aboutsummaryrefslogtreecommitdiff
path: root/lua/lsp.lua
blob: c0a8d6698202cc8e514c7665777e093e49568b86 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
require('mason').setup()
--require('mason-lspconfig').setup()
local lspconfig = require('lspconfig')
lspconfig.pyright.setup {}
lspconfig.clangd.setup{
    capabilities = { offsetEncoding = 'utf-8' }, -- = capabilities
}
lspconfig.zls.setup {}
lspconfig.lua_ls.setup {
  settings = {
    Lua = {
      diagnostics = {
        disable = {"lowercase-global", "trailing-space", "unused-local"}
      }
    }
  }
}
lspconfig.solargraph.setup {}
lspconfig.tsserver.setup {}
lspconfig.csharp_ls.setup {}
--[[
require('clangd_extensions').setup{
	server = {
	  capabilities = { offsetEncoding = 'utf-8' }, -- = capabilities	
	},
	extensions = {
		inlay_hints = {
			show_parameter_hints = false,
		},
	},
}
--]]
local null_ls = require('null-ls')
null_ls.setup({
    sources = {
        --null_ls.builtins.formatting.stylua,
        --null_ls.builtins.diagnostics.eslint,
        --null_ls.builtins.completion.spell,
				--null_ls.builtins.diagnostics.codespell,
   			--null_ls.builtins.diagnostics.clang_check, 
		},
})

require('illuminate').configure({ 
    providers = {
        'lsp',
        'treesitter',
        'regex',
    }, 
    delay = 100,
    filetype_overrides = {}, 
    filetypes_denylist = {
        'dirvish',
        'fugitive',
    },
    filetypes_allowlist = {}, 
    modes_denylist = {},
    modes_allowlist = {},
    providers_regex_syntax_denylist = {},
    providers_regex_syntax_allowlist = {},
    under_cursor = true,
    large_file_cutoff = nil,
    large_file_overrides = nil,
    min_count_to_highlight = 1,
})

require'nvim-treesitter.configs'.setup {
  -- A list of parser names, or "all" (the five listed parsers should always be installed)
  ensure_installed = { 'c', 'lua', 'cpp', 'python', 'java', 'javascript', 'ruby'},
 
  sync_install = false,

  auto_install = true,
	
	highlight = {
    enable = true,

   	disable = function(lang, buf)
        local max_filesize = 100 * 1024 -- 100 KB
        local ok, stats = pcall(vim.loop.fs_stat, vim.api.nvim_buf_get_name(buf))
        if ok and stats and stats.size > max_filesize then
            return true
        end
    end,
  	additional_vim_regex_highlighting = false,
  
	},
	rainbow = {
		enable = true,
		extented_mod = true,
		colors = {
  		'#74d7ec', '#96cde2', '#b9c3d9', '#dcb9d0', '#ffafc7', '#ffafc7', '#fec1d2', '#fdd4de', '#fce6e9', '#fbf9f5', '#fbf9f5', '#fce8ea', '#fdd7e0', '#fec6d5', '#ffb5cb', '#ffb5cb', '#dcbdd2', '#b9c5da', '#96cde2', '#73d5ea'
		},
	},
}
local cmp = require'cmp'

  cmp.setup({
		--[[
		sorting = {
			comparators = {
				require('clangd_extensions.cmp_scores'),
			},
		},
		--]]
		snippet = { 
      expand = function(args)
        vim.fn['vsnip#anonymous'](args.body) -- For `vsnip` users.
        -- require('luasnip').lsp_expand(args.body) -- For `luasnip` users.
        -- require('snippy').expand_snippet(args.body) -- For `snippy` users.
        -- vim.fn["UltiSnips#Anon"](args.body) -- For `ultisnips` users.
      end,
    },
    window = {
      -- completion = cmp.config.window.bordered(),
      -- documentation = cmp.config.window.bordered(),
    },
    mapping = cmp.mapping.preset.insert({
      ['<C-b>'] = cmp.mapping.scroll_docs(-4),
      ['<C-f>'] = cmp.mapping.scroll_docs(4),
      ['<C-Space>'] = cmp.mapping.complete(),
      ['<C-e>'] = cmp.mapping.abort(),
      ['<CR>'] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
   		['<Tab>'] = cmp.mapping(cmp.mapping.select_next_item(), { 'i', 's' }), 
		}),
    sources = cmp.config.sources({
      { name = 'nvim_lsp' },
      { name = 'vsnip' }, -- For vsnip users.
      -- { name = 'luasnip' }, -- For luasnip users.
      -- { name = 'ultisnips' }, -- For ultisnips users.
      -- { name = 'snippy' }, -- For snippy users.
    }, {
      { name = 'buffer' },
    })
  })



require 'lsp_signature'.setup()