chore(home-manager): put neovim plugins configuration in a separate directory

This commit is contained in:
Yorick Barbanneau 2025-04-18 00:47:14 +02:00
parent a8c87655ac
commit d9aecb3e19
No known key found for this signature in database
GPG key ID: 4447A19BBEDB8DBA
16 changed files with 13 additions and 84 deletions

View file

@ -1,7 +0,0 @@
require('lsp_lines').setup()
vim.diagnostic.config({ virtual_lines = true })
-- Disable virtual_text since it's redundant due to lsp_lines.
vim.diagnostic.config({
virtual_text = false,
})

View file

@ -1,64 +0,0 @@
local lspconfig = require('lspconfig')
local capabilities = require("cmp_nvim_lsp").default_capabilities()
require("yaml-companion").open_ui_select()
lspconfig.clangd.setup {
capabilities = capabilities,
}
lspconfig.eslint.setup{
capabilities = capabilities,
}
-- YAML configuration (quite big!)
vim.api.nvim_create_autocmd('LspAttach', {
desc = 'LSP actions',
callback = function(ev)
local bufmap = function(mode, lhs, rhs)
local opts = {buffer = true}
vim.keymap.set(mode, lhs, rhs, opts)
end
-- Displays hover information about the symbol under the cursor
bufmap('n', 'K', '<cmd>lua vim.lsp.buf.hover()<cr>')
-- Jump to the definition
bufmap('n', 'gd', '<cmd>lua vim.lsp.buf.definition()<cr>')
-- Jump to declaration
bufmap('n', 'gD', '<cmd>lua vim.lsp.buf.declaration()<cr>')
-- Lists all the implementations for the symbol under the cursor
bufmap('n', 'gi', '<cmd>lua vim.lsp.buf.implementation()<cr>')
-- Jumps to the definition of the type symbol
bufmap('n', 'go', '<cmd>lua vim.lsp.buf.type_definition()<cr>')
-- Lists all the references
bufmap('n', 'gr', '<cmd>lua vim.lsp.buf.references()<cr>')
-- Displays a function's signature information
bufmap('n', 'gs', '<cmd>lua vim.lsp.buf.signature_help()<cr>')
-- Renames all references to the symbol under the cursor
bufmap('n', '<F2>', '<cmd>lua vim.lsp.buf.rename()<cr>')
-- Selects a code action available at the current cursor position
bufmap('n', '<F4>', '<cmd>lua vim.lsp.buf.code_action()<cr>')
bufmap('x', '<F4>', '<cmd>lua vim.lsp.buf.range_code_action()<cr>')
-- Show diagnostics in a floating window
bufmap('n', 'gl', '<cmd>lua vim.diagnostic.open_float()<cr>')
-- Move to the previous diagnostic
bufmap('n', '[d', '<cmd>lua vim.diagnostic.goto_prev()<cr>')
-- Move to the next diagnostic
bufmap('n', ']d', '<cmd>lua vim.diagnostic.goto_next()<cr>')
local client = vim.lsp.get_client_by_id(ev.data.client_id)
if client and (client.name == "yamlls" or client.name == "helm_ls") then
bufmap ('n', '<F3>', '<cmd>lua require("yaml-companion").open_ui_select()<cr>')
end
end
})