From c6e3829c621a533b0bb5f21a0047083937de2607 Mon Sep 17 00:00:00 2001 From: Jonathan Hodgson Date: Sat, 22 Apr 2017 09:55:25 +0100 Subject: [PATCH] Get to partly working state on my template autocmd It doesn't currently take me to the marker so I have stoped it deleting the first on load. It now takes me to the firt line and I have to push i to go to my first mark. --- .vimrc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.vimrc b/.vimrc index 472016c..e9225b9 100644 --- a/.vimrc +++ b/.vimrc @@ -82,9 +82,10 @@ function! NextMark() endfunction function! NewHtml() - execute "normal! :read ~/Templates/html" - execute "normal! ggdd" - call NextMark() + read ~/Templates/html + normal! ggdd + setlocal filetype=html + "call NextMark() endfunction " Mappings {{{1 @@ -182,7 +183,7 @@ augroup END " augroup new_html autocmd! - autocmd BufNew *.html call NewHtml() + autocmd BufNew,BufNewFile *.html call NewHtml() augroup END " augroup file_vim