migrate vim configuration files
This commit is contained in:
parent
ee06a5446b
commit
b4ae067792
59 changed files with 10296 additions and 0 deletions
1
after/ftdetect/octobercms.vim
Normal file
1
after/ftdetect/octobercms.vim
Normal file
|
|
@ -0,0 +1 @@
|
|||
au BufNewFile,BufRead *.htm set filetype=octobercms
|
||||
1
after/ftplugin/help.vim
Normal file
1
after/ftplugin/help.vim
Normal file
|
|
@ -0,0 +1 @@
|
|||
nmap <buffer> q :q<CR>
|
||||
2
after/ftplugin/html.vim
Normal file
2
after/ftplugin/html.vim
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
set foldlevelstart=2
|
||||
set foldnestmax=5
|
||||
107
after/ftplugin/javascript.vim
Normal file
107
after/ftplugin/javascript.vim
Normal file
|
|
@ -0,0 +1,107 @@
|
|||
" https://gist.github.com/romainl/1f50c55b0ee92e5420de51e6c4b38491
|
||||
|
||||
nnoremap <silent> <space>cF :call CocAction('runCommand', 'eslint.executeAutofix')<CR>
|
||||
|
||||
setlocal includeexpr=RESOLVE(v:fname)
|
||||
|
||||
function! RESOLVE(module) abort
|
||||
let built_ins = [
|
||||
\ "assert",
|
||||
\ "async_hooks",
|
||||
\ "child_process",
|
||||
\ "cluster",
|
||||
\ "crypto",
|
||||
\ "dns",
|
||||
\ "domain",
|
||||
\ "events",
|
||||
\ "fs",
|
||||
\ "http",
|
||||
\ "http2",
|
||||
\ "https",
|
||||
\ "inspector",
|
||||
\ "net",
|
||||
\ "os",
|
||||
\ "path",
|
||||
\ "perf_hooks",
|
||||
\ "punycode",
|
||||
\ "querystring",
|
||||
\ "readline",
|
||||
\ "stream",
|
||||
\ "string_decoder",
|
||||
\ "tls",
|
||||
\ "tty",
|
||||
\ "dgram",
|
||||
\ "url",
|
||||
\ "util",
|
||||
\ "v8",
|
||||
\ "vm",
|
||||
\ "zlib" ]
|
||||
|
||||
" There's no source file for built-in node modules.
|
||||
" Example: var http = require('http');
|
||||
if index(built_ins, a:module) != -1
|
||||
return 0
|
||||
endif
|
||||
|
||||
" Handling absolute and relative paths.
|
||||
" Example: var foo = require('./foo.js');
|
||||
if a:module =~ '^\/' || a:module =~ '^\.\{1,2}\/'
|
||||
let root = fnamemodify(substitute(finddir("node_modules", ".;"), '/node_modules', '', ''), ':p:h:h')
|
||||
if a:module =~ '^\.\{1,2}\/'
|
||||
let module = substitute(a:module, '^\.\{1,2}\/', '', '')
|
||||
endif
|
||||
|
||||
let filename = 0
|
||||
try
|
||||
let filename = findfile(module, root)
|
||||
catch
|
||||
try
|
||||
let filename = findfile(module . ".js", root)
|
||||
catch
|
||||
try
|
||||
let filename = findfile(module . "/index.js", root)
|
||||
catch
|
||||
let filename = 0
|
||||
endtry
|
||||
endtry
|
||||
endtry
|
||||
|
||||
return filename
|
||||
endif
|
||||
|
||||
" Handling vendored-in modules.
|
||||
" Example: var _ = require('lodash');
|
||||
for dir in NODE_MODULES_PATHS()
|
||||
" require('module') => node_modules/module/package.json#main => node_modules/module/**/...
|
||||
if filereadable(dir . "/" . a:module . "/package.json")
|
||||
let package = json_decode(join(readfile(dir . "/" . a:module . "/package.json")))
|
||||
return dir . "/" . a:module . "/" . substitute(get(package, "main", "index.js"), '^\.\{1,2}\/', '', '')
|
||||
endif
|
||||
|
||||
" require('module') => node_modules/module/index.js
|
||||
if filereadable(dir . "/" . a:module . "/index.js")
|
||||
return dir . "/" . a:module . "/index.js"
|
||||
endif
|
||||
|
||||
" require('module') => node_modules/module.js
|
||||
if filereadable(dir . "/" . a:module . ".js")
|
||||
return dir . "/" . a:module . ".js"
|
||||
endif
|
||||
endfor
|
||||
|
||||
" well, well, well
|
||||
return 0
|
||||
endfunction
|
||||
|
||||
function! NODE_MODULES_PATHS() abort
|
||||
" node_modules/
|
||||
let node_modules = finddir("node_modules", ".;")
|
||||
|
||||
" node_modules/foo/node_modules/
|
||||
let basic_dirs = extend([node_modules], globpath(node_modules, "*/node_modules", 1, 1))
|
||||
|
||||
" node_modules/@foo/bar/node_modules/
|
||||
let all_dirs = extend(basic_dirs, globpath(node_modules, "@*/*/node_modules", 1, 1))
|
||||
|
||||
return all_dirs
|
||||
endfunction
|
||||
4
after/ftplugin/netrw.vim
Normal file
4
after/ftplugin/netrw.vim
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
nmap <buffer> o <CR>
|
||||
nmap <buffer><silent> q <CR>:call CloseNetrw(1)<CR>
|
||||
nmap <buffer><silent> Q :call CloseNetrw(0)<CR>
|
||||
setl bufhidden=wipe
|
||||
19
after/ftplugin/python.vim
Normal file
19
after/ftplugin/python.vim
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
set tabstop=4
|
||||
set softtabstop=0
|
||||
set shiftwidth=4
|
||||
set noexpandtab
|
||||
|
||||
" set softtabstop=8
|
||||
" set tabstop=4
|
||||
" set shiftwidth=4
|
||||
|
||||
set textwidth=88
|
||||
|
||||
set foldmethod=indent
|
||||
set foldnestmax=1
|
||||
|
||||
set colorcolumn=88
|
||||
|
||||
noremap <F4> :w<CR>:silent !clear;python %<CR> :redraw!<CR>
|
||||
nnoremap <silent> <buffer> <F5> :call SaveAndExecute('python')<CR>
|
||||
command! CTagsPython !ctags -R --fields=+l --languages=python --python-kinds=-iv -f ./.tags-py $(python -c "import os, sys; print(' '.join('{}'.format(d) for d in sys.path if os.path.isdir(d)))")
|
||||
2
after/ftplugin/qf.vim
Normal file
2
after/ftplugin/qf.vim
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
nmap <buffer> o <CR>
|
||||
nmap <buffer> q :q<CR>
|
||||
2
after/ftplugin/sass.vim
Normal file
2
after/ftplugin/sass.vim
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
|
||||
set includeexpr=substitute(substitute(substitute(v:fname,'\%(.*/\|^\)\zs','_',''),'^[\\~@]\/','./',''),'^[\\~@]','./node_modules/','')
|
||||
2
after/ftplugin/vim.vim
Normal file
2
after/ftplugin/vim.vim
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
set foldmethod=marker
|
||||
|
||||
3
after/syntax/gitcommit.vim
Normal file
3
after/syntax/gitcommit.vim
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
syn match gitCommitNumber "\<\d\+\>" containedin=gitCommitComment
|
||||
syn keyword gitCommitAhead ahead containedin=gitCommitOnBranch
|
||||
syn keyword gitCommitBehind behind containedin=gitCommitOnBranch
|
||||
79
after/syntax/html.vim
Normal file
79
after/syntax/html.vim
Normal file
|
|
@ -0,0 +1,79 @@
|
|||
syn clear htmlArg
|
||||
syn clear htmlCssDefinition
|
||||
|
||||
" css classes
|
||||
syn region cssClassRegion contained start=+class="+hs=s+7 end=+"+he=e-1 contains=htmlSpecialChar,cssClassAttr,cssAttrNoise,cssClassName containedin=htmlTag,htmlTagN keepend
|
||||
syn region cssClassRegion contained start=+class='+hs=s+7 end=+'+he=e-1 contains=htmlSpecialChar,cssClassAttr,cssAttrNoise,cssClassName containedin=htmlTag,htmlTagN keepend
|
||||
syn region cssClassName contained start=+"+hs=s+1 end=+"+he=e-1 contains=cssAttrNoise keepend
|
||||
syn region cssClassName contained start=+'+hs=s+1 end=+'+he=e-1 contains=cssAttrNoise keepend
|
||||
syn match cssClassAttr "class" contained
|
||||
|
||||
" css IDs
|
||||
syn region cssIdRegion contained start=+id="+hs=s+4 end=+"+he=e-1 contains=htmlSpecialChar,cssIdentifierAttr,cssAttrNoise,cssIdentifier containedin=htmlTag,htmlTagN keepend
|
||||
syn region cssIdRegion contained start=+id='+hs=s+4 end=+'+he=e-1 contains=htmlSpecialChar,cssIdentifierAttr,cssAttrNoise,cssIdentifier containedin=htmlTag,htmlTagN keepend
|
||||
syn region cssIdentifier contained start=+"+hs=s+1 end=+"+he=s-1 contains=cssAttrNoise keepend
|
||||
syn region cssIdentifier contained start=+'+hs=s+1 end=+'+he=s-1 contains=cssAttrNoise keepend
|
||||
syn match cssIdentifierAttr "id" contained
|
||||
|
||||
" img arguments
|
||||
syn region htmlArgRegion contained start=+src="+hs=s+5 end=+"+he=e-1 contains=htmlSpecialChar,cssAttrNoise,htmlSrcArg,htmlSrcValue containedin=htmlTag,htmlTagN keepend
|
||||
syn region htmlArgRegion contained start=+src='+hs=s+5 end=+'+he=e-1 contains=htmlSpecialChar,cssAttrNoise,htmlSrcArg,htmlSrcValue containedin=htmlTag,htmlTagN keepend
|
||||
syn region htmlSrcValue contained start=+"+hs=s+1 end=+"+he=s-1 contains=cssAttrNoise keepend
|
||||
syn region htmlSrcValue contained start=+'+hs=s+1 end=+'+he=s-1 contains=cssAttrNoise keepend
|
||||
syn match htmlSrcArg "src" contained
|
||||
|
||||
syn region htmlArgRegion contained start=+srcset="+hs=s+8 end=+"+he=e-1 contains=htmlSpecialChar,htmlSrcsetArg,htmlSrcsetValue,cssAttrNoise containedin=htmlTag,htmlTagN keepend
|
||||
syn region htmlArgRegion contained start=+srcset='+hs=s+8 end=+'+he=e-1 contains=htmlSpecialChar,htmlSrcsetArg,htmlSrcsetValue,cssAttrNoise containedin=htmlTag,htmlTagN keepend
|
||||
syn region htmlSrcsetValue contained start=+"+hs=s+1 end=+"+he=s-1 contains=cssAttrNoise keepend
|
||||
syn region htmlSrcsetValue contained start=+'+hs=s+1 end=+'+he=s-1 contains=cssAttrNoise keepend
|
||||
syn match htmlSrcsetArg "srcset" contained
|
||||
|
||||
syn region htmlArgRegion contained start=+\<alt="+hs=s+5 end=+"+he=e-1 contains=htmlSpecialChar,htmlAltArg,htmlAltValue,cssAttrNoise containedin=htmlTag,htmlTagN keepend
|
||||
syn region htmlArgRegion contained start=+\<alt='+hs=s+5 end=+'+he=e-1 contains=htmlSpecialChar,htmlAltArg,htmlAltValue,cssAttrNoise containedin=htmlTag,htmlTagN keepend
|
||||
syn region htmlAltValue contained start=+"+hs=s+1 end=+"+he=s-1 contains=cssAttrNoise keepend
|
||||
syn region htmlAltValue contained start=+'+hs=s+1 end=+'+he=s-1 contains=cssAttrNoise keepend
|
||||
syn match htmlAltArg "alt" contained
|
||||
|
||||
" data-*
|
||||
syn region htmlArgRegion contained start=+data.*="+ end=+"+ contains=htmlDataArg,htmlDataValue,cssAttrNoise,htmlTag containedin=htmlTag,htmlTagN keepend
|
||||
syn region htmlArgRegion contained start=+data.*='+ end=+'+ contains=htmlDataArg,htmlDataValue,cssAttrNoise,htmlTag containedin=htmlTag,htmlTagN keepend
|
||||
syn region htmlDataValue contained start=+"+hs=s+1 end=+"+me=e-1 contains=cssAttrNoise keepend
|
||||
syn region htmlDataValue contained start=+'+hs=s+1 end=+'+me=e-1 contains=cssAttrNoise keepend
|
||||
syn match htmlDataArg +data.*="+me=e-2 contained
|
||||
|
||||
" href
|
||||
syn region htmlArgRegion contained start=+href="+hs=s+7 end=+"+he=e-1 contains=htmlSpecialChar,htmlHrefArg,htmlHrefValue,cssAttrNoise containedin=htmlTag,htmlTagN keepend
|
||||
syn region htmlArgRegion contained start=+href='+hs=s+7 end=+'+he=e-1 contains=htmlSpecialChar,htmlHrefArg,htmlHrefValue,cssAttrNoise containedin=htmlTag,htmlTagN keepend
|
||||
syn region htmlHrefValue contained start=+"+hs=s+1 end=+"+he=s-1 contains=cssAttrNoise keepend
|
||||
syn region htmlHrefValue contained start=+'+hs=s+1 end=+'+he=s-1 contains=cssAttrNoise keepend
|
||||
syn match htmlHrefArg "href" contained
|
||||
|
||||
syn match cssAttrNoise +=+ contained
|
||||
|
||||
syn region htmlLink start="<a\>\_[^>]*\<href\>" end="</a>"me=e-4 contains=@Spell,htmlTag,htmlEndTag,htmlSpecialChar,htmlPreProc,htmlComment,htmlLeadingSpace,javaScript,@htmlPreproc,htmlArgRegion
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
"TODO better group links
|
||||
hi def link cssAttrNoise htmlTag
|
||||
hi def link cssClassName Identifier
|
||||
hi def link cssClassAttr Type
|
||||
hi def link cssIdentifier Identifier
|
||||
hi def link cssIdentifierAttr Type
|
||||
hi def link htmlSrcValue htmlImgValue
|
||||
hi def link htmlSrcArg htmlImgArg
|
||||
hi def link htmlSrcsetValue htmlImgValue
|
||||
hi def link htmlSrcsetArg htmlImgArg
|
||||
hi def link htmlAltValue htmlImgValue
|
||||
hi def link htmlAltArg htmlImgArg
|
||||
hi def link htmlImgValue Identifier
|
||||
hi def link htmlImgArg Type
|
||||
hi def link htmlDataValue Identifier
|
||||
hi def link htmlDataArg Special
|
||||
hi def link htmlHrefValue Identifier
|
||||
hi def link htmlHrefArg Type
|
||||
|
||||
|
||||
|
||||
2
after/syntax/i3config.vim
Normal file
2
after/syntax/i3config.vim
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
hi! def link ArbitraryCommand Identifier
|
||||
|
||||
2
after/syntax/python.vim
Normal file
2
after/syntax/python.vim
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
syn match pythonBrackets "[(){}\[\]]" containedin=ALL
|
||||
syn match pythonNoise "[,:]" containedin=ALL
|
||||
2
after/syntax/scss.vim
Normal file
2
after/syntax/scss.vim
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
" syn region cssURL contained matchgroup=cssFunctionName start="\<\(uri\|url\|local\|format\)\s*(" end=")" contains=cssStringQ,cssStringQQ oneline
|
||||
syn region cssURL containedin=scssDefinition matchgroup=cssFunctionName start="\<\(uri\|url\|local\|format\)\s*(" end=")" contains=cssStringQ,cssStringQQ oneline
|
||||
2
after/syntax/vim.vim
Normal file
2
after/syntax/vim.vim
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
syn match vimDefLink "def\(ine\)\= link" containedin=vimHiGroup,vimGroup
|
||||
syn match vimFoldMarker "{{{\|}}}" containedin=vimComment,vimLineComment
|
||||
61
after/syntax/vue.html
Normal file
61
after/syntax/vue.html
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
runtime! after/syntax/html.vim
|
||||
|
||||
syn keyword vueComponentTag contained template containedin=htmlSpecialTagName
|
||||
|
||||
syn match vueDirective "\(^\|\s\)\zs[v:][-:.0-9_a-z]*" containedin=htmlTag,vueTag,htmlTagN contains=vueDirectiveClass nextgroup=vueDirectiveValue
|
||||
syn match vueEvent "\(^\|\s\)\zs[@][-:.0-9_a-z]*" containedin=htmlTag,vueTag,htmlTagN nextgroup=vueEventValue
|
||||
syn match vueConditional "\<v-else" containedin=htmlTag,vueTag,htmlTagN
|
||||
syn match vueConditional "\<v-else-if" containedin=htmlTag,vueTag,htmlTagN nextgroup=vueConditionalValue
|
||||
syn match vueConditional "\<v-if\|\<v-show" containedin=htmlTag,vueTag,htmlTagN nextgroup=vueConditionalValue
|
||||
syn match vueSlot +\<slot=+he=e-1 containedin=htmlTag,vueTag,htmlTagN nextgroup=vueSlotValue
|
||||
syn match vueFor "\<v-for" containedin=htmlTag,vueTag,htmlTagN nextgroup=vueForValue
|
||||
syn match vueRef "\(^\|\s\)\zs:\?ref" containedin=htmlTag,vueTag,htmlTagN nextgroup=vueRefValue
|
||||
|
||||
syn region vueMustache start="{{"hs=s+2 end="}}"he=e-2
|
||||
syn region vueDirectiveClass contained start=+class="+hs=s+7 end=+"+he=e-1 contains=vueObjectKey
|
||||
syn region vueDirectiveValue contained start=+="+hs=s+2 end=+"+he=e-1
|
||||
" syn region vueDirectiveValue contained start=+='+hs=s+2 end=+'+he=e-1
|
||||
|
||||
syntax match vueObjectKey contained /\<\k*\ze\s*:/ contains=jsFunctionKey skipwhite skipempty nextgroup=vueObjectValue
|
||||
syntax region vueObjectKey contained start=+\z([']\)+hs=s+1 skip=+\\\%(\z1\|$\)+ end=+\z1\|$+he=e-1 contains=jsSpecial,@Spell skipwhite skipempty nextgroup=vueObjectValue
|
||||
syntax region vueObjectValue contained matchgroup=jsNoise start=/:/ end=/[,}]\@=/ contains=@jsExpression extend
|
||||
" TODO match vueObjectValue with a javascript expression
|
||||
|
||||
syn region vueEventValue contained start=+="+hs=s+2 end=+"+he=e-1
|
||||
syn region vueEventValue contained start=+='+hs=s+2 end=+'+he=e-1
|
||||
syn region vueConditionalValue contained start=+="+hs=s+2 end=+"+he=e-1
|
||||
syn region vueConditionalValue contained start=+='+hs=s+2 end=+'+he=e-1
|
||||
syn region vueForValue contained start=+="+hs=s+2 end=+"+he=e-1
|
||||
syn region vueForValue contained start=+='+hs=s+2 end=+'+he=e-1
|
||||
syn match vueRefValue contained +="[-:.0-9_a-z]*"+hs=s+2,he=e-1
|
||||
syn match vueRefValue contained +='[-:.0-9_a-z]*'+hs=s+2,he=e-1
|
||||
syn match vueSlotValue contained +"[-:.0-9_a-z]*"+hs=s+1,he=e-1
|
||||
syn match vueSlotValue contained +'[-:.0-9_a-z]*'+hs=s+1,he=e-1
|
||||
|
||||
syn match vueComponentName contained "\(<\|</\)\zsvue-[0-9A-Za-z\-]\+\|\(<\|</\)\zs\u\+[0-9A-Za-z]\+\ze\(\s\|>\)" containedin=htmlTag,vueTag,htmlTagN
|
||||
syn region vueLink start="<router-link\>[^>]*" end="</router-link>"me=e-14 contains=@Spell,vueTag,htmlEndTag,htmlSpecialChar,htmlPreProc,htmlComment,htmlLeadingSpace,javaScript,@htmlPreproc,vueComponentName
|
||||
syn region vueTag start=+<[^/]+ end=+>+ fold contained contains=htmlString,htmlArg,htmlValue,htmlTagError,htmlEvent,htmlCssDefinition,@htmlPreproc,@htmlArgCluster,vueDynamicComponent
|
||||
syn match vueComponentName contained "router-link" containedin=vueTag,htmlEndTag
|
||||
hi! def link vueLink htmlLink
|
||||
|
||||
syn match vueDynamicComponent contained "\<component\>\|\<keep-alive\>\|\<router-link\>" containedin=htmlTag,vueTag,htmlTagN
|
||||
syn match vueTransitionComponent contained "\<transition\>" containedin=htmlTag,vueTag,htmlTagN nextgroup=vueTransitionName,vueTransitionMode
|
||||
syn region vueTransitionName contained start=+\sname="+hs=s+7 end=+"+he=e-1 containedin=htmlTag,vueTag,htmlTagN
|
||||
syn region vueTransitionMode contained start=+\smode="+hs=s+7 end=+"+he=e-1 containedin=htmlTag,vueTag,htmlTagN
|
||||
|
||||
syn keyword vueTagSpecial contained template script style containedin=htmlTagN
|
||||
syn keyword htmlArg contained scoped ts
|
||||
|
||||
" syn region cssClassRegion contained start=+classes="+hs=s+9 end=+"+he=e-1 contains=htmlSpecialChar,cssClassAttr,cssAttrNoise,cssClassName containedin=htmlTag,htmlTagN keepend
|
||||
" syn region cssClassRegion contained start=+classes='+hs=s+9 end=+'+he=e-1 contains=htmlSpecialChar,cssClassAttr,cssAttrNoise,cssClassName containedin=htmlTag,htmlTagN keepend
|
||||
|
||||
syn match cssClassesAttr contained "\<[-a-zA-z0-9]*class[-a-zA-z0-9]*=" contains=htmlSpecialChar,cssClassAttr,cssAttrNoise,cssClassName containedin=htmlTag,vueTag,htmlTagN keepend nextgroup=vueClassesName
|
||||
|
||||
syn region vueClassesName contained start=+"+hs=s+1 end=+"+he=e-1
|
||||
|
||||
hi def link cssClassesAttr cssClassAttr
|
||||
hi def link vueClassesname cssClassName
|
||||
hi def link vueObjectKey cssClassName
|
||||
hi def link vueDirectiveClass Noise
|
||||
hi def link vueDirectiveClassName vueClassesName
|
||||
hi def link vueMustache Identifier
|
||||
Loading…
Add table
Add a link
Reference in a new issue