diff --git a/after/ftplugin/terraform.vim b/after/ftplugin/terraform.vim index 0597b42..a175098 100644 --- a/after/ftplugin/terraform.vim +++ b/after/ftplugin/terraform.vim @@ -39,6 +39,8 @@ function! TerraformFolds() return ">1" elseif match(thisline, '^terraform') >= 0 return ">1" + elseif match(thisline, '^locals') >= 0 + return ">1" else return "=" endif diff --git a/after/syntax/jsx.vim b/after/syntax/jsx.vim index a8ca0ae..0598714 100644 --- a/after/syntax/jsx.vim +++ b/after/syntax/jsx.vim @@ -49,7 +49,7 @@ syn region jsxChild contained start=+{+ end=++ contains=jsBlock,javascriptBlock " and generic Flow type annotations (http://flowtype.org/). syn region jsxRegion \ contains=@Spell,@XMLSyntax,jsxRegion,jsxChild,jsBlock,javascriptBlock - \ start=+\%(<\|\w\)\@[:,]\@!\)\([^>]*>(\)\@!+ \ skip=++ \ end=++ \ end=+/>+ diff --git a/compiler/go.vim b/compiler/go.vim index 5c30dd2..162fa7f 100644 --- a/compiler/go.vim +++ b/compiler/go.vim @@ -6,10 +6,10 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'go') == -1 " " compiler/go.vim: Vim compiler file for Go. -if exists("current_compiler") +if exists("g:current_compiler") finish endif -let current_compiler = "go" +let g:current_compiler = "go" if exists(":CompilerSet") != 2 command -nargs=* CompilerSet setlocal diff --git a/ftdetect/polyglot.vim b/ftdetect/polyglot.vim index d3a204e..e42ae50 100644 --- a/ftdetect/polyglot.vim +++ b/ftdetect/polyglot.vim @@ -339,15 +339,18 @@ function! s:gofiletype_post() let &g:fileencodings = s:current_fileencodings endfunction -au BufNewFile *.go setfiletype go | setlocal fileencoding=utf-8 fileformat=unix -au BufRead *.go call s:gofiletype_pre("go") -au BufReadPost *.go call s:gofiletype_post() +augroup vim-go-filetype + autocmd! + au BufNewFile *.go setfiletype go | setlocal fileencoding=utf-8 fileformat=unix + au BufRead *.go call s:gofiletype_pre("go") + au BufReadPost *.go call s:gofiletype_post() -au BufNewFile *.s setfiletype asm | setlocal fileencoding=utf-8 fileformat=unix -au BufRead *.s call s:gofiletype_pre("asm") -au BufReadPost *.s call s:gofiletype_post() + au BufNewFile *.s setfiletype asm | setlocal fileencoding=utf-8 fileformat=unix + au BufRead *.s call s:gofiletype_pre("asm") + au BufReadPost *.s call s:gofiletype_post() -au BufRead,BufNewFile *.tmpl set filetype=gohtmltmpl + au BufRead,BufNewFile *.tmpl set filetype=gohtmltmpl +augroup end " vim: sw=2 ts=2 et augroup END @@ -919,7 +922,7 @@ fun! s:DetectScala() endif endfun -au BufRead,BufNewFile *.scala set filetype=scala +au BufRead,BufNewFile *.scala,*.sc set filetype=scala au BufRead,BufNewFile * call s:DetectScala() " Install vim-sbt for additional syntax highlighting. @@ -1021,8 +1024,8 @@ augroup END augroup filetypedetect " toml:cespare/vim-toml -" Rust uses several TOML config files that are not named with .toml. -autocmd BufNewFile,BufRead *.toml,Cargo.lock,*/.cargo/config set filetype=toml +" Go dep and Rust use several TOML config files that are not named with .toml. +autocmd BufNewFile,BufRead *.toml,Gopkg.lock,Cargo.lock,*/.cargo/config set filetype=toml augroup END augroup filetypedetect diff --git a/ftplugin/typescript.vim b/ftplugin/typescript.vim index 2a9af1e..69631e1 100644 --- a/ftplugin/typescript.vim +++ b/ftplugin/typescript.vim @@ -15,7 +15,7 @@ setlocal commentstring=//\ %s " " and insert the comment leader when hitting or using "o". setlocal formatoptions-=t formatoptions+=croql -setlocal suffixesadd+=.ts +setlocal suffixesadd+=.ts,.tsx let b:undo_ftplugin = "setl fo< ofu< com< cms<" diff --git a/indent/blade.vim b/indent/blade.vim index 95cc00a..e93d48c 100644 --- a/indent/blade.vim +++ b/indent/blade.vim @@ -19,7 +19,7 @@ let b:did_indent = 1 " Doesn't include 'foreach' and 'forelse' because these already get matched by 'for'. let s:directives_start = 'if\|else\|unless\|for\|while\|empty\|push\|section\|can\|hasSection\|verbatim\|php\|' . - \ 'component\|slot\|prepend' + \ 'component\|slot\|prepend\|auth\|guest' let s:directives_end = 'else\|end\|empty\|show\|stop\|append\|overwrite' if exists('g:blade_custom_directives_pairs') diff --git a/indent/clojure.vim b/indent/clojure.vim index f538195..6d21c3d 100644 --- a/indent/clojure.vim +++ b/indent/clojure.vim @@ -192,11 +192,7 @@ if exists("*searchpairpos") " Check if form is a reader conditional, that is, it is prefixed by #? " or @#? function! s:is_reader_conditional_special_case(position) - if getline(a:position[0])[a:position[1] - 3 : a:position[1] - 2] == "#?" - return 1 - endif - - return 0 + return getline(a:position[0])[a:position[1] - 3 : a:position[1] - 2] == "#?" endfunction " Returns 1 for opening brackets, -1 for _anything else_. @@ -294,6 +290,19 @@ if exists("*searchpairpos") return paren endif + " If the keyword begins with #, check if it is an anonymous + " function or set, in which case we indent by the shiftwidth + " (minus one if g:clojure_align_subforms = 1), or if it is + " ignored, in which case we use the ( position for indent. + if w[0] == "#" + " TODO: Handle #=() and other rare reader invocations? + if w[1] == '(' || w[1] == '{' + return [paren[0], paren[1] + (g:clojure_align_subforms ? 0 : &shiftwidth - 1)] + elseif w[1] == '_' + return paren + endif + endif + " Test words without namespace qualifiers and leading reader macro " metacharacters. " diff --git a/indent/glsl.vim b/indent/glsl.vim index b959da0..64f3a6f 100644 --- a/indent/glsl.vim +++ b/indent/glsl.vim @@ -8,6 +8,7 @@ if exists("b:did_indent") endif setlocal autoindent cindent +setlocal formatoptions+=roq " vim:set sts=2 sw=2 : diff --git a/indent/javascript.vim b/indent/javascript.vim index 728fa11..f6fda1d 100644 --- a/indent/javascript.vim +++ b/indent/javascript.vim @@ -12,10 +12,6 @@ if exists('b:did_indent') endif let b:did_indent = 1 -" indent correctly if inside