summaryrefslogtreecommitdiffstats
path: root/vim/ftplugin/ruby.vim
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2017-10-29 01:54:41 -0400
committerJesse Luehrs <doy@tozt.net>2017-10-29 02:01:52 -0400
commitfa3b083016391c7ced5074f498c942ab47034975 (patch)
tree0a10e329a6d247016d4391c875def483da895d47 /vim/ftplugin/ruby.vim
parent34d83456f8c76ecdce5eb53abe6764c5ae061d64 (diff)
downloadconf-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/ruby.vim')
-rw-r--r--vim/ftplugin/ruby.vim11
1 files changed, 6 insertions, 5 deletions
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>