32 lines
750 B
Lua
32 lines
750 B
Lua
-- autocmd
|
|
|
|
-- Disable autocommenting on new lines under commented ones
|
|
|
|
vim.api.nvim_create_autocmd("Filetype", {
|
|
pattern = "*",
|
|
command = "setlocal formatoptions-=c formatoptions-=r formatoptions-=o"
|
|
})
|
|
|
|
-- persistent folds
|
|
vim.api.nvim_create_autocmd({"BufWinLeave"}, {
|
|
pattern = {"*.*"},
|
|
desc = "save view (folds), when closing file",
|
|
command = "mkview",
|
|
})
|
|
vim.api.nvim_create_autocmd({"BufWinEnter"}, {
|
|
pattern = {"*.*"},
|
|
desc = "load view (folds), when opening file",
|
|
command = "silent! loadview"
|
|
})
|
|
|
|
vim.api.nvim_create_autocmd("WinEnter", {
|
|
callback = function()
|
|
vim.wo.cursorline = true
|
|
end,
|
|
})
|
|
|
|
vim.api.nvim_create_autocmd("WinLeave", {
|
|
callback = function()
|
|
vim.wo.cursorline = false
|
|
end,
|
|
})
|