use fresh vim.api autocmds
This commit is contained in:
@@ -1,3 +1,9 @@
|
|||||||
vim.cmd([[
|
local group = vim.api.nvim_create_augroup("RootGroup", { clear = true })
|
||||||
au TextYankPost * silent! lua vim.highlight.on_yank({timeout = 200})
|
|
||||||
]])
|
vim.api.nvim_create_autocmd("TextYankPost", {
|
||||||
|
pattern = "*",
|
||||||
|
group = group,
|
||||||
|
callback = function()
|
||||||
|
vim.highlight.on_yank({ timeout = 200 })
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|||||||
@@ -44,17 +44,22 @@ null_ls.setup({
|
|||||||
formatting.shfmt,
|
formatting.shfmt,
|
||||||
},
|
},
|
||||||
on_attach = function()
|
on_attach = function()
|
||||||
vim.cmd([[
|
local group = vim.api.nvim_create_augroup("NullLsLspFormatting", { clear = true })
|
||||||
augroup LspFormatting
|
vim.api.nvim_create_autocmd("BufWritePre", {
|
||||||
autocmd! * <buffer>
|
pattern = "*",
|
||||||
autocmd BufWritePre <buffer> lua vim.lsp.buf.formatting_sync()
|
group = group,
|
||||||
augroup END
|
callback = vim.lsp.buf.formatting_sync,
|
||||||
]])
|
})
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
-- Other formats that work weird with null_ls
|
-- Other formats that work weird with null_ls
|
||||||
vim.cmd([[autocmd BufWritePre *.svelte lua vim.lsp.buf.formatting_sync(nil, 1000)]])
|
local group = vim.api.nvim_create_augroup("OtherLspFormatting", { clear = true })
|
||||||
|
vim.api.nvim_create_autocmd("BufWritePre", {
|
||||||
|
pattern = { "*.svelte" },
|
||||||
|
group = group,
|
||||||
|
callback = vim.lsp.buf.formatting_sync,
|
||||||
|
})
|
||||||
|
|
||||||
local completion_trigger = "<C-space>"
|
local completion_trigger = "<C-space>"
|
||||||
if vim.fn.has("win32") == 1 then
|
if vim.fn.has("win32") == 1 then
|
||||||
|
|||||||
Reference in New Issue
Block a user