From 4b8b35b71fc3ac0ac81e82bdffde048f2baca657 Mon Sep 17 00:00:00 2001 From: Jason Chu Date: Sat, 6 Mar 2021 19:41:16 +0000 Subject: Fix autocommand to use filetype and an autocommand group --- ftdetect/beancount.vim | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/ftdetect/beancount.vim b/ftdetect/beancount.vim index bf0556d..a808164 100644 --- a/ftdetect/beancount.vim +++ b/ftdetect/beancount.vim @@ -1,8 +1,4 @@ -" This is to avoid setting ft twice. Taken from vim-ruby. -function! s:setf(filetype) abort - if &filetype !=# a:filetype - let &filetype = a:filetype - endif -endfunction - -au BufNewFile,BufRead *.bean,*.beancount call s:setf('beancount') +augroup beancount + au! + au BufNewFile,BufRead *.bean,*.beancount setf beancount +augroup END -- cgit v1.2.3-2-gb3c3