0

The first line returns the cursor to the line i was on, the second sources the resource file. both work on there own but will not work together. The marks set by Return cursor seem to still be set, can anyone explain what the correlation is between the two?

au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") 
    \ | exe "normal! g`\"" | endif

augroup myvimrc
    au!
    au BufWritePost .vimrc,_vimrc,vimrc,.gvimrc,_gvimrc,gvimrc so $MYVIMRC 
    \ | if has('gui_running') && filereadable($MYGVIMRC) 
    \ | so $MYGVIMRC | endif
augroup END
0

1 Answer 1

1

Vim's core code tries hard not to change or lose marks unless absolutely necessary, especially in situations that would "surprise" the user; sourcing your .vimrc is like sourcing any Vim script, which does not change mark locations--or unset them--unless there are explicit commands in the Vim script that would do so.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .