diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2019-05-10 10:38:50 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2019-05-10 10:38:50 +1200 |
commit | ed2dfe06b1ad22d09af7fe7efc36555812c24aa5 (patch) | |
tree | ffc37ddaaf7ae67f2e7f81acc92f56493020a9b2 /vim/autoload/filetype.vim | |
parent | Merge branch 'release/v4.19.0' (diff) | |
parent | Bump VERSION (diff) | |
download | dotfiles-ed2dfe06b1ad22d09af7fe7efc36555812c24aa5.tar.gz dotfiles-ed2dfe06b1ad22d09af7fe7efc36555812c24aa5.zip |
Merge branch 'release/v4.20.0'v4.20.0
* release/v4.20.0:
Bump VERSION
Update vim-juvenile to v0.4.0
Update vim-insert-suspend-hlsearch to v0.7.0
Update vim-insert-cancel to v3.3.0
Update vim-foldlevelstart-stdin to v0.2.0
Update vim-equalalways-resized to v0.2.0
Update vim-digraph-search to v0.2.0
Update vim-diff-prune to v1.3.0
Update vim-cursorline-current to v0.4.0
Update vim-copy-linebreak to v0.7.0
Update vim-colon-operator to v0.4.0
Update vim-cmdwin-ctrlc to v0.3.0
Update vim-big-file-options to v1.1.0
Remove unnecessary l: prefixes to Vim variables
Remove unnecessary g: prefixes to Vim variables
Remap g& to preserve substitution flags
Bind \S in Vim to run :scriptnames
Diffstat (limited to 'vim/autoload/filetype.vim')
-rw-r--r-- | vim/autoload/filetype.vim | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/vim/autoload/filetype.vim b/vim/autoload/filetype.vim index e33dfcbc..fb70d690 100644 --- a/vim/autoload/filetype.vim +++ b/vim/autoload/filetype.vim @@ -8,24 +8,24 @@ function! filetype#StripRepeat() abort endif " Expand the match result - let l:fn = expand('<afile>') + let fn = expand('<afile>') " Strip leading and trailing #hashes# - if l:fn =~# '^#\+.*#\+$' - let l:fn = substitute(l:fn, '^#\+\(.\+\)#\+$', '\1', '') + if fn =~# '^#\+.*#\+$' + let fn = substitute(fn, '^#\+\(.\+\)#\+$', '\1', '') " Strip trailing tilde~ - elseif l:fn =~# '\~$' - let l:fn = substitute(l:fn, '\~$', '', '') + elseif fn =~# '\~$' + let fn = substitute(fn, '\~$', '', '') " Strip generic .extension else - let l:fn = expand('<afile>:r') + let fn = expand('<afile>:r') endif " Re-run the group if there's anything left - if strlen(l:fn) - execute 'doautocmd filetypedetect BufRead ' . fnameescape(l:fn) + if strlen(fn) + execute 'doautocmd filetypedetect BufRead ' . fnameescape(fn) endif endfunction @@ -41,17 +41,17 @@ function! filetype#SudoRepeat() abort endif " Expand the match result - let l:fn = expand('<afile>') + let fn = expand('<afile>') " myfileXXQGS16A.conf: strip eight chars before final period - if l:fn =~# '/[^./]\+\w\{8}\.[^./]\+$' - let l:fr = expand('<afile>:r') - let l:fe = expand('<afile>:e') - let l:fn = strpart(l:fr, -8, strlen(l:fr)) . '.' . l:fe + if fn =~# '/[^./]\+\w\{8}\.[^./]\+$' + let fr = expand('<afile>:r') + let fe = expand('<afile>:e') + let fn = strpart(fr, -8, strlen(fr)) . '.' . fe " myfile.XXQGS16A: strip extension - elseif l:fn =~# '/[^./]\+\.\w\{8}$' - let l:fn = expand('<afile>:r') + elseif fn =~# '/[^./]\+\.\w\{8}$' + let fn = expand('<afile>:r') " Unrecognised pattern; return, don't repeat else @@ -59,8 +59,8 @@ function! filetype#SudoRepeat() abort endif " Re-run the group if there's anything left - if strlen(l:fn) - execute 'doautocmd filetypedetect BufRead ' . fnameescape(l:fn) + if strlen(fn) + execute 'doautocmd filetypedetect BufRead ' . fnameescape(fn) endif endfunction |