Compare commits

...

35 Commits

Author SHA1 Message Date
Ray Elliott b12e317651 update 2021-09-20 21:23:42 +01:00
Ray Elliott d6a71c92d4 fix js json issues (tsserver confilct?) 2021-09-19 14:56:16 +01:00
Ray Elliott d27b3caa9c remove abbreviations, move some into snippets 2021-09-19 13:49:22 +01:00
Ray Elliott 33fd21d06f cmp - fix snippets 2021-09-19 13:28:34 +01:00
Ray Elliott b3e1ce732b lspconfig - add snippet support, fix css 2021-09-19 13:01:52 +01:00
Ray Elliott aaf41ab39e add nvim-autopairs, nvim-ts-autotag 2021-09-09 14:56:57 +01:00
Ray Elliott 7b13d73648 add treesitter highlights 2021-09-08 22:23:35 +01:00
Ray Elliott a022178884 reformat 2021-09-08 22:23:18 +01:00
Ray Elliott d389e1fed1 move commands to separate file 2021-09-08 22:22:51 +01:00
Ray Elliott ca70b402c4 add SpacesToTabs command 2021-09-08 17:08:30 +01:00
Ray Elliott 6af0c10297 workaround for php autoindent turned off
https://github.com/nvim-treesitter/nvim-treesitter/issues/462
2021-09-08 16:44:42 +01:00
Ray Elliott 6847f5b915 restructure 2021-09-08 16:44:08 +01:00
Ray Elliott fad1f15ad4 fix vim-plug error for non-master branches 2021-09-08 16:43:54 +01:00
Ray Elliott 0f62bfa83f delete unused files 2021-09-08 16:14:14 +01:00
Ray Elliott 0046be65ca set ftplugin files to use setlocal not set 2021-09-08 16:10:05 +01:00
Ray Elliott 13956ce178 update tab settings 2021-09-08 15:56:41 +01:00
Ray Elliott 37c02901fb update 2021-09-08 15:45:27 +01:00
Ray Elliott 0752dda7dc add intelephense 2021-09-08 14:11:11 +01:00
Ray Elliott be3f150d12 update 2021-09-07 13:44:51 +01:00
Ray Elliott 5c336c9c12 add lua-format 2021-09-06 13:24:28 +01:00
Ray Elliott c6b63d871b paper-tonic -> nvim-paper-tonic 2021-09-06 13:01:43 +01:00
Ray Elliott 8c7e571333 add paper-tonic colorscheme 2021-09-06 12:47:57 +01:00
Ray Elliott dd6b4f1284 update 2021-09-05 19:47:46 +01:00
Ray Elliott e208545120 move lua config to separate module 2021-09-05 19:27:27 +01:00
Ray Elliott 17cdb1b4b5 remove unused mappings 2021-09-05 18:32:21 +01:00
Ray Elliott f7cee27291 add nvim-cmp 2021-09-05 17:52:28 +01:00
Ray Elliott 16266dada9 add lsp diagnostics color scheme 2021-09-05 17:48:05 +01:00
Ray Elliott 88d230ea34 add lsp diagnostic virtual text colors 2021-09-04 14:20:45 +01:00
Ray Elliott d4a4fde031 add treesitter playground 2021-09-04 13:37:48 +01:00
Ray Elliott 2e8442b64e add treesitter playground 2021-09-04 13:27:58 +01:00
Ray Elliott 78b7069aa7 remove unused plugins 2021-09-04 12:21:41 +01:00
Ray Elliott 174362d35f update completeopt 2021-09-04 12:21:35 +01:00
Ray Elliott cec47a2328 efm-langserver format on save 2021-09-04 11:59:31 +01:00
Ray Elliott 08ef954cd8 update nvim-lspconfig formatt on save 2021-09-04 11:40:16 +01:00
Ray Elliott dc285da74f add treesitter, nvim-langserver, efm-langserver 2021-09-04 10:11:03 +01:00
37 changed files with 468 additions and 718 deletions

View File

@ -1,4 +1,23 @@
snippet sld "/* stylelint-disable-next-line ... */"
snippet abs "pabs position: absolute;"
position: absolute;
endsnippet
snippet fix "position: fixed;"
position: fixed;
endsnippet
snippet rel "position: relative;"
position: relative;
endsnippet
snippet row "flex-direction: row;"
flex-direction: row;
endsnippet
snippet col "flex-direction: column;"
flex-direction: column;
endsnippet
snippet over "overflow: hidden;"
overflow: $0;
endsnippet
snippet style "/* stylelint-disable-next-line ... */"
/* stylelint-disable-next-line ${1:declaration-block-no-shorthand-property-overrides} */
endsnippet
@ -29,7 +48,7 @@ linear-gradient(
endsnippet
snippet bglg "background: linear-gradient ..."
background: linear-gradient(
background-image: linear-gradient(
${2:to bottom},
${3:transparent},
${4:transparent}

View File

@ -1,3 +1,15 @@
snippet pp "<?php ... ?>"
<?php $0; ?>
endsnippet
snippet pe "<?php ... ?>"
<?php echo "$0"; ?>
endsnippet
snippet ph "<?php ... ?>"
<?php esc_html( $0 ); ?>
endsnippet
snippet pf "public function ..."
public function $1($2) {
$0

View File

@ -1 +1 @@
set foldnestmax=5
setlocal foldnestmax=5

View File

@ -1,6 +1,3 @@
" NOTE also see ../ftplugin/javascript.vim
set shiftwidth=2
" https://gist.github.com/romainl/1f50c55b0ee92e5420de51e6c4b38491
nnoremap <silent> <space>cF :call CocAction('runCommand', 'eslint.executeAutofix')<CR>

2
after/ftplugin/php.vim Normal file
View File

@ -0,0 +1,2 @@
setlocal iskeyword+=$
setlocal autoindent

View File

@ -1,19 +1,11 @@
set tabstop=4
set softtabstop=0
set shiftwidth=4
set noexpandtab
setlocal tabstop=4
" set softtabstop=8
" set tabstop=4
" set shiftwidth=4
setlocal textwidth=88
set textwidth=88
setlocal foldmethod=indent
setlocal foldnestmax=1
set foldmethod=indent
set foldnestmax=1
set colorcolumn=88
setlocal 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)))")

View File

@ -1,2 +1 @@
set includeexpr=substitute(substitute(substitute(v:fname,'\%(.*/\|^\)\zs','_',''),'^[\\~@]\/','./',''),'^[\\~@]','./node_modules/','')
setlocal includeexpr=substitute(substitute(substitute(v:fname,'\%(.*/\|^\)\zs','_',''),'^[\\~@]\/','./',''),'^[\\~@]','./node_modules/','')

View File

@ -1,2 +1,2 @@
set foldmethod=marker
setlocal foldmethod=marker

4
after/indent/php.vim Normal file
View File

@ -0,0 +1,4 @@
" https://github.com/nvim-treesitter/nvim-treesitter/issues/462#issuecomment-700278736
setlocal indentexpr =
setlocal autoindent
setlocal smartindent

View File

@ -0,0 +1,18 @@
(id_selector (id_name) @CssIdentifier)
(id_selector (id_name)) @CssIdSelector
(tag_name) @HtmlTagName
(class_selector (class_name) @CssClassName)
(selectors (pseudo_class_selector (class_name) @cssPseudoClass))
(nesting_selector) @cssNestingSelector
; need to find out how to make this more specific?
(universal_selector) @CssUniversalSelector
((property_name) (_)) @CssProp
(unit) @CssUnit
(declaration (property_name) (_) @CssPropertyValue)
(media_statement (feature_query (feature_name) @cssMediaFeatureName (_ (unit) @cssMediaQueryValueUnit) @cssMediaQueryValue) @cssMediaQuery)

View File

View File

@ -0,0 +1,17 @@
(start_tag
(attribute
(attribute_name) @ClassNameAttribute (#eq? @ClassNameAttribute "class")
(quoted_attribute_value
(attribute_value) @CssClassName )))
(start_tag
(attribute
(attribute_name) @IdAttribute (#eq? @IdAttribute "id")
(quoted_attribute_value
(attribute_value) @CssIdentifier )))
(start_tag
(attribute
(attribute_name) @DataAttribute (#match? @DataAttribute "^data-")
(quoted_attribute_value
(attribute_value) @DataAttributeValue )))

View File

@ -1,3 +0,0 @@
syn match gitCommitNumber "\<\d\+\>" containedin=gitCommitComment
syn keyword gitCommitAhead ahead containedin=gitCommitOnBranch
syn keyword gitCommitBehind behind containedin=gitCommitOnBranch

View File

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

View File

@ -1,2 +0,0 @@
hi! def link ArbitraryCommand Identifier

View File

@ -1,2 +0,0 @@
syn match pythonBrackets "[(){}\[\]]" containedin=ALL
syn match pythonNoise "[,:]" containedin=ALL

View File

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

View File

@ -1,2 +0,0 @@
syn match vimDefLink "def\(ine\)\= link" containedin=vimHiGroup,vimGroup
syn match vimFoldMarker "{{{\|}}}" containedin=vimComment,vimLineComment

View File

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

View File

@ -1,40 +0,0 @@
{
"suggest.triggerAfterInsertEnter": false,
"suggest.autoTrigger": "always",
"suggest.noselect": true,
"suggest.snippetIndicator": "►",
"suggest.timeout": 1000,
"suggest.echodocSupport": true,
"signature.enable": true,
"diagnostic.enable": true,
"diagnostic.warningSign": "λ",
"diagnostic.errorSign": "Λ",
"diagnostic.infoSign": "λ",
"diagnostic.hintSign": "λ",
"coc.source.buffer.ignoreGitignore": true,
"javascript.validate.enable": false,
"vetur.format.defaultFormatter.js": "prettier-eslint",
"vetur.format.defaultFormatter.html": "prettier",
"vetur.format.defaultFormatter.scss": "prettier",
"scss.validate": true,
"python.linting.flake8Enabled": true,
"python.linting.flake8Path": "/home/ray/.local/bin/flake8",
"python.linting.lintOnSave": true,
"python.formatting.provider": "black",
"python.formatting.blackPath": "/home/ray/.local/bin/black",
"coc.preferences.formatOnSaveFiletypes": ["python", "vue"],
"sh.enable": true,
"sh.highlightParsingErrors": true,
"css.validate": true,
"stylelint.enable": true,
"stylelint.autoFixOnSave": true,
"prettier.requireConfig": true,
"eslint.enable": true,
"eslint.autoFixOnSave": true,
"eslint.filetypes": [
"javascript",
"vue"
]
}

View File

@ -22,18 +22,6 @@
color_primary = ["#555555", 19, "darkblue"]
color_primary_strong = ["#444444", 17, "darkblue"]
# color_primary_weak = ["#898fcb", 20, "blue"]
# color_primary = ["#7e84c6", 19, "darkblue"]
# color_primary_strong = ["#5c6191", 17, "darkblue"]
# color_primary_weak = ["#9f61c2", 20, "blue"]
# color_primary = ["#8132ad", 19, "darkblue"]
# color_primary_strong = ["#641b8d", 17, "darkblue"]
# color_primary_weak = ["#ff9800", 20, "blue"]
# color_primary = ["#d68000", 19, "darkblue"]
# color_primary_strong = ["#bc6200", 17, "darkblue"]
color_2_weak = ["#5e955e", 28, "darkgreen"]
color_2 = ["#008700", 22, "darkgreen"]
color_2_strong = ["#005a00", 22, "darkgreen"]
@ -73,7 +61,7 @@
ui_fg_error = ["#d70000", 196, "red"]
ui_fg_warning = ["#d75f00", 166, "yellow"]
ui_fg_question = ["#56acd7", 247, "darkgray"]
ui_fg_question = ["#d7a100", 247, "darkgray"]
# Step 3: highlights
highlights = [

View File

@ -91,7 +91,7 @@ if ($TERM =~ '256' || &t_Co >= 256) || has("gui_running")
hi ErrorMsg ctermbg=NONE ctermfg=196 cterm=italic guibg=NONE guifg=#d70000 gui=italic
hi ModeMsg ctermbg=NONE ctermfg=255 cterm=italic guibg=NONE guifg=#555555 gui=italic
hi MoreMsg ctermbg=NONE ctermfg=255 cterm=italic guibg=NONE guifg=#555555 gui=italic
hi Question ctermbg=NONE ctermfg=247 cterm=italic guibg=NONE guifg=#56acd7 gui=italic
hi Question ctermbg=NONE ctermfg=247 cterm=italic guibg=NONE guifg=#d7a100 gui=italic
hi WarningMsg ctermbg=NONE ctermfg=166 cterm=italic guibg=NONE guifg=#d75f00 gui=italic
hi CursorColumn ctermbg=250 ctermfg=NONE cterm=NONE guibg=#eeeeee guifg=NONE gui=NONE
hi EndOfBuffer ctermbg=234 ctermfg=234 cterm=NONE guibg=#ffffff guifg=#ffffff gui=NONE
@ -297,19 +297,14 @@ if ($TERM =~ '256' || &t_Co >= 256) || has("gui_running")
hi link jsonValue String
hi link jsonQuote Noise
hi link octobercmsSectionDelimiter Noise
hi link CocErrorSign ErrorMsg
hi link CocWarningSign WarningMsg
hi link CocInfoSign Question
hi link CocHintSign Question
hi link CocHighlightText IncSearch
hi link CocUnderline Error
hi link LspDiagnosticsDefaultError ErrorMsg
hi link LspDiagnosticsDefaultWarning WarningMsg
hi link LspDiagnosticsDefaultInformation Question
hi link LspDiagnosticsDefaultHint Question
hi link LspErrorText ErrorMsg
hi link LspWarningText WarningMsg
hi link LspInformationText Question
hi link LspHintText Question
hi link ALEError CocUnderline
hi link ALEErrorSign ErrorMsg
hi link ALEErrorSign ErrorMsg
hi link mkdCodeStart Comment
hi link mkdListItem Conditional
hi link netrwTreeBar Noise

View File

@ -1 +1 @@
set iskeyword+=-
setlocal iskeyword+=-

View File

@ -1,2 +0,0 @@
set tabstop=2
set shiftwidth=2

View File

@ -1,7 +1,2 @@
" also see after/ftplugin/javascript.vim
set iskeyword+=$
set tabstop=2
set shiftwidth=2
set foldmethod=syntax
setlocal iskeyword+=$
setlocal foldmethod=syntax

View File

@ -1 +0,0 @@
set iskeyword+=$

View File

@ -1 +1 @@
set iskeyword+=$
setlocal iskeyword+=$

View File

@ -1,4 +1,4 @@
set includeexpr=substitute(substitute(v:fname,'^[\\~@]\/','./',''),'^[\\~@]','./node_modules/','')
setlocal includeexpr=substitute(substitute(v:fname,'^[\\~@]\/','./',''),'^[\\~@]','./node_modules/','')
setlocal suffixesadd=.js,.vue,.scss
setlocal complete=.,w,b,u,i

27
init.commands.vim Normal file
View File

@ -0,0 +1,27 @@
" SpacesToTabs {{{
" TODO - ake a proper regex substitution
function! s:spacestotabs()
%s/^ / /e
%s/^ / /e
%s/^ / /e
%s/^ / /e
%s/^ / /e
%s/^ / /e
endfunction
command SpacesToTabs call s:spacestotabs()
"}}}
" TrimWhitespace {{{
command! -range=% TrimWhitespace let b:wv = winsaveview() |
\ keeppattern <line1>,<line2>s/\s\+$// |
\ call winrestview(b:wv)
"}}}
" Scratch, ScratchVertical {{{
command! Scratch new | setlocal buftype=nofile | setlocal bufhidden=hide | setlocal noswapfile
command! ScratchVertical vnew | setlocal buftype=nofile | setlocal bufhidden=hide | setlocal noswapfile
"}}}
"
"

View File

@ -5,50 +5,85 @@ if empty(glob('~/.config/nvim/autoload/plug.vim'))"
endif
call plug#begin('~/.config/nvim/bundle')
" colorscheme (temporary)
Plug 'https://github.com/marko-cerovac/material.nvim', { 'branch': 'main' }
let g:material_style = 'lighter'
" colorscheme in develpment paper-tonic
Plug '~/nvim-paper-tonic'
" evaluating
" #nvim-treesitter {{{
" https://github.com/nvim-treesitter/nvim-treesitter
Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'} " update the parsers on update
" config needs to be after call to plug#end
" Treesitter uses a different parser for every language, which needs to be generated
" If the language is already supported by nvim-treesitter, you can install it with
" :TSInstall <language_to_install>
" - can use tab completion with this
" Parsers not on this list can be added manually
"
" If you update nvim-treesitter and want to make sure the parser is at the latest compatible version (as specified in nvim-treesitter's lockfile.json), use
" :TSUpdate {language}.
" To update all parsers unconditionally, use
" :TSUpdate all or just :TSUpdate.
"
" Each module provides a distinct tree-sitter-based feature such as highlighting, indentation, or folding; see :h nvim-treesitter-modules or "Available modules" below for a list of modules and their options.
" All modules are disabled by default and need to be activated explicitly in your init.vim
"
" Each module can also be enabled or disabled interactively through the following commands:
" :TSBufEnable {module} " enable module on current buffer
" :TSBufDisable {module} " disable module on current buffer
" :TSEnableAll {module} [{ft}] " enable module on every buffer. If filetype is specified, enable only for this filetype.
" :TSDisableAll {module} [{ft}] " disable module on every buffer. If filetype is specified, disable only for this filetype.
" :TSModuleInfo [{module}] " list information about modules state for each filetype
"
" Check :h nvim-treesitter-commands for a list of all available commands. It may be necessary to reload the buffer (e.g., via :e) after enabling a module interactively.
"}}}
" #playground (temporary) {{{
" https://github.com/nvim-treesitter/playground
Plug 'nvim-treesitter/playground'
"}}}
" #vim-lspconfig {{{
" https://github.com/neovim/nvim-lspconfig
" https://github.com/neovim/nvim-lspconfig/wiki
Plug 'neovim/nvim-lspconfig'
"}}}
" #nvim-cmp {{{
" https://github.com/hrsh7th/nvim-cmp/
" completion
Plug 'hrsh7th/nvim-cmp', { 'branch': 'main' }
Plug 'hrsh7th/cmp-nvim-lsp', { 'branch': 'main' }
Plug 'hrsh7th/cmp-buffer', { 'branch': 'main' }
Plug 'hrsh7th/cmp-path', { 'branch': 'main' }
Plug 'quangnguyen30192/cmp-nvim-ultisnips', { 'branch': 'main' }
"}}}
" keeping
" #vim-hexokinase {{{
" https://github.com/chrisbra/Colorizer
" display colors asynchronously
Plug 'chrisbra/Colorizer'
" let g:colorizer_use_virtual_text = 1
nnoremap <silent> <cr>cc :ColorToggle<CR>
"}}}
" #coc.nvim{{{
" https://github.com/neoclide/coc.nvim
" SEE BOTTOM OF THIS FILE FOR coc#add_extension statement
" for some reason fails when added some other places
Plug 'neoclide/coc.nvim', {'branch': 'release', 'do': { -> coc#util#install()}}
let g:coc_snippet_next = '<tab>'
let g:coc_snippet_prev = '<s-tab>'
" inoremap <silent><expr> <c-n> coc#refresh()
nnoremap <silent> <silent> <space><space> :call CocAction('doHover')<CR>
nnoremap <silent> <space>cf :call CocAction('doQuickfix')<CR>
nnoremap <silent> <space>cg :call CocAction('jumpDefinition')<CR>
nnoremap <silent> <space>ci :call CocAction('jumpImplementation')<CR>
nnoremap <silent> <space>cr :call CocAction('jumpReferences')<CR>
nnoremap <silent> <space>cm :call CocAction('rename')<CR>
nnoremap <silent> <space>ca :call CocAction('codeAction')<CR>
nnoremap <silent> <space>cs :call CocAction('documentSymbols')<CR>
nnoremap <silent> <space>cS :call CocAction('workspaceSymbols')<CR>
nnoremap <silent> ]c :call CocAction('diagnosticNext')<CR>
nnoremap <silent> [c :call CocAction('diagnosticPrevious')<CR>
command! -nargs=0 Format :call CocAction('format')
command! -nargs=? Fold :call CocAction('fold', <f-args>)
" #nvim-autopairs {{{
" https://github.com/windwp/nvim-autopairs
" automatic quote, paranthesis,etc closing.
Plug 'windwp/nvim-autopairs'
"}}}
" #delimitMate{{{
" https://github.com/Raimondi/delimitMate
Plug 'Raimondi/delimitMate'
let delimitMate_expand_cr = 1
let delimitMate_expand_space = 1
"}}}
" #echodoc.vim{{{
" https://github.com/Shougo/echodoc.vim
Plug 'Shougo/echodoc.vim'
" #nvim-autopairs {{{
" https://github.com/windwp/nvim-ts-autotag
" automatic html tag closing/renaming.
Plug 'windwp/nvim-ts-autotag', { 'branch': 'main' }
"}}}
" #emmet-vim {{{
" https://github.com/mattn/emmet-vim
@ -61,6 +96,7 @@ call plug#begin('~/.config/nvim/bundle')
"}}}
" #gitgutter {{{
" https://github.com/airblade/vim-gitgutter/blob/master/README.mkd
" show git diff in sign column
Plug 'airblade/vim-gitgutter'
nmap ]h <Plug>(GitGutterNextHunk)
@ -72,6 +108,7 @@ call plug#begin('~/.config/nvim/bundle')
"}}}
" #MatchTagAlways{{{
" always highlights xml/html tags enclosing cursor
" https://github.com/Valloric/MatchTagAlways
Plug 'Valloric/MatchTagAlways'
let g:mta_filetypes = {
@ -82,26 +119,12 @@ let g:mta_filetypes = {
\ 'xml' : 1,
\}
"}}}
" #phpcomplete.vim{{{
" https://github.com/shawncplus/phpcomplete.vim
Plug 'shawncplus/phpcomplete.vim'
" https://github.com/dsawardekar/wordpress.vim
" For up to date Wordpress Files see:
" https://github.com/joseluis/wordpress.vim-generator
"}}}
" #quickscope{{{
" highlights unique characters when using f, F, etc
" https://github.com/unblevable/quick-scope
Plug 'unblevable/quick-scope'
let g:qs_highlight_on_keys = ['f', 'F', 't', 'T']
"}}}
" #rainbow{{{
" https://github.com/luochen1990/rainbow/blob/master/README.md
Plug 'luochen1990/rainbow'
let g:rainbow_active = 0
nnoremap <cr>9 :RainbowToggle<cr>
nnoremap <cr>( :RainbowToggle<cr>
"}}}
" #switch {{{
"https://github.com/AndrewRadev/switch.vim
Plug 'AndrewRadev/switch.vim'
@ -118,52 +141,6 @@ let g:mta_filetypes = {
\ ['private', 'public', 'protected']
\ ]
"}}}
" #tagbar {{{
" Plug 'majutsushi/tagbar'
"
" nnoremap <space>tb :TagbarOpen fj<CR>
" nnoremap <space>] :tag /[.#@]<c-r>=expand('<cword>')<cr><cr>
" let g:tagbar_autoclose = 1
" " let g:tagbar_autopreview = 1
" " let g:tagbar_previewwin_pos = ''
"
" let g:tagbar_type_css = {
" \ 'ctagstype' : 'css',
" \ 'kinds' : [
" \ 'c:classes',
" \ 'i:ids',
" \ 't:tags',
" \ 'm:medias'
" \ ]
" \}
"
" let g:tagbar_type_scss = {
" \ 'ctagstype' : 'scss',
" \ 'kinds' : [
" \ 'v:variables',
" \ 'c:classes',
" \ 'i:ids',
" \ 't:tags',
" \ 'd:medias',
" \ 'm:mixins',
" \ 'f:functions'
" \ ]
" \}
"
" let g:tagbar_type_vue = {
" \ 'ctagstype' : 'vue',
" \ 'kinds' : [
" \ 'o:objects',
" \ 'f:functions',
" \ 'a:array',
" \ 's:string',
" \ 'b:boolean',
" \ 'n:number',
" \ 'v:variable'
" \ ]
" \ }
"}}}
" #ultisnips {{{
" https://github.com/sirver/UltiSnips
@ -220,72 +197,6 @@ let g:mta_filetypes = {
set completefunc=CompleteSnippets
"}}}
" #vim-dispatch{{{
" https://github.com/tpope/vim-dispatch
Plug 'tpope/vim-dispatch'
"}}}
" #vim-easy-align {{{
" https://github.com/junegunn/vim-easy-align
Plug 'junegunn/vim-easy-align'
xmap ga <Plug>(EasyAlign)
nmap ga <Plug>(EasyAlign)
"}}}
" #vim-floaterm{{{
" https://github.com/voldikss/floaterm
Plug 'voldikss/vim-floaterm'
let g:floaterm_opener = 'edit'
nnoremap <space>lf :FloatermNew --height=0.9 --width=0.9 lf<CR>
nnoremap <space>lg :FloatermNew --height=0.9 --width=0.9 lazygit<CR>
"}}}
" #vim-gutentags {{{
" https://github.com/ludovicchabant/vim-gutentags
" Plug 'ludovicchabant/vim-gutentags'
"
" let g:gutentags_ctags_tagfile = '.tags'
" let g:gutentags_ctags_exclude = ['package.json', 'Session.vim', 'package-lock.json', 'TODO.txt']
" let g:gutentags_resolve_symlinks = 1
"}}}
" #vim-Jinja2-Syntax{{{
" https://github.com/studio-vx/Vim-Jinja2-Syntax
" original: https://github.com/Glench/Vim-Jinja2-Syntax
Plug 'studio-vx/Vim-Jinja2-Syntax'
"}}}
" #vim-shellcheck{{{
" https://github.com/itspriddle/vim-shellcheck
Plug 'itspriddle/vim-shellcheck'
"}}}
" #vim-SyntaxRange{{{
" https://github.com/inkarkat/vim-SyntaxRange
" Plug 'inkarkat/vim-SyntaxRange'
" command! HiJinja call SyntaxRange#Include('{{', '}}', 'jinja', 'jinjaBraces', 'jinjaVariable')
" command! HiJinja call SyntaxRange#IncludeEx('start=/{{-\?/hs=s+2 end=/-\?}}/he=s-1', 'jinja')
"}}}
" #vim-Styled-components{{{
"https://github.com/styled-components/vim-styled-components
Plug 'styled-components/vim-styled-components', { 'branch': 'main' }
"}}}
" #wordpress.vim{{{
" doesn't support universal ctags
" #Plug 'dsawardekar/wordpress.vim'
" This fork does:
" https://github.com/DArcMattr/wordpress.vim/tree/universal-ctags
" Using studio-vx fork
" Plug 'studio-vx/wordpress.vim', { 'branch': 'universal-ctags' }
"}}}
" #vim-git{{{
" https://github.com/tpope/vim-git
Plug 'tpope/vim-git'
"}}}
" #Netrw {{{
let g:netrw_liststyle=3
@ -302,17 +213,34 @@ let g:mta_filetypes = {
" fork of tpope/vim-obsession
Plug 'studio-vx/vim-obsession'
"}}}
" #undotree {{{
Plug 'mbbill/undotree'
nnoremap <space>ut :UndotreeToggle<cr>
"}}}
" #tcomment_vim{{{
" https://github.com/tomtom/tcomment_vim
Plug 'tomtom/tcomment_vim'
"}}}
" #vim-rsi{{{
"https://github.com/tpope/vim-rsi
Plug 'tpope/vim-rsi'
"}}}
" #wakatime{{{
" https://wakatime.com/vim
Plug 'wakatime/vim-wakatime'
"}}}
" #vim-repeat{{{
" https://github.com/tpope/vim-repeat
" makes repeat . work for more stuff
Plug 'tpope/vim-repeat'
"}}}
" #vim-surround{{{
Plug 'tpope/vim-surround'
"}}}
" reconfigure and learn to use properly
" #vim-fzf {{{
" https://github.com/junegunn/fzf.vim
Plug 'junegunn/fzf'
@ -321,7 +249,6 @@ Plug 'junegunn/fzf.vim'
nnoremap <space>fg :GFiles<CR>
nnoremap <space>ff :Files<CR>
nnoremap <space>fh :History<CR>
nnoremap <space>ft :Tags<CR>
nnoremap <space>fb :Buffers<CR>
nnoremap <space>fH :Helptags<CR>
@ -334,7 +261,7 @@ let g:fzf_colors =
\ 'bg+': ['bg', 'CursorLine', 'CursorColumn'],
\ 'hl+': ['fg', 'WildMenu'],
\ 'info': ['fg', 'Comment'],
\ 'border': ['fg', 'Ignore'],
\ 'border': ['fg', 'Comment'],
\ 'prompt': ['fg', 'Constant'],
\ 'pointer': ['fg', 'Special'],
\ 'marker': ['fg', 'Keyword'],
@ -342,17 +269,10 @@ let g:fzf_colors =
\ 'header': ['fg', 'Comment'] }
"}}}
" #polyglot{{{
" https://github.com/sheerun/vim-polyglot
Plug 'sheerun/vim-polyglot'
" #vim-shellcheck{{{
" https://github.com/itspriddle/vim-shellcheck
Plug 'itspriddle/vim-shellcheck'
" vue options
let g:vue_disable_pre_processors=0
" set custom syntax highlighting
augroup fixhighlighting
autocmd!
autocmd BufNewFile,BufRead *.vue syntax sync fromstart
augroup END
"}}}
" #vim-markdown{{{
" https://github.com/plasticboy/vim-markdown
@ -360,28 +280,42 @@ Plug 'plasticboy/vim-markdown'
let g:vim_markdown_toc_autofit = 1
let g:vim_markdown_fenced_languages = ['bash=sh']
"}}}
" #vim-repeat{{{
" https://github.com/tpope/vim-repeat
Plug 'tpope/vim-repeat'
" #undotree {{{
Plug 'mbbill/undotree'
nnoremap <space>ut :UndotreeToggle<cr>
"}}}
" #vim-rsi{{{
"https://github.com/tpope/vim-rsi
Plug 'tpope/vim-rsi'
" do i still need, can i replace?
" #vim-dispatch{{{
" https://github.com/tpope/vim-dispatch
Plug 'tpope/vim-dispatch'
"}}}
" #vim-surround{{{
Plug 'tpope/vim-surround'
" #vim-floaterm{{{
" https://github.com/voldikss/floaterm
" allows to open floating terminal
Plug 'voldikss/vim-floaterm'
let g:floaterm_opener = 'edit'
nnoremap <space>lf :FloatermNew --height=0.9 --width=0.9 lf<CR>
nnoremap <space>lg :FloatermNew --height=0.9 --width=0.9 lazygit<CR>
"}}}
" #vim-Jinja2-Syntax{{{
" https://github.com/studio-vx/Vim-Jinja2-Syntax
" original: https://github.com/Glench/Vim-Jinja2-Syntax
Plug 'studio-vx/Vim-Jinja2-Syntax'
"}}}
" #wakatime{{{
" https://wakatime.com/vim
Plug 'wakatime/vim-wakatime'
"}}}
" ------------------------------------------------------------------------------
call plug#end()
runtime macros/matchit.vim
" require lua init module
lua <<EOF
require('init-plugins')
EOF
" vim: set fdm=marker ft=vim:

View File

@ -44,7 +44,7 @@ function! MyTabLine() "{{{
let l:file = "''"
endif
let l:customtabline .= l:file . ' '
let l:customtabline .= l:file . '%T%#TabLineFill# '
let l:tabnumber = l:tabnumber + 1

View File

@ -2,10 +2,13 @@
" problems if I ever use ruby virtual environments or RVM or similar.
let g:ruby_host_prog = '~/.gem/ruby/2.7.0/bin/neovim-ruby-host'
set rtp+='~/nvim-paper-tonic'
source ~/.config/nvim/init.plugins.vim
source ~/.config/nvim/init.tabline.vim
source ~/.config/nvim/init.auto-window.vim
source ~/.config/nvim/init.fold-text.vim
source ~/.config/nvim/init.commands.vim
" TODO - maybe separate some of these into own files too
" #functions {{{
@ -15,7 +18,8 @@ function! <SID>SynStack()"{{{
endif
echo map(synstack(line('.'), col('.')), 'synIDattr(v:val,"name")') '-> ' . synIDattr(synIDtrans(synID(line('.'),col('.'),1)), 'name' )
endfunc
nmap <space>pp :call <SID>SynStack()<CR>
" nmap <space>pp :call <SID>SynStack()<CR>
nmap <silent><space>pp :TSHighlightCapturesUnderCursor<CR>
"}}}
function! s:RunShellCommand(cmdline) abort"{{{
" Shell command
@ -177,17 +181,6 @@ function! ToggleHighlights() abort "{{{
endfunction
"}}}
"----------------------------------------------------------------------------}}}
"#commands{{{
" TrimWhitespace{{{
command! -range=% TrimWhitespace let b:wv = winsaveview() |
\ keeppattern <line1>,<line2>s/\s\+$// |
\ call winrestview(b:wv)
"}}}
" Scratch, ScratchVertical{{{
command! Scratch new | setlocal buftype=nofile | setlocal bufhidden=hide | setlocal noswapfile
command! ScratchVertical vnew | setlocal buftype=nofile | setlocal bufhidden=hide | setlocal noswapfile
"}}}
"}}}
" #settings {{{
scriptencoding utf-8
@ -212,7 +205,7 @@ if exists('+termguicolors')
set termguicolors
endif
colorscheme paper-custom
colorscheme paper-tonic
set updatetime=100
set timeoutlen=500
@ -252,7 +245,7 @@ set hidden
set hlsearch
set completeopt=menuone
set completeopt=menuone,noselect
set nospell
set spelllang=en_gb
@ -261,12 +254,15 @@ set diffopt+=vertical
set rnu nu
set tabstop=4
set tabstop=2
set softtabstop=-1
set shiftwidth=4
set shiftwidth=0
set shiftround
set noexpandtab
set autoindent
set breakindent
set showbreak=\ \ ↳\
set formatoptions=cq
set wrapmargin=0
@ -295,10 +291,6 @@ set foldlevelstart=99
set showmode
set autoindent
set breakindent
set showbreak=\ \ ↳\
set mouse=a
set listchars=eol,tab:│\ ,trail:~,extends:>,precedes:<,space
@ -328,23 +320,11 @@ set conceallevel=0
"----------------------------------------------------------------------------}}}
" #mappings {{{
let g:mapleader = ' '
" image capable file browser
nnoremap <silent><space>rs :!VIMRUNTIME= st -t WM_FORCE_FULLSCREEN ranger<CR>
" search and replace {{{
nnoremap <space>rr :%s/\<<Ckr>=expand('<cword>')<CR>\>//g<left><left>
"}}}
" #syntax
nnoremap <silent> <cr>s :syntax on<cr>
nnoremap <silent> <cr>S :syntax off<cr>
" miscallaneous {{{
nnoremap <cr>fc :set foldcolumn=
nnoremap <cr>l :colorscheme paper-custom<cr>
nnoremap <silent> <cr>c :call ToggleHighlights()<cr>
nnoremap <cr>d :colorscheme monotonous-dark<cr>
nnoremap 0 ^
nnoremap <silent><space>cs :let @/=""<cr>
nnoremap <space>: :setlocal number<CR>:
nnoremap <silent> <space>rc :so $MYVIMRC<CR>
nnoremap <silent><expr> <space>nh (&hls && v:hlsearch ? ':nohls' : ':set hls')."\n"
" Focus on current fold, close the rest
nnoremap <silent> <space>zz zMzvzt
@ -353,20 +333,6 @@ tnoremap <Esc> <C-\><C-n>
" open quickfix window of TODOs
nnoremap <space>td :grep -RE '(TODO\\|FIXME)' .<CR>:botright cwindow<CR>:echo len(getqflist()) 'TODOs'<CR>
" sync highlighting from start
nnoremap <silent><space>ss :syntax sync fromstart<CR>
"}}}
" git mappings {{{
nnoremap <space>ga :!clear; git add %; git status<CR>
nnoremap <space>gg :!clear; git add %; git commit -m ''<Left>
nnoremap <silent><space>gs :!VIMRUNTIME= st -t WM_FORCE_FLOATING -g 230x62 tig status<CR>
"}}}
" movement/navigation{{{
" alias for :tjump <cword>
nnoremap <space>tj g<C-]>
" alias for :ptjump <cword>
nnoremap <space>tp <C-w>g}
"}}}
" location list and quickfix mappings {{{
@ -388,50 +354,18 @@ nnoremap <space>qn :cnewer<CR>
"}}}
" insert mode mappings {{{
inoremap jj; <Esc>A;<Esc>
inoremap jj, <Esc>A,<Esc>
inoremap jjrg <c-o>:reg<cr>
inoremap :w<cr> :w<cr>
inoremap [:w<cr> :w<cr>
inoremap {:w<cr> :w<cr>
nnoremap ''; '';<left><left>
"}}}
" working_with_underscores{{{
nnoremap <space>w f_l
nnoremap <space>b hT_
nnoremap <space>e lt_
onoremap u t_
onoremap U f_
"}}}
"----------------------------------------------------------------------------}}}
" #abbreviations {{{
" spelling"{{{
iabbrev adn and
iabbrev waht what
iabbrev tehn then
iabbrev functin function
iabbrev positin position
"}}}
" css{{{
" TODO move these into autocommand to just load in css, scss, jsx, files
iabbrev pabs position: absolute;
iabbrev pfix position: fixed;
iabbrev prel position: relative;
iabbrev fdr flex-direction: row;
iabbrev fdc flex-direction: column;
iabbrev jcc justify-content: center;
iabbrev aic align-items: center;
iabbrev ovh overflow: hidden;
iabbrev ovv overflow: visible;
iabbrev ova overflow: auto;
iabbrev ct'' content-type: '';
"}}}
"----------------------------------------------------------------------------}}}
" #autocommands {{{

198
lua/init-plugins.lua Normal file
View File

@ -0,0 +1,198 @@
require'nvim-treesitter.configs'.setup {
ensure_installed = "maintained", -- one of "all", "maintained" (parsers with maintainers), or a list of languages
ignore_install = { "c" }, -- List of parsers to ignore installing
highlight = {
enable = true, -- false will disable the whole extension
disable = { "c", "rust" }, -- list of language that will be disabled
-- Setting this to true will run `:h syntax` and tree-sitter at the same time.
-- Set this to `true` if you depend on 'syntax' being enabled (like for indentation).
-- Using this option may slow down your editor, and you may see some duplicate highlights.
-- Instead of true it can also be a list of languages
additional_vim_regex_highlighting = false,
},
}
--[efm-langserver]
-- " npm install -g eslint_d
local eslint = {
lintCommand = "eslint_d -f unix --stdin --stdin-filename ${INPUT}",
lintStdin = true,
lintFormats = {"%f:%l:%c: %m"},
lintIgnoreExitCode = true,
formatCommand = "eslint_d --fix-to-stdout --stdin --stdin-filename=${INPUT}",
formatStdin = true
}
local shellcheck = {
lintCommand = "shellcheck -f gcc -x",
lintSource = "shellcheck",
lintFormats = {
"%f:%l:%c: %trror: %m",
"%f:%l:%c: %tarning: %m",
"%f:%l:%c: %tote: %m",
}
}
local flake8 = {
lintCommand = "flake8 --stdin-display-name ${INPUT} -",
lintStdin = true,
lintFormats = {"%f:%l:%c: %m"}
}
local black = {
formatCommand = "black --quiet -",
formatStdin = true
}
-- sudo pacman -Syu jq
local jq = {
lintCommand = "jq ."
}
-- npm install -g fixjson
local fixjson = {
formatCommand = "fixjson"
}
-- https://aur.archlinux.org/packages/lua-format/
local luaformat = {
formatCommand = 'lua-formatt -i',
formatStdin = true
}
local util = require "lspconfig".util
local on_attach_efm = function(client)
-- if client.resolved_capabilities.document_formatting then
-- vim.cmd [[augroup lsp_formatting]]
-- vim.cmd [[autocmd!]]
-- vim.cmd [[autocmd BufWritePre <buffer> :lua vim.lsp.buf.formatting_seq_sync({}, 1000)]]
-- vim.cmd [[augroup END]]
-- end
end
require "lspconfig".efm.setup {
init_options = {documentFormatting = true},
on_attach = on_attach_efm,
filetypes = {"javascript", "json", "sh", "python", "lua"},
root_dir = function(fname)
return util.root_pattern("tsconfig.json")(fname) or
util.root_pattern(".eslintrc.js", ".git")(fname);
end,
settings = {
rootMarkers = {".eslintrc.js", ".git/"},
languages = {
javascript = {eslint},
json = {jq, fixjson},
python = {flake8, black},
sh = {shellcheck},
lua = {luaformat}
}
}
}
-- [lspconfig]
local nvim_lsp = require('lspconfig')
-- Use a loop to conveniently call 'setup' on multiple servers and
-- map buffer local keybindings when the language server attaches
local servers = {
-- npm i -g bash-language-server
-- TODO - don't run for sh files but have something else instead - shellcheck?
'bashls',
-- npm i -g vscode-langservers-extracted
'cssls',
-- npm install -g intelephense
'intelephense',
-- https://phpactor.readthedocs.io/en/master/usage/standalone.html
'phpactor',
-- npm install -g pyright
'pyright',
-- npm i -g stylelint-lsp
'stylelint_lsp',
-- https://github.com/neovim/nvim-lspconfig/wiki
-- 'tailwindcss',
-- npm install -g typescript typescript-language-server
'tsserver',
-- npm install -g vim-language-server
'vimls',
-- npm install -g vls
'vuels',
'yamlls',
}
-- Use an on_attach function to only map the following keys
-- after the language server attaches to the current buffer
local on_attach = function(client, bufnr)
local function buf_set_keymap(...) vim.api.nvim_buf_set_keymap(bufnr, ...) end
local function buf_set_option(...) vim.api.nvim_buf_set_option(bufnr, ...) end
-- Enable completion triggered by <c-x><c-o>
buf_set_option('omnifunc', 'v:lua.vim.lsp.omnifunc')
-- Mappings.
local opts = { noremap=true, silent=true }
-- See `:help vim.lsp.*` for documentation on any of the below functions
buf_set_keymap('n', 'gD', '<cmd>lua vim.lsp.buf.declaration()<CR>', opts)
buf_set_keymap('n', 'gd', '<cmd>lua vim.lsp.buf.definition()<CR>', opts)
buf_set_keymap('n', 'K', '<cmd>lua vim.lsp.buf.hover()<CR>', opts)
buf_set_keymap('n', 'gi', '<cmd>lua vim.lsp.buf.implementation()<CR>', opts)
buf_set_keymap('n', '<C-k>', '<cmd>lua vim.lsp.buf.signature_help()<CR>', opts)
buf_set_keymap('n', '[d', '<cmd>lua vim.lsp.diagnostic.goto_prev()<CR>', opts)
buf_set_keymap('n', ']d', '<cmd>lua vim.lsp.diagnostic.goto_next()<CR>', opts)
buf_set_keymap('n', 'gr', '<cmd>lua vim.lsp.buf.references()<CR>', opts)
buf_set_keymap('n', '<space>l', '<cmd>lua vim.lsp.diagnostic.set_loclist()<CR>', opts)
buf_set_keymap('n', '<space>ca', '<cmd>lua vim.lsp.buf.code_action()<CR>', opts)
buf_set_keymap('n', '<space>rn', '<cmd>lua vim.lsp.buf.rename()<CR>', opts)
buf_set_keymap('n', '<space>e', '<cmd>lua vim.lsp.diagnostic.show_line_diagnostics()<CR>', opts)
buf_set_keymap('n', '<space>D', '<cmd>lua vim.lsp.buf.type_definition()<CR>', opts)
buf_set_keymap('n', '<space>f', '<cmd>lua vim.lsp.buf.formatting()<CR>', opts)
-- buf_set_keymap('n', '<space>wa', '<cmd>lua vim.lsp.buf.add_workspace_folder()<CR>', opts)
-- buf_set_keymap('n', '<space>wr', '<cmd>lua vim.lsp.buf.remove_workspace_folder()<CR>', opts)
-- buf_set_keymap('n', '<space>wl', '<cmd>lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))<CR>', opts)
end
local capabilities = vim.lsp.protocol.make_client_capabilities()
capabilities.textDocument.completion.completionItem.snippetSupport = true
for _, lsp in ipairs(servers) do
nvim_lsp[lsp].setup {
on_attach = on_attach,
capabilities = capabilities,
flags = {
debounce_text_changes = 150,
}
}
end
local cmp = require'cmp'
cmp.setup({
completion = {
keyword_length = 4,
-- autocomplete = false
},
-- snippet = {
-- expand = function(args)
-- vim.fn["vsnip#anonymous"](args.body)
-- end,
-- },
mapping = {
['<C-n>'] = cmp.mapping.complete(),
['<C-y>'] = cmp.mapping.confirm({ select = true }),
['<C-e>'] = cmp.mapping.abort(),
},
sources = {
{ name = 'buffer' },
{ name = 'nvim_lsp' },
{ name = 'path' },
{ name = 'ultisnips' },
...
}
})
-- nvim-autopairs
require('nvim-autopairs').setup{}
-- you need setup cmp first put this after cmp.setup()
require("nvim-autopairs.completion.cmp").setup({
map_cr = true, -- map <CR> on insert mode
map_complete = true, -- it will auto insert `(` after select function or method item
auto_select = true -- automatically select the first item
})
--nvim-ts-autotag
require'nvim-treesitter.configs'.setup {
autotag = {
enable = true,
}
}

View File

@ -166,3 +166,13 @@ Cloudways
anime
Yoast
WordPress's
eigenbase
eigenbasis
Maclaurin
Multivariable
erimplement
particularly
movie
multivariable
Unsetting
ajax

Binary file not shown.

View File

@ -1,179 +0,0 @@
" Vim syntax file
" Language: cst
" Maintainer: Thomas R. Kimpton <tkimpton@gooberdude.com>
" URL: http://www.gooberdude.com/~tkimpton/vim/syntax/cst.vim
" Last Change: 5/14/2003
" Remark: Used to test color schemes: edit your color scheme file, and
" to see what each color assignment does, set the color scheme to your color
" scheme then type the command ':setf cst'. As you continue to make changes
" save your changes, and switch to another color scheme and back to your own
" to see changes.
" Quit when a syntax file was already loaded
if !exists("main_syntax")
if version < 600
syntax clear
elseif exists("b:current_syntax")
finish
endif
" we define it here so that included files can test for it
let main_syntax='cst'
endif
" don't use standard HiLink, it will not work with included syntax files
if version < 508
command! -nargs=+ CSTHiLink hi link <args>
else
command! -nargs=+ CSTHiLink hi def link <args>
endif
syntax case ignore
" match definitions
syn match CSTSpecialKey /\<SpecialKey\>/
syn match CSTNonText /\<NonText\>/
syn match CSTDirectory /\<Directory\>/
syn match CSTErrorMsg /\<ErrorMsg\>/
syn match CSTIncSearch /\<IncSearch\>/
syn match CSTSearch /\<Search\>/
syn match CSTMoreMsg /\<MoreMsg\>/
syn match CSTModeMsg /\<ModeMsg\>/
syn match CSTLineNr /\<LineNr\>/
syn match CSTQuestion /\<Question\>/
syn match CSTStatusLineNC /\<StatusLineNC\>/
syn match CSTStatusLine /\<StatusLine\>/
syn match CSTVertSplit /\<VertSplit\>/
syn match CSTTitle /\<Title\>/
syn match CSTVisualNOS /\<VisualNOS\>/
syn match CSTVisual /\<Visual\>/
syn match CSTWarningMsg /\<WarningMsg\>/
syn match CSTWildMenu /\<WildMenu\>/
syn match CSTFolded /\<Folded\>/
syn match CSTFoldColumn /\<FoldColumn\>/
syn match CSTSignColumn /\<SignColumn\>/
syn match CSTDiffAdd /\<DiffAdd\>/
syn match CSTDiffChange /\<DiffChange\>/
syn match CSTDiffDelete /\<DiffDelete\>/
syn match CSTDiffText /\<DiffText\>/
syn match CSTCursor /\<Cursor\>/
syn match CSTComment /\<Comment\>/
syn match CSTConstant /\<Constant\>/
syn match CSTString /\<String\>/
syn match CSTCharacter /\<Character\>/
syn match CSTNumber /\<Number\>/
syn match CSTBoolean /\<Boolean\>/
syn match CSTFloat /\<Float\>/
syn match CSTIdentifier /\<Identifier\>/
syn match CSTFunction /\<Function\>/
syn match CSTStatement /\<Statement\>/
syn match CSTConditional /\<Conditional\>/
syn match CSTRepeat /\<Repeat\>/
syn match CSTLabel /\<Label\>/
syn match CSTOperator /\<Operator\>/
syn match CSTKeyword /\<Keyword\>/
syn match CSTException /\<Exception\>/
syn match CSTPreProc /\<PreProc\>/
syn match CSTInclude /\<Include\>/
syn match CSTDefine /\<Define\>/
syn match CSTMacro /\<Macro\>/
syn match CSTPreCondit /\<PreCondit\>/
syn match CSTType /\<Type\>/
syn match CSTStorageClass /\<StorageClass\>/
syn match CSTStructure /\<Structure\>/
syn match CSTTypeDef /\<TypeDef\>/
syn match CSTSpecial /\<Special\>/
syn match CSTSpecialChar /\<SpecialChar\>/
syn match CSTTag /\<Tag\>/
syn match CSTDelimiter /\<Delimiter\>/
syn match CSTSpecialComment /\<SpecialComment\>/
syn match CSTDebug /\<Debug\>/
syn match CSTUnderlined /\<Underlined\>/
syn match CSTIgnore /\<Ignore\>/
syn match CSTError /\<Error\>/
syn match CSTSpellBad /\<SpellBad\>/
syn match CSTSpellCap /\<SpellCap\>/
syn match CSTSpellLocal /\<SpellLocal\>/
syn match CSTSpellRare /\<SpellRare\>/
syn match CSTTodo /\<Todo\>/
" The default highlighting.
if version >= 508 || !exists("did_CST_syn_inits")
if version < 508
let did_CST_syn_inits = 1
endif
CSTHiLink CSTSpecialKey SpecialKey
CSTHiLink CSTNonText NonText
CSTHiLink CSTDirectory Directory
CSTHiLink CSTErrorMsg ErrorMsg
CSTHiLink CSTIncSearch IncSearch
CSTHiLink CSTSearch Search
CSTHiLink CSTMoreMsg MoreMsg
CSTHiLink CSTModeMsg ModeMsg
CSTHiLink CSTLineNr LineNr
CSTHiLink CSTQuestion Question
CSTHiLink CSTStatusLineNC StatusLineNC
CSTHiLink CSTStatusLine StatusLine
CSTHiLink CSTVertSplit VertSplit
CSTHiLink CSTTitle Title
CSTHiLink CSTVisualNOS VisualNOS
CSTHiLink CSTVisual Visual
CSTHiLink CSTWarningMsg WarningMsg
CSTHiLink CSTWildMenu WildMenu
CSTHiLink CSTFolded Folded
CSTHiLink CSTFoldColumn FoldColumn
CSTHiLink CSTSignColumn SignColumn
CSTHiLink CSTDiffAdd DiffAdd
CSTHiLink CSTDiffChange DiffChange
CSTHiLink CSTDiffDelete DiffDelete
CSTHiLink CSTDiffText DiffText
CSTHiLink CSTCursor Cursor
CSTHiLink CSTComment Comment
CSTHiLink CSTConstant Constant
CSTHiLink CSTString String
CSTHiLink CSTCharacter Character
CSTHiLink CSTNumber Number
CSTHiLink CSTBoolean Boolean
CSTHiLink CSTFloat Float
CSTHiLink CSTIdentifier Identifier
CSTHiLink CSTFunction Function
CSTHiLink CSTStatement Statement
CSTHiLink CSTConditional Conditional
CSTHiLink CSTRepeat Repeat
CSTHiLink CSTLabel Label
CSTHiLink CSTOperator Operator
CSTHiLink CSTKeyword Keyword
CSTHiLink CSTException Exception
CSTHiLink CSTPreProc PreProc
CSTHiLink CSTInclude Include
CSTHiLink CSTDefine Define
CSTHiLink CSTMacro Macro
CSTHiLink CSTPreCondit PreCondit
CSTHiLink CSTType Type
CSTHiLink CSTStorageClass StorageClass
CSTHiLink CSTStructure Structure
CSTHiLink CSTTypedef Typedef
CSTHiLink CSTSpecial Special
CSTHiLink CSTSpecialChar SpecialChar
CSTHiLink CSTTag Tag
CSTHiLink CSTDelimiter Delimiter
CSTHiLink CSTSpecialComment SpecialComment
CSTHiLink CSTDebug Debug
CSTHiLink CSTUnderlined Underlined
CSTHiLink CSTIgnore Ignore
CSTHiLink CSTError Error
CSTHiLink CSTSpellBad SpellBad
CSTHiLink CSTSpellCap SpellCap
CSTHiLink CSTSpellLocal SpellLocal
CSTHiLink CSTSpellRare SpellRare
CSTHiLink CSTTodo Todo
endif
delcommand CSTHiLink
let b:current_syntax = "cst"
if main_syntax == 'cst'
unlet main_syntax
endif
" vim: set filetype=cst:

View File

@ -1,18 +0,0 @@
if exists("b:current_syntax")
finish
endif
" changing order of following 4 lines breaks highlighting TODO - why?
syntax include @octoberPHP syntax/php.vim
unlet! b:current_syntax
syntax include @octoberConfig syntax/dosini.vim
runtime! syntax/jinja.vim
syntax region octoberConfig start=@\%^\([a-zA-z]\+[a-zA-Z0-9]\+\s*=\s*\("\|'\)\)\|\[\s*[a-zA-Z0-9]\+\s*\]@ end=+^==$+me=e-2 contains=@octoberConfig
syntax region octoberPHP start=+^==$+ms=s+2 end=+^==$+me=e-2 contains=@octoberPHP
" FIXME - why these no work!
" syntax match octobercmsSectionDelimiter "^==$"
" highlight link octobercmsSectionDelimiter Comment
let b:current_syntax = "octobercms"