summaryrefslogtreecommitdiffstats
path: root/.config/nvim
diff options
context:
space:
mode:
authorLuke Smith <luke@lukesmith.xyz>2021-12-21 13:03:50 -0500
committerLuke Smith <luke@lukesmith.xyz>2021-12-21 13:03:50 -0500
commit5f3576da169c7dc15dfb7e7d6e2f71db27583354 (patch)
tree4daac26ac7ca2b3d7774b82aecd40e52391cb40a /.config/nvim
parent58e1952ce22b364fc21763cc52e7a1418607db99 (diff)
parenta01c9f967b8801b9917be0f270f1cf9b9655e770 (diff)
downloadeibhear-5f3576da169c7dc15dfb7e7d6e2f71db27583354.tar.gz
eibhear-5f3576da169c7dc15dfb7e7d6e2f71db27583354.tar.zst
eibhear-5f3576da169c7dc15dfb7e7d6e2f71db27583354.zip
Merge branch 'master' of github.com:LukeSmithxyz/voidrice
Diffstat (limited to '.config/nvim')
-rw-r--r--.config/nvim/init.vim4
1 files changed, 3 insertions, 1 deletions
diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim
index f93eed4..e32b8eb 100644
--- a/.config/nvim/init.vim
+++ b/.config/nvim/init.vim
@@ -111,10 +111,12 @@ set noshowcmd
autocmd BufRead,BufNewFile /tmp/neomutt* map ZZ :Goyo\|x!<CR>
autocmd BufRead,BufNewFile /tmp/neomutt* map ZQ :Goyo\|q!<CR>
-" Automatically deletes all trailing whitespace and newlines at end of file on save.
+" Automatically deletes all trailing whitespace and newlines at end of file on save. & reset cursor position
+ autocmd BufWritePre * let currPos = getpos(".")
autocmd BufWritePre * %s/\s\+$//e
autocmd BufWritePre * %s/\n\+\%$//e
autocmd BufWritePre *.[ch] %s/\%$/\r/e
+ autocmd BufWritePre * cal cursor(currPos[1], currPos[2])
" When shortcut files are updated, renew bash and ranger configs with new material:
autocmd BufWritePost bm-files,bm-dirs !shortcuts