From 07797b39851da045aa1bfd0289de0858a1377c48 Mon Sep 17 00:00:00 2001 From: Max Christian Pohle Date: Sun, 18 Dec 2022 20:29:55 +0100 Subject: Switched to nvim and neovide --- .gitmodules | 115 ++++----- CursorHold-example.vim | 37 --- GetLatest/GetLatestVimScripts.dat | 10 - UPDATING | 3 - after/ftdetect/log.vim | 1 + after/ftplugin/javascript.vim | 1 + after/indent/html5.vim | 387 ++++++++++++++++++++++++++++++ after/indent/php.vim | 37 +++ after/syntax/log.vim | 24 ++ after/syntax/markdown.vim | 19 ++ colors/coderonline.vim | 181 -------------- colors/mac_classic.vim | 1 - doc/INSTALL | 46 ---- doc/UPDATE | 4 - doc/gitignore | 50 ---- experimental/list-commands.vim | 6 - experimental/vimrc-minimal | 16 -- experimental/vimrc-minimal-statusline | 30 --- experimental/vimrc-old | 303 ----------------------- ftplugin/c.vim | 18 -- ftplugin/coffee.vim | 1 - ftplugin/doxygen.vim | 3 - ftplugin/help.vim | 3 - ftplugin/java.vim | 2 - ftplugin/nerdtree.vim | 1 - ftplugin/python.vim | 1 - ftplugin/text.vim | 21 -- gvimrc | 30 --- indent/.keep | 1 - indent/html5.vim | 387 ------------------------------ indent/php.vim | 37 --- init.lua | 176 ++++++++++++++ init.vim | 80 ------ install.sh | 23 -- pack/.empty | 1 - pack/_all/opt/.empty | 1 - pack/_all/opt/ale | 1 - pack/_all/opt/nerdtree | 1 - pack/_all/opt/tagbar | 1 - pack/_all/opt/vim-signify | 1 - pack/_all/opt/zeavim.vim | 1 - pack/_all/start/.empty | 1 - pack/_all/start/base16-vim | 1 - pack/_all/start/deoplete-clang | 1 - pack/_all/start/deoplete-jedi | 1 - pack/_all/start/deoplete.nvim | 1 - pack/_all/start/echodoc | 1 - pack/_all/start/jedi-vim | 1 - pack/_all/start/papercolor-theme | 1 - pack/_all/start/tabular | 1 - pack/_all/start/vim-fugitive | 1 - pack/_all/start/vim-mediawiki-editor | 1 - pack/_all/start/vim-operator-user | 1 - pack/_all/start/vim-remote-menu | 1 - pack/_all/start/vim-surround | 1 - pack/all/start/vim-colorscheme-papercolor | 1 + pack/all/start/vim-fancy-line | 1 + pack/all/start/vim-karlmarks | 1 + pack/all/start/vim-mercenary | 1 + pack/all/start/vim-recently-used | 1 + pack/coderonline/start/vim-karlmarks | 1 - pack/coderonline/start/vim-recently-used | 1 - pack/neovim/opt/.empty | 1 - pack/nvim/start/nvim-cmp | 1 + pack/nvim/start/nvim-cmp-nvim-lsp | 1 + pack/nvim/start/nvim-colorizer | 1 + pack/nvim/start/nvim-lspconfig | 1 + pack/nvim/start/nvim-vsnip | 1 + pack/vim/opt/.empty | 1 - pack/vim/opt/syntastic | 1 - pack/vim/opt/vim-youcompleteme | 1 + pack/vim/opt/vimtex | 1 - plugin/ale.vim | 8 - plugin/cscope.vim | 57 ----- plugin/fix-pumvisible-no-newline.vim | 1 - plugin/jedi.vim | 15 -- plugin/karlmarks.vim | 7 - plugin/max-change-icon.vim | 11 - plugin/max-fix-colorschemes.vim | 31 +-- plugin/max-function-menu.vim | 173 ------------- plugin/nerdtree.vim | 25 -- plugin/printing-hardcopy.vim | 10 - plugin/signify.vim | 35 --- plugin/snippets.vim | 3 - plugin/statusline.vim | 153 ------------ plugin/tagbar.vim | 10 - plugin/terminal.vim | 19 -- plugin/youcompleteme.vim | 10 +- spell/.keep | 1 - syntax/univention-template.vim | 31 --- temp/.keep | 3 - thesaurus/php.txt | 2 - update.sh | 2 - vimpagerrc | 10 - vimrc | 50 ++-- vimrc-common | 23 +- ycm_extra_conf.py | 21 -- ycm_extra_mini-conf.py | 138 ----------- 98 files changed, 757 insertions(+), 2185 deletions(-) delete mode 100644 CursorHold-example.vim delete mode 100644 GetLatest/GetLatestVimScripts.dat delete mode 100644 UPDATING create mode 100644 after/ftdetect/log.vim create mode 100644 after/ftplugin/javascript.vim create mode 100644 after/indent/html5.vim create mode 100644 after/indent/php.vim create mode 100644 after/syntax/log.vim create mode 100644 after/syntax/markdown.vim delete mode 100644 colors/coderonline.vim delete mode 120000 colors/mac_classic.vim delete mode 100644 doc/INSTALL delete mode 100644 doc/UPDATE delete mode 100644 doc/gitignore delete mode 100644 experimental/list-commands.vim delete mode 100644 experimental/vimrc-minimal delete mode 100644 experimental/vimrc-minimal-statusline delete mode 100644 experimental/vimrc-old delete mode 100644 ftplugin/c.vim delete mode 100644 ftplugin/coffee.vim delete mode 100644 ftplugin/doxygen.vim delete mode 100644 ftplugin/help.vim delete mode 100644 ftplugin/java.vim delete mode 100644 ftplugin/nerdtree.vim delete mode 100644 ftplugin/python.vim delete mode 100644 ftplugin/text.vim delete mode 100644 gvimrc delete mode 100644 indent/.keep delete mode 100644 indent/html5.vim delete mode 100644 indent/php.vim create mode 100644 init.lua delete mode 100644 init.vim delete mode 100755 install.sh delete mode 100644 pack/.empty delete mode 100644 pack/_all/opt/.empty delete mode 160000 pack/_all/opt/ale delete mode 160000 pack/_all/opt/nerdtree delete mode 160000 pack/_all/opt/tagbar delete mode 160000 pack/_all/opt/vim-signify delete mode 160000 pack/_all/opt/zeavim.vim delete mode 100644 pack/_all/start/.empty delete mode 160000 pack/_all/start/base16-vim delete mode 160000 pack/_all/start/deoplete-clang delete mode 160000 pack/_all/start/deoplete-jedi delete mode 160000 pack/_all/start/deoplete.nvim delete mode 160000 pack/_all/start/echodoc delete mode 160000 pack/_all/start/jedi-vim delete mode 160000 pack/_all/start/papercolor-theme delete mode 160000 pack/_all/start/tabular delete mode 160000 pack/_all/start/vim-fugitive delete mode 160000 pack/_all/start/vim-mediawiki-editor delete mode 160000 pack/_all/start/vim-operator-user delete mode 160000 pack/_all/start/vim-remote-menu delete mode 160000 pack/_all/start/vim-surround create mode 160000 pack/all/start/vim-colorscheme-papercolor create mode 160000 pack/all/start/vim-fancy-line create mode 160000 pack/all/start/vim-karlmarks create mode 160000 pack/all/start/vim-mercenary create mode 160000 pack/all/start/vim-recently-used delete mode 160000 pack/coderonline/start/vim-karlmarks delete mode 160000 pack/coderonline/start/vim-recently-used delete mode 100644 pack/neovim/opt/.empty create mode 160000 pack/nvim/start/nvim-cmp create mode 160000 pack/nvim/start/nvim-cmp-nvim-lsp create mode 160000 pack/nvim/start/nvim-colorizer create mode 160000 pack/nvim/start/nvim-lspconfig create mode 160000 pack/nvim/start/nvim-vsnip delete mode 100644 pack/vim/opt/.empty delete mode 160000 pack/vim/opt/syntastic create mode 160000 pack/vim/opt/vim-youcompleteme delete mode 160000 pack/vim/opt/vimtex delete mode 100644 plugin/ale.vim delete mode 100644 plugin/cscope.vim delete mode 100644 plugin/fix-pumvisible-no-newline.vim delete mode 100644 plugin/jedi.vim delete mode 100644 plugin/karlmarks.vim delete mode 100644 plugin/max-change-icon.vim delete mode 100644 plugin/max-function-menu.vim delete mode 100644 plugin/nerdtree.vim delete mode 100644 plugin/printing-hardcopy.vim delete mode 100644 plugin/signify.vim delete mode 100644 plugin/snippets.vim delete mode 100644 plugin/statusline.vim delete mode 100644 plugin/tagbar.vim delete mode 100644 plugin/terminal.vim delete mode 100644 spell/.keep delete mode 100644 syntax/univention-template.vim delete mode 100644 temp/.keep delete mode 100644 thesaurus/php.txt delete mode 100755 update.sh delete mode 100644 vimpagerrc delete mode 100644 ycm_extra_conf.py delete mode 100644 ycm_extra_mini-conf.py diff --git a/.gitmodules b/.gitmodules index 857c94c..00d4440 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,75 +1,48 @@ -[submodule "pack/_all/start/vim-remote-menu"] - path = pack/_all/start/vim-remote-menu - url = https://github.com/coderonline/vim-remote-menu.git -[submodule "pack/_all/start/base16-vim"] - path = pack/_all/start/base16-vim - url = https://github.com/chriskempson/base16-vim.git -[submodule "pack/_all/start/papercolor-theme"] - path = pack/_all/start/papercolor-theme +[submodule "pack/submodules/vim-recently-used"] + path = pack/submodules/start/vim-recently-used + url = https://git.entwicklerseite.de/vim-recently-used +[submodule "pack/submodules/vim-karlmarks"] + path = pack/submodules/start/vim-karlmarks + url = http://git.entwicklerseite.de/vim-karlmarks +[submodule "pack/submodules/vim-fancy-line"] + path = pack/submodules/start/vim-fancy-line + url = https://github.com/coderonline/vim-fancy-line +[submodule "pack/submodules/vim-mercenary"] + path = pack/submodules/start/vim-mercenary + url = https://github.com/jlfwong/vim-mercenary +[submodule "pack/submodules/start/vim-colorscheme-papercolor"] + path = pack/all/start/vim-colorscheme-papercolor url = https://github.com/NLKNguyen/papercolor-theme.git -[submodule "pack/_all/opt/vim-signify"] - path = pack/_all/opt/vim-signify - url = https://github.com/mhinz/vim-signify.git -[submodule "pack/_all/start/vim-fugitive"] - path = pack/_all/start/vim-fugitive - url = https://github.com/tpope/vim-fugitive.git -[submodule "pack/_all/start/tabular"] - path = pack/_all/start/tabular - url = https://github.com/godlygeek/tabular.git -[submodule "pack/_all/opt/tagbar"] - path = pack/_all/opt/tagbar - url = https://github.com/majutsushi/tagbar.git -[submodule "pack/_all/start/vim-surround"] - path = pack/_all/start/vim-surround - url = https://github.com/tpope/vim-surround.git -[submodule "pack/_all/opt/nerdtree"] - path = pack/_all/opt/nerdtree - url = https://github.com/scrooloose/nerdtree.git -[submodule "pack/_all/opt/vim-snippets"] - path = pack/_all/opt/vim-snippets - url = https://github.com/honza/vim-snippets.git -[submodule "pack/neovim/opt/echodoc.vim"] - path = pack/_all/start/echodoc - url = https://github.com/Shougo/echodoc.vim.git -[submodule "pack/neovim/opt/ale"] - path = pack/_all/opt/ale - url = https://github.com/dense-analysis/ale.git -[submodule "pack/vim/opt/syntastic"] - path = pack/vim/opt/syntastic - url = https://github.com/vim-syntastic/syntastic.git -[submodule "pack/_all/opt/jedi-vim"] - path = pack/_all/start/jedi-vim - url = https://github.com/davidhalter/jedi-vim.git -[submodule "pack/_all/start/vim-operator-user"] - path = pack/_all/start/vim-operator-user - url = https://github.com/kana/vim-operator-user.git -[submodule "pack/_all/opt/zeavim.vim"] - path = pack/_all/opt/zeavim.vim - url = https://github.com/KabbAmine/zeavim.vim -[submodule "pack/vim/opt/YouCompleteMe.git"] - path = pack/_all/opt/YouCompleteMe +[submodule "pack/submodules/start/vim-YouCompleteMe"] + path = pack/submodules/opt/vim-youcompleteme url = https://github.com/Valloric/YouCompleteMe.git -[submodule "pack/vim/opt/vimtex"] - path = pack/vim/opt/vimtex - url = https://github.com/lervag/vimtex -[submodule "pack/_all/start/vim-mediawiki-editor"] - path = pack/_all/start/vim-mediawiki-editor - url = https://github.com/aquach/vim-mediawiki-editor -[submodule "pack/coderonline/start/vim-recently-used"] - path = pack/coderonline/start/vim-recently-used +[submodule "pack/submodules/start/nvim-colorizer"] + path = pack/nvim/start/nvim-colorizer + url = https://github.com/norcalli/nvim-colorizer.lua +[submodule "pack/submodules/start/nvim-cmp"] + path = pack/nvim/start/nvim-cmp + url = https://github.com/hrsh7th/nvim-cmp +[submodule "pack/submodules/start/nvim-lspconfig"] + path = pack/nvim/start/nvim-lspconfig + url = https://github.com/neovim/nvim-lspconfig +[submodule "pack/submodules/start/nvim-cmp-nvim-lsp"] + path = pack/nvim/start/nvim-cmp-nvim-lsp + url = https://github.com/hrsh7th/cmp-nvim-lsp +[submodule "pack/submodules/start/nvim-vsnip"] + path = pack/nvim/start/nvim-vsnip + url = https://github.com/hrsh7th/vim-vsnip +[submodule "pack/submodules/start/vim-recently-used"] + path = pack/all/start/vim-recently-used url = https://git.entwicklerseite.de/vim-recently-used -[submodule "pack/_all/start/deoplete-jedi"] - path = pack/_all/start/deoplete-jedi - url = https://github.com/deoplete-plugins/deoplete-jedi -[submodule "pack/_all/start/deoplete-clang"] - path = pack/_all/start/deoplete-clang - url = https://github.com/deoplete-plugins/deoplete-clang -[submodule "pack/_all/start/deoplete.nvim"] - path = pack/_all/start/deoplete.nvim - url = https://github.com/Shougo/deoplete.nvim.git -[submodule "vim-karlmarks"] - path = vim-karlmarks - url = http://git.entwicklerseite.de/vim-karlmarks -[submodule "pack/coderonline/start/vim-karlmarks"] - path = pack/coderonline/start/vim-karlmarks +[submodule "pack/submodules/start/vim-karlmarks"] + path = pack/all/start/vim-karlmarks url = http://git.entwicklerseite.de/vim-karlmarks +[submodule "pack/submodules/start/vim-fancy-line"] + path = pack/all/start/vim-fancy-line + url = https://github.com/coderonline/vim-fancy-line +[submodule "pack/submodules/start/vim-mercenary"] + path = pack/all/start/vim-mercenary + url = https://github.com/jlfwong/vim-mercenary +[submodule "pack/submodules/opt/vim-youcompleteme"] + path = pack/vim/opt/vim-youcompleteme + url = https://github.com/Valloric/YouCompleteMe.git diff --git a/CursorHold-example.vim b/CursorHold-example.vim deleted file mode 100644 index ae55396..0000000 --- a/CursorHold-example.vim +++ /dev/null @@ -1,37 +0,0 @@ -au! CursorHold *.[ch] nested call PreviewWord() -func PreviewWord() - if &previewwindow " don't do this in the preview window - return - endif - let w = expand("") " get the word under cursor - if w =~ '\a' " if the word contains a letter - - " Delete any existing highlight before showing another tag - silent! wincmd P " jump to preview window - if &previewwindow " if we really get there... - match none " delete existing highlight - wincmd p " back to old window - endif - - " Try displaying a matching tag for the word under the cursor - try - exe "ptag " . w - catch - return - endtry - - silent! wincmd P " jump to preview window - if &previewwindow " if we really get there... - if has("folding") - silent! .foldopen " don't want a closed fold - endif - call search("$", "b") " to end of previous line - let w = substitute(w, '\\', '\\\\', "") - call search('\<\V' . w . '\>') " position cursor on match - " Add a match highlight to the word at this position - hi previewWord term=bold ctermbg=green guibg=green - exe 'match previewWord "\%' . line(".") . 'l\%' . col(".") . 'c\k*"' - wincmd p " back to old window - endif - endif -endfun diff --git a/GetLatest/GetLatestVimScripts.dat b/GetLatest/GetLatestVimScripts.dat deleted file mode 100644 index aff0816..0000000 --- a/GetLatest/GetLatestVimScripts.dat +++ /dev/null @@ -1,10 +0,0 @@ -ScriptID SourceID Filename --------------------------- -294 19633 :AutoInstall: Align.vim -120 9388 Decho.vim -40 21108 DrawIt.tar.gz -451 9231 EasyAccents.vim -195 6351 engspchk.vim -642 15781 GetLatestVimScripts.vim -489 16670 Manpageview.vim -1066 7618 :AutoInstall: cecutil.vim diff --git a/UPDATING b/UPDATING deleted file mode 100644 index 4359a5b..0000000 --- a/UPDATING +++ /dev/null @@ -1,3 +0,0 @@ - git submodule sync --recursive - git submodule update --remote - vim -c ':UpdateRemotePlugins' diff --git a/after/ftdetect/log.vim b/after/ftdetect/log.vim new file mode 100644 index 0000000..8203171 --- /dev/null +++ b/after/ftdetect/log.vim @@ -0,0 +1 @@ +autocmd BufReadPost *.log setfiletype log diff --git a/after/ftplugin/javascript.vim b/after/ftplugin/javascript.vim new file mode 100644 index 0000000..d4c9199 --- /dev/null +++ b/after/ftplugin/javascript.vim @@ -0,0 +1 @@ +set number diff --git a/after/indent/html5.vim b/after/indent/html5.vim new file mode 100644 index 0000000..94baa87 --- /dev/null +++ b/after/indent/html5.vim @@ -0,0 +1,387 @@ +" Description: HTML5 and inline SVG indenter +" Changed By: HT de Beer +" Last Change: 20121013 +" Added the SVG elements to the list of indenting element. SVG elements +" taken from http://www.w3.org/TR/SVG/eltindex.html +" +" Description: html5 (and html4) indenter +" Changed By: Brian Gershon +" Last Change: 30 Jan 2011 +" +" 1. Started with vim72 html indent file authored by Johannes Zellner (below) +" 2. Added html5 list as described here: +" http://stackoverflow.com/questions/3232518/how-to-update-vim-to-color-code-new-html-elements +" 3. Added this to a fork of https://github.com/othree/html5.vim +" which already provides nice html5 syntax highlighting. +" +" Description: html indenter +" Author: Johannes Zellner +" Last Change: Mo, 05 Jun 2006 22:32:41 CEST +" Restoring 'cpo' and 'ic' added by Bram 2006 May 5 +" Globals: +" let g:html_indent_tags = 'html\|p\|time' +" let g:html_exclude_tags = ['html', 'style', 'script', 'body'] + + +" Only load this indent file when no other was loaded. +if exists("b:did_indent") + finish +endif +runtime! indent/javascript.vim +let s:jsindent = &indentexpr +unlet b:did_indent +runtime! indent/css.vim +let s:cssindent = &indentexpr +let b:did_indent = 1 + +" [-- local settings (must come before aborting the script) --] +setlocal indentexpr=HtmlIndentGet(v:lnum) +setlocal indentkeys=o,O,*,<>>,{,},!^F + + +let s:tags = [] + +" [-- --] +call add(s:tags, 'a') +call add(s:tags, 'abbr') +call add(s:tags, 'acronym') +call add(s:tags, 'address') +call add(s:tags, 'b') +call add(s:tags, 'bdo') +call add(s:tags, 'big') +call add(s:tags, 'blockquote') +call add(s:tags, 'button') +call add(s:tags, 'caption') +call add(s:tags, 'center') +call add(s:tags, 'cite') +call add(s:tags, 'code') +call add(s:tags, 'colgroup') +call add(s:tags, 'del') +call add(s:tags, 'dfn') +call add(s:tags, 'dir') +call add(s:tags, 'div') +call add(s:tags, 'dl') +call add(s:tags, 'dt') +call add(s:tags, 'dd') +call add(s:tags, 'em') +call add(s:tags, 'fieldset') +call add(s:tags, 'font') +call add(s:tags, 'form') +call add(s:tags, 'frameset') +call add(s:tags, 'h1') +call add(s:tags, 'h2') +call add(s:tags, 'h3') +call add(s:tags, 'h4') +call add(s:tags, 'h5') +call add(s:tags, 'h6') +call add(s:tags, 'i') +call add(s:tags, 'iframe') +call add(s:tags, 'ins') +call add(s:tags, 'kbd') +call add(s:tags, 'label') +call add(s:tags, 'legend') +call add(s:tags, 'li') +call add(s:tags, 'map') +call add(s:tags, 'menu') +call add(s:tags, 'noframes') +call add(s:tags, 'noscript') +call add(s:tags, 'object') +call add(s:tags, 'ol') +call add(s:tags, 'optgroup') +call add(s:tags, 'p') +" call add(s:tags, 'pre') +call add(s:tags, 'q') +call add(s:tags, 's') +call add(s:tags, 'samp') +call add(s:tags, 'script') +call add(s:tags, 'select') +call add(s:tags, 'small') +call add(s:tags, 'span') +call add(s:tags, 'strong') +call add(s:tags, 'style') +call add(s:tags, 'sub') +call add(s:tags, 'sup') +call add(s:tags, 'table') +call add(s:tags, 'textarea') +call add(s:tags, 'title') +call add(s:tags, 'tt') +call add(s:tags, 'u') +call add(s:tags, 'ul') +call add(s:tags, 'var') + +" New HTML 5 elements +call add(s:tags, 'article') +call add(s:tags, 'aside') +call add(s:tags, 'audio') +call add(s:tags, 'canvas') +call add(s:tags, 'datalist') +call add(s:tags, 'details') +call add(s:tags, 'figcaption') +call add(s:tags, 'figure') +call add(s:tags, 'footer') +call add(s:tags, 'header') +call add(s:tags, 'hgroup') +call add(s:tags, 'main') +call add(s:tags, 'mark') +call add(s:tags, 'meter') +call add(s:tags, 'nav') +call add(s:tags, 'output') +call add(s:tags, 'progress') +call add(s:tags, 'picture') +call add(s:tags, 'rb') +call add(s:tags, 'rp') +call add(s:tags, 'rt') +call add(s:tags, 'rtc') +call add(s:tags, 'ruby') +call add(s:tags, 'section') +call add(s:tags, 'source') +call add(s:tags, 'summary') +call add(s:tags, 'time') +call add(s:tags, 'video') +call add(s:tags, 'bdi') +call add(s:tags, 'data') + +" Web Component +call add(s:tags, 'template') + +" Common inline used SVG elements +call add(s:tags, 'clipPath') +call add(s:tags, 'defs') +call add(s:tags, 'desc') +call add(s:tags, 'filter') +call add(s:tags, 'foreignObject') +call add(s:tags, 'g') +call add(s:tags, 'linearGradient') +call add(s:tags, 'marker') +call add(s:tags, 'mask') +call add(s:tags, 'pattern') +call add(s:tags, 'radialGradient') +call add(s:tags, 'svg') +call add(s:tags, 'switch') +call add(s:tags, 'symbol') +call add(s:tags, 'text') +call add(s:tags, 'textPath') +call add(s:tags, 'tref') +call add(s:tags, 'tspan') + +call add(s:tags, 'html') +call add(s:tags, 'head') +call add(s:tags, 'body') + +call add(s:tags, 'thead') +call add(s:tags, 'tbody') +call add(s:tags, 'tfoot') +call add(s:tags, 'tr') +call add(s:tags, 'th') +call add(s:tags, 'td') + + + +let s:omittable = [ + \ ['address', 'article', 'aside', 'blockquote', 'dir', 'div', 'dl', 'fieldset', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'header', 'hr', 'menu', 'nav', 'ol', 'p', 'pre', 'section', 'table', 'ul'], + \ ['dt', 'dd'], + \ ['li'], + \ ['thead', 'tbody', 'tfoot'], + \ ['th', 'td'], + \] + +if exists('g:html_exclude_tags') + for tag in g:html_exclude_tags + call remove(s:tags, index(s:tags, tag)) + endfor +endif +let s:html_indent_tags = join(s:tags, '\|') +let s:html_indent_tags = s:html_indent_tags.'\|\w\+\(-\w\+\)\+' +if exists('g:html_indent_tags') + let s:html_indent_tags = s:html_indent_tags.'\|'.g:html_indent_tags +endif + +let s:cpo_save = &cpo +set cpo-=C + +" [-- count indent-increasing tags of line a:lnum --] +fun! HtmlIndentOpen(lnum, pattern) + let s = substitute('x'.getline(a:lnum), + \ '.\{-}\(\(<\)\('.a:pattern.'\)\>\)', "\1", 'g') + let s = substitute(s, "[^\1].*$", '', '') + return strlen(s) +endfun + +" [-- count indent-decreasing tags of line a:lnum --] +fun! HtmlIndentClose(lnum, pattern) + let s = substitute('x'.getline(a:lnum), + \ '.\{-}\(\(<\)/\('.a:pattern.'\)\>>\)', "\1", 'g') + let s = substitute(s, "[^\1].*$", '', '') + return strlen(s) +endfun + +" [-- count indent-increasing '{' of (java|css) line a:lnum --] +fun! HtmlIndentOpenAlt(lnum) + return strlen(substitute(getline(a:lnum), '[^{]\+', '', 'g')) +endfun + +" [-- count indent-decreasing '}' of (java|css) line a:lnum --] +fun! HtmlIndentCloseAlt(lnum) + return strlen(substitute(getline(a:lnum), '[^}]\+', '', 'g')) +endfun + +" [-- return the sum of indents respecting the syntax of a:lnum --] +fun! HtmlIndentSum(lnum, style) + if a:style == match(getline(a:lnum), '^\s*') + let open = HtmlIndentOpen(a:lnum, s:html_indent_tags) + let close = HtmlIndentClose(a:lnum, s:html_indent_tags) + if 0 != open || 0 != close + return open - close + endif + endif + endif + + if '' != &syntax && + \ synIDattr(synID(a:lnum, 1, 1), 'name') =~ '\(css\|java\).*' && + \ synIDattr(synID(a:lnum, strlen(getline(a:lnum)), 1), 'name') + \ =~ '\(css\|java\).*' + if a:style == match(getline(a:lnum), '^\s*}') + return HtmlIndentOpenAlt(a:lnum) - HtmlIndentCloseAlt(a:lnum) + endif + endif + return 0 +endfun + +fun! HtmlIndentGet(lnum) + " Find a non-empty line above the current line. + let lnum = prevnonblank(a:lnum - 1) + + " Hit the start of the file, use zero indent. + if lnum == 0 + return 0 + endif + + let restore_ic = &ic + setlocal ic " ignore case + + " [-- special handling for
: no indenting --]
+    if getline(a:lnum) =~ '\c
' + \ || 0 < searchpair('\c
', '', '\c
', 'nWb') + \ || 0 < searchpair('\c
', '', '\c
', 'nW') + " we're in a line with or inside
 ... 
+ if restore_ic == 0 + setlocal noic + endif + return -1 + endif + + " [-- special handling for : use cindent --] + let js = ', 05 Jun 2006 + " ZDR: This needs to be an AND (we are 'after the start of the pair' AND + " we are 'before the end of the pair'). Otherwise, indentation + " before the start of the script block will be affected; the end of + " the pair will still match if we are before the beginning of the + " pair. + " + if 0 < searchpair(js, '', jse, 'nWb') + \ && 0 < searchpair(js, '', jse, 'nW') + " we're inside javascript + if getline(searchpair(js, '', '', 'nWb')) !~ '' - - """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" - " by Tye Zdrojewski , 05 Jun 2006 - " ZDR: This needs to be an AND (we are 'after the start of the pair' AND - " we are 'before the end of the pair'). Otherwise, indentation - " before the start of the script block will be affected; the end of - " the pair will still match if we are before the beginning of the - " pair. - " - if 0 < searchpair(js, '', jse, 'nWb') - \ && 0 < searchpair(js, '', jse, 'nW') - " we're inside javascript - if getline(searchpair(js, '', '', 'nWb')) !~ '