mirror of
https://github.com/adulau/dotfiles.git
synced 2024-12-22 08:46:01 +00:00
Cursor position stored in default vimrc
Additional function added to set the cursor to the known last position.
This commit is contained in:
parent
0131b0ff76
commit
03dc6bb5f2
1 changed files with 15 additions and 0 deletions
15
.vimrc
15
.vimrc
|
@ -35,3 +35,18 @@ if v:version >= 700
|
||||||
autocmd BufNewFile,BufRead COMMIT_EDITMSG setlocal spell spelllang=en
|
autocmd BufNewFile,BufRead COMMIT_EDITMSG setlocal spell spelllang=en
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
" store position (ctrl-o to recall)
|
||||||
|
set viminfo='10,\"100,:20,%,n~/.viminfo
|
||||||
|
" go to last position
|
||||||
|
function! ResCur()
|
||||||
|
if line("'\"") <= line("$")
|
||||||
|
normal! g`"
|
||||||
|
return 1
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
augroup resCur
|
||||||
|
autocmd!
|
||||||
|
autocmd BufWinEnter * call ResCur()
|
||||||
|
augroup END
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue