mirror of
https://github.com/pratiktri/dotfiles.git
synced 2026-02-04 16:41:43 +05:30
refactor(neovim): Convert file-autocmd to after-ftplugin
- Markdown, gitcommit, text: `lua/shared/text_settings.lua` - Javascript, Typescript, React, Vue: `lua/shared/javascript_settings.lua` - `after/ftplugin` files that `require` the above 2 shared configs
This commit is contained in:
24
common/.config/nvim/lua/shared/javascript_settings.lua
Normal file
24
common/.config/nvim/lua/shared/javascript_settings.lua
Normal file
@@ -0,0 +1,24 @@
|
||||
local M = {}
|
||||
|
||||
function M.setup()
|
||||
vim.keymap.set({ "n", "v" }, "<leader>co", function()
|
||||
vim.lsp.buf.code_action({
|
||||
apply = true,
|
||||
context = {
|
||||
only = { "source.organizeimports.ts" },
|
||||
diagnostics = {},
|
||||
},
|
||||
})
|
||||
end, { desc = "Typescript: organize imports" })
|
||||
vim.keymap.set({ "n", "v" }, "<leader>co", function()
|
||||
vim.lsp.buf.code_action({
|
||||
apply = true,
|
||||
context = {
|
||||
only = { "source.removeunused.ts" },
|
||||
diagnostics = {},
|
||||
},
|
||||
})
|
||||
end, { desc = "Typescript: remove unused imports" })
|
||||
end
|
||||
|
||||
return M
|
||||
Reference in New Issue
Block a user