Update
This commit is contained in:
parent
f3833f5a39
commit
610f4c5701
File diff suppressed because one or more lines are too long
@ -15,7 +15,7 @@ endif
|
||||
let s:cpo_save = &cpo
|
||||
set cpo-=C
|
||||
|
||||
CompilerSet makeprg=haml\ -c
|
||||
CompilerSet makeprg=haml
|
||||
|
||||
CompilerSet errorformat=
|
||||
\Haml\ %trror\ on\ line\ %l:\ %m,
|
||||
|
@ -17,6 +17,8 @@ let s:cpo_save = &cpo
|
||||
set cpo-=C
|
||||
|
||||
CompilerSet makeprg=testrb
|
||||
" CompilerSet makeprg=ruby\ -Itest
|
||||
" CompilerSet makeprg=m
|
||||
|
||||
CompilerSet errorformat=\%W\ %\\+%\\d%\\+)\ Failure:,
|
||||
\%C%m\ [%f:%l]:,
|
||||
|
@ -15,7 +15,7 @@ endif
|
||||
let s:cpo_save = &cpo
|
||||
set cpo-=C
|
||||
|
||||
CompilerSet makeprg=sass\ -c
|
||||
CompilerSet makeprg=sass
|
||||
|
||||
CompilerSet errorformat=
|
||||
\%f:%l:%m\ (Sass::Syntax%trror),
|
||||
|
@ -15,7 +15,7 @@ autocmd BufNewFile,BufReadPost *.feature,*.story set filetype=cucumber
|
||||
au BufNewFile,BufRead Dockerfile set filetype=dockerfile
|
||||
au BufRead,BufNewFile *.ex,*.exs set filetype=elixir
|
||||
au FileType elixir setl sw=2 sts=2 et iskeyword+=!,?
|
||||
autocmd BufNewFile,BufRead *.git/{,modules/**/}{COMMIT_EDIT,MERGE_}MSG set ft=gitcommit
|
||||
autocmd BufNewFile,BufRead *.git/{,modules/**/}{COMMIT_EDIT,TAG_EDIT,MERGE_,}MSG set ft=gitcommit
|
||||
autocmd BufNewFile,BufRead *.git/config,.gitconfig,.gitmodules set ft=gitconfig
|
||||
autocmd BufNewFile,BufRead */.config/git/config set ft=gitconfig
|
||||
autocmd BufNewFile,BufRead *.git/modules/**/config set ft=gitconfig
|
||||
@ -44,7 +44,7 @@ endfunction
|
||||
au BufNewFile *.go setlocal filetype=go fileencoding=utf-8 fileformat=unix
|
||||
au BufRead *.go call s:gofiletype_pre()
|
||||
au BufReadPost *.go call s:gofiletype_post()
|
||||
autocmd BufNewFile,BufRead *.haml,*.hamlbars setf haml
|
||||
autocmd BufNewFile,BufRead *.haml,*.hamlbars,*.hamlc setf haml
|
||||
autocmd BufNewFile,BufRead *.sass setf sass
|
||||
autocmd BufNewFile,BufRead *.scss setf scss
|
||||
autocmd BufNewFile,BufReadPost *.jade set filetype=jade
|
||||
@ -85,28 +85,33 @@ au BufRead,BufNewFile /etc/nginx/*,/usr/local/nginx/*,*/nginx/vhosts.d/*,nginx.c
|
||||
au BufRead,BufNewFile *.cl set filetype=opencl
|
||||
autocmd BufNewFile,BufRead *.proto setfiletype proto
|
||||
au BufRead,BufNewFile *.pp set filetype=puppet
|
||||
au BufNewFile,BufRead *.rb,*.rbw,*.gemspec set filetype=ruby
|
||||
au BufNewFile,BufRead *.builder,*.rxml,*.rjs,*.ruby set filetype=ruby
|
||||
au BufNewFile,BufRead [rR]akefile,*.rake set filetype=ruby
|
||||
au BufNewFile,BufRead [rR]antfile,*.rant set filetype=ruby
|
||||
au BufNewFile,BufRead .irbrc,irbrc set filetype=ruby
|
||||
au BufNewFile,BufRead .pryrc set filetype=ruby
|
||||
au BufNewFile,BufRead *.ru set filetype=ruby
|
||||
au BufNewFile,BufRead Capfile set filetype=ruby
|
||||
au BufNewFile,BufRead Gemfile set filetype=ruby
|
||||
au BufNewFile,BufRead Guardfile,.Guardfile set filetype=ruby
|
||||
au BufNewFile,BufRead Cheffile set filetype=ruby
|
||||
au BufNewFile,BufRead Berksfile set filetype=ruby
|
||||
au BufNewFile,BufRead [vV]agrantfile set filetype=ruby
|
||||
au BufNewFile,BufRead .autotest set filetype=ruby
|
||||
au BufNewFile,BufRead *.erb,*.rhtml set filetype=eruby
|
||||
au BufNewFile,BufRead [tT]horfile,*.thor set filetype=ruby
|
||||
au BufNewFile,BufRead *.rabl set filetype=ruby
|
||||
au BufNewFile,BufRead *.jbuilder set filetype=ruby
|
||||
au BufNewFile,BufRead Puppetfile set filetype=ruby
|
||||
au BufNewFile,BufRead [Bb]uildfile set filetype=ruby
|
||||
au BufNewFile,BufRead Appraisals set filetype=ruby
|
||||
au BufNewFile,BufRead Podfile,*.podspec set filetype=ruby
|
||||
function! s:setf(filetype) abort
|
||||
if &filetype !=# a:filetype
|
||||
let &filetype = a:filetype
|
||||
endif
|
||||
endfunction
|
||||
au BufNewFile,BufRead *.rb,*.rbw,*.gemspec call s:setf('ruby')
|
||||
au BufNewFile,BufRead *.builder,*.rxml,*.rjs,*.ruby call s:setf('ruby')
|
||||
au BufNewFile,BufRead [rR]akefile,*.rake call s:setf('ruby')
|
||||
au BufNewFile,BufRead [rR]antfile,*.rant call s:setf('ruby')
|
||||
au BufNewFile,BufRead .irbrc,irbrc call s:setf('ruby')
|
||||
au BufNewFile,BufRead .pryrc call s:setf('ruby')
|
||||
au BufNewFile,BufRead *.ru call s:setf('ruby')
|
||||
au BufNewFile,BufRead Capfile call s:setf('ruby')
|
||||
au BufNewFile,BufRead Gemfile call s:setf('ruby')
|
||||
au BufNewFile,BufRead Guardfile,.Guardfile call s:setf('ruby')
|
||||
au BufNewFile,BufRead Cheffile call s:setf('ruby')
|
||||
au BufNewFile,BufRead Berksfile call s:setf('ruby')
|
||||
au BufNewFile,BufRead [vV]agrantfile call s:setf('ruby')
|
||||
au BufNewFile,BufRead .autotest call s:setf('ruby')
|
||||
au BufNewFile,BufRead *.erb,*.rhtml call s:setf('eruby')
|
||||
au BufNewFile,BufRead [tT]horfile,*.thor call s:setf('ruby')
|
||||
au BufNewFile,BufRead *.rabl call s:setf('ruby')
|
||||
au BufNewFile,BufRead *.jbuilder call s:setf('ruby')
|
||||
au BufNewFile,BufRead Puppetfile call s:setf('ruby')
|
||||
au BufNewFile,BufRead [Bb]uildfile call s:setf('ruby')
|
||||
au BufNewFile,BufRead Appraisals call s:setf('ruby')
|
||||
au BufNewFile,BufRead Podfile,*.podspec call s:setf('ruby')
|
||||
au BufRead,BufNewFile *.rs set filetype=rust
|
||||
au BufRead,BufNewFile *.sbt set filetype=sbt
|
||||
fun! s:DetectScala()
|
||||
|
@ -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
|
||||
|
@ -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.
|
||||
|
@ -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:
|
||||
|
@ -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
|
||||
|
||||
|
@ -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:
|
||||
|
@ -57,27 +57,30 @@ if exists("*searchpairpos")
|
||||
let g:clojure_align_subforms = 0
|
||||
endif
|
||||
|
||||
function! s:SynIdName()
|
||||
function! s:syn_id_name()
|
||||
return synIDattr(synID(line("."), col("."), 0), "name")
|
||||
endfunction
|
||||
|
||||
function! s:CurrentChar()
|
||||
function! s:ignored_region()
|
||||
return s:syn_id_name() =~? '\vstring|regex|comment|character'
|
||||
endfunction
|
||||
|
||||
function! s:current_char()
|
||||
return getline('.')[col('.')-1]
|
||||
endfunction
|
||||
|
||||
function! s:CurrentWord()
|
||||
function! s:current_word()
|
||||
return getline('.')[col('.')-1 : searchpos('\v>', 'n', line('.'))[1]-2]
|
||||
endfunction
|
||||
|
||||
function! s:IsParen()
|
||||
return s:CurrentChar() =~# '\v[\(\)\[\]\{\}]' &&
|
||||
\ s:SynIdName() !~? '\vstring|regex|comment|character'
|
||||
function! s:is_paren()
|
||||
return s:current_char() =~# '\v[\(\)\[\]\{\}]' && !s:ignored_region()
|
||||
endfunction
|
||||
|
||||
" Returns 1 if string matches a pattern in 'patterns', which may be a
|
||||
" list of patterns, or a comma-delimited string of implicitly anchored
|
||||
" patterns.
|
||||
function! s:MatchesOne(patterns, string)
|
||||
function! s:match_one(patterns, string)
|
||||
let list = type(a:patterns) == type([])
|
||||
\ ? a:patterns
|
||||
\ : map(split(a:patterns, ','), '"^" . v:val . "$"')
|
||||
@ -86,7 +89,7 @@ if exists("*searchpairpos")
|
||||
endfor
|
||||
endfunction
|
||||
|
||||
function! s:MatchPairs(open, close, stopat)
|
||||
function! s:match_pairs(open, close, stopat)
|
||||
" Stop only on vector and map [ resp. {. Ignore the ones in strings and
|
||||
" comments.
|
||||
if a:stopat == 0
|
||||
@ -95,11 +98,11 @@ if exists("*searchpairpos")
|
||||
let stopat = a:stopat
|
||||
endif
|
||||
|
||||
let pos = searchpairpos(a:open, '', a:close, 'bWn', "!s:IsParen()", stopat)
|
||||
let pos = searchpairpos(a:open, '', a:close, 'bWn', "!s:is_paren()", stopat)
|
||||
return [pos[0], virtcol(pos)]
|
||||
endfunction
|
||||
|
||||
function! s:ClojureCheckForStringWorker()
|
||||
function! s:clojure_check_for_string_worker()
|
||||
" Check whether there is the last character of the previous line is
|
||||
" highlighted as a string. If so, we check whether it's a ". In this
|
||||
" case we have to check also the previous character. The " might be the
|
||||
@ -113,17 +116,17 @@ if exists("*searchpairpos")
|
||||
|
||||
call cursor(nb, 0)
|
||||
call cursor(0, col("$") - 1)
|
||||
if s:SynIdName() !~? "string"
|
||||
if s:syn_id_name() !~? "string"
|
||||
return -1
|
||||
endif
|
||||
|
||||
" This will not work for a " in the first column...
|
||||
if s:CurrentChar() == '"'
|
||||
if s:current_char() == '"'
|
||||
call cursor(0, col("$") - 2)
|
||||
if s:SynIdName() !~? "string"
|
||||
if s:syn_id_name() !~? "string"
|
||||
return -1
|
||||
endif
|
||||
if s:CurrentChar() != '\\'
|
||||
if s:current_char() != '\\'
|
||||
return -1
|
||||
endif
|
||||
call cursor(0, col("$") - 1)
|
||||
@ -138,40 +141,40 @@ if exists("*searchpairpos")
|
||||
return indent(".")
|
||||
endfunction
|
||||
|
||||
function! s:CheckForString()
|
||||
function! s:check_for_string()
|
||||
let pos = getpos('.')
|
||||
try
|
||||
let val = s:ClojureCheckForStringWorker()
|
||||
let val = s:clojure_check_for_string_worker()
|
||||
finally
|
||||
call setpos('.', pos)
|
||||
endtry
|
||||
return val
|
||||
endfunction
|
||||
|
||||
function! s:StripNamespaceAndMacroChars(word)
|
||||
function! s:strip_namespace_and_macro_chars(word)
|
||||
return substitute(a:word, "\\v%(.*/|[#'`~@^,]*)(.*)", '\1', '')
|
||||
endfunction
|
||||
|
||||
function! s:ClojureIsMethodSpecialCaseWorker(position)
|
||||
function! s:clojure_is_method_special_case_worker(position)
|
||||
" Find the next enclosing form.
|
||||
call search('\S', 'Wb')
|
||||
|
||||
" Special case: we are at a '(('.
|
||||
if s:CurrentChar() == '('
|
||||
if s:current_char() == '('
|
||||
return 0
|
||||
endif
|
||||
call cursor(a:position)
|
||||
|
||||
let nextParen = s:MatchPairs('(', ')', 0)
|
||||
let next_paren = s:match_pairs('(', ')', 0)
|
||||
|
||||
" Special case: we are now at toplevel.
|
||||
if nextParen == [0, 0]
|
||||
if next_paren == [0, 0]
|
||||
return 0
|
||||
endif
|
||||
call cursor(nextParen)
|
||||
call cursor(next_paren)
|
||||
|
||||
call search('\S', 'W')
|
||||
let w = s:StripNamespaceAndMacroChars(s:CurrentWord())
|
||||
let w = s:strip_namespace_and_macro_chars(s:current_word())
|
||||
if g:clojure_special_indent_words =~# '\V\<' . w . '\>'
|
||||
return 1
|
||||
endif
|
||||
@ -179,27 +182,33 @@ if exists("*searchpairpos")
|
||||
return 0
|
||||
endfunction
|
||||
|
||||
function! s:IsMethodSpecialCase(position)
|
||||
function! s:is_method_special_case(position)
|
||||
let pos = getpos('.')
|
||||
try
|
||||
let val = s:ClojureIsMethodSpecialCaseWorker(a:position)
|
||||
let val = s:clojure_is_method_special_case_worker(a:position)
|
||||
finally
|
||||
call setpos('.', pos)
|
||||
endtry
|
||||
return val
|
||||
endfunction
|
||||
|
||||
function! GetClojureIndent()
|
||||
" Returns 1 for opening brackets, -1 for _anything else_.
|
||||
function! s:bracket_type(char)
|
||||
return stridx('([{', a:char) > -1 ? 1 : -1
|
||||
endfunction
|
||||
|
||||
" Returns: [opening-bracket-lnum, indent]
|
||||
function! s:clojure_indent_pos()
|
||||
" Get rid of special case.
|
||||
if line(".") == 1
|
||||
return 0
|
||||
return [0, 0]
|
||||
endif
|
||||
|
||||
" We have to apply some heuristics here to figure out, whether to use
|
||||
" normal lisp indenting or not.
|
||||
let i = s:CheckForString()
|
||||
let i = s:check_for_string()
|
||||
if i > -1
|
||||
return i + !!g:clojure_align_multiline_strings
|
||||
return [0, i + !!g:clojure_align_multiline_strings]
|
||||
endif
|
||||
|
||||
call cursor(0, 1)
|
||||
@ -207,28 +216,28 @@ if exists("*searchpairpos")
|
||||
" Find the next enclosing [ or {. We can limit the second search
|
||||
" to the line, where the [ was found. If no [ was there this is
|
||||
" zero and we search for an enclosing {.
|
||||
let paren = s:MatchPairs('(', ')', 0)
|
||||
let bracket = s:MatchPairs('\[', '\]', paren[0])
|
||||
let curly = s:MatchPairs('{', '}', bracket[0])
|
||||
let paren = s:match_pairs('(', ')', 0)
|
||||
let bracket = s:match_pairs('\[', '\]', paren[0])
|
||||
let curly = s:match_pairs('{', '}', bracket[0])
|
||||
|
||||
" In case the curly brace is on a line later then the [ or - in
|
||||
" case they are on the same line - in a higher column, we take the
|
||||
" curly indent.
|
||||
if curly[0] > bracket[0] || curly[1] > bracket[1]
|
||||
if curly[0] > paren[0] || curly[1] > paren[1]
|
||||
return curly[1]
|
||||
return curly
|
||||
endif
|
||||
endif
|
||||
|
||||
" If the curly was not chosen, we take the bracket indent - if
|
||||
" there was one.
|
||||
if bracket[0] > paren[0] || bracket[1] > paren[1]
|
||||
return bracket[1]
|
||||
return bracket
|
||||
endif
|
||||
|
||||
" There are neither { nor [ nor (, ie. we are at the toplevel.
|
||||
if paren == [0, 0]
|
||||
return 0
|
||||
return paren
|
||||
endif
|
||||
|
||||
" Now we have to reimplement lispindent. This is surprisingly easy, as
|
||||
@ -246,58 +255,106 @@ if exists("*searchpairpos")
|
||||
" - In any other case we use the column of the end of the word + 2.
|
||||
call cursor(paren)
|
||||
|
||||
if s:IsMethodSpecialCase(paren)
|
||||
return paren[1] + &shiftwidth - 1
|
||||
if s:is_method_special_case(paren)
|
||||
return [paren[0], paren[1] + &shiftwidth - 1]
|
||||
endif
|
||||
|
||||
" In case we are at the last character, we use the paren position.
|
||||
if col("$") - 1 == paren[1]
|
||||
return paren[1]
|
||||
return paren
|
||||
endif
|
||||
|
||||
" In case after the paren is a whitespace, we search for the next word.
|
||||
call cursor(0, col('.') + 1)
|
||||
if s:CurrentChar() == ' '
|
||||
if s:current_char() == ' '
|
||||
call search('\v\S', 'W')
|
||||
endif
|
||||
|
||||
" If we moved to another line, there is no word after the (. We
|
||||
" use the ( position for indent.
|
||||
if line(".") > paren[0]
|
||||
return paren[1]
|
||||
return paren
|
||||
endif
|
||||
|
||||
" We still have to check, whether the keyword starts with a (, [ or {.
|
||||
" In that case we use the ( position for indent.
|
||||
let w = s:CurrentWord()
|
||||
if stridx('([{', w[0]) > -1
|
||||
return paren[1]
|
||||
let w = s:current_word()
|
||||
if s:bracket_type(w[0]) == 1
|
||||
return paren
|
||||
endif
|
||||
|
||||
" Test words without namespace qualifiers and leading reader macro
|
||||
" metacharacters.
|
||||
"
|
||||
" e.g. clojure.core/defn and #'defn should both indent like defn.
|
||||
let ww = s:StripNamespaceAndMacroChars(w)
|
||||
let ww = s:strip_namespace_and_macro_chars(w)
|
||||
|
||||
if &lispwords =~# '\V\<' . ww . '\>'
|
||||
return paren[1] + &shiftwidth - 1
|
||||
return [paren[0], paren[1] + &shiftwidth - 1]
|
||||
endif
|
||||
|
||||
if g:clojure_fuzzy_indent
|
||||
\ && !s:MatchesOne(g:clojure_fuzzy_indent_blacklist, ww)
|
||||
\ && s:MatchesOne(g:clojure_fuzzy_indent_patterns, ww)
|
||||
return paren[1] + &shiftwidth - 1
|
||||
\ && !s:match_one(g:clojure_fuzzy_indent_blacklist, ww)
|
||||
\ && s:match_one(g:clojure_fuzzy_indent_patterns, ww)
|
||||
return [paren[0], paren[1] + &shiftwidth - 1]
|
||||
endif
|
||||
|
||||
call search('\v\_s', 'cW')
|
||||
call search('\v\S', 'W')
|
||||
if paren[0] < line(".")
|
||||
return paren[1] + (g:clojure_align_subforms ? 0 : &shiftwidth - 1)
|
||||
return [paren[0], paren[1] + (g:clojure_align_subforms ? 0 : &shiftwidth - 1)]
|
||||
endif
|
||||
|
||||
call search('\v\S', 'bW')
|
||||
return virtcol(".") + 1
|
||||
return [line('.'), virtcol('.') + 1]
|
||||
endfunction
|
||||
|
||||
function! GetClojureIndent()
|
||||
let lnum = line('.')
|
||||
let [opening_lnum, indent] = s:clojure_indent_pos()
|
||||
|
||||
" Return if there are no previous lines to inherit from
|
||||
if opening_lnum < 1 || opening_lnum >= lnum - 1
|
||||
return indent
|
||||
endif
|
||||
|
||||
let bracket_count = 0
|
||||
|
||||
" Take the indent of the first previous non-white line that is
|
||||
" at the same sexp level. cf. src/misc1.c:get_lisp_indent()
|
||||
while 1
|
||||
let lnum = prevnonblank(lnum - 1)
|
||||
let col = 1
|
||||
|
||||
if lnum <= opening_lnum
|
||||
break
|
||||
endif
|
||||
|
||||
call cursor(lnum, col)
|
||||
|
||||
" Handle bracket counting edge case
|
||||
if s:is_paren()
|
||||
let bracket_count += s:bracket_type(s:current_char())
|
||||
endif
|
||||
|
||||
while 1
|
||||
if search('\v[(\[{}\])]', '', lnum) < 1
|
||||
break
|
||||
elseif !s:ignored_region()
|
||||
let bracket_count += s:bracket_type(s:current_char())
|
||||
endif
|
||||
endwhile
|
||||
|
||||
if bracket_count == 0
|
||||
" Check if this is part of a multiline string
|
||||
call cursor(lnum, 1)
|
||||
if s:syn_id_name() !~? '\vstring|regex'
|
||||
return indent(lnum)
|
||||
endif
|
||||
endif
|
||||
endwhile
|
||||
|
||||
return indent
|
||||
endfunction
|
||||
|
||||
setlocal indentexpr=GetClojureIndent()
|
||||
|
@ -1,7 +1,7 @@
|
||||
" Vim indent file
|
||||
" Language: Cucumber
|
||||
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
||||
" Last Change: 2010 May 21
|
||||
" Last Change: 2013 May 30
|
||||
|
||||
if exists("b:did_indent")
|
||||
finish
|
||||
|
@ -36,7 +36,7 @@ let b:did_indent = 1
|
||||
|
||||
" [-- local settings (must come before aborting the script) --]
|
||||
setlocal indentexpr=HtmlIndentGet(v:lnum)
|
||||
setlocal indentkeys=o,O,*<Return>,<>>,{,}
|
||||
setlocal indentkeys=o,O,*<Return>,<>>,{,},!^F
|
||||
|
||||
|
||||
let s:tags = []
|
||||
|
File diff suppressed because one or more lines are too long
@ -2,11 +2,14 @@
|
||||
" Language: Cucumber
|
||||
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
||||
" Filenames: *.feature
|
||||
" Last Change: 2010 May 21
|
||||
" Last Change: 2013 May 30
|
||||
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
let s:keepcpo= &cpo
|
||||
set cpo&vim
|
||||
|
||||
syn case match
|
||||
syn sync minlines=20
|
||||
|
||||
@ -133,4 +136,7 @@ hi def link cucumberThen Type
|
||||
|
||||
let b:current_syntax = "cucumber"
|
||||
|
||||
let &cpo = s:keepcpo
|
||||
unlet s:keepcpo
|
||||
|
||||
" vim:set sts=2 sw=2:
|
||||
|
@ -67,7 +67,7 @@ syn region hamlJavascriptFilter matchgroup=hamlFilter start="^\z(\s*\):javascri
|
||||
syn region hamlCSSFilter matchgroup=hamlFilter start="^\z(\s*\):css\s*$" end="^\%(\z1 \| *$\)\@!" contains=@htmlCss,hamlInterpolation keepend
|
||||
syn region hamlSassFilter matchgroup=hamlFilter start="^\z(\s*\):sass\s*$" end="^\%(\z1 \| *$\)\@!" contains=@hamlSassTop
|
||||
|
||||
syn region hamlJavascriptBlock start="^\z(\s*\)%script" nextgroup=@hamlComponent,hamlError end="^\%(\z1 \| *$\)\@!" contains=@hamlTop,@htmlJavaScript keepend
|
||||
syn region hamlJavascriptBlock start="^\z(\s*\)%script\%((type=[\"']text/javascript[\"'])\)\=\s*$" nextgroup=@hamlComponent,hamlError end="^\%(\z1 \| *$\)\@!" contains=@hamlTop,@htmlJavaScript keepend
|
||||
syn region hamlCssBlock start="^\z(\s*\)%style" nextgroup=@hamlComponent,hamlError end="^\%(\z1 \| *$\)\@!" contains=@hamlTop,@htmlCss keepend
|
||||
syn match hamlError "\$" contained
|
||||
|
||||
|
@ -96,7 +96,7 @@ syn match perlStatementFiles "\<\%(ch\%(dir\|mod\|own\|root\)\|glob\|link\|mkdi
|
||||
syn match perlStatementFiles "-[rwxoRWXOezsfdlpSbctugkTBMAC]\>"
|
||||
syn match perlStatementFlow "\<\%(caller\|die\|dump\|eval\|exit\|wantarray\|evalbytes\)\>"
|
||||
syn match perlStatementInclude "\<\%(require\|import\|unimport\)\>"
|
||||
syn match perlStatementInclude "\<\%(use\|no\)\s\+\%(\%(attributes\|attrs\|autouse\|parent\|base\|big\%(int\|num\|rat\)\|blib\|bytes\|charnames\|constant\|diagnostics\|encoding\%(::warnings\)\=\|feature\|fields\|filetest\|if\|integer\|less\|lib\|locale\|mro\|open\|ops\|overload\|re\|sigtrap\|sort\|strict\|subs\|threads\%(::shared\)\=\|utf8\|vars\|version\|vmsish\|warnings\%(::register\)\=\)\>\)\="
|
||||
syn match perlStatementInclude "\<\%(use\|no\)\s\+\%(\%(attributes\|attrs\|autodie\|autouse\|parent\|base\|big\%(int\|num\|rat\)\|blib\|bytes\|charnames\|constant\|diagnostics\|encoding\%(::warnings\)\=\|feature\|fields\|filetest\|if\|integer\|less\|lib\|locale\|mro\|open\|ops\|overload\|overloading\|re\|sigtrap\|sort\|strict\|subs\|threads\%(::shared\)\=\|utf8\|vars\|version\|vmsish\|warnings\%(::register\)\=\)\>\)\="
|
||||
syn match perlStatementProc "\<\%(alarm\|exec\|fork\|get\%(pgrp\|ppid\|priority\)\|kill\|pipe\|set\%(pgrp\|priority\)\|sleep\|system\|times\|wait\%(pid\)\=\)\>"
|
||||
syn match perlStatementSocket "\<\%(accept\|bind\|connect\|get\%(peername\|sock\%(name\|opt\)\)\|listen\|recv\|send\|setsockopt\|shutdown\|socket\%(pair\)\=\)\>"
|
||||
syn match perlStatementIPC "\<\%(msg\%(ctl\|get\|rcv\|snd\)\|sem\%(ctl\|get\|op\)\|shm\%(ctl\|get\|read\|write\)\)\>"
|
||||
|
@ -100,10 +100,6 @@ syn match rubySymbol "[]})\"':]\@<!:\%(\^\|\~\|<<\|<=>\|<=\|<\|===\|[=!]=\|[=!
|
||||
syn match rubySymbol "[]})\"':]\@<!:\$\%(-.\|[`~<=>_,;:!?/.'"@$*\&+0]\)"
|
||||
syn match rubySymbol "[]})\"':]\@<!:\%(\$\|@@\=\)\=\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*"
|
||||
syn match rubySymbol "[]})\"':]\@<!:\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*\%([?!=]>\@!\)\="
|
||||
syn match rubySymbol "\%([{(,]\_s*\)\@<=\l\w*[!?]\=::\@!"he=e-1
|
||||
syn match rubySymbol "[]})\"':]\@<!\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*[!?]\=:[[:space:],]\@="he=e-1
|
||||
syn match rubySymbol "\%([{(,]\_s*\)\@<=[[:space:],{]\l\w*[!?]\=::\@!"hs=s+1,he=e-1
|
||||
syn match rubySymbol "[[:space:],{(]\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*[!?]\=:[[:space:],]\@="hs=s+1,he=e-1
|
||||
syn region rubySymbol start="[]})\"':]\@<!:'" end="'" skip="\\\\\|\\'" contains=rubyQuoteEscape fold
|
||||
syn region rubySymbol start="[]})\"':]\@<!:\"" end="\"" skip="\\\\\|\\\"" contains=@rubyStringSpecial fold
|
||||
|
||||
@ -293,6 +289,11 @@ syn match rubyKeywordAsMethod "\%(\%(\.\@<!\.\)\|::\)\_s*\%(extend\|fail\|fork\|
|
||||
syn match rubyKeywordAsMethod "\%(\%(\.\@<!\.\)\|::\)\_s*\%(load\|loop\|prepend\|private\|proc\|protected\)\>" transparent contains=NONE
|
||||
syn match rubyKeywordAsMethod "\%(\%(\.\@<!\.\)\|::\)\_s*\%(public\|require\|require_relative\|raise\|throw\|trap\|using\)\>" transparent contains=NONE
|
||||
|
||||
syn match rubySymbol "\%([{(,]\_s*\)\@<=\l\w*[!?]\=::\@!"he=e-1
|
||||
syn match rubySymbol "[]})\"':]\@<!\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*[!?]\=:[[:space:],]\@="he=e-1
|
||||
syn match rubySymbol "\%([{(,]\_s*\)\@<=[[:space:],{]\l\w*[!?]\=::\@!"hs=s+1,he=e-1
|
||||
syn match rubySymbol "[[:space:],{(]\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*[!?]\=:[[:space:],]\@="hs=s+1,he=e-1
|
||||
|
||||
" __END__ Directive
|
||||
syn region rubyData matchgroup=rubyDataDirective start="^__END__$" end="\%$" fold
|
||||
|
||||
|
@ -52,7 +52,7 @@ syn keyword rustType f64 i8 i16 i32 i64 str Self
|
||||
" to make it easy to update.
|
||||
|
||||
" Core operators {{{3
|
||||
syn keyword rustTrait Freeze Pod Send Sized
|
||||
syn keyword rustTrait Share Copy Send Sized
|
||||
syn keyword rustTrait Add Sub Mul Div Rem Neg Not
|
||||
syn keyword rustTrait BitAnd BitOr BitXor
|
||||
syn keyword rustTrait Drop
|
||||
@ -72,7 +72,7 @@ syn keyword rustTrait Any AnyOwnExt AnyRefExt AnyMutRefExt
|
||||
syn keyword rustTrait Ascii AsciiCast OwnedAsciiCast AsciiStr IntoBytes
|
||||
syn keyword rustTrait ToCStr
|
||||
syn keyword rustTrait Char
|
||||
syn keyword rustTrait Clone DeepClone
|
||||
syn keyword rustTrait Clone
|
||||
syn keyword rustTrait Eq Ord TotalEq TotalOrd Ordering Equiv
|
||||
syn keyword rustEnumVariant Less Equal Greater
|
||||
syn keyword rustTrait Container Mutable Map MutableMap Set MutableSet
|
||||
@ -135,7 +135,7 @@ syn match rustStringContinuation display contained /\\\n\s*/
|
||||
syn region rustString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=rustSpecial,rustSpecialError,rustStringContinuation,@Spell
|
||||
syn region rustString start='r\z(#*\)"' end='"\z1' contains=@Spell
|
||||
|
||||
syn region rustAttribute start="#\[" end="\]" contains=rustString,rustDeriving
|
||||
syn region rustAttribute start="#!\?\[" end="\]" contains=rustString,rustDeriving
|
||||
syn region rustDeriving start="deriving(" end=")" contained contains=rustTrait
|
||||
|
||||
" Number literals
|
||||
|
@ -58,6 +58,7 @@ syn match sassAmpersand "&"
|
||||
" TODO: Attribute namespaces
|
||||
" TODO: Arithmetic (including strings and concatenation)
|
||||
|
||||
syn region sassCharset start="@charset" end=";\|$" contains=scssComment,cssStringQ,cssStringQQ,cssURL,cssUnicodeEscape,cssMediaType
|
||||
syn region sassInclude start="@import" end=";\|$" contains=scssComment,cssStringQ,cssStringQQ,cssURL,cssUnicodeEscape,cssMediaType
|
||||
syn region sassDebugLine end=";\|$" matchgroup=sassDebug start="@debug\>" contains=@sassCssAttributes,sassVariable,sassFunction
|
||||
syn region sassWarnLine end=";\|$" matchgroup=sassWarn start="@warn\>" contains=@sassCssAttributes,sassVariable,sassFunction
|
||||
@ -82,6 +83,7 @@ hi def link sassExtend PreProc
|
||||
hi def link sassFunctionDecl PreProc
|
||||
hi def link sassReturn PreProc
|
||||
hi def link sassTodo Todo
|
||||
hi def link sassCharset PreProc
|
||||
hi def link sassInclude Include
|
||||
hi def link sassDebug sassControl
|
||||
hi def link sassWarn sassControl
|
||||
|
@ -17,6 +17,8 @@ syn keyword scalaKeyword val nextgroup=scalaNameDefinition,scalaQuasiQuotes skip
|
||||
syn keyword scalaKeyword def var nextgroup=scalaNameDefinition skipwhite
|
||||
hi link scalaKeyword Keyword
|
||||
|
||||
syn region scalaBlock start=/{/ end=/}/ contains=TOP fold
|
||||
|
||||
syn keyword scalaAkkaSpecialWord when goto using startWith initialize onTransition stay become unbecome
|
||||
hi link scalaAkkaSpecialWord PreProc
|
||||
|
||||
@ -95,31 +97,26 @@ syn region scalaString start=/"/ end=/"/ contains=scalaStringEmbeddedQuote,scala
|
||||
hi link scalaString String
|
||||
hi link scalaStringEmbeddedQuote String
|
||||
|
||||
syn region scalaSString matchgroup=Special start=/s"/ skip=/\\"/ end=/"/ contains=scalaInterpolation,scalaEscapedChar,scalaUnicodeChar
|
||||
syn match scalaInterpolation /\$[a-zA-Z0-9_$]\+/ contained
|
||||
syn match scalaInterpolation /\${[^}]\+}/ contained
|
||||
hi link scalaSString String
|
||||
hi link scalaInterpolation Function
|
||||
syn region scalaIString matchgroup=Special start=/\<[a-zA-Z][a-zA-Z0-9_]*"/ skip=/\\"/ end=/"/ contains=scalaInterpolation,scalaInterpolationB,scalaEscapedChar,scalaUnicodeChar
|
||||
syn region scalaTripleIString matchgroup=Special start=/\<[a-zA-Z][a-zA-Z0-9_]*"""/ end=/"""\%([^"]\|$\)/ contains=scalaInterpolation,scalaInterpolationB,scalaEscapedChar,scalaUnicodeChar
|
||||
hi link scalaIString String
|
||||
hi link scalaTripleIString String
|
||||
|
||||
syn region scalaFString matchgroup=Special start=/f"/ skip=/\\"/ end=/"/ contains=scalaInterpolation,scalaFInterpolation,scalaEscapedChar,scalaUnicodeChar
|
||||
syn match scalaFInterpolation /\$[a-zA-Z0-9_$]\+%[-A-Za-z0-9\.]\+/ contained
|
||||
syn match scalaFInterpolation /\${[^}]\+}%[-A-Za-z0-9\.]\+/ contained
|
||||
syn match scalaInterpolation /\$[a-zA-Z0-9_$]\+/ contained
|
||||
syn region scalaInterpolationB matchgroup=scalaInterpolation start=/\${/ end=/}/ contained contains=TOP
|
||||
hi link scalaInterpolation Function
|
||||
hi link scalaInterpolationB Normal
|
||||
|
||||
syn region scalaFString matchgroup=Special start=/f"/ skip=/\\"/ end=/"/ contains=scalaFInterpolation,scalaFInterpolationB,scalaEscapedChar,scalaUnicodeChar
|
||||
syn match scalaFInterpolation /\$[a-zA-Z0-9_$]\+\(%[-A-Za-z0-9\.]\+\)\?/ contained
|
||||
syn region scalaFInterpolationB matchgroup=scalaFInterpolation start=/${/ end=/}\(%[-A-Za-z0-9\.]\+\)\?/ contained contains=TOP
|
||||
hi link scalaFString String
|
||||
hi link scalaFInterpolation Function
|
||||
|
||||
syn region scalaQuasiQuotes matchgroup=Type start=/\<q"/ skip=/\\"/ end=/"/ contains=scalaInterpolation
|
||||
syn region scalaQuasiQuotes matchgroup=Type start=/\<[tcp]q"/ skip=/\\"/ end=/"/ contains=scalaInterpolation
|
||||
hi link scalaQuasiQuotes String
|
||||
|
||||
syn region scalaTripleQuasiQuotes matchgroup=Type start=/\<q"""/ end=/"""\%([^"]\|$\)/ contains=scalaInterpolation
|
||||
syn region scalaTripleQuasiQuotes matchgroup=Type start=/\<[tcp]q"""/ end=/"""\%([^"]\|$\)/ contains=scalaInterpolation
|
||||
hi link scalaTripleQuasiQuotes String
|
||||
hi link scalaFInterpolationB Normal
|
||||
|
||||
syn region scalaTripleString start=/"""/ end=/"""\%([^"]\|$\)/ contains=scalaEscapedChar,scalaUnicodeChar
|
||||
syn region scalaTripleSString matchgroup=Special start=/s"""/ end=/"""\%([^"]\|$\)/ contains=scalaInterpolation,scalaEscapedChar,scalaUnicodeChar
|
||||
syn region scalaTripleFString matchgroup=Special start=/f"""/ end=/"""\%([^"]\|$\)/ contains=scalaInterpolation,scalaFInterpolation,scalaEscapedChar,scalaUnicodeChar
|
||||
syn region scalaTripleFString matchgroup=Special start=/f"""/ end=/"""\%([^"]\|$\)/ contains=scalaFInterpolation,scalaFInterpolationB,scalaEscapedChar,scalaUnicodeChar
|
||||
hi link scalaTripleString String
|
||||
hi link scalaTripleSString String
|
||||
hi link scalaTripleFString String
|
||||
|
||||
syn match scalaNumber /\<0[dDfFlL]\?\>/ " Just a bare 0
|
||||
|
Loading…
Reference in New Issue
Block a user