Easier controls with nvim

This commit is contained in:
Thomas Forgione 2025-05-08 17:20:06 +02:00
parent f5c758741e
commit 897c3a7057

View File

@ -95,6 +95,7 @@ vim.diagnostic.config {
}
}
-- Show diagnostics on hover
vim.api.nvim_create_autocmd({'CursorHold'}, {
pattern = {'*'},
@ -104,12 +105,20 @@ vim.api.nvim_create_autocmd({'CursorHold'}, {
})
-- Shortcuts for mapping shortcuts
local map = function(type, key, value)
vim.api.nvim_buf_set_keymap(0, type, key, value, { noremap = true, silent = true });
end
vim.keymap.set('i', '<Tab>', function()
if vim.fn.pumvisible() == 1 then
return '<C-n>'
else
return '<Tab>'
end
end, { silent = true, expr = true })
vim.api.nvim_create_autocmd("LspAttach", {
callback = function(args)
local client = vim.lsp.get_client_by_id(args.data.client_id)