I am looking to jump automatically to the last position in any file that I open.
I have in my ~/.vimrc file:
autocmd BufReadPost *
\ if line("'\"") > 0 && line("'\"") <= line("$") |
\ exe "normal! g`\"" |
\ endif
This works fine if I open a file using the vim
command.
But if I write vim .
in a directory to load netrw and use t
to open a file in a new tab, the cursor appears at the top of the file and not at the last position.
I then have to use `"
to jump to the last position.
Is there any way to jump to the last position when using netrw and t
?
Thanks.