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  endifendfunction                                                             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.
How do I keep custom cursor reset function from interfering with vim-template?
cursor movement;autocmd
Since this should only work for existing files, you'll want to use BufRead instead of BufWinEnter.  vim-template won't trigger BufRead.If you really need BufWinEnter to be used to process modelines before calling your function, you can use BufRead to set a buffer variable:autocmd BufRead * let b:not_new = 1And check if the variable exists before moving the cursor.