I have an autocommand function in my
.vimrc that resets the cursor to where it was before I last closed the file. This function looks like this:
function! ResCur() if line("'\"") <= line("$") normal! g`" return 1 endif endfunction autocmd BufWinEnter * call ResCur()
I started using vim-template which recognizes a
%HERE% variable in the templates that sets the cursor location. My custom function overrides this capability. Is there a way to change my autocommand to only reset the cursor when a template is not loaded so the
%HERE% variable still works when a template is loaded? If part of the solution involves using a different template plugin, I would be happy to hear that as well.