diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2017-10-30 14:34:19 +1300 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2017-10-30 14:34:19 +1300 |
commit | 71acc00c5b688cc42e3d13881d1c6c9436335066 (patch) | |
tree | 1d41dd2d07c16f0cf3fc4e35f12bba95044d8066 /vim/ftdetect/xdefaults.vim | |
parent | Use consistent long-line indent (diff) | |
download | dotfiles-71acc00c5b688cc42e3d13881d1c6c9436335066.tar.gz dotfiles-71acc00c5b688cc42e3d13881d1c6c9436335066.zip |
Use :setfiletype in lieu of :setlocal filetype=
Use this recommended syntax in the custom ftplugin settings.
Seems to be the recommended way to set filetype idempotently, and is
present even in very old Vim (6.2 tested).
From the Vim documentation for :setfiletype:
>Set the 'filetype' option to {filetype}, but only if not done yet in a
>sequence of (nested) autocommands. This is short for:
> :if !did_filetype()
> : setlocal filetype={filetype}
> :endif
>This command is used in a filetype.vim file to avoid setting the
>'filetype' option twice, causing different settings and syntax files to
>be loaded.
Diffstat (limited to 'vim/ftdetect/xdefaults.vim')
-rw-r--r-- | vim/ftdetect/xdefaults.vim | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/vim/ftdetect/xdefaults.vim b/vim/ftdetect/xdefaults.vim index 2d4c6738..589f0dfc 100644 --- a/vim/ftdetect/xdefaults.vim +++ b/vim/ftdetect/xdefaults.vim @@ -3,5 +3,5 @@ augroup dfxdefaults autocmd! autocmd BufNewFile,BufRead \ **/.Xresources.d/* - \ setlocal filetype=xdefaults + \ setfiletype xdefaults augroup END |