Skip to content

Commit

Permalink
vimrc: restore position in previously opened file
Browse files Browse the repository at this point in the history
  • Loading branch information
ddvlad committed Feb 10, 2014
1 parent 3919e28 commit 3fb7fa0
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions _vimrc
Original file line number Diff line number Diff line change
Expand Up @@ -125,3 +125,16 @@ nnoremap <F6> :cn<CR>
" Align subsequent lines to open parantheses in C sources. Via andradaq.
set cinoptions=(0,W4

" Restore position inside previously opened file. From vim.wikia.
function! ResCur()
if line("'\"") <= line("$")
normal! g`"
return 1
endif
endfunction

augroup resCur
autocmd!
autocmd BufWinEnter * call ResCur()
augroup END

0 comments on commit 3fb7fa0

Please sign in to comment.