Conditionally include lsp
This commit is contained in:
parent
672c44d96a
commit
81cd9a6c79
37
lua/lsp.lua
37
lua/lsp.lua
@ -8,21 +8,30 @@ local capabilities = cmp_nvim_lsp.default_capabilities({snippetSupport = false})
|
||||
|
||||
-- nvim-lspconfig
|
||||
local nvim_lspconfig = require('lspconfig')
|
||||
nvim_lspconfig.clangd.setup({capabilities = capabilities})
|
||||
nvim_lspconfig.gopls.setup({capabilities = capabilities})
|
||||
nvim_lspconfig.jedi_language_server.setup({capabilities = capabilities})
|
||||
nvim_lspconfig.rust_analyzer.setup({capabilities = capabilities})
|
||||
nvim_lspconfig.tsserver.setup({capabilities = capabilities})
|
||||
nvim_lspconfig.sumneko_lua.setup({
|
||||
settings = {
|
||||
Lua = {
|
||||
diagnostics = {globals = {'vim'}},
|
||||
runtime = {version = 'LuaJIT'},
|
||||
telemetry = {enable = false},
|
||||
workspace = {library = vim.api.nvim_get_runtime_file('', true)},
|
||||
if vim.fn.executable('clangd') then
|
||||
nvim_lspconfig.clangd.setup({capabilities = capabilities})
|
||||
end
|
||||
if vim.fn.executable('gopls') then
|
||||
nvim_lspconfig.gopls.setup({capabilities = capabilities})
|
||||
end
|
||||
if vim.fn.executable('jedi-language-server') then
|
||||
nvim_lspconfig.jedi_language_server.setup({capabilities = capabilities})
|
||||
end
|
||||
if vim.fn.executable('typescript-language-server') then
|
||||
nvim_lspconfig.tsserver.setup({capabilities = capabilities})
|
||||
end
|
||||
if vim.fn.executable('lua-language-server') then
|
||||
nvim_lspconfig.sumneko_lua.setup({
|
||||
settings = {
|
||||
Lua = {
|
||||
diagnostics = {globals = {'vim'}},
|
||||
runtime = {version = 'LuaJIT'},
|
||||
telemetry = {enable = false},
|
||||
workspace = {library = vim.api.nvim_get_runtime_file('', true)},
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
})
|
||||
end
|
||||
|
||||
vim.keymap.set('n', '<C-k>', vim.lsp.buf.signature_help)
|
||||
vim.keymap.set('n', '<space>D', vim.lsp.buf.type_definition)
|
||||
|
@ -1,26 +1,28 @@
|
||||
-- fzf.vim
|
||||
vim.g['$FZF_DEFAULT_COMMAND'] = 'ag --hidden --ignore .git -f -g "" 2> /dev/null'
|
||||
if vim.fn.executable('fzf') then
|
||||
vim.g['$FZF_DEFAULT_COMMAND'] = 'ag --hidden --ignore .git -f -g "" 2> /dev/null'
|
||||
|
||||
vim.keymap.set('n', '<leader>fg', vim.cmd.GFiles)
|
||||
vim.keymap.set('n', '<leader>fh', vim.cmd.History)
|
||||
vim.keymap.set('n', '<leader>fb', vim.cmd.Buffers)
|
||||
vim.keymap.set('n', '<leader>fl', vim.cmd.Lines)
|
||||
vim.keymap.set('n', '<leader>fg', vim.cmd.GFiles)
|
||||
vim.keymap.set('n', '<leader>fh', vim.cmd.History)
|
||||
vim.keymap.set('n', '<leader>fb', vim.cmd.Buffers)
|
||||
vim.keymap.set('n', '<leader>fl', vim.cmd.Lines)
|
||||
|
||||
vim.g.fzf_colors = {
|
||||
['bg'] = {'bg', 'Normal'},
|
||||
['bg+'] = {'bg', 'CursorLine', 'CursorColumn'},
|
||||
['border'] = {'fg', 'Ignore'},
|
||||
['fg'] = {'fg', 'Normal'},
|
||||
['fg+'] = {'fg', 'CursorLine', 'CursorColumn', 'Normal'},
|
||||
['header'] = {'fg', 'Comment'},
|
||||
['hl'] = {'fg', 'Comment'},
|
||||
['hl+'] = {'fg', 'Statement'},
|
||||
['info'] = {'fg', 'PreProc'},
|
||||
['marker'] = {'fg', 'Keyword'},
|
||||
['pointer'] = {'fg', 'Exception'},
|
||||
['prompt'] = {'fg', 'Conditional'},
|
||||
['spinner'] = {'fg', 'Label'},
|
||||
}
|
||||
vim.g.fzf_colors = {
|
||||
['bg'] = {'bg', 'Normal'},
|
||||
['bg+'] = {'bg', 'CursorLine', 'CursorColumn'},
|
||||
['border'] = {'fg', 'Ignore'},
|
||||
['fg'] = {'fg', 'Normal'},
|
||||
['fg+'] = {'fg', 'CursorLine', 'CursorColumn', 'Normal'},
|
||||
['header'] = {'fg', 'Comment'},
|
||||
['hl'] = {'fg', 'Comment'},
|
||||
['hl+'] = {'fg', 'Statement'},
|
||||
['info'] = {'fg', 'PreProc'},
|
||||
['marker'] = {'fg', 'Keyword'},
|
||||
['pointer'] = {'fg', 'Exception'},
|
||||
['prompt'] = {'fg', 'Conditional'},
|
||||
['spinner'] = {'fg', 'Label'},
|
||||
}
|
||||
end
|
||||
|
||||
-- hflip.nvim
|
||||
vim.keymap.set('n', 'gfs', vim.cmd.HFlip)
|
||||
|
Loading…
Reference in New Issue
Block a user