cleanup and refactor autocmd
This commit is contained in:
@@ -18,12 +18,12 @@ autocmd('LspAttach', {
|
|||||||
vim.keymap.set("i", "<C-h>", function() vim.lsp.buf.signature_help() end, opts)
|
vim.keymap.set("i", "<C-h>", function() vim.lsp.buf.signature_help() end, opts)
|
||||||
vim.keymap.set("n", "[d", function() vim.diagnostic.goto_next() end, opts)
|
vim.keymap.set("n", "[d", function() vim.diagnostic.goto_next() end, opts)
|
||||||
vim.keymap.set("n", "]d", function() vim.diagnostic.goto_prev() end, opts)
|
vim.keymap.set("n", "]d", function() vim.diagnostic.goto_prev() end, opts)
|
||||||
vim.keymap.set("n", "<M-F>", "<cmd>lua vim.lsp.buf.format()<CR>")
|
vim.keymap.set("n", "<M-F>", function() vim.lsp.buf.format() end, opts)
|
||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
|
||||||
-- Add new line to the end of the file
|
-- Add new line to the end of the file
|
||||||
autocmd({ "BufWritePre" }, {
|
autocmd({ 'BufWritePre' }, {
|
||||||
group = OnSaveGroup,
|
group = OnSaveGroup,
|
||||||
pattern = '*',
|
pattern = '*',
|
||||||
callback = function()
|
callback = function()
|
||||||
@@ -37,7 +37,7 @@ autocmd({ "BufWritePre" }, {
|
|||||||
})
|
})
|
||||||
|
|
||||||
-- Remove trailing spaces
|
-- Remove trailing spaces
|
||||||
autocmd({ "BufWritePre" }, {
|
autocmd({ 'BufWritePre' }, {
|
||||||
group = OnSaveGroup,
|
group = OnSaveGroup,
|
||||||
pattern = { "*" },
|
pattern = { "*" },
|
||||||
callback = function()
|
callback = function()
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
require("crentist.remap")
|
require("crentist.remap")
|
||||||
require("crentist.set")
|
require("crentist.set")
|
||||||
require("crentist.autocmd")
|
|
||||||
require("crentist.lazy_init")
|
require("crentist.lazy_init")
|
||||||
|
require("crentist.autocmd")
|
||||||
require("crentist.filetype")
|
require("crentist.filetype")
|
||||||
require("crentist.luasnip")
|
require("crentist.luasnip")
|
||||||
require("crentist.null-ls")
|
require("crentist.null-ls")
|
||||||
|
|||||||
Reference in New Issue
Block a user