33 changed files with 1757 additions and 517 deletions
@ -0,0 +1,6 @@ |
|||||||
|
" Slow yaml highlighting workaround |
||||||
|
if exists('+regexpengine') && ('®expengine' == 0) |
||||||
|
setlocal regexpengine=1 |
||||||
|
endif |
||||||
|
set isfname+=@-@ |
||||||
|
set path+=./../templates,./../files,templates,files |
@ -0,0 +1,10 @@ |
|||||||
|
if exists("b:did_ftplugin") |
||||||
|
finish |
||||||
|
else |
||||||
|
let b:did_ftplugin = 1 |
||||||
|
endif |
||||||
|
|
||||||
|
setlocal syntax=dosini |
||||||
|
setlocal comments=:# commentstring=#\ %s formatoptions-=t formatoptions-=c |
||||||
|
|
||||||
|
let b:undo_ftplugin = "setl comments< commentstring< formatoptions<" |
@ -1,4 +1,131 @@ |
|||||||
set makeprg=ghc\ %\ -o\ %< " Компилятор |
set makeprg=ghc\ %\ -o\ %< " Компилятор |
||||||
|
|
||||||
call SetHaskellFolding() |
runtime syntax/custom/HaskellConceal.vim |
||||||
|
|
||||||
|
|
||||||
|
" ============================================================================= |
||||||
|
" Descriptions: Provide a function providing folding information for haskell |
||||||
|
" files. |
||||||
|
" Maintainer: Vincent B (twinside@gmail.com) |
||||||
|
" Warning: Assume the presence of type signatures on top of your functions to |
||||||
|
" work well. |
||||||
|
" Usage: drop in ~/vimfiles/plugin or ~/.vim/plugin |
||||||
|
" Version: 1.2 |
||||||
|
" Changelog: - 1.2 : Reacting to file type instead of file extension. |
||||||
|
" - 1.1 : Adding foldtext to bet more information. |
||||||
|
" - 1.0 : initial version |
||||||
|
" ============================================================================= |
||||||
|
" Top level bigdefs |
||||||
|
fun! s:HaskellFoldMaster( line ) "{{{ |
||||||
|
return a:line =~# '^data\s' |
||||||
|
\ || a:line =~# '^type\s' |
||||||
|
\ || a:line =~# '^newtype\s' |
||||||
|
\ || a:line =~# '^class\s' |
||||||
|
\ || a:line =~# '^instance\s' |
||||||
|
\ || a:line =~ '^[^:]\+\s*::' |
||||||
|
endfunction "}}} |
||||||
|
|
||||||
|
" Top Level one line shooters. |
||||||
|
fun! s:HaskellSnipGlobal(line) "{{{ |
||||||
|
return a:line =~# '^module' |
||||||
|
\ || a:line =~# '^import' |
||||||
|
\ || a:line =~# '^infix[lr]\s' |
||||||
|
endfunction "}}} |
||||||
|
|
||||||
|
" The real folding function |
||||||
|
fun! HaskellFold( lineNum ) "{{{ |
||||||
|
let line = getline( a:lineNum ) |
||||||
|
|
||||||
|
" Beginning of comment |
||||||
|
if line =~ '^\s*--' || line =~ '^\s*{-' |
||||||
|
return 2 |
||||||
|
endif |
||||||
|
|
||||||
|
if line =~ '^import' |
||||||
|
return 2 |
||||||
|
endif |
||||||
|
|
||||||
|
if s:HaskellSnipGlobal( line ) |
||||||
|
return 0 |
||||||
|
endif |
||||||
|
|
||||||
|
if line =~ '^\s*$' |
||||||
|
let nextline = getline(a:lineNum + 1) |
||||||
|
if s:HaskellFoldMaster( nextline ) > 0 || s:HaskellSnipGlobal( nextline ) > 0 |
||||||
|
\ || nextline =~ "^--" || nextline =~ "^{-" |
||||||
|
return 0 |
||||||
|
else |
||||||
|
return -1 |
||||||
|
endif |
||||||
|
endif |
||||||
|
|
||||||
|
return 1 |
||||||
|
endfunction "}}} |
||||||
|
|
||||||
|
" This function skim over function definitions |
||||||
|
" skiping comments line : |
||||||
|
" -- .... |
||||||
|
" and merging lines without first non space element, to |
||||||
|
" catch the full type expression. |
||||||
|
fun! HaskellFoldText() "{{{ |
||||||
|
let i = v:foldstart |
||||||
|
let retVal = '' |
||||||
|
let began = 0 |
||||||
|
|
||||||
|
let commentOnlyLine = '^\s*--.*$' |
||||||
|
let monoLineComment = '\s*--.*$' |
||||||
|
let nonEmptyLine = '^\s\+\S' |
||||||
|
let emptyLine = '^\s*$' |
||||||
|
let multilineCommentBegin = '^\s*{-' |
||||||
|
let multilineCommentEnd = '-}' |
||||||
|
|
||||||
|
let short = get(g:, 'haskellFold_ShortText', 0) |
||||||
|
let isMultiLine = 0 |
||||||
|
|
||||||
|
let line = getline(i) |
||||||
|
while i <= v:foldend |
||||||
|
|
||||||
|
if isMultiLine |
||||||
|
if line =~ multilineCommentEnd |
||||||
|
let isMultiLine = 0 |
||||||
|
let line = substitute(line, '.*-}', '', '') |
||||||
|
|
||||||
|
if line =~ emptyLine |
||||||
|
let i = i + 1 |
||||||
|
let line = getline(i) |
||||||
|
end |
||||||
|
else |
||||||
|
let i = i + 1 |
||||||
|
let line = getline(i) |
||||||
|
end |
||||||
|
else |
||||||
|
if line =~ multilineCommentBegin |
||||||
|
let isMultiLine = 1 |
||||||
|
continue |
||||||
|
elseif began == 0 && !(line =~ commentOnlyLine) |
||||||
|
let retVal = substitute(line, monoLineComment, ' ','') |
||||||
|
let began = 1 |
||||||
|
elseif began != 0 && line =~ nonEmptyLine && !short |
||||||
|
let tempVal = substitute( line, '\s\+\(.*\)$', ' \1', '' ) |
||||||
|
let retVal = retVal . substitute(tempVal, '\s\+--.*', ' ','') |
||||||
|
elseif began != 0 |
||||||
|
break |
||||||
|
endif |
||||||
|
|
||||||
|
let i = i + 1 |
||||||
|
let line = getline(i) |
||||||
|
endif |
||||||
|
endwhile |
||||||
|
|
||||||
|
if retVal == '' |
||||||
|
" We didn't found any meaningfull text |
||||||
|
return foldtext() |
||||||
|
endif |
||||||
|
|
||||||
|
return retVal |
||||||
|
endfunction "}}} |
||||||
|
|
||||||
|
setlocal foldexpr=HaskellFold(v:lnum) |
||||||
|
setlocal foldtext=HaskellFoldText() |
||||||
|
setlocal foldmethod=expr |
||||||
|
|
||||||
|
@ -0,0 +1,61 @@ |
|||||||
|
" Vim filetype plugin |
||||||
|
" Language: Liquid |
||||||
|
" Maintainer: Tim Pope <vimNOSPAM@tpope.org> |
||||||
|
" Last Change: 2010 May 21 |
||||||
|
|
||||||
|
if exists('b:did_ftplugin') |
||||||
|
finish |
||||||
|
endif |
||||||
|
|
||||||
|
if !exists('g:liquid_default_subtype') |
||||||
|
let g:liquid_default_subtype = 'html' |
||||||
|
endif |
||||||
|
|
||||||
|
if !exists('b:liquid_subtype') |
||||||
|
let s:lines = getline(1)."\n".getline(2)."\n".getline(3)."\n".getline(4)."\n".getline(5)."\n".getline("$") |
||||||
|
let b:liquid_subtype = matchstr(s:lines,'liquid_subtype=\zs\w\+') |
||||||
|
if b:liquid_subtype == '' |
||||||
|
let b:liquid_subtype = matchstr(&filetype,'^liquid\.\zs\w\+') |
||||||
|
endif |
||||||
|
if b:liquid_subtype == '' |
||||||
|
let b:liquid_subtype = matchstr(substitute(expand('%:t'),'\c\%(\.liquid\)\+$','',''),'\.\zs\w\+$') |
||||||
|
endif |
||||||
|
if b:liquid_subtype == '' |
||||||
|
let b:liquid_subtype = g:liquid_default_subtype |
||||||
|
endif |
||||||
|
endif |
||||||
|
|
||||||
|
if exists('b:liquid_subtype') && b:liquid_subtype != '' |
||||||
|
exe 'runtime! ftplugin/'.b:liquid_subtype.'.vim ftplugin/'.b:liquid_subtype.'_*.vim ftplugin/'.b:liquid_subtype.'/*.vim' |
||||||
|
else |
||||||
|
runtime! ftplugin/html.vim ftplugin/html_*.vim ftplugin/html/*.vim |
||||||
|
endif |
||||||
|
let b:did_ftplugin = 1 |
||||||
|
|
||||||
|
if exists('b:undo_ftplugin') |
||||||
|
let b:undo_ftplugin .= '|' |
||||||
|
else |
||||||
|
let b:undo_ftplugin = '' |
||||||
|
endif |
||||||
|
if exists('b:browsefilter') |
||||||
|
let b:browsefilter = "\n".b:browsefilter |
||||||
|
else |
||||||
|
let b:browsefilter = '' |
||||||
|
endif |
||||||
|
if exists('b:match_words') |
||||||
|
let b:match_words .= ',' |
||||||
|
elseif exists('loaded_matchit') |
||||||
|
let b:match_words = '' |
||||||
|
endif |
||||||
|
|
||||||
|
if has('gui_win32') |
||||||
|
let b:browsefilter="Liquid Files (*.liquid)\t*.liquid" . b:browsefilter |
||||||
|
endif |
||||||
|
|
||||||
|
if exists('loaded_matchit') |
||||||
|
let b:match_words .= '\<\%(if\w*\|unless\|case\)\>:\<\%(elsif\|else\|when\)\>:\<end\%(if\w*\|unless\|case\)\>,\<\%(for\|tablerow\)\>:\%({%\s*\)\@<=empty\>:\<end\%(for\|tablerow\)\>,<\(capture\|comment\|highlight\)\>:\<end\1\>' |
||||||
|
endif |
||||||
|
|
||||||
|
setlocal commentstring={%\ comment\ %}%s{%\ endcomment\ %} |
||||||
|
|
||||||
|
let b:undo_ftplugin .= 'setl cms< | unlet! b:browsefilter b:match_words' |
@ -1 +1,4 @@ |
|||||||
set makeprg=racket\ % " Проверка на ошибки и синтаксис |
set makeprg=racket\ % " Проверка на ошибки и синтаксис |
||||||
|
|
||||||
|
runtime syntax/custom/RainbowParenthsis.vim |
||||||
|
|
||||||
|
@ -0,0 +1,61 @@ |
|||||||
|
" Slow yaml highlighting workaround |
||||||
|
if exists('+regexpengine') && ('®expengine' == 0) |
||||||
|
setlocal regexpengine=1 |
||||||
|
endif |
||||||
|
|
||||||
|
" Use two-spaces for indentation |
||||||
|
setlocal expandtab |
||||||
|
setlocal softtabstop=2 |
||||||
|
setlocal shiftwidth=2 |
||||||
|
setlocal commentstring=#%s |
||||||
|
|
||||||
|
setlocal formatoptions=crl |
||||||
|
" r -> don't add comment leader after an Enter |
||||||
|
" c -> wrap long comments, including # |
||||||
|
" l -> do not wrap long lines |
||||||
|
|
||||||
|
" indentation |
||||||
|
setlocal autoindent |
||||||
|
|
||||||
|
" This function is from https://gist.github.com/871107 |
||||||
|
" Author: Ian Young |
||||||
|
" |
||||||
|
function! GetYamlIndent() |
||||||
|
let cnum = v:lnum |
||||||
|
let lnum = v:lnum - 1 |
||||||
|
if lnum == 0 |
||||||
|
return 0 |
||||||
|
endif |
||||||
|
let line = substitute(getline(lnum),'\s\+$','','') |
||||||
|
let cline = substitute(getline(cnum),'\s\+$','','') |
||||||
|
let indent = indent(lnum) |
||||||
|
let increase = indent + &sw |
||||||
|
let decrease = indent - &sw |
||||||
|
if line =~ ':$' |
||||||
|
return increase |
||||||
|
elseif line !~ ':$' && cline =~ ':$' |
||||||
|
return decrease |
||||||
|
elseif line =~ ':$' |
||||||
|
else |
||||||
|
return indent |
||||||
|
endif |
||||||
|
endfunction |
||||||
|
|
||||||
|
setlocal indentexpr=GetYamlIndent() |
||||||
|
|
||||||
|
" folding |
||||||
|
setlocal foldmethod=indent |
||||||
|
setlocal foldlevel=20 " by default do not fold |
||||||
|
|
||||||
|
|
||||||
|
" Visual warning about UTF8 characters in SLS file. |
||||||
|
" salt does not like them much, so they should be red |
||||||
|
augroup utfsls |
||||||
|
autocmd! |
||||||
|
highlight UTFsls ctermbg=red guibg=red |
||||||
|
match UTFsls /[\x7F-\xFF]/ |
||||||
|
autocmd BufWinEnter <buffer> match UTFsls /[\x7F-\xFF]/ |
||||||
|
autocmd InsertEnter <buffer> match UTFsls /[\x7F-\xFF]/ |
||||||
|
autocmd InsertLeave <buffer> match UTFsls /[\x7F-\xFF]/ |
||||||
|
autocmd BufWinLeave <buffer> call clearmatches() |
||||||
|
augroup END |
@ -0,0 +1,184 @@ |
|||||||
|
" terraform.vim - basic vim/terraform integration |
||||||
|
" Maintainer: HashiVim <https://github.com/hashivim> |
||||||
|
|
||||||
|
let s:cpo_save = &cpoptions |
||||||
|
set cpoptions&vim |
||||||
|
|
||||||
|
" Ensure no conflict with arguments from the environment |
||||||
|
let $TF_CLI_ARGS_fmt='' |
||||||
|
|
||||||
|
function! TerraformFmt() abort |
||||||
|
" Save the view. |
||||||
|
let curw = winsaveview() |
||||||
|
|
||||||
|
" Make a fake change so that the undo point is right. |
||||||
|
normal! ix |
||||||
|
normal! "_x |
||||||
|
|
||||||
|
" Execute `terraform fmt`, redirecting stderr to a temporary file. |
||||||
|
let tmpfile = tempname() |
||||||
|
let shellredir_save = &shellredir |
||||||
|
let &shellredir = '>%s 2>'.tmpfile |
||||||
|
silent execute '%!'.g:terraform_binary_path.' fmt -no-color -' |
||||||
|
let &shellredir = shellredir_save |
||||||
|
|
||||||
|
" If there was an error, undo any changes and show stderr. |
||||||
|
if v:shell_error != 0 |
||||||
|
silent undo |
||||||
|
let output = readfile(tmpfile) |
||||||
|
echo join(output, "\n") |
||||||
|
endif |
||||||
|
|
||||||
|
" Delete the temporary file, and restore the view. |
||||||
|
call delete(tmpfile) |
||||||
|
call winrestview(curw) |
||||||
|
endfunction |
||||||
|
|
||||||
|
function! TerraformAlign() abort |
||||||
|
let p = '^.*=[^>]*$' |
||||||
|
if exists(':Tabularize') && getline('.') =~# '^.*=' && (getline(line('.')-1) =~# p || getline(line('.')+1) =~# p) |
||||||
|
let column = strlen(substitute(getline('.')[0:col('.')],'[^=]','','g')) |
||||||
|
let position = strlen(matchstr(getline('.')[0:col('.')],'.*=\s*\zs.*')) |
||||||
|
Tabularize/=/l1 |
||||||
|
normal! 0 |
||||||
|
call search(repeat('[^=]*=',column).'\s\{-\}'.repeat('.',position),'ce',line('.')) |
||||||
|
endif |
||||||
|
endfunction |
||||||
|
|
||||||
|
function! TerraformCommands(ArgLead, CmdLine, CursorPos) abort |
||||||
|
let commands = [ |
||||||
|
\ 'init', |
||||||
|
\ 'validate', |
||||||
|
\ 'plan', |
||||||
|
\ 'apply', |
||||||
|
\ 'destroy', |
||||||
|
\ 'console', |
||||||
|
\ 'fmt', |
||||||
|
\ 'force-unlock', |
||||||
|
\ 'get', |
||||||
|
\ 'graph', |
||||||
|
\ 'import', |
||||||
|
\ 'login', |
||||||
|
\ 'logout', |
||||||
|
\ 'output', |
||||||
|
\ 'providers', |
||||||
|
\ 'refresh', |
||||||
|
\ 'show', |
||||||
|
\ 'state', |
||||||
|
\ 'taint', |
||||||
|
\ 'untaint', |
||||||
|
\ 'version', |
||||||
|
\ 'workspace' |
||||||
|
\ ] |
||||||
|
return join(commands, "\n") |
||||||
|
endfunction |
||||||
|
|
||||||
|
let &cpoptions = s:cpo_save |
||||||
|
unlet s:cpo_save |
||||||
|
|
||||||
|
" ------------------------------------------------------------------------------ |
||||||
|
|
||||||
|
if exists('b:did_ftplugin') || v:version < 700 || &compatible |
||||||
|
finish |
||||||
|
endif |
||||||
|
let b:did_ftplugin = 1 |
||||||
|
|
||||||
|
let s:cpo_save = &cpoptions |
||||||
|
set cpoptions&vim |
||||||
|
|
||||||
|
" j is a relatively recent addition; silence warnings when setting it. |
||||||
|
setlocal formatoptions-=t formatoptions+=croql |
||||||
|
silent! setlocal formatoptions+=j |
||||||
|
let b:undo_ftplugin = 'setlocal formatoptions<' |
||||||
|
|
||||||
|
if !has('patch-7.4.1142') |
||||||
|
" Include hyphens as keyword characters so that a keyword appearing as |
||||||
|
" part of a longer name doesn't get partially highlighted. |
||||||
|
setlocal iskeyword+=- |
||||||
|
let b:undo_ftplugin .= ' iskeyword<' |
||||||
|
endif |
||||||
|
|
||||||
|
if get(g:, 'terraform_fold_sections', 0) |
||||||
|
setlocal foldmethod=syntax |
||||||
|
let b:undo_ftplugin .= ' foldmethod<' |
||||||
|
endif |
||||||
|
|
||||||
|
" Set the commentstring |
||||||
|
setlocal commentstring=#%s |
||||||
|
let b:undo_ftplugin .= ' commentstring<' |
||||||
|
|
||||||
|
if get(g:, 'terraform_align', 0) && exists(':Tabularize') |
||||||
|
inoremap <buffer> <silent> = =<Esc>:call TerraformAlign()<CR>a |
||||||
|
let b:undo_ftplugin .= '|iunmap <buffer> =' |
||||||
|
endif |
||||||
|
|
||||||
|
let &cpoptions = s:cpo_save |
||||||
|
unlet s:cpo_save |
||||||
|
|
||||||
|
if !exists('g:terraform_binary_path') |
||||||
|
let g:terraform_binary_path='terraform' |
||||||
|
endif |
||||||
|
|
||||||
|
if !executable(g:terraform_binary_path) |
||||||
|
finish |
||||||
|
endif |
||||||
|
|
||||||
|
let s:cpo_save = &cpoptions |
||||||
|
set cpoptions&vim |
||||||
|
|
||||||
|
command! -nargs=+ -complete=custom,TerraformCommands -buffer Terraform |
||||||
|
\ execute '!'.g:terraform_binary_path.' '.<q-args>.' -no-color' |
||||||
|
|
||||||
|
" command! -nargs=0 -buffer TerraformFmt call TerraformFmt() |
||||||
|
let b:undo_ftplugin .= '|delcommand Terraform|delcommand TerraformFmt' |
||||||
|
|
||||||
|
if get(g:, 'terraform_fmt_on_save', 0) |
||||||
|
augroup vim.terraform.fmt |
||||||
|
autocmd! |
||||||
|
autocmd BufWritePre *.tf call TerraformFmt() |
||||||
|
autocmd BufWritePre *.tfvars call TerraformFmt() |
||||||
|
augroup END |
||||||
|
endif |
||||||
|
|
||||||
|
let &cpoptions = s:cpo_save |
||||||
|
unlet s:cpo_save |
||||||
|
|
||||||
|
" ------------------------------------------------------------------------------ |
||||||
|
" https://github.com/jgerry/terraform-vim-folding |
||||||
|
" ------------------------------------------------------------------------------ |
||||||
|
|
||||||
|
function! TerraformFolds() |
||||||
|
let thisline = getline(v:lnum) |
||||||
|
if match(thisline, '^resource') >= 0 |
||||||
|
return ">1" |
||||||
|
elseif match(thisline, '^provider') >= 0 |
||||||
|
return ">1" |
||||||
|
elseif match(thisline, '^module') >= 0 |
||||||
|
return ">1" |
||||||
|
elseif match(thisline, '^variable') >= 0 |
||||||
|
return ">1" |
||||||
|
elseif match(thisline, '^output') >= 0 |
||||||
|
return ">1" |
||||||
|
elseif match(thisline, '^data') >= 0 |
||||||
|
return ">1" |
||||||
|
elseif match(thisline, '^locals') >= 0 |
||||||
|
return ">1" |
||||||
|
elseif match(thisline, '^terraform') >= 0 |
||||||
|
return ">1" |
||||||
|
else |
||||||
|
return "=" |
||||||
|
endif |
||||||
|
endfunction |
||||||
|
|
||||||
|
function! TerraformFoldText() |
||||||
|
let foldsize = (v:foldend-v:foldstart) |
||||||
|
return getline(v:foldstart).' ('.foldsize.' lines)' |
||||||
|
endfunction |
||||||
|
|
||||||
|
setlocal foldmethod=expr |
||||||
|
setlocal foldexpr=TerraformFolds() |
||||||
|
setlocal foldlevel=0 |
||||||
|
setlocal foldtext=TerraformFoldText() |
||||||
|
|
||||||
|
" ------------------------------------------------------------------------------ |
||||||
|
|
@ -1,69 +1,118 @@ |
|||||||
au BufNewFile,BufRead *.test set filetype=tcl |
au BufRead,BufNewFile *.gv setlocal filetype=graphviz |
||||||
au BufNewFile,BufRead *.txt set textwidth=80 |
au BufRead,BufNewFile *.lisp,*.scm setlocal lisp |
||||||
au BufNewFile,BufRead *.txt set filetype=txt |
au BufRead,BufNewFile *.mutt setlocal filetype=muttrc |
||||||
|
au BufRead,BufNewFile *.note setlocal filetype=note |
||||||
au BufRead,BufNewFile *.tex set filetype=tex |
au BufRead,BufNewFile *.pro setlocal filetype=prolog |
||||||
au BufRead,BufNewFile *.pro set filetype=prolog |
au BufRead,BufNewFile *.r setlocal filetype=rebol |
||||||
au BufRead,BufNewFile *.xpt.vim set filetype=xpt.vim |
au BufRead,BufNewFile *.rename setlocal filetype=rename |
||||||
au BufRead,BufNewFile *.xpt.vim set filetype=xpt.vim |
au BufRead,BufNewFile *.rkt setlocal filetype=racket |
||||||
au BufRead,BufNewFile *.vim set filetype=vim |
au BufRead,BufNewFile *.rsc setlocal filetype=rsc |
||||||
au BufRead,BufNewFile *.mutt set filetype=muttrc |
au BufRead,BufNewFile *.sls,Saltfile setlocal filetype=sls |
||||||
au BufRead,BufNewFile *rtorrent.rc* set filetype=rtorrent |
au BufRead,BufNewFile *.test setlocal filetype=tcl |
||||||
au BufRead,BufNewFile *.gv set filetype=graphviz |
au BufRead,BufNewFile *.tex setlocal filetype=tex |
||||||
au BufRead,BufNewFile *.r set filetype=rebol |
au BufRead,BufNewFile *.tf,*.tfvars setlocal filetype=terraform |
||||||
au BufRead,BufNewFile rfc* set filetype=rfc |
au BufRead,BufNewFile *.tfstate setlocal filetype=json |
||||||
au BufRead,BufNewFile bash-fc* set filetype=sh |
au BufRead,BufNewFile *.timelog setlocal filetype=timelog |
||||||
au BufRead,BufNewFile *.wiki set filetype=vimwiki |
au BufRead,BufNewFile *.txt setlocal filetype=txt |
||||||
au BufWinEnter,BufRead,BufNewFile *.wiki set nocursorline |
au BufRead,BufNewFile *.txt setlocal textwidth=80 |
||||||
au BufRead,BufNewFile *.timelog set filetype=timelog |
au BufRead,BufNewFile *.vim setlocal filetype=vim |
||||||
au BufRead,BufNewFile *.rkt set filetype=racket |
au BufRead,BufNewFile *.wiki setlocal filetype=vimwiki |
||||||
|
au BufRead,BufNewFile *.xpt.vim setlocal filetype=xpt.vim |
||||||
au BufRead,BufNewFile *.scm runtime plugin/RainbowParenthsis.vim |
au BufRead,BufNewFile *.xpt.vim setlocal filetype=xpt.vim |
||||||
au BufRead,BufNewFile *.lisp runtime plugin/RainbowParenthsis.vim |
au BufRead,BufNewFile */templates/*.yaml,*/templates/*.tpl setlocal filetype=helm |
||||||
au BufRead,BufNewFile *.rkt runtime plugin/RainbowParenthsis.vim |
au BufRead,BufNewFile *rtorrent.rc* setlocal filetype=rtorrent |
||||||
|
au BufRead,BufNewFile Containerfile setlocal filetype=dockerfile |
||||||
au BufRead,BufNewFile *.scm set lisp |
au BufRead,BufNewFile Vagrantfile setlocal filetype=ruby |
||||||
au BufRead,BufNewFile *.lisp set lisp |
au BufRead,BufNewFile bash-fc* setlocal filetype=sh |
||||||
|
au BufRead,BufNewFile rfc* setlocal filetype=rfc |
||||||
au BufReadPre *.doc set ro |
|
||||||
au BufReadPre *.doc set hlsearch! |
au BufWinEnter,BufRead,BufNewFile *.wiki setlocal nocursorline |
||||||
au BufReadPost *.doc %!antiword "%" |
|
||||||
au BufReadPost *.doc set filetype=txt |
au BufReadPost *.doc setlocal filetype=txt |
||||||
|
au BufReadPost *.doc %!antiword "%" |
||||||
au BufReadPre *.docx set ro |
au BufReadPre *.doc setlocal hlsearch! |
||||||
au BufReadPre *.docx set hlsearch! |
au BufReadPre *.doc setlocal ro |
||||||
au BufReadPost *.docx %!docx2txt "%" - |
|
||||||
au BufReadPost *.docx set filetype=txt |
au BufReadPost *.docx %!docx2txt "%" - |
||||||
|
au BufReadPost *.docx setlocal filetype=txt |
||||||
au BufReadPre *.odt set ro |
au BufReadPre *.docx setlocal hlsearch! |
||||||
au BufReadPre *.odt set hlsearch! |
au BufReadPre *.docx setlocal ro |
||||||
au BufReadPost *.odt %!odt2txt "%" |
|
||||||
au BufReadPost *.odt set filetype=txt |
au BufReadPost *.odt setlocal filetype=txt |
||||||
|
au BufReadPost *.odt %!odt2txt "%" |
||||||
au BufReadPre *.rtf set ro |
au BufReadPre *.odt setlocal hlsearch! |
||||||
au BufReadPre *.rtf set hlsearch! |
au BufReadPre *.odt setlocal ro |
||||||
au BufReadPost *.rtf %!catdoc "%" |
|
||||||
au BufReadPost *.rtf set filetype=txt |
au BufReadPost *.pdf setlocal filetype=txt |
||||||
|
au BufReadPost *.pdf %!pdftotext -nopgbrk "%" - | fmt -csw78 |
||||||
au BufReadPre *.pdf set ro |
au BufReadPre *.pdf setlocal hlsearch! |
||||||
au BufReadPre *.pdf set hlsearch! |
au BufReadPre *.pdf setlocal ro |
||||||
au BufReadPost *.pdf %!pdftotext -nopgbrk "%" - | fmt -csw78 |
|
||||||
au BufReadPost *.pdf set filetype=txt |
au BufReadPost *.rtf setlocal filetype=txt |
||||||
|
au BufReadPost *.rtf %!catdoc "%" |
||||||
au BufRead,BufNewFile *.note setf note |
au BufReadPre *.rtf setlocal hlsearch! |
||||||
|
au BufReadPre *.rtf setlocal ro |
||||||
au BufRead,BufNewFile *.rsc set filetype=rsc |
|
||||||
|
" Liquid |
||||||
au BufNewFile,BufRead *.rename set filetype=rename |
au BufNewFile,BufRead *.liquid setlocal filetype=liquid |
||||||
|
au BufNewFile,BufRead */_layouts/*.html,*/_includes/*.html setlocal filetype=liquid |
||||||
au BufNewFile,BufRead Vagrantfile set filetype=ruby |
au BufNewFile,BufRead *.html,*.xml,*.textile |
||||||
|
\ if getline(1) == '---' | setlocal filetype=liquid | endif |
||||||
au BufNewFile,BufRead *.tf setlocal filetype=terraform |
au BufNewFile,BufRead *.markdown,*.mkd,*.mkdn,*.md |
||||||
au BufNewFile,BufRead *.tfvars setlocal filetype=terraform |
\ if getline(1) == '---' | |
||||||
au BufNewFile,BufRead *.tfstate setlocal filetype=json |
\ let b:liquid_subtype = 'markdown' | |
||||||
|
\ setlocal filetype=liquid | |
||||||
au BufNewFile,BufRead Containerfile setlocal filetype=dockerfile |
\ endif |
||||||
|
|
||||||
|
" Set subtype for Shopify alternate templates |
||||||
|
au BufNewFile,BufRead */templates/**.liquid,*/layout/**.liquid,*/snippets/**.liquid |
||||||
|
\ let b:liquid_subtype = 'html' | |
||||||
|
\ setlocal filetype=liquid | |
||||||
|
|
||||||
" Открывать справку в вертикальном окне |
" Открывать справку в вертикальном окне |
||||||
au! BufEnter * if &ft ==# 'help' | wincmd L | endif |
au! BufEnter * if &ft ==# 'help' | wincmd L | endif |
||||||
|
|
||||||
|
" Ansible |
||||||
|
function! s:isAnsible() |
||||||
|
let filepath = expand("%:p") |
||||||
|
let filename = expand("%:t") |
||||||
|
if filepath =~ '\v/(defaults|tasks|roles|handlers|meta|vars)/.*\.ya?ml$' | return 1 | en |
||||||
|
if filepath =~ '\v/(group|host)_vars/' | return 1 | en |
||||||
|
if filename =~ '\v(playbook|site|main|local)\.ya?ml$' | return 1 | en |
||||||
|
|
||||||
|
let shebang = getline(1) |
||||||
|
if shebang =~# '^#!.*/bin/env\s\+ansible-playbook\>' | return 1 | en |
||||||
|
if shebang =~# '^#!.*/bin/ansible-playbook\>' | return 1 | en |
||||||
|
|
||||||
|
return 0 |
||||||
|
endfunction |
||||||
|
|
||||||
|
function! s:setupTemplate() |
||||||
|
if exists("g:ansible_template_syntaxes") |
||||||
|
let filepath = expand("%:p") |
||||||
|
for syntax_name in items(g:ansible_template_syntaxes) |
||||||
|
let s:syntax_string = '\v/'.syntax_name[0] |
||||||
|
if filepath =~ s:syntax_string |
||||||
|
execute 'setlocal filetype='.syntax_name[1].'.jinja' |
||||||
|
return |
||||||
|
endif |
||||||
|
endfor |
||||||
|
endif |
||||||
|
setlocal filetype=jinja |
||||||
|
endfunction |
||||||
|
|
||||||
|
augroup ansible_vim_ftyaml_ansible |
||||||
|
au! |
||||||
|
au BufNewFile,BufRead * if s:isAnsible() | setlocal filetype=yaml.ansible | en |
||||||
|
augroup END |
||||||
|
|
||||||
|
augroup ansible_vim_ftjinja2 |
||||||
|
au! |
||||||
|
au BufNewFile,BufRead *.j2 call s:setupTemplate() |
||||||
|
augroup END |
||||||
|
|
||||||
|
augroup ansible_vim_fthosts |
||||||
|
au! |
||||||
|
au BufNewFile,BufRead *inventory* setlocal filetype=ansible_hosts |
||||||
|
augroup END |
||||||
|
|
||||||
|
@ -0,0 +1 @@ |
|||||||
|
../../+ftplugin/ansible.vim |
@ -0,0 +1 @@ |
|||||||
|
../../+ftplugin/ansible_hosts.vim |
@ -0,0 +1 @@ |
|||||||
|
../../+ftplugin/liquid.vim |
@ -0,0 +1 @@ |
|||||||
|
../../+ftplugin/terraform.vim |
@ -0,0 +1,59 @@ |
|||||||
|
let s:save_cpo = &cpo |
||||||
|
set cpo&vim |
||||||
|
|
||||||
|
setlocal indentexpr=GetAnsibleIndent(v:lnum) |
||||||
|
setlocal indentkeys=!^F,o,O,0#,0},0],<:>,-,*<Return> |
||||||
|
setlocal nosmartindent |
||||||
|
setlocal expandtab |
||||||
|
setlocal softtabstop=2 |
||||||
|
setlocal shiftwidth=2 |
||||||
|
setlocal commentstring=#%s |
||||||
|
setlocal formatoptions+=cl |
||||||
|
" c -> wrap long comments, including # |
||||||
|
" l -> do not wrap long lines |
||||||
|
|
||||||
|
let s:comment = '\v^\s*#' " # comment |
||||||
|
let s:array_entry = '\v^\s*-\s' " - foo |
||||||
|
let s:named_module_entry = '\v^\s*-\s*(name|hosts|role):\s*\S' " - name: 'do stuff' |
||||||
|
let s:dictionary_entry = '\v^\s*[^:-]+:\s*$' " with_items: |
||||||
|
let s:key_value = '\v^\s*[^:-]+:\s*\S' " apt: name=package |
||||||
|
let s:scalar_value = '\v:\s*[>|\|]\s*$' " shell: > |
||||||
|
|
||||||
|
if exists('*GetAnsibleIndent') |
||||||
|
finish |
||||||
|
endif |
||||||
|
|
||||||
|
function GetAnsibleIndent(lnum) |
||||||
|
if a:lnum == 1 || !prevnonblank(a:lnum-1) |
||||||
|
return 0 |
||||||
|
endif |
||||||
|
if exists("g:ansible_unindent_after_newline") |
||||||
|
if (a:lnum -1) != prevnonblank(a:lnum - 1) |
||||||
|
return 0 |
||||||
|
endif |
||||||
|
endif |
||||||
|
let prevlnum = prevnonblank(a:lnum - 1) |
||||||
|
let maintain = indent(prevlnum) |
||||||
|
let increase = maintain + &sw |
||||||
|
|
||||||
|
let line = getline(prevlnum) |
||||||
|
if line =~ s:array_entry |
||||||
|
if line =~ s:named_module_entry |
||||||
|
return increase |
||||||
|
else |
||||||
|
return maintain |
||||||
|
endif |
||||||
|
elseif line =~ s:dictionary_entry |
||||||
|
return increase |
||||||
|
elseif line =~ s:key_value |
||||||
|
if line =~ s:scalar_value |
||||||
|
return increase |
||||||
|
else |
||||||
|
return maintain |
||||||
|
endif |
||||||
|
else |
||||||
|
return maintain |
||||||
|
endif |
||||||
|
endfunction |
||||||
|
|
||||||
|
let &cpo = s:save_cpo |
@ -0,0 +1,63 @@ |
|||||||
|
" Vim indent file |
||||||
|
" Language: Liquid |
||||||
|
" Maintainer: Tim Pope <vimNOSPAM@tpope.org> |
||||||
|
" Last Change: 2010 May 21 |
||||||
|
|
||||||
|
if exists('b:did_indent') |
||||||
|
finish |
||||||
|
endif |
||||||
|
|
||||||
|
set indentexpr= |
||||||
|
if exists('b:liquid_subtype') |
||||||
|
exe 'runtime! indent/'.b:liquid_subtype.'.vim' |
||||||
|
else |
||||||
|
runtime! indent/html.vim |
||||||
|
endif |
||||||
|
unlet! b:did_indent |
||||||
|
|
||||||
|
if &l:indentexpr == '' |
||||||
|
if &l:cindent |
||||||
|
let &l:indentexpr = 'cindent(v:lnum)' |
||||||
|
else |
||||||
|
let &l:indentexpr = 'indent(prevnonblank(v:lnum-1))' |
||||||
|
endif |
||||||
|
endif |
||||||
|
let b:liquid_subtype_indentexpr = &l:indentexpr |
||||||
|
|
||||||
|
let b:did_indent = 1 |
||||||
|
|
||||||
|
setlocal indentexpr=GetLiquidIndent() |
||||||
|
setlocal indentkeys=o,O,*<Return>,<>>,{,},0),0],o,O,!^F,=end,=endif,=endunless,=endifchanged,=endcase,=endfor,=endtablerow,=endcapture,=else,=elsif,=when,=empty |
||||||
|
|
||||||
|
" Only define the function once. |
||||||
|
if exists('*GetLiquidIndent') |
||||||
|
finish |
||||||
|
endif |
||||||
|
|
||||||
|
function! s:count(string,pattern) |
||||||
|
let string = substitute(a:string,'\C'.a:pattern,"\n",'g') |
||||||
|
return strlen(substitute(string,"[^\n]",'','g')) |
||||||
|
endfunction |
||||||
|
|
||||||
|
function! GetLiquidIndent(...) |
||||||
|
if a:0 && a:1 == '.' |
||||||
|
let v:lnum = line('.') |
||||||
|
elseif a:0 && a:1 =~ '^\d' |
||||||
|
let v:lnum = a:1 |
||||||
|
endif |
||||||
|
let vcol = col('.') |
||||||
|
call cursor(v:lnum,1) |
||||||
|
exe "let ind = ".b:liquid_subtype_indentexpr |
||||||
|
let lnum = prevnonblank(v:lnum-1) |
||||||
|
let line = getline(lnum) |
||||||
|
let cline = getline(v:lnum) |
||||||
|
let line = substitute(line,'\C^\%(\s*{%\s*end\w*\s*%}\)\+','','') |
||||||
|
let line .= matchstr(cline,'\C^\%(\s*{%\s*end\w*\s*%}\)\+') |
||||||
|
let cline = substitute(cline,'\C^\%(\s*{%\s*end\w*\s*%}\)\+','','') |
||||||
|
let sw = exists('*shiftwidth') ? shiftwidth() : &sw |
||||||
|
let ind += sw * s:count(line,'{%\s*\%(if\|elsif\|else\|unless\|ifchanged\|case\|when\|for\|empty\|tablerow\|capture\)\>') |
||||||
|
let ind -= sw * s:count(line,'{%\s*end\%(if\|unless\|ifchanged\|case\|for\|tablerow\|capture\)\>') |
||||||
|
let ind -= sw * s:count(cline,'{%\s*\%(elsif\|else\|when\|empty\)\>') |
||||||
|
let ind -= sw * s:count(cline,'{%\s*end\w*$') |
||||||
|
return ind |
||||||
|
endfunction |
@ -0,0 +1,64 @@ |
|||||||
|
" Only load this file if no other indent file was loaded |
||||||
|
if exists('b:did_indent') |
||||||
|
finish |
||||||
|
endif |
||||||
|
let b:did_indent = 1 |
||||||
|
|
||||||
|
let s:cpo_save = &cpoptions |
||||||
|
set cpoptions&vim |
||||||
|
|
||||||
|
setlocal nolisp |
||||||
|
setlocal autoindent shiftwidth=2 tabstop=2 softtabstop=2 expandtab |
||||||
|
setlocal indentexpr=TerraformIndent(v:lnum) |
||||||
|
setlocal indentkeys+=<:>,0=},0=) |
||||||
|
let b:undo_indent = 'setlocal lisp< autoindent< shiftwidth< tabstop< softtabstop<' |
||||||
|
\ . ' expandtab< indentexpr< indentkeys<' |
||||||
|
|
||||||
|
let &cpoptions = s:cpo_save |
||||||
|
unlet s:cpo_save |
||||||
|
|
||||||
|
if exists('*TerraformIndent') |
||||||
|
finish |
||||||
|
endif |
||||||
|
|
||||||
|
let s:cpo_save = &cpoptions |
||||||
|
set cpoptions&vim |
||||||
|
|
||||||
|
function! TerraformIndent(lnum) |
||||||
|
" Beginning of the file should have no indent |
||||||
|
if a:lnum == 0 |
||||||
|
return 0 |
||||||
|
endif |
||||||
|
|
||||||
|
" Usual case is to continue at the same indent as the previous non-blank line. |
||||||
|
let prevlnum = prevnonblank(a:lnum-1) |
||||||
|
let thisindent = indent(prevlnum) |
||||||
|
|
||||||
|
" If that previous line is a non-comment ending in [ { (, increase the |
||||||
|
" indent level. |
||||||
|
let prevline = getline(prevlnum) |
||||||
|
if prevline !~# '^\s*\(#\|//\)' && prevline =~# '[\[{\(]\s*$' |
||||||
|
let thisindent += &shiftwidth |
||||||
|
endif |
||||||
|
|
||||||
|
" If the current line ends a block, decrease the indent level. |
||||||
|
let thisline = getline(a:lnum) |
||||||
|
if thisline =~# '^\s*[\)}\]]' |
||||||
|
let thisindent -= &shiftwidth |
||||||
|
endif |
||||||
|
|
||||||
|
" If the previous line starts a block comment /*, increase by one |
||||||
|
if prevline =~# '/\*' |
||||||
|
let thisindent += 1 |
||||||
|
endif |
||||||
|
|
||||||
|
" If the previous line ends a block comment */, decrease by one |
||||||
|
if prevline =~# '\*/' |
||||||
|
let thisindent -= 1 |
||||||
|
endif |
||||||
|
|
||||||
|
return thisindent |
||||||
|
endfunction |
||||||
|
|
||||||
|
let &cpoptions = s:cpo_save |
||||||
|
unlet s:cpo_save |
@ -1,3 +1,3 @@ |
|||||||
set runtimepath^=~/.config/nvim runtimepath+=~/.config/nvim/after |
set runtimepath^=~/.config/nvim runtimepath+=~/.config/nvim/after |
||||||
let &packpath = &runtimepath |
let &packpath = &runtimepath |
||||||
source ~/.config/nvim/vimrc |
runtime vimrc |
||||||
|
@ -0,0 +1,104 @@ |
|||||||
|
" Vim syntax file |
||||||
|
" Language: Ansible YAML/Jinja templates |
||||||
|
" Maintainer: Dave Honneffer <pearofducks@gmail.com> |
||||||
|
" Last Change: 2018.02.08 |
||||||
|
|
||||||
|
if !exists("main_syntax") |
||||||
|
let main_syntax = 'yaml' |
||||||
|
endif |
||||||
|
|
||||||
|
if exists('b:current_syntax') |
||||||
|
let s:current_syntax=b:current_syntax |
||||||
|
unlet b:current_syntax |
||||||
|
endif |
||||||
|
|
||||||
|
syntax include @Jinja syntax/jinja.vim |
||||||
|
|
||||||
|
if exists('s:current_syntax') |
||||||
|
let b:current_syntax=s:current_syntax |
||||||
|
endif |
||||||
|
|
||||||
|
" Jinja |
||||||
|
" ================================ |
||||||
|
|
||||||
|
syn cluster jinjaSLSBlocks add=jinjaTagBlock,jinjaVarBlock,jinjaComment |
||||||
|
" https://github.com/mitsuhiko/jinja2/blob/6b7c0c23/ext/Vim/jinja.vim |
||||||
|
syn region jinjaTagBlock matchgroup=jinjaTagDelim start=/{%-\?/ end=/-\?%}/ containedin=ALLBUT,jinjaTagBlock,jinjaVarBlock,jinjaRaw,jinjaString,jinjaNested,jinjaComment,@jinjaSLSBlocks |
||||||
|
syn region jinjaVarBlock matchgroup=jinjaVarDelim start=/{{-\?/ end=/-\?}}/ containedin=ALLBUT,yamlComment,jinjaTagBlock,jinjaVarBlock,jinjaRaw,jinjaString,jinjaNested,jinjaComment,@jinjaSLSBlocks |
||||||
|
syn region jinjaComment matchgroup=jinjaCommentDelim start="{#" end="#}" containedin=ALLBUT,jinjaTagBlock,jinjaVarBlock,jinjaString,@jinjaSLSBlocks |
||||||
|
highlight link jinjaVariable Constant |
||||||
|
highlight link jinjaVarDelim Delimiter |
||||||
|
|
||||||
|
" YAML |
||||||
|
" ================================ |
||||||
|
|
||||||
|
if exists("g:ansible_yamlKeyName") |
||||||
|
let s:yamlKey = g:ansible_yamlKeyName |
||||||
|
else |
||||||
|
let s:yamlKey = "yamlBlockMappingKey" |
||||||
|
endif |
||||||
|
|
||||||
|
" Reset some YAML to plain styling |
||||||
|
" the number 80 in Ansible isn't any more important than the word root |
||||||
|
highlight link yamlInteger NONE |
||||||
|
highlight link yamlBool NONE |
||||||
|
highlight link yamlFlowString NONE |
||||||
|
" but it does make sense we visualize quotes easily |
||||||
|
highlight link yamlFlowStringDelimiter Delimiter |
||||||
|
" This is only found in stephypy/vim-yaml, since it's one line it isn't worth |
||||||
|
" making conditional |
||||||
|
highlight link yamlConstant NONE |
||||||
|
|
||||||
|
fun! s:attribute_highlight(attributes) |
||||||
|
if a:attributes =~ 'a' |
||||||
|
syn match ansible_attributes "\v\w+\=" containedin=yamlPlainScalar |
||||||
|
else |
||||||
|
syn match ansible_attributes "\v^\s*\w+\=" containedin=yamlPlainScalar |
||||||
|
endif |
||||||
|
if a:attributes =~ 'n' |
||||||
|
highlight link ansible_attributes NONE |
||||||
|
elseif a:attributes =~ 'd' |
||||||
|
highlight link ansible_attributes Comment |
||||||
|
else |
||||||
|
highlight link ansible_attributes Structure |
||||||
|
endif |
||||||
|
endfun |
||||||
|
|
||||||
|
if exists("g:ansible_attribute_highlight") |
||||||
|
call s:attribute_highlight(g:ansible_attribute_highlight) |
||||||
|
else |
||||||
|
call s:attribute_highlight('ad') |
||||||
|
endif |
||||||
|
|
||||||
|
if exists("g:ansible_name_highlight") |
||||||
|
execute 'syn keyword ansible_name name containedin='.s:yamlKey.' contained' |
||||||
|
if g:ansible_name_highlight =~ 'd' |
||||||
|
highlight link ansible_name Comment |
||||||
|
else |
||||||
|
highlight link ansible_name Underlined |
||||||
|
endif |
||||||
|
endif |
||||||
|
|
||||||
|
execute 'syn keyword ansible_debug_keywords debug containedin='.s:yamlKey.' contained' |
||||||
|
highlight link ansible_debug_keywords Debug |
||||||
|
|
||||||
|
if exists("g:ansible_extra_keywords_highlight") |
||||||
|
execute 'syn keyword ansible_extra_special_keywords register always_run changed_when failed_when no_log args vars delegate_to ignore_errors containedin='.s:yamlKey.' contained' |
||||||
|
highlight link ansible_extra_special_keywords Statement |
||||||
|
endif |
||||||
|
|
||||||
|
execute 'syn keyword ansible_normal_keywords include include_tasks import_tasks until retries delay when only_if become become_user block rescue always notify containedin='.s:yamlKey.' contained' |
||||||
|
if exists("g:ansible_normal_keywords_highlight") |
||||||
|
execute 'highlight link ansible_normal_keywords '.g:ansible_normal_keywords_highlight |
||||||
|
else |
||||||
|
highlight link ansible_normal_keywords Statement |
||||||
|
endif |
||||||
|
|
||||||
|
execute 'syn match ansible_with_keywords "\vwith_.+" containedin='.s:yamlKey.' contained' |
||||||
|
if exists("g:ansible_with_keywords_highlight") |
||||||
|
execute 'highlight link ansible_with_keywords '.g:ansible_with_keywords_highlight |
||||||
|
else |
||||||
|
highlight link ansible_with_keywords Statement |
||||||
|
endif |
||||||
|
|
||||||
|
let b:current_syntax = "ansible" |
@ -0,0 +1,103 @@ |
|||||||
|
"============================================================================= |
||||||
|
" What Is This: Add some conceal operator for your haskell files |
||||||
|
" File: haskell.vim (conceal enhancement) |
||||||
|
" Author: Vincent Berthoux <twinside@gmail.com> |
||||||
|
" Last Change: 2011-09-07 |
||||||
|
" Version: 1.3.2 |
||||||
|
" Require: |
||||||
|
" set nocompatible |
||||||
|
" somewhere on your .vimrc |
||||||
|
" |
||||||
|
" Vim 7.3 or Vim compiled with conceal patch. |
||||||
|
" Use --with-features=big or huge in order to compile it in. |
||||||
|
" |
||||||
|
" Usage: |
||||||
|
" Drop this file in your |
||||||
|
" ~/.vim/after/syntax folder (Linux/MacOSX/BSD...) |
||||||
|
" ~/vimfiles/after/syntax folder (Windows) |
||||||
|
" |
||||||
|
" For this script to work, you have to set the encoding |
||||||
|
" to utf-8 :set enc=utf-8 |
||||||
|
" |
||||||
|
" Additional: |
||||||
|
" * if you want to avoid the loading, add the following |
||||||
|
" line in your .vimrc : |
||||||
|
" let g:no_haskell_conceal = 1 |
||||||
|
" Changelog: |
||||||
|
" - 1.3.1: putting undefined in extra conceal, not appearing on windows |
||||||
|
" - 1.3: adding new arrow characters used by GHC in Unicode extension. |
||||||
|
" - 1.2: Fixing conceal level to be local (thx Erlend Hamberg) |
||||||
|
" - 1.1: Better handling of non utf-8 systems, and avoid some |
||||||
|
" concealing operations on windows on some fonts |
||||||
|
" |
||||||
|
if exists('g:no_haskell_conceal') || !has('conceal') || &enc != 'utf-8' |
||||||
|
finish |
||||||
|
endif |
||||||
|
|
||||||
|
" vim: set fenc=utf-8: |
||||||
|
syntax match hsNiceOperator "\\\ze[[:alpha:][:space:]_([]" conceal cchar=λ |
||||||
|
syntax match hsNiceOperator "<-" conceal cchar=← |
||||||
|
syntax match hsNiceOperator "->" conceal cchar=→ |
||||||
|
syntax match hsNiceOperator "\<sum\>" conceal cchar=∑ |
||||||
|
syntax match hsNiceOperator "\<product\>" conceal cchar=∏ |
||||||
|
syntax match hsNiceOperator "\<sqrt\>" conceal cchar=√ |
||||||
|
syntax match hsNiceOperator "\<pi\>" conceal cchar=π |
||||||
|
syntax match hsNiceOperator "==" conceal cchar=≡ |
||||||
|
syntax match hsNiceOperator "\/=" conceal cchar=≠ |
||||||
|
syntax match hsNiceOperator ">>" conceal cchar=» |
||||||
|
|
||||||
|
let s:extraConceal = 1 |
||||||
|
" Some windows font don't support some of the characters, |
||||||
|
" so if they are the main font, we don't load them :) |
||||||
|
if has("win32") |
||||||
|
let s:incompleteFont = [ 'Consolas' |
||||||
|
\ , 'Lucida Console' |
||||||
|
\ , 'Courier New' |
||||||
|
\ ] |
||||||
|
let s:mainfont = substitute( &guifont, '^\([^:,]\+\).*', '\1', '') |
||||||
|
for s:fontName in s:incompleteFont |
||||||
|
if s:mainfont ==? s:fontName |
||||||
|
let s:extraConceal = 0 |
||||||
|
break |
||||||
|
endif |
||||||
|
endfor |
||||||
|
endif |
||||||
|
|
||||||
|
if s:extraConceal |
||||||
|
syntax match hsNiceOperator "\<undefined\>" conceal cchar=⊥ |
||||||
|
|
||||||
|
" Match greater than and lower than w/o messing with Kleisli composition |
||||||
|
syntax match hsNiceOperator "<=\ze[^<]" conceal cchar=≤ |
||||||
|
syntax match hsNiceOperator ">=\ze[^>]" conceal cchar=≥ |
||||||
|
|
||||||
|
syntax match hsNiceOperator "=>" conceal cchar=⇒ |
||||||
|
syntax match hsNiceOperator "=\zs<<" conceal cchar=« |
||||||
|
|
||||||
|
" Redfining to get proper '::' concealing |
||||||
|
syntax match hs_DeclareFunction /^[a-z_(]\S*\(\s\|\n\)*::/me=e-2 nextgroup=hsNiceOperator contains=hs_FunctionName,hs_OpFunctionName |
||||||
|
syntax match hsNiceOperator "\:\:" conceal cchar=∷ |
||||||
|
|
||||||
|
syntax match hsniceoperator "++" conceal cchar=⧺ |
||||||
|
syntax match hsNiceOperator "\<forall\>" conceal cchar=∀ |
||||||
|
syntax match hsNiceOperator "-<" conceal cchar=↢ |
||||||
|
syntax match hsNiceOperator ">-" conceal cchar=↣ |
||||||
|
syntax match hsNiceOperator "-<<" conceal cchar=⤛ |
||||||
|
syntax match hsNiceOperator ">>-" conceal cchar=⤜ |
||||||
|
" the star does not seem so good... |
||||||
|
" syntax match hsNiceOperator "*" conceal cchar=★ |
||||||
|
|
||||||
|
" Only replace the dot, avoid taking spaces around. |
||||||
|
syntax match hsNiceOperator /\s\.\s/ms=s+1,me=e-1 conceal cchar=∘ |
||||||
|
syntax match hsNiceOperator "\.\." conceal cchar=‥ |
||||||
|
|
||||||
|
syntax match hsQQEnd "|\]" contained conceal cchar=〛 |
||||||
|
" sy match hsQQEnd "|\]" contained conceal=〚 |
||||||
|
|
||||||
|
syntax match hsNiceOperator "`elem`" conceal cchar=∈ |
||||||
|
syntax match hsNiceOperator "`notElem`" conceal cchar=∉ |
||||||
|
endif |
||||||
|
|
||||||
|
hi link hsNiceOperator Operator |
||||||
|
hi! link Conceal Operator |
||||||
|
setlocal conceallevel=2 |
||||||
|
|
@ -0,0 +1,61 @@ |
|||||||
|
" This is a simple script. It extends the syntax highlighting to |
||||||
|
" highlight each matching set of parens in different colors, to make |
||||||
|
" it visually obvious what matches which. |
||||||
|
|
||||||
|
" Obviously, most useful when working with lisp. But it's also nice othe |
||||||
|
" times. |
||||||
|
|
||||||
|
" I don't intend to maintain this script. I hacked it together for my |
||||||
|
" own purposes, and it is sufficient to the day. If you want to improve it, |
||||||
|
" knock yourself out. |
||||||
|
|
||||||
|
" This file is public domain. |
||||||
|
|
||||||
|
if &ft == "vimwiki" |
||||||
|
finish |
||||||
|
endif |
||||||
|
|
||||||
|
" define colors. Note that the one numbered '16' is the outermost pair, |
||||||
|
" keep that in mind if you want to change the colors. |
||||||
|
" Also, if this script doesn't work on your terminal, you may need to add |
||||||
|
" guifg=xx or ever termfg=, though what good this script will do on a |
||||||
|
" black and white terminal I don't know. |
||||||
|
hi level1c ctermfg=brown |
||||||
|
hi level2c ctermfg=76 |
||||||
|
hi level3c ctermfg=202 |
||||||
|
hi level4c ctermfg=darkgreen |
||||||
|
hi level5c ctermfg=45 |
||||||
|
hi level6c ctermfg=darkred |
||||||
|
hi level7c ctermfg=darkmagenta |
||||||
|
hi level8c ctermfg=brown |
||||||
|
hi level9c ctermfg=3 |
||||||
|
hi level10c ctermfg=100 |
||||||
|
hi level11c ctermfg=darkmagenta |
||||||
|
hi level12c ctermfg=33 |
||||||
|
hi level13c ctermfg=46 |
||||||
|
hi level14c ctermfg=darkcyan |
||||||
|
hi level15c ctermfg=darkred |
||||||
|
hi level16c ctermfg=208 |
||||||
|
|
||||||
|
""() |
||||||
|
|
||||||
|
" These are the regions for each pair. |
||||||
|
" This could be improved, perhaps, by makeing them match [ and { also, |
||||||
|
" but I'm not going to take the time to figure out haw to make the |
||||||
|
" end pattern match only the proper type. |
||||||
|
syn region level1 matchgroup=level1c start=/(/ end=/)/ contains=TOP,level1,level2,level3,level4,level5,level6,level7,level8,level9,level10,level11,level12,level13,level14,level15, level16,NoInParens |
||||||
|
syn region level2 matchgroup=level2c start=/(/ end=/)/ contains=TOP,level2,level3,level4,level5,level6,level7,level8,level9,level10,level11,level12,level13,level14,level15, level16,NoInParens |
||||||
|
syn region level3 matchgroup=level3c start=/(/ end=/)/ contains=TOP,level3,level4,level5,level6,level7,level8,level9,level10,level11,level12,level13,level14,level15, level16,NoInParens |
||||||
|
syn region level4 matchgroup=level4c start=/(/ end=/)/ contains=TOP,level4,level5,level6,level7,level8,level9,level10,level11,level12,level13,level14,level15, level16,NoInParens |
||||||
|
syn region level5 matchgroup=level5c start=/(/ end=/)/ contains=TOP,level5,level6,level7,level8,level9,level10,level11,level12,level13,level14,level15, level16,NoInParens |
||||||
|
syn region level6 matchgroup=level6c start=/(/ end=/)/ contains=TOP,level6,level7,level8,level9,level10,level11,level12,level13,level14,level15, level16,NoInParens |
||||||
|
syn region level7 matchgroup=level7c start=/(/ end=/)/ contains=TOP,level7,level8,level9,level10,level11,level12,level13,level14,level15, level16,NoInParens |
||||||
|
syn region level8 matchgroup=level8c start=/(/ end=/)/ contains=TOP,level8,level9,level10,level11,level12,level13,level14,level15, level16,NoInParens |
||||||
|
syn region level9 matchgroup=level9c start=/(/ end=/)/ contains=TOP,level9,level10,level11,level12,level13,level14,level15, level16,NoInParens |
||||||
|
syn region level10 matchgroup=level10c start=/(/ end=/)/ contains=TOP,level10,level11,level12,level13,level14,level15, level16,NoInParens |
||||||
|
syn region level11 matchgroup=level11c start=/(/ end=/)/ contains=TOP,level11,level12,level13,level14,level15, level16,NoInParens |
||||||
|
syn region level12 matchgroup=level12c start=/(/ end=/)/ contains=TOP,level12,level13,level14,level15, level16,NoInParens |
||||||
|
syn region level13 matchgroup=level13c start=/(/ end=/)/ contains=TOP,level13,level14,level15, level16,NoInParens |
||||||
|
syn region level14 matchgroup=level14c start=/(/ end=/)/ contains=TOP,level14,level15, level16,NoInParens |
||||||
|
syn region level15 matchgroup=level15c start=/(/ end=/)/ contains=TOP,level15, level16,NoInParens |
||||||
|
syn region level16 matchgroup=level16c start=/(/ end=/)/ contains=TOP,level16,NoInParens |
@ -0,0 +1,103 @@ |
|||||||
|
" vim syntax for helm templates (yaml + gotmpl + sprig + custom) |
||||||
|
" |
||||||
|
" Install via vundle: |
||||||
|
" |
||||||
|
" ```vim |
||||||
|
" Plugin 'towolf/vim-helm' |
||||||
|
" ``` |
||||||
|
|
||||||
|
if exists("b:current_syntax") |
||||||
|
finish |
||||||
|
endif |
||||||
|
|
||||||
|
if !exists("main_syntax") |
||||||
|
let main_syntax = 'yaml' |
||||||
|
endif |
||||||
|
|
||||||
|
let b:current_syntax = '' |
||||||
|
unlet b:current_syntax |
||||||
|
runtime! syntax/yaml.vim |
||||||
|
|
||||||
|
let b:current_syntax = '' |
||||||
|
unlet b:current_syntax |
||||||
|
syntax include @Yaml syntax/yaml.vim |
||||||
|
|
||||||
|
syn case match |
||||||
|
|
||||||
|
" Go escapes |
||||||
|
syn match goEscapeOctal display contained "\\[0-7]\{3}" |
||||||
|
syn match goEscapeC display contained +\\[abfnrtv\\'"]+ |
||||||
|
syn match goEscapeX display contained "\\x\x\{2}" |
||||||
|
syn match goEscapeU display contained "\\u\x\{4}" |
||||||
|
syn match goEscapeBigU display contained "\\U\x\{8}" |
||||||
|
syn match goEscapeError display contained +\\[^0-7xuUabfnrtv\\'"]+ |
||||||
|
|
||||||
|
hi def link goEscapeOctal goSpecialString |
||||||
|
hi def link goEscapeC goSpecialString |
||||||
|
hi def link goEscapeX goSpecialString |
||||||
|
hi def link goEscapeU goSpecialString |
||||||
|
hi def link goEscapeBigU goSpecialString |
||||||
|
hi def link goSpecialString Special |
||||||
|
hi def link goEscapeError Error |
||||||
|
|
||||||
|
" Strings and their contents |
||||||
|
syn cluster goStringGroup contains=goEscapeOctal,goEscapeC,goEscapeX,goEscapeU,goEscapeBigU,goEscapeError |
||||||
|
syn region goString contained start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=@goStringGroup |
||||||
|
syn region goRawString contained start=+`+ end=+`+ |
||||||
|
|
||||||
|
hi def link goString String |
||||||
|
hi def link goRawString String |
||||||
|
|
||||||
|
" Characters; their contents |
||||||
|
syn cluster goCharacterGroup contains=goEscapeOctal,goEscapeC,goEscapeX,goEscapeU,goEscapeBigU |
||||||
|
syn region goCharacter contained start=+'+ skip=+\\\\\|\\'+ end=+'+ contains=@goCharacterGroup |
||||||
|
|
||||||
|
hi def link goCharacter Character |
||||||
|
|
||||||
|
" Integers |
||||||
|
syn match goDecimalInt contained "\<\d\+\([Ee]\d\+\)\?\>" |
||||||
|
syn match goHexadecimalInt contained "\<0x\x\+\>" |
||||||
|
syn match goOctalInt contained "\<0\o\+\>" |
||||||
|
syn match goOctalError contained "\<0\o*[89]\d*\>" |
||||||
|
syn cluster goInt contains=goDecimalInt,goHexadecimalInt,goOctalInt |
||||||
|
" Floating point |
||||||
|
syn match goFloat contained "\<\d\+\.\d*\([Ee][-+]\d\+\)\?\>" |
||||||
|
syn match goFloat contained "\<\.\d\+\([Ee][-+]\d\+\)\?\>" |
||||||
|
syn match goFloat contained "\<\d\+[Ee][-+]\d\+\>" |
||||||
|
" Imaginary literals |
||||||
|
syn match goImaginary contained "\<\d\+i\>" |
||||||
|
syn match goImaginary contained "\<\d\+\.\d*\([Ee][-+]\d\+\)\?i\>" |
||||||
|
syn match goImaginary contained "\<\.\d\+\([Ee][-+]\d\+\)\?i\>" |
||||||
|
syn match goImaginary contained "\<\d\+[Ee][-+]\d\+i\>" |
||||||
|
|
||||||
|
hi def link goInt Number |
||||||
|
hi def link goFloat Number |
||||||
|
hi def link goImaginary Number |
||||||
|
|
||||||
|
" Token groups |
||||||
|
syn cluster gotplLiteral contains=goString,goRawString,goCharacter,@goInt,goFloat,goImaginary |
||||||
|
syn keyword gotplControl contained if else end range with template include tpl required define |
||||||
|
syn keyword gotplFunctions contained and call html index js len not or print printf println urlquery eq ne lt le gt ge |
||||||
|
syn keyword goSprigFunctions contained abbrev abbrevboth add add1 adler32sum ago append atoi b32dec b32enc b64dec b64enc base biggest buildCustomCert camelcase cat ceil clean coalesce \contains compact date dateInZone dateModify date_in_zone date_modify default derivePassword dict dir div empty ext fail first float64 floor fromJson fromYaml genCA genPrivateKey genSelfSignedCert genSignedCert has hasKey hasPrefix hasSuffix hello htmlDate htmlDateInZone indent initial initials int int64 isAbs join kebabcase keys kindIs kindOf last list lower max merge mergeOverwrite min mod mul nindent nospace now omit pick pluck plural prepend quote randAlpha randAlphaNum randAscii randNumeric regexFind regexFindAll regexMatch regexReplaceAll regexReplaceAllLiteral regexSplit repeat replace rest reverse round semver semverCompare set sha1sum sha256sum shuffle slice snakecase sortAlpha split splitList splitn squote sub substr swapcase ternary title toDate toJson toPrettyJson toString toStrings toToml toYaml trim trimAll trimPrefix trimSuffix trimall trunc tuple typeIs typeIsLike typeOf uniq unixEpoch unset until untilStep untitle upper uuidv4 values without wrap wrapWith |
||||||
|
syn match goTplVariable contained /\$[a-zA-Z0-9_]*\>/ |
||||||
|
syn match goTplIdentifier contained /\.[^\s}]+\>/ |
||||||
|
|
||||||
|
" hi def link gotplControl Keyword |
||||||
|
" hi def link gotplFunctions Function |
||||||
|
" hi def link goSprigFunctions Function |
||||||
|
" hi def link goTplVariable Special |
||||||
|
hi def link gotplControl goConditional |
||||||
|
hi def link gotplFunctions goConditional |
||||||
|
hi def link goSprigFunctions goConditional |
||||||
|
hi def link goTplVariable goStatement |
||||||
|
|
||||||
|
syn region gotplAction start="{{\(-? \)\?" end="\( -?\)\?}}" contains=@gotplLiteral,gotplControl,gotplFunctions,goSprigFunctions,gotplVariable,goTplIdentifier containedin=yamlFlowString display |
||||||
|
syn region gotplAction start="\[\[\(-? \)\?" end="\( -?\)\?\]\]" contains=@gotplLiteral,gotplControl,gotplFunctions,goSprigFunctions,gotplVariable containedin=yamlFlowString display |
||||||
|
syn region goTplComment start="{{\(-? \)\?/\*" end="\*/\( -?\)\?}}" display |
||||||
|
syn region goTplComment start="\[\[\(-? \)\?/\*" end="\*/\( -?\)\?\]\]" display |
||||||
|
|
||||||
|
hi def link goTplAction Operator |
||||||
|
hi def link goTplComment Comment |
||||||
|
let b:current_syntax = "helm" |
||||||
|
|
||||||
|
" vim: sw=2 ts=2 et |
@ -0,0 +1,138 @@ |
|||||||
|
" Vim syntax file |
||||||
|
" Language: Liquid |
||||||
|
" Maintainer: Tim Pope <vimNOSPAM@tpope.org> |
||||||
|
" Filenames: *.liquid |
||||||
|
" Last Change: 2010 May 21 |
||||||
|
|
||||||
|
if exists('b:current_syntax') |
||||||
|
finish |
||||||
|
endif |
||||||
|
|
||||||
|
if !exists('main_syntax') |
||||||
|
let main_syntax = 'liquid' |
||||||
|
endif |
||||||
|
|
||||||
|
if !exists('g:liquid_default_subtype') |
||||||
|
let g:liquid_default_subtype = 'html' |
||||||
|
endif |
||||||
|
|
||||||
|
if !exists('b:liquid_subtype') && main_syntax == 'liquid' |
||||||
|
let s:lines = getline(1)."\n".getline(2)."\n".getline(3)."\n".getline(4)."\n".getline(5)."\n".getline("$") |
||||||
|
let b:liquid_subtype = matchstr(s:lines,'liquid_subtype=\zs\w\+') |
||||||
|
if b:liquid_subtype == '' |
||||||
|
let b:liquid_subtype = matchstr(&filetype,'^liquid\.\zs\w\+') |
||||||
|
endif |
||||||
|
if b:liquid_subtype == '' |
||||||
|
let b:liquid_subtype = matchstr(substitute(expand('%:t'),'\c\%(\.liquid\)\+$','',''),'\.\zs\w\+$') |
||||||
|
endif |
||||||
|
if b:liquid_subtype == '' |
||||||
|
let b:liquid_subtype = g:liquid_default_subtype |
||||||
|
endif |
||||||
|
endif |
||||||
|
|
||||||
|
if exists('b:liquid_subtype') && b:liquid_subtype != '' |
||||||
|
exe 'runtime! syntax/'.b:liquid_subtype.'.vim' |
||||||
|
unlet! b:current_syntax |
||||||
|
endif |
||||||
|
|
||||||
|
syn case match |
||||||
|
|
||||||
|
if exists('b:liquid_subtype') && b:liquid_subtype != 'yaml' |
||||||
|
" YAML Front Matter |
||||||
|
syn include @liquidYamlTop syntax/yaml.vim |
||||||
|
unlet! b:current_syntax |
||||||
|
syn region liquidYamlHead start="\%^---$" end="^---\s*$" keepend contains=@liquidYamlTop,@Spell |
||||||
|
endif |
||||||
|
|
||||||
|
if !exists('g:liquid_highlight_types') |
||||||
|
let g:liquid_highlight_types = [] |
||||||
|
endif |
||||||
|
|
||||||
|
if !exists('s:subtype') |
||||||
|
let s:subtype = exists('b:liquid_subtype') ? b:liquid_subtype : '' |
||||||
|
|
||||||
|
for s:type in map(copy(g:liquid_highlight_types),'matchstr(v:val,"[^=]*$")') |
||||||
|
if s:type =~ '\.' |
||||||
|
let b:{matchstr(s:type,'[^.]*')}_subtype = matchstr(s:type,'\.\zs.*') |
||||||
|
endif |
||||||
|
exe 'syn include @liquidHighlight'.substitute(s:type,'\.','','g').' syntax/'.matchstr(s:type,'[^.]*').'.vim' |
||||||
|
unlet! b:current_syntax |
||||||
|
endfor |
||||||
|
unlet! s:type |
||||||
|
|
||||||
|
if s:subtype == '' |
||||||
|
unlet! b:liquid_subtype |
||||||
|
else |
||||||
|
let b:liquid_subtype = s:subtype |
||||||
|
endif |
||||||
|
unlet s:subtype |
||||||
|
endif |
||||||
|
|
||||||
|
syn region liquidStatement matchgroup=liquidDelimiter start="{%" end="%}" contains=@liquidStatement containedin=ALLBUT,@liquidExempt keepend |
||||||
|
syn region liquidExpression matchgroup=liquidDelimiter start="{{" end="}}" contains=@liquidExpression containedin=ALLBUT,@liquidExempt keepend |
||||||
|
syn region liquidComment matchgroup=liquidDelimiter start="{%\s*comment\s*%}" end="{%\s*endcomment\s*%}" contains=liquidTodo,@Spell containedin=ALLBUT,@liquidExempt keepend |
||||||
|
syn region liquidRaw matchgroup=liquidDelimiter start="{%\s*raw\s*%}" end="{%\s*endraw\s*%}" contains=TOP,@liquidExempt containedin=ALLBUT,@liquidExempt keepend |
||||||
|
|
||||||
|
syn cluster liquidExempt contains=liquidStatement,liquidExpression,liquidComment,liquidRaw,@liquidStatement,liquidYamlHead |
||||||
|
syn cluster liquidStatement contains=liquidConditional,liquidRepeat,liquidKeyword,@liquidExpression |
||||||
|
syn cluster liquidExpression contains=liquidOperator,liquidString,liquidNumber,liquidFloat,liquidBoolean,liquidNull,liquidEmpty,liquidPipe,liquidForloop |
||||||
|
|
||||||
|
syn keyword liquidKeyword highlight nextgroup=liquidTypeHighlight skipwhite contained |
||||||
|
syn keyword liquidKeyword endhighlight contained |
||||||
|
syn region liquidHighlight start="{%\s*highlight\s\+\w\+\s*%}" end="{% endhighlight %}" keepend |
||||||
|
|
||||||
|
for s:type in g:liquid_highlight_types |
||||||
|
exe 'syn match liquidTypeHighlight "\<'.matchstr(s:type,'[^=]*').'\>" contained' |
||||||
|
exe 'syn region liquidHighlight'.substitute(matchstr(s:type,'[^=]*$'),'\..*','','').' start="{%\s*highlight\s\+'.matchstr(s:type,'[^=]*').'\s*%}" end="{% endhighlight %}" keepend contains=@liquidHighlight'.substitute(matchstr(s:type,'[^=]*$'),'\.','','g') |
||||||
|
endfor |
||||||
|
unlet! s:type |
||||||
|
|
||||||
|
syn region liquidString matchgroup=liquidQuote start=+"+ end=+"+ contained |
||||||
|
syn region liquidString matchgroup=liquidQuote start=+'+ end=+'+ contained |
||||||
|
syn match liquidNumber "-\=\<\d\+\>" contained |
||||||
|
syn match liquidFloat "-\=\<\d\+\>\.\.\@!\%(\d\+\>\)\=" contained |
||||||
|
syn keyword liquidBoolean true false contained |
||||||
|
syn keyword liquidNull null nil contained |
||||||
|
syn match liquidEmpty "\<empty\>" contained |
||||||
|
|
||||||
|
syn keyword liquidOperator and or not contained |
||||||
|
syn match liquidPipe '|' contained skipwhite nextgroup=liquidFilter |
||||||
|
|
||||||
|
syn keyword liquidFilter date capitalize downcase upcase first last join sort size strip_html strip_newlines newline_to_br replace replace_first remove remove_first truncate truncatewords prepend append minus plus times divided_by contained |
||||||
|
|
||||||
|
syn keyword liquidConditional if elsif else endif unless endunless case when endcase ifchanged endifchanged contained |
||||||
|
syn keyword liquidRepeat for endfor tablerow endtablerow in contained |
||||||
|
syn match liquidRepeat "\%({%\s*\)\@<=empty\>" contained |
||||||
|
syn keyword liquidKeyword assign cycle include with contained |
||||||
|
|
||||||
|
syn keyword liquidForloop forloop nextgroup=liquidForloopDot contained |
||||||
|
syn match liquidForloopDot "\." nextgroup=liquidForloopAttribute contained |
||||||
|
syn keyword liquidForloopAttribute length index index0 rindex rindex0 first last contained |
||||||
|
|
||||||
|
syn keyword liquidTablerowloop tablerowloop nextgroup=liquidTablerowloopDot contained |
||||||
|
syn match liquidTablerowloopDot "\." nextgroup=liquidTableForloopAttribute contained |
||||||
|
syn keyword liquidTablerowloopAttribute length index index0 col col0 index0 rindex rindex0 first last col_first col_last contained |
||||||
|
|
||||||
|
hi def link liquidDelimiter PreProc |
||||||
|
hi def link liquidComment Comment |
||||||
|
hi def link liquidTypeHighlight Type |
||||||
|
hi def link liquidConditional Conditional |
||||||
|
hi def link liquidRepeat Repeat |
||||||
|
hi def link liquidKeyword Keyword |
||||||
|
hi def link liquidOperator Operator |
||||||
|
hi def link liquidString String |
||||||
|
hi def link liquidQuote Delimiter |
||||||
|
hi def link liquidNumber Number |
||||||
|
hi def link liquidFloat Float |
||||||
|
hi def link liquidEmpty liquidNull |
||||||
|
hi def link liquidNull liquidBoolean |
||||||
|
hi def link liquidBoolean Boolean |
||||||
|
hi def link liquidFilter Function |
||||||
|
hi def link liquidForloop Identifier |
||||||
|
hi def link liquidForloopAttribute Identifier |
||||||
|
|
||||||
|
let b:current_syntax = 'liquid' |
||||||
|
|
||||||
|
if exists('main_syntax') && main_syntax == 'liquid' |
||||||
|
unlet main_syntax |
||||||
|
endif |
@ -0,0 +1,71 @@ |
|||||||
|
" Vim syntax file |
||||||
|
" Language: Salt States template |
||||||
|
" Maintainer: Seth House <seth@eseth.com> |
||||||
|
" Last Change: 2012 June 20 |
||||||
|
" |
||||||
|
if exists("b:current_syntax") |
||||||
|
finish |
||||||
|
endif |
||||||
|
|
||||||
|
if !exists("main_syntax") |
||||||
|
let main_syntax = 'yaml' |
||||||
|
endif |
||||||
|
|
||||||
|
let b:current_syntax = '' |
||||||
|
unlet b:current_syntax |
||||||
|
runtime! syntax/yaml.vim |
||||||
|
|
||||||
|
let b:current_syntax = '' |
||||||
|
unlet b:current_syntax |
||||||
|
syntax include @Yaml syntax/yaml.vim |
||||||
|
|
||||||
|
let b:current_syntax = '' |
||||||
|
unlet b:current_syntax |
||||||
|
|
||||||
|
" Default to look for Jinja syntax file |
||||||
|
let s:load_jinja_syntax = 0 |
||||||
|
let s:search_for_jinja_syntax = 1 |
||||||
|
if exists("g:sls_use_jinja_syntax") |
||||||
|
let s:search_for_jinja_syntax = 0 |
||||||
|
let s:load_jinja_syntax = g:sls_use_jinja_syntax |
||||||
|
endif |
||||||
|
if s:search_for_jinja_syntax |
||||||
|
let s:jinja_path = findfile("syntax/jinja.vim", &rtp, 1) |
||||||
|
if s:jinja_path != "" |
||||||
|
let s:load_jinja_syntax = 1 |
||||||
|
endif |
||||||
|
endif |
||||||
|
|
||||||
|
if s:load_jinja_syntax |
||||||
|
syntax include @Jinja syntax/jinja.vim |
||||||
|
|
||||||
|
syn cluster jinjaSLSBlocks add=jinjaTagBlock,jinjaVarBlock,jinjaComment |
||||||
|
" Mostly copy/pasted from |
||||||
|
" https://github.com/mitsuhiko/jinja2/blob/6b7c0c23/ext/Vim/jinja.vim |
||||||
|
syn region jinjaTagBlock matchgroup=jinjaTagDelim start=/{%-\?/ end=/-\?%}/ containedin=ALLBUT,jinjaTagBlock,jinjaVarBlock,jinjaRaw,jinjaString,jinjaNested,jinjaComment,@jinjaSLSBlocks |
||||||
|
syn region jinjaVarBlock matchgroup=jinjaVarDelim start=/{{-\?/ end=/-\?}}/ containedin=ALLBUT,jinjaTagBlock,jinjaVarBlock,jinjaRaw,jinjaString,jinjaNested,jinjaComment,@jinjaSLSBlocks |
||||||
|
syn region jinjaComment matchgroup=jinjaCommentDelim start="{#" end="#}" containedin=ALLBUT,jinjaTagBlock,jinjaVarBlock,jinjaString,@jinjaSLSBlocks |
||||||
|
else |
||||||
|
" Fall back to Django template syntax |
||||||
|
syntax include @Jinja syntax/django.vim |
||||||
|
|
||||||
|
syn cluster djangoBlocks add=djangoTagBlock,djangoVarBlock,djangoComment,djangoComBlock |
||||||
|
syn region djangoTagBlock start="{%" end="%}" contains=djangoStatement,djangoFilter,djangoArgument,djangoTagError display containedin=ALLBUT,@djangoBlocks |
||||||
|
syn region djangoVarBlock start="{{" end="}}" contains=djangoFilter,djangoArgument,djangoVarError display containedin=ALLBUT,@djangoBlocks |
||||||
|
syn region djangoComBlock start="{#" end="#}" contains=djangoTodo containedin=ALLBUT,@djangoBlocks |
||||||
|
endif |
||||||
|
|
||||||
|
syn keyword salt_stateInclude include extend containedin=yamlBlockMappingKey |
||||||
|
highlight link salt_stateInclude Include |
||||||
|
|
||||||
|
syn keyword salt_stateSpecialArgs name names check_cmd listen listen_in onchanges onchanges_in onfail onfail_in onlyif prereq prereq_in require require_in unless use use_in watch watch_in containedin=yamlBlockMappingKey |
||||||
|
highlight link salt_stateSpecialArgs Special |
||||||
|
|
||||||
|
syn keyword salt_stateErrors requires requires_in watches watches_in includes extends containedin=yamlBlockMappingKey |
||||||
|
highlight link salt_stateErrors Error |
||||||
|
|
||||||
|
let g:NERDCustomDelimiters = { |
||||||
|
\ 'sls': { 'left': '#' }, |
||||||
|
\ } |
||||||
|
|
||||||
|
let b:current_syntax = "sls" |
@ -0,0 +1,71 @@ |
|||||||
|
" Forked from Larry Gilbert's syntax file |
||||||
|
" github.com/L2G/vim-syntax-terraform |
||||||
|
|
||||||
|
if exists('b:current_syntax') |
||||||
|
finish |
||||||
|
endif |
||||||
|
|
||||||
|
let s:cpo_save = &cpo |
||||||
|
set cpo&vim |
||||||
|
|
||||||
|
" Identifiers are made up of alphanumeric characters, underscores, and |
||||||
|
" hyphens. |
||||||
|
if has('patch-7.4.1142') |
||||||
|
syn iskeyword a-z,A-Z,48-57,_,- |
||||||
|
endif |
||||||
|
|
||||||
|
syn case match |
||||||
|
|
||||||
|
" A block is introduced by a type, some number of labels - which are either |
||||||
|
" strings or identifiers - and an opening curly brace. Match the type. |
||||||
|
syn match terraBlockIntroduction /^\s*\zs\K\k*\ze\s\+\(\("\K\k*"\|\K\k*\)\s\+\)*{/ contains=terraBlockType |
||||||
|
syn keyword terraBlockType contained data locals module output provider resource terraform variable |
||||||
|
|
||||||
|
syn keyword terraValueBool true false on off yes no |
||||||
|
|
||||||
|
syn keyword terraTodo contained TODO FIXME XXX BUG TF-UPGRADE-TODO |
||||||
|
syn region terraComment start="/\*" end="\*/" contains=terraTodo,@Spell |
||||||
|
syn region terraComment start="#" end="$" contains=terraTodo,@Spell |
||||||
|
syn region terraComment start="//" end="$" contains=terraTodo,@Spell |
||||||
|
|
||||||
|
""" misc. |
||||||
|
syn match terraValueDec "\<[0-9]\+\([kKmMgG]b\?\)\?\>" |
||||||
|
syn match terraValueHexaDec "\<0x[0-9a-f]\+\([kKmMgG]b\?\)\?\>" |
||||||
|
syn match terraBraces "[\[\]]" |
||||||
|
|
||||||
|
""" skip \" and \\ in strings. |
||||||
|
syn region terraValueString start=/"/ skip=/\\\\\|\\"/ end=/"/ contains=terraStringInterp |
||||||
|
syn region terraStringInterp matchgroup=terraBraces start=/\${/ end=/}/ contained contains=ALL |
||||||
|
syn region terraHereDocText start=/<<-\?\z([a-z0-9A-Z]\+\)/ end=/^\s*\z1/ contains=terraStringInterp |
||||||
|
|
||||||
|
"" Functions. |
||||||
|
syn match terraFunction "[a-z0-9]\+(\@=" |
||||||
|
|
||||||
|
""" HCL2 |
||||||
|
syn keyword terraRepeat for in |
||||||
|
syn keyword terraConditional if |
||||||
|
syn keyword terraType string bool number object tuple list map set any |
||||||
|
syn keyword terraValueNull null |
||||||
|
|
||||||
|
" enable block folding |
||||||
|
syn region terraBlockBody matchgroup=terraBraces start="{" end="}" fold transparent |
||||||
|
|
||||||
|
hi def link terraComment Comment |
||||||
|
hi def link terraTodo Todo |
||||||
|
hi def link terraBraces Delimiter |
||||||
|
hi def link terraBlockType Structure |
||||||
|
hi def link terraValueBool Boolean |
||||||
|
hi def link terraValueDec Number |
||||||
|
hi def link terraValueHexaDec Number |
||||||
|
hi def link terraValueString String |
||||||
|
hi def link terraHereDocText String |
||||||
|
hi def link terraFunction Function |
||||||
|
hi def link terraRepeat Repeat |
||||||
|
hi def link terraConditional Conditional |
||||||
|
hi def link terraType Type |
||||||
|
hi def link terraValueNull Constant |
||||||
|
|
||||||
|
let b:current_syntax = 'terraform' |
||||||
|
|
||||||
|
let &cpo = s:cpo_save |
||||||
|
unlet s:cpo_save |
@ -0,0 +1,197 @@ |
|||||||
|
" vim: set ft=vim foldmethod=marker: |
||||||
|
|
||||||
|
" ------------------------------------------------------------------------------ |
||||||
|
" PLUGINS |
||||||
|
" ------------------------------------------------------------------------------ |
||||||
|
|
||||||
|
" ------------------------------------------------------------------------------ |
||||||
|
" Version: $Id: autoloadTemplate.vim,v 1.2 2007/02/06 05:22:55 alanc Exp $ |
||||||
|
" File: autoloadTemplate.vim |
||||||
|
" Maintainer: Alan Che <alan.che@hotmail.com> |
||||||
|
" Last Change:2007/02/06 |
||||||
|
" |
||||||
|
" Load template file from a specific directory according their filetype while |
||||||
|
" starting to edit a new file. if the file does not exist, skip it! |
||||||
|
" |
||||||
|
let g:TemplatePath="~/.config/nvim/template" |
||||||
|
|
||||||
|
augroup loadTemplate |
||||||
|
autocmd! |
||||||
|
au FileType * call Template() |
||||||
|
|
||||||
|
function! Template() |
||||||
|
if ! exists("b:IsNewFile") |
||||||
|
return |
||||||
|
endif |
||||||
|
|
||||||
|
if exists("b:Template_loaded") |
||||||
|
return |
||||||
|
endif |
||||||
|
let b:Template_loaded=1 |
||||||
|
|
||||||
|
let b:ThisFileType=expand("<amatch>") |
||||||
|
let b:TemplatePath=g:TemplatePath ."/". b:ThisFileType . ".vim" |
||||||
|
let TemplateFullName = expand(b:TemplatePath) |
||||||
|
|
||||||
|
if filereadable(TemplateFullName) |
||||||
|
let $TemplateFullName=TemplateFullName |
||||||
|
0r $TemplateFullName |
||||||
|
unlet TemplateFullName |
||||||
|
normal G |
||||||
|
endif |
||||||
|
endfunction |
||||||
|
|
||||||
|
augroup END |
||||||
|
|
||||||
|
au BufNewFile * execute "let b:IsNewFile=1" |
||||||
|
au BufNewFile * execute "doau loadTemplate FileType" |
||||||
|
|
||||||
|
" ------------------------------------------------------------------------------ |
||||||
|
" Author: Cornelius <cornelius.howl@gmail.com> |
||||||
|
" Date: 一 12/21 20:29:23 2009 |
||||||
|
" Script type: plugin |
||||||
|
" Script id: |
||||||
|
|
||||||
|
" filetype completion hacks |
||||||
|
fun! FiletypeCompletion(lead,cmd,pos) |
||||||
|
let list = glob(expand('$VIMRUNTIME/syntax'). '/*.vim') |
||||||
|
let items = split(list,"\n") |
||||||
|
cal map(items,'matchstr(v:val,''\w\+\(.vim$\)\@='')') |
||||||
|
cal filter(items,"v:val =~ '^" . a:lead . "'") |
||||||
|
return items |
||||||
|
endf |
||||||
|
com! -complete=customlist,FiletypeCompletion -nargs=1 SetFiletype :setf <args> |
||||||
|
cabbr sft SetFiletype |
||||||
|
cabbr setf SetFiletype |
||||||
|
|
||||||
|
" ------------------------------------------------------------------------------ |
||||||
|
" Author: acustodioo <http://github.com/acustodioo> |
||||||
|
" License: GPL |
||||||
|
|
||||||
|
" if exists('g:loaded_enter_indent') | finish | endif |
||||||
|
" let g:loaded_enter_indent = 1 |
||||||
|
|
||||||
|
" let s:pairs = [ |
||||||
|
" \ ['[\{\[\(]','[\)\]\}]'], |
||||||
|
" \ ['<[^>]*>', '</[^>]*>'], |
||||||
|
" \ ['<?\(php\)\?','?>'], |
||||||
|
" \ ['<%', '%>'], |
||||||
|
" \ ['\[[^\]]*\]', '\[/[^\]]*\]'], |
||||||
|
" \ ['<\!--\(\[[^\]]*\]>\)\?', '\(<\!\[[^\]]*\]\)\?-->'], |
||||||
|
" \ ['\(#\)\?{[^\}]*\}', '\(#\)\?{[^\}]*\}'], |
||||||
|
" \ ['{{[^}]*}}', '{{[^}]*}}'], |
||||||
|
" \ ] |
||||||
|
|
||||||
|
" func! EnterIndent() |
||||||
|
" let getline = getline('.') |
||||||
|
" let col = col('.') - 1 |
||||||
|
|
||||||
|
" let getline_right = substitute( |
||||||
|
" \ strpart(getline, col, col('$')), |
||||||
|
" \ '^[ ]*', '', '' |
||||||
|
" \ ) |
||||||
|
|
||||||
|
" if getline_right == "" | call feedkeys("\<CR>", 'n') | return '' | endif |
||||||
|
|
||||||
|
" for pair in s:pairs |
||||||
|
" if matchstr(getline_right, '^' . pair[1]) != "" |
||||||
|
" let found = 1 | break |
||||||
|
" endif |
||||||
|
" endfor |
||||||
|
|
||||||
|
" if !exists('found') | call feedkeys("\<CR>", 'n') | return '' | endif |
||||||
|
|
||||||
|
" let getline_left = substitute( |
||||||
|
" \ strpart(getline, 0, col), |
||||||
|
" \ '[ ]*$', '', '' |
||||||
|
" \ ) |
||||||
|
|
||||||
|
" if matchstr(getline_left, pair[0] . '$') == "" |
||||||
|
" silent call feedkeys("\<CR>", 'n') | return '' |
||||||
|
" endif |
||||||
|
|
||||||
|
" let line = line('.') |
||||||
|
" let indent = substitute(getline_left, '^\([ |\t]*\).*$', '\1', '') |
||||||
|
|
||||||
|
" silent call setline(line, getline_left) |
||||||
|
" silent call append(line, indent . getline_right) |
||||||
|
" silent call feedkeys("\<Esc>\<Down>\O", 'n') |
||||||
|
|
||||||
|
" return '' |
||||||
|
" endf |
||||||
|
|
||||||
|
" inoremap <silent> <cr> <c-r>=EnterIndent()<cr> |
||||||
|
|
||||||
|
|
||||||
|
" ------------------------------------------------------------------------------ |
||||||
|
" CUSTOM |
||||||
|
" ------------------------------------------------------------------------------ |
||||||
|
|
||||||
|
" Восстановление состояния |
||||||
|
function RestoreState() |
||||||
|
if getline(1) != "" |
||||||
|
if bufname("") =~ "..*" |
||||||
|
" !empty(expand("<sfile>")) |
||||||
|
silent! loadview |
||||||
|
endif |
||||||
|
endif |
||||||
|
endfunction |
||||||
|
|
||||||
|
" ------------------------------------------------------------------------------ |
||||||
|
|
||||||
|
" Автоматически делать файл исполнимым |
||||||
|
function ModeChange() |
||||||
|
if getline(1) =~ "^#!/" |
||||||
|
silent !chmod a+x <afile> |
||||||
|
endif |
||||||
|
endfunction |
||||||
|
|
||||||
|
au BufWritePost * call ModeChange() |
||||||
|
|
||||||
|
" ------------------------------------------------------------------------------ |
||||||
|
|
||||||
|
" Отображение декларации функции |
||||||
|
function GetDeclaration() |
||||||
|
if strlen(glob("~/.vim/+scripts/declarations/".&ft)) |
||||||
|
echo system("~/.vim/+scripts/declarations/".&ft." '".expand("<cword>")."' ".expand("%")) |
||||||
|
endif |
||||||
|
|
||||||
|
" elseif &ft == 'perl' |
||||||
|
" echo system("echo -n $(perldoc -i -f " |
||||||
|
" \ .expand("<cword>") |
||||||
|
" \ . " | head -1 | sed -r 's/^[[:space:]]+//g')") |
||||||
|
" endif |
||||||
|
endfunction |
||||||
|
|
||||||
|
nmap <silent>fd :call GetDeclaration()<CR> |
||||||
|
|
||||||
|
" ------------------------------------------------------------------------------ |
||||||
|
|
||||||
|
" Выполнение файла с параметрами |
||||||
|
nmap <F10> :call Run("")<left><left> |
||||||
|
vmap <F10> <esc>:call Run("")<left><left> |
||||||
|
imap <F10> <esc>:call Run("")<left><left> |
||||||
|
|
||||||
|
function Run(...) |
||||||
|
if getline(1) =~ "^#!/" |
||||||
|
execute "!%:p" a:1 |
||||||
|
else |
||||||
|
execute "!\'".getcwd()."/%<\'" a:1 |
||||||
|
endif |
||||||
|
endfunction |
||||||
|
|
||||||
|
" ------------------------------------------------------------------------------ |
||||||
|
|
||||||
|
" ------------------------------------------------------------------------------ |
||||||
|
|
||||||
|
" ------------------------------------------------------------------------------ |
||||||
|
|
||||||
|
" ------------------------------------------------------------------------------ |
||||||
|
|
||||||
|
" ------------------------------------------------------------------------------ |
||||||
|
|
||||||
|
" ------------------------------------------------------------------------------ |
||||||
|
|
||||||
|
" ------------------------------------------------------------------------------ |
||||||
|
|
||||||
|
" ------------------------------------------------------------------------------ |
Loading…
Reference in new issue