Vimrc: remember position and return to it.

This commit is contained in:
David Tomaschik
2020-02-21 17:18:08 -08:00
parent e4f2cc94b5
commit 7d35ace5bb

View File

@@ -29,6 +29,20 @@ imap <S-Tab> <Esc><<A
set number
set ruler
" Setup viminfo for recording positions, etc.
set viminfo='10,\"100,:20,%,n~/.viminfo
" Jump back when editing a file
function! ResCur()
if line("'\"") <= line("$")
normal! g`"
return 1
endif
endfunction
augroup resCur
autocmd!
autocmd BufWinEnter * call ResCur()
augroup END
" File options
set encoding=utf-8
" Syntax highlighting, look and feel