Browse Source

vim: review all settings

Maxim Likhachev 4 years ago
parent
commit
313084c4e8
  1. 6
      etc/soft/nvim/+ftplugin/ansible.vim
  2. 10
      etc/soft/nvim/+ftplugin/ansible_hosts.vim
  3. 129
      etc/soft/nvim/+ftplugin/haskell.vim
  4. 61
      etc/soft/nvim/+ftplugin/liquid.vim
  5. 1
      etc/soft/nvim/+ftplugin/mru.vim
  6. 3
      etc/soft/nvim/+ftplugin/racket.vim
  7. 3
      etc/soft/nvim/+ftplugin/scheme.vim
  8. 61
      etc/soft/nvim/+ftplugin/sls.vim
  9. 184
      etc/soft/nvim/+ftplugin/terraform.vim
  10. 3
      etc/soft/nvim/+ftplugin/vimwiki.vim
  11. 177
      etc/soft/nvim/autoload/pathogen.vim
  12. 15
      etc/soft/nvim/cheat40.txt
  13. 6
      etc/soft/nvim/coc-settings.json
  14. 163
      etc/soft/nvim/ftdetect/detect.vim
  15. 1
      etc/soft/nvim/ftplugin/ansible/ansible.custom.vim
  16. 1
      etc/soft/nvim/ftplugin/ansible_hosts/ansible_hosts.custom.vim
  17. 1
      etc/soft/nvim/ftplugin/liquid/liquid.custom.vim
  18. 1
      etc/soft/nvim/ftplugin/mru/mru.custom.vim
  19. 1
      etc/soft/nvim/ftplugin/sls/sls.custom.vim
  20. 1
      etc/soft/nvim/ftplugin/terraform/terraform.custom.vim
  21. 59
      etc/soft/nvim/indent/ansible.vim
  22. 63
      etc/soft/nvim/indent/liquid.vim
  23. 64
      etc/soft/nvim/indent/terraform.vim
  24. 2
      etc/soft/nvim/init.vim
  25. 104
      etc/soft/nvim/syntax/ansible.vim
  26. 103
      etc/soft/nvim/syntax/custom/HaskellConceal.vim
  27. 61
      etc/soft/nvim/syntax/custom/RainbowParenthsis.vim
  28. 103
      etc/soft/nvim/syntax/helm.vim
  29. 138
      etc/soft/nvim/syntax/liquid.vim
  30. 71
      etc/soft/nvim/syntax/sls.vim
  31. 71
      etc/soft/nvim/syntax/terraform.vim
  32. 392
      etc/soft/nvim/vimrc
  33. 197
      etc/soft/nvim/vimrc.functions

6
etc/soft/nvim/+ftplugin/ansible.vim

@ -0,0 +1,6 @@ @@ -0,0 +1,6 @@
" Slow yaml highlighting workaround
if exists('+regexpengine') && ('&regexpengine' == 0)
setlocal regexpengine=1
endif
set isfname+=@-@
set path+=./../templates,./../files,templates,files

10
etc/soft/nvim/+ftplugin/ansible_hosts.vim

@ -0,0 +1,10 @@ @@ -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<"

129
etc/soft/nvim/+ftplugin/haskell.vim

@ -1,4 +1,131 @@ @@ -1,4 +1,131 @@
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

61
etc/soft/nvim/+ftplugin/liquid.vim

@ -0,0 +1,61 @@ @@ -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
etc/soft/nvim/+ftplugin/mru.vim

@ -0,0 +1 @@ @@ -0,0 +1 @@
set number

3
etc/soft/nvim/+ftplugin/racket.vim

@ -1 +1,4 @@ @@ -1 +1,4 @@
set makeprg=racket\ % " Проверка на ошибки и синтаксис
runtime syntax/custom/RainbowParenthsis.vim

3
etc/soft/nvim/+ftplugin/scheme.vim

@ -3,3 +3,6 @@ set keywordprg=hs()\ {\ echo\ \"(help\ $1)\"\|guile\|less;\ };\ hs @@ -3,3 +3,6 @@ set keywordprg=hs()\ {\ echo\ \"(help\ $1)\"\|guile\|less;\ };\ hs
set makeprg=guile\ % " Проверка на ошибки и синтаксис
set errorformat=%tRROR:\ %f:%l:%c:\ %m " Формат строки с информацией"
runtime syntax/custom/RainbowParenthsis.vim

61
etc/soft/nvim/+ftplugin/sls.vim

@ -0,0 +1,61 @@ @@ -0,0 +1,61 @@
" Slow yaml highlighting workaround
if exists('+regexpengine') && ('&regexpengine' == 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

184
etc/soft/nvim/+ftplugin/terraform.vim

@ -0,0 +1,184 @@ @@ -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()
" ------------------------------------------------------------------------------

3
etc/soft/nvim/+ftplugin/vimwiki.vim

@ -7,3 +7,6 @@ vmap - :normal -<CR> @@ -7,3 +7,6 @@ vmap - :normal -<CR>
set textwidth=80
" Vimwiki тормозит
set nocursorline

177
etc/soft/nvim/autoload/pathogen.vim

@ -1,6 +1,6 @@ @@ -1,6 +1,6 @@
" pathogen.vim - path option manipulation
" Maintainer: Tim Pope <http://tpo.pe/>
" Version: 2.3
" Version: 2.4
" Install in ~/.vim/autoload (or ~\vimfiles\autoload).
"
@ -16,22 +16,29 @@ endif @@ -16,22 +16,29 @@ endif
let g:loaded_pathogen = 1
" Point of entry for basic default usage. Give a relative path to invoke
" pathogen#interpose() (defaults to "bundle/{}"), or an absolute path to invoke
" pathogen#surround(). Curly braces are expanded with pathogen#expand():
" "bundle/{}" finds all subdirectories inside "bundle" inside all directories
" in the runtime path.
" pathogen#interpose() or an absolute path to invoke pathogen#surround().
" Curly braces are expanded with pathogen#expand(): "bundle/{}" finds all
" subdirectories inside "bundle" inside all directories in the runtime path.
" If no arguments are given, defaults "bundle/{}", and also "pack/{}/start/{}"
" on versions of Vim without native package support.
function! pathogen#infect(...) abort
for path in a:0 ? filter(reverse(copy(a:000)), 'type(v:val) == type("")') : ['bundle/{}']
if path =~# '^\%({\=[$~\\/]\|{\=\w:[\\/]\).*[{}*]'
if a:0
let paths = filter(reverse(copy(a:000)), 'type(v:val) == type("")')
else
let paths = ['bundle/{}', 'pack/{}/start/{}']
endif
if has('packages')
call filter(paths, 'v:val !~# "^pack/[^/]*/start/[^/]*$"')
endif
let static = '^\%([$~\\/]\|\w:[\\/]\)[^{}*]*$'
for path in filter(copy(paths), 'v:val =~# static')
call pathogen#surround(path)
endfor
for path in filter(copy(paths), 'v:val !~# static')
if path =~# '^\%([$~\\/]\|\w:[\\/]\)'
call pathogen#surround(path)
elseif path =~# '^\%([$~\\/]\|\w:[\\/]\)'
call s:warn('Change pathogen#infect('.string(path).') to pathogen#infect('.string(path.'/{}').')')
call pathogen#surround(path . '/{}')
elseif path =~# '[{}*]'
call pathogen#interpose(path)
else
call s:warn('Change pathogen#infect('.string(path).') to pathogen#infect('.string(path.'/{}').')')
call pathogen#interpose(path . '/{}')
call pathogen#interpose(path)
endif
endfor
call pathogen#cycle_filetype()
@ -90,27 +97,28 @@ function! pathogen#cycle_filetype() abort @@ -90,27 +97,28 @@ function! pathogen#cycle_filetype() abort
endfunction
" Check if a bundle is disabled. A bundle is considered disabled if its
" basename or full name is included in the list g:pathogen_disabled.
" basename or full name is included in the list g:pathogen_blacklist or the
" comma delimited environment variable $VIMBLACKLIST.
function! pathogen#is_disabled(path) abort
if a:path =~# '\~$'
return 1
endif
let sep = pathogen#slash()
let blacklist = map(
\ get(g:, 'pathogen_blacklist', get(g:, 'pathogen_disabled', [])) +
\ pathogen#split($VIMBLACKLIST),
\ 'substitute(v:val, "[\\/]$", "", "")')
let blacklist = get(g:, 'pathogen_blacklist', get(g:, 'pathogen_disabled', [])) + pathogen#split($VIMBLACKLIST)
if !empty(blacklist)
call map(blacklist, 'substitute(v:val, "[\\/]$", "", "")')
endif
return index(blacklist, fnamemodify(a:path, ':t')) != -1 || index(blacklist, a:path) != -1
endfunction "}}}1
endfunction
" Prepend the given directory to the runtime path and append its corresponding
" after directory. Curly braces are expanded with pathogen#expand().
function! pathogen#surround(path) abort
let sep = pathogen#slash()
let rtp = pathogen#split(&rtp)
let path = fnamemodify(a:path, ':p:?[\\/]\=$??')
let path = fnamemodify(a:path, ':s?[\\/]\=$??')
let before = filter(pathogen#expand(path), '!pathogen#is_disabled(v:val)')
let after = filter(reverse(pathogen#expand(path.sep.'after')), '!pathogen#is_disabled(v:val[0:-7])')
let after = filter(reverse(pathogen#expand(path, sep.'after')), '!pathogen#is_disabled(v:val[0 : -7])')
call filter(rtp, 'index(before + after, v:val) == -1')
let &rtp = pathogen#join(before, rtp, after)
return &rtp
@ -128,7 +136,7 @@ function! pathogen#interpose(name) abort @@ -128,7 +136,7 @@ function! pathogen#interpose(name) abort
let list = []
for dir in pathogen#split(&rtp)
if dir =~# '\<after$'
let list += reverse(filter(pathogen#expand(dir[0:-6].name.sep.'after'), '!pathogen#is_disabled(v:val[0:-7])')) + [dir]
let list += reverse(filter(pathogen#expand(dir[0 : -6].name, sep.'after'), '!pathogen#is_disabled(v:val[0 : -7])')) + [dir]
else
let list += [dir] + filter(pathogen#expand(dir.sep.name), '!pathogen#is_disabled(v:val)')
endif
@ -171,22 +179,26 @@ endfunction @@ -171,22 +179,26 @@ endfunction
" alternatives of that string. pathogen#expand('/{a,b}/{c,d}') yields
" ['/a/c', '/a/d', '/b/c', '/b/d']. Empty braces are treated as a wildcard
" and globbed. Actual globs are preserved.
function! pathogen#expand(pattern) abort
if a:pattern =~# '{[^{}]\+}'
let [pre, pat, post] = split(substitute(a:pattern, '\(.\{-\}\){\([^{}]\+\)}\(.*\)', "\\1\001\\2\001\\3", ''), "\001", 1)
function! pathogen#expand(pattern, ...) abort
let after = a:0 ? a:1 : ''
let pattern = substitute(a:pattern, '^[~$][^\/]*', '\=expand(submatch(0))', '')
if pattern =~# '{[^{}]\+}'
let [pre, pat, post] = split(substitute(pattern, '\(.\{-\}\){\([^{}]\+\)}\(.*\)', "\\1\001\\2\001\\3", ''), "\001", 1)
let found = map(split(pat, ',', 1), 'pre.v:val.post')
let results = []
for pattern in found
call extend(results, pathogen#expand(pattern))
endfor
return results
elseif a:pattern =~# '{}'
let pat = matchstr(a:pattern, '^.*{}[^*]*\%($\|[\\/]\)')
let post = a:pattern[strlen(pat) : -1]
return map(split(glob(substitute(pat, '{}', '*', 'g')), "\n"), 'v:val.post')
elseif pattern =~# '{}'
let pat = matchstr(pattern, '^.*{}[^*]*\%($\|[\\/]\)')
let post = pattern[strlen(pat) : -1]
let results = map(split(glob(substitute(pat, '{}', '*', 'g')), "\n"), 'v:val.post')
else
return [a:pattern]
let results = [pattern]
endif
let vf = pathogen#slash() . 'vimfiles'
call map(results, 'v:val =~# "\\*" ? v:val.after : isdirectory(v:val.vf.after) ? v:val.vf.after : isdirectory(v:val.after) ? v:val.after : ""')
return filter(results, '!empty(v:val)')
endfunction
" \ on Windows unless shellslash is set, / everywhere else.
@ -202,12 +214,12 @@ endfunction @@ -202,12 +214,12 @@ endfunction
function! pathogen#glob(pattern) abort
let files = split(glob(a:pattern),"\n")
return map(files,'substitute(v:val,"[".pathogen#slash()."/]$","","")')
endfunction "}}}1
endfunction
" Like pathogen#glob(), only limit the results to directories.
function! pathogen#glob_directories(pattern) abort
return filter(pathogen#glob(a:pattern),'isdirectory(v:val)')
endfunction "}}}1
endfunction
" Remove duplicates from a list.
function! pathogen#uniq(list) abort
@ -239,7 +251,7 @@ function! pathogen#fnameescape(string) abort @@ -239,7 +251,7 @@ function! pathogen#fnameescape(string) abort
endfunction
" Like findfile(), but hardcoded to use the runtimepath.
function! pathogen#runtime_findfile(file,count) abort "{{{1
function! pathogen#runtime_findfile(file,count) abort
let rtp = pathogen#join(1,pathogen#split(&rtp))
let file = findfile(a:file,rtp,a:count)
if file ==# ''
@ -249,99 +261,4 @@ function! pathogen#runtime_findfile(file,count) abort "{{{1 @@ -249,99 +261,4 @@ function! pathogen#runtime_findfile(file,count) abort "{{{1
endif
endfunction
" Section: Deprecated
function! s:warn(msg) abort
echohl WarningMsg
echomsg a:msg
echohl NONE
endfunction
" Prepend all subdirectories of path to the rtp, and append all 'after'
" directories in those subdirectories. Deprecated.
function! pathogen#runtime_prepend_subdirectories(path) abort
call s:warn('Change pathogen#runtime_prepend_subdirectories('.string(a:path).') to pathogen#infect('.string(a:path.'/{}').')')
return pathogen#surround(a:path . pathogen#slash() . '{}')
endfunction
function! pathogen#incubate(...) abort
let name = a:0 ? a:1 : 'bundle/{}'
call s:warn('Change pathogen#incubate('.(a:0 ? string(a:1) : '').') to pathogen#infect('.string(name).')')
return pathogen#interpose(name)
endfunction
" Deprecated alias for pathogen#interpose().
function! pathogen#runtime_append_all_bundles(...) abort
if a:0
call s:warn('Change pathogen#runtime_append_all_bundles('.string(a:1).') to pathogen#infect('.string(a:1.'/{}').')')
else
call s:warn('Change pathogen#runtime_append_all_bundles() to pathogen#infect()')
endif
return pathogen#interpose(a:0 ? a:1 . '/{}' : 'bundle/{}')
endfunction
if exists(':Vedit')
finish
endif
let s:vopen_warning = 0
function! s:find(count,cmd,file,lcd)
let rtp = pathogen#join(1,pathogen#split(&runtimepath))
let file = pathogen#runtime_findfile(a:file,a:count)
if file ==# ''
return "echoerr 'E345: Can''t find file \"".a:file."\" in runtimepath'"
endif
if !s:vopen_warning
let s:vopen_warning = 1
let warning = '|echohl WarningMsg|echo "Install scriptease.vim to continue using :V'.a:cmd.'"|echohl NONE'
else
let warning = ''
endif
if a:lcd
let path = file[0:-strlen(a:file)-2]
execute 'lcd `=path`'
return a:cmd.' '.pathogen#fnameescape(a:file) . warning
else
return a:cmd.' '.pathogen#fnameescape(file) . warning
endif
endfunction
function! s:Findcomplete(A,L,P)
let sep = pathogen#slash()
let cheats = {
\'a': 'autoload',
\'d': 'doc',
\'f': 'ftplugin',
\'i': 'indent',
\'p': 'plugin',
\'s': 'syntax'}
if a:A =~# '^\w[\\/]' && has_key(cheats,a:A[0])
let request = cheats[a:A[0]].a:A[1:-1]
else
let request = a:A
endif
let pattern = substitute(request,'/\|\'.sep,'*'.sep,'g').'*'
let found = {}
for path in pathogen#split(&runtimepath)
let path = expand(path, ':p')
let matches = split(glob(path.sep.pattern),"\n")
call map(matches,'isdirectory(v:val) ? v:val.sep : v:val')
call map(matches,'expand(v:val, ":p")[strlen(path)+1:-1]')
for match in matches
let found[match] = 1
endfor
endfor
return sort(keys(found))
endfunction
command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Ve :execute s:find(<count>,'edit<bang>',<q-args>,0)
command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vedit :execute s:find(<count>,'edit<bang>',<q-args>,0)
command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vopen :execute s:find(<count>,'edit<bang>',<q-args>,1)
command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vsplit :execute s:find(<count>,'split',<q-args>,<bang>1)
command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vvsplit :execute s:find(<count>,'vsplit',<q-args>,<bang>1)
command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vtabedit :execute s:find(<count>,'tabedit',<q-args>,<bang>1)
command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vpedit :execute s:find(<count>,'pedit',<q-args>,<bang>1)
command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vread :execute s:find(<count>,'read',<q-args>,<bang>1)
" vim:set et sw=2 foldmethod=expr foldexpr=getline(v\:lnum)=~'^\"\ Section\:'?'>1'\:getline(v\:lnum)=~#'^fu'?'a1'\:getline(v\:lnum)=~#'^endf'?'s1'\:'=':

15
etc/soft/nvim/cheat40.txt

@ -18,14 +18,14 @@ Press q to dismiss, <Tab> to lose focus @@ -18,14 +18,14 @@ Press q to dismiss, <Tab> to lose focus
Конец предыдущего слова ge
Конец предыдущего СЛОВА gE
ex {{{1
ex {{{2
Замена результатов поиска:%s///g C
Замена в найденных стр. :g/../s/a/b/g C
Замена с подтверждением :s/a/b/gc C
Повтор последней замены :%&g C
Регистры {{{1
Регистры {{{2
Содержимое регистров :registers N
Копировать строку в `a` "ayy N
@ -48,3 +48,14 @@ ex {{{1 @@ -48,3 +48,14 @@ ex {{{1
~ \p без цифр \P
последняя строка поиска ~
signature.vim {{{1
Toggle mark 'x' mx
Remove mark 'x' dmx
Place the next available mark m,
Delete all line marks m-
Delete all buffer marks m<Space>
Jump to next mark ]`
Jump to prev mark [`
Open buffer marks list m/

6
etc/soft/nvim/coc-settings.json

@ -1,10 +1,8 @@ @@ -1,10 +1,8 @@
{
"diagnostic.errorSign": "✖",
"suggest.autoTrigger": "none",
"coc.preferences.formatOnSaveFiletypes": [],
"codeLens.enable": true,
"coc.preferences.formatOnSaveFiletypes": ["haskell"],
"coc.preferences.snippets.enable": true,
"diagnostic.errorSign": "✖",
"suggest.autoTrigger": "none",
"languageserver": {
"golang": {
"command": "/Users/m.likhachev/go/bin/gopls",

163
etc/soft/nvim/ftdetect/detect.vim

@ -1,69 +1,118 @@ @@ -1,69 +1,118 @@
au BufNewFile,BufRead *.test set filetype=tcl
au BufNewFile,BufRead *.txt set textwidth=80
au BufNewFile,BufRead *.txt set filetype=txt
au BufRead,BufNewFile *.tex set filetype=tex
au BufRead,BufNewFile *.pro set filetype=prolog
au BufRead,BufNewFile *.xpt.vim set filetype=xpt.vim
au BufRead,BufNewFile *.xpt.vim set filetype=xpt.vim
au BufRead,BufNewFile *.vim set filetype=vim
au BufRead,BufNewFile *.mutt set filetype=muttrc
au BufRead,BufNewFile *rtorrent.rc* set filetype=rtorrent
au BufRead,BufNewFile *.gv set filetype=graphviz
au BufRead,BufNewFile *.r set filetype=rebol
au BufRead,BufNewFile rfc* set filetype=rfc
au BufRead,BufNewFile bash-fc* set filetype=sh
au BufRead,BufNewFile *.wiki set filetype=vimwiki
au BufWinEnter,BufRead,BufNewFile *.wiki set nocursorline
au BufRead,BufNewFile *.timelog set filetype=timelog
au BufRead,BufNewFile *.rkt set filetype=racket
au BufRead,BufNewFile *.scm runtime plugin/RainbowParenthsis.vim
au BufRead,BufNewFile *.lisp runtime plugin/RainbowParenthsis.vim
au BufRead,BufNewFile *.rkt runtime plugin/RainbowParenthsis.vim
au BufRead,BufNewFile *.scm set lisp
au BufRead,BufNewFile *.lisp set lisp
au BufReadPre *.doc set ro
au BufReadPre *.doc set hlsearch!
au BufRead,BufNewFile *.gv setlocal filetype=graphviz
au BufRead,BufNewFile *.lisp,*.scm setlocal lisp
au BufRead,BufNewFile *.mutt setlocal filetype=muttrc
au BufRead,BufNewFile *.note setlocal filetype=note
au BufRead,BufNewFile *.pro setlocal filetype=prolog
au BufRead,BufNewFile *.r setlocal filetype=rebol
au BufRead,BufNewFile *.rename setlocal filetype=rename
au BufRead,BufNewFile *.rkt setlocal filetype=racket
au BufRead,BufNewFile *.rsc setlocal filetype=rsc
au BufRead,BufNewFile *.sls,Saltfile setlocal filetype=sls
au BufRead,BufNewFile *.test setlocal filetype=tcl
au BufRead,BufNewFile *.tex setlocal filetype=tex
au BufRead,BufNewFile *.tf,*.tfvars setlocal filetype=terraform
au BufRead,BufNewFile *.tfstate setlocal filetype=json
au BufRead,BufNewFile *.timelog setlocal filetype=timelog
au BufRead,BufNewFile *.txt setlocal filetype=txt
au BufRead,BufNewFile *.txt setlocal textwidth=80
au BufRead,BufNewFile *.vim setlocal filetype=vim
au BufRead,BufNewFile *.wiki setlocal filetype=vimwiki
au BufRead,BufNewFile *.xpt.vim setlocal filetype=xpt.vim
au BufRead,BufNewFile *.xpt.vim setlocal filetype=xpt.vim
au BufRead,BufNewFile */templates/*.yaml,*/templates/*.tpl setlocal filetype=helm
au BufRead,BufNewFile *rtorrent.rc* setlocal filetype=rtorrent
au BufRead,BufNewFile Containerfile setlocal filetype=dockerfile
au BufRead,BufNewFile Vagrantfile setlocal filetype=ruby
au BufRead,BufNewFile bash-fc* setlocal filetype=sh
au BufRead,BufNewFile rfc* setlocal filetype=rfc
au BufWinEnter,BufRead,BufNewFile *.wiki setlocal nocursorline
au BufReadPost *.doc setlocal filetype=txt
au BufReadPost *.doc %!antiword "%"
au BufReadPost *.doc set filetype=txt
au BufReadPre *.doc setlocal hlsearch!
au BufReadPre *.doc setlocal ro
au BufReadPre *.docx set ro
au BufReadPre *.docx set hlsearch!
au BufReadPost *.docx %!docx2txt "%" -
au BufReadPost *.docx set filetype=txt
au BufReadPost *.docx setlocal filetype=txt
au BufReadPre *.docx setlocal hlsearch!
au BufReadPre *.docx setlocal ro
au BufReadPre *.odt set ro
au BufReadPre *.odt set hlsearch!
au BufReadPost *.odt setlocal filetype=txt
au BufReadPost *.odt %!odt2txt "%"
au BufReadPost *.odt set filetype=txt
au BufReadPre *.odt setlocal hlsearch!
au BufReadPre *.odt setlocal ro
au BufReadPre *.rtf set ro
au BufReadPre *.rtf set hlsearch!
au BufReadPost *.rtf %!catdoc "%"
au BufReadPost *.rtf set filetype=txt
au BufReadPre *.pdf set ro
au BufReadPre *.pdf set hlsearch!
au BufReadPost *.pdf setlocal filetype=txt
au BufReadPost *.pdf %!pdftotext -nopgbrk "%" - | fmt -csw78
au BufReadPost *.pdf set filetype=txt
au BufRead,BufNewFile *.note setf note
au BufRead,BufNewFile *.rsc set filetype=rsc
au BufNewFile,BufRead *.rename set filetype=rename
au BufReadPre *.pdf setlocal hlsearch!
au BufReadPre *.pdf setlocal ro
au BufNewFile,BufRead Vagrantfile set filetype=ruby
au BufNewFile,BufRead *.tf setlocal filetype=terraform
au BufNewFile,BufRead *.tfvars setlocal filetype=terraform
au BufNewFile,BufRead *.tfstate setlocal filetype=json
au BufNewFile,BufRead Containerfile setlocal filetype=dockerfile
au BufReadPost *.rtf setlocal filetype=txt
au BufReadPost *.rtf %!catdoc "%"
au BufReadPre *.rtf setlocal hlsearch!
au BufReadPre *.rtf setlocal ro
" Liquid
au BufNewFile,BufRead *.liquid setlocal filetype=liquid
au BufNewFile,BufRead */_layouts/*.html,*/_includes/*.html setlocal filetype=liquid
au BufNewFile,BufRead *.html,*.xml,*.textile
\ if getline(1) == '---' | setlocal filetype=liquid | endif
au BufNewFile,BufRead *.markdown,*.mkd,*.mkdn,*.md
\ if getline(1) == '---' |
\ let b:liquid_subtype = 'markdown' |
\ setlocal filetype=liquid |
\ 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
" 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

1
etc/soft/nvim/ftplugin/ansible/ansible.custom.vim

@ -0,0 +1 @@ @@ -0,0 +1 @@
../../+ftplugin/ansible.vim

1
etc/soft/nvim/ftplugin/ansible_hosts/ansible_hosts.custom.vim

@ -0,0 +1 @@ @@ -0,0 +1 @@
../../+ftplugin/ansible_hosts.vim

1
etc/soft/nvim/ftplugin/liquid/liquid.custom.vim

@ -0,0 +1 @@ @@ -0,0 +1 @@
../../+ftplugin/liquid.vim

1
etc/soft/nvim/ftplugin/mru/mru.custom.vim

@ -0,0 +1 @@ @@ -0,0 +1 @@
../../+ftplugin/mru.vim

1
etc/soft/nvim/ftplugin/sls/sls.custom.vim

@ -0,0 +1 @@ @@ -0,0 +1 @@
../../+ftplugin/sls.vim

1
etc/soft/nvim/ftplugin/terraform/terraform.custom.vim

@ -0,0 +1 @@ @@ -0,0 +1 @@
../../+ftplugin/terraform.vim

59
etc/soft/nvim/indent/ansible.vim

@ -0,0 +1,59 @@ @@ -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

63
etc/soft/nvim/indent/liquid.vim

@ -0,0 +1,63 @@ @@ -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

64
etc/soft/nvim/indent/terraform.vim

@ -0,0 +1,64 @@ @@ -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

2
etc/soft/nvim/init.vim

@ -1,3 +1,3 @@ @@ -1,3 +1,3 @@
set runtimepath^=~/.config/nvim runtimepath+=~/.config/nvim/after
let &packpath = &runtimepath
source ~/.config/nvim/vimrc
runtime vimrc

104
etc/soft/nvim/syntax/ansible.vim

@ -0,0 +1,104 @@ @@ -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"

103
etc/soft/nvim/syntax/custom/HaskellConceal.vim

@ -0,0 +1,103 @@ @@ -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

61
etc/soft/nvim/syntax/custom/RainbowParenthsis.vim

@ -0,0 +1,61 @@ @@ -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

103
etc/soft/nvim/syntax/helm.vim

@ -0,0 +1,103 @@ @@ -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

138
etc/soft/nvim/syntax/liquid.vim

@ -0,0 +1,138 @@ @@ -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

71
etc/soft/nvim/syntax/sls.vim

@ -0,0 +1,71 @@ @@ -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"

71
etc/soft/nvim/syntax/terraform.vim

@ -0,0 +1,71 @@ @@ -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

392
etc/soft/nvim/vimrc

@ -22,26 +22,15 @@ set winminwidth=0 " Минимальная ширина окна @@ -22,26 +22,15 @@ set winminwidth=0 " Минимальная ширина окна
set winaltkeys=menu " Включение Win/Alt
set autochdir " Переходить в каталог файла
set viewdir=$HOME/.shellrc/var/vim/view " Директория файлов состояний буферов
set modeline " Настройка modeline
set modelineexpr " Настройка modeline
" При выходе запоминать состояние файла
au BufWinLeave * if bufname("") =~ "..*" | mkview | endif
" Восстановление состояния
function RestoreState()
if getline(1) != ""
if bufname("") =~ "..*"
" !empty(expand("<sfile>"))
silent loadview
endif
endif
endfunction
" au BufWinEnter * call RestoreState()
au BufWinEnter * call RestoreState()
au BufWinEnter * set cursorline
" Vimwiki тормозит
au BufWinEnter *.wiki set nocursorline
" Отключение zip
let g:loaded_zipPlugin = 1
let g:loaded_zip = 1
@ -149,9 +138,10 @@ set foldcolumn=1 " Видимая колонка фолдинга @@ -149,9 +138,10 @@ set foldcolumn=1 " Видимая колонка фолдинга
" }}}---------------------------------------------------------------------------
" {{{-------------------------- Настройки поиска -------------------------------
" {{{---------------------- Настройки поиска и замены --------------------------
set incsearch " Поиск по набору текста
set inccommand=nosplit " Поиск и замена по ходу набора
set hlsearch " Подсветка результатов поиска
set wrapscan " Не останавливать поиск при достижении конца файла
set ignorecase " Игнорировать регистр букв при поиске
@ -255,55 +245,13 @@ set ch=1 " Количество строк @@ -255,55 +245,13 @@ set ch=1 " Количество строк
set cmdheight=1 " Коммандная строка в одну линию
set laststatus=2 " Всегда отображать статусную строку
" Функция отображения конструкции языка
function! SyntaxItem()
if synIDattr(synID(line("."),col("."),1),"name") == ""
return " --- "
else
return synIDattr(synID(line("."),col("."),1),"name")
endfunction
set statusline=%#Question# " Цвет
set statusline+=%t%m%r%h%w " Имя файла
" set statusline+=%{strlen(GitBranch())?'@'.GitBranch().'.git':''} " Ветка Git
set statusline+=%= " Выравн. справа
" set statusline=%#Question# " Цвет
" set statusline+=%t%m%r%h%w " Имя файла
" set statusline+=%= " Выравн. справа
" set statusline+=%#Function# " Цвет
" set statusline+=%{functionator#GetName()} " Функция
" set statusline+=%#Question# " Цвет
" set statusline+=\ [ЛЕКСЕМА:\ %{SyntaxItem()}] " Лексема
" set statusline+=%#WarningMsg# " Цвет
set statusline+=%#Function# " Цвет
set statusline+=\ [%{strlen(&ft)?&ft:'none'} " Тип файла
set statusline+=\/\%{(&fenc==\"\"?&enc:&fenc)} " Кодировка
" set statusline+=%#String# " Цвет
set statusline+=\|%L:%03l,%03v\ %p%%] " Строка/столбец
" }}}###########################################################################
" {{{ ДОПОЛНИТЕЛЬНЫЕ ФУНКЦИИ
" ##############################################################################
" Автоматически делать файл исполняемым
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>
" set statusline+=\ [%{strlen(&ft)?&ft:'none'} " Тип файла
" set statusline+=\/\%{(&fenc==\"\"?&enc:&fenc)} " Кодировка
" set statusline+=\|%L:%03l,%03v\ %p%%] " Строка/столбец
" }}}###########################################################################
" {{{ КОМБИНАЦИИ КЛАВИШ
@ -399,19 +347,6 @@ nmap <S-F9> :copen<cr> @@ -399,19 +347,6 @@ nmap <S-F9> :copen<cr>
imap <S-F9> <esc>:copen<cr>
imap <S-F9> <esc>:copen<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
nmap <F11> :echo system("robodoc &")<CR>:echo "MAKING DOCUMENTATION"<CR>
imap <F11> :echo system("robodoc &")<CR>:echo "MAKING DOCUMENTATION"<CR>
vmap <F11> :echo system("robodoc &")<CR>:echo "MAKING DOCUMENTATION"<CR>
@ -441,167 +376,16 @@ cnoremap <ESC><C-H> <C-W> @@ -441,167 +376,16 @@ cnoremap <ESC><C-H> <C-W>
nn <leader>@ :<c-u><c-r><c-r>='let @'.v:register.' =
\ '.string(getreg(v:register))<cr><c-f><left>
" Редактирование окружений (cib/dap/...) {{{
" Редактирование СЛЕДУЮЩЕГО окружения"
nnoremap cinb f(ci(
nnoremap canb f(ca(
nnoremap cinB f{ci{
nnoremap canB f{ca{
nnoremap cin( f(ci(
nnoremap can( f(ca(
nnoremap cin{ f{ci{
nnoremap can{ f{ca{
nnoremap cin) f(ci(
nnoremap can) f(ca(
nnoremap cin} f{ci{
nnoremap can} f{ca{
nnoremap cin[ f[ci[
nnoremap can[ f[ca[
nnoremap cin] f[ci[
nnoremap can] f[ca[
nnoremap cin< f<ci<
nnoremap can< f<ca<
nnoremap cin> f<ci<
nnoremap can> f<ca<
nnoremap cin' f'ci'
nnoremap can' f'ca'
nnoremap cin" f"ci"
nnoremap can" f"ca"
nnoremap dinb f(di(
nnoremap danb f(da(
nnoremap dinB f{di{
nnoremap danB f{da{
nnoremap din( f(di(
nnoremap dan( f(da(
nnoremap din{ f{di{
nnoremap dan{ f{da{
nnoremap din) f(di(
nnoremap dan) f(da(
nnoremap din} f{di{
nnoremap dan} f{da{
nnoremap din[ f[di[
nnoremap dan[ f[da[
nnoremap din] f[di[
nnoremap dan] f[da[
nnoremap din< f<di<
nnoremap dan< f<da<
nnoremap din> f<di<
nnoremap dan> f<da<
nnoremap din' f'di'
nnoremap dan' f'da'
nnoremap din" f"di"
nnoremap dan" f"da"
nnoremap yinb f(yi(
nnoremap yanb f(ya(
nnoremap yinB f{yi{
nnoremap yanB f{ya{
nnoremap yin( f(yi(
nnoremap yan( f(ya(
nnoremap yin{ f{yi{
nnoremap yan{ f{ya{
nnoremap yin) f(yi(
nnoremap yan) f(ya(
nnoremap yin} f{yi{
nnoremap yan} f{ya{
nnoremap yin[ f[yi[
nnoremap yan[ f[ya[
nnoremap yin] f[yi[
nnoremap yan] f[ya[
nnoremap yin< f<yi<
nnoremap yan< f<ya<
nnoremap yin> f<yi<
nnoremap yan> f<ya<
nnoremap yin' f'yi'
nnoremap yan' f'ya'
nnoremap yin" f"yi"
nnoremap yan" f"ya"
" Редактирование ПРЕДЫДУЩЕГО окружения
nnoremap ciNb F(ci(
nnoremap caNb F(ca(
nnoremap ciNB F{ci{
nnoremap caNB F{ca{
nnoremap ciN( F(ci(
nnoremap caN( F(ca(
nnoremap ciN{ F{ci{
nnoremap caN{ F{ca{
nnoremap ciN) F(ci(
nnoremap caN) F(ca(
nnoremap ciN} F{ci{
nnoremap caN} F{ca{
nnoremap ciN[ F[ci[
nnoremap caN[ F[ca[
nnoremap ciN] F[ci[
nnoremap caN] F[ca[
nnoremap ciN< F<ci<
nnoremap caN< F<ca<
nnoremap ciN> F<ci<
nnoremap caN> F<ca<
nnoremap ciN' F'ci'
nnoremap caN' F'ca'
nnoremap ciN" F"ci"
nnoremap caN" F"ca"
nnoremap diNb F(di(
nnoremap daNb F(da(
nnoremap diNB F{di{
nnoremap daNB F{da{
nnoremap diN( F(di(
nnoremap daN( F(da(
nnoremap diN{ F{di{
nnoremap daN{ F{da{
nnoremap diN) F(di(
nnoremap daN) F(da(
nnoremap diN} F{di{
nnoremap daN} F{da{
nnoremap diN[ F[di[
nnoremap daN[ F[da[
nnoremap diN] F[di[
nnoremap daN] F[da[
nnoremap diN< F<di<
nnoremap daN< F<da<
nnoremap diN> F<di<
nnoremap daN> F<da<
nnoremap diN' F'di'
nnoremap daN' F'da'
nnoremap diN" F"di"
nnoremap daN" F"da"
nnoremap yiNb F(yi(
nnoremap yaNb F(ya(
nnoremap yiNB F{yi{
nnoremap yaNB F{ya{
nnoremap yiN( F(yi(
nnoremap yaN( F(ya(
nnoremap yiN{ F{yi{
nnoremap yaN{ F{ya{
nnoremap yiN) F(yi(
nnoremap yaN) F(ya(
nnoremap yiN} F{yi{
nnoremap yaN} F{ya{
nnoremap yiN[ F[yi[
nnoremap yaN[ F[ya[
nnoremap yiN] F[yi[
nnoremap yaN] F[ya[
nnoremap yiN< F<yi<
nnoremap yaN< F<ya<
nnoremap yiN> F<yi<
nnoremap yaN> F<ya<
nnoremap yiN' F'yi'
nnoremap yaN' F'ya'
nnoremap yiN" F"yi"
nnoremap yaN" F"ya"
" }}}
" }}}###########################################################################
" {{{ ВВОД КОМАНД В ДРУГИХ РАСКЛАДКАХ
" {{{ НАСТРОЙКИ ФОРМАТОВ ФАЙЛОВ
" ##############################################################################
source ~/.shellrc/etc/soft/nvim/+layouts/russian.vim
source ~/.shellrc/etc/soft/nvim/+layouts/greek.vim
source ~/.shellrc/etc/soft/nvim/+layouts/coptic.vim
" Terraform {{{
" Вызов terraform fmt при сохранении файла
let g:terraform_fmt_on_save = 1
" }}}
" }}}###########################################################################
" {{{ НАСТРОЙКИ ПЛАГИНОВ
@ -727,6 +511,7 @@ let g:vimwiki_listsyms = ' ○◐●✓' @@ -727,6 +511,7 @@ let g:vimwiki_listsyms = ' ○◐●✓'
nmap <Leader>m :MRU<cr>
let MRU_File = $HOME . '/.shellrc/var/vim/mru/vim_mru_files'
let MRU_Add_Menu = 0
let MRU_Max_Entries = 150
let MRU_Exclude_Files = '^/tmp/.*\|^/var/tmp/.*\|MERGE_MSG\|.*COMMIT_EDITMSG.*\|viper.*\|_cheat\|bash-fc.*\|vifm\.rename.*\|tmpprms2en3.yml'
"}}}
@ -738,19 +523,22 @@ nmap <Leader>qr <Plug>(quickhl-reset) @@ -738,19 +523,22 @@ nmap <Leader>qr <Plug>(quickhl-reset)
vmap <Leader>qr <Plug>(quickhl-reset)
"}}}
" CommentToggle"{{{
nmap <C-C> <Plug>CommentToggle
imap <C-C> <ESC><Plug>CommentToggle
vmap <C-C> <Plug>CommentToggle
" vim-commentary {{{
nmap <C-C> <Plug>Commentary
nmap <C-C><C-C> <Plug>CommentaryLine
imap <C-C> <ESC><Plug>Commentary
vmap <C-C> <Plug>Commentary
"}}}
" Calendar"{{{
let g:calendar_navi_label = 'Пред,Тек,След'
let g:calendar_mruler = 'Январь,Февраль,Март,Апрель,Май,Июнь,Июль,Август,Сентябрь'
\.',Октябрь,Ноябрь,Декабрь'
let g:calendar_wruler = 'Вс Пн Вт Ср Чт Пт Сб'
let g:calendar_monday = 1
"}}}
" vim-signify {{{
let g:signify_sign_add = '⭢'
let g:signify_sign_delete = '⭠'
let g:signify_sign_delete_first_line = '⬿'
let g:signify_sign_change = '~' " '⮂'
let g:signify_sign_change_delete = g:signify_sign_change . g:signify_sign_delete_first_line
" }}}
" Tasklist"{{{
let g:tlWindowPosition = 1 " Открывать окно снизу экрана
@ -816,27 +604,10 @@ let g:nnn#command = 'nnn -C' @@ -816,27 +604,10 @@ let g:nnn#command = 'nnn -C'
let g:nnn#set_default_mappings = 0
" Start nnn in the current file's directory
nnoremap <leader>n :NnnPicker '%:p:h'<CR>
nnoremap <leader>n :NnnPicker %:p:h<CR>
" Floating window (neovim)
function! s:layout()
let buf = nvim_create_buf(v:false, v:true)
let height = &lines - (float2nr(&lines / 3))
let width = float2nr(&columns - (&columns * 2 / 3))
let opts = {
\ 'relative': 'editor',
\ 'row': 2,
\ 'col': 8,
\ 'width': width,
\ 'height': height
\ }
call nvim_open_win(buf, v:true, opts)
endfunction
let g:nnn#layout = 'call ' . string(function('<SID>layout')) . '()'
let g:nnn#layout = { 'window': { 'width': 0.3, 'height': 0.9, 'highlight': 'Debug', 'xoffset': 0.07, 'yoffset': 0.5 } }
let g:nnn#action = { 't': 'tab split' }
@ -851,52 +622,6 @@ hi EasyMotionTarget2First ctermbg=155 ctermfg=black cterm=bold @@ -851,52 +622,6 @@ hi EasyMotionTarget2First ctermbg=155 ctermfg=black cterm=bold
hi EasyMotionTarget2Second ctermbg=119 ctermfg=black cterm=bold
" }}}
" cheat.sh {{{
" Cheat sheet file type
let g:CheatSheetFt='markdown'
" Program used to retrieve cheat sheet with its arguments
let g:CheatSheetUrlGetter='curl --silent'
" Flag to add cookie file to the query
let g:CheatSheetUrlGetterIdFlag='-b'
" cheat sheet base url
let g:CheatSheetBaseUrl='https://cht.sh'
" cheat sheet settings do not include style settings neiter comments,
" see other options below
let g:CheatSheetUrlSettings='q'
" cheat sheet pager
let g:CheatPager='less -R'
" Show comments in answers by default
" (setting this to 0 means giving ?Q to the server)
let g:CheatSheetShowCommentsByDefault=0
" cheat sheet buffer name
let g:CheatSheetBufferName="_cheat"
" Default selection in normal mode (line for whole line, word for word under cursor)
let g:CheatSheetDefaultSelection="line"
" Default query mode
" 0 => buffer
" 1 => replace (do not use or you might loose some lines of code)
" 2 => pager
" 3 => paste after query
" 4 => paste before query
let g:CheatSheetDefaultMode=0
let g:CheatSheetFrameworks = {}
" imap <script> <silent> <C-O>
" \ <ESC>:call cheat#cheat("", getcurpos()[1], getcurpos()[1], 0, 0, '!')<CR>
" }}}
" startify {{{
let g:startify_bookmarks = [
@ -942,6 +667,12 @@ hi FloatermBorder ctermbg=none ctermfg=236 @@ -942,6 +667,12 @@ hi FloatermBorder ctermbg=none ctermfg=236
" }}}
" vim-toggle {{{
let g:toggle_map = '<C-g>'
" }}}
" vim-matchup {{{
let g:matchup_matchparen_stopline = 400
@ -966,9 +697,11 @@ let g:committia_min_window_width = 80 @@ -966,9 +697,11 @@ let g:committia_min_window_width = 80
" Coc {{{
let g:coc_node_path='~/.nvm/versions/node/v12.12.0/bin/node'
let g:coc_global_extensions = ['coc-json', 'coc-yaml', 'coc-docker']
let g:coc_suggest_disable = 1
command! Lopen normal! :CocDiagnostics<CR>
nnoremap <silent> K :call <SID>show_documentation()<CR>
function! s:show_documentation()
@ -980,7 +713,7 @@ function! s:show_documentation() @@ -980,7 +713,7 @@ function! s:show_documentation()
endfunction
" Highlight the symbol and its references when holding the cursor.
autocmd CursorHold * silent call CocActionAsync('highlight')
" autocmd CursorHold * silent call CocActionAsync('highlight')
" Introduce function text object
" NOTE: Requires 'textDocument.documentSymbol' support from the language server.
@ -990,7 +723,7 @@ omap if <Plug>(coc-funcobj-i) @@ -990,7 +723,7 @@ omap if <Plug>(coc-funcobj-i)
omap af <Plug>(coc-funcobj-a)
" GoTo code navigation.
nmap <silent> gd <Plug>(coc-definition)
nmap <silent> gD :<C-u>call CocActionAsync('jumpDefinition', 'split')<CR>
nmap <silent> gy <Plug>(coc-type-definition)
" nmap <silent> gi <Plug>(coc-implementation)
nmap <silent> gr <Plug>(coc-references)
@ -1073,5 +806,38 @@ let hscoptions="Ax*Eerl↱w-Tt" @@ -1073,5 +806,38 @@ let hscoptions="Ax*Eerl↱w-Tt"
" }}}
" {{{ vista.vim
let g:vista_default_executive = 'coc'
let g:vista_cursor_delay = 0
let g:vista_echo_cursor_strategy = 'echo'
let g:vista_blink = [0, 0]
let g:vista#renderer#enable_icon = 1
let g:vista#renderer#icons = {
\ "file": "▸",
\ "function": "ℱ",
\ "module": "ℳ",
\ "variable": "𝒱",
\ "struct": "𝒮",
\ "field": "𝕗",
\ }
nmap <leader>f :Vista!!<CR>
" }}}
" }}}###########################################################################
" {{{ ВВОД КОМАНД В ДРУГИХ РАСКЛАДКАХ
" ##############################################################################
runtime +layouts/russian.vim
runtime +layouts/greek.vim
runtime +layouts/coptic.vim
" }}}###########################################################################
" {{{ ДОПОЛНИТЕЛЬНЫЕ ФУНКЦИИ
" ##############################################################################
runtime vimrc.functions
" }}} ##########################################################################

197
etc/soft/nvim/vimrc.functions

@ -0,0 +1,197 @@ @@ -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…
Cancel
Save