mirror of
https://github.com/LukeSmithxyz/voidrice.git
synced 2026-03-20 01:37:45 +01:00
Resets cursor position on file save (Issue #1040)
This commit is contained in:
parent
ed9a67ed6d
commit
da0a2b3ae0
@ -111,10 +111,12 @@ set noshowcmd
|
|||||||
autocmd BufRead,BufNewFile /tmp/neomutt* map ZZ :Goyo\|x!<CR>
|
autocmd BufRead,BufNewFile /tmp/neomutt* map ZZ :Goyo\|x!<CR>
|
||||||
autocmd BufRead,BufNewFile /tmp/neomutt* map ZQ :Goyo\|q!<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 lineNumb = line('.')
|
||||||
autocmd BufWritePre * %s/\s\+$//e
|
autocmd BufWritePre * %s/\s\+$//e
|
||||||
autocmd BufWritePre * %s/\n\+\%$//e
|
autocmd BufWritePre * %s/\n\+\%$//e
|
||||||
autocmd BufWritePre *.[ch] %s/\%$/\r/e
|
autocmd BufWritePre *.[ch] %s/\%$/\r/e
|
||||||
|
autocmd BufWritePre * cal cursor(lineNumb,0)
|
||||||
|
|
||||||
" When shortcut files are updated, renew bash and ranger configs with new material:
|
" When shortcut files are updated, renew bash and ranger configs with new material:
|
||||||
autocmd BufWritePost bm-files,bm-dirs !shortcuts
|
autocmd BufWritePost bm-files,bm-dirs !shortcuts
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user