From c2a13ef3f498d90fb9f46b830e14c31156635676 Mon Sep 17 00:00:00 2001 From: Max Christian Pohle Date: Mon, 9 May 2016 17:00:35 +0200 Subject: moved repository up again this repo shell be used for vim exclusively --- .gitignore | 7 + .gitmodules | 4 +- .netrwhist | 4 + .screen/doc/shortcuts.txt | 3 - .screenrc | 27 --- .vim/.gitignore | 7 - .vim/.gitmodules | 3 - .vim/colors/coderonline.vim | 180 -------------------- .vim/doc/INSTALL | 42 ----- .vim/doc/coderonline-vim.png | Bin 195172 -> 0 bytes .vim/doc/readme.md | 8 - .vim/doc/shortcuts.txt | 50 ------ .vim/favicon.ico | Bin 32038 -> 0 bytes .vim/gvim.desktop | 10 -- .vim/indent/.keep | 1 - .vim/plugins/Vundle.vim | 1 - .vim/spell/.keep | 1 - .vim/temp/.keep | 3 - .vim/vimrc | 233 -------------------------- colors/coderonline.vim | 180 ++++++++++++++++++++ doc/INSTALL | 42 +++++ doc/coderonline-vim.png | Bin 0 -> 195172 bytes doc/readme.md | 8 + doc/shortcuts.txt | 50 ++++++ favicon.ico | Bin 0 -> 32038 bytes gvim.desktop | 10 ++ indent/.keep | 1 + indent/html5.vim | 387 +++++++++++++++++++++++++++++++++++++++++++ indent/php.vim | 37 +++++ spell/.keep | 1 + temp/.keep | 3 + vimrc | 233 ++++++++++++++++++++++++++ ycm_extra_conf.py | 145 ++++++++++++++++ ycm_extra_conf.pyc | Bin 0 -> 2659 bytes 34 files changed, 1110 insertions(+), 571 deletions(-) create mode 100644 .gitignore create mode 100644 .netrwhist delete mode 100644 .screen/doc/shortcuts.txt delete mode 100644 .screenrc delete mode 100644 .vim/.gitignore delete mode 100644 .vim/.gitmodules delete mode 100644 .vim/colors/coderonline.vim delete mode 100644 .vim/doc/INSTALL delete mode 100644 .vim/doc/coderonline-vim.png delete mode 100644 .vim/doc/readme.md delete mode 100644 .vim/doc/shortcuts.txt delete mode 100644 .vim/favicon.ico delete mode 100644 .vim/gvim.desktop delete mode 100644 .vim/indent/.keep delete mode 160000 .vim/plugins/Vundle.vim delete mode 100644 .vim/spell/.keep delete mode 100644 .vim/temp/.keep delete mode 100644 .vim/vimrc create mode 100644 colors/coderonline.vim create mode 100644 doc/INSTALL create mode 100644 doc/coderonline-vim.png create mode 100644 doc/readme.md create mode 100644 doc/shortcuts.txt create mode 100644 favicon.ico create mode 100644 gvim.desktop create mode 100644 indent/.keep create mode 100644 indent/html5.vim create mode 100644 indent/php.vim create mode 100644 spell/.keep create mode 100644 temp/.keep create mode 100644 vimrc create mode 100644 ycm_extra_conf.py create mode 100644 ycm_extra_conf.pyc diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..93df1ba --- /dev/null +++ b/.gitignore @@ -0,0 +1,7 @@ +/temp/** +!temp/.keep +/intent/** +!indent/.keep +/spell/** +!spell/.keep +/systags diff --git a/.gitmodules b/.gitmodules index a7dea0d..57ae747 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ -[submodule ".vim/plugins/Vundle.vim"] - path = .vim/plugins/Vundle.vim +[submodule "plugins/Vundle.vim"] + path = plugins/Vundle.vim url = https://github.com/VundleVim/Vundle.vim.git diff --git a/.netrwhist b/.netrwhist new file mode 100644 index 0000000..430f97c --- /dev/null +++ b/.netrwhist @@ -0,0 +1,4 @@ +let g:netrw_dirhistmax =10 +let g:netrw_dirhist_cnt =2 +let g:netrw_dirhist_1='/home/max/.config/google-chrome' +let g:netrw_dirhist_2='/home/max/openvpn/cx20/client' diff --git a/.screen/doc/shortcuts.txt b/.screen/doc/shortcuts.txt deleted file mode 100644 index eba7846..0000000 --- a/.screen/doc/shortcuts.txt +++ /dev/null @@ -1,3 +0,0 @@ -[CTRL-A commands] - -:layout save default - saves current window layout for detach/reattach diff --git a/.screenrc b/.screenrc deleted file mode 100644 index 8beaf4c..0000000 --- a/.screenrc +++ /dev/null @@ -1,27 +0,0 @@ -# the following two lines give a two-line status, with the current window highlighted -hardstatus alwayslastline -hardstatus string '%{= kG}[%{G}%H%? %1`%?%{g}][%= %{= kw}%-w%{+b yk} %n*%t%?(%u)%? %{-}%+w %=%{g}][%{B}%m/%d %{W}%C%A%{g}]' - -# huge scrollback buffer -defscrollback 5000 - -# no welcome message -startup_message off - -# 256 colors -attrcolor b ".I" -termcapinfo xterm 'Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm' -defbce on - -# mouse tracking allows to switch region focus by clicking -mousetrack on -defmousetrack on - -# default windows -# get rid of silly xoff stuff -bind s split - - -# Use X scrolling mechanism -termcapinfo xterm* ti@:te@ - diff --git a/.vim/.gitignore b/.vim/.gitignore deleted file mode 100644 index 93df1ba..0000000 --- a/.vim/.gitignore +++ /dev/null @@ -1,7 +0,0 @@ -/temp/** -!temp/.keep -/intent/** -!indent/.keep -/spell/** -!spell/.keep -/systags diff --git a/.vim/.gitmodules b/.vim/.gitmodules deleted file mode 100644 index 57ae747..0000000 --- a/.vim/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "plugins/Vundle.vim"] - path = plugins/Vundle.vim - url = https://github.com/VundleVim/Vundle.vim.git diff --git a/.vim/colors/coderonline.vim b/.vim/colors/coderonline.vim deleted file mode 100644 index f842b28..0000000 --- a/.vim/colors/coderonline.vim +++ /dev/null @@ -1,180 +0,0 @@ -" color theme for vim -" Maintainer: Max Christian Pohle -" Last Change: 07.09.2015 -" Web: http://max.coderonline.de/ - -set background=dark -hi clear -if exists("syntax_on") - syntax reset -endif -let g:colors_name="coderonline" - - -"set guifont=Andale\ Mono\ 12 -set guifont=Liberation\ Mono\ Normal\ 11 -"set guifont=Meslo\ LG\ S\ DZ\ for\ Powerline\ 14 -"set guifont=Monospace\ 11 -"set guifont=DejaVu\ Sans\ Mono\ 11 -"set guifont=Liberation\ Mono\ for\ Powerline\ 11 -"set guifont=Envy\ Code\ R\ 11 - -set number -set hls - -highlight Menu gui=none cterm=none term=none guibg=white ctermbg=white guifg=black ctermfg=black -highlight Scrollbar gui=none cterm=none term=none guibg=white ctermbg=white guifg=black ctermfg=black -highlight Tooltip gui=none cterm=none term=none guibg=yellow ctermbg=yellow guifg=black ctermfg=black - -highlight Normal gui=none cterm=none term=none guibg=white ctermbg=white guifg=black ctermfg=black -highlight! link NonText Normal - -highlight Statement gui=bold cterm=bold term=bold guibg=white ctermbg=white guifg=#0000ff ctermfg=21 -highlight! link Boolean Statement -highlight! link Identifier Statement - -highlight Type gui=bold cterm=bold term=bold guibg=white ctermbg=white guifg=DarkBlue ctermfg=darkblue - -highlight Constant gui=none cterm=none term=none guibg=white ctermbg=white guifg=brown ctermfg=brown -highlight! link String Constant -highlight! link Number Constant - -highlight Comment gui=none cterm=none term=none guibg=white ctermbg=white guifg=DarkGreen ctermfg=DarkGreen -highlight! link PreProc Comment - -highlight StatusLine gui=bold cterm=bold term=bold guibg=lightgray ctermbg=lightgray guifg=darkgray ctermfg=darkgrey -highlight! link StatusLineNC StatusLine - -highlight LineNr gui=none cterm=none term=none guibg=lightgray ctermbg=lightgray guifg=black ctermfg=black -highlight CursorLine gui=none cterm=none term=none guibg=lightgray ctermbg=lightgray -" highlight! link CursorLine LineNr -" highlight! link CursorColumn LineNr -" highlight! link ColorColumn LineNr - -" Cursor the character under the cursor -highlight Cursor gui=inverse cterm=inverse term=inverse guibg=lightgray ctermbg=lightgray guifg=black ctermfg=black -highlight iCursor gui=underline cterm=underline term=underline -highlight! link CursorLineNr Cursor -highlight! link CursorIM Cursor -highlight! link Visual Cursor -highlight! link VirualNOS Cursor -" highlight! link MatchParen LineNr -highlight MatchParen guibg=yellow ctermbg=yellow - -" WildMenu current match in 'wildmenu' completion -" Pmenu Popup menu: normal item. -" PmenuSel Popup menu: selected item. -" PmenuSbar Popup menu: scrollbar. -" PmenuThumb Popup menu: Thumb of the scrollbar. -highlight! link WildMenu Todo -highlight! link Popup LineNr -highlight! link PMenu Popup -highlight! link PMenuSel CursorLineNr -highlight! link PMenuSbar CursorLineNr -highlight! link PMenuThumb CursorLineNr - - -" Windows -highlight Title gui=bold cterm=bold term=bold guibg=lightgray ctermbg=lightgray guifg=darkgray ctermfg=darkgray -highlight! link VertSplit Title -highlight! link StatusLine Title -highlight! link StatusLineNC Title -highlight! link TabLine Title -highlight! link TabLineFill TabLine -highlight! link TabLineSel TabLine -highlight TabLineSel gui=inverse cterm=inverse term=inverse - -highlight cParen gui=none cterm=none term=none guibg=white ctermbg=white guifg=orange ctermfg=brown -highlight cBlock gui=none cterm=none term=none guibg=white ctermbg=cyan guifg=orange ctermfg=brown -highlight vimParenSep gui=none cterm=none term=none guibg=white ctermbg=white guifg=orange ctermfg=brown - -highlight Special gui=bold cterm=bold term=bold guibg=white ctermbg=white guifg=black ctermfg=178 -highlight! link SpecialKey Special - -highlight Todo gui=none cterm=none term=none guibg=yellow ctermbg=yellow guifg=black ctermfg=black -highlight! link ModeMsg Todo -highlight! link MoreMsg Todo -highlight! link ErrorMsg Todo -highlight! link Conceal Todo -highlight! link Directory Todo - -highlight Question gui=bold cterm=bold term=bold guibg=white ctermbg=white guifg=black ctermfg=black -highlight! link WarningMsg Question - -highlight SpellBad gui=underline cterm=underline term=underline ctermbg=white -highlight! link SpellCap SpellBad -highlight! link SpellLocal Todo -highlight! link SpellRare Todo -" *hl-Conceal* -" *hl-DiffAdd* -" DiffAdd diff mode: Added line |diff.txt| -" *hl-DiffChange* -" DiffChange diff mode: Changed line |diff.txt| -" *hl-DiffDelete* -" DiffDelete diff mode: Deleted line |diff.txt| -" *hl-DiffText* -" DiffText diff mode: Changed text within a changed line |diff.txt| -" *hl-ErrorMsg* -" Folded line used for closed folds -" *hl-FoldColumn* -" FoldColumn 'foldcolumn' -" *hl-SignColumn* -" SignColumn column where |signs| are displayed -" *hl-IncSearch* -" IncSearch 'incsearch' highlighting; also used for the text replaced with -" ":s///c" -" *hl-LineNr* -" MatchParen The character under the cursor or just before it, if it -" is a paired bracket, and its match. |pi_paren.txt| -" -" *hl-ModeMsg* -" *hl-NonText* -" *hl-Search* -" Search Last search pattern highlighting (see 'hlsearch'). -" Also used for highlighting the current line in the quickfix -" window and similar items that need to stand out. -" *hl-SpecialKey* -" to show unprintable characters in the text, 'listchars'. -" Generally: text that is displayed differently from what it -" really is. -" *hl-SpellBad* - - -" ====================== Important bits ====================== -"exe 'hi Normal guifg='.s:white .' guibg='.s:darkgrey -"exe 'hi String guifg='.s:green .' guibg='.s:darkgrey .' gui=bold' -"exe 'hi Function guifg='.s:violet .' guibg='.s:darkgrey .' gui=none' -"exe 'hi Operator guifg='.s:light_orange .' guibg='.s:darkgrey .' gui=none' -"exe 'hi Type guifg='.s:yellow .' guibg='.s:darkgrey .' gui=bold' -"exe 'hi Number guifg='.s:orange .' guibg='.s:darkgrey .' gui=none' -"exe 'hi Constant guifg='.s:red .' guibg='.s:darkgrey .' gui=none' -"exe 'hi Macro guifg='.s:magenta .' guibg='.s:darkgrey .' gui=none' -"exe 'hi PreProc guifg='.s:grey_blue .' guibg='.s:darkgrey .' gui=none' -"exe 'hi Keyword guifg='.s:light_orange .' guibg='.s:darkgrey .' gui=none' -"exe 'hi Comment guifg='.s:white .' guibg='.s:darkgrey .' gui=italic' -"exe 'hi TODO guifg='.s:grey_blue .' guibg='.s:darkgrey .' gui=italic,bold' -" Lay out our palette -let s:grey_blue = '#8a9597' -let s:light_grey_blue = '#a0a8b0' -let s:dark_grey_blue = '#34383c' -let s:mid_grey_blue = '#64686c' -let s:beige = '#ceb67f' -let s:light_orange = '#ebc471' -let s:yellow = '#e3d796' -let s:violet = '#a982c8' -let s:magenta = '#a933ac' -let s:green = '#e0a96f' -let s:lightgreen = '#c2c98f' -let s:red = '#d08356' -let s:cyan = '#74dad9' -let s:darkgrey = '#1a1a1a' -let s:grey = '#303030' -let s:lightgrey = '#605958' -let s:white = '#fffedc' -let s:orange = '#d08356' - -" ~~~ These are specific to color_coded ~~~ -exe 'hi Member guifg=#0000aa gui=italic' -exe 'hi Variable guifg=#8800aa gui=none' -exe 'hi Namespace guifg=#aa0000 gui=none' -exe 'hi EnumConstant guifg=#00aaaa gui=none' diff --git a/.vim/doc/INSTALL b/.vim/doc/INSTALL deleted file mode 100644 index 50a2f08..0000000 --- a/.vim/doc/INSTALL +++ /dev/null @@ -1,42 +0,0 @@ -# INSTALL -# this should briefly show you how to install this bundle -# -# step 1) -# download the current version using git -git clone http://git.entwicklerseite.de/vim .vim/ - -# step 2) -# create a symbolic link to the downloaded vim.rc in you $HOME-directory -ln -s .vim/vimrc .vimrc - -# step 3) -# get vim submodules, namely this is just vundle as this will download the rest by itsown -git submodule update --init --recursive - -# step 4) -# fix errors caused by the different vim version you might be using and define the spell checkers language. Starting Vim will show you which lines are not supported on your vim installation so that you can fix them: -vim vimrc - -# step 5) -# download plugins and spell file for your language -vim -c ":VundleUpdate" -vim -c ":set spell" -# vim +set\ spell # < maybe that works as well - -# step 6) -# build YouCompleteMe (if you plan to use it) -cd plugins/YouCompleteMe -python2 ./install.py --clang-completer - - -# step 7) -# create an entry in file managers right click menu 'open with' allowing you to open the file in a vim tab -mkdir -p .local/share/Thunar/sendto/ -cp ~/.vim/gvim-tab.desktop ~/.local/share/Thunar/sendto/ - -# step 8) -# add gvim functionality to thunar, so that sendto can be used to open a file in an existing vim instance (as a tab in this case) -cp ~/.vim/gvim-tab.desktop ~/.local/share/applications/ -update-desktop-database ~/.local/share/applications/ - - diff --git a/.vim/doc/coderonline-vim.png b/.vim/doc/coderonline-vim.png deleted file mode 100644 index ac76bff..0000000 Binary files a/.vim/doc/coderonline-vim.png and /dev/null differ diff --git a/.vim/doc/readme.md b/.vim/doc/readme.md deleted file mode 100644 index 800c1a2..0000000 --- a/.vim/doc/readme.md +++ /dev/null @@ -1,8 +0,0 @@ -

vim configuration

-This is the configuration I am using. - - -

coderonline.vim - colorscheme

- - screenshot of vim - diff --git a/.vim/doc/shortcuts.txt b/.vim/doc/shortcuts.txt deleted file mode 100644 index 9c168f9..0000000 --- a/.vim/doc/shortcuts.txt +++ /dev/null @@ -1,50 +0,0 @@ -[normal mode] -f{char} - move cursor to the character {char} - - -[visual mode] - with selected lines -gq - formats text so that it fits in whatever :set textwidth was set -iB - select block between curly braces (:help object-select) - - -[commands] -:spell [word] - adds a word to the current dictionary (no mistake any more) -:set list - display non printable characters -:retab - replaces tabs with spaces -:set expandtab - in insert mode: replace tab with spaces - - -[navigation] - - look up the tag under the cursor (help links as well) - - return back from tag under the cursor - - -[macros] - record and play back a series of vim commands -qa - start (q) macro recording in register a (can be anything) -q - stop macro recording -@a - replay macro a -:'<,'>normal @a - apply a to every line in the current selection - - -[marker] -ma - set marker a-z (a in this case) -'a - go to marker a - - -[hotkeys] -, - increment, decrement number under the cursor - - -[windows] -v - splits buffer vertically (screen uses |) -s - splits buffer horizontally (same as screen) -w - moves the cursor to the next window and back -[dir] - moves the cursor in that direction (use hjkl or arrow keys) - - -[vimdiff] -do - get changes from other window into the current -dp - put changes from current window into the other -]c - jump to the next change -[c - jump to the prevous change -zR - opens all folds (unfold all) diff --git a/.vim/favicon.ico b/.vim/favicon.ico deleted file mode 100644 index ca0b3c3..0000000 Binary files a/.vim/favicon.ico and /dev/null differ diff --git a/.vim/gvim.desktop b/.vim/gvim.desktop deleted file mode 100644 index 37c6e58..0000000 --- a/.vim/gvim.desktop +++ /dev/null @@ -1,10 +0,0 @@ -[Desktop Entry] -Name=Vi IMproved Tab -Comment=Open file in an existing instance of vi and in a new tab -MimeType=text/english;text/plain;text/x-makefile;text/x-c++hdr;text/x-c++src;text/x-chdr;text/x-csrc;text/x-java;text/x-moc;text/x-pascal;text/x-tcl;text/x-tex;application/x-shellscript;text/x-c;text/x-c++; -Exec=gvim f -N --remote-tab %F -Icon=gvim -Type=Application -Terminal=false -X-XClassHintResName=VIM -Categories=Utility;TextEditor; diff --git a/.vim/indent/.keep b/.vim/indent/.keep deleted file mode 100644 index f8e463a..0000000 --- a/.vim/indent/.keep +++ /dev/null @@ -1 +0,0 @@ -this directory gets used for custom indentation rules. file naming follows the extension of the files the indentation is for and the extension .vim. diff --git a/.vim/plugins/Vundle.vim b/.vim/plugins/Vundle.vim deleted file mode 160000 index 4984767..0000000 --- a/.vim/plugins/Vundle.vim +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 4984767509e3d05ca051e253c8a8b37de784be45 diff --git a/.vim/spell/.keep b/.vim/spell/.keep deleted file mode 100644 index 6d81f6e..0000000 --- a/.vim/spell/.keep +++ /dev/null @@ -1 +0,0 @@ -vim will automatically download spellchecker dictionaries to this directory diff --git a/.vim/temp/.keep b/.vim/temp/.keep deleted file mode 100644 index 3d99c12..0000000 --- a/.vim/temp/.keep +++ /dev/null @@ -1,3 +0,0 @@ -this directory is meant to store backups and undo files. it improves the vim -experience when working with fuse mounted file systems, because they can get -really slow when doing those things remotely diff --git a/.vim/vimrc b/.vim/vimrc deleted file mode 100644 index e03c5e1..0000000 --- a/.vim/vimrc +++ /dev/null @@ -1,233 +0,0 @@ -" vi:columns=160:list:ts=2:sts=2:sw=2 -"================================================================================ -" Vundle: plugin manager... -set nocompatible | " do not try to be vi, be vim (required by Vundle) -filetype off | " Vundle needs this -set rtp+=~/.vim/plugins/Vundle.vim | " set runtimepath (required by Vundle) -call vundle#begin('~/.vim/plugins/') | " location where Vundle searches&installs plugins - -" Plugin dependant configurations... -Plugin 'VundleVim/Vundle.vim' | " Vundle itself (required) -Plugin 'cscope_plus.vim' | " run cscope -R -b in project folder then use -Plugin 'autoload_cscope.vim' | " CTRL+\ s searches word under cursor, CTRL+T back -Plugin 'tpope/vim-fugitive' | " the most complete GIT integration plugin -Plugin 'jeaye/color_coded' | " semantic highlighting with vim -Plugin 'terryma/vim-multiple-cursors' | " displays visual block mode as cursors - -Plugin 'taglist-plus' | " quick code navigator -Plugin 'jdonaldson/vaxe' | " code completion for haxe -Plugin 'sheerun/vim-polyglot' | " better syntax highlighting/indentation for multiple languages -Plugin 'loremipsum' | " Sample text generator -let Tlist_Compact_Format = 1 | " -let Tlist_GainFocus_On_ToggleOpen = 1 | " -let Tlist_Close_On_Select = 1 | " - -Plugin 'Valloric/YouCompleteMe' | " syntax checker and code completion -let g:ycm_global_ycm_extra_conf = '~/.vim/ycm_extra_conf.py' | " fallback, right one should be in the applications path -let g:ycm_confirm_extra_conf = 0 | " disable 'do you really want to execute .py?' -let g:ycm_key_select_completion = '' | " key completion key -let g:ycm_error_symbol = '✖' | " insert this as an error symbol in the gutter bar -let g:ycm_warning_symbol = '➔' | " insert this as a warning symbol in the gutter bar -let g:ycm_collect_identifiers_from_tags_files = 1 | " -let g:ycm_autoclose_preview_window_after_insertion=1 | " close the window when leaving insert mode -"let g:ycm_semantic_triggers = {'c' : ['(', ',']} | " add additional triggers (not recommend) - -let b:html_omni_flavor='xhtml' | " prever xhtml over html because that makes inline php code possible without hassle -let html_use_css = 1 | " when using :TOhtml no font-tags will be used, but proper css - -call vundle#end() | " required by Vundle -filetype plugin indent on | " required by Vundle -"================================================================================ -" custom config -colorscheme coderonline -syntax enable - -set noswapfile | " noundofile, nobackup, nowritebackup -set backupdir=~/.vim/temp | " using :set backup will copy current file to this directory -set directory=~/.vim/temp | " -set undodir=~/.vim/temp | " - -set ts=2 sts=2 sw=2 expandtab | " indentation which i like (abbr: tabstop, softtabstop, shiftwidth) -set autoindent | " always set autoindenting on -set copyindent | " copy the previous indentation on autoindenting -set scrolloff=2 | " always keeps at least two lines visible (when seeking) -" set selectmode=mouse | " avoid using select mode (only with mouse) -set mousemodel=popup_setpos | " display a default right click menu for the selection (that is c&p is possible) -set selection=exclusive | " includes last character of the selection into following command (like x or d) - -set whichwrap=b,s,<,>,[,] | " beyond beginning/end line causes cusor to wrap -set backspace=indent,eol,start| " allow backspacing over everything in insert mode, not needed with whichwrap -set diffopt+=iwhite,filler | " lets diff ignore white spaces -set spell spelllang=en,de | " enable spell checker -set virtualedit=onemore | " one character beyond the line length should be navigatable (options: all,insert,block,onemore) -set breakindent cpoptions+=n | " when wrapping lines indent wrapped line to align with the previews -set linebreak | " do not wrap in the middle of words -set showcmd | " displays status line messages while selecting (matrix size) -set nofoldenable | " do not fold code automatically -set tags+=~/.vim/systags | " ctags -R -f ~/.vim/systags /usr/include /usr/local/include -set wildmenu wildmode=full | " wildmenu code completion - -" search... -set ignorecase smartcase | " if search pattern contains uppercase then search is case sensitive -set incsearch | " do incremental searching -set showmatch matchtime=4 | " blinks matching braces - -set novisualbell | " don't beep -set noerrorbells | " don't beep -set clipboard=unnamedplus | " makes copy and paste work (autoselectplus might work as well) -set number | " toggle line numbers - -if has("multi_byte") - set encoding=utf-8 | " we need default utf-8 encoding to use cool chars as line break and so on (see below) - scriptencoding utf-8 | " tell vim that we are using utf-8 here - set showbreak+=› | " symbol used in the beginning of a wrapped line - set listchars=eol:↲ | " symbols used when using :set list (which displays non-printable chars) - set listchars+=trail:· | " symbols used when using :set list (which displays non-printable chars) - set listchars+=precedes:« | " symbols used when using :set list (which displays non-printable chars) - set listchars+=extends:» | " symbols used when using :set list (which displays non-printable chars) - set listchars+=tab:▸\ | " symbols used when using :set list (which displays non-printable chars) -endif - -if has("autocmd") - set modeline | " set variables specific to a file, like indentation by adding a comment - set modelines=3 | " how many lines in the beginning and end of the file can be mode lines? - - augroup resCur | " make cursor appear in its previous position when reopening a file... - autocmd BufReadPost * call setpos(".", getpos("'\"")) - augroup END - - augroup PreviewOnBottom | " will open new windows below the current (only in insert mode, so that the preview window is drawn below) - autocmd InsertEnter * set splitbelow - autocmd InsertLeave * set splitbelow! - augroup END - - augroup OmniFunc | " this will enable omnicomplete just in case this configuration runs somewhere, where YouCompleteMe is not compiled - if exists("+omnifunc") - autocmd Filetype * - \ if &omnifunc == "" | - \ setlocal omnifunc=syntaxcomplete#Complete | - \ setlocal completeopt=longest,menuone | - \ endif - endif - augroup END - - autocmd FileType text setlocal textwidth=78 | " text files: set 'textwidth' to 78 - autocmd FileType gitcommit set tw=72 | " longer commit messages without auto line wrapping - autocmd FileType LaTeX let g:tex_flavor = "latex"| set conceallevel=1| set concealcursor= - autocmd BufNewFile,BufReadPost *.config set filetype=xml | " visual studio config file - autocmd BufNewFile,BufReadPost *.csproj set filetype=xml | " visual studio project file - autocmd BufNewFile,BufReadPost *.sln set filetype=xml | " visual studio solution file -endif - -"================================================================================ -" gui stuff and appearance -if &t_Co > 2 - set hlsearch | " highlight all search matches - set cursorline | " highlight currently selected line -endif - - -if has("gui_running") - set mouse=a | " use mouse in gui-mode (which is default) - set mouseshape+=n:beam,v:beam | " display a text input cursor even in normal and selection mode - set guicursor=n-v-c:ver30-Cursor-blinkon500-blinkoff500 | " how the caret looks like - set guitablabel=%t | " do not display full path as tabname - set guioptions+=m | " menu bar - set guioptions+=T | " toolbar - set guioptions+=r | " right-hand scroll bar - set guioptions-=c | " use console dialogs instead of popups - set guioptions+=a | " autoselect: copy&paste using middleclick - set guioptions+=e | " add tab pages - set guioptions+=p | " use gui pointer callback for x11 - set toolbariconsize=large | " make the icon toolbar as big as possible - "set columns=80 | " set initial window width (so that it fits the terminals) -else - if &term =~? 'mlterm\|xterm\|screen' - set t_Co=256 | " fixes incompatibilities with our color scheme - endif - set mouse=nh | " limits mouse usage to normal mode and help files, so that middle click text insertion works in insert mode - set title | " set the terminal caption - set icon | " sets the terminal icon to vim - set ttyfast | " modern terminals are all fast in a way - "set titleold="vim ended" | " set terminal title after closing vim - "set titlestring="VIM-CONSOLE" | " set window title - "if has('mouse') - "endif -endif - - -"================================================================================ -" custom commands... -map h|map j| " window navigation shortcuts -map k|map l| " window navigation shortcuts - -cmap w!! w !sudo tee % >/dev/null| " write :w!! to execute :w as root user - -" custom hotkeys... -nnoremap :tabnext| " lets one use CTRL+Tab to switch between tabs -nnoremap :tabprevious| " use CTRL+Shift+Tab to switch to preview tab - -nnoremap j gj|nnoremap k gk| " do not jump over wrapped lines - -nnoremap $ g$| " and make the $ key position the cursor after the last char of that line, not before -nnoremap g$| " and make the key position the cursor after the last char of that line -function ExtendedHome() - let column = col('.') - normal! ^ - if column == col('.') - normal! 0 - endif -endfunction -noremap ^ -noremap :call ExtendedHome() - -nnoremap u - - -"map el -"map hgel -"vnoremap e -"vnoremap b - - -" plugin hotkeys -map :TlistToggle| " bind TagList to Hotkey Ctrl+L -inoremap ( (| " when opening a bracket: call the OmniComplete function, display the menu, but deselect the first entry (C-p) - - -set makeprg=make\ test -nnoremap :!make| " classic key binding: press F5 to compile and execute (if you have a Makefile with make test doing that) - - -"================================================================================ -" deactivated on-demand commands (just in case one needs them one day) -" -" code completion: http://vim.wikia.com/wiki/Make_Vim_completion_popup_menu_work_just_like_in_an_IDE -" reacts on CTRL+P, CTRL+Space -"inoremap pumvisible() ? "\" : "\u\" -"inoremap pumvisible() ? "\" : "\" -"inoremap pumvisible() ? "\" : "\" -"inoremap pumvisible() ? "\" : "\" -"inoremap pumvisible() ? "\\\" : "\" -"inoremap pumvisible() ? "\\\" : "\" -" set guiheadroom=0| " do not fill non-functional area of the empty editor with gtk background -" map shift-right to visually select and so on -"nnoremap El -"nnoremap vl -"nnoremap vj -"nnoremap vk -"nnoremap vj -" noremap % v% " jump between braces and highlight -"nnoremap ^ -"vmap ^ -"nnoremap $ -"vmap $ -"nnoremap -"nnoremap -":inoremap pumvisible() ? "\" : "\u\" -"inoremap pumvisible() ? "\" : "\" " breaks cursor keys! -" binding ESC can easily break cursor key movement on the console (tricky, because gvim works) -"inoremap -"inoremap -" -"map OA k|map OB j|map OC l|map OD h| " allow cursor keys in insert mode diff --git a/colors/coderonline.vim b/colors/coderonline.vim new file mode 100644 index 0000000..f842b28 --- /dev/null +++ b/colors/coderonline.vim @@ -0,0 +1,180 @@ +" color theme for vim +" Maintainer: Max Christian Pohle +" Last Change: 07.09.2015 +" Web: http://max.coderonline.de/ + +set background=dark +hi clear +if exists("syntax_on") + syntax reset +endif +let g:colors_name="coderonline" + + +"set guifont=Andale\ Mono\ 12 +set guifont=Liberation\ Mono\ Normal\ 11 +"set guifont=Meslo\ LG\ S\ DZ\ for\ Powerline\ 14 +"set guifont=Monospace\ 11 +"set guifont=DejaVu\ Sans\ Mono\ 11 +"set guifont=Liberation\ Mono\ for\ Powerline\ 11 +"set guifont=Envy\ Code\ R\ 11 + +set number +set hls + +highlight Menu gui=none cterm=none term=none guibg=white ctermbg=white guifg=black ctermfg=black +highlight Scrollbar gui=none cterm=none term=none guibg=white ctermbg=white guifg=black ctermfg=black +highlight Tooltip gui=none cterm=none term=none guibg=yellow ctermbg=yellow guifg=black ctermfg=black + +highlight Normal gui=none cterm=none term=none guibg=white ctermbg=white guifg=black ctermfg=black +highlight! link NonText Normal + +highlight Statement gui=bold cterm=bold term=bold guibg=white ctermbg=white guifg=#0000ff ctermfg=21 +highlight! link Boolean Statement +highlight! link Identifier Statement + +highlight Type gui=bold cterm=bold term=bold guibg=white ctermbg=white guifg=DarkBlue ctermfg=darkblue + +highlight Constant gui=none cterm=none term=none guibg=white ctermbg=white guifg=brown ctermfg=brown +highlight! link String Constant +highlight! link Number Constant + +highlight Comment gui=none cterm=none term=none guibg=white ctermbg=white guifg=DarkGreen ctermfg=DarkGreen +highlight! link PreProc Comment + +highlight StatusLine gui=bold cterm=bold term=bold guibg=lightgray ctermbg=lightgray guifg=darkgray ctermfg=darkgrey +highlight! link StatusLineNC StatusLine + +highlight LineNr gui=none cterm=none term=none guibg=lightgray ctermbg=lightgray guifg=black ctermfg=black +highlight CursorLine gui=none cterm=none term=none guibg=lightgray ctermbg=lightgray +" highlight! link CursorLine LineNr +" highlight! link CursorColumn LineNr +" highlight! link ColorColumn LineNr + +" Cursor the character under the cursor +highlight Cursor gui=inverse cterm=inverse term=inverse guibg=lightgray ctermbg=lightgray guifg=black ctermfg=black +highlight iCursor gui=underline cterm=underline term=underline +highlight! link CursorLineNr Cursor +highlight! link CursorIM Cursor +highlight! link Visual Cursor +highlight! link VirualNOS Cursor +" highlight! link MatchParen LineNr +highlight MatchParen guibg=yellow ctermbg=yellow + +" WildMenu current match in 'wildmenu' completion +" Pmenu Popup menu: normal item. +" PmenuSel Popup menu: selected item. +" PmenuSbar Popup menu: scrollbar. +" PmenuThumb Popup menu: Thumb of the scrollbar. +highlight! link WildMenu Todo +highlight! link Popup LineNr +highlight! link PMenu Popup +highlight! link PMenuSel CursorLineNr +highlight! link PMenuSbar CursorLineNr +highlight! link PMenuThumb CursorLineNr + + +" Windows +highlight Title gui=bold cterm=bold term=bold guibg=lightgray ctermbg=lightgray guifg=darkgray ctermfg=darkgray +highlight! link VertSplit Title +highlight! link StatusLine Title +highlight! link StatusLineNC Title +highlight! link TabLine Title +highlight! link TabLineFill TabLine +highlight! link TabLineSel TabLine +highlight TabLineSel gui=inverse cterm=inverse term=inverse + +highlight cParen gui=none cterm=none term=none guibg=white ctermbg=white guifg=orange ctermfg=brown +highlight cBlock gui=none cterm=none term=none guibg=white ctermbg=cyan guifg=orange ctermfg=brown +highlight vimParenSep gui=none cterm=none term=none guibg=white ctermbg=white guifg=orange ctermfg=brown + +highlight Special gui=bold cterm=bold term=bold guibg=white ctermbg=white guifg=black ctermfg=178 +highlight! link SpecialKey Special + +highlight Todo gui=none cterm=none term=none guibg=yellow ctermbg=yellow guifg=black ctermfg=black +highlight! link ModeMsg Todo +highlight! link MoreMsg Todo +highlight! link ErrorMsg Todo +highlight! link Conceal Todo +highlight! link Directory Todo + +highlight Question gui=bold cterm=bold term=bold guibg=white ctermbg=white guifg=black ctermfg=black +highlight! link WarningMsg Question + +highlight SpellBad gui=underline cterm=underline term=underline ctermbg=white +highlight! link SpellCap SpellBad +highlight! link SpellLocal Todo +highlight! link SpellRare Todo +" *hl-Conceal* +" *hl-DiffAdd* +" DiffAdd diff mode: Added line |diff.txt| +" *hl-DiffChange* +" DiffChange diff mode: Changed line |diff.txt| +" *hl-DiffDelete* +" DiffDelete diff mode: Deleted line |diff.txt| +" *hl-DiffText* +" DiffText diff mode: Changed text within a changed line |diff.txt| +" *hl-ErrorMsg* +" Folded line used for closed folds +" *hl-FoldColumn* +" FoldColumn 'foldcolumn' +" *hl-SignColumn* +" SignColumn column where |signs| are displayed +" *hl-IncSearch* +" IncSearch 'incsearch' highlighting; also used for the text replaced with +" ":s///c" +" *hl-LineNr* +" MatchParen The character under the cursor or just before it, if it +" is a paired bracket, and its match. |pi_paren.txt| +" +" *hl-ModeMsg* +" *hl-NonText* +" *hl-Search* +" Search Last search pattern highlighting (see 'hlsearch'). +" Also used for highlighting the current line in the quickfix +" window and similar items that need to stand out. +" *hl-SpecialKey* +" to show unprintable characters in the text, 'listchars'. +" Generally: text that is displayed differently from what it +" really is. +" *hl-SpellBad* + + +" ====================== Important bits ====================== +"exe 'hi Normal guifg='.s:white .' guibg='.s:darkgrey +"exe 'hi String guifg='.s:green .' guibg='.s:darkgrey .' gui=bold' +"exe 'hi Function guifg='.s:violet .' guibg='.s:darkgrey .' gui=none' +"exe 'hi Operator guifg='.s:light_orange .' guibg='.s:darkgrey .' gui=none' +"exe 'hi Type guifg='.s:yellow .' guibg='.s:darkgrey .' gui=bold' +"exe 'hi Number guifg='.s:orange .' guibg='.s:darkgrey .' gui=none' +"exe 'hi Constant guifg='.s:red .' guibg='.s:darkgrey .' gui=none' +"exe 'hi Macro guifg='.s:magenta .' guibg='.s:darkgrey .' gui=none' +"exe 'hi PreProc guifg='.s:grey_blue .' guibg='.s:darkgrey .' gui=none' +"exe 'hi Keyword guifg='.s:light_orange .' guibg='.s:darkgrey .' gui=none' +"exe 'hi Comment guifg='.s:white .' guibg='.s:darkgrey .' gui=italic' +"exe 'hi TODO guifg='.s:grey_blue .' guibg='.s:darkgrey .' gui=italic,bold' +" Lay out our palette +let s:grey_blue = '#8a9597' +let s:light_grey_blue = '#a0a8b0' +let s:dark_grey_blue = '#34383c' +let s:mid_grey_blue = '#64686c' +let s:beige = '#ceb67f' +let s:light_orange = '#ebc471' +let s:yellow = '#e3d796' +let s:violet = '#a982c8' +let s:magenta = '#a933ac' +let s:green = '#e0a96f' +let s:lightgreen = '#c2c98f' +let s:red = '#d08356' +let s:cyan = '#74dad9' +let s:darkgrey = '#1a1a1a' +let s:grey = '#303030' +let s:lightgrey = '#605958' +let s:white = '#fffedc' +let s:orange = '#d08356' + +" ~~~ These are specific to color_coded ~~~ +exe 'hi Member guifg=#0000aa gui=italic' +exe 'hi Variable guifg=#8800aa gui=none' +exe 'hi Namespace guifg=#aa0000 gui=none' +exe 'hi EnumConstant guifg=#00aaaa gui=none' diff --git a/doc/INSTALL b/doc/INSTALL new file mode 100644 index 0000000..50a2f08 --- /dev/null +++ b/doc/INSTALL @@ -0,0 +1,42 @@ +# INSTALL +# this should briefly show you how to install this bundle +# +# step 1) +# download the current version using git +git clone http://git.entwicklerseite.de/vim .vim/ + +# step 2) +# create a symbolic link to the downloaded vim.rc in you $HOME-directory +ln -s .vim/vimrc .vimrc + +# step 3) +# get vim submodules, namely this is just vundle as this will download the rest by itsown +git submodule update --init --recursive + +# step 4) +# fix errors caused by the different vim version you might be using and define the spell checkers language. Starting Vim will show you which lines are not supported on your vim installation so that you can fix them: +vim vimrc + +# step 5) +# download plugins and spell file for your language +vim -c ":VundleUpdate" +vim -c ":set spell" +# vim +set\ spell # < maybe that works as well + +# step 6) +# build YouCompleteMe (if you plan to use it) +cd plugins/YouCompleteMe +python2 ./install.py --clang-completer + + +# step 7) +# create an entry in file managers right click menu 'open with' allowing you to open the file in a vim tab +mkdir -p .local/share/Thunar/sendto/ +cp ~/.vim/gvim-tab.desktop ~/.local/share/Thunar/sendto/ + +# step 8) +# add gvim functionality to thunar, so that sendto can be used to open a file in an existing vim instance (as a tab in this case) +cp ~/.vim/gvim-tab.desktop ~/.local/share/applications/ +update-desktop-database ~/.local/share/applications/ + + diff --git a/doc/coderonline-vim.png b/doc/coderonline-vim.png new file mode 100644 index 0000000..ac76bff Binary files /dev/null and b/doc/coderonline-vim.png differ diff --git a/doc/readme.md b/doc/readme.md new file mode 100644 index 0000000..800c1a2 --- /dev/null +++ b/doc/readme.md @@ -0,0 +1,8 @@ +

vim configuration

+This is the configuration I am using. + + +

coderonline.vim - colorscheme

+ + screenshot of vim + diff --git a/doc/shortcuts.txt b/doc/shortcuts.txt new file mode 100644 index 0000000..9c168f9 --- /dev/null +++ b/doc/shortcuts.txt @@ -0,0 +1,50 @@ +[normal mode] +f{char} - move cursor to the character {char} + + +[visual mode] - with selected lines +gq - formats text so that it fits in whatever :set textwidth was set +iB - select block between curly braces (:help object-select) + + +[commands] +:spell [word] - adds a word to the current dictionary (no mistake any more) +:set list - display non printable characters +:retab - replaces tabs with spaces +:set expandtab - in insert mode: replace tab with spaces + + +[navigation] + - look up the tag under the cursor (help links as well) + - return back from tag under the cursor + + +[macros] - record and play back a series of vim commands +qa - start (q) macro recording in register a (can be anything) +q - stop macro recording +@a - replay macro a +:'<,'>normal @a - apply a to every line in the current selection + + +[marker] +ma - set marker a-z (a in this case) +'a - go to marker a + + +[hotkeys] +, - increment, decrement number under the cursor + + +[windows] +v - splits buffer vertically (screen uses |) +s - splits buffer horizontally (same as screen) +w - moves the cursor to the next window and back +[dir] - moves the cursor in that direction (use hjkl or arrow keys) + + +[vimdiff] +do - get changes from other window into the current +dp - put changes from current window into the other +]c - jump to the next change +[c - jump to the prevous change +zR - opens all folds (unfold all) diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000..ca0b3c3 Binary files /dev/null and b/favicon.ico differ diff --git a/gvim.desktop b/gvim.desktop new file mode 100644 index 0000000..37c6e58 --- /dev/null +++ b/gvim.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Name=Vi IMproved Tab +Comment=Open file in an existing instance of vi and in a new tab +MimeType=text/english;text/plain;text/x-makefile;text/x-c++hdr;text/x-c++src;text/x-chdr;text/x-csrc;text/x-java;text/x-moc;text/x-pascal;text/x-tcl;text/x-tex;application/x-shellscript;text/x-c;text/x-c++; +Exec=gvim f -N --remote-tab %F +Icon=gvim +Type=Application +Terminal=false +X-XClassHintResName=VIM +Categories=Utility;TextEditor; diff --git a/indent/.keep b/indent/.keep new file mode 100644 index 0000000..f8e463a --- /dev/null +++ b/indent/.keep @@ -0,0 +1 @@ +this directory gets used for custom indentation rules. file naming follows the extension of the files the indentation is for and the extension .vim. diff --git a/indent/html5.vim b/indent/html5.vim new file mode 100644 index 0000000..94baa87 --- /dev/null +++ b/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')) !~ '