farmergreg / vim-lastplace

A vim / nvim plugin that intelligently reopens files at your last edit position.
https://www.gregd.org/
MIT License
583 stars 28 forks source link

vim-lastplace does not work with templates #15

Closed scottchiefbaker closed 7 years ago

scottchiefbaker commented 7 years ago

I'm attempting to use a default template for new Perl files with this command:

autocmd BufNewFile *.pl 0r ~/.vim/perl/base_template.pl

I would like Vim to start the cursor on Line 11 of the template which is done like this:

autocmd BufNewFile *.pl 0r ~/.vim/perl/base_template.pl | 11

With vim-lastplace enabled when I create a new .pl file it loads the template but always puts the cursor on line 0. If I disable vim-lastplace then it starts on line 11.

farmergreg commented 7 years ago

@scottchiefbaker thanks for the bug report! I've pushed a fix - please try it out and let me know if it resolves the issue.

Thanks again for the bug report!

scottchiefbaker commented 7 years ago

Works for me! Thanks for the quick fix.