diff options
author | Jesse Luehrs <doy@tozt.net> | 2017-10-29 01:54:41 -0400 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2017-10-29 02:01:52 -0400 |
commit | fa3b083016391c7ced5074f498c942ab47034975 (patch) | |
tree | 0a10e329a6d247016d4391c875def483da895d47 /vim/ftplugin | |
parent | 34d83456f8c76ecdce5eb53abe6764c5ae061d64 (diff) | |
download | conf-fa3b083016391c7ced5074f498c942ab47034975.tar.gz conf-fa3b083016391c7ced5074f498c942ab47034975.zip |
more vim scoping
this fixes, at least, using the Help function directly before opening
denite for the first time (since `modifiable` was leaking through)
Diffstat (limited to 'vim/ftplugin')
-rw-r--r-- | vim/ftplugin/gitcommit.vim | 2 | ||||
-rw-r--r-- | vim/ftplugin/perl.vim | 2 | ||||
-rw-r--r-- | vim/ftplugin/ruby.vim | 11 | ||||
-rw-r--r-- | vim/ftplugin/terraform.vim | 2 | ||||
-rw-r--r-- | vim/ftplugin/tex.vim | 24 |
5 files changed, 21 insertions, 20 deletions
diff --git a/vim/ftplugin/gitcommit.vim b/vim/ftplugin/gitcommit.vim index 11d34aa..758db96 100644 --- a/vim/ftplugin/gitcommit.vim +++ b/vim/ftplugin/gitcommit.vim @@ -1 +1 @@ -set viminfo= +setlocal viminfo= diff --git a/vim/ftplugin/perl.vim b/vim/ftplugin/perl.vim index 6edc9fb..f6383fa 100644 --- a/vim/ftplugin/perl.vim +++ b/vim/ftplugin/perl.vim @@ -13,7 +13,7 @@ function! s:set_excludes() for line in readfile("dist.ini", '', 10) let name = matchstr(line, '\s*name\s*=\s*\zs.*') if name != "" - exe 'set wildignore+=' . name . '-*/*' + exe 'setlocal wildignore+=' . name . '-*/*' break endif endfor diff --git a/vim/ftplugin/ruby.vim b/vim/ftplugin/ruby.vim index e030a3d..035f432 100644 --- a/vim/ftplugin/ruby.vim +++ b/vim/ftplugin/ruby.vim @@ -1,11 +1,11 @@ function! s:rubocop_in_bundler() - let gemfiles = glob("*.gemspec", 1, 1) + let l:gemfiles = glob("*.gemspec", 1, 1) if filereadable("Gemfile") - let gemfiles += ["Gemfile"] + let l:gemfiles += ["Gemfile"] endif - for file in gemfiles - for line in readfile(file) - if line =~ 'gem.*rubocop' + for l:file in l:gemfiles + for l:line in readfile(l:file) + if l:line =~ 'gem.*rubocop' return 1 endif endfor @@ -19,6 +19,7 @@ endif " look up words in ri rather than man for K function! s:ri(word) exe 'silent read! ri -T -f rdoc "' . a:word . '" 2>/dev/null' + setlocal ft= endfunction nnoremap <buffer> <silent>K :call Help(0, [':', '.'], '<SID>ri')<CR> vnoremap <buffer> <silent>K :call Help(1, [':', '.'], '<SID>ri')<CR> diff --git a/vim/ftplugin/terraform.vim b/vim/ftplugin/terraform.vim index b296111..4e7db16 100644 --- a/vim/ftplugin/terraform.vim +++ b/vim/ftplugin/terraform.vim @@ -1,2 +1,2 @@ setlocal commentstring=#\ %s -let g:terraform_fmt_on_save = 1 +let b:terraform_fmt_on_save = 1 diff --git a/vim/ftplugin/tex.vim b/vim/ftplugin/tex.vim index a283f01..6f9bd52 100644 --- a/vim/ftplugin/tex.vim +++ b/vim/ftplugin/tex.vim @@ -5,28 +5,28 @@ setlocal makeprg=(cd\ /tmp\ &&\ pdflatex\ --halt-on-error\ %:p) " xpdf needs to be manually refreshed when the file changes function! s:xpdf() - let pdf = '/tmp/' . expand('<afile>:t:r') . '.pdf' - let processes = split(system('ps xo args'), '\n') - for process in processes - if process =~ 'xpdf -remote localhost' + let l:pdf = '/tmp/' . expand('<afile>:t:r') . '.pdf' + let l:processes = split(system('ps xo args'), '\n') + for l:process in l:processes + if l:process =~ 'xpdf -remote localhost' call system('xpdf -remote localhost -reload') return endif endfor - call system('xpdf -remote localhost ' . pdf . ' &') + call system('xpdf -remote localhost ' . l:pdf . ' &') endfunction " evince treats opening the same file twice as meaning 'reload' function! s:evince() - let pdf = '/tmp/' . expand('<afile>:t:r') . '.pdf' - system('evince ' . pdf . ' &') + let l:pdf = '/tmp/' . expand('<afile>:t:r') . '.pdf' + system('evince ' . l:pdf . ' &') endfunction " don't load the pdf if the make failed function! s:make_errors() - let qf = getqflist() - for line in qf - if line['type'] == 'E' + let l:qf = getqflist() + for l:line in l:qf + if l:line['type'] == 'E' return 1 endif endfor @@ -35,12 +35,12 @@ endfunction let b:automake_enabled = 0 function! s:automake() - let old_shellpipe = &shellpipe + let l:old_shellpipe = &shellpipe let &shellpipe = '>' try silent make! finally - let &shellpipe = old_shellpipe + let &shellpipe = l:old_shellpipe endtry endfunction |