28122023
This commit is contained in:
parent
41adb9e23d
commit
7ace81f4f0
27 changed files with 784 additions and 1 deletions
23
linux/.config/nvim/lua/core/autocmds.lua
Normal file
23
linux/.config/nvim/lua/core/autocmds.lua
Normal file
|
@ -0,0 +1,23 @@
|
|||
-- auto-format on save
|
||||
local lsp_fmt_group = vim.api.nvim_create_augroup("LspFormattingGroup", {})
|
||||
vim.api.nvim_create_autocmd("BufWritePre", {
|
||||
group = lsp_fmt_group,
|
||||
callback = function()
|
||||
local efm = vim.lsp.get_active_clients({ name = "efm" })
|
||||
|
||||
if vim.tbl_isempty(efm) then
|
||||
return
|
||||
end
|
||||
|
||||
vim.lsp.buf.format({ name = "efm", async = true })
|
||||
end,
|
||||
})
|
||||
|
||||
-- highlight on yank
|
||||
local highlight_yank_group = vim.api.nvim_create_augroup("HighlightYankGroup", {})
|
||||
vim.api.nvim_create_autocmd("TextYankPost", {
|
||||
group = highlight_yank_group,
|
||||
callback = function()
|
||||
vim.highlight.on_yank()
|
||||
end,
|
||||
})
|
Loading…
Add table
Add a link
Reference in a new issue