diff options
Diffstat (limited to 'ftplugin')
-rw-r--r-- | ftplugin/coffee.vim | 13 | ||||
-rw-r--r-- | ftplugin/csv.vim | 23 | ||||
-rw-r--r-- | ftplugin/erlang.vim | 3 | ||||
-rw-r--r-- | ftplugin/html.vim | 2 | ||||
-rw-r--r-- | ftplugin/latex-box/complete.vim | 1 | ||||
-rw-r--r-- | ftplugin/latex-box/folding.vim | 39 | ||||
-rw-r--r-- | ftplugin/latex-box/latexmk.vim | 7 | ||||
-rw-r--r-- | ftplugin/latextoc.vim | 8 | ||||
-rw-r--r-- | ftplugin/mustache.vim | 5 | ||||
-rw-r--r-- | ftplugin/ruby.vim | 2 |
10 files changed, 73 insertions, 30 deletions
diff --git a/ftplugin/coffee.vim b/ftplugin/coffee.vim index c44fe979..347155ac 100644 --- a/ftplugin/coffee.vim +++ b/ftplugin/coffee.vim @@ -1,5 +1,5 @@ " Language: CoffeeScript -" Maintainer: Mick Koch <kchmck@gmail.com> +" Maintainer: Mick Koch <mick@kochm.co> " URL: http://github.com/kchmck/vim-coffee-script " License: WTFPL @@ -13,6 +13,7 @@ call coffee#CoffeeSetUpVariables() setlocal formatoptions-=t formatoptions+=croql setlocal comments=:# commentstring=#\ %s setlocal omnifunc=javascriptcomplete#CompleteJS +setlocal suffixesadd+=coffee " Create custom augroups. augroup CoffeeBufUpdate | augroup END @@ -330,7 +331,7 @@ function! s:CoffeeLint(startline, endline, bang, args) endif let output = system(g:coffee_linter . - \ ' -s --csv' . + \ ' -s --reporter csv' . \ ' ' . b:coffee_litcoffee . \ ' ' . g:coffee_lint_options . \ ' ' . a:args . @@ -394,11 +395,11 @@ if !exists('b:coffee_run_buf') call s:CoffeeRunResetVars() endif -command! -range=% -bar -nargs=* -complete=customlist,s:CoffeeComplete +command! -buffer -range=% -bar -nargs=* -complete=customlist,s:CoffeeComplete \ CoffeeCompile call s:CoffeeCompile(<line1>, <line2>, <q-args>) -command! -bar -nargs=* -complete=customlist,s:CoffeeComplete +command! -buffer -bar -nargs=* -complete=customlist,s:CoffeeComplete \ CoffeeWatch call s:CoffeeWatch(<q-args>) -command! -range=% -bar -nargs=* CoffeeRun +command! -buffer -range=% -bar -nargs=* CoffeeRun \ call s:CoffeeRun(<line1>, <line2>, <q-args>) -command! -range=% -bang -bar -nargs=* CoffeeLint +command! -buffer -range=% -bang -bar -nargs=* CoffeeLint \ call s:CoffeeLint(<line1>, <line2>, <q-bang>, <q-args>) diff --git a/ftplugin/csv.vim b/ftplugin/csv.vim index 9d8df120..19f649cc 100644 --- a/ftplugin/csv.vim +++ b/ftplugin/csv.vim @@ -517,7 +517,13 @@ fu! <sid>WColumn(...) "{{{3 " Return on which column the cursor is let _cur = getpos('.') if !exists("b:csv_fixed_width_cols") - let line=getline('.') + if line('.') > 1 && mode('') != 'n' + " in insert mode, get line from above, just in case the current + " line is empty + let line = getline(line('.')-1) + else + let line=getline('.') + endif " move cursor to end of field "call search(b:col, 'ec', line('.')) call search(b:col, 'ec') @@ -2398,6 +2404,9 @@ fu! csv#EvalColumn(nr, func, first, last) range "{{{3 call <sid>CheckHeaderLine() let nr = matchstr(a:nr, '^\-\?\d\+') let col = (empty(nr) ? <sid>WColumn() : nr) + if col == 0 + let col = 1 + endif " don't take the header line into consideration let start = a:first - 1 + s:csv_fold_headerline let stop = a:last - 1 + s:csv_fold_headerline @@ -2516,8 +2525,18 @@ fu! CSV_CloseBuffer(buffer) "{{{3 augroup! CSV_QuitPre endtry endfu - +fu! CSVSum(col, fmt, first, last) "{{{3 + let first = a:first + let last = a:last + if empty(first) + let first = 1 + endif + if empty(last) + let last = line('$') + endif + return csv#EvalColumn(a:col, '<sid>SumColumn', first, last) +endfu " Initialize Plugin "{{{2 let b:csv_start = exists("b:csv_start") ? b:csv_start : 1 let b:csv_end = exists("b:csv_end") ? b:csv_end : line('$') diff --git a/ftplugin/erlang.vim b/ftplugin/erlang.vim index f75f47ae..4f1acfe8 100644 --- a/ftplugin/erlang.vim +++ b/ftplugin/erlang.vim @@ -39,6 +39,9 @@ function s:SetErlangOptions() setlocal omnifunc=erlangcomplete#Complete endif + setlocal comments=:%%%,:%%,:% + setlocal commentstring=%%s + setlocal foldmethod=expr setlocal foldexpr=GetErlangFold(v:lnum) setlocal foldtext=ErlangFoldText() diff --git a/ftplugin/html.vim b/ftplugin/html.vim index 4c0d9d07..a2af59c4 100644 --- a/ftplugin/html.vim +++ b/ftplugin/html.vim @@ -4,4 +4,4 @@ " License: MIT " Changes: Add - to keyword -setlocal iskeyword+=- +" setlocal iskeyword+=- diff --git a/ftplugin/latex-box/complete.vim b/ftplugin/latex-box/complete.vim index 458e8d81..150b00e7 100644 --- a/ftplugin/latex-box/complete.vim +++ b/ftplugin/latex-box/complete.vim @@ -367,6 +367,7 @@ function! s:ExtractLabels() " Ignore cref entries (because they are duplicates) if curname =~# "@cref$" + let [lblline, lblbegin] = searchpos( '\\newlabel{', 'ecW' ) continue endif diff --git a/ftplugin/latex-box/folding.vim b/ftplugin/latex-box/folding.vim index 4fe13bc8..5d733c23 100644 --- a/ftplugin/latex-box/folding.vim +++ b/ftplugin/latex-box/folding.vim @@ -156,7 +156,7 @@ let s:notcomment = '\%(\%(\\\@<!\%(\\\\\)*\)\@<=%.*\)\@<!' let s:envbeginpattern = s:notcomment . s:notbslash . '\\begin\s*{.\{-}}' let s:envendpattern = s:notcomment . s:notbslash . '\\end\s*{.\{-}}' let s:foldparts = '^\s*\\\%(' . join(g:LatexBox_fold_parts, '\|') . '\)' -let s:folded = '\(% Fake\|\\\(document\|begin\|end\|' +let s:folded = '\(% Fake\|\\\(document\|begin\|end\|paragraph\|' \ . 'front\|main\|back\|app\|sub\|section\|chapter\|part\)\)' function! LatexBox_FoldLevel(lnum) @@ -193,26 +193,31 @@ function! LatexBox_FoldLevel(lnum) endif " Fold environments - if line =~# s:envbeginpattern - if g:LatexBox_fold_envs == 1 - return "a1" - else - let env = matchstr(line,'\\begin\*\?{\zs\w*\*\?\ze}') - if index(g:LatexBox_fold_envs_force, env) >= 0 + if line =~# s:envbeginpattern && line =~# s:envendpattern + " If the begin and end pattern are on the same line , do not fold + return "=" + else + if line =~# s:envbeginpattern + if g:LatexBox_fold_envs == 1 return "a1" else - return "=" + let env = matchstr(line,'\\begin\*\?{\zs\w*\*\?\ze}') + if index(g:LatexBox_fold_envs_force, env) >= 0 + return "a1" + else + return "=" + endif endif - endif - elseif line =~# s:envendpattern - if g:LatexBox_fold_envs == 1 - return "s1" - else - let env = matchstr(line,'\\end\*\?{\zs\w*\*\?\ze}') - if index(g:LatexBox_fold_envs_force, env) >= 0 + elseif line =~# s:envendpattern + if g:LatexBox_fold_envs == 1 return "s1" else - return "=" + let env = matchstr(line,'\\end\*\?{\zs\w*\*\?\ze}') + if index(g:LatexBox_fold_envs_force, env) >= 0 + return "s1" + else + return "=" + endif endif endif endif @@ -288,7 +293,7 @@ function! LatexBox_FoldText_title() endif " Parts, sections and fakesections - let sections = '\(\(sub\)*section\|part\|chapter\)' + let sections = '\(\(sub\)*\(section\|paragraph\)\|part\|chapter\)' let secpat1 = '^\s*\\' . sections . '\*\?\s*{' let secpat2 = '^\s*\\' . sections . '\*\?\s*\[' if line =~ '\\frontmatter' diff --git a/ftplugin/latex-box/latexmk.vim b/ftplugin/latex-box/latexmk.vim index bb70f83d..6c5d3eb1 100644 --- a/ftplugin/latex-box/latexmk.vim +++ b/ftplugin/latex-box/latexmk.vim @@ -23,6 +23,9 @@ endif if ! exists('g:LatexBox_quickfix') let g:LatexBox_quickfix = 1 endif +if ! exists('g:LatexBox_personal_latexmkrc') + let g:LatexBox_personal_latexmkrc = 0 +endif " }}} @@ -177,7 +180,9 @@ function! LatexBox_Latexmk(force) let cmd = 'cd ' . texroot . ' && ' endif let cmd .= env . ' latexmk' - let cmd .= ' -' . g:LatexBox_output_type + if ! g:LatexBox_personal_latexmkrc + let cmd .= ' -' . g:LatexBox_output_type + endif let cmd .= ' -quiet ' let cmd .= g:LatexBox_latexmk_options if a:force diff --git a/ftplugin/latextoc.vim b/ftplugin/latextoc.vim index 8edf23d1..65315dea 100644 --- a/ftplugin/latextoc.vim +++ b/ftplugin/latextoc.vim @@ -87,8 +87,12 @@ function! s:TOCActivate(close) endfor " Find section in buffer (or inputted files) - call s:TOCFindMatch('\\' . entry['level'] . '\_\s*{' . titlestr . '}', - \ duplicates, files) + if entry['level'] == 'label' + let re = '\(\\label\_\s*{\|label\s*=\s*\)' . titlestr . '\>' + else + let re = '\\' . entry['level'] . '\_\s*{' . titlestr . '}' + endif + call s:TOCFindMatch(re, duplicates, files) if a:close if g:LatexBox_split_resize diff --git a/ftplugin/mustache.vim b/ftplugin/mustache.vim index 592ed09d..61b5896d 100644 --- a/ftplugin/mustache.vim +++ b/ftplugin/mustache.vim @@ -1,3 +1,8 @@ +if exists('g:loaded_mustache_handlebars') && g:loaded_mustache_handlebars + finish +endif +let g:loaded_mustache_handlebars = 1 + let s:cpo_save = &cpo set cpo&vim diff --git a/ftplugin/ruby.vim b/ftplugin/ruby.vim index f406cc88..a032928c 100644 --- a/ftplugin/ruby.vim +++ b/ftplugin/ruby.vim @@ -277,12 +277,12 @@ function! RubyBalloonexpr() endfunction function! s:searchsyn(pattern,syn,flags,mode) + let cnt = v:count1 norm! m' if a:mode ==# 'v' norm! gv endif let i = 0 - let cnt = v:count ? v:count : 1 while i < cnt let i = i + 1 let line = line('.') |