diff --git a/UltiSnips/css.snippets b/UltiSnips/css.snippets index 5eb7046..8645782 100644 --- a/UltiSnips/css.snippets +++ b/UltiSnips/css.snippets @@ -1,23 +1,4 @@ -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 ... */" +snippet sld "/* stylelint-disable-next-line ... */" /* stylelint-disable-next-line ${1:declaration-block-no-shorthand-property-overrides} */ endsnippet @@ -48,7 +29,7 @@ linear-gradient( endsnippet snippet bglg "background: linear-gradient ..." -background-image: linear-gradient( +background: linear-gradient( ${2:to bottom}, ${3:transparent}, ${4:transparent} diff --git a/UltiSnips/php.snippets b/UltiSnips/php.snippets index c54e5dd..a32a09b 100644 --- a/UltiSnips/php.snippets +++ b/UltiSnips/php.snippets @@ -1,15 +1,3 @@ -snippet pp "" - -endsnippet - -snippet pe "" - -endsnippet - -snippet ph "" - -endsnippet - snippet pf "public function ..." public function $1($2) { $0 diff --git a/after/ftplugin/html.vim b/after/ftplugin/html.vim index a06a63b..b7086e9 100644 --- a/after/ftplugin/html.vim +++ b/after/ftplugin/html.vim @@ -1 +1 @@ -setlocal foldnestmax=5 +set foldnestmax=5 diff --git a/after/ftplugin/javascript.vim b/after/ftplugin/javascript.vim index 101be7c..7c7f9dc 100644 --- a/after/ftplugin/javascript.vim +++ b/after/ftplugin/javascript.vim @@ -1,3 +1,6 @@ +" NOTE also see ../ftplugin/javascript.vim +set shiftwidth=2 + " https://gist.github.com/romainl/1f50c55b0ee92e5420de51e6c4b38491 nnoremap cF :call CocAction('runCommand', 'eslint.executeAutofix') diff --git a/after/ftplugin/php.vim b/after/ftplugin/php.vim deleted file mode 100644 index 9787fb3..0000000 --- a/after/ftplugin/php.vim +++ /dev/null @@ -1,2 +0,0 @@ -setlocal iskeyword+=$ -setlocal autoindent diff --git a/after/ftplugin/python.vim b/after/ftplugin/python.vim index de126ac..07cea3a 100644 --- a/after/ftplugin/python.vim +++ b/after/ftplugin/python.vim @@ -1,11 +1,19 @@ -setlocal tabstop=4 +set tabstop=4 +set softtabstop=0 +set shiftwidth=4 +set noexpandtab -setlocal textwidth=88 +" set softtabstop=8 +" set tabstop=4 +" set shiftwidth=4 -setlocal foldmethod=indent -setlocal foldnestmax=1 +set textwidth=88 -setlocal colorcolumn=88 +set foldmethod=indent +set foldnestmax=1 + +set colorcolumn=88 noremap :w:silent !clear;python % :redraw! nnoremap :call SaveAndExecute('python') +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)))") diff --git a/after/ftplugin/sass.vim b/after/ftplugin/sass.vim index d19ac0e..79981e1 100644 --- a/after/ftplugin/sass.vim +++ b/after/ftplugin/sass.vim @@ -1 +1,2 @@ -setlocal includeexpr=substitute(substitute(substitute(v:fname,'\%(.*/\|^\)\zs','_',''),'^[\\~@]\/','./',''),'^[\\~@]','./node_modules/','') + +set includeexpr=substitute(substitute(substitute(v:fname,'\%(.*/\|^\)\zs','_',''),'^[\\~@]\/','./',''),'^[\\~@]','./node_modules/','') diff --git a/after/ftplugin/vim.vim b/after/ftplugin/vim.vim index 57b1e2e..03361bb 100644 --- a/after/ftplugin/vim.vim +++ b/after/ftplugin/vim.vim @@ -1,2 +1,2 @@ -setlocal foldmethod=marker + set foldmethod=marker diff --git a/after/indent/php.vim b/after/indent/php.vim deleted file mode 100644 index 2d98542..0000000 --- a/after/indent/php.vim +++ /dev/null @@ -1,4 +0,0 @@ -" https://github.com/nvim-treesitter/nvim-treesitter/issues/462#issuecomment-700278736 -setlocal indentexpr = -setlocal autoindent -setlocal smartindent diff --git a/after/queries/css/highlights.scm b/after/queries/css/highlights.scm deleted file mode 100644 index 7fa2000..0000000 --- a/after/queries/css/highlights.scm +++ /dev/null @@ -1,18 +0,0 @@ -(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) diff --git a/after/queries/ecma/highlights.scm b/after/queries/ecma/highlights.scm deleted file mode 100644 index e69de29..0000000 diff --git a/after/queries/html/highlights.scm b/after/queries/html/highlights.scm deleted file mode 100644 index 2b752d4..0000000 --- a/after/queries/html/highlights.scm +++ /dev/null @@ -1,17 +0,0 @@ -(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 ))) diff --git a/after/syntax/gitcommit.vim b/after/syntax/gitcommit.vim new file mode 100644 index 0000000..11db794 --- /dev/null +++ b/after/syntax/gitcommit.vim @@ -0,0 +1,3 @@ +syn match gitCommitNumber "\<\d\+\>" containedin=gitCommitComment +syn keyword gitCommitAhead ahead containedin=gitCommitOnBranch +syn keyword gitCommitBehind behind containedin=gitCommitOnBranch diff --git a/after/syntax/html.vim b/after/syntax/html.vim new file mode 100644 index 0000000..eb0b8bf --- /dev/null +++ b/after/syntax/html.vim @@ -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=+\\)" containedin=htmlTag,vueTag,htmlTagN +syn region vueLink start="[^>]*" end=""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 "\\|\\|\" containedin=htmlTag,vueTag,htmlTagN +syn match vueTransitionComponent contained "\" 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 diff --git a/coc-settings.json b/coc-settings.json new file mode 100644 index 0000000..b60e06b --- /dev/null +++ b/coc-settings.json @@ -0,0 +1,40 @@ +{ + "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" + ] +} diff --git a/colors/paper-custom.erb b/colors/paper-custom.erb index 6070c22..8b62d23 100644 --- a/colors/paper-custom.erb +++ b/colors/paper-custom.erb @@ -22,6 +22,18 @@ 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"] @@ -61,7 +73,7 @@ ui_fg_error = ["#d70000", 196, "red"] ui_fg_warning = ["#d75f00", 166, "yellow"] - ui_fg_question = ["#d7a100", 247, "darkgray"] + ui_fg_question = ["#56acd7", 247, "darkgray"] # Step 3: highlights highlights = [ diff --git a/colors/paper-custom.vim b/colors/paper-custom.vim index 29aed03..672bddc 100644 --- a/colors/paper-custom.vim +++ b/colors/paper-custom.vim @@ -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=#d7a100 gui=italic + hi Question ctermbg=NONE ctermfg=247 cterm=italic guibg=NONE guifg=#56acd7 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,14 +297,19 @@ if ($TERM =~ '256' || &t_Co >= 256) || has("gui_running") hi link jsonValue String hi link jsonQuote Noise hi link octobercmsSectionDelimiter Noise - hi link LspDiagnosticsDefaultError ErrorMsg - hi link LspDiagnosticsDefaultWarning WarningMsg - hi link LspDiagnosticsDefaultInformation Question - hi link LspDiagnosticsDefaultHint Question + 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 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 diff --git a/ftplugin/css.vim b/ftplugin/css.vim index df4fe48..ea5af32 100644 --- a/ftplugin/css.vim +++ b/ftplugin/css.vim @@ -1 +1 @@ -setlocal iskeyword+=- +set iskeyword+=- diff --git a/ftplugin/html.vim b/ftplugin/html.vim index e69de29..b32befc 100644 --- a/ftplugin/html.vim +++ b/ftplugin/html.vim @@ -0,0 +1,2 @@ +set tabstop=2 +set shiftwidth=2 diff --git a/ftplugin/javascript.vim b/ftplugin/javascript.vim index 9c0321c..8d449ca 100644 --- a/ftplugin/javascript.vim +++ b/ftplugin/javascript.vim @@ -1,2 +1,7 @@ -setlocal iskeyword+=$ -setlocal foldmethod=syntax +" also see after/ftplugin/javascript.vim + +set iskeyword+=$ + +set tabstop=2 +set shiftwidth=2 +set foldmethod=syntax diff --git a/ftplugin/php.vim b/ftplugin/php.vim new file mode 100644 index 0000000..88b6ebc --- /dev/null +++ b/ftplugin/php.vim @@ -0,0 +1 @@ +set iskeyword+=$ diff --git a/ftplugin/sass.vim b/ftplugin/sass.vim index fc6035c..88b6ebc 100644 --- a/ftplugin/sass.vim +++ b/ftplugin/sass.vim @@ -1 +1 @@ -setlocal iskeyword+=$ +set iskeyword+=$ diff --git a/ftplugin/vue.vim b/ftplugin/vue.vim index 5325c8c..e34f6bb 100644 --- a/ftplugin/vue.vim +++ b/ftplugin/vue.vim @@ -1,4 +1,4 @@ -setlocal includeexpr=substitute(substitute(v:fname,'^[\\~@]\/','./',''),'^[\\~@]','./node_modules/','') +set includeexpr=substitute(substitute(v:fname,'^[\\~@]\/','./',''),'^[\\~@]','./node_modules/','') setlocal suffixesadd=.js,.vue,.scss setlocal complete=.,w,b,u,i diff --git a/init.commands.vim b/init.commands.vim deleted file mode 100644 index 418e83d..0000000 --- a/init.commands.vim +++ /dev/null @@ -1,27 +0,0 @@ -" 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 ,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 -"}}} -" -" diff --git a/init.plugins.vim b/init.plugins.vim index a5516b8..385e8a3 100644 --- a/init.plugins.vim +++ b/init.plugins.vim @@ -5,85 +5,50 @@ 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 - " - 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 cc :ColorToggle "}}} -" #nvim-autopairs {{{ -" https://github.com/windwp/nvim-autopairs -" automatic quote, paranthesis,etc closing. - Plug 'windwp/nvim-autopairs' + +" #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 = '' + let g:coc_snippet_prev = '' + + " inoremap coc#refresh() + nnoremap :call CocAction('doHover') + nnoremap cf :call CocAction('doQuickfix') + nnoremap cg :call CocAction('jumpDefinition') + nnoremap ci :call CocAction('jumpImplementation') + nnoremap cr :call CocAction('jumpReferences') + nnoremap cm :call CocAction('rename') + nnoremap ca :call CocAction('codeAction') + nnoremap cs :call CocAction('documentSymbols') + nnoremap cS :call CocAction('workspaceSymbols') + nnoremap ]c :call CocAction('diagnosticNext') + nnoremap [c :call CocAction('diagnosticPrevious') + command! -nargs=0 Format :call CocAction('format') + command! -nargs=? Fold :call CocAction('fold', ) + +" }}} +" #delimitMate{{{ +" https://github.com/Raimondi/delimitMate + Plug 'Raimondi/delimitMate' + let delimitMate_expand_cr = 1 + let delimitMate_expand_space = 1 "}}} - - -" #nvim-autopairs {{{ -" https://github.com/windwp/nvim-ts-autotag -" automatic html tag closing/renaming. -Plug 'windwp/nvim-ts-autotag', { 'branch': 'main' } - - +" #echodoc.vim{{{ +" https://github.com/Shougo/echodoc.vim + Plug 'Shougo/echodoc.vim' "}}} " #emmet-vim {{{ " https://github.com/mattn/emmet-vim @@ -96,7 +61,6 @@ Plug 'windwp/nvim-ts-autotag', { 'branch': 'main' } "}}} " #gitgutter {{{ " https://github.com/airblade/vim-gitgutter/blob/master/README.mkd - " show git diff in sign column Plug 'airblade/vim-gitgutter' nmap ]h (GitGutterNextHunk) @@ -108,7 +72,6 @@ Plug 'windwp/nvim-ts-autotag', { 'branch': 'main' } "}}} " #MatchTagAlways{{{ -" always highlights xml/html tags enclosing cursor " https://github.com/Valloric/MatchTagAlways Plug 'Valloric/MatchTagAlways' let g:mta_filetypes = { @@ -119,12 +82,26 @@ 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 9 :RainbowToggle + nnoremap ( :RainbowToggle + "}}} " #switch {{{ "https://github.com/AndrewRadev/switch.vim Plug 'AndrewRadev/switch.vim' @@ -141,6 +118,52 @@ let g:mta_filetypes = { \ ['private', 'public', 'protected'] \ ] + "}}} +" #tagbar {{{ + " Plug 'majutsushi/tagbar' + " + " nnoremap tb :TagbarOpen fj + " nnoremap ] :tag /[.#@]=expand('') + " 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 @@ -197,6 +220,72 @@ 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 (EasyAlign) + nmap ga (EasyAlign) + + "}}} + " #vim-floaterm{{{ +" https://github.com/voldikss/floaterm + Plug 'voldikss/vim-floaterm' + let g:floaterm_opener = 'edit' + nnoremap lf :FloatermNew --height=0.9 --width=0.9 lf + nnoremap lg :FloatermNew --height=0.9 --width=0.9 lazygit + "}}} +" #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 @@ -213,34 +302,17 @@ let g:mta_filetypes = { " fork of tpope/vim-obsession Plug 'studio-vx/vim-obsession' + "}}} +" #undotree {{{ + Plug 'mbbill/undotree' + nnoremap ut :UndotreeToggle + "}}} " #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' @@ -249,6 +321,7 @@ Plug 'junegunn/fzf.vim' nnoremap fg :GFiles nnoremap ff :Files nnoremap fh :History +nnoremap ft :Tags nnoremap fb :Buffers nnoremap fH :Helptags @@ -261,7 +334,7 @@ let g:fzf_colors = \ 'bg+': ['bg', 'CursorLine', 'CursorColumn'], \ 'hl+': ['fg', 'WildMenu'], \ 'info': ['fg', 'Comment'], - \ 'border': ['fg', 'Comment'], + \ 'border': ['fg', 'Ignore'], \ 'prompt': ['fg', 'Constant'], \ 'pointer': ['fg', 'Special'], \ 'marker': ['fg', 'Keyword'], @@ -269,53 +342,46 @@ let g:fzf_colors = \ 'header': ['fg', 'Comment'] } "}}} -" #vim-shellcheck{{{ -" https://github.com/itspriddle/vim-shellcheck - Plug 'itspriddle/vim-shellcheck' +" #polyglot{{{ + " https://github.com/sheerun/vim-polyglot + Plug 'sheerun/vim-polyglot' - "}}} + " 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 Plug 'plasticboy/vim-markdown' let g:vim_markdown_toc_autofit = 1 let g:vim_markdown_fenced_languages = ['bash=sh'] "}}} -" #undotree {{{ - Plug 'mbbill/undotree' - nnoremap ut :UndotreeToggle +" #vim-repeat{{{ + " https://github.com/tpope/vim-repeat + Plug 'tpope/vim-repeat' "}}} - -" do i still need, can i replace? -" #vim-dispatch{{{ - " https://github.com/tpope/vim-dispatch - Plug 'tpope/vim-dispatch' +" #vim-rsi{{{ + "https://github.com/tpope/vim-rsi + Plug 'tpope/vim-rsi' "}}} -" #vim-floaterm{{{ -" https://github.com/voldikss/floaterm -" allows to open floating terminal - Plug 'voldikss/vim-floaterm' - let g:floaterm_opener = 'edit' - nnoremap lf :FloatermNew --height=0.9 --width=0.9 lf - nnoremap lg :FloatermNew --height=0.9 --width=0.9 lazygit - "}}} -" #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-surround{{{ + Plug 'tpope/vim-surround' "}}} +" #wakatime{{{ + " https://wakatime.com/vim + Plug 'wakatime/vim-wakatime' -" ------------------------------------------------------------------------------ + "}}} call plug#end() runtime macros/matchit.vim -" require lua init module -lua <SynStack()"{{{ endif echo map(synstack(line('.'), col('.')), 'synIDattr(v:val,"name")') '-> ' . synIDattr(synIDtrans(synID(line('.'),col('.'),1)), 'name' ) endfunc -" nmap pp :call SynStack() -nmap pp :TSHighlightCapturesUnderCursor +nmap pp :call SynStack() "}}} function! s:RunShellCommand(cmdline) abort"{{{ " Shell command @@ -181,6 +177,17 @@ function! ToggleHighlights() abort "{{{ endfunction "}}} "----------------------------------------------------------------------------}}} +"#commands{{{ +" TrimWhitespace{{{ +command! -range=% TrimWhitespace let b:wv = winsaveview() | + \ keeppattern ,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 @@ -205,7 +212,7 @@ if exists('+termguicolors') set termguicolors endif -colorscheme paper-tonic +colorscheme paper-custom set updatetime=100 set timeoutlen=500 @@ -245,7 +252,7 @@ set hidden set hlsearch -set completeopt=menuone,noselect +set completeopt=menuone set nospell set spelllang=en_gb @@ -254,15 +261,12 @@ set diffopt+=vertical set rnu nu -set tabstop=2 +set tabstop=4 set softtabstop=-1 -set shiftwidth=0 +set shiftwidth=4 set shiftround set noexpandtab - set autoindent -set breakindent -set showbreak=\ \ ↳\ set formatoptions=cq set wrapmargin=0 @@ -291,6 +295,10 @@ set foldlevelstart=99 set showmode +set autoindent +set breakindent +set showbreak=\ \ ↳\ + set mouse=a set listchars=eol:¬,tab:│\ ,trail:~,extends:>,precedes:<,space:· @@ -320,11 +328,23 @@ set conceallevel=0 "----------------------------------------------------------------------------}}} " #mappings {{{ let g:mapleader = ' ' +" image capable file browser +nnoremap rs :!VIMRUNTIME= st -t WM_FORCE_FULLSCREEN ranger +" search and replace {{{ +nnoremap rr :%s/\<=expand('')\>//g +"}}} +" #syntax +nnoremap s :syntax on +nnoremap S :syntax off " miscallaneous {{{ +nnoremap fc :set foldcolumn= nnoremap l :colorscheme paper-custom +nnoremap c :call ToggleHighlights() nnoremap d :colorscheme monotonous-dark nnoremap 0 ^ nnoremap cs :let @/="" +nnoremap : :setlocal number: +nnoremap rc :so $MYVIMRC nnoremap nh (&hls && v:hlsearch ? ':nohls' : ':set hls')."\n" " Focus on current fold, close the rest nnoremap zz zMzvzt @@ -333,6 +353,20 @@ tnoremap " open quickfix window of TODOs nnoremap td :grep -RE '(TODO\\|FIXME)' .:botright cwindow:echo len(getqflist()) 'TODOs' " sync highlighting from start +nnoremap ss :syntax sync fromstart + +"}}} +" git mappings {{{ +nnoremap ga :!clear; git add %; git status +nnoremap gg :!clear; git add %; git commit -m '' +nnoremap gs :!VIMRUNTIME= st -t WM_FORCE_FLOATING -g 230x62 tig status + +"}}} +" movement/navigation{{{ +" alias for :tjump +nnoremap tj g +" alias for :ptjump +nnoremap tp g} "}}} " location list and quickfix mappings {{{ @@ -354,18 +388,50 @@ nnoremap qn :cnewer "}}} " insert mode mappings {{{ +inoremap jj; A; +inoremap jj, A, inoremap jjrg :reg +inoremap :w :w +inoremap [:w :w +inoremap {:w :w +nnoremap ''; ''; +"}}} +" working_with_underscores{{{ +nnoremap w f_l +nnoremap b hT_ +nnoremap 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 {{{ diff --git a/lua/init-plugins.lua b/lua/init-plugins.lua deleted file mode 100644 index 904b622..0000000 --- a/lua/init-plugins.lua +++ /dev/null @@ -1,198 +0,0 @@ -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 :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 - 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', 'lua vim.lsp.buf.declaration()', opts) - buf_set_keymap('n', 'gd', 'lua vim.lsp.buf.definition()', opts) - buf_set_keymap('n', 'K', 'lua vim.lsp.buf.hover()', opts) - buf_set_keymap('n', 'gi', 'lua vim.lsp.buf.implementation()', opts) - buf_set_keymap('n', '', 'lua vim.lsp.buf.signature_help()', opts) - buf_set_keymap('n', '[d', 'lua vim.lsp.diagnostic.goto_prev()', opts) - buf_set_keymap('n', ']d', 'lua vim.lsp.diagnostic.goto_next()', opts) - buf_set_keymap('n', 'gr', 'lua vim.lsp.buf.references()', opts) - buf_set_keymap('n', 'l', 'lua vim.lsp.diagnostic.set_loclist()', opts) - buf_set_keymap('n', 'ca', 'lua vim.lsp.buf.code_action()', opts) - buf_set_keymap('n', 'rn', 'lua vim.lsp.buf.rename()', opts) - buf_set_keymap('n', 'e', 'lua vim.lsp.diagnostic.show_line_diagnostics()', opts) - buf_set_keymap('n', 'D', 'lua vim.lsp.buf.type_definition()', opts) - buf_set_keymap('n', 'f', 'lua vim.lsp.buf.formatting()', opts) - -- buf_set_keymap('n', 'wa', 'lua vim.lsp.buf.add_workspace_folder()', opts) - -- buf_set_keymap('n', 'wr', 'lua vim.lsp.buf.remove_workspace_folder()', opts) - -- buf_set_keymap('n', 'wl', 'lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))', 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 = { - [''] = cmp.mapping.complete(), - [''] = cmp.mapping.confirm({ select = true }), - [''] = 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 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, - } -} diff --git a/spell/en.utf-8.add b/spell/en.utf-8.add index d309946..a95fb27 100644 --- a/spell/en.utf-8.add +++ b/spell/en.utf-8.add @@ -166,13 +166,3 @@ Cloudways anime Yoast WordPress's -eigenbase -eigenbasis -Maclaurin -Multivariable -erimplement -particularly -movie -multivariable -Unsetting -ajax diff --git a/spell/en.utf-8.add.spl b/spell/en.utf-8.add.spl index 9eee6c1..ea636fb 100644 Binary files a/spell/en.utf-8.add.spl and b/spell/en.utf-8.add.spl differ diff --git a/syntax/cst.vim b/syntax/cst.vim new file mode 100644 index 0000000..eb1efbe --- /dev/null +++ b/syntax/cst.vim @@ -0,0 +1,179 @@ +" Vim syntax file +" Language: cst +" Maintainer: Thomas R. Kimpton +" 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 +else + command! -nargs=+ CSTHiLink hi def link +endif + +syntax case ignore + +" match definitions +syn match CSTSpecialKey /\/ +syn match CSTNonText /\/ +syn match CSTDirectory /\/ +syn match CSTErrorMsg /\/ +syn match CSTIncSearch /\/ +syn match CSTSearch /\/ +syn match CSTMoreMsg /\/ +syn match CSTModeMsg /\/ +syn match CSTLineNr /\/ +syn match CSTQuestion /\/ +syn match CSTStatusLineNC /\/ +syn match CSTStatusLine /\/ +syn match CSTVertSplit /\/ +syn match CSTTitle /\/ +syn match CSTVisualNOS /\/ +syn match CSTVisual /\/ +syn match CSTWarningMsg /\/ +syn match CSTWildMenu /\/ +syn match CSTFolded /\/ +syn match CSTFoldColumn /\/ +syn match CSTSignColumn /\/ +syn match CSTDiffAdd /\/ +syn match CSTDiffChange /\/ +syn match CSTDiffDelete /\/ +syn match CSTDiffText /\/ +syn match CSTCursor /\/ +syn match CSTComment /\/ +syn match CSTConstant /\/ +syn match CSTString /\/ +syn match CSTCharacter /\/ +syn match CSTNumber /\/ +syn match CSTBoolean /\/ +syn match CSTFloat /\/ +syn match CSTIdentifier /\/ +syn match CSTFunction /\/ +syn match CSTStatement /\/ +syn match CSTConditional /\/ +syn match CSTRepeat /\/ +syn match CSTLabel /\/ +syn match CSTOperator /\/ +syn match CSTKeyword /\/ +syn match CSTException /\/ +syn match CSTPreProc /\/ +syn match CSTInclude /\/ +syn match CSTDefine /\/ +syn match CSTMacro /\/ +syn match CSTPreCondit /\/ +syn match CSTType /\/ +syn match CSTStorageClass /\/ +syn match CSTStructure /\/ +syn match CSTTypeDef /\/ +syn match CSTSpecial /\/ +syn match CSTSpecialChar /\/ +syn match CSTTag /\/ +syn match CSTDelimiter /\/ +syn match CSTSpecialComment /\/ +syn match CSTDebug /\/ +syn match CSTUnderlined /\/ +syn match CSTIgnore /\/ +syn match CSTError /\/ +syn match CSTSpellBad /\/ +syn match CSTSpellCap /\/ +syn match CSTSpellLocal /\/ +syn match CSTSpellRare /\/ +syn match CSTTodo /\/ + +" 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: diff --git a/syntax/octobercms.vim b/syntax/octobercms.vim new file mode 100644 index 0000000..a2f1706 --- /dev/null +++ b/syntax/octobercms.vim @@ -0,0 +1,18 @@ +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"