summaryrefslogtreecommitdiffstats
path: root/ftplugin
diff options
context:
space:
mode:
Diffstat (limited to 'ftplugin')
-rw-r--r--ftplugin/clojure.vim3
-rw-r--r--ftplugin/csv.vim6
-rw-r--r--ftplugin/cucumber.vim16
-rw-r--r--ftplugin/latextoc.vim11
-rw-r--r--ftplugin/markdown.vim28
5 files changed, 44 insertions, 20 deletions
diff --git a/ftplugin/clojure.vim b/ftplugin/clojure.vim
index 2741a3a1..672f856e 100644
--- a/ftplugin/clojure.vim
+++ b/ftplugin/clojure.vim
@@ -42,8 +42,9 @@ setlocal commentstring=;\ %s
" Functions that accept a flat list of forms do not treat the first argument
" specially and hence are not indented specially.
"
+" -*- LISPWORDS -*-
" Generated from https://github.com/guns/vim-clojure-static/blob/%%RELEASE_TAG%%/clj/src/vim_clojure_static/generate.clj
-setlocal lispwords=as->,binding,bound-fn,case,catch,cond->,cond->>,condp,def,definline,definterface,defmacro,defmethod,defmulti,defn,defn-,defonce,defprotocol,defrecord,defstruct,deftest,deftest-,deftype,doall,dorun,doseq,dotimes,doto,extend,extend-protocol,extend-type,fn,for,if,if-let,if-not,let,letfn,locking,loop,ns,proxy,reify,set-test,testing,when,when-first,when-let,when-not,while,with-bindings,with-in-str,with-local-vars,with-open,with-precision,with-redefs,with-redefs-fn,with-test
+setlocal lispwords=as->,binding,bound-fn,case,catch,cond->,cond->>,condp,def,definline,definterface,defmacro,defmethod,defmulti,defn,defn-,defonce,defprotocol,defrecord,defstruct,deftest,deftest-,deftype,doseq,dotimes,doto,extend,extend-protocol,extend-type,fn,for,if,if-let,if-not,if-some,let,letfn,locking,loop,ns,proxy,reify,set-test,testing,when,when-first,when-let,when-not,when-some,while,with-bindings,with-in-str,with-local-vars,with-open,with-precision,with-redefs,with-redefs-fn,with-test
" Provide insert mode completions for special forms and clojure.core. As
" 'omnifunc' is set by popular Clojure REPL client plugins, we also set
diff --git a/ftplugin/csv.vim b/ftplugin/csv.vim
index d824c154..0b3eee19 100644
--- a/ftplugin/csv.vim
+++ b/ftplugin/csv.vim
@@ -1,11 +1,11 @@
" Filetype plugin for editing CSV files. "{{{1
" Author: Christian Brabandt <cb@256bit.org>
-" Version: 0.29
+" Version: 0.30
" Script: http://www.vim.org/scripts/script.php?script_id=2830
" License: VIM License
-" Last Change: Wed, 14 Aug 2013 22:05:39 +0200
+" Last Change: Thu, 27 Mar 2014 23:28:40 +0100
" Documentation: see :help ft-csv.txt
-" GetLatestVimScripts: 2830 28 :AutoInstall: csv.vim
+" GetLatestVimScripts: 2830 29 :AutoInstall: csv.vim
"
" Some ideas are taken from the wiki http://vim.wikia.com/wiki/VimTip667
" though, implementation differs.
diff --git a/ftplugin/cucumber.vim b/ftplugin/cucumber.vim
index 1c1f0f25..f52a1b21 100644
--- a/ftplugin/cucumber.vim
+++ b/ftplugin/cucumber.vim
@@ -1,7 +1,7 @@
" Vim filetype plugin
" Language: Cucumber
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
-" Last Change: 2010 Aug 09
+" Last Change: 2013 Jun 01
" Only do this when not done yet for this buffer
if (exists("b:did_ftplugin"))
@@ -9,6 +9,9 @@ if (exists("b:did_ftplugin"))
endif
let b:did_ftplugin = 1
+let s:keepcpo= &cpo
+set cpo&vim
+
setlocal formatoptions-=t formatoptions+=croql
setlocal comments=:# commentstring=#\ %s
setlocal omnifunc=CucumberComplete
@@ -18,25 +21,17 @@ 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 <silent><buffer> <C-]> :<C-U>exe <SID>jump('edit',v:count)<CR>
nnoremap <silent><buffer> [<C-D> :<C-U>exe <SID>jump('edit',v:count)<CR>
nnoremap <silent><buffer> ]<C-D> :<C-U>exe <SID>jump('edit',v:count)<CR>
- nnoremap <silent><buffer> <C-W>] :<C-U>exe <SID>jump('split',v:count)<CR>
- nnoremap <silent><buffer> <C-W><C-]> :<C-U>exe <SID>jump('split',v:count)<CR>
nnoremap <silent><buffer> <C-W>d :<C-U>exe <SID>jump('split',v:count)<CR>
nnoremap <silent><buffer> <C-W><C-D> :<C-U>exe <SID>jump('split',v:count)<CR>
- nnoremap <silent><buffer> <C-W>} :<C-U>exe <SID>jump('pedit',v:count)<CR>
nnoremap <silent><buffer> [d :<C-U>exe <SID>jump('pedit',v:count)<CR>
nnoremap <silent><buffer> ]d :<C-U>exe <SID>jump('pedit',v:count)<CR>
let b:undo_ftplugin .=
- \ "|sil! nunmap <buffer> <C-]>" .
\ "|sil! nunmap <buffer> [<C-D>" .
\ "|sil! nunmap <buffer> ]<C-D>" .
- \ "|sil! nunmap <buffer> <C-W>]" .
- \ "|sil! nunmap <buffer> <C-W><C-]>" .
\ "|sil! nunmap <buffer> <C-W>d" .
\ "|sil! nunmap <buffer> <C-W><C-D>" .
- \ "|sil! nunmap <buffer> <C-W>}" .
\ "|sil! nunmap <buffer> [d" .
\ "|sil! nunmap <buffer> ]d"
endif
@@ -145,4 +140,7 @@ function! CucumberComplete(findstart,base) abort
return sort(steps)
endfunction
+let &cpo = s:keepcpo
+unlet s:keepcpo
+
" vim:set sts=2 sw=2:
diff --git a/ftplugin/latextoc.vim b/ftplugin/latextoc.vim
index 48f20e3b..01fd9bb0 100644
--- a/ftplugin/latextoc.vim
+++ b/ftplugin/latextoc.vim
@@ -40,13 +40,9 @@ endfunction
" {{{2 EscapeTitle
function! s:EscapeTitle(titlestr)
- " Credit goes to Marcin Szamotulski for the following fix. It allows to
- " match through commands added by TeX.
- let titlestr = substitute(a:titlestr, '\\\w*\>\s*\%({[^}]*}\)\?', '.*', 'g')
-
- let titlestr = escape(titlestr, '\')
- let titlestr = substitute(titlestr, ' ', '\\_\\s\\+', 'g')
-
+ let titlestr = substitute(a:titlestr, '\\[a-zA-Z@]*\>\s*{\?', '.*', 'g')
+ let titlestr = substitute(titlestr, '}', '', 'g')
+ let titlestr = substitute(titlestr, '\%(\.\*\s*\)\{2,}', '.*', 'g')
return titlestr
endfunction
@@ -170,6 +166,7 @@ function! s:TOCOpenBuf(file)
let bnr = bufnr(a:file)
endif
execute 'buffer! ' . bnr
+ normal! gg
endfunction
diff --git a/ftplugin/markdown.vim b/ftplugin/markdown.vim
index 5d6ebecd..ae3bd262 100644
--- a/ftplugin/markdown.vim
+++ b/ftplugin/markdown.vim
@@ -19,4 +19,32 @@ else
let b:undo_ftplugin = "setl cms< com< fo< flp<"
endif
+function! MarkdownFold()
+ let line = getline(v:lnum)
+
+ " Regular headers
+ let depth = match(line, '\(^#\+\)\@<=\( .*$\)\@=')
+ if depth > 0
+ return ">" . depth
+ endif
+
+ " Setext style headings
+ let nextline = getline(v:lnum + 1)
+ if (line =~ '^.\+$') && (nextline =~ '^=\+$')
+ return ">1"
+ endif
+
+ if (line =~ '^.\+$') && (nextline =~ '^-\+$')
+ return ">2"
+ endif
+
+ return "="
+endfunction
+
+if has("folding") && exists("g:markdown_folding")
+ setlocal foldexpr=MarkdownFold()
+ setlocal foldmethod=expr
+ let b:undo_ftplugin .= " foldexpr< foldmethod<"
+endif
+
" vim:set sw=2: