misc clean

This commit is contained in:
siduck 2024-02-27 12:31:36 +05:30
parent a5fc21b4f1
commit afd8870358
5 changed files with 93 additions and 129 deletions

View file

@ -75,10 +75,12 @@ local options = {
["<C-f>"] = cmp.mapping.scroll_docs(4),
["<C-Space>"] = cmp.mapping.complete(),
["<C-e>"] = cmp.mapping.close(),
["<CR>"] = cmp.mapping.confirm {
behavior = cmp.ConfirmBehavior.Insert,
select = true,
},
["<Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_next_item()
@ -87,10 +89,8 @@ local options = {
else
fallback()
end
end, {
"i",
"s",
}),
end, { "i", "s" }),
["<S-Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_prev_item()
@ -99,10 +99,7 @@ local options = {
else
fallback()
end
end, {
"i",
"s",
}),
end, { "i", "s" }),
},
sources = {
{ name = "nvim_lsp" },

View file

@ -31,7 +31,11 @@ M.on_attach = function(client, bufnr)
end, opts "List workspace folders | lsp")
map("n", "<leader>D", vim.lsp.buf.type_definition, opts "Go to type definition | lsp")
map("n", "<leader>rn", vim.lsp.buf.rename, opts "Rename symbol | lsp")
map("n", "<leader>ra", function()
require "nvchad.renamer"()
end, opts "NvRename symbol | lsp")
map({ "n", "v" }, "<leader>ca", vim.lsp.buf.code_action, opts "Code action | lsp")
map("n", "gr", vim.lsp.buf.references, opts "Show references | lsp")
end