From 5f1223fbc5285689db812236c9100329740a805b Mon Sep 17 00:00:00 2001 From: Adam Stankiewicz Date: Tue, 29 Jul 2014 13:03:49 +0200 Subject: Major update --- ftplugin/csv.vim | 31 +++++------ ftplugin/cucumber.vim | 13 ++--- ftplugin/gitcommit.vim | 11 +--- ftplugin/latex-box/common.vim | 38 ++++++++++--- ftplugin/latex-box/complete.vim | 3 +- ftplugin/latex-box/findmain.vim | 10 ++-- ftplugin/latex-box/folding.vim | 115 ++++++++++++++++++++++++++-------------- ftplugin/latex-box/latexmk.vim | 35 ++++++++---- ftplugin/latex-box/mappings.vim | 6 +++ ftplugin/latex-box/motion.vim | 26 +++++---- ftplugin/latextoc.vim | 7 ++- ftplugin/markdown.vim | 2 +- ftplugin/ruby.vim | 23 ++++---- ftplugin/rust.vim | 106 +++++++++++++++++++++++------------- 14 files changed, 265 insertions(+), 161 deletions(-) (limited to 'ftplugin') diff --git a/ftplugin/csv.vim b/ftplugin/csv.vim index b6414d9f..9d8df120 100644 --- a/ftplugin/csv.vim +++ b/ftplugin/csv.vim @@ -160,7 +160,7 @@ fu! Init(startline, endline) "{{{3 " \ delf PrepareFolding | delf OutputFilters | " \ delf SortFilter | delf GetColumn | " \ delf RemoveLastItem | delf DisableFolding | - " \ delf GetSID | delf CheckHeaderLine | + " \ delf CheckHeaderLine | " \ delf AnalyzeColumn | delf Vertfold | " \ delf InitCSVFixedWidth | delf LocalCmd | " \ delf CommandDefinitions | delf NumberFormat | @@ -806,18 +806,18 @@ fu! GetColPat(colnr, zs_flag) "{{{3 else if a:colnr >= len(b:csv_fixed_width_cols) " Get last column - let pat='\%' . b:csv_fixed_width_cols[-1] . 'c.*' + let pat='\%' . b:csv_fixed_width_cols[-1] . 'v.*' else let pat='\%' . b:csv_fixed_width_cols[(a:colnr - 1)] . - \ 'c.\{-}\%' . b:csv_fixed_width_cols[a:colnr] . 'c' + \ 'c.\{-}\%' . b:csv_fixed_width_cols[a:colnr] . 'v' endif endif elseif !exists("b:csv_fixed_width_cols") let pat=b:col else - let pat='\%' . b:csv_fixed_width_cols[0] . 'c.\{-}' . + let pat='\%' . b:csv_fixed_width_cols[0] . 'v.\{-}' . \ (len(b:csv_fixed_width_cols) > 1 ? - \ '\%' . b:csv_fixed_width_cols[1] . 'c' : + \ '\%' . b:csv_fixed_width_cols[1] . 'v' : \ '') endif return pat . (a:zs_flag ? '\zs' : '') @@ -1078,12 +1078,12 @@ fu! Sort(bang, line1, line2, colnr) range "{{{3 if !exists("b:csv_fixed_width_cols") let pat= '^' . GetColPat(col-1,1) . b:col else - let pat= '^' . GetColPat(col,0) + let pat= GetColPat(col,0) endif else let pat= '^' . GetColPat(col,0) endif - exe a:line1 ',' a:line2 . "sort" . (a:bang ? '!' : '') . + exe a:line1. ','. a:line2. "sort". (a:bang ? '!' : '') . \' r ' . (numeric ? 'n' : '') . ' /' . pat . '/' call winrestview(wsv) endfun @@ -1488,12 +1488,11 @@ fu! PrepareFolding(add, match) "{{{3 " for val in sort(values(b:csv_filter), 'SortFilter') " let @/ .= val.pat . (val.id == s:filter_count ? '' : '\&') " endfor - let sid = GetSID() " Fold settings: call LocalSettings('fold') " Don't put spaces between the arguments! - exe 'setl foldexpr=' . sid . '_FoldValue(v:lnum,b:csv_filter)' + exe 'setl foldexpr=' . s:SID . '_FoldValue(v:lnum,b:csv_filter)' " Move folded area to the bottom, so there is only on consecutive " non-folded area @@ -1541,8 +1540,7 @@ fu! OutputFilters(bang) "{{{3 call Warn("No filters defined currently!") return else - let sid = GetSID() - exe 'setl foldexpr=' . sid . '_FoldValue(v:lnum,b:csv_filter)' + exe 'setl foldexpr=' . s:SID . '_FoldValue(v:lnum,b:csv_filter)' endif endif endfu @@ -1588,14 +1586,11 @@ fu! DisableFolding() "{{{3 endif endfu -fu! GetSID() "{{{3 - if v:version > 703 || v:version == 703 && has("patch032") - return maparg('W', "", "", 1).sid - else - "return substitute(maparg('W'), '\(\d\+\)_', '\1', '') - return matchstr(expand(''), '\zs\d\+\ze_GetSID$') - endif +fu! DetermineSID() + let s:SID = matchstr(expand(''), '\zs\d\+\ze_DetermineSID$') endfu +call s:DetermineSID() +delf s:DetermineSID fu! NumberFormat() "{{{3 let s:nr_format = [',', '.'] diff --git a/ftplugin/cucumber.vim b/ftplugin/cucumber.vim index f52a1b21..b2f60fdd 100644 --- a/ftplugin/cucumber.vim +++ b/ftplugin/cucumber.vim @@ -21,12 +21,13 @@ let b:undo_ftplugin = "setl fo< com< cms< ofu<" let b:cucumber_root = expand('%:p:h:s?.*[\/]\%(features\|stories\)\zs[\/].*??') if !exists("g:no_plugin_maps") && !exists("g:no_cucumber_maps") - nnoremap [ :exe jump('edit',v:count) - nnoremap ] :exe jump('edit',v:count) - nnoremap d :exe jump('split',v:count) - nnoremap :exe jump('split',v:count) - nnoremap [d :exe jump('pedit',v:count) - nnoremap ]d :exe jump('pedit',v:count) + cnoremap foldopen if &foldopen =~# 'tag'exe 'norm! zv'endif + nnoremap