From 53cef2f63570817841ac763e0e9fe4374e75d76c Mon Sep 17 00:00:00 2001 From: Daniel Gitelson Date: Thu, 22 Oct 2015 10:32:56 +0300 Subject: [PATCH] Enable jumping to the last position in file on open --- vimrcs/basic.vim | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/vimrcs/basic.vim b/vimrcs/basic.vim index c22d30bd..1649cb95 100644 --- a/vimrcs/basic.vim +++ b/vimrcs/basic.vim @@ -432,3 +432,8 @@ function! BufcloseCloseIt() execute("bdelete! ".l:currentBufNum) endif endfunction + +" Make VIM remember position in file after reopen +if has("autocmd") + au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif +endif