rename command

This commit is contained in:
Ivan Dimitrov 2023-08-21 20:23:31 +03:00
parent 3ad738b6dd
commit 170e867faf
2 changed files with 5 additions and 1 deletions

View File

@ -4,6 +4,7 @@
enable = true;
keybindings = {
D = "delete";
R = "rename";
};
};
};

View File

@ -40,6 +40,7 @@ nmap("<leader>e", vim.diagnostic.open_float)
-- Format on CursorHold
local filetypes = { "*.ts", "*.tsx", "*.prisma", "*.js", "*.jsx", "*.html", "*.css", "*.json", "*.yaml", "*.lua" }
local async = require("plenary.async")
@ -50,7 +51,7 @@ end
local async_format = async.void(format_file)
vim.api.nvim_create_autocmd("CursorHold", {
callback = async_format,
pattern = { "*.*" }
pattern = filetypes
})
@ -87,11 +88,13 @@ local on_attach = function(client, bufnr)
callback = function()
vim.lsp.buf.document_highlight()
end,
pattern = filetypes
})
vim.api.nvim_create_autocmd("CursorMoved", {
callback = function()
vim.lsp.buf.clear_references()
end,
pattern = filetypes
})
end
cmp.setup({