Migrate to Neovim internal LSP configuration

This commit is contained in:
Michael Yockey
2025-09-30 09:29:08 -04:00
parent 9aaf58322f
commit 89294e8b2f
9 changed files with 130 additions and 103 deletions

View File

@@ -1,37 +1,36 @@
{
"FixCursorHold.nvim": { "branch": "master", "commit": "1900f89dc17c603eec29960f57c00bd9ae696495" },
"auto-dark-mode.nvim": { "branch": "master", "commit": "97a86c9402c784a254e5465ca2c51481eea310e3" },
"blink.cmp": { "branch": "main", "commit": "3536ce464e82843b00c76718d9bfe1994647d686" },
"auto-dark-mode.nvim": { "branch": "master", "commit": "e300259ec777a40b4b9e3c8e6ade203e78d15881" },
"blink.cmp": { "branch": "main", "commit": "327fff91fe6af358e990be7be1ec8b78037d2138" },
"cloak.nvim": { "branch": "main", "commit": "648aca6d33ec011dc3166e7af3b38820d01a71e4" },
"direnv.vim": { "branch": "master", "commit": "ab2a7e08dd630060cd81d7946739ac7442a4f269" },
"friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" },
"git-blame.nvim": { "branch": "master", "commit": "8503b199edf9a666fe7b1a989cf14e3c26b2eb03" },
"git-blame.nvim": { "branch": "master", "commit": "9874ec1ec8bc53beb33b7cd82c092b85271a578b" },
"gitmoji.nvim": { "branch": "main", "commit": "2659de229c2b26d50732f1220700eebbcdb2d6ef" },
"harpoon": { "branch": "harpoon2", "commit": "ed1f853847ffd04b2b61c314865665e1dadf22c7" },
"lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" },
"lazygit.nvim": { "branch": "main", "commit": "4839ab642962cc76bb1bf278427dc4c59be15072" },
"lualine.nvim": { "branch": "master", "commit": "a94fc68960665e54408fe37dcf573193c4ce82c9" },
"lazygit.nvim": { "branch": "main", "commit": "2305deed25bc61b866d5d39189e9105a45cf1cfb" },
"lualine.nvim": { "branch": "master", "commit": "b8c23159c0161f4b89196f74ee3a6d02cdc3a955" },
"markdown-preview.nvim": { "branch": "master", "commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee" },
"neotest": { "branch": "master", "commit": "61d1951131e6770c815243d84a27ccd0436ec61c" },
"neotest-rspec": { "branch": "main", "commit": "825bc085b7a691860d5cafc5fa7ab140c713e6c8" },
"neotest": { "branch": "master", "commit": "2cf3544fb55cdd428a9a1b7154aea9c9823426e8" },
"neotest-rspec": { "branch": "main", "commit": "e7dc67c1167a9e593c804a6be6808ba9a5920d43" },
"nvim-colorizer.lua": { "branch": "master", "commit": "a065833f35a3a7cc3ef137ac88b5381da2ba302e" },
"nvim-dap": { "branch": "master", "commit": "cc77338e6e34c79f1c638f51ae4160dc9bfb05de" },
"nvim-dap": { "branch": "master", "commit": "7367cec8e8f7a0b1e4566af9a7ef5959d11206a7" },
"nvim-dap-ruby": { "branch": "main", "commit": "ba36f9905ca9c6d89e5af5467a52fceeb2bbbf6d" },
"nvim-dap-ui": { "branch": "master", "commit": "cf91d5e2d07c72903d052f5207511bf7ecdb7122" },
"nvim-lspconfig": { "branch": "master", "commit": "8c5efd1269160fc2fdf61e3d7176be5015860a8f" },
"nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" },
"nvim-surround": { "branch": "main", "commit": "8dd9150ca7eae5683660ea20cec86edcd5ca4046" },
"nvim-surround": { "branch": "main", "commit": "75de1782c781961e392efcca57601bf436f4d550" },
"nvim-tmux-navigation": { "branch": "main", "commit": "4898c98702954439233fdaf764c39636681e2861" },
"nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" },
"nvim-treesitter-endwise": { "branch": "master", "commit": "d6cbb83307d516ec076d17c9a33d704ef626ee8c" },
"nvim-web-devicons": { "branch": "master", "commit": "0422a19d9aa3aad2c7e5cca167e5407b13407a9d" },
"oil.nvim": { "branch": "master", "commit": "bbad9a76b2617ce1221d49619e4e4b659b3c61fc" },
"plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" },
"nvim-treesitter-endwise": { "branch": "master", "commit": "a61a9de7965324d4019fb1637b66bfacdcb01f51" },
"nvim-web-devicons": { "branch": "master", "commit": "f6b0920f452bfd7595ee9a9efe5e1ae78e0e2997" },
"oil.nvim": { "branch": "master", "commit": "919e155fdf38e9148cdb5304faaaf53c20d703ea" },
"plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" },
"telescope-fzf-native.nvim": { "branch": "main", "commit": "1f08ed60cafc8f6168b72b80be2b2ea149813e55" },
"telescope.nvim": { "branch": "master", "commit": "b4da76be54691e854d3e0e02c36b0245f945c2c7" },
"todo-comments.nvim": { "branch": "main", "commit": "304a8d204ee787d2544d8bc23cd38d2f929e7cc5" },
"trouble.nvim": { "branch": "main", "commit": "85bedb7eb7fa331a2ccbecb9202d8abba64d37b3" },
"undotree": { "branch": "master", "commit": "28f2f54a34baff90ea6f4a735ef1813ad875c743" },
"trouble.nvim": { "branch": "main", "commit": "f176232e7759c4f8abd923c21e3e5a5c76cd6837" },
"undotree": { "branch": "master", "commit": "fe9a9d0645f0f5532360b5e5f5c550d7bb4f1869" },
"vim-doge": { "branch": "master", "commit": "03a84072ef21b205237c77986c78914395d646c3" },
"which-key.nvim": { "branch": "main", "commit": "370ec46f710e058c9c1646273e6b225acf47cbed" }
"which-key.nvim": { "branch": "main", "commit": "904308e6885bbb7b60714c80ab3daf0c071c1492" }
}

View File

@@ -0,0 +1,5 @@
return {
cmd = { 'ngserver', '--stdio', '--tsProbeLocations', vim.fn.getcwd(), '--ngProbeLocations', vim.fn.getcwd() },
filetypes = { 'typescript', 'html' },
}

View File

@@ -0,0 +1,13 @@
return {
cmd = { 'emmet-language-server', '--stdio' },
filetypes = {
'html',
'eruby',
'css',
'scss',
'sass',
'javascript',
'typescript',
},
root_markers = { 'package.json', 'Gemfile', '.git' }
}

View File

@@ -0,0 +1,20 @@
return {
cmd = { 'lua-language-server' },
filetypes = { 'lua' },
root_markers = { '.luarc.json', '.luarc.jsonc' },
settings = {
Lua = {
runtime = { version = 'LuaJIT' },
diagnostics = {
globals = {
'vim',
'require',
'out',
's',
'c',
't',
}
}
},
}
}

View File

@@ -0,0 +1,13 @@
return {
cmd = { 'ruby-lsp' },
filetypes = { 'ruby', 'eruby' },
init_options = {
linters = { 'rubocop' },
formatters = {},
addonSettings = {
['Ruby LSP Rails'] = {
enablePendingMigrationsPrompt = false,
}
}
}
}

View File

@@ -0,0 +1,6 @@
return {
cmd = { 'typescript-language-server', '--stdio' },
filetypes = { 'typescript' },
}

View File

@@ -1,3 +1,4 @@
require('yock.lazy')
require('yock.set')
require('yock.remap')
require('yock.lsp')

View File

@@ -0,0 +1,56 @@
vim.lsp.enable('lua_ls')
vim.lsp.enable('ruby_lsp')
vim.lsp.enable('emmet')
vim.lsp.enable('ts_ls')
vim.lsp.enable('angularls')
--vim.lsp.enable('pylsp')
--vim.lsp.enable('ols')
--vim.lsp.enable('gopls')
--vim.lsp.enable('sqlls')
vim.api.nvim_create_autocmd('LspAttach', {
callback = function(ev)
local client = vim.lsp.get_client_by_id(ev.data.client_id)
if client:supports_method('textDocument/completion') then
vim.opt.completeopt = { 'menu', 'menuone', 'noinsert', 'fuzzy', 'popup' }
vim.lsp.completion.enable(true, client.id, ev.buf, { autotrigger = true })
vim.keymap.set('i', '<C-Space>', function()
vim.lsp.completion.get()
end)
end
end
})
local function filteredQuickfix()
vim.lsp.buf.code_action({
context = { only = { 'quickfix' } },
apply = true,
filter = function(codeAction)
return codeAction.isPreferred
end
})
end
vim.api.nvim_create_autocmd('LspAttach', {
group = vim.api.nvim_create_augroup('UserLspConfig', {}),
callback = function(ev)
-- Enable completion triggered by <c-x><c-o>
vim.bo[ev.buf].omnifunc = 'v:lua.vim.lsp.omnifunc'
local opts = { remap = false }
vim.keymap.set('n', 'K', function() vim.lsp.buf.hover() end, opts)
vim.keymap.set('n', '<leader>vws', function() vim.lsp.buf.workspace_symbol() end, opts)
vim.keymap.set('n', '<leader>vd', function() vim.diagnostic.open_float() end, opts)
vim.keymap.set('n', '[d', function() vim.diagnostic.goto_next() end, opts)
vim.keymap.set('n', ']d', function() vim.diagnostic.goto_prev() end, opts)
vim.keymap.set('n', '<leader>vca', function() vim.lsp.buf.code_action() end, opts)
vim.keymap.set('n', '<C-f>', filteredQuickfix, opts)
vim.keymap.set('n', '<leader>vrr', function() vim.lsp.buf.references() end, opts)
vim.keymap.set('n', '<leader>vrn', function() vim.lsp.buf.rename() end, opts)
vim.keymap.set('n', '<leader>vrh', function() vim.lsp.buf.signature_help() end, opts)
end,
})
vim.diagnostic.config({
virtual_lines = true
})

View File

@@ -1,86 +0,0 @@
return {
'neovim/nvim-lspconfig',
dependencies = {
'saghen/blink.cmp',
},
config = function()
local lspconfig = require('lspconfig')
local lsp_capabilities = vim.lsp.protocol.make_client_capabilities()
local capabilities = require('blink.cmp').get_lsp_capabilities(lsp_capabilities)
lspconfig.pylsp.setup({ capabilities = capabilities })
lspconfig.ts_ls.setup({ capabilities = capabilities })
lspconfig.ruby_lsp.setup({ capabilities = capabilities })
lspconfig.angularls.setup({ capabilities = capabilities })
lspconfig.ols.setup({
capabilities = capabilities,
init_options = {
checker_args = "-strict-style"
},
})
lspconfig.emmet_ls.setup({
capabilities = capabilities,
filetypes = {
'html',
'eruby',
'css',
'scss',
'sass',
'javascript',
'typescript',
},
})
lspconfig.lua_ls.setup({
capabilities = capabilities,
settings = {
Lua = {
diagnostics = {
globals = {
'vim',
'require',
'out',
's',
'c',
't',
}
}
}
}
})
lspconfig.gopls.setup({ capabilities = capabilities })
lspconfig.rust_analyzer.setup({ capabilities = capabilities })
lspconfig.sourcekit.setup({ capabilities = capabilities })
lspconfig.sqlls.setup({ capabilities = capabilities })
local function filteredQuickfix()
vim.lsp.buf.code_action({
context = { only = { 'quickfix' } },
apply = true,
filter = function(codeAction)
return codeAction.isPreferred
end
})
end
vim.api.nvim_create_autocmd('LspAttach', {
group = vim.api.nvim_create_augroup('UserLspConfig', {}),
callback = function(ev)
local client = vim.lsp.get_client_by_id(ev.data.client_id)
-- Enable completion triggered by <c-x><c-o>
vim.bo[ev.buf].omnifunc = 'v:lua.vim.lsp.omnifunc'
local opts = { remap = false }
vim.keymap.set('n', 'K', function() vim.lsp.buf.hover() end, opts)
vim.keymap.set('n', '<leader>vws', function() vim.lsp.buf.workspace_symbol() end, opts)
vim.keymap.set('n', '<leader>vd', function() vim.diagnostic.open_float() end, opts)
vim.keymap.set('n', '[d', function() vim.diagnostic.goto_next() end, opts)
vim.keymap.set('n', ']d', function() vim.diagnostic.goto_prev() end, opts)
vim.keymap.set('n', '<leader>vca', function() vim.lsp.buf.code_action() end, opts)
vim.keymap.set('n', '<C-f>', filteredQuickfix, opts)
vim.keymap.set('n', '<leader>vrr', function() vim.lsp.buf.references() end, opts)
vim.keymap.set('n', '<leader>vrn', function() vim.lsp.buf.rename() end, opts)
vim.keymap.set('n', '<leader>vrh', function() vim.lsp.buf.signature_help() end, opts)
end,
})
end
}