summaryrefslogtreecommitdiffstats
path: root/vim/ftplugin/ruby.vim
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2017-10-27 20:42:07 -0400
committerJesse Luehrs <doy@tozt.net>2017-10-27 20:43:13 -0400
commit3839eb947fdb6c7bfeccbcd594db2a966ede6293 (patch)
tree8980eccadc9f412c447ad4462438cd3322a25369 /vim/ftplugin/ruby.vim
parent4ebbac1a1686b06cd30907312fa7646c8ede7f71 (diff)
downloadconf-3839eb947fdb6c7bfeccbcd594db2a966ede6293.tar.gz
conf-3839eb947fdb6c7bfeccbcd594db2a966ede6293.zip
use ri and pydoc for K in ruby and python
Diffstat (limited to 'vim/ftplugin/ruby.vim')
-rw-r--r--vim/ftplugin/ruby.vim7
1 files changed, 7 insertions, 0 deletions
diff --git a/vim/ftplugin/ruby.vim b/vim/ftplugin/ruby.vim
index fa735f8..a7c536d 100644
--- a/vim/ftplugin/ruby.vim
+++ b/vim/ftplugin/ruby.vim
@@ -15,3 +15,10 @@ endfunction
if s:rubocop_in_bundler()
let b:ale_ruby_rubocop_executable = 'bundle'
endif
+
+" look up words in ri rather than man for K
+function! s:ri(word)
+ exe 'silent read! ri --no-pager "' . a:word . '" 2>/dev/null'
+endfunction
+nnoremap <buffer> <silent>K :call Help(0, [':'], '<SID>ri')<CR>
+vnoremap <buffer> <silent>K :call Help(1, [':'], '<SID>ri')<CR>