aboutsummaryrefslogtreecommitdiffhomepage
path: root/.config/nvim/lua/vimrc/plugins.lua
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2023-07-17 00:28:05 +0900
committernsfisis <nsfisis@gmail.com>2023-08-19 22:29:39 +0900
commit182f8ab51baeda68c6892f4417de93326a335819 (patch)
tree7e1f5a2e7f99107cec153ab7d629a2233cfe1935 /.config/nvim/lua/vimrc/plugins.lua
parentcddffa79d48087a13965e3605dea667a6fd28801 (diff)
downloaddotfiles-182f8ab51baeda68c6892f4417de93326a335819.tar.gz
dotfiles-182f8ab51baeda68c6892f4417de93326a335819.tar.zst
dotfiles-182f8ab51baeda68c6892f4417de93326a335819.zip
neovim: install nvim-lspconfig
Diffstat (limited to '.config/nvim/lua/vimrc/plugins.lua')
-rw-r--r--.config/nvim/lua/vimrc/plugins.lua30
1 files changed, 29 insertions, 1 deletions
diff --git a/.config/nvim/lua/vimrc/plugins.lua b/.config/nvim/lua/vimrc/plugins.lua
index 544364c..61c62f2 100644
--- a/.config/nvim/lua/vimrc/plugins.lua
+++ b/.config/nvim/lua/vimrc/plugins.lua
@@ -683,10 +683,38 @@ return {
vim.g.yankround_use_region_hl = true
end,
},
- -- }}}
+ -- LSP {{{1
+ -- Collection of common LSP configurations.
+ {
+ 'neovim/nvim-lspconfig',
+ config = function()
+ local lspconfig = require('lspconfig')
+
+ if vim.fn.executable('typescript-language-server') == 1 then
+ lspconfig.tsserver.setup({})
+ end
+ if vim.fn.executable('gopls') == 1 then
+ lspconfig.gopls.setup({})
+ end
+
+ vim.api.nvim_create_autocmd('LspAttach', {
+ group = vim.api.nvim_create_augroup('UserLspConfig', {}),
+ callback = function(e)
+ vim.bo[e.buf].omnifunc = 'v:lua.vim.lsp.omnifunc'
+
+ local opts = { buffer = e.buf }
+ vim.keymap.set('n', 'K', vim.lsp.buf.hover, opts)
+ vim.keymap.set('n', '<space>f', function()
+ vim.lsp.buf.format({ async = true })
+ end, opts)
+ end,
+ })
+ end,
+ },
-- *Magic* {{{1
-- Integration with GitHub Copilot (https://docs.github.com/en/copilot)
{
'github/copilot.vim',
},
+ -- }}}
}