aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Chu2021-03-06 19:41:16 +0000
committerWolfgang Müller2021-03-17 17:38:29 +0100
commit4b8b35b71fc3ac0ac81e82bdffde048f2baca657 (patch)
treee07bba1407636bc701f0af6acba528adf2852cb2
parentf5db8a897f1eb01db88ee5579d7c5fff780afed0 (diff)
downloadvim-beancount-4b8b35b71fc3ac0ac81e82bdffde048f2baca657.tar.gz
Fix autocommand to use filetype and an autocommand group
-rw-r--r--ftdetect/beancount.vim12
1 files 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