You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
nvim-config/lua/user/autocmds.lua

25 lines
703 B

-- Embedded Vim Auto-command, that adds file cursor location persistance.
vim.cmd
[[
augroup line_return
au!
au BufReadPost *
\ if line("'\"") > 0 && line("'\"") <= line("$") |
\ execute 'normal! g`"zvzz' |
\ endif
augroup END
]]
-- Vertically center the buffer, each time I go into insert mode.
vim.cmd
[[
autocmd InsertEnter * norm zz
]]
-- Automatically save & re-fold Documents, when exiting & re-entering the file.
vim.cmd
[[
autocmd BufWinLeave *.* mkview " Auto-save Folds before leaving a buffer.
autocmd BufWinEnter *.* silent loadview " Auto-re-load saved folds.
]]