From 12db3dafc57d990db2b3758b0d97a37333a0ddab Mon Sep 17 00:00:00 2001 From: Adam Stankiewicz Date: Sat, 18 Jul 2015 21:29:35 +0200 Subject: Update --- ftplugin/ruby.vim | 125 ++++++++++++++++++++++++++++++++---------------------- 1 file changed, 74 insertions(+), 51 deletions(-) (limited to 'ftplugin/ruby.vim') diff --git a/ftplugin/ruby.vim b/ftplugin/ruby.vim index c8c3946f..60404744 100644 --- a/ftplugin/ruby.vim +++ b/ftplugin/ruby.vim @@ -67,7 +67,7 @@ if !exists('g:ruby_version_paths') let g:ruby_version_paths = {} endif -function! s:query_path(root) +function! s:query_path(root) abort let code = "print $:.join %q{,}" if &shell =~# 'sh' let prefix = 'env PATH='.shellescape($PATH).' ' @@ -92,7 +92,7 @@ function! s:query_path(root) endtry endfunction -function! s:build_path(path) +function! s:build_path(path) abort let path = join(map(copy(a:path), 'v:val ==# "." ? "" : v:val'), ',') if &g:path !~# '\v^\.%(,/%(usr|emx)/include)=,,$' let path = substitute(&g:path,',,$',',','') . ',' . path @@ -146,7 +146,22 @@ let b:undo_ftplugin = "setl fo< inc< inex< sua< def< com< cms< path< tags< kp<" \."| if exists('&ofu') && has('ruby') | setl ofu< | endif" \."| if has('balloon_eval') && exists('+bexpr') | setl bexpr< | endif" +function! s:map(mode, flags, map) abort + let from = matchstr(a:map, '\S\+') + if empty(mapcheck(from, a:mode)) + exe a:mode.'map' ''.(a:0 ? a:1 : '') a:map + let b:undo_ftplugin .= '|sil! '.a:mode.'unmap '.from + endif +endfunction + +cmap