From e7228660f0b317d733468d354162365f53653ff8 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 f81f3e13..bfe89f43 100644 --- a/vimrcs/basic.vim +++ b/vimrcs/basic.vim @@ -429,3 +429,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