From 42b26a34889bf150f677ef6584d81509fa776339 Mon Sep 17 00:00:00 2001 From: ache Date: Thu, 22 Feb 2018 14:24:54 +0100 Subject: [BIG] Clean up the config --- README | 20 -- colors/darkZ.vim | 92 ----- colors/jallybeans.vim | 488 -------------------------- ftdetect/javascript.vim | 6 - ftplugin/svg.vim | 105 ------ indent/html.vim | 462 ------------------------- plugin/buffers.vim | 5 - plugin/colors.vim | 5 - plugin/compatibility.vim | 11 - plugin/completion.vim | 6 - plugin/editzone.vim | 10 +- plugin/encoding.vim | 2 + plugin/filetype.vim | 4 - plugin/indent.vim | 33 +- plugin/matchit.vim | 812 -------------------------------------------- plugin/misc-bindings.vim | 9 +- plugin/perso.vim | 94 ++--- plugin/plugin_ultisnips.vim | 5 - plugin/plugin_unite.vim | 15 - plugin/search.vim | 1 + plugin/trailing-spaces.vim | 7 - plugin/vim-airline.vim | 6 - rgb.txt | 753 ---------------------------------------- syntax/haskell.vim | 181 ---------- syntax/html.vim | 185 ---------- syntax/javascript.vim | 311 ----------------- 26 files changed, 62 insertions(+), 3566 deletions(-) delete mode 100644 README delete mode 100644 colors/darkZ.vim delete mode 100644 colors/jallybeans.vim delete mode 100644 ftdetect/javascript.vim delete mode 100644 ftplugin/svg.vim delete mode 100644 indent/html.vim delete mode 100755 plugin/buffers.vim delete mode 100755 plugin/colors.vim delete mode 100755 plugin/compatibility.vim delete mode 100755 plugin/completion.vim delete mode 100755 plugin/filetype.vim delete mode 100755 plugin/matchit.vim delete mode 100755 plugin/plugin_ultisnips.vim delete mode 100755 plugin/plugin_unite.vim delete mode 100755 plugin/trailing-spaces.vim delete mode 100755 plugin/vim-airline.vim delete mode 100644 rgb.txt delete mode 100644 syntax/haskell.vim delete mode 100644 syntax/html.vim delete mode 100644 syntax/javascript.vim diff --git a/README b/README deleted file mode 100644 index 3688874..0000000 --- a/README +++ /dev/null @@ -1,20 +0,0 @@ -Ceci est un dossier .vim -À installer dans votre home "~" - - - -Attention, le thème ('darkZ') utilisé n'est pas forcément installé chez vous. -Remplacez le par le votre dans le fichier plugin/perso.vim - -N'hésitez à soumettre vos retours si vous avez rencontrez un problème à l'installation - -e-mail : ache ache.one - - - - - -Personal vim config directory - -Based on the halfr's vim-config-lite : https://bitbucket.org/halfr/vim-config-lite - diff --git a/colors/darkZ.vim b/colors/darkZ.vim deleted file mode 100644 index 87107bd..0000000 --- a/colors/darkZ.vim +++ /dev/null @@ -1,92 +0,0 @@ -" darkZ 1.1 (Vim color file) -" Create by ☆andy☆ -" QQ24375048 - -if version > 580 - hi clear - if exists("syntax_on") - syntax reset - endif -endif - -set cursorline -let g:colors_name="darkZ" - -hi Normal guifg=#DFD6C1 guibg=gray16 gui=none - -hi Cursor guifg=black guibg=yellow gui=none -hi ErrorMsg guifg=white guibg=red gui=none -hi VertSplit guifg=gray40 guibg=gray40 gui=none -hi Folded guifg=DarkSlateGray3 guibg=grey30 gui=none -hi FoldColumn guifg=tan guibg=grey30 gui=none -hi IncSearch guifg=#b0ffff guibg=#2050d0 -hi LineNr guifg=gray40 gui=none -hi ModeMsg guifg=SkyBlue gui=none -hi MoreMsg guifg=SeaGreen gui=none -hi NonText guifg=cyan gui=none -hi Question guifg=springgreen gui=none -hi Search guifg=white guibg=#445599 gui=bold -hi SpecialKey guifg=cyan gui=none -hi StatusLine guifg=black guibg=Pink gui=bold -hi StatusLineNC guifg=grey guibg=gray40 gui=none -hi Title guifg=#ff4400 gui=none gui=bold -hi Visual guifg=gray17 guibg=tan1 gui=none -hi WarningMsg guifg=salmon gui=none -hi Pmenu guifg=white guibg=#445599 gui=none -hi PmenuSel guifg=#445599 guibg=gray -hi WildMenu guifg=gray guibg=gray17 gui=none -hi MatchParen guifg=black guibg=orange2 gui=bold -hi DiffAdd guifg=black guibg=wheat1 -hi DiffChange guifg=black guibg=skyblue1 -hi DiffText guifg=black guibg=hotpink1 gui=none -hi DiffDelete guibg=gray45 guifg=black gui=none -hi CursorLine guibg=gray24 -hi CursorColumn guibg=gray24 - -hi Comment guifg=gray55 gui=italic -hi Constant guifg=#FF77FF gui=none -hi Identifier guifg=#6FDEF8 gui=none -hi Function guifg=#82EF2A gui=none -hi Statement guifg=#FCFC63 gui=none -hi PreProc guifg=#82EF2A gui=none -hi Type guifg=#33AFF3 gui=none -hi Special guifg=orange gui=none -hi Ignore guifg=red gui=none -hi Todo guifg=red guibg=yellow2 gui=none - -hi SpecialKey ctermfg=red -hi NonText cterm=bold ctermfg=darkblue -hi Directory ctermfg=darkcyan -hi ErrorMsg cterm=bold ctermfg=7 ctermbg=1 -hi IncSearch cterm=NONE ctermfg=yellow ctermbg=green -hi Search cterm=NONE ctermfg=white ctermbg=grey -hi MoreMsg ctermfg=darkgreen -hi ModeMsg cterm=NONE ctermfg=brown -hi LineNr ctermfg=3 -hi Question ctermfg=green -hi StatusLine cterm=bold,reverse -hi StatusLineNC cterm=reverse -hi VertSplit cterm=reverse -hi Title ctermfg=5 -hi Visual cterm=reverse -hi VisualNOS cterm=bold,underline -hi WarningMsg ctermfg=1 -hi WildMenu ctermfg=0 ctermbg=3 -hi Folded ctermfg=darkgrey ctermbg=NONE -hi FoldColumn ctermfg=darkgrey ctermbg=NONE -hi DiffAdd ctermbg=4 -hi DiffChange ctermbg=5 -hi DiffDelete cterm=bold ctermfg=4 ctermbg=6 -hi DiffText cterm=bold ctermbg=1 - -hi Comment ctermfg=darkcyan -hi Constant ctermfg=brown -hi Special ctermfg=5 -hi Identifier ctermfg=6 -hi Statement ctermfg=3 -hi PreProc ctermfg=5 -hi Type ctermfg=2 -hi Underlined cterm=underline ctermfg=5 -hi Ignore ctermfg=darkgrey -hi Error cterm=bold ctermfg=7 ctermbg=1 - diff --git a/colors/jallybeans.vim b/colors/jallybeans.vim deleted file mode 100644 index 27e4eea..0000000 --- a/colors/jallybeans.vim +++ /dev/null @@ -1,488 +0,0 @@ -" Vim color file -" -" -" _ _ _ _ -" | | __ _| | |_ _| |__ ___ __ _ _ __ ___ -" _ | |/ _` | | | | | | '_ \ / _ \/ _` | '_ \/ __| -" | |_| | (_| | | | |_| | |_) | __/ (_| | | | \__ \ -" \___/ \__,_|_|_|\__, |_.__/ \___|\__,_|_| |_|___/ -" |___/ -" "A colorful, dark color scheme for Vim." -" -" File: jallybeans.vim -" Version: 1 -" Last Change: October 30th, 2016 -" -" Permission is hereby granted, free of charge, to any person obtaining a copy -" of this software and associated documentation files (the "Software"), to deal -" in the Software without restriction, including without limitation the rights -" to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -" copies of the Software, and to permit persons to whom the Software is -" furnished to do so, subject to the following conditions: -" -" The above copyright notice and this permission notice shall be included in -" all copies or substantial portions of the Software. -" -" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -" IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -" FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -" AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -" LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -" OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -" THE SOFTWARE. - - -hi clear - -if exists("syntax_on") - syntax reset -endif - -let colors_name = "jallybeans" - -if has("gui_running") || &t_Co == 88 || &t_Co == 256 - let s:low_color = 0 -else - let s:low_color = 1 -endif - -" Color approximation functions by Henry So, Jr. and David Liang {{{ - -" returns an approximate grey index for the given grey level -fun! s:grey_number(x) - if &t_Co == 88 - if a:x < 23 - return 0 - elseif a:x < 69 - return 1 - elseif a:x < 103 - return 2 - elseif a:x < 127 - return 3 - elseif a:x < 150 - return 4 - elseif a:x < 173 - return 5 - elseif a:x < 196 - return 6 - elseif a:x < 219 - return 7 - elseif a:x < 243 - return 8 - else - return 9 - endif - else - if a:x < 14 - return 0 - else - let l:n = (a:x - 8) / 10 - let l:m = (a:x - 8) % 10 - if l:m < 5 - return l:n - else - return l:n + 1 - endif - endif - endif -endfun - -" returns the actual grey level represented by the grey index -fun! s:grey_level(n) - if &t_Co == 88 - if a:n == 0 - return 0 - elseif a:n == 1 - return 46 - elseif a:n == 2 - return 92 - elseif a:n == 3 - return 115 - elseif a:n == 4 - return 139 - elseif a:n == 5 - return 162 - elseif a:n == 6 - return 185 - elseif a:n == 7 - return 208 - elseif a:n == 8 - return 231 - else - return 255 - endif - else - if a:n == 0 - return 0 - else - return 8 + (a:n * 10) - endif - endif -endfun - -" returns the palette index for the given grey index -fun! s:grey_color(n) - if &t_Co == 88 - if a:n == 0 - return 16 - elseif a:n == 9 - return 79 - else - return 79 + a:n - endif - else - if a:n == 0 - return 16 - elseif a:n == 25 - return 231 - else - return 231 + a:n - endif - endif -endfun - -" returns an approximate color index for the given color level -fun! s:rgb_number(x) - if &t_Co == 88 - if a:x < 69 - return 0 - elseif a:x < 172 - return 1 - elseif a:x < 230 - return 2 - else - return 3 - endif - else - if a:x < 75 - return 0 - else - let l:n = (a:x - 55) / 40 - let l:m = (a:x - 55) % 40 - if l:m < 20 - return l:n - else - return l:n + 1 - endif - endif - endif -endfun - -" returns the actual color level for the given color index -fun! s:rgb_level(n) - if &t_Co == 88 - if a:n == 0 - return 0 - elseif a:n == 1 - return 139 - elseif a:n == 2 - return 205 - else - return 255 - endif - else - if a:n == 0 - return 0 - else - return 55 + (a:n * 40) - endif - endif -endfun - -" returns the palette index for the given R/G/B color indices -fun! s:rgb_color(x, y, z) - if &t_Co == 88 - return 16 + (a:x * 16) + (a:y * 4) + a:z - else - return 16 + (a:x * 36) + (a:y * 6) + a:z - endif -endfun - -" returns the palette index to approximate the given R/G/B color levels -fun! s:color(r, g, b) - " get the closest grey - let l:gx = s:grey_number(a:r) - let l:gy = s:grey_number(a:g) - let l:gz = s:grey_number(a:b) - - " get the closest color - let l:x = s:rgb_number(a:r) - let l:y = s:rgb_number(a:g) - let l:z = s:rgb_number(a:b) - - if l:gx == l:gy && l:gy == l:gz - " there are two possibilities - let l:dgr = s:grey_level(l:gx) - a:r - let l:dgg = s:grey_level(l:gy) - a:g - let l:dgb = s:grey_level(l:gz) - a:b - let l:dgrey = (l:dgr * l:dgr) + (l:dgg * l:dgg) + (l:dgb * l:dgb) - let l:dr = s:rgb_level(l:gx) - a:r - let l:dg = s:rgb_level(l:gy) - a:g - let l:db = s:rgb_level(l:gz) - a:b - let l:drgb = (l:dr * l:dr) + (l:dg * l:dg) + (l:db * l:db) - if l:dgrey < l:drgb - " use the grey - return s:grey_color(l:gx) - else - " use the color - return s:rgb_color(l:x, l:y, l:z) - endif - else - " only one possibility - return s:rgb_color(l:x, l:y, l:z) - endif -endfun - -" returns the palette index to approximate the 'rrggbb' hex string -fun! s:rgb(rgb) - let l:r = ("0x" . strpart(a:rgb, 0, 2)) + 0 - let l:g = ("0x" . strpart(a:rgb, 2, 2)) + 0 - let l:b = ("0x" . strpart(a:rgb, 4, 2)) + 0 - return s:color(l:r, l:g, l:b) -endfun - -" sets the highlighting for the given group -fun! s:X(group, fg, bg, attr, lcfg, lcbg) - if s:low_color - let l:fge = empty(a:lcfg) - let l:bge = empty(a:lcbg) - - if !l:fge && !l:bge - exec "hi ".a:group." ctermfg=".a:lcfg." ctermbg=".a:lcbg - elseif !l:fge && l:bge - exec "hi ".a:group." ctermfg=".a:lcfg." ctermbg=NONE" - elseif l:fge && !l:bge - exec "hi ".a:group." ctermfg=NONE ctermbg=".a:lcbg - endif - else - let l:fge = empty(a:fg) - let l:bge = empty(a:bg) - - if !l:fge && !l:bge - exec "hi ".a:group." guifg=#".a:fg." guibg=#".a:bg." ctermfg=".s:rgb(a:fg)." ctermbg=".s:rgb(a:bg) - elseif !l:fge && l:bge - exec "hi ".a:group." guifg=#".a:fg." guibg=NONE ctermfg=".s:rgb(a:fg)." ctermbg=NONE" - elseif l:fge && !l:bge - exec "hi ".a:group." guifg=NONE guibg=#".a:bg." ctermfg=NONE ctermbg=".s:rgb(a:bg) - endif - endif - - if a:attr == "" - exec "hi ".a:group." gui=none cterm=none" - else - let noitalic = join(filter(split(a:attr, ","), "v:val !=? 'italic'"), ",") - if empty(noitalic) - let noitalic = "none" - endif - exec "hi ".a:group." gui=".a:attr." cterm=".noitalic - endif -endfun -" }}} - - -if !exists("g:jallybeans_use_lowcolor_black") || g:jallybeans_use_lowcolor_black - let s:termBlack = "Black" -else - let s:termBlack = "Grey" -endif - -if version >= 700 - call s:X("CursorLine","","1c1c1c","","",s:termBlack) - call s:X("CursorColumn","","1c1c1c","","",s:termBlack) - call s:X("MatchParen","ffffff","80a090","bold","","DarkCyan") - - call s:X("TabLine","000000","b0b8c0","italic","",s:termBlack) - call s:X("TabLineFill","9098a0","","","",s:termBlack) - call s:X("TabLineSel","000000","f0f0f0","italic,bold",s:termBlack,"White") - - " Auto-completion - call s:X("Pmenu","ffffff","606060","","White",s:termBlack) - call s:X("PmenuSel","101010","eeeeee","",s:termBlack,"White") -endif - -call s:X("Visual","","404040","","",s:termBlack) -call s:X("Cursor","","b0d0f0","","","") - -call s:X("LineNr","605958","151515","none",s:termBlack,"") -call s:X("Comment","888888","","italic","Grey","") -call s:X("Todo","808080","","bold","White",s:termBlack) - -call s:X("StatusLine","000000","dddddd","italic","","White") -call s:X("StatusLineNC","ffffff","403c41","italic","White","Black") -call s:X("VertSplit","777777","403c41","",s:termBlack,s:termBlack) -call s:X("WildMenu","f0a0c0","302028","","Magenta","") - -call s:X("Folded","a0a8b0","384048","italic",s:termBlack,"") -call s:X("FoldColumn","535D66","1f1f1f","","",s:termBlack) -call s:X("SignColumn","777777","333333","","",s:termBlack) -call s:X("ColorColumn","","000000","","",s:termBlack) - -call s:X("Title","70b950","","bold","Green","") - -call s:X("Constant","cf6a4c","","","Red","") -call s:X("Special","799d6a","","","Green","") -call s:X("Delimiter","668799","","","Grey","") - -call s:X("String","99ad6a","","","Green","") -call s:X("StringDelimiter","556633","","","DarkGreen","") - -call s:X("Identifier","c6b6ee","","","LightCyan","") -call s:X("Structure","8fbfdc","","","LightCyan","") -call s:X("Function","fad07a","","","Yellow","") -call s:X("Statement","8197bf","","","DarkBlue","") -call s:X("PreProc","8fbfdc","","","LightBlue","") - -"hi! link Operator Normal -call s:X("Operator","fad07a","","","Yellow","") - -call s:X("Type","ffb964","","","Yellow","") -call s:X("NonText","606060","151515","",s:termBlack,"") - -call s:X("SpecialKey","444444","1c1c1c","",s:termBlack,"") - -call s:X("Search","FFa0c0","302028","underline","Black","Green") - -highlight Search ctermbg=Green -highlight Search ctermfg=Black -set hls - -call s:X("Directory","dad085","","","Yellow","") -call s:X("ErrorMsg","","902020","","","DarkRed") -hi! link Error ErrorMsg -hi! link MoreMsg Special -call s:X("Question","65C254","","","Green","") - - -" Spell Checking - -call s:X("SpellBad","","902020","underline","","DarkRed") -call s:X("SpellCap","","0000df","underline","","Blue") -call s:X("SpellRare","","540063","underline","","DarkMagenta") -call s:X("SpellLocal","","2D7067","underline","","Green") - -" Diff - -hi! link diffRemoved Constant -hi! link diffAdded String - -" VimDiff - -call s:X("DiffAdd","D2EBBE","437019","","White","DarkGreen") -call s:X("DiffDelete","40000A","700009","","DarkRed","DarkRed") -call s:X("DiffChange","","2B5B77","","White","DarkBlue") -call s:X("DiffText","8fbfdc","000000","reverse","Yellow","") - -" PHP - -hi! link phpFunctions Function -call s:X("StorageClass","c59f6f","","","Red","") -hi! link phpSuperglobal Identifier -hi! link phpQuoteSingle StringDelimiter -hi! link phpQuoteDouble StringDelimiter -hi! link phpBoolean Constant -hi! link phpNull Constant -hi! link phpArrayPair Operator - -" Ruby - -hi! link rubySharpBang Comment -call s:X("rubyClass","447799","","","DarkBlue","") -call s:X("rubyIdentifier","c6b6fe","","","Cyan","") -hi! link rubyConstant Type -hi! link rubyFunction Function - -call s:X("rubyInstanceVariable","c6b6fe","","","Cyan","") -call s:X("rubySymbol","7697d6","","","Blue","") -hi! link rubyGlobalVariable rubyInstanceVariable -hi! link rubyModule rubyClass -call s:X("rubyControl","7597c6","","","Blue","") - -hi! link rubyString String -hi! link rubyStringDelimiter StringDelimiter -hi! link rubyInterpolationDelimiter Identifier - -call s:X("rubyRegexpDelimiter","540063","","","Magenta","") -call s:X("rubyRegexp","dd0093","","","DarkMagenta","") -call s:X("rubyRegexpSpecial","a40073","","","Magenta","") - -call s:X("rubyPredefinedIdentifier","de5577","","","Red","") - -" JavaScript - -hi! link javaScriptValue Constant -hi! link javaScriptRegexpString rubyRegexp - -" CoffeeScript - -hi! link coffeeRegExp javaScriptRegexpString - -" Lua - -hi! link luaOperator Conditional - -" C - -hi! link cOperator Constant - -" Objective-C/Cocoa - -hi! link objcClass Type -hi! link cocoaClass objcClass -hi! link objcSubclass objcClass -hi! link objcSuperclass objcClass -hi! link objcDirective rubyClass -hi! link objcStatement Constant -hi! link cocoaFunction Function -hi! link objcMethodName Identifier -hi! link objcMethodArg Normal -hi! link objcMessageName Identifier - -" Debugger.vim - -call s:X("DbgCurrent","DEEBFE","345FA8","","White","DarkBlue") -call s:X("DbgBreakPt","","4F0037","","","DarkMagenta") - -" vim-indent-guides - -if !exists("g:indent_guides_auto_colors") - let g:indent_guides_auto_colors = 0 -endif -call s:X("IndentGuidesOdd","","202020","","","") -call s:X("IndentGuidesEven","","1c1c1c","","","") - -" Plugins, etc. - -hi! link TagListFileName Directory -call s:X("PreciseJumpTarget","B9ED67","405026","","White","Green") - -" Manual overrides for 256-color terminals. Dark colors auto-map badly. -if !s:low_color - hi StatusLineNC ctermbg=235 - hi Folded ctermbg=236 - hi FoldColumn ctermbg=234 - hi SignColumn ctermbg=236 - hi CursorColumn ctermfg=215 - hi CursorLine ctermbg=236 - hi SpecialKey ctermbg=234 - hi NonText ctermbg=233 - hi LineNr ctermbg=233 - hi DiffText ctermfg=81 - hi DbgBreakPt ctermbg=53 -endif - -" delete functions {{{ -delf s:X -delf s:rgb -delf s:color -delf s:rgb_color -delf s:rgb_level -delf s:rgb_number -delf s:grey_color -delf s:grey_level -delf s:grey_number -" }}} - -" Gui - - -hi Normal guifg=white guibg=black diff --git a/ftdetect/javascript.vim b/ftdetect/javascript.vim deleted file mode 100644 index 54f2c4f..0000000 --- a/ftdetect/javascript.vim +++ /dev/null @@ -1,6 +0,0 @@ -function! s:DetectJS() - if getline(1) =~# '^#!.*/bin/\(env\s\+\)\?node\>' - setfiletype javascript - endif -endfunction -autocmd BufNewFile,BufRead * call s:DetectJS() diff --git a/ftplugin/svg.vim b/ftplugin/svg.vim deleted file mode 100644 index b1597a9..0000000 --- a/ftplugin/svg.vim +++ /dev/null @@ -1,105 +0,0 @@ -" Vim indent file -" -" Language: svg -" Maintainer: Jason Shell -" Last Change: 2015 Sep 23 -" Notes: 1) will be confused by unbalanced tags in comments - -" Only load this indent file when no other was loaded. -if exists('b:did_indent') - finish -endif -let b:did_indent = 1 -let s:keepcpo= &cpo -set cpo&vim - -" [-- local settings (must come before aborting the script) --] -setlocal indentexpr=SvgIndentGet(v:lnum,1) -setlocal indentkeys=o,O,*,<>>,<<>,/,{,} - -if !exists('b:svg_indent_open') - let b:svg_indent_open = '.\{-}<\a' - " pre tag, e.g.
- " let b:svg_indent_open = '.\{-}<[/]\@!\(address\)\@!' -endif - -if !exists('b:svg_indent_close') - let b:svg_indent_close = '.\{-} - " let b:svg_indent_close = '.\{-}SvgIndentWithPattern(line, pat) - let s = substitute('x'.a:line, a:pat, "\1", 'g') - return strlen(substitute(s, "[^\1].*$", '', '')) -endfun - -" [-- check if it's svg --] -fun! SvgIndentSynCheck(lnum) - if '' != &syntax - let syn1 = synIDattr(synID(a:lnum, 1, 1), 'name') - let syn2 = synIDattr(synID(a:lnum, strlen(getline(a:lnum)) - 1, 1), 'name') - if '' != syn1 && syn1 !~ 'svg' && '' != syn2 && syn2 !~ 'svg' - " don't indent pure non-xml code - return 0 - - " elseif syn1 =~ '^xmlComment' && syn2 =~ '^xmlComment' - elseif syn1 =~ '^svgComment' && syn2 =~ '^svgComment' - " indent comments specially - return -1 - endif - endif - return 1 -endfun - -" [-- return the sum of indents of a:lnum --] -fun! SvgIndentSum(lnum, style, add) - let line = getline(a:lnum) - if a:style == match(line, '^\s*SvgIndentWithPattern(line, b:svg_indent_open) - \ - SvgIndentWithPattern(line, b:svg_indent_close) - \ - SvgIndentWithPattern(line, '.\{-}/>'))) + a:add - else - return a:add - endif -endfun - -fun! SvgIndentGet(lnum, use_syntax_check) - " 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 - - if a:use_syntax_check - let check_lnum = SvgIndentSynCheck(lnum) - let check_alnum = SvgIndentSynCheck(a:lnum) - if 0 == check_lnum || 0 == check_alnum - return indent(a:lnum) - elseif -1 == check_lnum || -1 == check_alnum - return -1 - endif - endif - - let ind = SvgIndentSum(lnum, -1, indent(lnum)) - let ind = SvgIndentSum(a:lnum, 0, ind) - - return ind -endfun - -let &cpo = s:keepcpo -unlet s:keepcpo diff --git a/indent/html.vim b/indent/html.vim deleted file mode 100644 index 2e8216d..0000000 --- a/indent/html.vim +++ /dev/null @@ -1,462 +0,0 @@ -" 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 = [] -let s:no_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') -" Common self closing SVG elements -call add(s:no_tags, 'animate') -call add(s:no_tags, 'animateTransform') -call add(s:no_tags, 'circle') -call add(s:no_tags, 'ellipse') -call add(s:no_tags, 'feBlend') -call add(s:no_tags, 'feColorMatrix') -call add(s:no_tags, 'feComposite') -call add(s:no_tags, 'feConvolveMatrix') -call add(s:no_tags, 'feDisplacementMap') -call add(s:no_tags, 'feFlood') -call add(s:no_tags, 'feFuncR') -call add(s:no_tags, 'feFuncG') -call add(s:no_tags, 'feFuncB') -call add(s:no_tags, 'feFuncA') -call add(s:no_tags, 'feGaussianBlur') -call add(s:no_tags, 'feImage') -call add(s:no_tags, 'feMergeNode') -call add(s:no_tags, 'feMorphology') -call add(s:no_tags, 'feOffset') -call add(s:no_tags, 'fePointLight') -call add(s:no_tags, 'feSpotLight') -call add(s:no_tags, 'feTile') -call add(s:no_tags, 'feTurbulence') -call add(s:no_tags, 'hatchpath') -call add(s:no_tags, 'hkern') -call add(s:no_tags, 'image') -call add(s:no_tags, 'line') -call add(s:no_tags, 'mpath') -call add(s:no_tags, 'polygon') -call add(s:no_tags, 'polyline') -call add(s:no_tags, 'path') -call add(s:no_tags, 'rect') -call add(s:no_tags, 'solidColor') -call add(s:no_tags, 'stop') -call add(s:no_tags, 'use') -call add(s:no_tags, 'view') -call add(s:no_tags, 'vkern') - -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') - -call add(s:no_tags, 'base') -call add(s:no_tags, 'link') -call add(s:no_tags, 'meta') -call add(s:no_tags, 'hr') -call add(s:no_tags, 'br') -call add(s:no_tags, 'wbr') -call add(s:no_tags, 'img') -call add(s:no_tags, 'embed') -call add(s:no_tags, 'param') -call add(s:no_tags, 'source') -call add(s:no_tags, 'track') -call add(s:no_tags, 'area') -call add(s:no_tags, 'col') -call add(s:no_tags, 'input') -call add(s:no_tags, 'keygen') -call add(s:no_tags, 'menuitem') - -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'], - \] - - -let s:html_noindent_tags = join(s:no_tags, '\|') - -if exists('g:html_exclude_tags') - for tag in g:html_exclude_tags - call remove(s:tags, index(s:tags, tag)) - endfor - let s:html_noindent_tags = s:html_noindent_tags.'\|'.join(g:html_exclude_tags, '\|') -endif - -" let s:html_indent_tags = join(s:tags, '\|') -let s:html_indent_tags = '[a-z_][a-z0-9_.-]*' -" 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 - -func! HtmlIndentPatternCount(content, pattern) - let s = substitute('x'.a:content, a:pattern, "\1", 'g') - let s = substitute(s, "[^\1].*$", '', '') - return strlen(s) -endfun - -" [-- count indent-increasing tags of line a:lnum --] -fun! HtmlIndentOpen(lnum, pattern) - return HtmlIndentPatternCount(getline(a:lnum), - \ '.\{-}\(\(<\)\('.a:pattern.'\)\>\)') -endfun - -" [-- count indent-decreasing tags of line a:lnum --] -fun! HtmlIndentClose(lnum, pattern) - return HtmlIndentPatternCount(getline(a:lnum), - \ '.\{-}\(\(<\)/\('.a:pattern.'\)\>>\)') -endfun - -" [-- count self close tags of line a:lnum --] -fun! HtmlIndentSelfClose(lnum, pattern) - return HtmlIndentPatternCount(getline(a:lnum), - \ '.\{-}\(\(<\('.a:pattern.'\).*\)\@\)') -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) - HtmlIndentOpen(a:lnum, s:html_noindent_tags) - let close = HtmlIndentClose(a:lnum, s:html_indent_tags) - HtmlIndentClose(a:lnum, s:html_noindent_tags) - let self_close = HtmlIndentSelfClose(a:lnum, s:html_noindent_tags) - if 0 != open || 0 != close || 0 != self_close - return open - close - self_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) - " Get shiftwidth value. - if exists('*shiftwidth') - let sw = shiftwidth() - else - let sw = &sw - endif - - " 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')) !~ '