diff --git a/.gitmodules b/.gitmodules index 8e291c3..e3ca83c 100644 --- a/.gitmodules +++ b/.gitmodules @@ -4,3 +4,108 @@ [submodule ".autoenv"] path = .autoenv url = git://github.com/kennethreitz/autoenv.git +[submodule ".vim/bundle/fugitive"] + path = .vim/bundle/fugitive + url = git://github.com/tpope/vim-fugitive.git +[submodule ".vim/bundle/nerdtree"] + path = .vim/bundle/nerdtree + url = git://github.com/scrooloose/nerdtree.git +[submodule ".vim/bundle/abolish"] + path = .vim/bundle/abolish + url = git://github.com/tpope/vim-abolish +[submodule ".vim/bundle/surround"] + path = .vim/bundle/surround + url = git://github.com/tpope/vim-surround +[submodule ".vim/bundle/markdown"] + path = .vim/bundle/markdown + url = git://github.com/tpope/vim-markdown +[submodule ".vim/bundle/gitv"] + path = .vim/bundle/gitv + url = git://github.com/gregsexton/gitv.git +[submodule ".vim/bundle/easymotion"] + path = .vim/bundle/easymotion + url = git://github.com/Lokaltog/vim-easymotion.git +[submodule ".vim/bundle/repeat"] + path = .vim/bundle/repeat + url = git://github.com/tpope/vim-repeat +[submodule ".vim/bundle/visualstar"] + path = .vim/bundle/visualstar + url = git://github.com/thinca/vim-visualstar.git +[submodule ".vim/bundle/css-color"] + path = .vim/bundle/css-color + url = git://github.com/ap/vim-css-color.git +[submodule ".vim/bundle/ruby"] + path = .vim/bundle/ruby + url = git://github.com/vim-ruby/vim-ruby.git +[submodule ".vim/bundle/supertab"] + path = .vim/bundle/supertab + url = git://github.com/tsaleh/vim-supertab.git +[submodule ".vim/bundle/dbext.vim"] + path = .vim/bundle/dbext.vim + url = git://github.com/vim-scripts/dbext.vim.git +[submodule ".vim/bundle/scriptease"] + path = .vim/bundle/scriptease + url = git://github.com/tpope/vim-scriptease.git +[submodule ".vim/bundle/powerline"] + path = .vim/bundle/powerline + url = git://github.com/Lokaltog/vim-powerline.git +[submodule ".vim/bundle/syntastic"] + path = .vim/bundle/syntastic + url = git://github.com/scrooloose/syntastic.git +[submodule ".vim/bundle/tagbar"] + path = .vim/bundle/tagbar + url = git://github.com/majutsushi/tagbar +[submodule ".vim/bundle/ctrlp"] + path = .vim/bundle/ctrlp + url = git://github.com/kien/ctrlp.vim.git +[submodule ".vim/bundle/tabular"] + path = .vim/bundle/tabular + url = git://github.com/godlygeek/tabular.git +[submodule ".vim/bundle/sensible"] + path = .vim/bundle/sensible + url = git://github.com/tpope/vim-sensible.git +[submodule ".vim/bundle/pathogen"] + path = .vim/bundle/pathogen + url = git://github.com/tpope/vim-pathogen.git +[submodule ".vim/bundle/git"] + path = .vim/bundle/git + url = git://github.com/tpope/vim-git.git +[submodule ".vim/bundle/irblack"] + path = .vim/bundle/irblack + url = git://github.com/wgibbs/vim-irblack.git +[submodule ".vim/bundle/colors-solarized"] + path = .vim/bundle/colors-solarized + url = git://github.com/altercation/vim-colors-solarized.git +[submodule ".vim/bundle/characterize"] + path = .vim/bundle/characterize + url = git://github.com/tpope/vim-characterize.git +[submodule ".vim/bundle/less"] + path = .vim/bundle/less + url = git://github.com/groenewege/vim-less.git +[submodule ".vim/bundle/css3-syntax"] + path = .vim/bundle/css3-syntax + url = git://github.com/hail2u/vim-css3-syntax.git +[submodule ".vim/bundle/ack"] + path = .vim/bundle/ack + url = git://github.com/mileszs/ack.vim.git +[submodule ".vim/bundle/snipmate.vim"] + path = .vim/bundle/snipmate.vim + url = git://github.com/msanders/snipmate.vim.git +[submodule ".vim/bundle/gundo.vim"] + path = .vim/bundle/gundo.vim + url = git://github.com/sjl/gundo.vim.git +[submodule ".vim/bundle/nerdtree-tabs"] + path = .vim/bundle/nerdtree-tabs + url = git://github.com/jistr/vim-nerdtree-tabs.git +[submodule ".vim/bundle/unimpaired"] + path = .vim/bundle/unimpaired + url = git://github.com/tpope/vim-unimpaired.git +[submodule ".vim/bundle/commentary"] + path = .vim/bundle/commentary + url = git://github.com/tpope/vim-commentary.git +[submodule ".vim/bundle/speeddating"] + path = .vim/bundle/speeddating + url = git://github.com/tpope/vim-speeddating.git +[submodule ".vim/bundle/dispatch"] + path = .vim/bundle/dispatch + url = git://github.com/tpope/vim-dispatch.git diff --git a/.vim/.gitignore b/.vim/.gitignore new file mode 100644 index 0000000..9ea0f13 --- /dev/null +++ b/.vim/.gitignore @@ -0,0 +1,2 @@ +.* +!.gitignore diff --git a/.vim/.netrwhist b/.vim/.netrwhist new file mode 100644 index 0000000..87e025a --- /dev/null +++ b/.vim/.netrwhist @@ -0,0 +1,7 @@ +let g:netrw_dirhistmax =10 +let g:netrw_dirhist_cnt =5 +let g:netrw_dirhist_1='/Users/lilix/Projects/home/.git/modules' +let g:netrw_dirhist_2='/Users/lilix/Projects/home/.git/modules/vim' +let g:netrw_dirhist_3='/Users/lilix/Projects/home/.git/modules/vim/bundle' +let g:netrw_dirhist_4='/Users/lilix/.dot' +let g:netrw_dirhist_5='/Users/lilix/.dot/.git' diff --git a/.vim/after/syntax/perl/conceal.vim b/.vim/after/syntax/perl/conceal.vim new file mode 100644 index 0000000..429d4d5 --- /dev/null +++ b/.vim/after/syntax/perl/conceal.vim @@ -0,0 +1,30 @@ +if !has('conceal') + finish +endif + + +syntax clear perlOperator +syntax keyword perlOperator is + +syntax match perlLambda /\(=>\?\s*\)\@<=sub\(\W\)\@=/ conceal cchar=λ +syntax match perlNiceOperator /\/ conceal cchar=∈ +syntax match perlNiceOperator /\/ conceal cchar=∨ +syntax match perlNiceOperator /\/ conceal cchar=∧ +syntax match perlNiceOperator /\/ conceal cchar=¬ +syntax match perlNiceOperator /\/ conceal cchar=∀ +syntax match perlNiceOperator /\/ conceal cchar=∀ +syntax match perlNiceOperator /\/ conceal cchar=∃ +syntax match perlNiceOperator containedin=ALL /<=/ conceal cchar=≤ +syntax match perlNiceOperator containedin=ALL />=/ conceal cchar=≥ +syntax match perlNiceOperator containedin=ALL /==/ conceal cchar=≡ +syntax match perlNiceOperator containedin=ALL /!=/ conceal cchar=≠ +syntax match perlNiceOperator containedin=ALL /=\~/ conceal cchar=≅ +syntax match perlNiceOperator containedin=ALL /!\~/ conceal cchar=≆ +syntax match perlNiceOperator containedin=ALL /=>/ conceal cchar=» +syntax match perlNiceOperator containedin=ALL /\->/ conceal cchar=› + +hi link perlNiceOperator Operator +hi link perlNiceStatement Statement +hi! link Conceal Operator + +setl conceallevel=2 diff --git a/.vim/after/syntax/perl/mappings.vim b/.vim/after/syntax/perl/mappings.vim new file mode 100644 index 0000000..1eb61f3 --- /dev/null +++ b/.vim/after/syntax/perl/mappings.vim @@ -0,0 +1,2 @@ +noremap K :!perldoc perldoc -f + diff --git a/.vim/after/syntax/perl/settings.vim b/.vim/after/syntax/perl/settings.vim new file mode 100644 index 0000000..11db920 --- /dev/null +++ b/.vim/after/syntax/perl/settings.vim @@ -0,0 +1,9 @@ +set makeprg=perl\ -c\ %\ $* +set errorformat=%f:%l:%m +set keywordprg=perldoc\ -f +set formatprg=perl\ -MText::Autoformat\ -e'autoformat' +set formatoptions=qro +set tabstop=4 +set expandtab +set tw=0 + diff --git a/.vim/after/syntax/perl/variables.vim b/.vim/after/syntax/perl/variables.vim new file mode 100644 index 0000000..b90f9e8 --- /dev/null +++ b/.vim/after/syntax/perl/variables.vim @@ -0,0 +1,18 @@ +let g:perl_compiler_force_warnings = 0 + +let perl_moose_stuff = 1 +let perl_no_scope_in_variables = 1 +let perl_no_sync_on_sub = 1 +let perl_no_sync_on_global_var = 1 +let perl_extended_vars = 1 +let perl_include_pod = 1 +let perl_string_as_statement = 1 +let perl_sync_dist = 1000 +let perl_want_scope_in_variables = 1 +let perl_pod_formatting = 1 +let perl_pod_spellcheck_headings = 1 +"let perl_fold = 1 +"let perl_fold_blocks = 1 +"let perl_nofold_packages = 1 +let perlhelp_prog = '/usr/bin/perldoc' + diff --git a/.vim/after/syntax/perl/workarounds.vim b/.vim/after/syntax/perl/workarounds.vim new file mode 100644 index 0000000..dcf608f --- /dev/null +++ b/.vim/after/syntax/perl/workarounds.vim @@ -0,0 +1 @@ +hi! def link perlSubPrototypeError perlSubPrototype diff --git a/.vim/after/syntax/python.vim b/.vim/after/syntax/python.vim new file mode 100644 index 0000000..1384f99 --- /dev/null +++ b/.vim/after/syntax/python.vim @@ -0,0 +1,43 @@ +set tabstop=4 +set expandtab +set tw=0 + +" we need the conceal feature (vim ≥ 7.3) +if !has('conceal') + finish +endif + +" remove the keywords. we'll re-add them below +syntax clear pythonOperator + +syntax match pythonOperator "\" + +syntax match pyNiceOperator "\" conceal cchar=∀ +syntax match pyNiceOperator "\" conceal cchar=∈ +syntax match pyNiceOperator "\" conceal cchar=∨ +syntax match pyNiceOperator "\" conceal cchar=∧ +" include the space after “not” – if present – so that “not a” becomes “¬a”. +" also, don't hide “not” behind ‘¬’ if it is after “is ”. +syntax match pyNiceOperator "\%(is \)\@\)" conceal cchar=¬ +syntax match pyNiceOperator "\" conceal cchar=∉ +syntax match pyNiceOperator "<=" conceal cchar=≤ +syntax match pyNiceOperator ">=" conceal cchar=≥ +" only conceal “==” if alone, to avoid concealing SCM conflict markers +syntax match pyNiceOperator "=\@" conceal cchar=√ +syntax match pyNiceKeyword "\<\%(math\.\)\?pi\>" conceal cchar=π + +syntax keyword pyNiceStatement lambda conceal cchar=λ + + + +hi link pyNiceOperator Operator +hi link pyNiceStatement Statement +hi link pyNiceKeyword Keyword +hi! link Conceal Operator + +setlocal conceallevel=2 +setlocal concealcursor=i diff --git a/.vim/after/syntax/ruby/settings.vim b/.vim/after/syntax/ruby/settings.vim new file mode 100644 index 0000000..b4e8cc8 --- /dev/null +++ b/.vim/after/syntax/ruby/settings.vim @@ -0,0 +1,3 @@ +set expandtab +set tabstop=2 shiftwidth=2 softtabstop=2 +set autoindent diff --git a/.vim/after/syntax/sh/settings.vim b/.vim/after/syntax/sh/settings.vim new file mode 100644 index 0000000..3fd8d29 --- /dev/null +++ b/.vim/after/syntax/sh/settings.vim @@ -0,0 +1 @@ +set formatoptions=tqron1 diff --git a/.vim/autoload/AnsiEsc.vim b/.vim/autoload/AnsiEsc.vim new file mode 100644 index 0000000..be4fa5e --- /dev/null +++ b/.vim/autoload/AnsiEsc.vim @@ -0,0 +1,848 @@ +" AnsiEsc.vim: Uses syntax highlighting. A vim 7.0 plugin! +" Language: Text with ansi escape sequences +" Maintainer: Charles E. Campbell +" Version: 12 +" Date: Dec 13, 2010 +" +" Usage: :AnsiEsc +" +" Note: this plugin requires Vince Negri's conceal-ownsyntax patch +" See http://groups.google.com/group/vim_dev/web/vim-patches, Patch#14 +" +" GetLatestVimScripts: 302 1 :AutoInstall: AnsiEsc.vim +"redraw!|call DechoSep()|call inputsave()|call input("Press to continue")|call inputrestore() +" --------------------------------------------------------------------- +"DechoTabOn +" Load Once: {{{1 +if exists("g:loaded_AnsiEsc") + finish +endif +let g:loaded_AnsiEsc = "v12" +if v:version < 700 + echohl WarningMsg + echo "***warning*** this version of AnsiEsc needs vim 7.0" + echohl Normal + finish +endif +let s:keepcpo= &cpo +set cpo&vim + +" --------------------------------------------------------------------- +" AnsiEsc#AnsiEsc: toggles ansi-escape code visualization {{{2 +fun! AnsiEsc#AnsiEsc(rebuild) +" call Dfunc("AnsiEsc#AnsiEsc(rebuild=".a:rebuild.")") + if a:rebuild +" call Decho("rebuilding AnsiEsc tables") + call AnsiEsc#AnsiEsc(0) + call AnsiEsc#AnsiEsc(0) +" call Dret("AnsiEsc#AnsiEsc") + return + endif + let bn= bufnr("%") + if !exists("s:AnsiEsc_enabled_{bn}") + let s:AnsiEsc_enabled_{bn}= 0 + endif + if s:AnsiEsc_enabled_{bn} + " disable AnsiEsc highlighting +" call Decho("disable AnsiEsc highlighting: s:AnsiEsc_ft_".bn."<".s:AnsiEsc_ft_{bn}."> bn#".bn) + if exists("g:colors_name")|let colorname= g:colors_name|endif + if exists("s:conckeep_{bufnr('%')}")|let &l:conc= s:conckeep_{bufnr('%')}|unlet s:conckeep_{bufnr('%')}|endif + if exists("s:colekeep_{bufnr('%')}")|let &l:cole= s:colekeep_{bufnr('%')}|unlet s:colekeep_{bufnr('%')}|endif + if exists("s:cocukeep_{bufnr('%')}")|let &l:cocu= s:cocukeep_{bufnr('%')}|unlet s:cocukeep_{bufnr('%')}|endif + hi! link ansiStop NONE + syn clear + hi clear + syn reset + exe "set ft=".s:AnsiEsc_ft_{bn} + if exists("colorname")|exe "colors ".colorname|endif + let s:AnsiEsc_enabled_{bn}= 0 + if has("gui_running") && has("menu") && &go =~ 'm' + " menu support + exe 'silent! unmenu '.g:DrChipTopLvlMenu.'AnsiEsc' + exe 'menu '.g:DrChipTopLvlMenu.'AnsiEsc.Start:AnsiEsc :AnsiEsc' + endif + let &l:hl= s:hlkeep_{bufnr("%")} +" call Dret("AnsiEsc#AnsiEsc") + return + else + let s:AnsiEsc_ft_{bn} = &ft + let s:AnsiEsc_enabled_{bn} = 1 +" call Decho("enable AnsiEsc highlighting: s:AnsiEsc_ft_".bn."<".s:AnsiEsc_ft_{bn}."> bn#".bn) + if has("gui_running") && has("menu") && &go =~ 'm' + " menu support + exe 'silent! unmenu '.g:DrChipTopLvlMenu.'AnsiEsc' + exe 'menu '.g:DrChipTopLvlMenu.'AnsiEsc.Stop:AnsiEsc :AnsiEsc' + endif + + " ----------------- + " Conceal Support: {{{2 + " ----------------- + if has("conceal") + if v:version < 703 + if &l:conc != 3 + let s:conckeep_{bufnr('%')}= &cole + setlocal conc=3 +" call Decho("l:conc=".&l:conc) + endif + else + if &l:cole != 3 || &l:cocu != "nv" + let s:colekeep_{bufnr('%')}= &l:cole + let s:cocukeep_{bufnr('%')}= &l:cocu + setlocal cole=3 cocu=nv +" call Decho("l:cole=".&l:cole." l:cocu=".&l:cocu) + endif + endif + endif + endif + + syn clear + + " suppress escaped sequences that don't involve colors (which may or may not be ansi-compliant) + if has("conceal") + syn match ansiSuppress conceal '\e\[[0-9;]*[^m]' + syn match ansiSuppress conceal '\e\[?\d*[^m]' + syn match ansiSuppress conceal '\b' + else + syn match ansiSuppress '\e\[[0-9;]*[^m]' + syn match ansiSuppress conceal '\e\[?\d*[^m]' + syn match ansiSuppress '\b' + endif + + " ------------------------------ + " Ansi Escape Sequence Handling: {{{2 + " ------------------------------ + syn region ansiNone start="\e\[[01;]m" end="\e\["me=e-2 contains=ansiConceal + syn region ansiNone start="\e\[m" end="\e\["me=e-2 contains=ansiConceal + + syn region ansiBlack start="\e\[;\=0\{0,2};\=30m" end="\e\["me=e-2 contains=ansiConceal + syn region ansiRed start="\e\[;\=0\{0,2};\=31m" end="\e\["me=e-2 contains=ansiConceal + syn region ansiGreen start="\e\[;\=0\{0,2};\=32m" end="\e\["me=e-2 contains=ansiConceal + syn region ansiYellow start="\e\[;\=0\{0,2};\=33m" end="\e\["me=e-2 contains=ansiConceal + syn region ansiBlue start="\e\[;\=0\{0,2};\=34m" end="\e\["me=e-2 contains=ansiConceal + syn region ansiMagenta start="\e\[;\=0\{0,2};\=35m" end="\e\["me=e-2 contains=ansiConceal + syn region ansiCyan start="\e\[;\=0\{0,2};\=36m" end="\e\["me=e-2 contains=ansiConceal + syn region ansiWhite start="\e\[;\=0\{0,2};\=37m" end="\e\["me=e-2 contains=ansiConceal + + syn region ansiBlackBg start="\e\[;\=0\{0,2};\=\%(1;\)\=40\%(1;\)\=m" end="\e\["me=e-2 contains=ansiConceal + syn region ansiRedBg start="\e\[;\=0\{0,2};\=\%(1;\)\=41\%(1;\)\=m" end="\e\["me=e-2 contains=ansiConceal + syn region ansiGreenBg start="\e\[;\=0\{0,2};\=\%(1;\)\=42\%(1;\)\=m" end="\e\["me=e-2 contains=ansiConceal + syn region ansiYellowBg start="\e\[;\=0\{0,2};\=\%(1;\)\=43\%(1;\)\=m" end="\e\["me=e-2 contains=ansiConceal + syn region ansiBlueBg start="\e\[;\=0\{0,2};\=\%(1;\)\=44\%(1;\)\=m" end="\e\["me=e-2 contains=ansiConceal + syn region ansiMagentaBg start="\e\[;\=0\{0,2};\=\%(1;\)\=45\%(1;\)\=m" end="\e\["me=e-2 contains=ansiConceal + syn region ansiCyanBg start="\e\[;\=0\{0,2};\=\%(1;\)\=46\%(1;\)\=m" end="\e\["me=e-2 contains=ansiConceal + syn region ansiWhiteBg start="\e\[;\=0\{0,2};\=\%(1;\)\=47\%(1;\)\=m" end="\e\["me=e-2 contains=ansiConceal + + syn region ansiBoldBlack start="\e\[;\=0\{0,2};\=\%(1;30\|30;1\)m" end="\e\["me=e-2 contains=ansiConceal + syn region ansiBoldRed start="\e\[;\=0\{0,2};\=\%(1;31\|31;1\)m" end="\e\["me=e-2 contains=ansiConceal + syn region ansiBoldGreen start="\e\[;\=0\{0,2};\=\%(1;32\|32;1\)m" end="\e\["me=e-2 contains=ansiConceal + syn region ansiBoldYellow start="\e\[;\=0\{0,2};\=\%(1;33\|33;1\)m" end="\e\["me=e-2 contains=ansiConceal + syn region ansiBoldBlue start="\e\[;\=0\{0,2};\=\%(1;34\|34;1\)m" end="\e\["me=e-2 contains=ansiConceal + syn region ansiBoldMagenta start="\e\[;\=0\{0,2};\=\%(1;35\|35;1\)m" end="\e\["me=e-2 contains=ansiConceal + syn region ansiBoldCyan start="\e\[;\=0\{0,2};\=\%(1;36\|36;1\)m" end="\e\["me=e-2 contains=ansiConceal + syn region ansiBoldWhite start="\e\[;\=0\{0,2};\=\%(1;37\|37;1\)m" end="\e\["me=e-2 contains=ansiConceal + + syn region ansiStandoutBlack start="\e\[;\=0\{0,2};\=\%(1;\)\=\%(3;30\|30;3\)m" end="\e\["me=e-2 contains=ansiConceal + syn region ansiStandoutRed start="\e\[;\=0\{0,2};\=\%(1;\)\=\%(3;31\|31;3\)m" end="\e\["me=e-2 contains=ansiConceal + syn region ansiStandoutGreen start="\e\[;\=0\{0,2};\=\%(1;\)\=\%(3;32\|32;3\)m" end="\e\["me=e-2 contains=ansiConceal + syn region ansiStandoutYellow start="\e\[;\=0\{0,2};\=\%(1;\)\=\%(3;33\|33;3\)m" end="\e\["me=e-2 contains=ansiConceal + syn region ansiStandoutBlue start="\e\[;\=0\{0,2};\=\%(1;\)\=\%(3;34\|34;3\)m" end="\e\["me=e-2 contains=ansiConceal + syn region ansiStandoutMagenta start="\e\[;\=0\{0,2};\=\%(1;\)\=\%(3;35\|35;3\)m" end="\e\["me=e-2 contains=ansiConceal + syn region ansiStandoutCyan start="\e\[;\=0\{0,2};\=\%(1;\)\=\%(3;36\|36;3\)m" end="\e\["me=e-2 contains=ansiConceal + syn region ansiStandoutWhite start="\e\[;\=0\{0,2};\=\%(1;\)\=\%(3;37\|37;3\)m" end="\e\["me=e-2 contains=ansiConceal + + syn region ansiItalicBlack start="\e\[;\=0\{0,2};\=\%(1;\)\=\%(2;30\|30;2\)m" end="\e\["me=e-2 contains=ansiConceal + syn region ansiItalicRed start="\e\[;\=0\{0,2};\=\%(1;\)\=\%(2;31\|31;2\)m" end="\e\["me=e-2 contains=ansiConceal + syn region ansiItalicGreen start="\e\[;\=0\{0,2};\=\%(1;\)\=\%(2;32\|32;2\)m" end="\e\["me=e-2 contains=ansiConceal + syn region ansiItalicYellow start="\e\[;\=0\{0,2};\=\%(1;\)\=\%(2;33\|33;2\)m" end="\e\["me=e-2 contains=ansiConceal + syn region ansiItalicBlue start="\e\[;\=0\{0,2};\=\%(1;\)\=\%(2;34\|34;2\)m" end="\e\["me=e-2 contains=ansiConceal + syn region ansiItalicMagenta start="\e\[;\=0\{0,2};\=\%(1;\)\=\%(2;35\|35;2\)m" end="\e\["me=e-2 contains=ansiConceal + syn region ansiItalicCyan start="\e\[;\=0\{0,2};\=\%(1;\)\=\%(2;36\|36;2\)m" end="\e\["me=e-2 contains=ansiConceal + syn region ansiItalicWhite start="\e\[;\=0\{0,2};\=\%(1;\)\=\%(2;37\|37;2\)m" end="\e\["me=e-2 contains=ansiConceal + + syn region ansiUnderlineBlack start="\e\[;\=0\{0,2};\=\%(1;\)\=\%(4;30\|30;4\)m" end="\e\["me=e-2 contains=ansiConceal + syn region ansiUnderlineRed start="\e\[;\=0\{0,2};\=\%(1;\)\=\%(4;31\|31;4\)m" end="\e\["me=e-2 contains=ansiConceal + syn region ansiUnderlineGreen start="\e\[;\=0\{0,2};\=\%(1;\)\=\%(4;32\|32;4\)m" end="\e\["me=e-2 contains=ansiConceal + syn region ansiUnderlineYellow start="\e\[;\=0\{0,2};\=\%(1;\)\=\%(4;33\|33;4\)m" end="\e\["me=e-2 contains=ansiConceal + syn region ansiUnderlineBlue start="\e\[;\=0\{0,2};\=\%(1;\)\=\%(4;34\|34;4\)m" end="\e\["me=e-2 contains=ansiConceal + syn region ansiUnderlineMagenta start="\e\[;\=0\{0,2};\=\%(1;\)\=\%(4;35\|35;4\)m" end="\e\["me=e-2 contains=ansiConceal + syn region ansiUnderlineCyan start="\e\[;\=0\{0,2};\=\%(1;\)\=\%(4;36\|36;4\)m" end="\e\["me=e-2 contains=ansiConceal + syn region ansiUnderlineWhite start="\e\[;\=0\{0,2};\=\%(1;\)\=\%(4;37\|37;4\)m" end="\e\["me=e-2 contains=ansiConceal + + syn region ansiBlinkBlack start="\e\[;\=0\{0,2};\=\%(1;\)\=\%(5;30\|30;5\)m" end="\e\["me=e-2 contains=ansiConceal + syn region ansiBlinkRed start="\e\[;\=0\{0,2};\=\%(1;\)\=\%(5;31\|31;5\)m" end="\e\["me=e-2 contains=ansiConceal + syn region ansiBlinkGreen start="\e\[;\=0\{0,2};\=\%(1;\)\=\%(5;32\|32;5\)m" end="\e\["me=e-2 contains=ansiConceal + syn region ansiBlinkYellow start="\e\[;\=0\{0,2};\=\%(1;\)\=\%(5;33\|33;5\)m" end="\e\["me=e-2 contains=ansiConceal + syn region ansiBlinkBlue start="\e\[;\=0\{0,2};\=\%(1;\)\=\%(5;34\|34;5\)m" end="\e\["me=e-2 contains=ansiConceal + syn region ansiBlinkMagenta start="\e\[;\=0\{0,2};\=\%(1;\)\=\%(5;35\|35;5\)m" end="\e\["me=e-2 contains=ansiConceal + syn region ansiBlinkCyan start="\e\[;\=0\{0,2};\=\%(1;\)\=\%(5;36\|36;5\)m" end="\e\["me=e-2 contains=ansiConceal + syn region ansiBlinkWhite start="\e\[;\=0\{0,2};\=\%(1;\)\=\%(5;37\|37;5\)m" end="\e\["me=e-2 contains=ansiConceal + + syn region ansiRapidBlinkBlack start="\e\[;\=0\{0,2};\=\%(1;\)\=\%(6;30\|30;6\)m" end="\e\["me=e-2 contains=ansiConceal + syn region ansiRapidBlinkRed start="\e\[;\=0\{0,2};\=\%(1;\)\=\%(6;31\|31;6\)m" end="\e\["me=e-2 contains=ansiConceal + syn region ansiRapidBlinkGreen start="\e\[;\=0\{0,2};\=\%(1;\)\=\%(6;32\|32;6\)m" end="\e\["me=e-2 contains=ansiConceal + syn region ansiRapidBlinkYellow start="\e\[;\=0\{0,2};\=\%(1;\)\=\%(6;33\|33;6\)m" end="\e\["me=e-2 contains=ansiConceal + syn region ansiRapidBlinkBlue start="\e\[;\=0\{0,2};\=\%(1;\)\=\%(6;34\|34;6\)m" end="\e\["me=e-2 contains=ansiConceal + syn region ansiRapidBlinkMagenta start="\e\[;\=0\{0,2};\=\%(1;\)\=\%(6;35\|35;6\)m" end="\e\["me=e-2 contains=ansiConceal + syn region ansiRapidBlinkCyan start="\e\[;\=0\{0,2};\=\%(1;\)\=\%(6;36\|36;6\)m" end="\e\["me=e-2 contains=ansiConceal + syn region ansiRapidBlinkWhite start="\e\[;\=0\{0,2};\=\%(1;\)\=\%(6;37\|37;6\)m" end="\e\["me=e-2 contains=ansiConceal + + syn region ansiRVBlack start="\e\[;\=0\{0,2};\=\%(1;\)\=\%(7;30\|30;7\)m" end="\e\["me=e-2 contains=ansiConceal + syn region ansiRVRed start="\e\[;\=0\{0,2};\=\%(1;\)\=\%(7;31\|31;7\)m" end="\e\["me=e-2 contains=ansiConceal + syn region ansiRVGreen start="\e\[;\=0\{0,2};\=\%(1;\)\=\%(7;32\|32;7\)m" end="\e\["me=e-2 contains=ansiConceal + syn region ansiRVYellow start="\e\[;\=0\{0,2};\=\%(1;\)\=\%(7;33\|33;7\)m" end="\e\["me=e-2 contains=ansiConceal + syn region ansiRVBlue start="\e\[;\=0\{0,2};\=\%(1;\)\=\%(7;34\|34;7\)m" end="\e\["me=e-2 contains=ansiConceal + syn region ansiRVMagenta start="\e\[;\=0\{0,2};\=\%(1;\)\=\%(7;35\|35;7\)m" end="\e\["me=e-2 contains=ansiConceal + syn region ansiRVCyan start="\e\[;\=0\{0,2};\=\%(1;\)\=\%(7;36\|36;7\)m" end="\e\["me=e-2 contains=ansiConceal + syn region ansiRVWhite start="\e\[;\=0\{0,2};\=\%(1;\)\=\%(7;37\|37;7\)m" end="\e\["me=e-2 contains=ansiConceal + + if has("conceal") + syn match ansiStop conceal "\e\[;\=0\{1,2}m" + syn match ansiStop conceal "\e\[K" + syn match ansiStop conceal "\e\[H" + syn match ansiStop conceal "\e\[2J" + else + syn match ansiStop "\e\[;\=0\{0,2}m" + syn match ansiStop "\e\[K" + syn match ansiStop "\e\[H" + syn match ansiStop "\e\[2J" + endif + + "syn match ansiIgnore conceal "\e\[\([56];3[0-9]\|3[0-9];[56]\)m" + "syn match ansiIgnore conceal "\e\[\([0-9]\+;\)\{2,}[0-9]\+m" + + " --------------------------------------------------------------------- + " Some Color Combinations: - can't do 'em all, the qty of highlighting groups is limited! {{{2 + " --------------------------------------------------------------------- + syn region ansiBlackBlack start="\e\[0\{0,2};\=\(30;40\|40;30\)m" end="\e\["me=e-2 contains=ansiConceal + syn region ansiRedBlack start="\e\[0\{0,2};\=\(31;40\|40;31\)m" end="\e\["me=e-2 contains=ansiConceal + syn region ansiGreenBlack start="\e\[0\{0,2};\=\(32;40\|40;32\)m" end="\e\["me=e-2 contains=ansiConceal + syn region ansiYellowBlack start="\e\[0\{0,2};\=\(33;40\|40;33\)m" end="\e\["me=e-2 contains=ansiConceal + syn region ansiBlueBlack start="\e\[0\{0,2};\=\(34;40\|40;34\)m" end="\e\["me=e-2 contains=ansiConceal + syn region ansiMagentaBlack start="\e\[0\{0,2};\=\(35;40\|40;35\)m" end="\e\["me=e-2 contains=ansiConceal + syn region ansiCyanBlack start="\e\[0\{0,2};\=\(36;40\|40;36\)m" end="\e\["me=e-2 contains=ansiConceal + syn region ansiWhiteBlack start="\e\[0\{0,2};\=\(37;40\|40;37\)m" end="\e\["me=e-2 contains=ansiConceal + + syn region ansiBlackRed start="\e\[0\{0,2};\=\(30;41\|41;30\)m" end="\e\["me=e-2 contains=ansiConceal + syn region ansiRedRed start="\e\[0\{0,2};\=\(31;41\|41;31\)m" end="\e\["me=e-2 contains=ansiConceal + syn region ansiGreenRed start="\e\[0\{0,2};\=\(32;41\|41;32\)m" end="\e\["me=e-2 contains=ansiConceal + syn region ansiYellowRed start="\e\[0\{0,2};\=\(33;41\|41;33\)m" end="\e\["me=e-2 contains=ansiConceal + syn region ansiBlueRed start="\e\[0\{0,2};\=\(34;41\|41;34\)m" end="\e\["me=e-2 contains=ansiConceal + syn region ansiMagentaRed start="\e\[0\{0,2};\=\(35;41\|41;35\)m" end="\e\["me=e-2 contains=ansiConceal + syn region ansiCyanRed start="\e\[0\{0,2};\=\(36;41\|41;36\)m" end="\e\["me=e-2 contains=ansiConceal + syn region ansiWhiteRed start="\e\[0\{0,2};\=\(37;41\|41;37\)m" end="\e\["me=e-2 contains=ansiConceal + + syn region ansiBlackGreen start="\e\[0\{0,2};\=\(30;42\|42;30\)m" end="\e\["me=e-2 contains=ansiConceal + syn region ansiRedGreen start="\e\[0\{0,2};\=\(31;42\|42;31\)m" end="\e\["me=e-2 contains=ansiConceal + syn region ansiGreenGreen start="\e\[0\{0,2};\=\(32;42\|42;32\)m" end="\e\["me=e-2 contains=ansiConceal + syn region ansiYellowGreen start="\e\[0\{0,2};\=\(33;42\|42;33\)m" end="\e\["me=e-2 contains=ansiConceal + syn region ansiBlueGreen start="\e\[0\{0,2};\=\(34;42\|42;34\)m" end="\e\["me=e-2 contains=ansiConceal + syn region ansiMagentaGreen start="\e\[0\{0,2};\=\(35;42\|42;35\)m" end="\e\["me=e-2 contains=ansiConceal + syn region ansiCyanGreen start="\e\[0\{0,2};\=\(36;42\|42;36\)m" end="\e\["me=e-2 contains=ansiConceal + syn region ansiWhiteGreen start="\e\[0\{0,2};\=\(37;42\|42;37\)m" end="\e\["me=e-2 contains=ansiConceal + + syn region ansiBlackYellow start="\e\[0\{0,2};\=\(30;43\|43;30\)m" end="\e\["me=e-2 contains=ansiConceal + syn region ansiRedYellow start="\e\[0\{0,2};\=\(31;43\|43;31\)m" end="\e\["me=e-2 contains=ansiConceal + syn region ansiGreenYellow start="\e\[0\{0,2};\=\(32;43\|43;32\)m" end="\e\["me=e-2 contains=ansiConceal + syn region ansiYellowYellow start="\e\[0\{0,2};\=\(33;43\|43;33\)m" end="\e\["me=e-2 contains=ansiConceal + syn region ansiBlueYellow start="\e\[0\{0,2};\=\(34;43\|43;34\)m" end="\e\["me=e-2 contains=ansiConceal + syn region ansiMagentaYellow start="\e\[0\{0,2};\=\(35;43\|43;35\)m" end="\e\["me=e-2 contains=ansiConceal + syn region ansiCyanYellow start="\e\[0\{0,2};\=\(36;43\|43;36\)m" end="\e\["me=e-2 contains=ansiConceal + syn region ansiWhiteYellow start="\e\[0\{0,2};\=\(37;43\|43;37\)m" end="\e\["me=e-2 contains=ansiConceal + + syn region ansiBlackBlue start="\e\[0\{0,2};\=\(30;44\|44;30\)m" end="\e\["me=e-2 contains=ansiConceal + syn region ansiRedBlue start="\e\[0\{0,2};\=\(31;44\|44;31\)m" end="\e\["me=e-2 contains=ansiConceal + syn region ansiGreenBlue start="\e\[0\{0,2};\=\(32;44\|44;32\)m" end="\e\["me=e-2 contains=ansiConceal + syn region ansiYellowBlue start="\e\[0\{0,2};\=\(33;44\|44;33\)m" end="\e\["me=e-2 contains=ansiConceal + syn region ansiBlueBlue start="\e\[0\{0,2};\=\(34;44\|44;34\)m" end="\e\["me=e-2 contains=ansiConceal + syn region ansiMagentaBlue start="\e\[0\{0,2};\=\(35;44\|44;35\)m" end="\e\["me=e-2 contains=ansiConceal + syn region ansiCyanBlue start="\e\[0\{0,2};\=\(36;44\|44;36\)m" end="\e\["me=e-2 contains=ansiConceal + syn region ansiWhiteBlue start="\e\[0\{0,2};\=\(37;44\|44;37\)m" end="\e\["me=e-2 contains=ansiConceal + + syn region ansiBlackMagenta start="\e\[0\{0,2};\=\(30;45\|45;30\)m" end="\e\["me=e-2 contains=ansiConceal + syn region ansiRedMagenta start="\e\[0\{0,2};\=\(31;45\|45;31\)m" end="\e\["me=e-2 contains=ansiConceal + syn region ansiGreenMagenta start="\e\[0\{0,2};\=\(32;45\|45;32\)m" end="\e\["me=e-2 contains=ansiConceal + syn region ansiYellowMagenta start="\e\[0\{0,2};\=\(33;45\|45;33\)m" end="\e\["me=e-2 contains=ansiConceal + syn region ansiBlueMagenta start="\e\[0\{0,2};\=\(34;45\|45;34\)m" end="\e\["me=e-2 contains=ansiConceal + syn region ansiMagentaMagenta start="\e\[0\{0,2};\=\(35;45\|45;35\)m" end="\e\["me=e-2 contains=ansiConceal + syn region ansiCyanMagenta start="\e\[0\{0,2};\=\(36;45\|45;36\)m" end="\e\["me=e-2 contains=ansiConceal + syn region ansiWhiteMagenta start="\e\[0\{0,2};\=\(37;45\|45;37\)m" end="\e\["me=e-2 contains=ansiConceal + + syn region ansiBlackCyan start="\e\[0\{0,2};\=\(30;46\|46;30\)m" end="\e\["me=e-2 contains=ansiConceal + syn region ansiRedCyan start="\e\[0\{0,2};\=\(31;46\|46;31\)m" end="\e\["me=e-2 contains=ansiConceal + syn region ansiGreenCyan start="\e\[0\{0,2};\=\(32;46\|46;32\)m" end="\e\["me=e-2 contains=ansiConceal + syn region ansiYellowCyan start="\e\[0\{0,2};\=\(33;46\|46;33\)m" end="\e\["me=e-2 contains=ansiConceal + syn region ansiBlueCyan start="\e\[0\{0,2};\=\(34;46\|46;34\)m" end="\e\["me=e-2 contains=ansiConceal + syn region ansiMagentaCyan start="\e\[0\{0,2};\=\(35;46\|46;35\)m" end="\e\["me=e-2 contains=ansiConceal + syn region ansiCyanCyan start="\e\[0\{0,2};\=\(36;46\|46;36\)m" end="\e\["me=e-2 contains=ansiConceal + syn region ansiWhiteCyan start="\e\[0\{0,2};\=\(37;46\|46;37\)m" end="\e\["me=e-2 contains=ansiConceal + + syn region ansiBlackWhite start="\e\[0\{0,2};\=\(30;47\|47;30\)m" end="\e\["me=e-2 contains=ansiConceal + syn region ansiRedWhite start="\e\[0\{0,2};\=\(31;47\|47;31\)m" end="\e\["me=e-2 contains=ansiConceal + syn region ansiGreenWhite start="\e\[0\{0,2};\=\(32;47\|47;32\)m" end="\e\["me=e-2 contains=ansiConceal + syn region ansiYellowWhite start="\e\[0\{0,2};\=\(33;47\|47;33\)m" end="\e\["me=e-2 contains=ansiConceal + syn region ansiBlueWhite start="\e\[0\{0,2};\=\(34;47\|47;34\)m" end="\e\["me=e-2 contains=ansiConceal + syn region ansiMagentaWhite start="\e\[0\{0,2};\=\(35;47\|47;35\)m" end="\e\["me=e-2 contains=ansiConceal + syn region ansiCyanWhite start="\e\[0\{0,2};\=\(36;47\|47;36\)m" end="\e\["me=e-2 contains=ansiConceal + syn region ansiWhiteWhite start="\e\[0\{0,2};\=\(37;47\|47;37\)m" end="\e\["me=e-2 contains=ansiConceal + + syn match ansiExtended "\e\[;\=\(0;\)\=[34]8;\(\d*;\)*\d*m" contains=ansiConceal + + if has("conceal") + syn match ansiConceal contained conceal "\e\[\(\d*;\)*\d*m" + else + syn match ansiConceal contained "\e\[\(\d*;\)*\d*m" + endif + + " ------------- + " Highlighting: {{{2 + " ------------- + if !has("conceal") + " -------------- + " ansiesc_ignore: {{{3 + " -------------- + hi def link ansiConceal Ignore + hi def link ansiSuppress Ignore + hi def link ansiIgnore ansiStop + hi def link ansiStop Ignore + hi def link ansiExtended Ignore + endif + let s:hlkeep_{bufnr("%")}= &l:hl + exe "setlocal hl=".substitute(&hl,'8:[^,]\{-},','8:Ignore,',"") + + " handle 3 or more element ansi escape sequences by building syntax and highlighting rules + " specific to the current file + call s:MultiElementHandler() + + hi ansiNone cterm=NONE gui=NONE + + if &t_Co == 8 || &t_Co == 256 + " --------------------- + " eight-color handling: {{{3 + " --------------------- +" call Decho("set up 8-color highlighting groups") + hi ansiBlack ctermfg=black guifg=black cterm=none gui=none + hi ansiRed ctermfg=red guifg=red cterm=none gui=none + hi ansiGreen ctermfg=green guifg=green cterm=none gui=none + hi ansiYellow ctermfg=yellow guifg=yellow cterm=none gui=none + hi ansiBlue ctermfg=blue guifg=blue cterm=none gui=none + hi ansiMagenta ctermfg=magenta guifg=magenta cterm=none gui=none + hi ansiCyan ctermfg=cyan guifg=cyan cterm=none gui=none + hi ansiWhite ctermfg=white guifg=white cterm=none gui=none + + hi ansiBlackBg ctermbg=black guibg=black cterm=none gui=none + hi ansiRedBg ctermbg=red guibg=red cterm=none gui=none + hi ansiGreenBg ctermbg=green guibg=green cterm=none gui=none + hi ansiYellowBg ctermbg=yellow guibg=yellow cterm=none gui=none + hi ansiBlueBg ctermbg=blue guibg=blue cterm=none gui=none + hi ansiMagentaBg ctermbg=magenta guibg=magenta cterm=none gui=none + hi ansiCyanBg ctermbg=cyan guibg=cyan cterm=none gui=none + hi ansiWhiteBg ctermbg=white guibg=white cterm=none gui=none + + hi ansiBoldBlack ctermfg=black guifg=black cterm=bold gui=bold + hi ansiBoldRed ctermfg=red guifg=red cterm=bold gui=bold + hi ansiBoldGreen ctermfg=green guifg=green cterm=bold gui=bold + hi ansiBoldYellow ctermfg=yellow guifg=yellow cterm=bold gui=bold + hi ansiBoldBlue ctermfg=blue guifg=blue cterm=bold gui=bold + hi ansiBoldMagenta ctermfg=magenta guifg=magenta cterm=bold gui=bold + hi ansiBoldCyan ctermfg=cyan guifg=cyan cterm=bold gui=bold + hi ansiBoldWhite ctermfg=white guifg=white cterm=bold gui=bold + + hi ansiStandoutBlack ctermfg=black guifg=black cterm=standout gui=standout + hi ansiStandoutRed ctermfg=red guifg=red cterm=standout gui=standout + hi ansiStandoutGreen ctermfg=green guifg=green cterm=standout gui=standout + hi ansiStandoutYellow ctermfg=yellow guifg=yellow cterm=standout gui=standout + hi ansiStandoutBlue ctermfg=blue guifg=blue cterm=standout gui=standout + hi ansiStandoutMagenta ctermfg=magenta guifg=magenta cterm=standout gui=standout + hi ansiStandoutCyan ctermfg=cyan guifg=cyan cterm=standout gui=standout + hi ansiStandoutWhite ctermfg=white guifg=white cterm=standout gui=standout + + hi ansiItalicBlack ctermfg=black guifg=black cterm=italic gui=italic + hi ansiItalicRed ctermfg=red guifg=red cterm=italic gui=italic + hi ansiItalicGreen ctermfg=green guifg=green cterm=italic gui=italic + hi ansiItalicYellow ctermfg=yellow guifg=yellow cterm=italic gui=italic + hi ansiItalicBlue ctermfg=blue guifg=blue cterm=italic gui=italic + hi ansiItalicMagenta ctermfg=magenta guifg=magenta cterm=italic gui=italic + hi ansiItalicCyan ctermfg=cyan guifg=cyan cterm=italic gui=italic + hi ansiItalicWhite ctermfg=white guifg=white cterm=italic gui=italic + + hi ansiUnderlineBlack ctermfg=black guifg=black cterm=underline gui=underline + hi ansiUnderlineRed ctermfg=red guifg=red cterm=underline gui=underline + hi ansiUnderlineGreen ctermfg=green guifg=green cterm=underline gui=underline + hi ansiUnderlineYellow ctermfg=yellow guifg=yellow cterm=underline gui=underline + hi ansiUnderlineBlue ctermfg=blue guifg=blue cterm=underline gui=underline + hi ansiUnderlineMagenta ctermfg=magenta guifg=magenta cterm=underline gui=underline + hi ansiUnderlineCyan ctermfg=cyan guifg=cyan cterm=underline gui=underline + hi ansiUnderlineWhite ctermfg=white guifg=white cterm=underline gui=underline + + hi ansiBlinkBlack ctermfg=black guifg=black cterm=standout gui=undercurl + hi ansiBlinkRed ctermfg=red guifg=red cterm=standout gui=undercurl + hi ansiBlinkGreen ctermfg=green guifg=green cterm=standout gui=undercurl + hi ansiBlinkYellow ctermfg=yellow guifg=yellow cterm=standout gui=undercurl + hi ansiBlinkBlue ctermfg=blue guifg=blue cterm=standout gui=undercurl + hi ansiBlinkMagenta ctermfg=magenta guifg=magenta cterm=standout gui=undercurl + hi ansiBlinkCyan ctermfg=cyan guifg=cyan cterm=standout gui=undercurl + hi ansiBlinkWhite ctermfg=white guifg=white cterm=standout gui=undercurl + + hi ansiRapidBlinkBlack ctermfg=black guifg=black cterm=standout gui=undercurl + hi ansiRapidBlinkRed ctermfg=red guifg=red cterm=standout gui=undercurl + hi ansiRapidBlinkGreen ctermfg=green guifg=green cterm=standout gui=undercurl + hi ansiRapidBlinkYellow ctermfg=yellow guifg=yellow cterm=standout gui=undercurl + hi ansiRapidBlinkBlue ctermfg=blue guifg=blue cterm=standout gui=undercurl + hi ansiRapidBlinkMagenta ctermfg=magenta guifg=magenta cterm=standout gui=undercurl + hi ansiRapidBlinkCyan ctermfg=cyan guifg=cyan cterm=standout gui=undercurl + hi ansiRapidBlinkWhite ctermfg=white guifg=white cterm=standout gui=undercurl + + hi ansiRVBlack ctermfg=black guifg=black cterm=reverse gui=reverse + hi ansiRVRed ctermfg=red guifg=red cterm=reverse gui=reverse + hi ansiRVGreen ctermfg=green guifg=green cterm=reverse gui=reverse + hi ansiRVYellow ctermfg=yellow guifg=yellow cterm=reverse gui=reverse + hi ansiRVBlue ctermfg=blue guifg=blue cterm=reverse gui=reverse + hi ansiRVMagenta ctermfg=magenta guifg=magenta cterm=reverse gui=reverse + hi ansiRVCyan ctermfg=cyan guifg=cyan cterm=reverse gui=reverse + hi ansiRVWhite ctermfg=white guifg=white cterm=reverse gui=reverse + + hi ansiBlackBlack ctermfg=black ctermbg=black guifg=Black guibg=Black cterm=none gui=none + hi ansiRedBlack ctermfg=red ctermbg=black guifg=Red guibg=Black cterm=none gui=none + hi ansiGreenBlack ctermfg=green ctermbg=black guifg=Green guibg=Black cterm=none gui=none + hi ansiYellowBlack ctermfg=yellow ctermbg=black guifg=Yellow guibg=Black cterm=none gui=none + hi ansiBlueBlack ctermfg=blue ctermbg=black guifg=Blue guibg=Black cterm=none gui=none + hi ansiMagentaBlack ctermfg=magenta ctermbg=black guifg=Magenta guibg=Black cterm=none gui=none + hi ansiCyanBlack ctermfg=cyan ctermbg=black guifg=Cyan guibg=Black cterm=none gui=none + hi ansiWhiteBlack ctermfg=white ctermbg=black guifg=White guibg=Black cterm=none gui=none + + hi ansiBlackRed ctermfg=black ctermbg=red guifg=Black guibg=Red cterm=none gui=none + hi ansiRedRed ctermfg=red ctermbg=red guifg=Red guibg=Red cterm=none gui=none + hi ansiGreenRed ctermfg=green ctermbg=red guifg=Green guibg=Red cterm=none gui=none + hi ansiYellowRed ctermfg=yellow ctermbg=red guifg=Yellow guibg=Red cterm=none gui=none + hi ansiBlueRed ctermfg=blue ctermbg=red guifg=Blue guibg=Red cterm=none gui=none + hi ansiMagentaRed ctermfg=magenta ctermbg=red guifg=Magenta guibg=Red cterm=none gui=none + hi ansiCyanRed ctermfg=cyan ctermbg=red guifg=Cyan guibg=Red cterm=none gui=none + hi ansiWhiteRed ctermfg=white ctermbg=red guifg=White guibg=Red cterm=none gui=none + + hi ansiBlackGreen ctermfg=black ctermbg=green guifg=Black guibg=Green cterm=none gui=none + hi ansiRedGreen ctermfg=red ctermbg=green guifg=Red guibg=Green cterm=none gui=none + hi ansiGreenGreen ctermfg=green ctermbg=green guifg=Green guibg=Green cterm=none gui=none + hi ansiYellowGreen ctermfg=yellow ctermbg=green guifg=Yellow guibg=Green cterm=none gui=none + hi ansiBlueGreen ctermfg=blue ctermbg=green guifg=Blue guibg=Green cterm=none gui=none + hi ansiMagentaGreen ctermfg=magenta ctermbg=green guifg=Magenta guibg=Green cterm=none gui=none + hi ansiCyanGreen ctermfg=cyan ctermbg=green guifg=Cyan guibg=Green cterm=none gui=none + hi ansiWhiteGreen ctermfg=white ctermbg=green guifg=White guibg=Green cterm=none gui=none + + hi ansiBlackYellow ctermfg=black ctermbg=yellow guifg=Black guibg=Yellow cterm=none gui=none + hi ansiRedYellow ctermfg=red ctermbg=yellow guifg=Red guibg=Yellow cterm=none gui=none + hi ansiGreenYellow ctermfg=green ctermbg=yellow guifg=Green guibg=Yellow cterm=none gui=none + hi ansiYellowYellow ctermfg=yellow ctermbg=yellow guifg=Yellow guibg=Yellow cterm=none gui=none + hi ansiBlueYellow ctermfg=blue ctermbg=yellow guifg=Blue guibg=Yellow cterm=none gui=none + hi ansiMagentaYellow ctermfg=magenta ctermbg=yellow guifg=Magenta guibg=Yellow cterm=none gui=none + hi ansiCyanYellow ctermfg=cyan ctermbg=yellow guifg=Cyan guibg=Yellow cterm=none gui=none + hi ansiWhiteYellow ctermfg=white ctermbg=yellow guifg=White guibg=Yellow cterm=none gui=none + + hi ansiBlackBlue ctermfg=black ctermbg=blue guifg=Black guibg=Blue cterm=none gui=none + hi ansiRedBlue ctermfg=red ctermbg=blue guifg=Red guibg=Blue cterm=none gui=none + hi ansiGreenBlue ctermfg=green ctermbg=blue guifg=Green guibg=Blue cterm=none gui=none + hi ansiYellowBlue ctermfg=yellow ctermbg=blue guifg=Yellow guibg=Blue cterm=none gui=none + hi ansiBlueBlue ctermfg=blue ctermbg=blue guifg=Blue guibg=Blue cterm=none gui=none + hi ansiMagentaBlue ctermfg=magenta ctermbg=blue guifg=Magenta guibg=Blue cterm=none gui=none + hi ansiCyanBlue ctermfg=cyan ctermbg=blue guifg=Cyan guibg=Blue cterm=none gui=none + hi ansiWhiteBlue ctermfg=white ctermbg=blue guifg=White guibg=Blue cterm=none gui=none + + hi ansiBlackMagenta ctermfg=black ctermbg=magenta guifg=Black guibg=Magenta cterm=none gui=none + hi ansiRedMagenta ctermfg=red ctermbg=magenta guifg=Red guibg=Magenta cterm=none gui=none + hi ansiGreenMagenta ctermfg=green ctermbg=magenta guifg=Green guibg=Magenta cterm=none gui=none + hi ansiYellowMagenta ctermfg=yellow ctermbg=magenta guifg=Yellow guibg=Magenta cterm=none gui=none + hi ansiBlueMagenta ctermfg=blue ctermbg=magenta guifg=Blue guibg=Magenta cterm=none gui=none + hi ansiMagentaMagenta ctermfg=magenta ctermbg=magenta guifg=Magenta guibg=Magenta cterm=none gui=none + hi ansiCyanMagenta ctermfg=cyan ctermbg=magenta guifg=Cyan guibg=Magenta cterm=none gui=none + hi ansiWhiteMagenta ctermfg=white ctermbg=magenta guifg=White guibg=Magenta cterm=none gui=none + + hi ansiBlackCyan ctermfg=black ctermbg=cyan guifg=Black guibg=Cyan cterm=none gui=none + hi ansiRedCyan ctermfg=red ctermbg=cyan guifg=Red guibg=Cyan cterm=none gui=none + hi ansiGreenCyan ctermfg=green ctermbg=cyan guifg=Green guibg=Cyan cterm=none gui=none + hi ansiYellowCyan ctermfg=yellow ctermbg=cyan guifg=Yellow guibg=Cyan cterm=none gui=none + hi ansiBlueCyan ctermfg=blue ctermbg=cyan guifg=Blue guibg=Cyan cterm=none gui=none + hi ansiMagentaCyan ctermfg=magenta ctermbg=cyan guifg=Magenta guibg=Cyan cterm=none gui=none + hi ansiCyanCyan ctermfg=cyan ctermbg=cyan guifg=Cyan guibg=Cyan cterm=none gui=none + hi ansiWhiteCyan ctermfg=white ctermbg=cyan guifg=White guibg=Cyan cterm=none gui=none + + hi ansiBlackWhite ctermfg=black ctermbg=white guifg=Black guibg=White cterm=none gui=none + hi ansiRedWhite ctermfg=red ctermbg=white guifg=Red guibg=White cterm=none gui=none + hi ansiGreenWhite ctermfg=green ctermbg=white guifg=Green guibg=White cterm=none gui=none + hi ansiYellowWhite ctermfg=yellow ctermbg=white guifg=Yellow guibg=White cterm=none gui=none + hi ansiBlueWhite ctermfg=blue ctermbg=white guifg=Blue guibg=White cterm=none gui=none + hi ansiMagentaWhite ctermfg=magenta ctermbg=white guifg=Magenta guibg=White cterm=none gui=none + hi ansiCyanWhite ctermfg=cyan ctermbg=white guifg=Cyan guibg=White cterm=none gui=none + hi ansiWhiteWhite ctermfg=white ctermbg=white guifg=White guibg=White cterm=none gui=none + + if v:version >= 700 && exists("&t_Co") && &t_Co == 256 && exists("g:ansiesc_256color") + " --------------------------- + " handle 256-color terminals: {{{3 + " --------------------------- +" call Decho("set up 256-color highlighting groups") + let icolor= 1 + while icolor < 256 + let jcolor= 1 + exe "hi ansiHL_".icolor."_0 ctermfg=".icolor + exe "hi ansiHL_0_".icolor." ctermbg=".icolor +" call Decho("exe hi ansiHL_".icolor." ctermfg=".icolor) + while jcolor < 256 + exe "hi ansiHL_".icolor."_".jcolor." ctermfg=".icolor." ctermbg=".jcolor +" call Decho("exe hi ansiHL_".icolor."_".jcolor." ctermfg=".icolor." ctermbg=".jcolor) + let jcolor= jcolor + 1 + endwhile + let icolor= icolor + 1 + endwhile + endif + + else + " ---------------------------------- + " not 8 or 256 color terminals (gui): {{{3 + " ---------------------------------- +" call Decho("set up gui highlighting groups") + hi ansiBlack ctermfg=black guifg=black cterm=none gui=none + hi ansiRed ctermfg=red guifg=red cterm=none gui=none + hi ansiGreen ctermfg=green guifg=green cterm=none gui=none + hi ansiYellow ctermfg=yellow guifg=yellow cterm=none gui=none + hi ansiBlue ctermfg=blue guifg=blue cterm=none gui=none + hi ansiMagenta ctermfg=magenta guifg=magenta cterm=none gui=none + hi ansiCyan ctermfg=cyan guifg=cyan cterm=none gui=none + hi ansiWhite ctermfg=white guifg=white cterm=none gui=none + + hi ansiBlackBg ctermbg=black guibg=black cterm=none gui=none + hi ansiRedBg ctermbg=red guibg=red cterm=none gui=none + hi ansiGreenBg ctermbg=green guibg=green cterm=none gui=none + hi ansiYellowBg ctermbg=yellow guibg=yellow cterm=none gui=none + hi ansiBlueBg ctermbg=blue guibg=blue cterm=none gui=none + hi ansiMagentaBg ctermbg=magenta guibg=magenta cterm=none gui=none + hi ansiCyanBg ctermbg=cyan guibg=cyan cterm=none gui=none + hi ansiWhiteBg ctermbg=white guibg=white cterm=none gui=none + + hi ansiBoldBlack ctermfg=black guifg=black cterm=bold gui=bold + hi ansiBoldRed ctermfg=red guifg=red cterm=bold gui=bold + hi ansiBoldGreen ctermfg=green guifg=green cterm=bold gui=bold + hi ansiBoldYellow ctermfg=yellow guifg=yellow cterm=bold gui=bold + hi ansiBoldBlue ctermfg=blue guifg=blue cterm=bold gui=bold + hi ansiBoldMagenta ctermfg=magenta guifg=magenta cterm=bold gui=bold + hi ansiBoldCyan ctermfg=cyan guifg=cyan cterm=bold gui=bold + hi ansiBoldWhite ctermfg=white guifg=white cterm=bold gui=bold + + hi ansiStandoutBlack ctermfg=black guifg=black cterm=standout gui=standout + hi ansiStandoutRed ctermfg=red guifg=red cterm=standout gui=standout + hi ansiStandoutGreen ctermfg=green guifg=green cterm=standout gui=standout + hi ansiStandoutYellow ctermfg=yellow guifg=yellow cterm=standout gui=standout + hi ansiStandoutBlue ctermfg=blue guifg=blue cterm=standout gui=standout + hi ansiStandoutMagenta ctermfg=magenta guifg=magenta cterm=standout gui=standout + hi ansiStandoutCyan ctermfg=cyan guifg=cyan cterm=standout gui=standout + hi ansiStandoutWhite ctermfg=white guifg=white cterm=standout gui=standout + + hi ansiItalicBlack ctermfg=black guifg=black cterm=italic gui=italic + hi ansiItalicRed ctermfg=red guifg=red cterm=italic gui=italic + hi ansiItalicGreen ctermfg=green guifg=green cterm=italic gui=italic + hi ansiItalicYellow ctermfg=yellow guifg=yellow cterm=italic gui=italic + hi ansiItalicBlue ctermfg=blue guifg=blue cterm=italic gui=italic + hi ansiItalicMagenta ctermfg=magenta guifg=magenta cterm=italic gui=italic + hi ansiItalicCyan ctermfg=cyan guifg=cyan cterm=italic gui=italic + hi ansiItalicWhite ctermfg=white guifg=white cterm=italic gui=italic + + hi ansiUnderlineBlack ctermfg=black guifg=black cterm=underline gui=underline + hi ansiUnderlineRed ctermfg=red guifg=red cterm=underline gui=underline + hi ansiUnderlineGreen ctermfg=green guifg=green cterm=underline gui=underline + hi ansiUnderlineYellow ctermfg=yellow guifg=yellow cterm=underline gui=underline + hi ansiUnderlineBlue ctermfg=blue guifg=blue cterm=underline gui=underline + hi ansiUnderlineMagenta ctermfg=magenta guifg=magenta cterm=underline gui=underline + hi ansiUnderlineCyan ctermfg=cyan guifg=cyan cterm=underline gui=underline + hi ansiUnderlineWhite ctermfg=white guifg=white cterm=underline gui=underline + + hi ansiBlinkBlack ctermfg=black guifg=black cterm=standout gui=undercurl + hi ansiBlinkRed ctermfg=red guifg=red cterm=standout gui=undercurl + hi ansiBlinkGreen ctermfg=green guifg=green cterm=standout gui=undercurl + hi ansiBlinkYellow ctermfg=yellow guifg=yellow cterm=standout gui=undercurl + hi ansiBlinkBlue ctermfg=blue guifg=blue cterm=standout gui=undercurl + hi ansiBlinkMagenta ctermfg=magenta guifg=magenta cterm=standout gui=undercurl + hi ansiBlinkCyan ctermfg=cyan guifg=cyan cterm=standout gui=undercurl + hi ansiBlinkWhite ctermfg=white guifg=white cterm=standout gui=undercurl + + hi ansiRapidBlinkBlack ctermfg=black guifg=black cterm=standout gui=undercurl + hi ansiRapidBlinkRed ctermfg=red guifg=red cterm=standout gui=undercurl + hi ansiRapidBlinkGreen ctermfg=green guifg=green cterm=standout gui=undercurl + hi ansiRapidBlinkYellow ctermfg=yellow guifg=yellow cterm=standout gui=undercurl + hi ansiRapidBlinkBlue ctermfg=blue guifg=blue cterm=standout gui=undercurl + hi ansiRapidBlinkMagenta ctermfg=magenta guifg=magenta cterm=standout gui=undercurl + hi ansiRapidBlinkCyan ctermfg=cyan guifg=cyan cterm=standout gui=undercurl + hi ansiRapidBlinkWhite ctermfg=white guifg=white cterm=standout gui=undercurl + + hi ansiRVBlack ctermfg=black guifg=black cterm=reverse gui=reverse + hi ansiRVRed ctermfg=red guifg=red cterm=reverse gui=reverse + hi ansiRVGreen ctermfg=green guifg=green cterm=reverse gui=reverse + hi ansiRVYellow ctermfg=yellow guifg=yellow cterm=reverse gui=reverse + hi ansiRVBlue ctermfg=blue guifg=blue cterm=reverse gui=reverse + hi ansiRVMagenta ctermfg=magenta guifg=magenta cterm=reverse gui=reverse + hi ansiRVCyan ctermfg=cyan guifg=cyan cterm=reverse gui=reverse + hi ansiRVWhite ctermfg=white guifg=white cterm=reverse gui=reverse + + hi ansiBlackBlack ctermfg=black ctermbg=black guifg=Black guibg=Black cterm=none gui=none + hi ansiRedBlack ctermfg=black ctermbg=black guifg=Black guibg=Black cterm=none gui=none + hi ansiRedBlack ctermfg=red ctermbg=black guifg=Red guibg=Black cterm=none gui=none + hi ansiGreenBlack ctermfg=green ctermbg=black guifg=Green guibg=Black cterm=none gui=none + hi ansiYellowBlack ctermfg=yellow ctermbg=black guifg=Yellow guibg=Black cterm=none gui=none + hi ansiBlueBlack ctermfg=blue ctermbg=black guifg=Blue guibg=Black cterm=none gui=none + hi ansiMagentaBlack ctermfg=magenta ctermbg=black guifg=Magenta guibg=Black cterm=none gui=none + hi ansiCyanBlack ctermfg=cyan ctermbg=black guifg=Cyan guibg=Black cterm=none gui=none + hi ansiWhiteBlack ctermfg=white ctermbg=black guifg=White guibg=Black cterm=none gui=none + + hi ansiBlackRed ctermfg=black ctermbg=red guifg=Black guibg=Red cterm=none gui=none + hi ansiRedRed ctermfg=red ctermbg=red guifg=Red guibg=Red cterm=none gui=none + hi ansiGreenRed ctermfg=green ctermbg=red guifg=Green guibg=Red cterm=none gui=none + hi ansiYellowRed ctermfg=yellow ctermbg=red guifg=Yellow guibg=Red cterm=none gui=none + hi ansiBlueRed ctermfg=blue ctermbg=red guifg=Blue guibg=Red cterm=none gui=none + hi ansiMagentaRed ctermfg=magenta ctermbg=red guifg=Magenta guibg=Red cterm=none gui=none + hi ansiCyanRed ctermfg=cyan ctermbg=red guifg=Cyan guibg=Red cterm=none gui=none + hi ansiWhiteRed ctermfg=white ctermbg=red guifg=White guibg=Red cterm=none gui=none + + hi ansiBlackGreen ctermfg=black ctermbg=green guifg=Black guibg=Green cterm=none gui=none + hi ansiRedGreen ctermfg=red ctermbg=green guifg=Red guibg=Green cterm=none gui=none + hi ansiGreenGreen ctermfg=green ctermbg=green guifg=Green guibg=Green cterm=none gui=none + hi ansiYellowGreen ctermfg=yellow ctermbg=green guifg=Yellow guibg=Green cterm=none gui=none + hi ansiBlueGreen ctermfg=blue ctermbg=green guifg=Blue guibg=Green cterm=none gui=none + hi ansiMagentaGreen ctermfg=magenta ctermbg=green guifg=Magenta guibg=Green cterm=none gui=none + hi ansiCyanGreen ctermfg=cyan ctermbg=green guifg=Cyan guibg=Green cterm=none gui=none + hi ansiWhiteGreen ctermfg=white ctermbg=green guifg=White guibg=Green cterm=none gui=none + + hi ansiBlackYellow ctermfg=black ctermbg=yellow guifg=Black guibg=Yellow cterm=none gui=none + hi ansiRedYellow ctermfg=red ctermbg=yellow guifg=Red guibg=Yellow cterm=none gui=none + hi ansiGreenYellow ctermfg=green ctermbg=yellow guifg=Green guibg=Yellow cterm=none gui=none + hi ansiYellowYellow ctermfg=yellow ctermbg=yellow guifg=Yellow guibg=Yellow cterm=none gui=none + hi ansiBlueYellow ctermfg=blue ctermbg=yellow guifg=Blue guibg=Yellow cterm=none gui=none + hi ansiMagentaYellow ctermfg=magenta ctermbg=yellow guifg=Magenta guibg=Yellow cterm=none gui=none + hi ansiCyanYellow ctermfg=cyan ctermbg=yellow guifg=Cyan guibg=Yellow cterm=none gui=none + hi ansiWhiteYellow ctermfg=white ctermbg=yellow guifg=White guibg=Yellow cterm=none gui=none + + hi ansiBlackBlue ctermfg=black ctermbg=blue guifg=Black guibg=Blue cterm=none gui=none + hi ansiRedBlue ctermfg=red ctermbg=blue guifg=Red guibg=Blue cterm=none gui=none + hi ansiGreenBlue ctermfg=green ctermbg=blue guifg=Green guibg=Blue cterm=none gui=none + hi ansiYellowBlue ctermfg=yellow ctermbg=blue guifg=Yellow guibg=Blue cterm=none gui=none + hi ansiBlueBlue ctermfg=blue ctermbg=blue guifg=Blue guibg=Blue cterm=none gui=none + hi ansiMagentaBlue ctermfg=magenta ctermbg=blue guifg=Magenta guibg=Blue cterm=none gui=none + hi ansiCyanBlue ctermfg=cyan ctermbg=blue guifg=Cyan guibg=Blue cterm=none gui=none + hi ansiWhiteBlue ctermfg=white ctermbg=blue guifg=White guibg=Blue cterm=none gui=none + + hi ansiBlackMagenta ctermfg=black ctermbg=magenta guifg=Black guibg=Magenta cterm=none gui=none + hi ansiRedMagenta ctermfg=red ctermbg=magenta guifg=Red guibg=Magenta cterm=none gui=none + hi ansiGreenMagenta ctermfg=green ctermbg=magenta guifg=Green guibg=Magenta cterm=none gui=none + hi ansiYellowMagenta ctermfg=yellow ctermbg=magenta guifg=Yellow guibg=Magenta cterm=none gui=none + hi ansiBlueMagenta ctermfg=blue ctermbg=magenta guifg=Blue guibg=Magenta cterm=none gui=none + hi ansiMagentaMagenta ctermfg=magenta ctermbg=magenta guifg=Magenta guibg=Magenta cterm=none gui=none + hi ansiCyanMagenta ctermfg=cyan ctermbg=magenta guifg=Cyan guibg=Magenta cterm=none gui=none + hi ansiWhiteMagenta ctermfg=white ctermbg=magenta guifg=White guibg=Magenta cterm=none gui=none + + hi ansiBlackCyan ctermfg=black ctermbg=cyan guifg=Black guibg=Cyan cterm=none gui=none + hi ansiRedCyan ctermfg=red ctermbg=cyan guifg=Red guibg=Cyan cterm=none gui=none + hi ansiGreenCyan ctermfg=green ctermbg=cyan guifg=Green guibg=Cyan cterm=none gui=none + hi ansiYellowCyan ctermfg=yellow ctermbg=cyan guifg=Yellow guibg=Cyan cterm=none gui=none + hi ansiBlueCyan ctermfg=blue ctermbg=cyan guifg=Blue guibg=Cyan cterm=none gui=none + hi ansiMagentaCyan ctermfg=magenta ctermbg=cyan guifg=Magenta guibg=Cyan cterm=none gui=none + hi ansiCyanCyan ctermfg=cyan ctermbg=cyan guifg=Cyan guibg=Cyan cterm=none gui=none + hi ansiWhiteCyan ctermfg=white ctermbg=cyan guifg=White guibg=Cyan cterm=none gui=none + + hi ansiBlackWhite ctermfg=black ctermbg=white guifg=Black guibg=White cterm=none gui=none + hi ansiRedWhite ctermfg=red ctermbg=white guifg=Red guibg=White cterm=none gui=none + hi ansiGreenWhite ctermfg=green ctermbg=white guifg=Green guibg=White cterm=none gui=none + hi ansiYellowWhite ctermfg=yellow ctermbg=white guifg=Yellow guibg=White cterm=none gui=none + hi ansiBlueWhite ctermfg=blue ctermbg=white guifg=Blue guibg=White cterm=none gui=none + hi ansiMagentaWhite ctermfg=magenta ctermbg=white guifg=Magenta guibg=White cterm=none gui=none + hi ansiCyanWhite ctermfg=cyan ctermbg=white guifg=Cyan guibg=White cterm=none gui=none + hi ansiWhiteWhite ctermfg=white ctermbg=white guifg=White guibg=White cterm=none gui=none + endif +" call Dret("AnsiEsc#AnsiEsc") +endfun + +" --------------------------------------------------------------------- +" s:MultiElementHandler: builds custom syntax highlighting for three or more element ansi escape sequences {{{2 +fun! s:MultiElementHandler() +" call Dfunc("s:MultiElementHandler()") + let curwp= SaveWinPosn(0) + keepj 1 + keepj norm! 0 + let mehcnt = 0 + let mehrules = [] + while search('\e\[;\=\d\+;\d\+;\d\+\(;\d\+\)*m','cW') + let curcol = col(".")+1 + call search('m','cW') + let mcol = col(".") + let ansiesc = strpart(getline("."),curcol,mcol - curcol) + let aecodes = split(ansiesc,'[;m]') +" call Decho("ansiesc<".ansiesc."> aecodes=".string(aecodes)) + let skip = 0 + let mod = "NONE," + let fg = "" + let bg = "" + + " if the ansiesc is + if index(mehrules,ansiesc) == -1 + let mehrules+= [ansiesc] + + for code in aecodes + + " handle multi-code sequences (38;5;color and 48;5;color) + if skip == 38 && code == 5 + " handling [38;5 + let skip= 385 +" call Decho(" 1: building code=".code." skip=".skip.": mod<".mod."> fg<".fg."> bg<".bg.">") + continue + elseif skip == 385 + " handling [38;5;... + if has("gui") && has("gui_running") + let fg= s:Ansi2Gui(code) + else + let fg= code + endif + let skip= 0 +" call Decho(" 2: building code=".code." skip=".skip.": mod<".mod."> fg<".fg."> bg<".bg.">") + continue + + elseif skip == 48 && code == 5 + " handling [48;5 + let skip= 485 +" call Decho(" 3: building code=".code." skip=".skip.": mod<".mod."> fg<".fg."> bg<".bg.">") + continue + elseif skip == 485 + " handling [48;5;... + if has("gui") && has("gui_running") + let bg= s:Ansi2Gui(code) + else + let bg= code + endif + let skip= 0 +" call Decho(" 4: building code=".code." skip=".skip.": mod<".mod."> fg<".fg."> bg<".bg.">") + continue + + else + let skip= 0 + endif + + " handle single-code sequences + if code == 1 + let mod=mod."bold," + elseif code == 2 + let mod=mod."italic," + elseif code == 3 + let mod=mod."standout," + elseif code == 4 + let mod=mod."underline," + elseif code == 5 || code == 6 + let mod=mod."undercurl," + elseif code == 7 + let mod=mod."reverse," + + elseif code == 30 + let fg= "black" + elseif code == 31 + let fg= "red" + elseif code == 32 + let fg= "green" + elseif code == 33 + let fg= "yellow" + elseif code == 34 + let fg= "blue" + elseif code == 35 + let fg= "magenta" + elseif code == 36 + let fg= "cyan" + elseif code == 37 + let fg= "white" + + elseif code == 40 + let bg= "black" + elseif code == 41 + let bg= "red" + elseif code == 42 + let bg= "green" + elseif code == 43 + let bg= "yellow" + elseif code == 44 + let bg= "blue" + elseif code == 45 + let bg= "magenta" + elseif code == 46 + let bg= "cyan" + elseif code == 47 + let bg= "white" + + elseif code == 38 + let skip= 38 + + elseif code == 48 + let skip= 48 + endif + +" call Decho(" 5: building code=".code." skip=".skip.": mod<".mod."> fg<".fg."> bg<".bg.">") + endfor + + " fixups + let mod= substitute(mod,',$','','') + + " build syntax-recognition rule + let mehcnt = mehcnt + 1 + let synrule = "syn region ansiMEH".mehcnt + let synrule = synrule.' start="\e\['.ansiesc.'"' + let synrule = synrule.' end="\e\["me=e-2' + let synrule = synrule." contains=ansiConceal" +" call Decho(" exe synrule: ".synrule) + exe synrule + + " build highlighting rule + let hirule= "hi ansiMEH".mehcnt + if has("gui") && has("gui_running") + let hirule=hirule." gui=".mod + if fg != ""| let hirule=hirule." guifg=".fg| endif + if bg != ""| let hirule=hirule." guibg=".bg| endif + else + let hirule=hirule." cterm=".mod + if fg != ""| let hirule=hirule." ctermfg=".fg| endif + if bg != ""| let hirule=hirule." ctermbg=".bg| endif + endif +" call Decho(" exe hirule: ".hirule) + exe hirule + endif + + endwhile + + call RestoreWinPosn(curwp) +" call Dret("s:MultiElementHandler") +endfun + +" --------------------------------------------------------------------- +" s:Ansi2Gui: converts an ansi-escape sequence (for 256-color xterms) {{{2 +" to an equivalent gui color +" colors 0- 15: +" colors 16-231: 6x6x6 color cube, code= 16+r*36+g*6+b with r,g,b each in [0,5] +" colors 232-255: grayscale ramp, code= 10*gray + 8 with gray in [0,23] (black,white left out) +fun! s:Ansi2Gui(code) +" call Dfunc("s:Ansi2Gui(code=)".a:code) + let guicolor= a:code + if a:code < 16 + let code2rgb = [ "black", "red3", "green3", "yellow3", "blue3", "magenta3", "cyan3", "gray70", "gray40", "red", "green", "yellow", "royalblue3", "magenta", "cyan", "white"] + let guicolor = code2rgb[a:code] + elseif a:code >= 232 + let code = a:code - 232 + let code = 10*code + 8 + let guicolor = printf("#%02x%02x%02x",code,code,code) + else + let code = a:code - 16 + let code2rgb = [43,85,128,170,213,255] + let r = code2rgb[code/36] + let g = code2rgb[(code%36)/6] + let b = code2rgb[code%6] + let guicolor = printf("#%02x%02x%02x",r,g,b) + endif +" call Dret("s:Ansi2Gui ".guicolor) + return guicolor +endfun + +" --------------------------------------------------------------------- +" Restore: {{{1 +let &cpo= s:keepcpo +unlet s:keepcpo + +" --------------------------------------------------------------------- +" Modelines: {{{1 +" vim: ts=12 fdm=marker diff --git a/.vim/bundle/abolish b/.vim/bundle/abolish new file mode 160000 index 0000000..d64ce06 --- /dev/null +++ b/.vim/bundle/abolish @@ -0,0 +1 @@ +Subproject commit d64ce06650cf9b098b5a01c0db53864965d9310b diff --git a/.vim/bundle/ack b/.vim/bundle/ack new file mode 160000 index 0000000..f183a34 --- /dev/null +++ b/.vim/bundle/ack @@ -0,0 +1 @@ +Subproject commit f183a345a0c10caed7684d07dabae33e007c7590 diff --git a/.vim/bundle/characterize b/.vim/bundle/characterize new file mode 160000 index 0000000..d5ba608 --- /dev/null +++ b/.vim/bundle/characterize @@ -0,0 +1 @@ +Subproject commit d5ba608255810c8e748d1eb463c22c652e4f6eb8 diff --git a/.vim/bundle/colors-solarized b/.vim/bundle/colors-solarized new file mode 160000 index 0000000..528a59f --- /dev/null +++ b/.vim/bundle/colors-solarized @@ -0,0 +1 @@ +Subproject commit 528a59f26d12278698bb946f8fb82a63711eec21 diff --git a/.vim/bundle/commentary b/.vim/bundle/commentary new file mode 160000 index 0000000..a3ae0df --- /dev/null +++ b/.vim/bundle/commentary @@ -0,0 +1 @@ +Subproject commit a3ae0df1d9e13941e9e8086637055841ce93f7bd diff --git a/.vim/bundle/css-color b/.vim/bundle/css-color new file mode 160000 index 0000000..bef9465 --- /dev/null +++ b/.vim/bundle/css-color @@ -0,0 +1 @@ +Subproject commit bef9465cd0cbb07c336334779737ac4b22f8010a diff --git a/.vim/bundle/css3-syntax b/.vim/bundle/css3-syntax new file mode 160000 index 0000000..012c1ba --- /dev/null +++ b/.vim/bundle/css3-syntax @@ -0,0 +1 @@ +Subproject commit 012c1ba6a075e2e83267ff5ecb80800e28044190 diff --git a/.vim/bundle/ctrlp b/.vim/bundle/ctrlp new file mode 160000 index 0000000..287b9c1 --- /dev/null +++ b/.vim/bundle/ctrlp @@ -0,0 +1 @@ +Subproject commit 287b9c12aad2420269576504d1c05d36111a4562 diff --git a/.vim/bundle/dbext.vim b/.vim/bundle/dbext.vim new file mode 160000 index 0000000..794c9a1 --- /dev/null +++ b/.vim/bundle/dbext.vim @@ -0,0 +1 @@ +Subproject commit 794c9a181078d0f39ac2656d398ed93fcebdb1bc diff --git a/.vim/bundle/dispatch b/.vim/bundle/dispatch new file mode 160000 index 0000000..b171bbc --- /dev/null +++ b/.vim/bundle/dispatch @@ -0,0 +1 @@ +Subproject commit b171bbc64a18dd565ff4d354d340ee5f0bbd4ac1 diff --git a/.vim/bundle/easymotion b/.vim/bundle/easymotion new file mode 160000 index 0000000..667a668 --- /dev/null +++ b/.vim/bundle/easymotion @@ -0,0 +1 @@ +Subproject commit 667a668e114e9ec0e5d4cbcb0962d835b23614c4 diff --git a/.vim/bundle/fugitive b/.vim/bundle/fugitive new file mode 160000 index 0000000..4c7e649 --- /dev/null +++ b/.vim/bundle/fugitive @@ -0,0 +1 @@ +Subproject commit 4c7e649efba289df0e7e8bb9abfa37f95b28f8ed diff --git a/.vim/bundle/git b/.vim/bundle/git new file mode 160000 index 0000000..5822ff0 --- /dev/null +++ b/.vim/bundle/git @@ -0,0 +1 @@ +Subproject commit 5822ff0de7b409f2cb00dc6bfcabfe382f7b279d diff --git a/.vim/bundle/gitv b/.vim/bundle/gitv new file mode 160000 index 0000000..0b797d1 --- /dev/null +++ b/.vim/bundle/gitv @@ -0,0 +1 @@ +Subproject commit 0b797d10f7f00c746fc2c6c2fc289bb58bc1fda0 diff --git a/.vim/bundle/gundo.vim b/.vim/bundle/gundo.vim new file mode 160000 index 0000000..4c376a8 --- /dev/null +++ b/.vim/bundle/gundo.vim @@ -0,0 +1 @@ +Subproject commit 4c376a8061fa335228da420937ce385b847dd56a diff --git a/.vim/bundle/irblack b/.vim/bundle/irblack new file mode 160000 index 0000000..59622ca --- /dev/null +++ b/.vim/bundle/irblack @@ -0,0 +1 @@ +Subproject commit 59622caff32a7925181ab139701fad3eee54ae51 diff --git a/.vim/bundle/less b/.vim/bundle/less new file mode 160000 index 0000000..1b37c0d --- /dev/null +++ b/.vim/bundle/less @@ -0,0 +1 @@ +Subproject commit 1b37c0d7cc0f74fb4c1185ed359e641b6865a9ff diff --git a/.vim/bundle/markdown b/.vim/bundle/markdown new file mode 160000 index 0000000..ec0abb3 --- /dev/null +++ b/.vim/bundle/markdown @@ -0,0 +1 @@ +Subproject commit ec0abb3064ce7af81d5d1141a5fba043ac9e8a1c diff --git a/.vim/bundle/nerdtree b/.vim/bundle/nerdtree new file mode 160000 index 0000000..eaf1973 --- /dev/null +++ b/.vim/bundle/nerdtree @@ -0,0 +1 @@ +Subproject commit eaf19734e73dbaa5b30f10591079043b0eba0aab diff --git a/.vim/bundle/nerdtree-tabs b/.vim/bundle/nerdtree-tabs new file mode 160000 index 0000000..84ccf91 --- /dev/null +++ b/.vim/bundle/nerdtree-tabs @@ -0,0 +1 @@ +Subproject commit 84ccf91ac2db0f634e3e7acb171456c8dcbd74e7 diff --git a/.vim/bundle/pathogen b/.vim/bundle/pathogen new file mode 160000 index 0000000..f1926ab --- /dev/null +++ b/.vim/bundle/pathogen @@ -0,0 +1 @@ +Subproject commit f1926ab6731cb1877160ff94d01ea644d257076e diff --git a/.vim/bundle/powerline b/.vim/bundle/powerline new file mode 160000 index 0000000..09c0cea --- /dev/null +++ b/.vim/bundle/powerline @@ -0,0 +1 @@ +Subproject commit 09c0cea859a2e0989eea740655b35976d951a84e diff --git a/.vim/bundle/repeat b/.vim/bundle/repeat new file mode 160000 index 0000000..a81bef7 --- /dev/null +++ b/.vim/bundle/repeat @@ -0,0 +1 @@ +Subproject commit a81bef76031ca1c71766b516417480caeb01c932 diff --git a/.vim/bundle/ruby b/.vim/bundle/ruby new file mode 160000 index 0000000..5943faa --- /dev/null +++ b/.vim/bundle/ruby @@ -0,0 +1 @@ +Subproject commit 5943faa4438b102ef19011f70599b6bc4f8a72c6 diff --git a/.vim/bundle/scriptease b/.vim/bundle/scriptease new file mode 160000 index 0000000..7c0b86c --- /dev/null +++ b/.vim/bundle/scriptease @@ -0,0 +1 @@ +Subproject commit 7c0b86c989c03c482a1b9c6cf687b4ec6604b0eb diff --git a/.vim/bundle/sensible b/.vim/bundle/sensible new file mode 160000 index 0000000..d39023b --- /dev/null +++ b/.vim/bundle/sensible @@ -0,0 +1 @@ +Subproject commit d39023bba7335bb982f549969da3fbcf88f4d8f9 diff --git a/.vim/bundle/snipmate.vim b/.vim/bundle/snipmate.vim new file mode 160000 index 0000000..f5a75d0 --- /dev/null +++ b/.vim/bundle/snipmate.vim @@ -0,0 +1 @@ +Subproject commit f5a75d075d3c005ebe69e3f5e56cf99516e8aa3b diff --git a/.vim/bundle/speeddating b/.vim/bundle/speeddating new file mode 160000 index 0000000..d01b808 --- /dev/null +++ b/.vim/bundle/speeddating @@ -0,0 +1 @@ +Subproject commit d01b8083f336b451df618fa623d3b4948ceea19a diff --git a/.vim/bundle/supertab b/.vim/bundle/supertab new file mode 160000 index 0000000..096be34 --- /dev/null +++ b/.vim/bundle/supertab @@ -0,0 +1 @@ +Subproject commit 096be343f89c63fc086a55262f2f264d0d0524b0 diff --git a/.vim/bundle/surround b/.vim/bundle/surround new file mode 160000 index 0000000..02199ea --- /dev/null +++ b/.vim/bundle/surround @@ -0,0 +1 @@ +Subproject commit 02199ea0080d744ec76b79d74ce56d51d25cf7ae diff --git a/.vim/bundle/syntastic b/.vim/bundle/syntastic new file mode 160000 index 0000000..6f214cb --- /dev/null +++ b/.vim/bundle/syntastic @@ -0,0 +1 @@ +Subproject commit 6f214cbb6d42256031aaa9670cf9ea7358e18431 diff --git a/.vim/bundle/tabular b/.vim/bundle/tabular new file mode 160000 index 0000000..0c856ba --- /dev/null +++ b/.vim/bundle/tabular @@ -0,0 +1 @@ +Subproject commit 0c856ba0a9e2d6118ef3139227873a70f7dd9f80 diff --git a/.vim/bundle/tagbar b/.vim/bundle/tagbar new file mode 160000 index 0000000..db9404c --- /dev/null +++ b/.vim/bundle/tagbar @@ -0,0 +1 @@ +Subproject commit db9404ca1a6ac67ab1c42791a44deb4c88546bda diff --git a/.vim/bundle/unimpaired b/.vim/bundle/unimpaired new file mode 160000 index 0000000..cabf4b7 --- /dev/null +++ b/.vim/bundle/unimpaired @@ -0,0 +1 @@ +Subproject commit cabf4b79b1c0cd9c9a8beec303c2e6172c82d19f diff --git a/.vim/bundle/visualstar b/.vim/bundle/visualstar new file mode 160000 index 0000000..04327d5 --- /dev/null +++ b/.vim/bundle/visualstar @@ -0,0 +1 @@ +Subproject commit 04327d52ee3b9ad35d1f6ac8919a6365352b2262 diff --git a/.vim/cache/.gitignore b/.vim/cache/.gitignore new file mode 100644 index 0000000..2d9dbe1 --- /dev/null +++ b/.vim/cache/.gitignore @@ -0,0 +1,4 @@ +* +!.gitignore +!backup +!undo diff --git a/.vim/colors/desert256.vim b/.vim/colors/desert256.vim new file mode 100644 index 0000000..7a97742 --- /dev/null +++ b/.vim/colors/desert256.vim @@ -0,0 +1,338 @@ +" Vim color file +" Maintainer: Henry So, Jr. + +" These are the colors of the "desert" theme by Hans Fugal with a few small +" modifications (namely that I lowered the intensity of the normal white and +" made the normal and nontext backgrounds black), modified to work with 88- +" and 256-color xterms. +" +" The original "desert" theme is available as part of the vim distribution or +" at http://hans.fugal.net/vim/colors/. +" +" The real feature of this color scheme, with a wink to the "inkpot" theme, is +" the programmatic approximation of the gui colors to the palettes of 88- and +" 256- color xterms. The functions that do this (folded away, for +" readability) are calibrated to the colors used for Thomas E. Dickey's xterm +" (version 200), which is available at http://dickey.his.com/xterm/xterm.html. +" +" I struggled with trying to parse the rgb.txt file to avoid the necessity of +" converting color names to #rrggbb form, but decided it was just not worth +" the effort. Maybe someone seeing this may decide otherwise... + +set background=dark +if version > 580 + " no guarantees for version 5.8 and below, but this makes it stop + " complaining + hi clear + if exists("syntax_on") + syntax reset + endif +endif +let g:colors_name="desert256" + +if has("gui_running") || &t_Co == 88 || &t_Co == 256 + " functions {{{ + " returns an approximate grey index for the given grey level + fun 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 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 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 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 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 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 color(r, g, b) + " get the closest grey + let l:gx = grey_number(a:r) + let l:gy = grey_number(a:g) + let l:gz = grey_number(a:b) + + " get the closest color + let l:x = rgb_number(a:r) + let l:y = rgb_number(a:g) + let l:z = rgb_number(a:b) + + if l:gx == l:gy && l:gy == l:gz + " there are two possibilities + let l:dgr = grey_level(l:gx) - a:r + let l:dgg = grey_level(l:gy) - a:g + let l:dgb = grey_level(l:gz) - a:b + let l:dgrey = (l:dgr * l:dgr) + (l:dgg * l:dgg) + (l:dgb * l:dgb) + let l:dr = rgb_level(l:gx) - a:r + let l:dg = rgb_level(l:gy) - a:g + let l:db = 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 grey_color(l:gx) + else + " use the color + return rgb_color(l:x, l:y, l:z) + endif + else + " only one possibility + return rgb_color(l:x, l:y, l:z) + endif + endfun + + " returns the palette index to approximate the 'rrggbb' hex string + fun 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 color(l:r, l:g, l:b) + endfun + + " sets the highlighting for the given group + fun X(group, fg, bg, attr) + if a:fg != "" + exec "hi " . a:group . " guifg=#" . a:fg . " ctermfg=" . rgb(a:fg) + endif + if a:bg != "" + exec "hi " . a:group . " guibg=#" . a:bg . " ctermbg=" . rgb(a:bg) + endif + if a:attr != "" + exec "hi " . a:group . " gui=" . a:attr . " cterm=" . a:attr + endif + endfun + " }}} + + call X("Normal", "cccccc", "000000", "") + + " highlight groups + call X("Cursor", "708090", "f0e68c", "") + "CursorIM + "Directory + "DiffAdd + "DiffChange + "DiffDelete + "DiffText + "ErrorMsg + call X("VertSplit", "c2bfa5", "7f7f7f", "reverse") + call X("Folded", "ffd700", "4d4d4d", "") + call X("FoldColumn", "d2b48c", "4d4d4d", "") + call X("IncSearch", "708090", "f0e68c", "") + "LineNr + call X("ModeMsg", "daa520", "", "") + call X("MoreMsg", "2e8b57", "", "") + call X("NonText", "addbe7", "000000", "bold") + call X("Question", "00ff7f", "", "") + call X("Search", "f5deb3", "cd853f", "") + call X("SpecialKey", "9acd32", "", "") + call X("StatusLine", "c2bfa5", "000000", "reverse") + call X("StatusLineNC", "c2bfa5", "7f7f7f", "reverse") + call X("Title", "cd5c5c", "", "") + call X("Visual", "6b8e23", "f0e68c", "reverse") + "VisualNOS + call X("WarningMsg", "fa8072", "", "") + "WildMenu + "Menu + "Scrollbar + "Tooltip + + " syntax highlighting groups + call X("Comment", "87ceeb", "", "") + call X("Constant", "ffa0a0", "", "") + call X("Identifier", "98fb98", "", "none") + call X("Statement", "f0e68c", "", "bold") + call X("PreProc", "cd5c5c", "", "") + call X("Type", "bdb76b", "", "bold") + call X("Special", "ffdead", "", "") + "Underlined + call X("Ignore", "666666", "", "") + "Error + call X("Todo", "ff4500", "eeee00", "") + + " delete functions {{{ + delf X + delf rgb + delf color + delf rgb_color + delf rgb_level + delf rgb_number + delf grey_color + delf grey_level + delf grey_number + " }}} +else + " color terminal definitions + hi SpecialKey ctermfg=darkgreen + 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=grey ctermbg=blue + 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 +endif + +" vim: set fdl=0 fdm=marker: diff --git a/.vim/colors/grb256.vim b/.vim/colors/grb256.vim new file mode 100644 index 0000000..10c57c0 --- /dev/null +++ b/.vim/colors/grb256.vim @@ -0,0 +1,32 @@ +" Based on +runtime colors/ir_black.vim + +let g:colors_name = "grb256" + +hi pythonSpaceError ctermbg=red guibg=red + +hi Comment ctermfg=darkgray + +hi StatusLine ctermbg=darkgrey ctermfg=white +hi StatusLineNC ctermbg=black ctermfg=lightgrey +hi VertSplit ctermbg=black ctermfg=lightgrey +hi LineNr ctermfg=darkgray +hi CursorLine guifg=NONE guibg=#121212 gui=NONE ctermfg=NONE ctermbg=234 +hi Function guifg=#FFD2A7 guibg=NONE gui=NONE ctermfg=yellow ctermbg=NONE cterm=NONE +hi Visual guifg=NONE guibg=#262D51 gui=NONE ctermfg=NONE ctermbg=236 cterm=NONE + +hi Error guifg=NONE guibg=NONE gui=undercurl ctermfg=16 ctermbg=red cterm=NONE guisp=#FF6C60 " undercurl color +hi ErrorMsg guifg=white guibg=#FF6C60 gui=BOLD ctermfg=16 ctermbg=red cterm=NONE +hi WarningMsg guifg=white guibg=#FF6C60 gui=BOLD ctermfg=16 ctermbg=red cterm=NONE +hi SpellBad guifg=white guibg=#FF6C60 gui=BOLD ctermfg=16 ctermbg=160 cterm=NONE + +" ir_black doesn't highlight operators for some reason +hi Operator guifg=#6699CC guibg=NONE gui=NONE ctermfg=lightblue ctermbg=NONE cterm=NONE + +highlight DiffAdd term=reverse cterm=bold ctermbg=lightgreen ctermfg=16 +highlight DiffChange term=reverse cterm=bold ctermbg=lightblue ctermfg=16 +highlight DiffText term=reverse cterm=bold ctermbg=lightgray ctermfg=16 +highlight DiffDelete term=reverse cterm=bold ctermbg=lightred ctermfg=16 + +highlight PmenuSel ctermfg=16 ctermbg=156 + diff --git a/.vim/colors/jellybeans.vim b/.vim/colors/jellybeans.vim new file mode 100644 index 0000000..20f14d9 --- /dev/null +++ b/.vim/colors/jellybeans.vim @@ -0,0 +1,497 @@ +" Vim color file +" +" " __ _ _ _ " +" " \ \ ___| | |_ _| |__ ___ __ _ _ __ ___ " +" " \ \/ _ \ | | | | | _ \ / _ \/ _ | _ \/ __| " +" " /\_/ / __/ | | |_| | |_| | __/ |_| | | | \__ \ " +" " \___/ \___|_|_|\__ |____/ \___|\____|_| |_|___/ " +" " \___/ " +" +" "A colorful, dark color scheme for Vim." +" +" File: jellybeans.vim +" Maintainer: NanoTech +" Version: 1.6~git +" Last Change: January 15th, 2012 +" Contributors: Daniel Herbert , +" Henry So, Jr. , +" David Liang , +" Rich Healey (richoH), +" Andrew Wong (w0ng) +" +" Copyright (c) 2009-2012 NanoTech +" +" 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. + +set background=dark + +hi clear + +if exists("syntax_on") + syntax reset +endif + +let colors_name = "jellybeans" + +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 {{{ +" Added to jellybeans.vim by Daniel Herbert + +" 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 +" }}} + +call s:X("Normal","e8e8d3","151515","","White","") +set background=dark + +if !exists("g:jellybeans_use_lowcolor_black") || g:jellybeans_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("Type","ffb964","","","Yellow","") +call s:X("NonText","606060","151515","",s:termBlack,"") + +call s:X("SpecialKey","444444","1c1c1c","",s:termBlack,"") + +call s:X("Search","f0a0c0","302028","underline","Magenta","") + +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 + +" Python + +hi! link pythonOperator Statement + +" 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","","232323","","","") +call s:X("IndentGuidesEven","","1b1b1b","","","") + +" 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 ctermbg=234 + hi CursorLine ctermbg=234 + hi SpecialKey ctermbg=234 + hi NonText ctermbg=233 + hi LineNr ctermbg=233 + hi DiffText ctermfg=81 + hi Normal ctermbg=233 + hi DbgBreakPt ctermbg=53 + hi IndentGuidesOdd ctermbg=235 + hi IndentGuidesEven ctermbg=234 +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 +" }}} diff --git a/.vim/colors/smyck.vim b/.vim/colors/smyck.vim new file mode 100644 index 0000000..12592ad --- /dev/null +++ b/.vim/colors/smyck.vim @@ -0,0 +1,95 @@ +" ---------------------------------------------------------------------------- +" Vim color file +" Maintainer: John-Paul Bader +" Last Change: 2012 April +" License: Beer Ware +" ---------------------------------------------------------------------------- + +" Reset Highlighting +hi clear +if exists("syntax_on") + syntax reset +endif + +set background=dark +set linespace=3 + +let g:colors_name = "smyck" + +hi Normal cterm=none ctermbg=none ctermfg=15 gui=none guibg=#282828 guifg=#F7F7F7 +hi LineNr cterm=none ctermbg=none ctermfg=8 gui=none guibg=#282828 guifg=#8F8F8F +hi StatusLine cterm=none ctermbg=8 ctermfg=15 gui=none guibg=#5D5D5D guifg=#FBFBFB +hi StatusLineNC cterm=none ctermbg=15 ctermfg=8 gui=none guibg=#5D5D5D guifg=#FBFBFB +hi Search cterm=none ctermbg=6 ctermfg=15 gui=none guibg=#2EB5C1 guifg=#F7F7F7 +hi IncSearch cterm=none ctermbg=3 ctermfg=8 gui=none guibg=#F6DC69 guifg=#8F8F8F +hi ColumnMargin cterm=none ctermbg=0 gui=none guibg=#000000 +hi Error cterm=none ctermbg=1 ctermfg=15 gui=none guifg=#F7F7F7 +hi ErrorMsg cterm=none ctermbg=1 ctermfg=15 gui=none guifg=#F7F7F7 +hi Folded cterm=none ctermbg=8 ctermfg=2 gui=none guibg=#3B3B3B guifg=#90AB41 +hi FoldColumn cterm=none ctermbg=8 ctermfg=2 gui=none guibg=#3B3B3B guifg=#90AB41 +hi NonText cterm=bold ctermbg=none ctermfg=8 gui=bold guifg=#8F8F8F +hi ModeMsg cterm=bold ctermbg=none ctermfg=10 gui=none +hi Pmenu cterm=none ctermbg=8 ctermfg=15 gui=none guibg=#8F8F8F guifg=#F7F7F7 +hi PmenuSel cterm=none ctermbg=15 ctermfg=8 gui=none guibg=#F7F7F7 guifg=#8F8F8F +hi PmenuSbar cterm=none ctermbg=15 ctermfg=8 gui=none guibg=#F7F7F7 guifg=#8F8F8F +hi SpellBad cterm=none ctermbg=1 ctermfg=15 gui=none guifg=#F7F7F7 +hi SpellCap cterm=none ctermbg=4 ctermfg=15 gui=none guifg=#F7F7F7 +hi SpellRare cterm=none ctermbg=4 ctermfg=15 gui=none guifg=#F7F7F7 +hi SpellLocal cterm=none ctermbg=4 ctermfg=15 gui=none guifg=#F7F7F7 +hi Visual cterm=none ctermbg=15 ctermfg=8 gui=none guibg=#F7F7F7 guifg=#8F8F8F +hi Directory cterm=none ctermbg=none ctermfg=4 gui=none guibg=#242424 guifg=#88CCE7 +hi SpecialKey cterm=none ctermbg=none ctermfg=8 gui=none guifg=#8F8F8F +hi DiffAdd cterm=bold ctermbg=2 ctermfg=15 +hi DiffChange cterm=bold ctermbg=4 ctermfg=15 +hi DiffDelete cterm=bold ctermbg=1 ctermfg=15 +hi DiffText cterm=bold ctermbg=3 ctermfg=8 +hi MatchParen cterm=none ctermbg=6 ctermfg=15 gui=none guibg=#2EB5C1 guifg=#F7F7F7 +hi CursorLine cterm=none ctermbg=238 ctermfg=none gui=none guibg=#424242 +hi CursorColumn cterm=none ctermbg=238 ctermfg=none gui=none guibg=#424242 +hi Title cterm=none ctermbg=none ctermfg=4 gui=none guifg=#88CCE7 + +" ---------------------------------------------------------------------------- +" Syntax Highlighting +" ---------------------------------------------------------------------------- +hi Keyword cterm=none ctermbg=none ctermfg=10 gui=none guifg=#D1FA71 +hi Comment cterm=none ctermbg=none ctermfg=8 gui=none guifg=#8F8F8F +hi Delimiter cterm=none ctermbg=none ctermfg=15 gui=none guifg=#F7F7F7 +hi Identifier cterm=none ctermbg=none ctermfg=12 gui=none guifg=#96D9F1 +hi Structure cterm=none ctermbg=none ctermfg=12 gui=none guifg=#9DEEF2 +hi Ignore cterm=none ctermbg=none ctermfg=8 gui=none guifg=bg +hi Constant cterm=none ctermbg=none ctermfg=12 gui=none guifg=#96D9F1 +hi PreProc cterm=none ctermbg=none ctermfg=10 gui=none guifg=#D1FA71 +hi Type cterm=none ctermbg=none ctermfg=12 gui=none guifg=#96D9F1 +hi Statement cterm=none ctermbg=none ctermfg=10 gui=none guifg=#D1FA71 +hi Special cterm=none ctermbg=none ctermfg=6 gui=none guifg=#d7d7d7 +hi String cterm=none ctermbg=none ctermfg=3 gui=none guifg=#F6DC69 +hi Number cterm=none ctermbg=none ctermfg=3 gui=none guifg=#F6DC69 +hi Underlined cterm=none ctermbg=none ctermfg=magenta gui=underline guibg=#272727 +hi Symbol cterm=none ctermbg=none ctermfg=9 gui=none guifg=#FAB1AB +hi Method cterm=none ctermbg=none ctermfg=15 gui=none guifg=#F7F7F7 +hi Interpolation cterm=none ctermbg=none ctermfg=6 gui=none guifg=#2EB5C1 + +" Erlang +hi link erlangAtom Keyword +hi link erlangBitType Keyword + +hi link rubyBeginend Keyword +hi link rubyClass Keyword +hi link rubyModule Keyword +hi link rubyKeyword Keyword +hi link rubyOperator Method +hi link rubyIdentifier Keyword +hi link rubyClassVariable Symbol +hi link rubyInstanceVariable Constant +hi link rubyGlobalVariable Constant +hi link rubyClassVariable Method +hi link rubyConstant Constant +hi link rubySymbol Symbol +hi link rubyFunction Constant +hi link rubyControl Keyword +hi link rubyConditional Keyword +hi link rubyInterpolation Interpolation +hi link rubyInterpolationDelimiter Interpolation +hi link rubyRailsMethod Method + + diff --git a/.vim/colors/tomorrow-night-eighties.vim b/.vim/colors/tomorrow-night-eighties.vim new file mode 100644 index 0000000..b9e5966 --- /dev/null +++ b/.vim/colors/tomorrow-night-eighties.vim @@ -0,0 +1,325 @@ +" Tomorrow Night Eighties - Full Colour and 256 Colour +" http://chriskempson.com +" +" Hex colour conversion functions borrowed from the theme "Desert256"" + +" Default GUI Colours +let s:foreground = "cfcfcf" +let s:background = "151515" +let s:selection = "515151" +let s:line = "393939" +let s:comment = "888888" +let s:red = "f2777a" +let s:orange = "f99157" +let s:yellow = "ffcc66" +let s:green = "99cc99" +let s:aqua = "009999" +let s:blue = "99cccc" +let s:purple = "cc99cc" + +set background=dark +hi clear +syntax reset + +let g:colors_name = "tomorrow-night-eighties" + +if has("gui_running") || &t_Co == 88 || &t_Co == 256 + " Returns an approximate grey index for the given grey level + fun 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 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 grey_colour(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 colour index for the given colour level + fun 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 colour level for the given colour index + fun 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 colour indices + fun rgb_colour(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 colour levels + fun colour(r, g, b) + " Get the closest grey + let l:gx = grey_number(a:r) + let l:gy = grey_number(a:g) + let l:gz = grey_number(a:b) + + " Get the closest colour + let l:x = rgb_number(a:r) + let l:y = rgb_number(a:g) + let l:z = rgb_number(a:b) + + if l:gx == l:gy && l:gy == l:gz + " There are two possibilities + let l:dgr = grey_level(l:gx) - a:r + let l:dgg = grey_level(l:gy) - a:g + let l:dgb = grey_level(l:gz) - a:b + let l:dgrey = (l:dgr * l:dgr) + (l:dgg * l:dgg) + (l:dgb * l:dgb) + let l:dr = rgb_level(l:gx) - a:r + let l:dg = rgb_level(l:gy) - a:g + let l:db = 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 grey_colour(l:gx) + else + " Use the colour + return rgb_colour(l:x, l:y, l:z) + endif + else + " Only one possibility + return rgb_colour(l:x, l:y, l:z) + endif + endfun + + " Returns the palette index to approximate the 'rrggbb' hex string + fun 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 colour(l:r, l:g, l:b) + endfun + + " Sets the highlighting for the given group + fun X(group, fg, bg, attr) + if a:fg != "" + exec "hi " . a:group . " guifg=#" . a:fg . " ctermfg=" . rgb(a:fg) + endif + if a:bg != "" + exec "hi " . a:group . " guibg=#" . a:bg . " ctermbg=" . rgb(a:bg) + endif + if a:attr != "" + exec "hi " . a:group . " gui=" . a:attr . " cterm=" . a:attr + endif + endfun + + " Vim Highlighting + call X("Normal", s:foreground, s:background, "") + call X("LineNr", s:comment, s:line, "") + call X("Folded", s:foreground, s:line, "") + call X("ColorColumn", "", s:line, "") + call X("NonText", s:selection, "", "") + call X("SpecialKey", s:selection, "", "") + call X("Search", s:background, s:yellow, "") + call X("TabLine", s:foreground, s:background, "reverse") + "call X("StatusLine", s:foreground, s:background, "reverse") + "call X("StatusLineNC", s:foreground, s:background, "reverse") + call X("Visual", "", s:selection, "") + call X("Directory", s:blue, "", "") + call X("ModeMsg", s:green, "", "") + call X("MoreMsg", s:green, "", "") + call X("Question", s:green, "", "") + call X("WarningMsg", s:red, "", "") + if version >= 700 + call X("CursorLine", "", s:line, "none") + call X("CursorColumn", "", s:line, "none") + call X("PMenu", s:foreground, s:selection, "none") + call X("PMenuSel", s:foreground, s:selection, "reverse") + end + + " Standard Highlighting + call X("Comment", s:comment, "", "") + call X("Todo", s:comment, "", "") + call X("Title", s:comment, "", "") + call X("Identifier", s:red, "", "none") + call X("Statement", s:foreground, "", "") + call X("Conditional", s:foreground, "", "") + call X("Repeat", s:foreground, "", "") + call X("Structure", s:purple, "", "") + call X("Function", s:blue, "", "") + call X("Constant", s:orange, "", "") + call X("String", s:green, "", "") + call X("Special", s:foreground, "", "") + call X("PreProc", s:purple, "", "") + call X("Operator", s:aqua, "", "none") + call X("Type", s:blue, "", "none") + call X("Define", s:purple, "", "none") + call X("Include", s:blue, "", "") + "call X("Ignore", "666666", "", "") + + " Vim Highlighting + call X("vimCommand", s:red, "", "none") + + " C Highlighting + call X("cType", s:yellow, "", "") + call X("cStorageClass", s:purple, "", "") + + " PHP Highlighting + call X("phpVarSelector", s:red, "", "") + call X("phpKeyword", s:purple, "", "") + call X("phpRepeat", s:purple, "", "") + call X("phpConditional", s:purple, "", "") + call X("phpStatement", s:purple, "", "") + call X("phpMemberSelector", s:foreground, "", "") + + " Ruby Highlighting + call X("rubySymbol", s:green, "", "") + call X("rubyConstant", s:yellow, "", "") + call X("rubyAttribute", s:blue, "", "") + call X("rubyInclude", s:blue, "", "") + call X("rubyLocalVariableOrMethod", s:orange, "", "") + call X("rubyCurlyBlock", s:orange, "", "") + + " Python Highlighting + call X("pythonInclude", s:purple, "", "") + call X("pythonStatement", s:purple, "", "") + call X("pythonConditional", s:purple, "", "") + call X("pythonFunction", s:blue, "", "") + + " JavaScript Highlighting + call X("javaScriptBraces", s:foreground, "", "") + call X("javaScriptFunction", s:purple, "", "") + call X("javaScriptConditional", s:purple, "", "") + call X("javaScriptRepeat", s:purple, "", "") + call X("javaScriptNumber", s:orange, "", "") + call X("javaScriptMember", s:orange, "", "") + + " Delete Functions + delf X + delf rgb + delf colour + delf rgb_colour + delf rgb_level + delf rgb_number + delf grey_colour + delf grey_level + delf grey_number +endif diff --git a/.vim/colors/tomorrow-night.vim b/.vim/colors/tomorrow-night.vim new file mode 100644 index 0000000..7dccc88 --- /dev/null +++ b/.vim/colors/tomorrow-night.vim @@ -0,0 +1,332 @@ +" Tomorrow Night - Full Colour and 256 Colour +" http://chriskempson.com +" +" Hex colour conversion functions borrowed from the theme "Desert256"" + +" Default GUI Colours +let s:foreground = "c5c8c6" +let s:background = "1d1f21" +let s:selection = "373b41" +let s:line = "282a2e" +let s:comment = "969896" +let s:red = "cc6666" +let s:orange = "de935f" +let s:yellow = "f0c674" +let s:green = "b5bd68" +let s:aqua = "8abeb7" +let s:blue = "81a2be" +let s:purple = "b294bb" + +" Console 256 Colours +if !has("gui_running") + let s:background = "101010" + let s:line = "3a3a3a" + let s:selection = "585858" +end + +set background=dark +hi clear +syntax reset + +let g:colors_name = "tomorrow-night" + +if has("gui_running") || &t_Co == 88 || &t_Co == 256 + " Returns an approximate grey index for the given grey level + fun 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 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 grey_colour(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 colour index for the given colour level + fun 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 colour level for the given colour index + fun 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 colour indices + fun rgb_colour(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 colour levels + fun colour(r, g, b) + " Get the closest grey + let l:gx = grey_number(a:r) + let l:gy = grey_number(a:g) + let l:gz = grey_number(a:b) + + " Get the closest colour + let l:x = rgb_number(a:r) + let l:y = rgb_number(a:g) + let l:z = rgb_number(a:b) + + if l:gx == l:gy && l:gy == l:gz + " There are two possibilities + let l:dgr = grey_level(l:gx) - a:r + let l:dgg = grey_level(l:gy) - a:g + let l:dgb = grey_level(l:gz) - a:b + let l:dgrey = (l:dgr * l:dgr) + (l:dgg * l:dgg) + (l:dgb * l:dgb) + let l:dr = rgb_level(l:gx) - a:r + let l:dg = rgb_level(l:gy) - a:g + let l:db = 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 grey_colour(l:gx) + else + " Use the colour + return rgb_colour(l:x, l:y, l:z) + endif + else + " Only one possibility + return rgb_colour(l:x, l:y, l:z) + endif + endfun + + " Returns the palette index to approximate the 'rrggbb' hex string + fun 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 colour(l:r, l:g, l:b) + endfun + + " Sets the highlighting for the given group + fun X(group, fg, bg, attr) + if a:fg != "" + exec "hi " . a:group . " guifg=#" . a:fg . " ctermfg=" . rgb(a:fg) + endif + if a:bg != "" + exec "hi " . a:group . " guibg=#" . a:bg . " ctermbg=" . rgb(a:bg) + endif + if a:attr != "" + exec "hi " . a:group . " gui=" . a:attr . " cterm=" . a:attr + endif + endfun + + " Vim Highlighting + call X("Normal", s:foreground, s:background, "") + call X("LineNr", s:comment, s:line, "") + call X("Folded", s:foreground, s:line, "") + call X("ColorColumn", "", s:line, "") + call X("NonText", s:selection, "", "") + call X("SpecialKey", s:selection, "", "") + call X("Search", s:background, s:yellow, "") + call X("TabLine", s:foreground, s:background, "reverse") + call X("StatusLine", s:foreground, s:background, "reverse") + call X("StatusLineNC", s:foreground, s:background, "reverse") + call X("Visual", "", s:selection, "") + call X("Directory", s:blue, "", "") + call X("ModeMsg", s:green, "", "") + call X("MoreMsg", s:green, "", "") + call X("Question", s:green, "", "") + call X("WarningMsg", s:red, "", "") + if version >= 700 + call X("CursorLine", "", s:line, "none") + call X("CursorColumn", "", s:line, "none") + call X("PMenu", s:foreground, s:selection, "none") + call X("PMenuSel", s:foreground, s:selection, "reverse") + end + + " Standard Highlighting + call X("Comment", s:comment, "", "") + call X("Todo", s:comment, "", "") + call X("Title", s:comment, "", "") + call X("Identifier", s:red, "", "none") + call X("Statement", s:foreground, "", "") + call X("Conditional", s:foreground, "", "") + call X("Repeat", s:foreground, "", "") + call X("Structure", s:purple, "", "") + call X("Function", s:blue, "", "") + call X("Constant", s:orange, "", "") + call X("String", s:green, "", "") + call X("Special", s:foreground, "", "") + call X("PreProc", s:purple, "", "") + call X("Operator", s:aqua, "", "none") + call X("Type", s:blue, "", "none") + call X("Define", s:purple, "", "none") + call X("Include", s:blue, "", "") + "call X("Ignore", "666666", "", "") + + " Vim Highlighting + call X("vimCommand", s:red, "", "none") + + " C Highlighting + call X("cType", s:yellow, "", "") + call X("cStorageClass", s:purple, "", "") + + " PHP Highlighting + call X("phpVarSelector", s:red, "", "") + call X("phpKeyword", s:purple, "", "") + call X("phpRepeat", s:purple, "", "") + call X("phpConditional", s:purple, "", "") + call X("phpStatement", s:purple, "", "") + call X("phpMemberSelector", s:foreground, "", "") + + " Ruby Highlighting + call X("rubySymbol", s:green, "", "") + call X("rubyConstant", s:yellow, "", "") + call X("rubyAttribute", s:blue, "", "") + call X("rubyInclude", s:blue, "", "") + call X("rubyLocalVariableOrMethod", s:orange, "", "") + call X("rubyCurlyBlock", s:orange, "", "") + + " Python Highlighting + call X("pythonInclude", s:purple, "", "") + call X("pythonStatement", s:purple, "", "") + call X("pythonConditional", s:purple, "", "") + call X("pythonFunction", s:blue, "", "") + + " JavaScript Highlighting + call X("javaScriptBraces", s:foreground, "", "") + call X("javaScriptFunction", s:purple, "", "") + call X("javaScriptConditional", s:purple, "", "") + call X("javaScriptRepeat", s:purple, "", "") + call X("javaScriptNumber", s:orange, "", "") + call X("javaScriptMember", s:orange, "", "") + + " Delete Functions + delf X + delf rgb + delf colour + delf rgb_colour + delf rgb_level + delf rgb_number + delf grey_colour + delf grey_level + delf grey_number +endif diff --git a/.vim/doc/AnsiEsc.txt b/.vim/doc/AnsiEsc.txt new file mode 100644 index 0000000..4fe361e --- /dev/null +++ b/.vim/doc/AnsiEsc.txt @@ -0,0 +1,134 @@ +*AnsiEsc.txt* Ansi Escape Sequence Visualization Dec 13, 2010 + +Author: Charles E. Campbell, Jr. + (remove NOSPAM from Campbell's email first) +Copyright: (c) 2004-2010 by Charles E. Campbell, Jr. *AnsiEsc-copyright* + The VIM LICENSE applies to AnsiEsc.vim and AnsiEsc.txt + (see |copyright|) except use "AnsiEsc" instead of "Vim". + No warranty, express or implied. Use At-Your-Own-Risk. + +============================================================================== +1. Contents *AnsiEsc* *AnsiEsc-contents* + 1. Contents ...................................|AnsiEsc-contents| + 2. AnsiEsc Manual ...................................|AnsiEsc| + 3. AnsiEsc History ...................................|AnsiEsc-history| + +============================================================================== +2. Manual *AnsiEsc-manual* + + CONCEAL -- the best mode. + For this, your vim must have +conceal. A typical way to get the + conceal feature: + + * cd ..wherever../vim72/ + * wget http://vince.negri.googlepages.com/conceal-ownsyntax.diff + * patch -p0 < conceal-ownsyntax.diff + * make distclean + * configure --with-features=huge + * make + * make install + + Normal: -- ansi escape sequences themselves are Ignore'd~ + Ansi escape sequences have the expected effect on subsequent + text, but the ansi escape sequences themselves still take up + screen columns. The sequences are displayed using "Ignore" + highlighting; depending on your colorscheme, this should either + make the sequences blend into your background or be visually + suppressed. If the sequences aren't suppressed, you need to + improve your colorscheme! + + USAGE~ + :AnsiEsc -- toggles Ansi escape sequence highlighting + :AnsiEsc! -- rebuilds highlighting for new/removed three + or more element Ansi escape sequences. + + RESULT~ + Ansi escape sequences become concealed or ignored (depending + on whether your vim supports Negri's conceal mode), and their + effect on subsequent text is emulated with Vim's syntax + highlighting. + + Syntax highlighting for one and two element codes are + hard-coded into AnsiEsc.vim. There are too many possibilities + for three or more element codes; these are supported by + examining the file for such sequences and only building syntax + highlighting rules for such sequences as are actually present + in the document. + + EXAMPLE~ + + You'll want to use :AnsiEsc to see the following properly! + (using Vince Negri's conceal option or vim 7.3) + + Color Escape Sequences + -   1   2   3   4   5   7  +black black black black black black black +red red red red red red red +green green green green green green green +yellow yellow yellow yellow yellow yellow yellow +blue blue blue blue blue blue blue +magenta magenta magenta magenta magenta magenta magenta +cyan cyan cyan cyan cyan cyan cyan +white white white white white white white + +Black B B B B B B B B +Red R R R R R R R R +Green G G G G G G G G +Yellow Y Y Y Y Y Y Y Y +Blue B B B B B B B B +Magenta M M M M M M M M +Cyan C C C C C C C C +White W W W W W W W W + + Here's the vim logo: + + / \ + / \ + / \ + / \ + +----+ +----+ \ + ++ ++ +- | \ + /| | / / \ +X | | / /O \ + \| | / /+-+ +-\//-+ + | |/ / | | | v | + | / / | | | + +| + | / | |/| |\/|| + +----\ +-+ +-+ ++ + \ / + \ / + + +============================================================================== +3. AnsiEsc History *AnsiEsc-history* {{{1 + v12 Jul 23, 2010 * changed conc to |'cole'| to correspond to vim 7.3's + change + Aug 10, 2010 * (Rainer M Schmid) changed conceallevel setting to + depend on whether the version is before vim 7.3; + for 7.3, also sets concealcursor + * Restores conc/cole/cocu settings when AnsiEsc is + toggled off. + Dec 13, 2010 * Included some additional sequences involving 0 + v11 Apr 20, 2010 * AnsiEsc now supports enabling/disabling via a menu + * [K and [00m now supported (as + grep --color=always issues them) + v10 May 06, 2009 * Three or more codes in an ANSI escape sequence are + supported by building custom syntax and highlighting + commands. + May 20, 2009 * cecutil bugfix + v9 May 12, 2008 * Now in plugin + autoload format. Provides :AnsiEsc + command to toggle Ansi-escape sequence processing. + Jan 01, 2009 * Applies Ignore highlighting to extended Ansi escape + sequences support 256-colors. + Mar 18, 2009 * Includes "rapid blink" ansi escape sequences. Vim + doesn't have a blinking attribute, so such text uses + "standout" for vim and "undercurl" for gvim. + v8 Aug 16, 2006 * Uses undercurl, and so is only available for vim 7.0 + v7 Dec 14, 2004 * Works better with vim2ansi output and Vince Negri's + conceal patch for vim 6.x. + v2 Nov 24, 2004 * This version didn't use Vince Negri's conceal patch + (used Ignore highlighting) + +============================================================================== +Modelines: {{{1 +vim:tw=78:ts=8:ft=help:fdm=marker: diff --git a/.vim/doc/LargeFile.txt b/.vim/doc/LargeFile.txt new file mode 100644 index 0000000..13ceead --- /dev/null +++ b/.vim/doc/LargeFile.txt @@ -0,0 +1,55 @@ +*LargeFile.txt* Editing Large Files Quickly Sep 23, 2008 + +Author: Charles E. Campbell, Jr. + (remove NOSPAM from Campbell's email first) +Copyright: (c) 2004-2008 by Charles E. Campbell, Jr. *LargeFile-copyright* + The VIM LICENSE applies to LargeFile.vim + (see |copyright|) except use "LargeFile" instead of "Vim" + No warranty, express or implied. Use At-Your-Own-Risk. + +============================================================================== +1. Large File Plugin *largefile* {{{1 + +The LargeFile plugin is fairly short -- it simply sets up an |autocmd| that +checks for large files. There is one parameter: > + g:LargeFile +which, by default, is 20MB. Thus with this value of g:LargeFile, 20MByte +files and larger are considered to be "large files"; smaller ones aren't. Of +course, you as a user may set g:LargeFile to whatever you want in your +<.vimrc> (in units of MBytes). + +LargeFile.vim always assumes that when the file size is larger than what +can fit into a signed integer (2^31, ie. about 2GB) that the file is "Large". + +Basically, this autocmd simply turns off a number of features in Vim, +including event handling, undo, and syntax highlighting, in the interest of +speed and responsiveness. + +LargeFile.vim borrows from vimtip#611. + +To undo what LargeFile does, type > + :Unlarge +< +To redo what LargeFile does, type > + :Large +< +Note that LargeFile cannot alleviate hardware limitations; vim on 32-bit +machines are limited to editing 2G files. If your vim is compiled on a 64-bit +machine such that it can take advantage of the additional address space, then +presumably vim could edit up to 9.7 quadrillion byte files (not that I've ever +tried that!). + +============================================================================== +2. History *largefile-history* {{{1 + + 4 : Jan 03, 2008 * made LargeFile.vim :AutoInstall:-able by getscript + Apr 11, 2008 * (Daniel Shahaf suggested) that :Large! do the large-file + handling irregardless of file size. Implemented. + Sep 23, 2008 * if getfsize() returns -2 then the file is assumed to be + large + 3 : May 24, 2007 * Unlarge command included + * If getfsize() returns something less than -1, then it + will automatically be assumed to be a large file. + +============================================================================== +vim:tw=78:ts=8:ft=help:fdm=marker: diff --git a/.vim/doc/NERD_tree.txt b/.vim/doc/NERD_tree.txt new file mode 100644 index 0000000..2e2278c --- /dev/null +++ b/.vim/doc/NERD_tree.txt @@ -0,0 +1,1222 @@ +*NERD_tree.txt* A tree explorer plugin that owns your momma! + + + + omg its ... ~ + + ________ ________ _ ____________ ____ __________ ____________~ + /_ __/ / / / ____/ / | / / ____/ __ \/ __ \ /_ __/ __ \/ ____/ ____/~ + / / / /_/ / __/ / |/ / __/ / /_/ / / / / / / / /_/ / __/ / __/ ~ + / / / __ / /___ / /| / /___/ _, _/ /_/ / / / / _, _/ /___/ /___ ~ + /_/ /_/ /_/_____/ /_/ |_/_____/_/ |_/_____/ /_/ /_/ |_/_____/_____/ ~ + + + Reference Manual~ + + + + +============================================================================== +CONTENTS *NERDTree-contents* + + 1.Intro...................................|NERDTree| + 2.Functionality provided..................|NERDTreeFunctionality| + 2.1.Global commands...................|NERDTreeGlobalCommands| + 2.2.Bookmarks.........................|NERDTreeBookmarks| + 2.2.1.The bookmark table..........|NERDTreeBookmarkTable| + 2.2.2.Bookmark commands...........|NERDTreeBookmarkCommands| + 2.2.3.Invalid bookmarks...........|NERDTreeInvalidBookmarks| + 2.3.NERD tree mappings................|NERDTreeMappings| + 2.4.The NERD tree menu................|NERDTreeMenu| + 3.Options.................................|NERDTreeOptions| + 3.1.Option summary....................|NERDTreeOptionSummary| + 3.2.Option details....................|NERDTreeOptionDetails| + 4.The NERD tree API.......................|NERDTreeAPI| + 4.1.Key map API.......................|NERDTreeKeymapAPI| + 4.2.Menu API..........................|NERDTreeMenuAPI| + 5.About...................................|NERDTreeAbout| + 6.Changelog...............................|NERDTreeChangelog| + 7.Credits.................................|NERDTreeCredits| + 8.License.................................|NERDTreeLicense| + +============================================================================== +1. Intro *NERDTree* + +What is this "NERD tree"?? + +The NERD tree allows you to explore your filesystem and to open files and +directories. It presents the filesystem to you in the form of a tree which you +manipulate with the keyboard and/or mouse. It also allows you to perform +simple filesystem operations. + +The following features and functionality are provided by the NERD tree: + * Files and directories are displayed in a hierarchical tree structure + * Different highlighting is provided for the following types of nodes: + * files + * directories + * sym-links + * windows .lnk files + * read-only files + * executable files + * Many (customisable) mappings are provided to manipulate the tree: + * Mappings to open/close/explore directory nodes + * Mappings to open files in new/existing windows/tabs + * Mappings to change the current root of the tree + * Mappings to navigate around the tree + * ... + * Directories and files can be bookmarked. + * Most NERD tree navigation can also be done with the mouse + * Filtering of tree content (can be toggled at runtime) + * custom file filters to prevent e.g. vim backup files being displayed + * optional displaying of hidden files (. files) + * files can be "turned off" so that only directories are displayed + * The position and size of the NERD tree window can be customised + * The order in which the nodes in the tree are listed can be customised. + * A model of your filesystem is created/maintained as you explore it. This + has several advantages: + * All filesystem information is cached and is only re-read on demand + * If you revisit a part of the tree that you left earlier in your + session, the directory nodes will be opened/closed as you left them + * The script remembers the cursor position and window position in the NERD + tree so you can toggle it off (or just close the tree window) and then + reopen it (with NERDTreeToggle) the NERD tree window will appear exactly + as you left it + * You can have a separate NERD tree for each tab, share trees across tabs, + or a mix of both. + * By default the script overrides the default file browser (netw), so if + you :edit a directory a (slighly modified) NERD tree will appear in the + current window + * A programmable menu system is provided (simulates right clicking on a + node) + * one default menu plugin is provided to perform basic filesytem + operations (create/delete/move/copy files/directories) + * There's an API for adding your own keymappings + + +============================================================================== +2. Functionality provided *NERDTreeFunctionality* + +------------------------------------------------------------------------------ +2.1. Global Commands *NERDTreeGlobalCommands* + +:NERDTree [ | ] *:NERDTree* + Opens a fresh NERD tree. The root of the tree depends on the argument + given. There are 3 cases: If no argument is given, the current directory + will be used. If a directory is given, that will be used. If a bookmark + name is given, the corresponding directory will be used. For example: > + :NERDTree /home/marty/vim7/src + :NERDTree foo (foo is the name of a bookmark) +< +:NERDTreeFromBookmark *:NERDTreeFromBookmark* + Opens a fresh NERD tree with the root initialized to the dir for + . This only reason to use this command over :NERDTree is for + the completion (which is for bookmarks rather than directories). + +:NERDTreeToggle [ | ] *:NERDTreeToggle* + If a NERD tree already exists for this tab, it is reopened and rendered + again. If no NERD tree exists for this tab then this command acts the + same as the |:NERDTree| command. + +:NERDTreeMirror *:NERDTreeMirror* + Shares an existing NERD tree, from another tab, in the current tab. + Changes made to one tree are reflected in both as they are actually the + same buffer. + + If only one other NERD tree exists, that tree is automatically mirrored. If + more than one exists, the script will ask which tree to mirror. + +:NERDTreeClose *:NERDTreeClose* + Close the NERD tree in this tab. + +:NERDTreeFind *:NERDTreeFind* + Find the current file in the tree. If no tree exists for the current tab, + or the file is not under the current root, then initialize a new tree where + the root is the directory of the current file. + +------------------------------------------------------------------------------ +2.2. Bookmarks *NERDTreeBookmarks* + +Bookmarks in the NERD tree are a way to tag files or directories of interest. +For example, you could use bookmarks to tag all of your project directories. + +------------------------------------------------------------------------------ +2.2.1. The Bookmark Table *NERDTreeBookmarkTable* + +If the bookmark table is active (see |NERDTree-B| and +|'NERDTreeShowBookmarks'|), it will be rendered above the tree. You can double +click bookmarks or use the |NERDTree-o| mapping to activate them. See also, +|NERDTree-t| and |NERDTree-T| + +------------------------------------------------------------------------------ +2.2.2. Bookmark commands *NERDTreeBookmarkCommands* + +Note that the following commands are only available in the NERD tree buffer. + +:Bookmark + Bookmark the current node as . If there is already a + bookmark, it is overwritten. must not contain spaces. + +:BookmarkToRoot + Make the directory corresponding to the new root. If a treenode + corresponding to is already cached somewhere in the tree then + the current tree will be used, otherwise a fresh tree will be opened. + Note that if points to a file then its parent will be used + instead. + +:RevealBookmark + If the node is cached under the current root then it will be revealed + (i.e. directory nodes above it will be opened) and the cursor will be + placed on it. + +:OpenBookmark + must point to a file. The file is opened as though |NERDTree-o| + was applied. If the node is cached under the current root then it will be + revealed and the cursor will be placed on it. + +:ClearBookmarks [] + Remove all the given bookmarks. If no bookmarks are given then remove all + bookmarks on the current node. + +:ClearAllBookmarks + Remove all bookmarks. + +:ReadBookmarks + Re-read the bookmarks in the |'NERDTreeBookmarksFile'|. + +See also |:NERDTree| and |:NERDTreeFromBookmark|. + +------------------------------------------------------------------------------ +2.2.3. Invalid Bookmarks *NERDTreeInvalidBookmarks* + +If invalid bookmarks are detected, the script will issue an error message and +the invalid bookmarks will become unavailable for use. + +These bookmarks will still be stored in the bookmarks file (see +|'NERDTreeBookmarksFile'|), down the bottom. There will always be a blank line +after the valid bookmarks but before the invalid ones. + +Each line in the bookmarks file represents one bookmark. The proper format is: + + +After you have corrected any invalid bookmarks, either restart vim, or go +:ReadBookmarks from the NERD tree window. + +------------------------------------------------------------------------------ +2.3. NERD tree Mappings *NERDTreeMappings* + +Default Description~ help-tag~ +Key~ + +o.......Open files, directories and bookmarks....................|NERDTree-o| +go......Open selected file, but leave cursor in the NERDTree.....|NERDTree-go| +t.......Open selected node/bookmark in a new tab.................|NERDTree-t| +T.......Same as 't' but keep the focus on the current tab........|NERDTree-T| +i.......Open selected file in a split window.....................|NERDTree-i| +gi......Same as i, but leave the cursor on the NERDTree..........|NERDTree-gi| +s.......Open selected file in a new vsplit.......................|NERDTree-s| +gs......Same as s, but leave the cursor on the NERDTree..........|NERDTree-gs| +O.......Recursively open the selected directory..................|NERDTree-O| +x.......Close the current nodes parent...........................|NERDTree-x| +X.......Recursively close all children of the current node.......|NERDTree-X| +e.......Edit the current dif.....................................|NERDTree-e| + +...............same as |NERDTree-o|. +double-click.......same as the |NERDTree-o| map. +middle-click.......same as |NERDTree-i| for files, same as + |NERDTree-e| for dirs. + +D.......Delete the current bookmark .............................|NERDTree-D| + +P.......Jump to the root node....................................|NERDTree-P| +p.......Jump to current nodes parent.............................|NERDTree-p| +K.......Jump up inside directories at the current tree depth.....|NERDTree-K| +J.......Jump down inside directories at the current tree depth...|NERDTree-J| +...Jump down to the next sibling of the current directory...|NERDTree-C-J| +...Jump up to the previous sibling of the current directory.|NERDTree-C-K| + +C.......Change the tree root to the selected dir.................|NERDTree-C| +u.......Move the tree root up one directory......................|NERDTree-u| +U.......Same as 'u' except the old root node is left open........|NERDTree-U| +r.......Recursively refresh the current directory................|NERDTree-r| +R.......Recursively refresh the current root.....................|NERDTree-R| +m.......Display the NERD tree menu...............................|NERDTree-m| +cd......Change the CWD to the dir of the selected node...........|NERDTree-cd| + +I.......Toggle whether hidden files displayed....................|NERDTree-I| +f.......Toggle whether the file filters are used.................|NERDTree-f| +F.......Toggle whether files are displayed.......................|NERDTree-F| +B.......Toggle whether the bookmark table is displayed...........|NERDTree-B| + +q.......Close the NERDTree window................................|NERDTree-q| +A.......Zoom (maximize/minimize) the NERDTree window.............|NERDTree-A| +?.......Toggle the display of the quick help.....................|NERDTree-?| + +------------------------------------------------------------------------------ + *NERDTree-o* +Default key: o +Map option: NERDTreeMapActivateNode +Applies to: files and directories. + +If a file node is selected, it is opened in the previous window. + +If a directory is selected it is opened or closed depending on its current +state. + +If a bookmark that links to a directory is selected then that directory +becomes the new root. + +If a bookmark that links to a file is selected then that file is opened in the +previous window. + +------------------------------------------------------------------------------ + *NERDTree-go* +Default key: go +Map option: None +Applies to: files. + +If a file node is selected, it is opened in the previous window, but the +cursor does not move. + +The key combo for this mapping is always "g" + NERDTreeMapActivateNode (see +|NERDTree-o|). + +------------------------------------------------------------------------------ + *NERDTree-t* +Default key: t +Map option: NERDTreeMapOpenInTab +Applies to: files and directories. + +Opens the selected file in a new tab. If a directory is selected, a fresh +NERD Tree for that directory is opened in a new tab. + +If a bookmark which points to a directory is selected, open a NERD tree for +that directory in a new tab. If the bookmark points to a file, open that file +in a new tab. + +------------------------------------------------------------------------------ + *NERDTree-T* +Default key: T +Map option: NERDTreeMapOpenInTabSilent +Applies to: files and directories. + +The same as |NERDTree-t| except that the focus is kept in the current tab. + +------------------------------------------------------------------------------ + *NERDTree-i* +Default key: i +Map option: NERDTreeMapOpenSplit +Applies to: files. + +Opens the selected file in a new split window and puts the cursor in the new +window. + +------------------------------------------------------------------------------ + *NERDTree-gi* +Default key: gi +Map option: None +Applies to: files. + +The same as |NERDTree-i| except that the cursor is not moved. + +The key combo for this mapping is always "g" + NERDTreeMapOpenSplit (see +|NERDTree-i|). + +------------------------------------------------------------------------------ + *NERDTree-s* +Default key: s +Map option: NERDTreeMapOpenVSplit +Applies to: files. + +Opens the selected file in a new vertically split window and puts the cursor in +the new window. + +------------------------------------------------------------------------------ + *NERDTree-gs* +Default key: gs +Map option: None +Applies to: files. + +The same as |NERDTree-s| except that the cursor is not moved. + +The key combo for this mapping is always "g" + NERDTreeMapOpenVSplit (see +|NERDTree-s|). + +------------------------------------------------------------------------------ + *NERDTree-O* +Default key: O +Map option: NERDTreeMapOpenRecursively +Applies to: directories. + +Recursively opens the selelected directory. + +All files and directories are cached, but if a directory would not be +displayed due to file filters (see |'NERDTreeIgnore'| |NERDTree-f|) or the +hidden file filter (see |'NERDTreeShowHidden'|) then its contents are not +cached. This is handy, especially if you have .svn directories. + +------------------------------------------------------------------------------ + *NERDTree-x* +Default key: x +Map option: NERDTreeMapCloseDir +Applies to: files and directories. + +Closes the parent of the selected node. + +------------------------------------------------------------------------------ + *NERDTree-X* +Default key: X +Map option: NERDTreeMapCloseChildren +Applies to: directories. + +Recursively closes all children of the selected directory. + +Tip: To quickly "reset" the tree, use |NERDTree-P| with this mapping. + +------------------------------------------------------------------------------ + *NERDTree-e* +Default key: e +Map option: NERDTreeMapOpenExpl +Applies to: files and directories. + +|:edit|s the selected directory, or the selected file's directory. This could +result in a NERD tree or a netrw being opened, depending on +|'NERDTreeHijackNetrw'|. + +------------------------------------------------------------------------------ + *NERDTree-D* +Default key: D +Map option: NERDTreeMapDeleteBookmark +Applies to: lines in the bookmarks table + +Deletes the currently selected bookmark. + +------------------------------------------------------------------------------ + *NERDTree-P* +Default key: P +Map option: NERDTreeMapJumpRoot +Applies to: no restrictions. + +Jump to the tree root. + +------------------------------------------------------------------------------ + *NERDTree-p* +Default key: p +Map option: NERDTreeMapJumpParent +Applies to: files and directories. + +Jump to the parent node of the selected node. + +------------------------------------------------------------------------------ + *NERDTree-K* +Default key: K +Map option: NERDTreeMapJumpFirstChild +Applies to: files and directories. + +Jump to the first child of the current nodes parent. + +If the cursor is already on the first node then do the following: + * loop back thru the siblings of the current nodes parent until we find an + open dir with children + * go to the first child of that node + +------------------------------------------------------------------------------ + *NERDTree-J* +Default key: J +Map option: NERDTreeMapJumpLastChild +Applies to: files and directories. + +Jump to the last child of the current nodes parent. + +If the cursor is already on the last node then do the following: + * loop forward thru the siblings of the current nodes parent until we find + an open dir with children + * go to the last child of that node + +------------------------------------------------------------------------------ + *NERDTree-C-J* +Default key: +Map option: NERDTreeMapJumpNextSibling +Applies to: files and directories. + +Jump to the next sibling of the selected node. + +------------------------------------------------------------------------------ + *NERDTree-C-K* +Default key: +Map option: NERDTreeMapJumpPrevSibling +Applies to: files and directories. + +Jump to the previous sibling of the selected node. + +------------------------------------------------------------------------------ + *NERDTree-C* +Default key: C +Map option: NERDTreeMapChdir +Applies to: directories. + +Make the selected directory node the new tree root. If a file is selected, its +parent is used. + +------------------------------------------------------------------------------ + *NERDTree-u* +Default key: u +Map option: NERDTreeMapUpdir +Applies to: no restrictions. + +Move the tree root up a dir (like doing a "cd .."). + +------------------------------------------------------------------------------ + *NERDTree-U* +Default key: U +Map option: NERDTreeMapUpdirKeepOpen +Applies to: no restrictions. + +Like |NERDTree-u| except that the old tree root is kept open. + +------------------------------------------------------------------------------ + *NERDTree-r* +Default key: r +Map option: NERDTreeMapRefresh +Applies to: files and directories. + +If a dir is selected, recursively refresh that dir, i.e. scan the filesystem +for changes and represent them in the tree. + +If a file node is selected then the above is done on it's parent. + +------------------------------------------------------------------------------ + *NERDTree-R* +Default key: R +Map option: NERDTreeMapRefreshRoot +Applies to: no restrictions. + +Recursively refresh the tree root. + +------------------------------------------------------------------------------ + *NERDTree-m* +Default key: m +Map option: NERDTreeMapMenu +Applies to: files and directories. + +Display the NERD tree menu. See |NERDTreeMenu| for details. + +------------------------------------------------------------------------------ + *NERDTree-cd* +Default key: cd +Map option: NERDTreeMapChdir +Applies to: files and directories. + +Change vims current working directory to that of the selected node. + +------------------------------------------------------------------------------ + *NERDTree-I* +Default key: I +Map option: NERDTreeMapToggleHidden +Applies to: no restrictions. + +Toggles whether hidden files (i.e. "dot files") are displayed. + +------------------------------------------------------------------------------ + *NERDTree-f* +Default key: f +Map option: NERDTreeMapToggleFilters +Applies to: no restrictions. + +Toggles whether file filters are used. See |'NERDTreeIgnore'| for details. + +------------------------------------------------------------------------------ + *NERDTree-F* +Default key: F +Map option: NERDTreeMapToggleFiles +Applies to: no restrictions. + +Toggles whether file nodes are displayed. + +------------------------------------------------------------------------------ + *NERDTree-B* +Default key: B +Map option: NERDTreeMapToggleBookmarks +Applies to: no restrictions. + +Toggles whether the bookmarks table is displayed. + +------------------------------------------------------------------------------ + *NERDTree-q* +Default key: q +Map option: NERDTreeMapQuit +Applies to: no restrictions. + +Closes the NERDtree window. + +------------------------------------------------------------------------------ + *NERDTree-A* +Default key: A +Map option: NERDTreeMapToggleZoom +Applies to: no restrictions. + +Maximize (zoom) and minimize the NERDtree window. + +------------------------------------------------------------------------------ + *NERDTree-?* +Default key: ? +Map option: NERDTreeMapHelp +Applies to: no restrictions. + +Toggles whether the quickhelp is displayed. + +------------------------------------------------------------------------------ +2.3. The NERD tree menu *NERDTreeMenu* + +The NERD tree has a menu that can be programmed via the an API (see +|NERDTreeMenuAPI|). The idea is to simulate the "right click" menus that most +file explorers have. + +The script comes with two default menu plugins: exec_menuitem.vim and +fs_menu.vim. fs_menu.vim adds some basic filesystem operations to the menu for +creating/deleting/moving/copying files and dirs. exec_menuitem.vim provides a +menu item to execute executable files. + +Related tags: |NERDTree-m| |NERDTreeApi| + +============================================================================== +3. Customisation *NERDTreeOptions* + + +------------------------------------------------------------------------------ +3.1. Customisation summary *NERDTreeOptionSummary* + +The script provides the following options that can customise the behaviour the +NERD tree. These options should be set in your vimrc. + +|'loaded_nerd_tree'| Turns off the script. + +|'NERDChristmasTree'| Tells the NERD tree to make itself colourful + and pretty. + +|'NERDTreeAutoCenter'| Controls whether the NERD tree window centers + when the cursor moves within a specified + distance to the top/bottom of the window. +|'NERDTreeAutoCenterThreshold'| Controls the sensitivity of autocentering. + +|'NERDTreeCaseSensitiveSort'| Tells the NERD tree whether to be case + sensitive or not when sorting nodes. + +|'NERDTreeChDirMode'| Tells the NERD tree if/when it should change + vim's current working directory. + +|'NERDTreeHighlightCursorline'| Tell the NERD tree whether to highlight the + current cursor line. + +|'NERDTreeHijackNetrw'| Tell the NERD tree whether to replace the netrw + autocommands for exploring local directories. + +|'NERDTreeIgnore'| Tells the NERD tree which files to ignore. + +|'NERDTreeBookmarksFile'| Where the bookmarks are stored. + +|'NERDTreeMouseMode'| Tells the NERD tree how to handle mouse + clicks. + +|'NERDTreeQuitOnOpen'| Closes the tree window after opening a file. + +|'NERDTreeShowBookmarks'| Tells the NERD tree whether to display the + bookmarks table on startup. + +|'NERDTreeShowFiles'| Tells the NERD tree whether to display files + in the tree on startup. + +|'NERDTreeShowHidden'| Tells the NERD tree whether to display hidden + files on startup. + +|'NERDTreeShowLineNumbers'| Tells the NERD tree whether to display line + numbers in the tree window. + +|'NERDTreeSortOrder'| Tell the NERD tree how to sort the nodes in + the tree. + +|'NERDTreeStatusline'| Set a statusline for NERD tree windows. + +|'NERDTreeWinPos'| Tells the script where to put the NERD tree + window. + +|'NERDTreeWinSize'| Sets the window size when the NERD tree is + opened. + +------------------------------------------------------------------------------ +3.2. Customisation details *NERDTreeOptionDetails* + +To enable any of the below options you should put the given line in your +~/.vimrc + + *'loaded_nerd_tree'* +If this plugin is making you feel homicidal, it may be a good idea to turn it +off with this line in your vimrc: > + let loaded_nerd_tree=1 +< +------------------------------------------------------------------------------ + *'NERDChristmasTree'* +Values: 0 or 1. +Default: 1. + +If this option is set to 1 then some extra syntax highlighting elements are +added to the nerd tree to make it more colourful. + +Set it to 0 for a more vanilla looking tree. + +------------------------------------------------------------------------------ + *'NERDTreeAutoCenter'* +Values: 0 or 1. +Default: 1 + +If set to 1, the NERD tree window will center around the cursor if it moves to +within |'NERDTreeAutoCenterThreshold'| lines of the top/bottom of the window. + +This is ONLY done in response to tree navigation mappings, +i.e. |NERDTree-J| |NERDTree-K| |NERDTree-C-J| |NERDTree-C-K| |NERDTree-p| +|NERDTree-P| + +The centering is done with a |zz| operation. + +------------------------------------------------------------------------------ + *'NERDTreeAutoCenterThreshold'* +Values: Any natural number. +Default: 3 + +This option controls the "sensitivity" of the NERD tree auto centering. See +|'NERDTreeAutoCenter'| for details. + +------------------------------------------------------------------------------ + *'NERDTreeCaseSensitiveSort'* +Values: 0 or 1. +Default: 0. + +By default the NERD tree does not sort nodes case sensitively, i.e. nodes +could appear like this: > + bar.c + Baz.c + blarg.c + boner.c + Foo.c +< +But, if you set this option to 1 then the case of the nodes will be taken into +account. The above nodes would then be sorted like this: > + Baz.c + Foo.c + bar.c + blarg.c + boner.c +< +------------------------------------------------------------------------------ + *'NERDTreeChDirMode'* + +Values: 0, 1 or 2. +Default: 0. + +Use this option to tell the script when (if at all) to change the current +working directory (CWD) for vim. + +If it is set to 0 then the CWD is never changed by the NERD tree. + +If set to 1 then the CWD is changed when the NERD tree is first loaded to the +directory it is initialized in. For example, if you start the NERD tree with > + :NERDTree /home/marty/foobar +< +then the CWD will be changed to /home/marty/foobar and will not be changed +again unless you init another NERD tree with a similar command. + +If the option is set to 2 then it behaves the same as if set to 1 except that +the CWD is changed whenever the tree root is changed. For example, if the CWD +is /home/marty/foobar and you make the node for /home/marty/foobar/baz the new +root then the CWD will become /home/marty/foobar/baz. + +------------------------------------------------------------------------------ + *'NERDTreeHighlightCursorline'* +Values: 0 or 1. +Default: 1. + +If set to 1, the current cursor line in the NERD tree buffer will be +highlighted. This is done using the |'cursorline'| option. + +------------------------------------------------------------------------------ + *'NERDTreeHijackNetrw'* +Values: 0 or 1. +Default: 1. + +If set to 1, doing a > + :edit +< +will open up a "secondary" NERD tree instead of a netrw in the target window. + +Secondary NERD trees behaves slighly different from a regular trees in the +following respects: + 1. 'o' will open the selected file in the same window as the tree, + replacing it. + 2. you can have as many secondary tree as you want in the same tab. + +------------------------------------------------------------------------------ + *'NERDTreeIgnore'* +Values: a list of regular expressions. +Default: ['\~$']. + +This option is used to specify which files the NERD tree should ignore. It +must be a list of regular expressions. When the NERD tree is rendered, any +files/dirs that match any of the regex's in 'NERDTreeIgnore' wont be +displayed. + +For example if you put the following line in your vimrc: > + let NERDTreeIgnore=['\.vim$', '\~$'] +< +then all files ending in .vim or ~ will be ignored. + +Note: to tell the NERD tree not to ignore any files you must use the following +line: > + let NERDTreeIgnore=[] +< + +The file filters can be turned on and off dynamically with the |NERDTree-f| +mapping. + +------------------------------------------------------------------------------ + *'NERDTreeBookmarksFile'* +Values: a path +Default: $HOME/.NERDTreeBookmarks + +This is where bookmarks are saved. See |NERDTreeBookmarkCommands|. + +------------------------------------------------------------------------------ + *'NERDTreeMouseMode'* +Values: 1, 2 or 3. +Default: 1. + +If set to 1 then a double click on a node is required to open it. +If set to 2 then a single click will open directory nodes, while a double +click will still be required for file nodes. +If set to 3 then a single click will open any node. + +Note: a double click anywhere on a line that a tree node is on will +activate it, but all single-click activations must be done on name of the node +itself. For example, if you have the following node: > + | | |-application.rb +< +then (to single click activate it) you must click somewhere in +'application.rb'. + +------------------------------------------------------------------------------ + *'NERDTreeQuitOnOpen'* + +Values: 0 or 1. +Default: 0 + +If set to 1, the NERD tree window will close after opening a file with the +|NERDTree-o|, |NERDTree-i|, |NERDTree-t| and |NERDTree-T| mappings. + +------------------------------------------------------------------------------ + *'NERDTreeShowBookmarks'* +Values: 0 or 1. +Default: 0. + +If this option is set to 1 then the bookmarks table will be displayed. + +This option can be toggled dynamically, per tree, with the |NERDTree-B| +mapping. + +------------------------------------------------------------------------------ + *'NERDTreeShowFiles'* +Values: 0 or 1. +Default: 1. + +If this option is set to 1 then files are displayed in the NERD tree. If it is +set to 0 then only directories are displayed. + +This option can be toggled dynamically, per tree, with the |NERDTree-F| +mapping and is useful for drastically shrinking the tree when you are +navigating to a different part of the tree. + +------------------------------------------------------------------------------ + *'NERDTreeShowHidden'* +Values: 0 or 1. +Default: 0. + +This option tells vim whether to display hidden files by default. This option +can be dynamically toggled, per tree, with the |NERDTree-I| mapping. Use one +of the follow lines to set this option: > + let NERDTreeShowHidden=0 + let NERDTreeShowHidden=1 +< + +------------------------------------------------------------------------------ + *'NERDTreeShowLineNumbers'* +Values: 0 or 1. +Default: 0. + +This option tells vim whether to display line numbers for the NERD tree +window. Use one of the follow lines to set this option: > + let NERDTreeShowLineNumbers=0 + let NERDTreeShowLineNumbers=1 +< + +------------------------------------------------------------------------------ + *'NERDTreeSortOrder'* +Values: a list of regular expressions. +Default: ['\/$', '*', '\.swp$', '\.bak$', '\~$'] + +This option is set to a list of regular expressions which are used to +specify the order of nodes under their parent. + +For example, if the option is set to: > + ['\.vim$', '\.c$', '\.h$', '*', 'foobar'] +< +then all .vim files will be placed at the top, followed by all .c files then +all .h files. All files containing the string 'foobar' will be placed at the +end. The star is a special flag: it tells the script that every node that +doesnt match any of the other regexps should be placed here. + +If no star is present in 'NERDTreeSortOrder' then one is automatically +appended to the array. + +The regex '\/$' should be used to match directory nodes. + +After this sorting is done, the files in each group are sorted alphabetically. + +Other examples: > + (1) ['*', '\/$'] + (2) [] + (3) ['\/$', '\.rb$', '\.php$', '*', '\.swp$', '\.bak$', '\~$'] +< +1. Directories will appear last, everything else will appear above. +2. Everything will simply appear in alphabetical order. +3. Dirs will appear first, then ruby and php. Swap files, bak files and vim + backup files will appear last with everything else preceding them. + +------------------------------------------------------------------------------ + *'NERDTreeStatusline'* +Values: Any valid statusline setting. +Default: %{b:NERDTreeRoot.path.strForOS(0)} + +Tells the script what to use as the |'statusline'| setting for NERD tree +windows. + +Note that the statusline is set using |:let-&| not |:set| so escaping spaces +isn't necessary. + +Setting this option to -1 will will deactivate it so that your global +statusline setting is used instead. + +------------------------------------------------------------------------------ + *'NERDTreeWinPos'* +Values: "left" or "right" +Default: "left". + +This option is used to determine where NERD tree window is placed on the +screen. + +This option makes it possible to use two different explorer plugins +simultaneously. For example, you could have the taglist plugin on the left of +the window and the NERD tree on the right. + +------------------------------------------------------------------------------ + *'NERDTreeWinSize'* +Values: a positive integer. +Default: 31. + +This option is used to change the size of the NERD tree when it is loaded. + +============================================================================== +4. The NERD tree API *NERDTreeAPI* + +The NERD tree script allows you to add custom key mappings and menu items via +a set of API calls. Any scripts that use this API should be placed in +~/.vim/nerdtree_plugin/ (*nix) or ~/vimfiles/nerdtree_plugin (windows). + +The script exposes some prototype objects that can be used to manipulate the +tree and/or get information from it: > + g:NERDTreePath + g:NERDTreeDirNode + g:NERDTreeFileNode + g:NERDTreeBookmark +< +See the code/comments in NERD_tree.vim to find how to use these objects. The +following code conventions are used: + * class members start with a capital letter + * instance members start with a lower case letter + * private members start with an underscore + +See this blog post for more details: + http://got-ravings.blogspot.com/2008/09/vim-pr0n-prototype-based-objects.html + +------------------------------------------------------------------------------ +4.1. Key map API *NERDTreeKeymapAPI* + +NERDTreeAddKeyMap({options}) *NERDTreeAddKeyMap()* + Adds a new keymapping for all NERD tree buffers. + {options} must be a dictionary, and must contain the following keys: + "key" - the trigger key for the new mapping + "callback" - the function the new mapping will be bound to + "quickhelpText" - the text that will appear in the quickhelp (see + |NERDTree-?|) + + Example: > + call NERDTreeAddKeyMap({ + \ 'key': 'b', + \ 'callback': 'NERDTreeEchoCurrentNode', + \ 'quickhelpText': 'echo full path of current node' }) + + function! NERDTreeEchoCurrentNode() + let n = g:NERDTreeFileNode.GetSelected() + if n != {} + echomsg 'Current node: ' . n.path.str() + endif + endfunction +< + This code should sit in a file like ~/.vim/nerdtree_plugin/mymapping.vim. + It adds a (rather useless) mapping on 'b' which echos the full path to the + current node. + +------------------------------------------------------------------------------ +4.2. Menu API *NERDTreeMenuAPI* + +NERDTreeAddSubmenu({options}) *NERDTreeAddSubmenu()* + Creates and returns a new submenu. + + {options} must be a dictionary and must contain the following keys: + "text" - the text of the submenu that the user will see + "shortcut" - a shortcut key for the submenu (need not be unique) + + The following keys are optional: + "isActiveCallback" - a function that will be called to determine whether + this submenu item will be displayed or not. The callback function must return + 0 or 1. + "parent" - the parent submenu of the new submenu (returned from a previous + invocation of NERDTreeAddSubmenu()). If this key is left out then the new + submenu will sit under the top level menu. + + See below for an example. + +NERDTreeAddMenuItem({options}) *NERDTreeAddMenuItem()* + Adds a new menu item to the NERD tree menu (see |NERDTreeMenu|). + + {options} must be a dictionary and must contain the + following keys: + "text" - the text of the menu item which the user will see + "shortcut" - a shortcut key for the menu item (need not be unique) + "callback" - the function that will be called when the user activates the + menu item. + + The following keys are optional: + "isActiveCallback" - a function that will be called to determine whether + this menu item will be displayed or not. The callback function must return + 0 or 1. + "parent" - if the menu item belongs under a submenu then this key must be + specified. This value for this key will be the object that + was returned when the submenu was created with |NERDTreeAddSubmenu()|. + + See below for an example. + +NERDTreeAddMenuSeparator([{options}]) *NERDTreeAddMenuSeparator()* + Adds a menu separator (a row of dashes). + + {options} is an optional dictionary that may contain the following keys: + "isActiveCallback" - see description in |NERDTreeAddMenuItem()|. + +Below is an example of the menu API in action. > + call NERDTreeAddMenuSeparator() + + call NERDTreeAddMenuItem({ + \ 'text': 'a (t)op level menu item', + \ 'shortcut': 't', + \ 'callback': 'SomeFunction' }) + + let submenu = NERDTreeAddSubmenu({ + \ 'text': 'a (s)ub menu', + \ 'shortcut': 's' }) + + call NERDTreeAddMenuItem({ + \ 'text': '(n)ested item 1', + \ 'shortcut': 'n', + \ 'callback': 'SomeFunction', + \ 'parent': submenu }) + + call NERDTreeAddMenuItem({ + \ 'text': '(n)ested item 2', + \ 'shortcut': 'n', + \ 'callback': 'SomeFunction', + \ 'parent': submenu }) +< +This will create the following menu: > + -------------------- + a (t)op level menu item + a (s)ub menu +< +Where selecting "a (s)ub menu" will lead to a second menu: > + (n)ested item 1 + (n)ested item 2 +< +When any of the 3 concrete menu items are selected the function "SomeFunction" +will be called. + +------------------------------------------------------------------------------ +NERDTreeRender() *NERDTreeRender()* + Re-renders the NERD tree buffer. Useful if you change the state of the + tree and you want to it to be reflected in the UI. + +============================================================================== +5. About *NERDTreeAbout* + +The author of the NERD tree is a terrible terrible monster called Martyzilla +who gobbles up small children with milk and sugar for breakfast. + +He can be reached at martin.grenfell at gmail dot com. He would love to hear +from you, so feel free to send him suggestions and/or comments about this +plugin. Don't be shy --- the worst he can do is slaughter you and stuff you in +the fridge for later ;) + +The latest stable versions can be found at + http://www.vim.org/scripts/script.php?script_id=1658 + +The latest dev versions are on github + http://github.com/scrooloose/nerdtree + + +============================================================================== +6. Changelog *NERDTreeChangelog* + +4.1.0 + features: + - NERDTreeFind to reveal the node for the current buffer in the tree, + see |NERDTreeFind|. This effectively merges the FindInNERDTree plugin (by + Doug McInnes) into the script. + - make NERDTreeQuitOnOpen apply to the t/T keymaps too. Thanks to Stefan + Ritter and Rémi Prévost. + - truncate the root node if wider than the tree window. Thanks to Victor + Gonzalez. + + bugfixes: + - really fix window state restoring + - fix some win32 path escaping issues. Thanks to Stephan Baumeister, Ricky, + jfilip1024, and Chris Chambers + +4.0.0 + - add a new programmable menu system (see :help NERDTreeMenu). + - add new APIs to add menus/menu-items to the menu system as well as + custom key mappings to the NERD tree buffer (see :help NERDTreeAPI). + - removed the old API functions + - added a mapping to maximize/restore the size of nerd tree window, thanks + to Guillaume Duranceau for the patch. See :help NERDTree-A for details. + + - fix a bug where secondary nerd trees (netrw hijacked trees) and + NERDTreeQuitOnOpen didnt play nicely, thanks to Curtis Harvey. + - fix a bug where the script ignored directories whose name ended in a dot, + thanks to Aggelos Orfanakos for the patch. + - fix a bug when using the x mapping on the tree root, thanks to Bryan + Venteicher for the patch. + - fix a bug where the cursor position/window size of the nerd tree buffer + wasnt being stored on closing the window, thanks to Richard Hart. + - fix a bug where NERDTreeMirror would mirror the wrong tree + +3.1.1 + - fix a bug where a non-listed no-name buffer was getting created every + time the tree windows was created, thanks to Derek Wyatt and owen1 + - make behave the same as the 'o' mapping + - some helptag fixes in the doc, thanks strull + - fix a bug when using :set nohidden and opening a file where the previous + buf was modified. Thanks iElectric + - other minor fixes + +3.1.0 + New features: + - add mappings to open files in a vsplit, see :help NERDTree-s and :help + NERDTree-gs + - make the statusline for the nerd tree window default to something + hopefully more useful. See :help 'NERDTreeStatusline' + Bugfixes: + - make the hijack netrw functionality work when vim is started with "vim + " (thanks to Alf Mikula for the patch). + - fix a bug where the CWD wasnt being changed for some operations even when + NERDTreeChDirMode==2 (thanks to Lucas S. Buchala) + - add -bar to all the nerd tree :commands so they can chain with other + :commands (thanks to tpope) + - fix bugs when ignorecase was set (thanks to nach) + - fix a bug with the relative path code (thanks to nach) + - fix a bug where doing a :cd would cause :NERDTreeToggle to fail (thanks nach) + + +3.0.1 + Bugfixes: + - fix bugs with :NERDTreeToggle and :NERDTreeMirror when 'hidden + was not set + - fix a bug where :NERDTree would fail if was relative and + didnt start with a ./ or ../ Thanks to James Kanze. + - make the q mapping work with secondary (:e style) trees, + thanks to jamessan + - fix a bunch of small bugs with secondary trees + + More insane refactoring. + +3.0.0 + - hijack netrw so that doing an :edit will put a NERD tree in + the window rather than a netrw browser. See :help 'NERDTreeHijackNetrw' + - allow sharing of trees across tabs, see :help :NERDTreeMirror + - remove "top" and "bottom" as valid settings for NERDTreeWinPos + - change the '' mapping to 'i' + - change the 'H' mapping to 'I' + - lots of refactoring + +============================================================================== +7. Credits *NERDTreeCredits* + +Thanks to the following people for testing, bug reports, ideas etc. Without +you I probably would have got bored of the hacking the NERD tree and +just downloaded pr0n instead. + + Tim Carey-Smith (halorgium) + Vigil + Nick Brettell + Thomas Scott Urban + Terrance Cohen + Yegappan Lakshmanan + Jason Mills + Michael Geddes (frogonwheels) + Yu Jun + Michael Madsen + AOYAMA Shotaro + Zhang Weiwu + Niels Aan de Brugh + Olivier Yiptong + Zhang Shuhan + Cory Echols + Piotr Czachur + Yuan Jiang + Matan Nassau + Maxim Kim + Charlton Wang + Matt Wozniski (godlygeek) + knekk + Sean Chou + Ryan Penn + Simon Peter Nicholls + Michael Foobar + Tomasz Chomiuk + Denis Pokataev + Tim Pope (tpope) + James Kanze + James Vega (jamessan) + Frederic Chanal (nach) + Alf Mikula + Lucas S. Buchala + Curtis Harvey + Guillaume Duranceau + Richard Hart (hates) + Doug McInnes + Stefan Ritter + Rémi Prévost + Victor Gonzalez + Stephan Baumeister + Ricky + jfilip1024 + Chris Chambers + +============================================================================== +8. License *NERDTreeLicense* + +The NERD tree is released under the wtfpl. +See http://sam.zoy.org/wtfpl/COPYING. diff --git a/.vim/doc/bufexplorer.txt b/.vim/doc/bufexplorer.txt new file mode 100644 index 0000000..06e9223 --- /dev/null +++ b/.vim/doc/bufexplorer.txt @@ -0,0 +1,513 @@ +*bufexplorer.txt* Buffer Explorer Last Change: 22 Oct 2010 + +Buffer Explorer *buffer-explorer* *bufexplorer* + Version 7.2.8 + +Plugin for easily exploring (or browsing) Vim |:buffers|. + +|bufexplorer-installation| Installation +|bufexplorer-usage| Usage +|bufexplorer-windowlayout| Window Layout +|bufexplorer-customization| Customization +|bufexplorer-changelog| Change Log +|bufexplorer-todo| Todo +|bufexplorer-credits| Credits + +For Vim version 7.0 and above. +This plugin is only available if 'compatible' is not set. + +{Vi does not have any of this} + +============================================================================== +INSTALLATION *bufexplorer-installation* + +To install: + - Download the bufexplorer.zip. + - Extract the zip archive into your runtime directory. + The archive contains plugin/bufexplorer.vim, and doc/bufexplorer.txt. + - Start Vim or goto an existing instance of Vim. + - Execute the following command: +> + :helptag /doc +< + This will generate all the help tags for any file located in the doc + directory. + +============================================================================== +USAGE *bufexplorer-usage* + +To start exploring in the current window, use: > + \be or :BufExplorer +To start exploring in a newly split horizontal window, use: > + \bs or :BufExplorerHorizontalSplit +To start exploring in a newly split vertical window, use: > + \bv or :BufExplorerVerticalSplit + +If you would like to use something other than '\', you may simply change the +leader (see |mapleader|). + +Note: If the current buffer is modified when bufexplorer started, the current + window is always split and the new bufexplorer is displayed in that new + window. + +Commands to use once exploring: + + Toggle help information. + Opens the buffer that is under the cursor into the current + window. + Opens the buffer that is under the cursor into the current + window. + Opens the buffer that is under the cursor in another tab. + d |:delete|the buffer under the cursor from the list. The + buffer's 'buflisted' is cleared. This allows for the buffer to + be displayed again using the 'show unlisted' command. + R Toggles relative path/absolute path. + T Toggles to show only buffers for this tab or not. + D |:wipeout|the buffer under the cursor from the list. When a + buffers is wiped, it will not be shown when unlisted buffer are + displayed. + f Toggles whether you are taken to the active window when + selecting a buffer or not. + o Opens the buffer that is under the cursor into the current + window. + p Toggles the showing of a split filename/pathname. + q Quit exploring. + r Reverses the order the buffers are listed in. + s Selects the order the buffers are listed in. Either by buffer + number, file name, file extension, most recently used (MRU), or + full path. + t Opens the buffer that is under the cursor in another tab. + u Toggles the showing of "unlisted" buffers. + +Once invoked, Buffer Explorer displays a sorted list (MRU is the default +sort method) of all the buffers that are currently opened. You are then +able to move the cursor to the line containing the buffer's name you are +wanting to act upon. Once you have selected the buffer you would like, +you can then either open it, close it(delete), resort the list, reverse +the sort, quit exploring and so on... + +=============================================================================== +WINDOW LAYOUT *bufexplorer-windowlayout* + +------------------------------------------------------------------------------- +" Press for Help +" Sorted by mru | Locate buffer | Absolute Split path +"= + 01 %a bufexplorer.txt C:\Vim\vimfiles\doc line 87 + 02 # bufexplorer.vim c:\Vim\vimfiles\plugin line 1 +------------------------------------------------------------------------------- + | | | | | + | | | | +-- Current Line #. + | | | +-- Relative/Full Path + | | +-- Buffer Name. + | +-- Buffer Attributes. See|:buffers|for more information. + +-- Buffer Number. See|:buffers|for more information. + +=============================================================================== +CUSTOMIZATION *bufexplorer-customization* + + *g:bufExplorerChgWin* +If set, bufexplorer will bring up the selected buffer in the window specified +by g:bufExplorerChgWin. + + *g:bufExplorerDefaultHelp* +To control whether the default help is displayed or not, use: > + let g:bufExplorerDefaultHelp=0 " Do not show default help. + let g:bufExplorerDefaultHelp=1 " Show default help. +The default is to show the default help. + + *g:bufExplorerDetailedHelp* +To control whether detailed help is display by, use: > + let g:bufExplorerDetailedHelp=0 " Do not show detailed help. + let g:bufExplorerDetailedHelp=1 " Show detailed help. +The default is NOT to show detailed help. + + *g:bufExplorerFindActive* +To control whether you are taken to the active window when selecting a buffer, +use: > + let g:bufExplorerFindActive=0 " Do not go to active window. + let g:bufExplorerFindActive=1 " Go to active window. +The default is to be taken to the active window. + + *g:bufExplorerFuncRef* +When a buffer is selected, the functions specified either singly or as a list +will be called. + + *g:bufExplorerReverseSort* +To control whether to sort the buffer in reverse order or not, use: > + let g:bufExplorerReverseSort=0 " Do not sort in reverse order. + let g:bufExplorerReverseSort=1 " Sort in reverse order. +The default is NOT to sort in reverse order. + + *g:bufExplorerShowDirectories* +Directories usually show up in the list from using a command like ":e .". +To control whether to show directories in the buffer list or not, use: > + let g:bufExplorerShowDirectories=1 " Show directories. + let g:bufExplorerShowDirectories=0 " Don't show directories. +The default is to show directories. + + *g:bufExplorerShowRelativePath* +To control whether to show absolute paths or relative to the current +directory, use: > + let g:bufExplorerShowRelativePath=0 " Show absolute paths. + let g:bufExplorerShowRelativePath=1 " Show relative paths. +The default is to show absolute paths. + + *g:bufExplorerShowTabBuffer* +To control weither or not to show buffers on for the specific tab or not, use: > + let g:bufExplorerShowTabBuffer=0 " No. + let g:bufExplorerShowTabBuffer=1 " Yes. +The default is not to show. + + *g:bufExplorerShowUnlisted* +To control whether to show unlisted buffer or not, use: > + let g:bufExplorerShowUnlisted=0 " Do not show unlisted buffers. + let g:bufExplorerShowUnlisted=1 " Show unlisted buffers. +The default is to NOT show unlisted buffers. + + *g:bufExplorerSortBy* +To control what field the buffers are sorted by, use: > + let g:bufExplorerSortBy='extension' " Sort by file extension. + let g:bufExplorerSortBy='fullpath' " Sort by full file path name. + let g:bufExplorerSortBy='mru' " Sort by most recently used. + let g:bufExplorerSortBy='name' " Sort by the buffer's name. + let g:bufExplorerSortBy='number' " Sort by the buffer's number. +The default is to sort by mru. + + *g:bufExplorerSplitBelow* +To control where the new split window will be placed above or below the +current window, use: > + let g:bufExplorerSplitBelow=1 " Split new window below current. + let g:bufExplorerSplitBelow=0 " Split new window above current. +The default is to use what ever is set by the global &splitbelow +variable. + + *g:bufExplorerSplitOutPathName* +To control whether to split out the path and file name or not, use: > + let g:bufExplorerSplitOutPathName=1 " Split the path and file name. + let g:bufExplorerSplitOutPathName=0 " Don't split the path and file + " name. +The default is to split the path and file name. + + *g:bufExplorerSplitRight* +To control where the new vsplit window will be placed to the left or right of +current window, use: > + let g:bufExplorerSplitRight=0 " Split left. + let g:bufExplorerSplitRight=1 " Split right. +The default is to use the global &splitright. + +=============================================================================== +CHANGE LOG *bufexplorer-changelog* + +7.2.8 - Enhancements: + * Thanks to Charles Campbell for integrating bufexplorer with GDBMGR. + http://mysite.verizon.net/astronaut/vim/index.html#GDBMGR +7.2.7 - Fix: + * My 1st attempt to fix the "cache" issue where buffers information + has changed but the cache/display does not reflect those changes. + More work still needs to be done. +7.2.6 - Fix: + * Thanks to Michael Henry for pointing out that I totally forgot to + update the inline help to reflect the previous change to the 'd' + and 'D' keys. Opps! +7.2.5 - Fix: + * Philip Morant suggested switching the command (bwipe) associated + with the 'd' key with the command (bdelete) associated with the 'D' + key. This made sense since the 'd' key is more likely to be used + compared to the 'D' key. +7.2.4 - Fix: + * I did not implement the patch provided by Godefroid Chapelle + correctly. I missed one line which happened to be the most + important one :) +7.2.3 - Enhancements: + * Thanks to David Fishburn for helping me out with a much needed + code overhaul as well as some awesome performance enhancements. + He also reworked the handling of tabs. + * Thanks to Vladimir Dobriakov for making the suggestions on + enhancing the documentation to include a better explaination of + what is contained in the main bufexplorer window. + * Thanks to Yuriy Ershov for added code that when the bufexplorer + window is opened, the cursor is now positioned at the line with the + active buffer (useful in non-MRU sort modes). + * Yuriy also added the abiltiy to cycle through the sort fields in + reverse order. + Fixes: + * Thanks to Michael Henry for supplying a patch that allows + bufexplorer to be opened even when there is one buffer or less. + * Thanks to Godefroid Chapelle for supplying a patch that fixed + MRU sort order after loading a session. +7.2.2 - Fixes: + * Thanks to David L. Dight for spotting and fixing an issue when + using ctrl^. bufexplorer would incorrectly handle the previous + buffer so that when ctrl^ was pressed the incorrect file was opened. +7.2.1 - Fixes: + * Thanks to Dimitar for spotting and fixing a feature that was + inadvertently left out of the previous version. The feature was + when bufexplorer was used together with WinManager, you could use + the tab key to open a buffer in a split window. +7.2.0 - Enhancements: + * For all those missing the \bs and \bv commands, these have now + returned. Thanks to Phil O'Connell for asking for the return of + these missing features and helping test out this version. + Fixes: + * Fixed problem with the bufExplorerFindActive code not working + correctly. + * Fixed an incompatibility between bufexplorer and netrw that caused + buffers to be incorrectly removed from the MRU list. +7.1.7 - Fixes: + * TaCahiroy fixed several issues related to opening a buffer in a + tab. +7.1.6 - Fixes: + * Removed ff=unix from modeline in bufexplorer.txt. Found by Bill + McCarthy. +7.1.5 - Fixes: + * Could not open unnamed buffers. Fixed by TaCahiroy. +7.1.4 - Fixes: + * Sometimes when a file's path has 'white space' in it, extra buffers + would be created containing each piece of the path. i.e: + opening c:\document and settings\test.txt would create a buffer + named "and" and a buffer named "Documents". This was reported and + fixed by TaCa Yoss. +7.1.3 - Fixes: + * Added code to allow only one instance of the plugin to run at a + time. Thanks Dennis Hostetler. +7.1.2 - Fixes: + * Fixed a jumplist issue spotted by JiangJun. I overlooked the + 'jumplist' and with a couple calls to 'keepjumps', everything is + fine again. + * Went back to just having a plugin file, no autoload file. By having + the autoload, WinManager was no longer working and without really + digging into the cause, it was easier to go back to using just a + plugin file. +7.1.1 - Fixes: + * A problem spotted by Thomas Arendsen Hein. + When running Vim (7.1.94), error E493 was being thrown. + Enhancements: + * Added 'D' for 'delete' buffer as the 'd' command was a 'wipe' + buffer. +7.1.0 - Another 'major' update, some by Dave Larson, some by me. + * Making use of 'autoload' now to make the plugin load quicker. + * Removed '\bs' and '\bv'. These are now controlled by the user. The + user can issue a ':sp' or ':vs' to create a horizontal or vertical + split window and then issue a '\be' + * Added handling of tabs. +7.0.17 - Fixed issue with 'drop' command. + Various enhancements and improvements. +7.0.16 - Fixed issue reported by Liu Jiaping on non Windows systems, which was + ... + Open file1, open file2, modify file1, open bufexplorer, you get the + following error: + + --------8<-------- + Error detected while processing function + 14_StartBufExplorer..14_SplitOpen: + line 4: + E37: No write since last change (add ! to override) + + But the worse thing is, when I want to save the current buffer and + type ':w', I get another error message: + E382: Cannot write, 'buftype' option is set + --------8<-------- + +7.0.15 - Thanks to Mark Smithfield for suggesting bufexplorer needed to handle + the ':args' command. +7.0.14 - Thanks to Randall Hansen for removing the requirement of terminal + versions to be recompiled with 'gui' support so the 'drop' command + would work. The 'drop' command is really not needed in terminal + versions. +7.0.13 - Fixed integration with WinManager. + Thanks to Dave Eggum for another update. + - Fix: The detailed help didn't display the mapping for toggling + the split type, even though the split type is displayed. + - Fixed incorrect description in the detailed help for toggling + relative or full paths. + - Deprecated s:ExtractBufferNbr(). Vim's str2nr() does the same + thing. + - Created a s:Set() function that sets a variable only if it hasn't + already been defined. It's useful for initializing all those + default settings. + - Removed checks for repetitive command definitions. They were + unnecessary. + - Made the help highlighting a little more fancy. + - Minor reverse compatibility issue: Changed ambiguous setting + names to be more descriptive of what they do (also makes the code + easier to follow): + Changed bufExplorerSortDirection to bufExplorerReverseSort + Changed bufExplorerSplitType to bufExplorerSplitVertical + Changed bufExplorerOpenMode to bufExplorerUseCurrentWindow + - When the BufExplorer window closes, all the file-local marks are + now deleted. This may have the benefit of cleaning up some of the + jumplist. + - Changed the name of the parameter for StartBufExplorer from + "split" to "open". The parameter is a string which specifies how + the buffer will be open, not if it is split or not. + - Deprecated DoAnyMoreBuffersExist() - it is a one line function + only used in one spot. + - Created four functions (SplitOpen(), RebuildBufferList(), + UpdateHelpStatus() and ReSortListing()) all with one purpose - to + reduce repeated code. + - Changed the name of AddHeader() to CreateHelp() to be more + descriptive of what it does. It now returns an array instead of + updating the window directly. This has the benefit of making the + code more efficient since the text the function returns is used a + little differently in the two places the function is called. + - Other minor simplifications. +7.0.12 - MAJOR Update. + This version will ONLY run with Vim version 7.0 or greater. + Dave Eggum has made some 'significant' updates to this latest + version: + - Added BufExplorerGetAltBuf() global function to be used in the + users rulerformat. + - Added g:bufExplorerSplitRight option. + - Added g:bufExplorerShowRelativePath option with mapping. + - Added current line highlighting. + - The split type can now be changed whether bufexplorer is opened + in split mode or not. + - Various major and minor bug fixes and speed improvements. + - Sort by extension. + Other improvements/changes: + - Changed the help key from '?' to to be more 'standard'. + - Fixed splitting of vertical bufexplorer window. + Hopefully I have not forgot something :) +7.0.11 - Fixed a couple of highlighting bugs, reported by David Eggum. He also + changed passive voice to active on a couple of warning messages. +7.0.10 - Fixed bug report by Xiangjiang Ma. If the 'ssl' option is set, + the slash character used when displaying the path was incorrect. +7.0.9 - Martin Grenfell found and eliminated an annoying bug in the + bufexplorer/winmanager integration. The bug was were an + annoying message would be displayed when a window was split or + a new file was opened in a new window. Thanks Martin! +7.0.8 - Thanks to Mike Li for catching a bug in the WinManager integration. + The bug was related to the incorrect displaying of the buffer + explorer's window title. +7.0.7 - Thanks to Jeremy Cowgar for adding a new enhancement. This + enhancement allows the user to press 'S', that is capital S, which + will open the buffer under the cursor in a newly created split + window. +7.0.6 - Thanks to Larry Zhang for finding a bug in the "split" buffer code. + If you force set g:bufExplorerSplitType='v' in your vimrc, and if you + tried to do a \bs to split the bufexplorer window, it would always + split horizontal, not vertical. He also found that I had a typeo in + that the variable g:bufExplorerSplitVertSize was all lower case in + the documentation which was incorrect. +7.0.5 - Thanks to Mun Johl for pointing out a bug that if a buffer was + modified, the '+' was not showing up correctly. +7.0.4 - Fixed a problem discovered first by Xiangjiang Ma. Well since I've + been using vim 7.0 and not 6.3, I started using a function (getftype) + that is not in 6.3. So for backward compatibility, I conditionaly use + this function now. Thus, the g:bufExplorerShowDirectories feature is + only available when using vim 7.0 and above. +7.0.3 - Thanks to Erwin Waterlander for finding a problem when the last + buffer was deleted. This issue got me to rewrite the buffer display + logic (which I've wanted to do for sometime now). + Also great thanks to Dave Eggum for coming up with idea for + g:bufExplorerShowDirectories. Read the above information about this + feature. +7.0.2 - Thanks to Thomas Arendsen Hein for finding a problem when a user + has the default help turned off and then brought up the explorer. An + E493 would be displayed. +7.0.1 - Thanks to Erwin Waterlander for finding a couple problems. + The first problem allowed a modified buffer to be deleted. Opps! The + second problem occurred when several files were opened, BufExplorer + was started, the current buffer was deleted using the 'd' option, and + then BufExplorer was exited. The deleted buffer was still visible + while it is not in the buffers list. Opps again! +7.0.0 - Thanks to Shankar R. for suggesting to add the ability to set + the fixed width (g:bufExplorerSplitVertSize) of a new window + when opening bufexplorer vertically and fixed height + (g:bufExplorerSplitHorzSize) of a new window when opening + bufexplorer horizontally. By default, the windows are normally + split to use half the existing width or height. +6.3.0 - Added keepjumps so that the jumps list would not get cluttered with + bufexplorer related stuff. +6.2.3 - Thanks to Jay Logan for finding a bug in the vertical split position + of the code. When selecting that the window was to be split + vertically by doing a '\bv', from then on, all splits, i.e. '\bs', + were split vertically, even though g:bufExplorerSplitType was not set + to 'v'. +6.2.2 - Thanks to Patrik Modesto for adding a small improvement. For some + reason his bufexplorer window was always showing up folded. He added + 'setlocal nofoldenable' and it was fixed. +6.2.1 - Thanks goes out to Takashi Matsuo for added the 'fullPath' sorting + logic and option. +6.2.0 - Thanks goes out to Simon Johann-Ganter for spotting and fixing a + problem in that the last search pattern is overridden by the search + pattern for blank lines. +6.1.6 - Thanks to Artem Chuprina for finding a pesky bug that has been around + for sometime now. The key mapping was causing the buffer + explored to close prematurely when vim was run in an xterm. The + key mapping is now removed. +6.1.5 - Thanks to Khorev Sergey. Added option to show default help or not. +6.1.4 - Thanks goes out to Valery Kondakoff for suggesting the addition of + setlocal nonumber and foldcolumn=0. This allows for line numbering + and folding to be turned off temporarily while in the explorer. +6.1.3 - Added folding. Did some code cleanup. Added the ability to force the + newly split window to be temporarily vertical, which was suggested by + Thomas Glanzmann. +6.1.2 - Now pressing the key will quit, just like 'q'. + Added folds to hide winmanager configuration. + If anyone had the 'C' option in their cpoptions they would receive + a E10 error on startup of BufExplorer. cpo is now saved, updated and + restored. Thanks to Charles E Campbell, Jr. + Attempted to make sure there can only be one BufExplorer window open + at a time. +6.1.1 - Thanks to Brian D. Goodwin for adding toupper to FileNameCmp. This + way buffers sorted by name will be in the correct order regardless of + case. +6.0.16 - Thanks to Andre Pang for the original patch/idea to get bufexplorer + to work in insertmode/modeless mode (evim). Added Initialize + and Cleanup autocommands to handle commands that need to be + performed when starting or leaving bufexplorer. +6.0.15 - Srinath Avadhanulax added a patch for winmanager.vim. +6.0.14 - Fix a few more bug that I thought I already had fixed. Thanks + to Eric Bloodworth for adding 'Open Mode/Edit in Place'. Added + vertical splitting. +6.0.13 - Thanks to Charles E Campbell, Jr. for pointing out some embarrassing + typos that I had in the documentation. I guess I need to run + the spell checker more :o) +6.0.12 - Thanks to Madoka Machitani, for the tip on adding the augroup command + around the MRUList autocommands. +6.0.11 - Fixed bug report by Xiangjiang Ma. '"=' was being added to the + search history which messed up hlsearch. +6.0.10 - Added the necessary hooks so that the Srinath Avadhanula's + winmanager.vim script could more easily integrate with this script. + Tried to improve performance. +6.0.9 - Added MRU (Most Recently Used) sort ordering. +6.0.8 - Was not resetting the showcmd command correctly. + Added nifty help file. +6.0.7 - Thanks to Brett Carlane for some great enhancements. Some are added, + some are not, yet. Added highlighting of current and alternate + filenames. Added splitting of path/filename toggle. Reworked + ShowBuffers(). + Changed my email address. +6.0.6 - Copyright notice added. Needed this so that it could be distributed + with Debian Linux. Fixed problem with the SortListing() function + failing when there was only one buffer to display. +6.0.5 - Fixed problems reported by David Pascoe, in that you where unable to + hit 'd' on a buffer that belonged to a files that no longer existed + and that the 'yank' buffer was being overridden by the help text when + the bufexplorer was opened. +6.0.4 - Thanks to Charles Campbell, Jr. for making this plugin more plugin + *compliant*, adding default keymappings of be and bs + as well as fixing the 'w:sortDirLabel not being defined' bug. +6.0.3 - Added sorting capabilities. Sort taken from explorer.vim. +6.0.2 - Can't remember. (2001-07-25) +6.0.1 - Initial release. + +=============================================================================== +TODO *bufexplorer-todo* + +- Nothing as of now, buf if you have any suggestions, drop me an email. + +=============================================================================== +CREDITS *bufexplorer-credits* + +Author: Jeff Lanzarotta + +Credit must go out to Bram Moolenaar and all the Vim developers for +making the world's best editor (IMHO). I also want to thank everyone who +helped and gave me suggestions. I wouldn't want to leave anyone out so I +won't list names. + +=============================================================================== +vim:tw=78:noet:wrap:ts=8:ft=help:norl: diff --git a/.vim/doc/pi_netrw.txt b/.vim/doc/pi_netrw.txt new file mode 100644 index 0000000..1ee4b6a --- /dev/null +++ b/.vim/doc/pi_netrw.txt @@ -0,0 +1,3681 @@ +*pi_netrw.txt* For Vim version 7.3. Last change: 2011 May 31 + + ----------------------------------------------------- + NETRW REFERENCE MANUAL by Charles E. Campbell, Jr. + ----------------------------------------------------- +Author: Charles E. Campbell, Jr. + (remove NOSPAM from Campbell's email first) + +Copyright: Copyright (C) 1999-2011 Charles E Campbell, Jr *netrw-copyright* + Permission is hereby granted to use and distribute this code, with + or without modifications, provided that this copyright notice is + copied with it. Like anything else that's free, netrw.vim, + netrwPlugin.vim, netrwFileHandlers.vim, netrwSettings.vim, + syntax/netrw.vim, and pi_netrw.txt are provided *as is* and comes + with no warranty of any kind, either expressed or implied. No + guarantees of merchantability. No guarantees of suitability for + any purpose. By using this plugin, you agree that in no event will + the copyright holder be liable for any damages resulting from the + use of this software. + + + *dav* *ftp* *netrw-file* *rcp* *scp* + *davs* *http* *netrw.vim* *rsync* *sftp* + *fetch* *netrw* *network* + +============================================================================== +1. Contents *netrw-contents* {{{1 + +1. Contents.............................................|netrw-contents| +2. Starting With Netrw..................................|netrw-start| +3. Netrw Reference......................................|netrw-ref| + EXTERNAL APPLICATIONS AND PROTOCOLS................|netrw-externapp| + READING............................................|netrw-read| + WRITING............................................|netrw-write| + SOURCING...........................................|netrw-source| + DIRECTORY LISTING..................................|netrw-dirlist| + CHANGING THE USERID AND PASSWORD...................|netrw-chgup| + VARIABLES AND SETTINGS.............................|netrw-variables| + PATHS..............................................|netrw-path| +4. Network-Oriented File Transfer.......................|netrw-xfer| + NETRC..............................................|netrw-netrc| + PASSWORD...........................................|netrw-passwd| +5. Activation...........................................|netrw-activate| +6. Transparent Remote File Editing......................|netrw-transparent| +7. Ex Commands..........................................|netrw-ex| +8. Variables and Options................................|netrw-var| +9. Browsing.............................................|netrw-browse| + Introduction To Browsing...........................|netrw-intro-browse| + Quick Reference: Maps..............................|netrw-browse-maps| + Quick Reference: Commands..........................|netrw-browse-cmds| + Bookmarking A Directory............................|netrw-mb| + Browsing...........................................|netrw-cr| + Browsing With A Horizontally Split Window..........|netrw-o| + Browsing With A New Tab............................|netrw-t| + Browsing With A Vertically Split Window............|netrw-v| + Change Listing Style.(thin wide long tree).........|netrw-i| + Changing To A Bookmarked Directory.................|netrw-gb| + Changing To A Predecessor Directory................|netrw-u| + Changing To A Successor Directory..................|netrw-U| + Customizing Browsing With A User Function..........|netrw-x| + Deleting Bookmarks.................................|netrw-mB| + Deleting Files Or Directories......................|netrw-D| + Directory Exploring Commands.......................|netrw-explore| + Exploring With Stars and Patterns..................|netrw-star| + Displaying Information About File..................|netrw-qf| + Edit File Or Directory Hiding List.................|netrw-ctrl-h| + Editing The Sorting Sequence.......................|netrw-S| + Forcing treatment as a file or directory...........|netrw-gd| |netrw-gf| + Going Up...........................................|netrw--| + Hiding Files Or Directories........................|netrw-a| + Improving Browsing.................................|netrw-ssh-hack| + Listing Bookmarks And History......................|netrw-qb| + Making A New Directory.............................|netrw-d| + Making The Browsing Directory The Current Directory|netrw-c| + Marking Files......................................|netrw-mf| + Marking Files By Regular Expression................|netrw-mr| + Marked Files: Arbitrary Command....................|netrw-mx| + Marked Files: Compression And Decompression........|netrw-mz| + Marked Files: Copying..............................|netrw-mc| + Marked Files: Diff.................................|netrw-md| + Marked Files: Editing..............................|netrw-me| + Marked Files: Grep.................................|netrw-mg| + Marked Files: Hiding and Unhiding by Suffix........|netrw-mh| + Marked Files: Moving...............................|netrw-mm| + Marked Files: Printing.............................|netrw-mp| + Marked Files: Sourcing.............................|netrw-ms| + Marked Files: Tagging..............................|netrw-mT| + Marked Files: Setting the Target Directory.........|netrw-mt| + Marked Files: Unmarking............................|netrw-mu| + Netrw Browser Variables............................|netrw-browser-var| + Netrw Browsing And Option Incompatibilities........|netrw-incompatible| + Netrw Settings.....................................|netrw-settings| + Obtaining A File...................................|netrw-O| + Preview Window.....................................|netrw-p| + Previous Window....................................|netrw-P| + Refreshing The Listing.............................|netrw-ctrl-l| + Renaming Files Or Directories......................|netrw-move| + Reversing Sorting Order............................|netrw-r| + Selecting Sorting Style............................|netrw-s| + Setting Editing Window.............................|netrw-C| +10. Problems and Fixes...................................|netrw-problems| +11. Debugging Netrw Itself...............................|netrw-debug| +12. History..............................................|netrw-history| +13. Todo.................................................|netrw-todo| +14. Credits..............................................|netrw-credits| + +{Vi does not have any of this} + +============================================================================== +2. Starting With Netrw *netrw-start* {{{1 + +Netrw makes reading files, writing files, browsing over a network, and +local browsing easy! First, make sure that you have plugins enabled, so +you'll need to have at least the following in your <.vimrc>: +(or see |netrw-activate|) > + + set nocp " 'compatible' is not set + filetype plugin on " plugins are enabled +< +(see |'cp'| and |:filetype-plugin-on|) + +Netrw supports "transparent" editing of files on other machines using urls +(see |netrw-transparent|). As an example of this, let's assume you have an +account on some other machine; if you can use scp, try: > + + vim scp://hostname/path/to/file +< +Want to make ssh/scp easier to use? Check out |netrw-ssh-hack|! + +So, what if you have ftp, not ssh/scp? That's easy, too; try > + + vim ftp://hostname/path/to/file +< +Want to make ftp simpler to use? See if your ftp supports a file called +<.netrc> -- typically it goes in your home directory, has read/write +permissions for only the user to read (ie. not group, world, other, etc), +and has lines resembling > + + machine HOSTNAME login USERID password "PASSWORD" + machine HOSTNAME login USERID password "PASSWORD" + ... + default login USERID password "PASSWORD" +< +Now about browsing -- when you just want to look around before editing a +file. For browsing on your current host, just "edit" a directory: > + + vim . + vim /home/userid/path +< +For browsing on a remote host, "edit" a directory (but make sure that +the directory name is followed by a "/"): > + + vim scp://hostname/ + vim ftp://hostname/path/to/dir/ +< +See |netrw-browse| for more! + +There are more protocols supported by netrw than just scp and ftp, too: see the +next section, |netrw-externapp|, on how to use these external applications with +netrw and vim. + +PREVENTING LOADING *netrw-noload* + +If you want to use plugins, but for some reason don't wish to use netrw, then +you need to avoid loading both the plugin and the autoload portions of netrw. +You may do so by placing the following two lines in your <.vimrc>: > + + :let g:loaded_netrw = 1 + :let g:loaded_netrwPlugin = 1 +< + +============================================================================== +3. Netrw Reference *netrw-ref* {{{1 + + Netrw supports several protocols in addition to scp and ftp as mentioned + in |netrw-start|. These include dav, fetch, http,... well, just look + at the list in |netrw-externapp|. Each protocol is associated with a + variable which holds the default command supporting that protocol. + +EXTERNAL APPLICATIONS AND PROTOCOLS *netrw-externapp* {{{2 + + Protocol Variable Default Value + -------- ---------------- ------------- + dav: *g:netrw_dav_cmd* = "cadaver" if cadaver is executable + dav: g:netrw_dav_cmd = "curl -o" elseif curl is available + fetch: *g:netrw_fetch_cmd* = "fetch -o" if fetch is available + ftp: *g:netrw_ftp_cmd* = "ftp" + http: *g:netrw_http_cmd* = "elinks" if elinks is available + http: g:netrw_http_cmd = "links" elseif links is available + http: g:netrw_http_cmd = "curl" elseif curl is available + http: g:netrw_http_cmd = "wget" elseif wget is available + http: g:netrw_http_cmd = "fetch" elseif fetch is available + rcp: *g:netrw_rcp_cmd* = "rcp" + rsync: *g:netrw_rsync_cmd* = "rsync -a" + scp: *g:netrw_scp_cmd* = "scp -q" + sftp: *g:netrw_sftp_cmd* = "sftp" + + *g:netrw_http_xcmd* : the option string for http://... protocols are + specified via this variable and may be independently overridden. By + default, the option arguments for the http-handling commands are: > + + elinks : "-source >" + links : "-source >" + curl : "-o" + wget : "-q -O" + fetch : "-o" +< + For example, if your system has elinks, and you'd rather see the + page using an attempt at rendering the text, you may wish to have > + let g:netrw_http_xcmd= "-dump >" +< in your .vimrc. + + +READING *netrw-read* *netrw-nread* {{{2 + + Generally, one may just use the url notation with a normal editing + command, such as > + + :e ftp://[user@]machine/path +< + Netrw also provides the Nread command: + + :Nread ? give help + :Nread "machine:path" uses rcp + :Nread "machine path" uses ftp w/ <.netrc> + :Nread "machine id password path" uses ftp + :Nread "dav://machine[:port]/path" uses cadaver + :Nread "fetch://[user@]machine/path" uses fetch + :Nread "ftp://[user@]machine[[:#]port]/path" uses ftp w/ <.netrc> + :Nread "http://[user@]machine/path" uses http uses wget + :Nread "rcp://[user@]machine/path" uses rcp + :Nread "rsync://[user@]machine[:port]/path" uses rsync + :Nread "scp://[user@]machine[[:#]port]/path" uses scp + :Nread "sftp://[user@]machine/path" uses sftp + +WRITING *netrw-write* *netrw-nwrite* {{{2 + + One may just use the url notation with a normal file writing + command, such as > + + :w ftp://[user@]machine/path +< + Netrw also provides the Nwrite command: + + :Nwrite ? give help + :Nwrite "machine:path" uses rcp + :Nwrite "machine path" uses ftp w/ <.netrc> + :Nwrite "machine id password path" uses ftp + :Nwrite "dav://machine[:port]/path" uses cadaver + :Nwrite "ftp://[user@]machine[[:#]port]/path" uses ftp w/ <.netrc> + :Nwrite "rcp://[user@]machine/path" uses rcp + :Nwrite "rsync://[user@]machine[:port]/path" uses rsync + :Nwrite "scp://[user@]machine[[:#]port]/path" uses scp + :Nwrite "sftp://[user@]machine/path" uses sftp + http: not supported! + +SOURCING *netrw-source* {{{2 + + One may just use the url notation with the normal file sourcing + command, such as > + + :so ftp://[user@]machine/path +< + Netrw also provides the Nsource command: + + :Nsource ? give help + :Nsource "dav://machine[:port]/path" uses cadaver + :Nsource "fetch://[user@]machine/path" uses fetch + :Nsource "ftp://[user@]machine[[:#]port]/path" uses ftp w/ <.netrc> + :Nsource "http://[user@]machine/path" uses http uses wget + :Nsource "rcp://[user@]machine/path" uses rcp + :Nsource "rsync://[user@]machine[:port]/path" uses rsync + :Nsource "scp://[user@]machine[[:#]port]/path" uses scp + :Nsource "sftp://[user@]machine/path" uses sftp + +DIRECTORY LISTING *netrw-trailingslash* *netrw-dirlist* {{{2 + + One may browse a directory to get a listing by simply attempting to + edit the directory: > + + :e scp://[user]@hostname/path/ + :e ftp://[user]@hostname/path/ +< + For remote directory listings (ie. those using scp or ftp), that + trailing "/" is necessary (the slash tells netrw to treat the argument + as a directory to browse instead of as a file to download). + + The Nread command may also be used to accomplish this (again, that + trailing slash is necessary): > + + :Nread [protocol]://[user]@hostname/path/ +< + *netrw-login* *netrw-password* +CHANGING USERID AND PASSWORD *netrw-chgup* *netrw-userpass* {{{2 + + Attempts to use ftp will prompt you for a user-id and a password. + These will be saved in global variables g:netrw_uid and + s:netrw_passwd; subsequent uses of ftp will re-use those two items to + simplify the further use of ftp. However, if you need to use a + different user id and/or password, you'll want to call NetUserPass() + first. To work around the need to enter passwords, check if your ftp + supports a <.netrc> file in your home directory. Also see + |netrw-passwd| (and if you're using ssh/scp hoping to figure out how + to not need to use passwords, look at |netrw-ssh-hack|). + + :NetUserPass [uid [password]] -- prompts as needed + :call NetUserPass() -- prompts for uid and password + :call NetUserPass("uid") -- prompts for password + :call NetUserPass("uid","password") -- sets global uid and password + +NETRW VARIABLES AND SETTINGS *netrw-variables* {{{2 +(also see: |netrw-browser-var| |netrw-protocol| |netrw-settings| |netrw-var|) + +Netrw provides a lot of variables which allow you to customize netrw to your +preferences. One way to look at them is via the command :NetrwSettings (see +|netrw-settings|) which will display your current netrw settings. Most such +settings are described below, in |netrw-browser-options|, and in +|netrw-externapp|: + + *b:netrw_lastfile* last file Network-read/written retained on a + per-buffer basis (supports plain :Nw ) + + *g:netrw_bufsettings* the settings that netrw buffers have + (default) noma nomod nonu nowrap ro nobl + + *g:netrw_chgwin* specifies a window number where file edits will take + place. (also see |netrw-C|) + (default) not defined + + *g:Netrw_funcref* specifies a function (or functions) to be called when + netrw edits a file. The file is first edited, and + then the function reference (|Funcref|) is called. + This variable may also hold a |List| of Funcrefs. + (default) not defined +> + Example: place in .vimrc; affects all file opening + fun! MyFuncRef() + endfun + let g:Netrw_funcref= function("MyFuncRef") +< + *g:netrw_ftp* if it doesn't exist, use default ftp + =0 use default ftp (uid password) + =1 use alternate ftp method (user uid password) + If you're having trouble with ftp, try changing the + value of this variable to see if the alternate ftp + method works for your setup. + + *g:netrw_ftpextracmd* default: doesn't exist + If this variable exists, then any string it contains + will be placed into the commands set to your ftp + client. As an example: + ="passive" + + *g:netrw_ftpmode* ="binary" (default) + ="ascii" + + *g:netrw_ignorenetrc* =0 (default for linux, cygwin) + =1 If you have a <.netrc> file but it doesn't work and + you want it ignored, then set this variable as + shown. (default for Windows + cmd.exe) + + *g:netrw_menu* =0 disable netrw's menu + =1 (default) netrw's menu enabled + + *g:netrw_nogx* if this variable exists, then the "gx" map will not + be available (see |netrw-gx|) + + *g:netrw_uid* (ftp) user-id, retained on a per-vim-session basis + *s:netrw_passwd* (ftp) password, retained on a per-vim-session basis + + *g:netrw_preview* =0 (default) preview window shown in a horizontally + split window + =1 preview window shown in a vertically split window. + Also affects the "previous window" (see |netrw-P|) in + the same way. + + *g:netrw_scpport* = "-P" : option to use to set port for scp + *g:netrw_sshport* = "-p" : option to use to set port for ssh + + *g:netrw_sepchr* =\0xff + =\0x01 for enc == euc-jp (and perhaps it should be for + others, too, please let me + know) + Separates priority codes from filenames internally. + See |netrw-p12|. + + *g:netrw_silent* =0 : transfers done normally + =1 : transfers done silently + + *g:netrw_use_errorwindow* =1 : messages from netrw will use a separate one + line window. This window provides reliable + delivery of messages. (default) + =0 : messages from netrw will use echoerr ; + messages don't always seem to show up this + way, but one doesn't have to quit the window. + + *g:netrw_win95ftp* =1 if using Win95, will remove four trailing blank + lines that o/s's ftp "provides" on transfers + =0 force normal ftp behavior (no trailing line removal) + + *g:netrw_cygwin* =1 assume scp under windows is from cygwin. Also + permits network browsing to use ls with time and + size sorting (default if windows) + =0 assume Windows' scp accepts windows-style paths + Network browsing uses dir instead of ls + This option is ignored if you're using unix + + *g:netrw_use_nt_rcp* =0 don't use the rcp of WinNT, Win2000 and WinXP + =1 use WinNT's rcp in binary mode (default) + +PATHS *netrw-path* {{{2 + +Paths to files are generally user-directory relative for most protocols. +It is possible that some protocol will make paths relative to some +associated directory, however. +> + example: vim scp://user@host/somefile + example: vim scp://user@host/subdir1/subdir2/somefile +< +where "somefile" is in the "user"'s home directory. If you wish to get a +file using root-relative paths, use the full path: +> + example: vim scp://user@host//somefile + example: vim scp://user@host//subdir1/subdir2/somefile +< + +============================================================================== +4. Network-Oriented File Transfer *netrw-xfer* {{{1 + +Network-oriented file transfer under Vim is implemented by a VimL-based script +() using plugin techniques. It currently supports both reading and +writing across networks using rcp, scp, ftp or ftp+<.netrc>, scp, fetch, +dav/cadaver, rsync, or sftp. + +http is currently supported read-only via use of wget or fetch. + + is a standard plugin which acts as glue between Vim and the +various file transfer programs. It uses autocommand events (BufReadCmd, +FileReadCmd, BufWriteCmd) to intercept reads/writes with url-like filenames. > + + ex. vim ftp://hostname/path/to/file +< +The characters preceding the colon specify the protocol to use; in the +example, it's ftp. The script then formulates a command or a +series of commands (typically ftp) which it issues to an external program +(ftp, scp, etc) which does the actual file transfer/protocol. Files are read +from/written to a temporary file (under Unix/Linux, /tmp/...) which the + script will clean up. + +Now, a word about Jan Minář's "FTP User Name and Password Disclosure"; first, +ftp is not a secure protocol. User names and passwords are transmitted "in +the clear" over the internet; any snooper tool can pick these up; this is not +a netrw thing, this is a ftp thing. If you're concerned about this, please +try to use scp or sftp instead. + +Netrw re-uses the user id and password during the same vim session and so long +as the remote hostname remains the same. + +Jan seems to be a bit confused about how netrw handles ftp; normally multiple +commands are performed in a "ftp session", and he seems to feel that the +uid/password should only be retained over one ftp session. However, netrw +does every ftp operation in a separate "ftp session"; so remembering the +uid/password for just one "ftp session" would be the same as not remembering +the uid/password at all. IMHO this would rapidly grow tiresome as one +browsed remote directories, for example. + +On the other hand, thanks go to Jan M. for pointing out the many +vulnerabilities that netrw (and vim itself) had had in handling "crafted" +filenames. The |shellescape()| and |fnameescape()| functions were written in +response by Bram Moolenaar to handle these sort of problems, and netrw has +been modified to use them. Still, my advice is, if the "filename" looks like +a vim command that you aren't comfortable with having executed, don't open it. + + *netrw-putty* *netrw-pscp* *netrw-psftp* +One may modify any protocol's implementing external application by setting a +variable (ex. scp uses the variable g:netrw_scp_cmd, which is defaulted to +"scp -q"). As an example, consider using PuTTY: > + + let g:netrw_scp_cmd = '"c:\Program Files\PuTTY\pscp.exe" -q -batch' + let g:netrw_sftp_cmd= '"c:\Program Files\PuTTY\psftp.exe"' +< +See |netrw-p8| for more about putty, pscp, psftp, etc. + +Ftp, an old protocol, seems to be blessed by numerous implementations. +Unfortunately, some implementations are noisy (ie., add junk to the end of the +file). Thus, concerned users may decide to write a NetReadFixup() function +that will clean up after reading with their ftp. Some Unix systems (ie., +FreeBSD) provide a utility called "fetch" which uses the ftp protocol but is +not noisy and more convenient, actually, for to use. +Consequently, if "fetch" is available (ie. executable), it may be preferable +to use it for ftp://... based transfers. + +For rcp, scp, sftp, and http, one may use network-oriented file transfers +transparently; ie. +> + vim rcp://[user@]machine/path + vim scp://[user@]machine/path +< +If your ftp supports <.netrc>, then it too can be transparently used +if the needed triad of machine name, user id, and password are present in +that file. Your ftp must be able to use the <.netrc> file on its own, however. +> + vim ftp://[user@]machine[[:#]portnumber]/path +< +Windows provides an ftp (typically c:\Windows\System32\ftp.exe) which uses +an option, -s:filename (filename can and probably should be a full path) +which contains ftp commands which will be automatically run whenever ftp +starts. You may use this feature to enter a user and password for one site: > + userid + password +If |g:netrw_ftp_cmd| contains -s:[path/]MACHINE, then (on Windows machines only) +netrw will substitute the current machine name requested for ftp connection +for MACHINE. Hence one can have multiple machine.ftp files containing login +and password for ftp. Example: > + + g:netrw_ftp_cmd= 'c:\Windows\System32\ftp -s:C:\Users\Myself\MACHINE' + vim ftp://myhost.somewhere.net/ +will use a file > + C:\Users\Myself\myhost.ftp +< +Often, ftp will need to query the user for the userid and password. +The latter will be done "silently"; ie. asterisks will show up instead of +the actually-typed-in password. Netrw will retain the userid and password +for subsequent read/writes from the most recent transfer so subsequent +transfers (read/write) to or from that machine will take place without +additional prompting. + + *netrw-urls* + +=================================+============================+============+ + | Reading | Writing | Uses | + +=================================+============================+============+ + | DAV: | | | + | dav://host/path | | cadaver | + | :Nread dav://host/path | :Nwrite dav://host/path | cadaver | + +---------------------------------+----------------------------+------------+ + | DAV + SSL: | | | + | davs://host/path | | cadaver | + | :Nread davs://host/path | :Nwrite davs://host/path | cadaver | + +---------------------------------+----------------------------+------------+ + | FETCH: | | | + | fetch://[user@]host/path | | | + | fetch://[user@]host:http/path | Not Available | fetch | + | :Nread fetch://[user@]host/path| | | + +---------------------------------+----------------------------+------------+ + | FILE: | | | + | file:///* | file:///* | | + | file://localhost/* | file://localhost/* | | + +---------------------------------+----------------------------+------------+ + | FTP: (*3) | (*3) | | + | ftp://[user@]host/path | ftp://[user@]host/path | ftp (*2) | + | :Nread ftp://host/path | :Nwrite ftp://host/path | ftp+.netrc | + | :Nread host path | :Nwrite host path | ftp+.netrc | + | :Nread host uid pass path | :Nwrite host uid pass path | ftp | + +---------------------------------+----------------------------+------------+ + | HTTP: wget is executable: (*4) | | | + | http://[user@]host/path | Not Available | wget | + +---------------------------------+----------------------------+------------+ + | HTTP: fetch is executable (*4) | | | + | http://[user@]host/path | Not Available | fetch | + +---------------------------------+----------------------------+------------+ + | RCP: | | | + | rcp://[user@]host/path | rcp://[user@]host/path | rcp | + +---------------------------------+----------------------------+------------+ + | RSYNC: | | | + | rsync://[user@]host/path | rsync://[user@]host/path | rsync | + | :Nread rsync://host/path | :Nwrite rsync://host/path | rsync | + | :Nread rcp://host/path | :Nwrite rcp://host/path | rcp | + +---------------------------------+----------------------------+------------+ + | SCP: | | | + | scp://[user@]host/path | scp://[user@]host/path | scp | + | :Nread scp://host/path | :Nwrite scp://host/path | scp (*1) | + +---------------------------------+----------------------------+------------+ + | SFTP: | | | + | sftp://[user@]host/path | sftp://[user@]host/path | sftp | + | :Nread sftp://host/path | :Nwrite sftp://host/path | sftp (*1) | + +=================================+============================+============+ + + (*1) For an absolute path use scp://machine//path. + + (*2) if <.netrc> is present, it is assumed that it will + work with your ftp client. Otherwise the script will + prompt for user-id and password. + + (*3) for ftp, "machine" may be machine#port or machine:port + if a different port is needed than the standard ftp port + + (*4) for http:..., if wget is available it will be used. Otherwise, + if fetch is available it will be used. + +Both the :Nread and the :Nwrite ex-commands can accept multiple filenames. + + +NETRC *netrw-netrc* + +The <.netrc> file, typically located in your home directory, contains lines +therein which map a hostname (machine name) to the user id and password you +prefer to use with it. + +The typical syntax for lines in a <.netrc> file is given as shown below. +Ftp under Unix usually supports <.netrc>; ftp under Windows usually doesn't. +> + machine {full machine name} login {user-id} password "{password}" + default login {user-id} password "{password}" + +Your ftp client must handle the use of <.netrc> on its own, but if the +<.netrc> file exists, an ftp transfer will not ask for the user-id or +password. + + Note: + Since this file contains passwords, make very sure nobody else can + read this file! Most programs will refuse to use a .netrc that is + readable for others. Don't forget that the system administrator can + still read the file! Ie. for Linux/Unix: chmod 600 .netrc + + +PASSWORD *netrw-passwd* + +The script attempts to get passwords for ftp invisibly using |inputsecret()|, +a built-in Vim function. See |netrw-userpass| for how to change the password +after one has set it. + +Unfortunately there doesn't appear to be a way for netrw to feed a password to +scp. Thus every transfer via scp will require re-entry of the password. +However, |netrw-ssh-hack| can help with this problem. + + +============================================================================== +5. Activation *netrw-activate* {{{1 + +Network-oriented file transfers are available by default whenever Vim's +|'nocompatible'| mode is enabled. Netrw's script files reside in your +system's plugin, autoload, and syntax directories; just the +plugin/netrwPlugin.vim script is sourced automatically whenever you bring up +vim. The main script in autoload/netrw.vim is only loaded when you actually +use netrw. I suggest that, at a minimum, you have at least the following in +your <.vimrc> customization file: > + + set nocp + if version >= 600 + filetype plugin indent on + endif +< + +============================================================================== +6. Transparent Remote File Editing *netrw-transparent* {{{1 + +Transparent file transfers occur whenever a regular file read or write +(invoked via an |:autocmd| for |BufReadCmd|, |BufWriteCmd|, or |SourceCmd| +events) is made. Thus one may read, write, or source files across networks +just as easily as if they were local files! > + + vim ftp://[user@]machine/path + ... + :wq + +See |netrw-activate| for more on how to encourage your vim to use plugins +such as netrw. + + +============================================================================== +7. Ex Commands *netrw-ex* {{{1 + +The usual read/write commands are supported. There are also a few +additional commands available. Often you won't need to use Nwrite or +Nread as shown in |netrw-transparent| (ie. simply use > + :e url + :r url + :w url +instead, as appropriate) -- see |netrw-urls|. In the explanations +below, a {netfile} is an url to a remote file. + + *:Nwrite* *:Nw* +:[range]Nw[rite] Write the specified lines to the current + file as specified in b:netrw_lastfile. + (related: |netrw-nwrite|) + +:[range]Nw[rite] {netfile} [{netfile}]... + Write the specified lines to the {netfile}. + + *:Nread* *:Nr* +:Nr[ead] Read the lines from the file specified in b:netrw_lastfile + into the current buffer. (related: |netrw-nread|) + +:Nr[ead] {netfile} {netfile}... + Read the {netfile} after the current line. + + *:Nsource* *:Ns* +:Ns[ource] {netfile} + Source the {netfile}. + To start up vim using a remote .vimrc, one may use + the following (all on one line) (tnx to Antoine Mechelynck) > + vim -u NORC -N + --cmd "runtime plugin/netrwPlugin.vim" + --cmd "source scp://HOSTNAME/.vimrc" +< (related: |netrw-source|) + +:call NetUserPass() *NetUserPass()* + If g:netrw_uid and s:netrw_passwd don't exist, + this function will query the user for them. + (related: |netrw-userpass|) + +:call NetUserPass("userid") + This call will set the g:netrw_uid and, if + the password doesn't exist, will query the user for it. + (related: |netrw-userpass|) + +:call NetUserPass("userid","passwd") + This call will set both the g:netrw_uid and s:netrw_passwd. + The user-id and password are used by ftp transfers. One may + effectively remove the user-id and password by using empty + strings (ie. ""). + (related: |netrw-userpass|) + +:NetrwSettings This command is described in |netrw-settings| -- used to + display netrw settings and change netrw behavior. + + +============================================================================== +8. Variables and Options *netrw-options* *netrw-var* {{{1 + +(if you're interested in the netrw browser settings, see: |netrw-browser-var|) + +The script provides several variables which act as options to +affect 's file transfer behavior. These variables typically may be +set in the user's <.vimrc> file: (see also |netrw-settings| |netrw-protocol|) +> + ------------- + Netrw Options + ------------- + Option Meaning + -------------- ----------------------------------------------- +< + b:netrw_col Holds current cursor position (during NetWrite) + g:netrw_cygwin =1 assume scp under windows is from cygwin + (default/windows) + =0 assume scp under windows accepts windows + style paths (default/else) + g:netrw_ftp =0 use default ftp (uid password) + g:netrw_ftpmode ="binary" (default) + ="ascii" (your choice) + g:netrw_ignorenetrc =1 (default) + if you have a <.netrc> file but you don't + want it used, then set this variable. Its + mere existence is enough to cause <.netrc> + to be ignored. + b:netrw_lastfile Holds latest method/machine/path. + b:netrw_line Holds current line number (during NetWrite) + g:netrw_silent =0 transfers done normally + =1 transfers done silently + g:netrw_uid Holds current user-id for ftp. + g:netrw_use_nt_rcp =0 don't use WinNT/2K/XP's rcp (default) + =1 use WinNT/2K/XP's rcp, binary mode + g:netrw_win95ftp =0 use unix-style ftp even if win95/98/ME/etc + =1 use default method to do ftp > + ----------------------------------------------------------------------- +< +The script will also make use of the following variables internally, albeit +temporarily. +> + ------------------- + Temporary Variables + ------------------- + Variable Meaning + -------- ------------------------------------ +< + b:netrw_method Index indicating rcp/ftp+.netrc/ftp + w:netrw_method (same as b:netrw_method) + g:netrw_machine Holds machine name parsed from input + b:netrw_fname Holds filename being accessed > + ------------------------------------------------------------ +< + *netrw-protocol* + +Netrw supports a number of protocols. These protocols are invoked using the +variables listed below, and may be modified by the user. +> + ------------------------ + Protocol Control Options + ------------------------ + Option Type Setting Meaning + --------- -------- -------------- --------------------------- +< + netrw_ftp variable =doesn't exist userid set by "user userid" + =0 userid set by "user userid" + =1 userid set by "userid" + NetReadFixup function =doesn't exist no change + =exists Allows user to have files + read via ftp automatically + transformed however they wish + by NetReadFixup() + g:netrw_dav_cmd variable ="cadaver" if cadaver is executable + g:netrw_dav_cmd variable ="curl -o" elseif curl is executable + g:netrw_fetch_cmd variable ="fetch -o" if fetch is available + g:netrw_ftp_cmd variable ="ftp" + g:netrw_http_cmd variable ="fetch -o" if fetch is available + g:netrw_http_cmd variable ="wget -O" else if wget is available + g:netrw_list_cmd variable ="ssh USEPORT HOSTNAME ls -Fa" + g:netrw_rcp_cmd variable ="rcp" + g:netrw_rsync_cmd variable ="rsync -a" + g:netrw_scp_cmd variable ="scp -q" + g:netrw_sftp_cmd variable ="sftp" > + ------------------------------------------------------------------------- +< + *netrw-ftp* + +The g:netrw_..._cmd options (|g:netrw_ftp_cmd| and |g:netrw_sftp_cmd|) +specify the external program to use handle the ftp protocol. They may +include command line options (such as -p for passive mode). Example: > + + let g:netrw_ftp_cmd= "ftp -p" +< +Browsing is supported by using the |g:netrw_list_cmd|; the substring +"HOSTNAME" will be changed via substitution with whatever the current request +is for a hostname. + +Two options (|g:netrw_ftp| and |netrw-fixup|) both help with certain ftp's +that give trouble . In order to best understand how to use these options if +ftp is giving you troubles, a bit of discussion is provided on how netrw does +ftp reads. + +For ftp, netrw typically builds up lines of one of the following formats in a +temporary file: +> + IF g:netrw_ftp !exists or is not 1 IF g:netrw_ftp exists and is 1 + ---------------------------------- ------------------------------ +< + open machine [port] open machine [port] + user userid password userid password + [g:netrw_ftpmode] password + [g:netrw_ftpextracmd] [g:netrw_ftpmode] + get filename tempfile [g:netrw_extracmd] + get filename tempfile > + --------------------------------------------------------------------- +< +The |g:netrw_ftpmode| and |g:netrw_ftpextracmd| are optional. + +Netrw then executes the lines above by use of a filter: +> + :%! {g:netrw_ftp_cmd} -i [-n] +< +where + g:netrw_ftp_cmd is usually "ftp", + -i tells ftp not to be interactive + -n means don't use netrc and is used for Method #3 (ftp w/o <.netrc>) + +If <.netrc> exists it will be used to avoid having to query the user for +userid and password. The transferred file is put into a temporary file. +The temporary file is then read into the main editing session window that +requested it and the temporary file deleted. + +If your ftp doesn't accept the "user" command and immediately just demands a +userid, then try putting "let netrw_ftp=1" in your <.vimrc>. + + *netrw-cadaver* +To handle the SSL certificate dialog for untrusted servers, one may pull +down the certificate and place it into /usr/ssl/cert.pem. This operation +renders the server treatment as "trusted". + + *netrw-fixup* *netreadfixup* +If your ftp for whatever reason generates unwanted lines (such as AUTH +messages) you may write a NetReadFixup() function: +> + function! NetReadFixup(method,line1,line2) + " a:line1: first new line in current file + " a:line2: last new line in current file + if a:method == 1 "rcp + elseif a:method == 2 "ftp + <.netrc> + elseif a:method == 3 "ftp + machine,uid,password,filename + elseif a:method == 4 "scp + elseif a:method == 5 "http/wget + elseif a:method == 6 "dav/cadaver + elseif a:method == 7 "rsync + elseif a:method == 8 "fetch + elseif a:method == 9 "sftp + else " complain + endif + endfunction +> +The NetReadFixup() function will be called if it exists and thus allows you to +customize your reading process. As a further example, contains +just such a function to handle Windows 95 ftp. For whatever reason, Windows +95's ftp dumps four blank lines at the end of a transfer, and so it is +desirable to automate their removal. Here's some code taken from +itself: +> + if has("win95") && g:netrw_win95ftp + fun! NetReadFixup(method, line1, line2) + if method == 3 " ftp (no <.netrc>) + let fourblanklines= line2 - 3 + silent fourblanklines.",".line2."g/^\s*/d" + endif + endfunction + endif +> + +============================================================================== +9. Browsing *netrw-browsing* *netrw-browse* *netrw-help* {{{1 + *netrw-browser* *netrw-dir* *netrw-list* + +INTRODUCTION TO BROWSING *netrw-intro-browse* {{{2 + (Quick References: |netrw-quickmaps| |netrw-quickcoms|) + +Netrw supports the browsing of directories on your local system and on remote +hosts; browsing includes listing files and directories, entering directories, +editing files therein, deleting files/directories, making new directories, +moving (renaming) files and directories, copying files and directories, etc. +One may mark files and execute any system command on them! The Netrw browser +generally implements the previous explorer's maps and commands for remote +directories, although details (such as pertinent global variable names) +necessarily differ. To browse a directory, simply "edit" it! > + + vim /your/directory/ + vim . + vim c:\your\directory\ +< +(Related topics: |netrw-cr| |netrw-o| |netrw-p| |netrw-P| |netrw-t| + |netrw-mf| |netrw-mx| |netrw-D| |netrw-R| |netrw-v| ) + +The Netrw remote file and directory browser handles two protocols: ssh and +ftp. The protocol in the url, if it is ftp, will cause netrw also to use ftp +in its remote browsing. Specifying any other protocol will cause it to be +used for file transfers; but the ssh protocol will be used to do remote +browsing. + +To use Netrw's remote directory browser, simply attempt to read a "file" with +a trailing slash and it will be interpreted as a request to list a directory: +> + vim [protocol]://[user@]hostname/path/ +< +where [protocol] is typically scp or ftp. As an example, try: > + + vim ftp://ftp.home.vim.org/pub/vim/ +< +For local directories, the trailing slash is not required. Again, because it's +easy to miss: to browse remote directories, the url must terminate with a +slash! + +If you'd like to avoid entering the password repeatedly for remote directory +listings with ssh or scp, see |netrw-ssh-hack|. To avoid password entry with +ftp, see |netrw-netrc| (if your ftp supports it). + +There are several things you can do to affect the browser's display of files: + + * To change the listing style, press the "i" key (|netrw-i|). + Currently there are four styles: thin, long, wide, and tree. + To make that change "permanent", see |g:netrw_liststyle|. + + * To hide files (don't want to see those xyz~ files anymore?) see + |netrw-ctrl-h|. + + * Press s to sort files by name, time, or size. + +See |netrw-browse-cmds| for all the things you can do with netrw! + + *netrw-getftype* *netrw-filigree* *netrw-ftype* +The |getftype()| function is used to append a bit of filigree to indicate +filetype to locally listed files: + + directory : / + executable : * + fifo : | + links : @ + sockets : = + +The filigree also affects the |g:netrw_sort_sequence|. + + +QUICK HELP *netrw-quickhelp* {{{2 + (Use ctrl-] to select a topic)~ + Intro to Browsing...............................|netrw-intro-browse| + Quick Reference: Maps.........................|netrw-quickmap| + Quick Reference: Commands.....................|netrw-browse-cmds| + Hiding + Edit hiding list..............................|netrw-ctrl-h| + Hiding Files or Directories...................|netrw-a| + Hiding/Unhiding by suffix.....................|netrw-mh| + Hiding dot-files.............................|netrw-gh| + Listing Style + Select listing style (thin/long/wide/tree)....|netrw-i| + Associated setting variable...................|g:netrw_liststyle| + Shell command used to perform listing.........|g:netrw_list_cmd| + Quick file info...............................|netrw-qf| + Sorted by + Select sorting style (name/time/size).........|netrw-s| + Editing the sorting sequence..................|netrw-S| + Sorting options...............................|g:netrw_sort_options| + Associated setting variable...................|g:netrw_sort_sequence| + Reverse sorting order.........................|netrw-r| + + + *netrw-quickmap* *netrw-quickmaps* +QUICK REFERENCE: MAPS *netrw-browse-maps* {{{2 +> + --- ----------------- ---- + Map Quick Explanation Link + --- ----------------- ---- +< Causes Netrw to issue help + Netrw will enter the directory or read the file |netrw-cr| + Netrw will attempt to remove the file/directory |netrw-del| + - Makes Netrw go up one directory |netrw--| + a Toggles between normal display, |netrw-a| + hiding (suppress display of files matching g:netrw_list_hide) + showing (display only files which match g:netrw_list_hide) + c Make browsing directory the current directory |netrw-c| + C Setting the editing window |netrw-C| + d Make a directory |netrw-d| + D Attempt to remove the file(s)/directory(ies) |netrw-D| + gb Go to previous bookmarked directory |netrw-gb| + gh Quick hide/unhide of dot-files |netrw-gh| + Edit file hiding list |netrw-ctrl-h| + i Cycle between thin, long, wide, and tree listings |netrw-i| + Causes Netrw to refresh the directory listing |netrw-ctrl-l| + mb Bookmark current directory |netrw-mb| + mc Copy marked files to marked-file target directory |netrw-mc| + md Apply diff to marked files (up to 3) |netrw-md| + me Place marked files on arg list and edit them |netrw-me| + mf Mark a file |netrw-mf| + mh Toggle marked file suffices' presence on hiding list |netrw-mh| + mm Move marked files to marked-file target directory |netrw-mm| + mp Print marked files |netrw-mp| + mr Mark files satisfying a shell-style |regexp| |netrw-mr| + mt Current browsing directory becomes markfile target |netrw-mt| + mT Apply ctags to marked files |netrw-mT| + mu Unmark all marked files |netrw-mu| + mx Apply arbitrary shell command to marked files |netrw-mx| + mz Compress/decompress marked files |netrw-mz| + o Enter the file/directory under the cursor in a new |netrw-o| + browser window. A horizontal split is used. + O Obtain a file specified by cursor |netrw-O| + p Preview the file |netrw-p| + P Browse in the previously used window |netrw-P| + qb List bookmarked directories and history |netrw-qb| + qf Display information on file |netrw-qf| + r Reverse sorting order |netrw-r| + R Rename the designed file(s)/directory(ies) |netrw-R| + s Select sorting style: by name, time, or file size |netrw-s| + S Specify suffix priority for name-sorting |netrw-S| + t Enter the file/directory under the cursor in a new tab|netrw-t| + u Change to recently-visited directory |netrw-u| + U Change to subsequently-visited directory |netrw-U| + v Enter the file/directory under the cursor in a new |netrw-v| + browser window. A vertical split is used. + x View file with an associated program |netrw-x| + + % Open a new file in netrw's current directory |netrw-%| + + *netrw-mouse* *netrw-leftmouse* *netrw-middlemouse* *netrw-rightmouse* + (gvim only) selects word under mouse as if a + had been pressed (ie. edit file, change directory) + (gvim only) same as P selecting word under mouse; + see |netrw-P| + (gvim only) delete file/directory using word under + mouse + <2-leftmouse> (gvim only) when: + * in a netrw-selected file, AND + * |g:netrw_retmap| == 1 AND + * the user doesn't already have a <2-leftmouse> mapping + defined before netrw is autoloaded, + then a double clicked leftmouse button will return + to the netrw browser window. See |g:netrw_retmap|. + (gvim only) like mf, will mark files + + (to disable mouse buttons while browsing: |g:netrw_mousemaps|) + + *netrw-quickcom* *netrw-quickcoms* +QUICK REFERENCE: COMMANDS *netrw-explore-cmds* *netrw-browse-cmds* {{{2 + :NetrwClean[!] ...........................................|netrw-clean| + :NetrwSettings ...........................................|netrw-settings| + :Explore[!] [dir] Explore directory of current file......|netrw-explore| + :Hexplore[!] [dir] Horizontal Split & Explore.............|netrw-explore| + :Nexplore[!] [dir] Vertical Split & Explore...............|netrw-explore| + :Pexplore[!] [dir] Vertical Split & Explore...............|netrw-explore| + :Rexplore Return to Explorer.....................|netrw-explore| + :Sexplore[!] [dir] Split & Explore directory .............|netrw-explore| + :Texplore[!] [dir] Tab & Explore..........................|netrw-explore| + :Vexplore[!] [dir] Vertical Split & Explore...............|netrw-explore| + +BOOKMARKING A DIRECTORY *netrw-mb* *netrw-bookmark* *netrw-bookmarks* {{{2 + +One may easily "bookmark" a directory by using > + + mb +< +Bookmarks are retained in between sessions in a $HOME/.netrwbook file, and are +kept in sorted order. + +Related Topics: + |netrw-gb| how to return (go) to a bookmark + |netrw-mB| how to delete bookmarks + |netrw-qb| how to list bookmarks + + +BROWSING *netrw-cr* {{{2 + +Browsing is simple: move the cursor onto a file or directory of interest. +Hitting the (the return key) will select the file or directory. +Directories will themselves be listed, and files will be opened using the +protocol given in the original read request. + + CAVEAT: There are four forms of listing (see |netrw-i|). Netrw assumes that + two or more spaces delimit filenames and directory names for the long and + wide listing formats. Thus, if your filename or directory name has two or + more sequential spaces embedded in it, or any trailing spaces, then you'll + need to use the "thin" format to select it. + +The |g:netrw_browse_split| option, which is zero by default, may be used to +cause the opening of files to be done in a new window or tab instead of the +default. When the option is one or two, the splitting will be taken +horizontally or vertically, respectively. When the option is set to three, a + will cause the file to appear in a new tab. + + +When using the gui (gvim), one may select a file by pressing the +button. In addition, if + + *|g:netrw_retmap| == 1 AND (its default value is 0) + * in a netrw-selected file, AND + * the user doesn't already have a <2-leftmouse> mapping defined before + netrw is loaded + +then a doubly-clicked leftmouse button will return to the netrw browser +window. + +Netrw attempts to speed up browsing, especially for remote browsing where one +may have to enter passwords, by keeping and re-using previously obtained +directory listing buffers. The |g:netrw_fastbrowse| variable is used to +control this behavior; one may have slow browsing (no buffer re-use), medium +speed browsing (re-use directory buffer listings only for remote directories), +and fast browsing (re-use directory buffer listings as often as possible). +The price for such re-use is that when changes are made (such as new files +are introduced into a directory), the listing may become out-of-date. One may +always refresh directory listing buffers by pressing ctrl-L (see +|netrw-ctrl-l|). + + +Related topics: |netrw-o| |netrw-p| |netrw-P| |netrw-t| |netrw-v| +Associated setting variables: |g:netrw_browse_split| |g:netrw_fastbrowse| + |g:netrw_ftp_list_cmd| |g:netrw_ftp_sizelist_cmd| + |g:netrw_ftp_timelist_cmd| |g:netrw_ssh_cmd| + |g:netrw_ssh_browse_reject| |g:netrw_use_noswf| + + +BROWSING WITH A HORIZONTALLY SPLIT WINDOW *netrw-o* *netrw-horiz* {{{2 + +Normally one enters a file or directory using the . However, the "o" map +allows one to open a new window to hold the new directory listing or file. A +horizontal split is used. (for vertical splitting, see |netrw-v|) + +Normally, the o key splits the window horizontally with the new window and +cursor at the top. To change to splitting the window horizontally with the +new window and cursor at the bottom, have + + let g:netrw_alto = 1 + +in your <.vimrc>. (also see |netrw-t| |netrw-T| |netrw-v|) + +Associated setting variables: |g:netrw_alto| |g:netrw_winsize| + + +BROWSING WITH A NEW TAB *netrw-t* *netrw-T* {{{2 + +Normally one enters a file or directory using the . The "t" map +allows one to open a new window holding the new directory listing or file in +a new tab. The "T" version puts the file or directory into a background tab +(see |gT|) + +Related actions: |netrw-o| |netrw-v| + + +BROWSING WITH A VERTICALLY SPLIT WINDOW *netrw-v* {{{2 + +Normally one enters a file or directory using the . However, the "v" map +allows one to open a new window to hold the new directory listing or file. A +vertical split is used. (for horizontal splitting, see |netrw-o|) + +Normally, the v key splits the window vertically with the new window and +cursor at the left. To change to splitting the window vertically with the new +window and cursor at the right, have + + let g:netrw_altv = 1 + +in your <.vimrc>. (also see: |netrw-o| |netrw-t| |netrw-T|) + +There is only one tree listing buffer; using "v" on a displayed subdirectory +will split the screen, but the same buffer will be shown twice. + +Associated setting variable: |g:netrw_altv| |g:netrw_winsize| + + +CHANGE LISTING STYLE (THIN LONG WIDE TREE) *netrw-i* {{{2 + +The "i" map cycles between the thin, long, wide, and tree listing formats. + +The thin listing format gives just the files' and directories' names. + +The long listing is either based on the "ls" command via ssh for remote +directories or displays the filename, file size (in bytes), and the time and +date of last modification for local directories. With the long listing +format, netrw is not able to recognize filenames which have trailing spaces. +Use the thin listing format for such files. + +The wide listing format uses two or more contiguous spaces to delineate +filenames; when using that format, netrw won't be able to recognize or use +filenames which have two or more contiguous spaces embedded in the name or any +trailing spaces. The thin listing format will, however, work with such files. +This listing format is the most compact. + +The tree listing format has a top directory followed by files and directories +preceded by a "|". One may open and close directories by pressing the +key while atop the directory name. + +One may make a preferred listing style your default; see |g:netrw_liststyle|. +As an example, by putting the following line in your .vimrc, > + let g:netrw_liststyle= 4 +the tree style will become your default listing style. + +Associated setting variables: |g:netrw_liststyle| |g:netrw_maxfilenamelen| + |g:netrw_timefmt| |g:netrw_list_cmd| + +CHANGE FILE PERMISSION *netrw-gp* {{{2 + +"gp" will ask you for a new permission for the file named under the cursor. +Currently, this only works for local files. + +Associated setting variables: |g:netrw_chgperm| + + +CHANGING TO A BOOKMARKED DIRECTORY *netrw-gb* {{{2 + +To change directory back to a bookmarked directory, use + + {cnt}gb + +Any count may be used to reference any of the bookmarks. + +Related Topics: + |netrw-mB| how to delete bookmarks + |netrw-mb| how to make a bookmark + |netrw-qb| how to list bookmarks + + +CHANGING TO A PREDECESSOR DIRECTORY *netrw-u* *netrw-updir* {{{2 + +Every time you change to a new directory (new for the current session), +netrw will save the directory in a recently-visited directory history +list (unless |g:netrw_dirhistmax| is zero; by default, it's ten). With the +"u" map, one can change to an earlier directory (predecessor). To do +the opposite, see |netrw-U|. + + +CHANGING TO A SUCCESSOR DIRECTORY *netrw-U* *netrw-downdir* {{{2 + +With the "U" map, one can change to a later directory (successor). +This map is the opposite of the "u" map. (see |netrw-u|) Use the +q map to list both the bookmarks and history. (see |netrw-qb|) + + +NETRW CLEAN *netrw-clean* *:NetrwClean* + +With :NetrwClean one may easily remove netrw from one's home directory; +more precisely, from the first directory on your |'runtimepath'|. + +With :NetrwClean!, netrw will remove netrw from all directories on your +|'runtimepath'|. + +With either form of the command, netrw will first ask for confirmation +that the removal is in fact what you want to do. If netrw doesn't have +permission to remove a file, it will issue an error message. + + *netrw-gx* +CUSTOMIZING BROWSING WITH A USER FUNCTION *netrw-x* *netrw-handler* {{{2 + (also see |netrw_filehandler|) + +Certain files, such as html, gif, jpeg, (word/office) doc, etc, files, are +best seen with a special handler (ie. a tool provided with your computer). +Netrw allows one to invoke such special handlers by: > + + * when Exploring, hit the "x" key + * when editing, hit gx with the cursor atop the special filename +< (not available if the |g:netrw_nogx| variable exists) + +Netrw determines which special handler by the following method: + + * if |g:netrw_browsex_viewer| exists, then it will be used to attempt to + view files. Examples of useful settings (place into your <.vimrc>): > + + :let g:netrw_browsex_viewer= "kfmclient exec" +< or > + :let g:netrw_browsex_viewer= "gnome-open" +< + If g:netrw_browsex_viewer == '-', then netrwFileHandler() will be + invoked first (see |netrw_filehandler|). + + * for Windows 32 or 64, the url and FileProtocolHandler dlls are used. + * for Gnome (with gnome-open): gnome-open is used. + * for KDE (with kfmclient) : kfmclient is used. + * for Mac OS X : open is used. + * otherwise the netrwFileHandler plugin is used. + +The file's suffix is used by these various approaches to determine an +appropriate application to use to "handle" these files. Such things as +OpenOffice (*.sfx), visualization (*.jpg, *.gif, etc), and PostScript (*.ps, +*.eps) can be handled. + + *netrw_filehandler* + +The "x" map applies a function to a file, based on its extension. Of course, +the handler function must exist for it to be called! +> + Ex. mypgm.html x -> + NFH_html("scp://user@host/some/path/mypgm.html") +< +Users may write their own netrw File Handler functions to support more +suffixes with special handling. See for +examples on how to make file handler functions. As an example: > + + " NFH_suffix(filename) + fun! NFH_suffix(filename) + ..do something special with filename.. + endfun +< +These functions need to be defined in some file in your .vim/plugin +(vimfiles\plugin) directory. Vim's function names may not have punctuation +characters (except for the underscore) in them. To support suffices that +contain such characters, netrw will first convert the suffix using the +following table: > + + @ -> AT ! -> EXCLAMATION % -> PERCENT + : -> COLON = -> EQUAL ? -> QUESTION + , -> COMMA - -> MINUS ; -> SEMICOLON + $ -> DOLLAR + -> PLUS ~ -> TILDE +< +So, for example: > + + file.rcs,v -> NFH_rcsCOMMAv() +< +If more such translations are necessary, please send me email: > + NdrOchip at ScampbellPfamily.AbizM - NOSPAM +with a request. + +Associated setting variable: |g:netrw_browsex_viewer| + + *netrw-curdir* +DELETING BOOKMARKS *netrw-mB* {{{2 + +To delete a bookmark, use > + + {cnt}mB +< +Related Topics: + |netrw-gb| how to return (go) to a bookmark + |netrw-mb| how to make a bookmark + |netrw-qb| how to list bookmarks + + +DELETING FILES OR DIRECTORIES *netrw-delete* *netrw-D* *netrw-del* {{{2 + +If files have not been marked with |netrw-mf|: (local marked file list) + + Deleting/removing files and directories involves moving the cursor to the + file/directory to be deleted and pressing "D". Directories must be empty + first before they can be successfully removed. If the directory is a + softlink to a directory, then netrw will make two requests to remove the + directory before succeeding. Netrw will ask for confirmation before doing + the removal(s). You may select a range of lines with the "V" command + (visual selection), and then pressing "D". + +If files have been marked with |netrw-mf|: (local marked file list) + + Marked files (and empty directories) will be deleted; again, you'll be + asked to confirm the deletion before it actually takes place. + +The |g:netrw_rm_cmd|, |g:netrw_rmf_cmd|, and |g:netrw_rmdir_cmd| variables are +used to control the attempts to remove files and directories. The +g:netrw_rm_cmd is used with files, and its default value is: + + g:netrw_rm_cmd: ssh HOSTNAME rm + +The g:netrw_rmdir_cmd variable is used to support the removal of directories. +Its default value is: + + g:netrw_rmdir_cmd: ssh HOSTNAME rmdir + +If removing a directory fails with g:netrw_rmdir_cmd, netrw then will attempt +to remove it again using the g:netrw_rmf_cmd variable. Its default value is: + + g:netrw_rmf_cmd: ssh HOSTNAME rm -f + +Associated setting variable: |g:netrw_local_rmdir| |g:netrw_rm_cmd| + |g:netrw_rmdir_cmd| |g:netrw_ssh_cmd| + + +*netrw-explore* *netrw-hexplore* *netrw-nexplore* *netrw-pexplore* +*netrw-rexplore* *netrw-sexplore* *netrw-texplore* *netrw-vexplore* +DIRECTORY EXPLORATION COMMANDS {{{2 + + :[N]Explore[!] [dir]... Explore directory of current file *:Explore* + :[N]Hexplore[!] [dir]... Horizontal Split & Explore *:Hexplore* + :Rexplore ... Return to Explorer *:Rexplore* + :[N]Sexplore[!] [dir]... Split&Explore current file's directory *:Sexplore* + :Texplore [dir]... Tab & Explore *:Texplore* + :[N]Vexplore[!] [dir]... Vertical Split & Explore *:Vexplore* + + Used with :Explore **/pattern : (also see |netrw-starstar|) + :Nexplore............. go to next matching file *:Nexplore* + :Pexplore............. go to previous matching file *:Pexplore* + +:Explore will open the local-directory browser on the current file's + directory (or on directory [dir] if specified). The window will be + split only if the file has been modified, otherwise the browsing + window will take over that window. Normally the splitting is taken + horizontally. +:Explore! is like :Explore, but will use vertical splitting. +:Sexplore will always split the window before invoking the local-directory + browser. As with Explore, the splitting is normally done + horizontally. +:Sexplore! [dir] is like :Sexplore, but the splitting will be done vertically. +:Hexplore [dir] does an :Explore with |:belowright| horizontal splitting. +:Hexplore! [dir] does an :Explore with |:aboveleft| horizontal splitting. +:Vexplore [dir] does an :Explore with |:leftabove| vertical splitting. +:Vexplore! [dir] does an :Explore with |:rightbelow| vertical splitting. +:Texplore [dir] does a tabnew before generating the browser window + +By default, these commands use the current file's directory. However, one may +explicitly provide a directory (path) to use. + +The [N] will override |g:netrw_winsize| to specify the quantity of rows and/or +columns the new explorer window should have. + +Otherwise, the |g:netrw_winsize| variable, if it has been specified by the +user, is used to control the quantity of rows and/or columns new explorer +windows should have. + +:Rexplore This command is a little different from the others. When one + edits a file, for example by pressing when atop a file in + a netrw browser window, :Rexplore will return the display to + that of the last netrw browser window. It is a command version + of the <2-leftmouse> map (which is only available under gvim and + cooperative terms). + + +*netrw-star* *netrw-starpat* *netrw-starstar* *netrw-starstarpat* +EXPLORING WITH STARS AND PATTERNS + +When Explore, Sexplore, Hexplore, or Vexplore are used with one of the +following four styles, Explore generates a list of files which satisfy +the request. > + + */filepat files in current directory which satisfy filepat + **/filepat files in current directory or below which satisfy the + file pattern + *//pattern files in the current directory which contain the + pattern (vimgrep is used) + **//pattern files in the current directory or below which contain + the pattern (vimgrep is used) +< +The cursor will be placed on the first file in the list. One may then +continue to go to subsequent files on that list via |:Nexplore| or to +preceding files on that list with |:Pexplore|. Explore will update the +directory and place the cursor appropriately. + +A plain > + :Explore +will clear the explore list. + +If your console or gui produces recognizable shift-up or shift-down sequences, +then you'll likely find using shift-downarrow and shift-uparrow convenient. +They're mapped by netrw: + + == Nexplore, and + == Pexplore. + +As an example, consider +> + :Explore */*.c + :Nexplore + :Nexplore + :Pexplore +< +The status line will show, on the right hand side of the status line, a +message like "Match 3 of 20". + +Associated setting variables: |g:netrw_keepdir| |g:netrw_browse_split| + |g:netrw_fastbrowse| |g:netrw_ftp_browse_reject| + |g:netrw_ftp_list_cmd| |g:netrw_ftp_sizelist_cmd| + |g:netrw_ftp_timelist_cmd| |g:netrw_list_cmd| + |g:netrw_liststyle| + + +DISPLAYING INFORMATION ABOUT FILE *netrw-qf* {{{2 + +With the cursor atop a filename, pressing "qf" will reveal the file's size +and last modification timestamp. Currently this capability is only available +for local files. + + +EDIT FILE OR DIRECTORY HIDING LIST *netrw-ctrl-h* *netrw-edithide* {{{2 + +The "" map brings up a requestor allowing the user to change the +file/directory hiding list contained in |g:netrw_list_hide|. The hiding list +consists of one or more patterns delimited by commas. Files and/or +directories satisfying these patterns will either be hidden (ie. not shown) or +be the only ones displayed (see |netrw-a|). + +The "gh" mapping (see |netrw-gh|) quickly alternates between the usual +hiding list and the hiding of files or directories that begin with ".". + +As an example, > + let g:netrw_list_hide= '\(^\|\s\s\)\zs\.\S\+' +Effectively, this makes the effect of a |netrw-gh| command the initial setting. +What it means: + + \(^\|\s\s\) : if the line begins with the following, -or- + two consecutive spaces are encountered + \zs : start the hiding match now + \. : if it now begins with a dot + \S\+ : and is followed by one or more non-whitespace + characters + +Associated setting variables: |g:netrw_hide| |g:netrw_list_hide| +Associated topics: |netrw-a| |netrw-gh| |netrw-mh| + + +EDITING THE SORTING SEQUENCE *netrw-S* *netrw-sortsequence* {{{2 + +When "Sorted by" is name, one may specify priority via the sorting sequence +(g:netrw_sort_sequence). The sorting sequence typically prioritizes the +name-listing by suffix, although any pattern will do. Patterns are delimited +by commas. The default sorting sequence is (all one line): + +For Unix: > + '[\/]$,\ + '[\/]$,\.[a-np-z]$,\.h$,\.c$,\.cpp$,*,\.o$,\.obj$,\.info$, + \.swp$,\.bak$,\~$' +< +The lone * is where all filenames not covered by one of the other patterns +will end up. One may change the sorting sequence by modifying the +g:netrw_sort_sequence variable (either manually or in your <.vimrc>) or by +using the "S" map. + +Related topics: |netrw-s| |netrw-S| +Associated setting variables: |g:netrw_sort_sequence| |g:netrw_sort_options| + + +FORCING TREATMENT AS A FILE OR DIRECTORY *netrw-gd* *netrw-gf* {{{2 + +Remote symbolic links (ie. those listed via ssh or ftp) are problematic +in that it is difficult to tell whether they link to a file or to a +directory. + +To force treatment as a file: use > + gd +< +To force treatment as a directory: use > + gf +< + +GOING UP *netrw--* {{{2 + +To go up a directory, press "-" or press the when atop the ../ directory +entry in the listing. + +Netrw will use the command in |g:netrw_list_cmd| to perform the directory +listing operation after changing HOSTNAME to the host specified by the +user-provided url. By default netrw provides the command as: + + ssh HOSTNAME ls -FLa + +where the HOSTNAME becomes the [user@]hostname as requested by the attempt to +read. Naturally, the user may override this command with whatever is +preferred. The NetList function which implements remote browsing +expects that directories will be flagged by a trailing slash. + + +HIDING FILES OR DIRECTORIES *netrw-a* *netrw-hiding* {{{2 + +Netrw's browsing facility allows one to use the hiding list in one of three +ways: ignore it, hide files which match, and show only those files which +match. + +If no files have been marked via |netrw-mf|: + +The "a" map allows the user to cycle through the three hiding modes. + +The |g:netrw_list_hide| variable holds a comma delimited list of patterns +based on regular expressions (ex. ^.*\.obj$,^\.) which specify the hiding list. +(also see |netrw-ctrl-h|) To set the hiding list, use the map. As an +example, to hide files which begin with a ".", one may use the map to +set the hiding list to '^\..*' (or one may put let g:netrw_list_hide= '^\..*' +in one's <.vimrc>). One may then use the "a" key to show all files, hide +matching files, or to show only the matching files. + + Example: \.[ch]$ + This hiding list command will hide/show all *.c and *.h files. + + Example: \.c$,\.h$ + This hiding list command will also hide/show all *.c and *.h + files. + +Don't forget to use the "a" map to select the mode (normal/hiding/show) you +want! + +If files have been marked using |netrw-mf|, then this command will: + + if showing all files or non-hidden files: + modify the g:netrw_list_hide list by appending the marked files to it + and showing only non-hidden files. + + else if showing hidden files only: + modify the g:netrw_list_hide list by removing the marked files from it + and showing only non-hidden files. + endif + + *netrw-gh* *netrw-hide* +As a quick shortcut, one may press > + gh +to toggle between hiding files which begin with a period (dot) and not hiding +them. + +Associated setting variable: |g:netrw_list_hide| +Associated topics: |netrw-a| |netrw-ctrl-h| |netrw-mh| + +IMPROVING BROWSING *netrw-listhack* *netrw-ssh-hack* {{{2 + +Especially with the remote directory browser, constantly entering the password +is tedious. + +For Linux/Unix systems, the book "Linux Server Hacks - 100 industrial strength +tips & tools" by Rob Flickenger (O'Reilly, ISBN 0-596-00461-3) gives a tip +for setting up no-password ssh and scp and discusses associated security +issues. It used to be available at http://hacks.oreilly.com/pub/h/66 , +but apparently that address is now being redirected to some "hackzine". +I'll attempt a summary based on that article and on a communication from +Ben Schmidt: + + 1. Generate a public/private key pair on the local machine + (ssh client): > + ssh-keygen -t rsa + (saving the file in ~/.ssh/id_rsa as prompted) +< + 2. Just hit the when asked for passphrase (twice) for no + passphrase. If you do use a passphrase, you will also need to use + ssh-agent so you only have to type the passphrase once per session. + If you don't use a passphrase, simply logging onto your local + computer or getting access to the keyfile in any way will suffice + to access any ssh servers which have that key authorized for login. + + 3. This creates two files: > + ~/.ssh/id_rsa + ~/.ssh/id_rsa.pub +< + 4. On the target machine (ssh server): > + cd + mkdir -p .ssh + chmod 0700 .ssh +< + 5. On your local machine (ssh client): (one line) > + ssh {serverhostname} + cat '>>' '~/.ssh/authorized_keys2' < ~/.ssh/id_rsa.pub +< + or, for OpenSSH, (one line) > + ssh {serverhostname} + cat '>>' '~/.ssh/authorized_keys' < ~/.ssh/id_rsa.pub +< +You can test it out with > + ssh {serverhostname} +and you should be log onto the server machine without further need to type +anything. + +If you decided to use a passphrase, do: > + ssh-agent $SHELL + ssh-add + ssh {serverhostname} +You will be prompted for your key passphrase when you use ssh-add, but not +subsequently when you use ssh. For use with vim, you can use > + ssh-agent vim +and, when next within vim, use > + :!ssh-add +Alternatively, you can apply ssh-agent to the terminal you're planning on +running vim in: > + ssh-agent xterm & +and do ssh-add whenever you need. + +For Windows, folks on the vim mailing list have mentioned that Pageant helps +with avoiding the constant need to enter the password. + +Kingston Fung wrote about another way to avoid constantly needing to enter +passwords: + + In order to avoid the need to type in the password for scp each time, you + provide a hack in the docs to set up a non password ssh account. I found a + better way to do that: I can use a regular ssh account which uses a + password to access the material without the need to key-in the password + each time. It's good for security and convenience. I tried ssh public key + authorization + ssh-agent, implementing this, and it works! Here are two + links with instructions: + + http://www.ibm.com/developerworks/library/l-keyc2/ + http://sial.org/howto/openssh/publickey-auth/ + + +LISTING BOOKMARKS AND HISTORY *netrw-qb* *netrw-listbookmark* {{{2 + +Pressing "qb" (query bookmarks) will list both the bookmarked directories and +directory traversal history. + +Related Topics: + |netrw-gb| how to return (go) to a bookmark + |netrw-mb| how to make a bookmark + |netrw-mB| how to delete bookmarks + |netrw-u| change to a predecessor directory via the history stack + |netrw-U| change to a successor directory via the history stack + +MAKING A NEW DIRECTORY *netrw-d* {{{2 + +With the "d" map one may make a new directory either remotely (which depends +on the global variable g:netrw_mkdir_cmd) or locally (which depends on the +global variable g:netrw_local_mkdir). Netrw will issue a request for the new +directory's name. A bare at that point will abort the making of the +directory. Attempts to make a local directory that already exists (as either +a file or a directory) will be detected, reported on, and ignored. + +Currently, making a directory via ftp is not supported. + +Associated setting variable: |g:netrw_local_mkdir| |g:netrw_mkdir_cmd| + + +MAKING THE BROWSING DIRECTORY THE CURRENT DIRECTORY *netrw-c* {{{2 + +By default, |g:netrw_keepdir| is 1. This setting means that the current +directory will not track the browsing directory. + +Setting g:netrw_keepdir to 0 tells netrw to make vim's current directory to +track netrw's browsing directory. + +However, given the default setting for g:netrw_keepdir of 1 where netrw +maintains its own separate notion of the current directory, in order to make +the two directories the same, use the "c" map (just type c). That map will +set Vim's notion of the current directory to netrw's current browsing +directory. + +Associated setting variable: |g:netrw_keepdir| + +MARKING FILES *netrw-mf* {{{2 + (also see |netrw-mr|) + +One may mark files with the cursor atop a filename and then pressing "mf". +With gvim, one may also mark files with . The following netrw +maps make use of marked files: + + |netrw-a| Hide marked files/directories + |netrw-D| Delete marked files/directories + |netrw-mc| Copy marked files to target + |netrw-md| Apply vimdiff to marked files + |netrw-me| Edit marked files + |netrw-mg| Apply vimgrep to marked files + |netrw-mm| Move marked files + |netrw-mp| Print marked files + |netrw-mt| Set target for |netrw-mm| and |netrw-mc| + |netrw-mT| Generate tags using marked files + |netrw-mx| Apply shell command to marked files + |netrw-mz| Compress/Decompress marked files + |netrw-O| Obtain marked files + |netrw-R| Rename marked files + +One may unmark files one at a time the same way one marks them; ie. place +the cursor atop a marked file and press "mf". This process also works +with using gvim. One may unmark all files by pressing +"mu" (see |netrw-mu|). + +Marked files are highlighted using the "netrwMarkFile" highlighting group, +which by default is linked to "Identifier" (see Identifier under +|group-name|). You may change the highlighting group by putting something +like > + + highlight clear netrwMarkFile + hi link netrwMarkFile ..whatever.. +< +into $HOME/.vim/after/syntax/netrw.vim . + +*markfilelist* *global_markfilelist* *local_markfilelist* +All marked files are entered onto the global marked file list; there is only +one such list. In addition, every netrw buffer also has its own local marked +file list; since netrw buffers are associated with specific directories, this +means that each directory has its own local marked file list. The various +commands which operate on marked files use one or the other of the marked file +lists. + + +MARKING FILES BY REGULAR EXPRESSION *netrw-mr* {{{2 + (also see |netrw-mf|) + +One may also mark files by pressing "mr"; netrw will then issue a prompt, +"Enter regexp: ". You may then enter a shell-style regular expression such +as *.c$ (see |glob()|). For remote systems, glob() doesn't work -- so netrw +converts "*" into ".*" (see |regexp|) and marks files based on that. In the +future I may make it possible to use |regexp|s instead of glob()-style +expressions (yet-another-option). + + +MARKED FILES: ARBITRARY COMMAND *netrw-mx* {{{2 + (See |netrw-mf| and |netrw-mr| for how to mark files) + (uses the local marked-file list) + +Upon activation of the "mx" map, netrw will query the user for some (external) +command to be applied to all marked files. All "%"s in the command will be +substituted with the name of each marked file in turn. If no "%"s are in the +command, then the command will be followed by a space and a marked filename. + + +MARKED FILES: COMPRESSION AND DECOMPRESSION *netrw-mz* {{{2 + (See |netrw-mf| and |netrw-mr| for how to mark files) + (uses the local marked file list) + +If any marked files are compressed, then "mz" will decompress them. +If any marked files are decompressed, then "mz" will compress them +using the command specified by |g:netrw_compress|; by default, +that's "gzip". + +For decompression, netrw provides a |Dictionary| of suffices and their +associated decompressing utilities; see |g:netrw_decompress|. + +Associated setting variables: |g:netrw_compress| |g:netrw_decompress| + +MARKED FILES: COPYING *netrw-mc* {{{2 + (See |netrw-mf| and |netrw-mr| for how to mark files) + (Uses the global marked file list) + +Select a target directory with mt (|netrw-mt|). Then change directory, +select file(s) (see |netrw-mf|), and press "mc". The copy is done +from the current window (where one does the mf) to the target. + +Associated setting variable: |g:netrw_localcopycmd| |g:netrw_ssh_cmd| + +MARKED FILES: DIFF *netrw-md* {{{2 + (See |netrw-mf| and |netrw-mr| for how to mark files) + (uses the global marked file list) + +Use |vimdiff| to visualize difference between selected files (two or +three may be selected for this). Uses the global marked file list. + +MARKED FILES: EDITING *netrw-me* {{{2 + (See |netrw-mf| and |netrw-mr| for how to mark files) + (uses the global marked file list) + +This command will place the marked files on the |arglist| and commence +editing them. One may return the to explorer window with |:Rexplore|. + +MARKED FILES: GREP *netrw-mg* {{{2 + (See |netrw-mf| and |netrw-mr| for how to mark files) + (uses the global marked file list) + +This command will apply |:vimgrep| to the marked files. The command will ask +for the requested pattern; one may enter: > + /pattern/[g][j] + ! /pattern/[g][j] + pattern +< +MARKED FILES: HIDING AND UNHIDING BY SUFFIX *netrw-mh* {{{2 + (See |netrw-mf| and |netrw-mr| for how to mark files) + (uses the local marked file list) + +This command extracts the suffices of the marked files and toggles their +presence on the hiding list. Please note that marking the same suffix +this way multiple times will result in the suffix's presence being toggled +for each file (so an even quantity of marked files having the same suffix +is the same as not having bothered to select them at all). + +Related topics: |netrw-a| |g:netrw_list_hide| + +MARKED FILES: MOVING *netrw-mm* {{{2 + (See |netrw-mf| and |netrw-mr| for how to mark files) + (uses the global marked file list) + + WARNING: moving files is more dangerous than copying them. + A file being moved is first copied and then deleted; if the + copy operation fails and the delete succeeds, you will lose + the file. Either try things out with unimportant files + first or do the copy and then delete yourself using mc and D. + Use at your own risk! + +Select a target directory with mt (|netrw-mt|). Then change directory, +select file(s) (see |netrw-mf|), and press "mm". The move is done +from the current window (where one does the mf) to the target. + +Associated setting variable: |g:netrw_localmovecmd| |g:netrw_ssh_cmd| + +MARKED FILES: PRINTING *netrw-mp* {{{2 + (See |netrw-mf| and |netrw-mr| for how to mark files) + (uses the local marked file list) + +Netrw will apply the |:hardcopy| command to marked files. What it does +is open each file in a one-line window, execute hardcopy, then close the +one-line window. + + +MARKED FILES: SOURCING *netrw-ms* {{{2 + (See |netrw-mf| and |netrw-mr| for how to mark files) + (uses the local marked file list) + +Netrw will source the marked files (using vim's |:source| command) + + +MARKED FILES: TAGGING *netrw-mT* {{{2 + (See |netrw-mf| and |netrw-mr| for how to mark files) + (uses the global marked file list) + +The "mT" mapping will apply the command in |g:netrw_ctags| (by default, it is +"ctags") to marked files. For remote browsing, in order to create a tags file +netrw will use ssh (see |g:netrw_ssh_cmd|), and so ssh must be available for +this to work on remote systems. For your local system, see |ctags| on how to +get a version. I myself use hdrtags, currently available at +http://mysite.verizon.net/astronaut/src/index.html , and have > + + let g:netrw_ctags= "hdrtag" +< +in my <.vimrc>. + +When a remote set of files are tagged, the resulting tags file is "obtained"; +ie. a copy is transferred to the local system's directory. The local tags +file is then modified so that one may use it through the network. The +modification is concerns the names of the files in the tags; each filename is +preceded by the netrw-compatible url used to obtain it. When one subsequently +uses one of the go to tag actions (|tags|), the url will be used by netrw to +edit the desired file and go to the tag. + +Associated setting variables: |g:netrw_ctags| |g:netrw_ssh_cmd| + + +MARKED FILES: SETTING THE TARGET DIRECTORY *netrw-mt* {{{2 + (See |netrw-mf| and |netrw-mr| for how to mark files) + +Set the marked file copy/move-to target (see |netrw-mc| and |netrw-mm|): + + * if the cursor is atop a file name, then the netrw window's currently + displayed directory is used for the copy/move-to target. + + * also, if the cursor is in the banner, then the netrw window's currently + displayed directory is used for the copy/move-to target. + + * however, if the cursor is atop a directory name, then that directory is + used for the copy/move-to target + +There is only one copy/move-to target per vim session; ie. the target is a +script variable (see |s:var|) and is shared between all netrw windows (in an +instance of vim). + +MARKED FILES: UNMARKING *netrw-mu* {{{2 + (See |netrw-mf| and |netrw-mr| for how to mark files) + +The "mu" mapping will unmark all currently marked files. + + +NETRW BROWSER VARIABLES *netrw-browser-options* *netrw-browser-var* {{{2 + +(if you're interested in the netrw file transfer settings, see |netrw-options|) + +The browser provides settings in the form of variables which +you may modify; by placing these settings in your <.vimrc>, you may customize +your browsing preferences. (see also: |netrw-settings|) +> + --- ----------- + Var Explanation + --- ----------- +< *g:netrw_alto* change from above splitting to below splitting + by setting this variable (see |netrw-o|) + default: =&sb (see |'sb'|) + + *g:netrw_altv* change from left splitting to right splitting + by setting this variable (see |netrw-v|) + default: =&spr (see |'spr'|) + + *g:netrw_banner* enable/suppress the banner + =0: suppress the banner + =1: banner is enabled (default) + NOTE: suppressing the banner is a new feature + which may cause problems. + + *g:netrw_browse_split* when browsing, will open the file by: + =0: re-using the same window + =1: horizontally splitting the window first + =2: vertically splitting the window first + =3: open file in new tab + =4: act like "P" (ie. open previous window) + Note that |g:netrw_preview| may be used + to get vertical splitting instead of + horizontal splitting. + + *g:netrw_browsex_viewer* specify user's preference for a viewer: > + "kfmclient exec" + "gnome-open" +< If > + "-" +< is used, then netrwFileHandler() will look for + a script/function to handle the given + extension. (see |netrw_filehandler|). + + *g:netrw_chgperm* Unix/Linux: "chmod PERM FILENAME" + Windows: "cacls FILENAME /e /p PERM" + Used to change access permission for a file. + + *g:netrw_compress* ="gzip" + Will compress marked files with this + command + + *g:netrw_ctags* ="ctags" + The default external program used to create tags + + *g:netrw_cursor* = 2 (default) + This option controls the use of the + |'cursorline'| (cul) and |'cursorcolumn'| + (cuc) settings by netrw: + + Value Thin-Long-Tree Wide + =0 u-cul u-cuc u-cul u-cuc + =1 u-cul u-cuc cul u-cuc + =2 cul u-cuc cul u-cuc + =3 cul u-cuc cul cuc + =4 cul cuc cul cuc + + Where + u-cul : user's |'cursorline'| setting used + u-cuc : user's |'cursorcolumn'| setting used + cul : |'cursorline'| locally set + cuc : |'cursorcolumn'| locally set + + *g:netrw_decompress* = { ".gz" : "gunzip" , + ".bz2" : "bunzip2" , + ".zip" : "unzip" , + ".tar" : "tar -xf"} + A dictionary mapping suffices to + decompression programs. + + *g:netrw_dirhistmax* =10: controls maximum quantity of past + history. May be zero to supppress + history. + (related: |netrw-qb| |netrw-u| |netrw-U|) + + *g:netrw_fastbrowse* =0: slow speed directory browsing; + never re-uses directory listings, + always obtains directory listings. + =1: medium speed directory browsing; + re-use directory listings only + when remote directory browsing. + (default value) + =2: fast directory browsing; + only obtains directory listings when the + directory hasn't been seen before + (or |netrw-ctrl-l| is used). + + Fast browsing retains old directory listing + buffers so that they don't need to be + re-acquired. This feature is especially + important for remote browsing. However, if + a file is introduced or deleted into or from + such directories, the old directory buffer + becomes out-of-date. One may always refresh + such a directory listing with |netrw-ctrl-l|. + This option gives the user the choice of + trading off accuracy (ie. up-to-date listing) + versus speed. + + *g:netrw_fname_escape* =' ?&;%' + Used on filenames before remote reading/writing + + *g:netrw_ftp_browse_reject* ftp can produce a number of errors and warnings + that can show up as "directories" and "files" + in the listing. This pattern is used to + remove such embedded messages. By default its + value is: + '^total\s\+\d\+$\| + ^Trying\s\+\d\+.*$\| + ^KERBEROS_V\d rejected\| + ^Security extensions not\| + No such file\| + : connect to address [0-9a-fA-F:]* + : No route to host$' + + *g:netrw_ftp_list_cmd* options for passing along to ftp for directory + listing. Defaults: + unix or g:netrw_cygwin set: : "ls -lF" + otherwise "dir" + + + *g:netrw_ftp_sizelist_cmd* options for passing along to ftp for directory + listing, sorted by size of file. + Defaults: + unix or g:netrw_cygwin set: : "ls -slF" + otherwise "dir" + + *g:netrw_ftp_timelist_cmd* options for passing along to ftp for directory + listing, sorted by time of last modification. + Defaults: + unix or g:netrw_cygwin set: : "ls -tlF" + otherwise "dir" + + *g:netrw_glob_escape* ='[]*?`{~$' (unix) + ='[]*?`{$' (windows + These characters in directory names are + escaped before applying glob() + + *g:netrw_hide* if true, the hiding list is used + default: =0 + + *g:netrw_home* The home directory for where bookmarks and + history are saved (as .netrwbook and + .netrwhist). + default: the first directory on the + |'runtimepath'| + + *g:netrw_keepdir* =1 (default) keep current directory immune from + the browsing directory. + =0 keep the current directory the same as the + browsing directory. + The current browsing directory is contained in + b:netrw_curdir (also see |netrw-c|) + + *g:netrw_list_cmd* command for listing remote directories + default: (if ssh is executable) + "ssh HOSTNAME ls -FLa" + + *g:netrw_liststyle* Set the default listing style: + = 0: thin listing (one file per line) + = 1: long listing (one file per line with time + stamp information and file size) + = 2: wide listing (multiple files in columns) + = 3: tree style listing + *g:netrw_list_hide* comma separated pattern list for hiding files + Patterns are regular expressions (see |regexp|) + Example: let g:netrw_list_hide= '.*\.swp$' + default: "" + + *g:netrw_localcopycmd* ="cp" Linux/Unix/MacOS/Cygwin + ="copy" Windows + Copies marked files (|netrw-mf|) to target + directory (|netrw-mt|, |netrw-mc|) + + *g:netrw_localmovecmd* ="mv" Linux/Unix/MacOS/Cygwin + ="move" Windows + Moves marked files (|netrw-mf|) to target + directory (|netrw-mt|, |netrw-mm|) + + *g:netrw_local_mkdir* command for making a local directory + default: "mkdir" + + *g:netrw_local_rmdir* remove directory command (rmdir) + default: "rmdir" + + *g:netrw_maxfilenamelen* =32 by default, selected so as to make long + listings fit on 80 column displays. + If your screen is wider, and you have file + or directory names longer than 32 bytes, + you may set this option to keep listings + columnar. + + *g:netrw_mkdir_cmd* command for making a remote directory + default: "ssh USEPORT HOSTNAME mkdir" + + *g:netrw_mousemaps* =1 (default) enables mouse buttons while + browsing to: + leftmouse : open file/directory + shift-leftmouse : mark file + middlemouse : same as P + rightmouse : remove file/directory + =0: disables mouse maps + + *g:netrw_retmap* if it exists and is set to one, then: + * if in a netrw-selected file, AND + * no normal-mode <2-leftmouse> mapping exists, + then the <2-leftmouse> will be mapped for easy + return to the netrw browser window. + example: click once to select and open a file, + double-click to return. + + Note that one may instead choose to: + * let g:netrw_retmap= 1, AND + * nmap YourChoice NetrwReturn + and have another mapping instead of + <2-leftmouse> to invoke the return. + + You may also use the |:Rexplore| command to do + the same thing. + + default: =0 + + *g:netrw_rm_cmd* command for removing files + default: "ssh USEPORT HOSTNAME rm" + + *g:netrw_rmdir_cmd* command for removing directories + default: "ssh USEPORT HOSTNAME rmdir" + + *g:netrw_rmf_cmd* command for removing softlinks + default: "ssh USEPORT HOSTNAME rm -f" + + *g:netrw_sort_by* sort by "name", "time", or "size" + default: "name" + + *g:netrw_sort_direction* sorting direction: "normal" or "reverse" + default: "normal" + + *g:netrw_sort_options* sorting is done using |:sort|; this + variable's value is appended to the + sort command. Thus one may ignore case, + for example, with the following in your + .vimrc: > + let g:netrw_sort_options="i" +< default: "" + + *g:netrw_sort_sequence* when sorting by name, first sort by the + comma-separated pattern sequence. Note that + the filigree added to indicate filetypes + should be accounted for in your pattern. + default: '[\/]$,*,\.bak$,\.o$,\.h$, + \.info$,\.swp$,\.obj$' + + *g:netrw_special_syntax* If true, then certain files will be shown + in special syntax in the browser: + + netrwBak : *.bak + netrwCompress: *.gz *.bz2 *.Z *.zip + netrwData : *.dat + netrwHdr : *.h + netrwLib : *.a *.so *.lib *.dll + netrwMakefile: [mM]akefile *.mak + netrwObj : *.o *.obj + netrwTags : tags ANmenu ANtags + netrwTilde : *~ + netrwTmp : tmp* *tmp + + These syntax highlighting groups are linked + to Folded or DiffChange by default + (see |hl-Folded| and |hl-DiffChange|), but + one may put lines like > + hi link netrwCompress Visual +< into one's <.vimrc> to use one's own + preferences. + + *g:netrw_ssh_cmd* One may specify an executable command + to use instead of ssh for remote actions + such as listing, file removal, etc. + default: ssh + + *g:netrw_ssh_browse_reject* ssh can sometimes produce unwanted lines, + messages, banners, and whatnot that one doesn't + want masquerading as "directories" and "files". + Use this pattern to remove such embedded + messages. By default its value is: + '^total\s\+\d\+$' + + + *g:netrw_tmpfile_escape* =' &;' + escape() is applied to all temporary files + to escape these characters. + + *g:netrw_timefmt* specify format string to vim's strftime(). + The default, "%c", is "the preferred date + and time representation for the current + locale" according to my manpage entry for + strftime(); however, not all are satisfied + with it. Some alternatives: + "%a %d %b %Y %T", + " %a %Y-%m-%d %I-%M-%S %p" + default: "%c" + + *g:netrw_use_noswf* netrw normally avoids writing swapfiles + for browser buffers. However, under some + systems this apparently is causing nasty + ml_get errors to appear; if you're getting + ml_get errors, try putting + let g:netrw_use_noswf= 0 + in your .vimrc. + + *g:netrw_winsize* specify initial size of new windows made with + "o" (see |netrw-o|), "v" (see |netrw-v|), + |:Hexplore| or |:Vexplore|. The g:netrw_winsize + is an integer describing the percentage of the + current netrw buffer's window to be used for + the new window. + default: 50 (for 50%) + + *g:netrw_xstrlen* Controls how netrw computes string lengths, + including multi-byte characters' string + length. (thanks to N Weibull, T Mechelynck) + =0: uses Vim's built-in strlen() + =1: number of codepoints (Latin a + combining + circumflex is two codepoints) (DEFAULT) + =2: number of spacing codepoints (Latin a + + combining circumflex is one spacing + codepoint; a hard tab is one; wide and + narrow CJK are one each; etc.) + =3: virtual length (counting tabs as anything + between 1 and |'tabstop'|, wide CJK as 2 + rather than 1, Arabic alif as zero when + immediately preceded by lam, one + otherwise, etc) + + *g:NetrwTopLvlMenu* This variable specifies the top level + menu name; by default, it's "Netrw.". If + you wish to change this, do so in your + .vimrc. + +NETRW BROWSING AND OPTION INCOMPATIBILITIES *netrw-incompatible* {{{2 + +Netrw has been designed to handle user options by saving them, setting the +options to something that's compatible with netrw's needs, and then restoring +them. However, the autochdir option: > + :set acd +is problematical. Autochdir sets the current directory to that containing the +file you edit; this apparently also applies to directories. In other words, +autochdir sets the current directory to that containing the "file" (even if +that "file" is itself a directory). + +NETRW BROWSER SETTINGS *netrw-settings* {{{2 + +With the NetrwSettings.vim plugin, > + :NetrwSettings +will bring up a window with the many variables that netrw uses for its +settings. You may change any of their values; when you save the file, the +settings therein will be used. One may also press "?" on any of the lines for +help on what each of the variables do. + +(also see: |netrw-browser-var| |netrw-protocol| |netrw-var| |netrw-variables|) + + +============================================================================== +OBTAINING A FILE *netrw-O* {{{2 + +If there are no marked files: + + When browsing a remote directory, one may obtain a file under the cursor + (ie. get a copy on your local machine, but not edit it) by pressing the O + key. + +If there are marked files: + + The marked files will be obtained (ie. a copy will be transferred to your + local machine, but not set up for editing). + +Only ftp and scp are supported for this operation (but since these two are +available for browsing, that shouldn't be a problem). The status bar will +then show, on its right hand side, a message like "Obtaining filename". The +statusline will be restored after the transfer is complete. + +Netrw can also "obtain" a file using the local browser. Netrw's display +of a directory is not necessarily the same as Vim's "current directory", +unless |g:netrw_keepdir| is set to 0 in the user's <.vimrc>. One may select +a file using the local browser (by putting the cursor on it) and pressing +"O" will then "obtain" the file; ie. copy it to Vim's current directory. + +Related topics: + * To see what the current directory is, use |:pwd| + * To make the currently browsed directory the current directory, see |netrw-c| + * To automatically make the currently browsed directory the current + directory, see |g:netrw_keepdir|. + + + *netrw-createfile* +OPEN A NEW FILE IN NETRW'S CURRENT DIRECTORY *netrw-%* + +To open a file in netrw's current directory, press "%". This map will +query the user for a new filename; an empty file by that name will be +placed in the netrw's current directory (ie. b:netrw_curdir). + + +PREVIEW WINDOW *netrw-p* *netrw-preview* {{{2 + +One may use a preview window by using the "p" key when the cursor is atop the +desired filename to be previewed. The display will then split to show both +the browser (where the cursor will remain) and the file (see |:pedit|). +By default, the split will be taken horizontally; one may use vertical +splitting if one has set |g:netrw_preview| first. + +An interesting set of netrw settings is: > + + let g:netrw_preview = 1 + let g:netrw_liststyle = 3 + let g:netrw_winsize = 30 + +These will: + 1. Make vertical splitting the default for previewing files + 2. Make the default listing style "tree" + 3. When a vertical preview window is opened, the directory listing + will use only 30 columns; the rest of the window is used for the + preview window. + +PREVIOUS WINDOW *netrw-P* *netrw-prvwin* {{{2 + +To edit a file or directory in the previously used (last accessed) window (see +:he |CTRL-W_p|), press a "P". If there's only one window, then the one window +will be horizontally split (above/below splitting is controlled by +|g:netrw_alto|, and its initial size is controlled by |g:netrw_winsize|). + +If there's more than one window, the previous window will be re-used on +the selected file/directory. If the previous window's associated buffer +has been modified, and there's only one window with that buffer, then +the user will be asked if s/he wishes to save the buffer first (yes, +no, or cancel). + + +REFRESHING THE LISTING *netrw-ctrl-l* *netrw-ctrl_l* {{{2 + +To refresh either a local or remote directory listing, press ctrl-l () or +hit the when atop the ./ directory entry in the listing. One may also +refresh a local directory by using ":e .". + + +RENAMING FILES OR DIRECTORIES *netrw-move* *netrw-rename* *netrw-R* {{{2 + +If there are no marked files: (see |netrw-mf|) + + Renaming/moving files and directories involves moving the cursor to the + file/directory to be moved (renamed) and pressing "R". You will then be + queried for where you want the file/directory to be moved. You may select + a range of lines with the "V" command (visual selection), and then + pressing "R". + +If there are marked files: (see |netrw-mf|) + + Marked files will be renamed (moved). You will be queried as above in + order to specify where you want the file/directory to be moved. + + WARNING:~ + + Note that moving files is a dangerous operation; copies are safer. That's + because a "move" for remote files is actually a copy + delete -- and if + the copy fails and the delete does not, you may lose the file. + +The g:netrw_rename_cmd variable is used to implement renaming. By default its +value is: + + ssh HOSTNAME mv + +One may rename a block of files and directories by selecting them with +the V (|linewise-visual|). + + +REVERSING SORTING ORDER *netrw-r* *netrw-reverse* {{{2 + +One may toggle between normal and reverse sorting order by pressing the +"r" key. + +Related topics: |netrw-s| +Associated setting variable: |g:netrw_sort_direction| + + +SELECTING SORTING STYLE *netrw-s* *netrw-sort* {{{2 + +One may select the sorting style by name, time, or (file) size. The "s" map +allows one to circulate amongst the three choices; the directory listing will +automatically be refreshed to reflect the selected style. + +Related topics: |netrw-r| |netrw-S| +Associated setting variables: |g:netrw_sort_by| |g:netrw_sort_sequence| + + +SETTING EDITING WINDOW *netrw-C* {{{2 + +One may select a netrw window for editing with the "C" mapping, or by setting +g:netrw_chgwin to the selected window number. Subsequent selection of a file +to edit (|netrw-cr|) will use that window. + +Related topics: |netrw-cr| +Associated setting variables: |g:netrw_chgwin| + + +10. Problems and Fixes *netrw-problems* {{{1 + + (This section is likely to grow as I get feedback) + (also see |netrw-debug|) + *netrw-p1* + P1. I use windows 95, and my ftp dumps four blank lines at the + end of every read. + + See |netrw-fixup|, and put the following into your + <.vimrc> file: + + let g:netrw_win95ftp= 1 + + *netrw-p2* + P2. I use Windows, and my network browsing with ftp doesn't sort by + time or size! -or- The remote system is a Windows server; why + don't I get sorts by time or size? + + Windows' ftp has a minimal support for ls (ie. it doesn't + accept sorting options). It doesn't support the -F which + gives an explanatory character (ABC/ for "ABC is a directory"). + Netrw then uses "dir" to get both its thin and long listings. + If you think your ftp does support a full-up ls, put the + following into your <.vimrc>: > + + let g:netrw_ftp_list_cmd = "ls -lF" + let g:netrw_ftp_timelist_cmd= "ls -tlF" + let g:netrw_ftp_sizelist_cmd= "ls -slF" +< + Alternatively, if you have cygwin on your Windows box, put + into your <.vimrc>: > + + let g:netrw_cygwin= 1 +< + This problem also occurs when the remote system is Windows. + In this situation, the various g:netrw_ftp_[time|size]list_cmds + are as shown above, but the remote system will not correctly + modify its listing behavior. + + + *netrw-p3* + P3. I tried rcp://user@host/ (or protocol other than ftp) and netrw + used ssh! That wasn't what I asked for... + + Netrw has two methods for browsing remote directories: ssh + and ftp. Unless you specify ftp specifically, ssh is used. + When it comes time to do download a file (not just a directory + listing), netrw will use the given protocol to do so. + + *netrw-p4* + P4. I would like long listings to be the default. + + Put the following statement into your |.vimrc|: > + + let g:netrw_liststyle= 1 +< + Check out |netrw-browser-var| for more customizations that + you can set. + + *netrw-p5* + P5. My times come up oddly in local browsing + + Does your system's strftime() accept the "%c" to yield dates + such as "Sun Apr 27 11:49:23 1997"? If not, do a "man strftime" + and find out what option should be used. Then put it into + your |.vimrc|: > + + let g:netrw_timefmt= "%X" (where X is the option) +< + *netrw-p6* + P6. I want my current directory to track my browsing. + How do I do that? + + Put the following line in your |.vimrc|: +> + let g:netrw_keepdir= 0 +< + *netrw-p7* + P7. I use Chinese (or other non-ascii) characters in my filenames, and + netrw (Explore, Sexplore, Hexplore, etc) doesn't display them! + + (taken from an answer provided by Wu Yongwei on the vim + mailing list) + I now see the problem. You code page is not 936, right? Vim + seems only able to open files with names that are valid in the + current code page, as are many other applications that do not + use the Unicode version of Windows APIs. This is an OS-related + issue. You should not have such problems when the system + locale uses UTF-8, such as modern Linux distros. + + (...it is one more reason to recommend that people use utf-8!) + + *netrw-p8* + P8. I'm getting "ssh is not executable on your system" -- what do I + do? + + (Dudley Fox) Most people I know use putty for windows ssh. It + is a free ssh/telnet application. You can read more about it + here: + + http://www.chiark.greenend.org.uk/~sgtatham/putty/ Also: + + (Marlin Unruh) This program also works for me. It's a single + executable, so he/she can copy it into the Windows\System32 + folder and create a shortcut to it. + + (Dudley Fox) You might also wish to consider plink, as it + sounds most similar to what you are looking for. plink is an + application in the putty suite. + + http://the.earth.li/~sgtatham/putty/0.58/htmldoc/Chapter7.html#plink + + (Vissale Neang) Maybe you can try OpenSSH for windows, which + can be obtained from: + + http://sshwindows.sourceforge.net/ + + It doesn't need the full Cygwin package. + + (Antoine Mechelynck) For individual Unix-like programs needed + for work in a native-Windows environment, I recommend getting + them from the GnuWin32 project on sourceforge if it has them: + + http://gnuwin32.sourceforge.net/ + + Unlike Cygwin, which sets up a Unix-like virtual machine on + top of Windows, GnuWin32 is a rewrite of Unix utilities with + Windows system calls, and its programs works quite well in the + cmd.exe "Dos box". + + (dave) Download WinSCP and use that to connect to the server. + In Preferences > Editors, set gvim as your editor: + + - Click "Add..." + - Set External Editor (adjust path as needed, include + the quotes and !.! at the end): + "c:\Program Files\Vim\vim70\gvim.exe" !.! + - Check that the filetype in the box below is + {asterisk}.{asterisk} (all files), or whatever types + you want (cec: change {asterisk} to * ; I had to + write it that way because otherwise the helptags + system thinks it's a tag) + - Make sure it's at the top of the listbox (click it, + then click "Up" if it's not) + If using the Norton Commander style, you just have to hit + to edit a file in a local copy of gvim. + + (Vit Gottwald) How to generate public/private key and save + public key it on server: > + http://www.chiark.greenend.org.uk/~sgtatham/putty/0.60/htmldoc/Chapter8.html#pubkey-gettingready + (8.3 Getting ready for public key authentication) +< + How to use a private key with 'pscp': > + + http://www.chiark.greenend.org.uk/~sgtatham/putty/0.60/htmldoc/Chapter5.html + (5.2.4 Using public key authentication with PSCP) +< + (Ben Schmidt) I find the ssh included with cwRsync is + brilliant, and install cwRsync or cwRsyncServer on most + Windows systems I come across these days. I guess COPSSH, + packed by the same person, is probably even better for use as + just ssh on Windows, and probably includes sftp, etc. which I + suspect the cwRsync doesn't, though it might + + (cec) To make proper use of these suggestions above, you will + need to modify the following user-settable variables in your + .vimrc: + + |g:netrw_ssh_cmd| |g:netrw_list_cmd| |g:netrw_mkdir_cmd| + |g:netrw_rm_cmd| |g:netrw_rmdir_cmd| |g:netrw_rmf_cmd| + + The first one (|g:netrw_ssh_cmd|) is the most important; most + of the others will use the string in g:netrw_ssh_cmd by + default. + *netrw-p9* *netrw-ml_get* + P9. I'm browsing, changing directory, and bang! ml_get errors + appear and I have to kill vim. Any way around this? + + Normally netrw attempts to avoid writing swapfiles for + its temporary directory buffers. However, on some systems + this attempt appears to be causing ml_get errors to + appear. Please try setting |g:netrw_use_noswf| to 0 + in your <.vimrc>: > + let g:netrw_use_noswf= 0 +< + *netrw-p10* + P10. I'm being pestered with "[something] is a directory" and + "Press ENTER or type command to continue" prompts... + + The "[something] is a directory" prompt is issued by Vim, + not by netrw, and there appears to be no way to work around + it. Coupled with the default cmdheight of 1, this message + causes the "Press ENTER..." prompt. So: read |hit-enter|; + I also suggest that you set your |'cmdheight'| to 2 (or more) in + your <.vimrc> file. + + *netrw-p11* + P11. I want to have two windows; a thin one on the left and my editing + window on the right. How may I accomplish this? + + * Put the following line in your <.vimrc>: + let g:netrw_altv = 1 + * Edit the current directory: :e . + * Select some file, press v + * Resize the windows as you wish (see |CTRL-W_<| and + |CTRL-W_>|). If you're using gvim, you can drag + the separating bar with your mouse. + * When you want a new file, use ctrl-w h to go back to the + netrw browser, select a file, then press P (see |CTRL-W_h| + and |netrw-P|). If you're using gvim, you can press + in the browser window and then press the + to select the file. + + *netrw-p12* + P12. My directory isn't sorting correctly, or unwanted letters are + appearing in the listed filenames, or things aren't lining + up properly in the wide listing, ... + + This may be due to an encoding problem. I myself usually use + utf-8, but really only use ascii (ie. bytes from 32-126). + Multibyte encodings use two (or more) bytes per character. + You may need to change |g:netrw_sepchr| and/or |g:netrw_xstrlen|. + + *netrw-p13* + P13. I'm a Windows + putty + ssh user, and when I attempt to browse, + the directories are missing trailing "/"s so netrw treats them + as file transfers instead of as attempts to browse + subdirectories. How may I fix this? + + (mikeyao) If you want to use vim via ssh and putty under Windows, + try combining the use of pscp/psftp with plink. pscp/psftp will + be used to connect and plink will be used to execute commands on + the server, for example: list files and directory using 'ls'. + + These are the settings I use to do this: +> + " list files, it's the key setting, if you haven't set, + " you will get a blank buffer + let g:netrw_list_cmd = "plink HOSTNAME ls -Fa" + " if you haven't add putty directory in system path, you should + " specify scp/sftp command. For examples: + "let g:netrw_sftp_cmd = "d:\\dev\\putty\\PSFTP.exe" + "let g:netrw_scp_cmd = "d:\\dev\\putty\\PSCP.exe" +< + *netrw-p14* + P14. I'd would like to speed up writes using Nwrite and scp/ssh + style connections. How? (Thomer M. Gil) + + Try using ssh's ControlMaster and ControlPath (see the ssh_config + man page) to share multiple ssh connections over a single network + connection. That cuts out the cryptographic handshake on each + file write, sometimes speeding it up by an order of magnitude. + (see http://thomer.com/howtos/netrw_ssh.html) + (included by permission) + + Add the following to your ~/.ssh/config: > + + # you change "*" to the hostname you care about + Host * + ControlMaster auto + ControlPath /tmp/%r@%h:%p + +< Then create an ssh connection to the host and leave it running: > + + ssh -N host.domain.com + +< Now remotely open a file with Vim's Netrw and enjoy the + zippiness: > + + vim scp://host.domain.com//home/user/.bashrc +< + *netrw-p15* + P15. How may I use a double-click instead of netrw's usual single click + to open a file or directory? (Ben Fritz) + + First, disable netrw's mapping with > + let g:netrw_mousemaps= 0 +< and then create a netrw buffer only mapping in + $HOME/.vim/after/ftplugin/netrw.vim: > + nmap <2-leftmouse> +< Note that setting g:netrw_mousemaps to zero will turn off + all netrw's mouse mappings, not just the one. + (see |g:netrw_mousemaps|) + +============================================================================== +11. Debugging Netrw Itself *netrw-debug* {{{1 + +The script is typically available as something like: +> + /usr/local/share/vim/vim7x/plugin/netrwPlugin.vim + /usr/local/share/vim/vim7x/autoload/netrw.vim +< -or- > + /usr/local/share/vim/vim6x/plugin/netrwPlugin.vim + /usr/local/share/vim/vim6x/autoload/netrw.vim +< +which is loaded automatically at startup (assuming :set nocp). + + 1. Get the script, available as: + + http://mysite.verizon.net/astronaut/vim/index.html#DECHO + or + http://vim.sourceforge.net/scripts/script.php?script_id=120 + + It now comes as a "vimball"; if you're using vim 7.0 or earlier, + you'll need to update vimball, too. See + http://mysite.verizon.net/astronaut/vim/index.html#VIMBALL + + 2. Edit the file by typing: > + + vim netrw.vim + :DechoOn + :wq +< + To restore to normal non-debugging behavior, re-edit + and type > + + vim netrw.vim + :DechoOff + :wq +< + This command, provided by , will comment out all + Decho-debugging statements (Dfunc(), Dret(), Decho(), Dredir()). + + 3. Then bring up vim and attempt to evoke the problem by doing a + transfer or doing some browsing. A set of messages should appear + concerning the steps that took in attempting to + read/write your file over the network in a separate tab. + + To save the file, use > + :tabnext + :set bt= + :w! DBG +< Please send that information to 's maintainer, > + NdrOchip at ScampbellPfamily.AbizM - NOSPAM +< +============================================================================== +12. History *netrw-history* {{{1 + + v142: Apr 06, 2011 * I modified NetrwRemoteListing() to use + shellescape(fnameescape(s:path),1) for + the benefit of those using scp://.../ + with subdirectories having spaces. + Problem reported by: Gilles Charron + Apr 18, 2011 * s:NetrwMethod() attempts to issue an + error message when given a malformed url + Apr 29, 2011 * converted most mousemaps to use s + * |g:netrw_winsize|'s meaning changed + v141: Aug 28, 2010 * added -s:... support for Windows ftp + * restored 2-leftmouse for :Rex-like return + * added balloon help for banner + Oct 26, 2010 * :Texplore changed to start from netrw's idea + of the current directory, not pwd's + Feb 10, 2011 * netrwPlugin modified to use BufReadCmd + when the "filename" ends with a "/" or a "\" + Avoids "... is a directory" message, works + inside a try-catch-endtry clause. + Feb 22, 2011 * for menus, &go =~# used to insure correct case + Apr 01, 2011 * changed g:netrw_cursorcolumn to g:netrw_cursor + In addition, there's more supported settings for + it. + v140: Jul 27, 2010 * (Lech Lorens) unexpected change of window + v139: May 14, 2010 * when viewing remote directory listings and + changing listing style, going to tree listing + mode was issuing two rather useless messages + about the buffer name. They have now been + silenced. + * (Jean Johner) with "behave mswin", clicking + on a filename in wide mode opened a new file + with a missing first letter + * (Britton Kerin) wanted netrw listings to be + buflisted; the |g:netrw_bufsettings| option + permits that. + Jun 18, 2010 * (Jan Steffens) added support for xz compression + Jun 23, 2010 * vimdiff dir1 dir2 now works + Jul 27, 2010 * (John Orr) pointed out that the intended maparg + test for gx was actually testing for g rather + than gx. Fixed. + v138: May 01, 2010 * added the bomb setting to the Save-Set-Restore + option handling (for Tony M) + May 14, 2010 * (Bram Moolenaar) netrw optionally sets cursorline + (and sometimes cursorcolumn) for its display. + This option setting was leaking through with + remote file handling. + v137: Dec 28, 2009 * modified the preview window handling for + vertically split windows. The preview + window will take up all but g:netrw_winsize + columns of the original window; those + g:netrw_winsize columns will be used for + the netrw listing. + * (Simon Dambe) removed "~" from + |g:netrw_glob_escape| under Windows + * (Bram Moolenaar) modified test for status bar + click with leftmouse. Moved code to + s:NetrwLeftmouse(). + Feb 24, 2010 * (for Jean Johner) added insert-mode maps; one + can get into insert mode with netrw via + ctrl-o :e . + Mar 15, 2010 * (Dominique Pellé) Directory with backslashes such + as foo\bar were not being entered/left properly + Mar 15, 2010 * Using :Explore .. and causing two FocusGained + events caused the directory to change. Fixed. + Mar 22, 2010 * Last fix caused problems for *//pat and */filepat + searches. + Mar 30, 2010 * With :set hidden and changing listing styles 8 + times, the tree listing buffer was being marked + as modified upon exit. Fixed. + v136: Jan 14, 2009 * extended |g:Netrw_funcref| to also handle lists + of function references + Jan 14, 2009 * (reported by Marvin Renich) with spell check + enabled, some filenamess will still being + displayed as spelling errors. + Apr 13, 2009 * (Björn Winckler) writing a file using + remote scp caused syntax highlighting problem. + Solution: avoid syntax/syntax.vim's + au Filetype * syntax setting autocommand by + checking that the current buffer has the + netrw filetype before attempting a doau + in s:NetrwSafeOptions(). + Apr 14, 2009 * (asgeo1) suggested the "T" map (|netrw-T|) + Apr 14, 2009 * marking wasn't working on executable and + other special filenames + Apr 20, 2009 * (Dennis Benzinger) files opened via http have + their syntax filetype auto-detected + Jun 19, 2009 * (Yukihiro Nakadaira) help document improvements + Jul 22, 2009 * g:netrw_browse_split will honor the + |'equalalways'| setting. + Jul 29, 2009 * implemented "I" mapping to toggle banner + (this is experimental and still being debugged) + Sep 19, 2009 * (Mike McEwan) writes via ftp now send both + g:netrw_ftpmode and g:netrw_ftpextracmd (if the + latter exists) + Dec 02, 2009 * netrw uses vimgrep several places; it now uses + "noautocmd vimgrep" (should be speedier). + Dec 03, 2009 * changed back to using -source instead of -dump + for elinks-using commands. (requested by James + Vega and Karsten Hopp) + v135: Oct 29, 2008 * using |simplify()| on directory names + (supporting handling ".."s in directory names) + Oct 31, 2008 * added special file highlighting for core dumps + under Unix/Linux. The default sorting sequence + now also gives core dumps priority. + Nov 10, 2008 * uses a call to netrw#Nread() instead of Nread + to avoid having to use fnameescape() + * fixed a tree redrawing problem (open directory, + open subdir, close subdir, close dir) + Nov 19, 2008 * sprinkled some histdel("/",-1)s through the code + in an attempt to prevent netrw from changing + the search history. + Jan 02, 2009 * |g:Netrw_funcref| included + Jan 05, 2009 * Explore */ **/ *// **// all clear explorer + variables + Jan 05, 2009 * (Panagiotis Louridas) extended s:WinPath() + to remove cygdrive from non-cygwin Windows + paths. Improved the determination as to + whether or not to do so. + Jan 13, 2009 * included contains=@NoSpell in every syntax + group for syntax/netrw.vim . + v134: Sep 30, 2008 * (Sander Marechal) provided a bugfix involving + the use of the |netrw-t| command with a remote + directory. + Sep 30, 2008 * using "x" on a remote jpg was failing; fixed. + Oct 03, 2008 * bookmarks now go on a list and are stored to + the first directory on the |'runtimepath'| in + the hopes of making their retention reliable. + History now also goes to that directory. + Oct 07, 2008 * Included check that vim 7.0 or later is in use. + Oct 07, 2008 * Improved |g:netrw_retmap| handling. + Oct 12, 2008 * Based upon Sébastien Migniot's suggestion, if + cadaver isn't available then netrw will try to + use curl for the dav://... protocol. + Oct 13, 2008 * added @*/ to netrw buffers' |'iskeyword'|setting + This lets mf (|netrw-mf|) mark directories, links + and executables. + Oct 13, 2008 * avoids a second NetrwBrowse() refresh when + g:netrw_fastbrowse is <= 1 (slow, medium speed) + Oct 22, 2008 * |g:netrw_http_xcmd| may now be overridden + independently of |g:netrw_http_cmd|. + Oct 23, 2008 * [N] added to the various Explore commands to + let users specify the width/height of new + explorer windows, overriding |g:netrw_winsize|. + v133: Aug 10, 2008 * NetReadFixup() for win95 was missing some "a:"s + Aug 12, 2008 * (Jan Minář) an error condition in NetrwMethod() + wasn't being used, resulting in "b:netrw_fname + undefined" errors + Aug 12, 2008 * (François Ingeirest) asked that "hi link" be + changed to hi default link in the netrw syntax + files. + Aug 12, 2008 * using s:NetrwUnmarkList() more often. Filenames + were being left on the global list when removed + from the buffer-local lists. + Aug 14, 2008 * (Joshua Clayton) an errant extra ")" was left in + the rcp-handling portion of NetRead(). + Sep 03, 2008 * added |'cursorline'| highlighting to thin, long, + and tree displays. + v132: Aug 06, 2008 * Fixed marked file-based obtain + Aug 08, 2008 * sourcing a file via ftp from a netrw-generated + buffer (or any buffer with |'nobl'|) left an + empty no-name buffer in its wake. Fixed. + v130: Jul 31, 2008 * trying out elinks/links for http://host/ + requests. One problem: in-page links + (such as with ...#LABEL) are not supported + * verified that Bram's modified netrwPlugin works + Aug 01, 2008 * fixed a bug: when sourcing a file via ftp, the + "filter window" was left behind. + v129: Jul 31, 2008 * bug found in non-mouse enabled vim and some + local maps + v128: Jul 30, 2008 * much work done in using shellescape() and + fnameescape() + v126: Jun 30, 2008 * after having gone to a remote directory, + was no longer taking one to the correct + entry in the help (|netrw-quickhelp|). Fixed. + Jul 01, 2008 * extracting the last filename from a wide listing + missed the last letter when |'virtualedit'| not + enabled. + Jul 01, 2008 * vim foo/bar was creating [Scratch] buffers, + where bar was also a directory + Jul 01, 2008 * numerous additional changes were made to netrw + to use fnameescape() and shellescape() instead + of escape(). Not all changes have been tested + as yet... + Jul 01, 2008 * (James Vega reported) some problems with + :NetrwSettings (due to no longer used setting + variables). + Jul 07, 2008 * Additional numerous changes to support security; + shellescape(arg,1), etc. + v125: Apr 07, 2008 * (Cristian Rigamonti) CR provides a patch; he + noted that gx was failing since its call to + netrw#NetBrowseX() wasn't updated to + netrw#NetrwBrowseX(). + * (Stanis Trendelenburg) ST provides a patch to + supports davs: (dav + ssl) + * (Rick Choi) noted that directory names comprised + of three digits were not being displayed by + the internal browser. Fixed. + * (Erik Falor) provided a patch to handle problems + with changing directory and |'acd'| option. + * (James Vega, Teemu Likonen) noted that netrw + wasn't handling multi-byte filenames/directories + correctly. Fixed. + * (Rick) found problem with g:netrw_maxfilenamelen + being overridden. + * (James Vega) pointed out that netrw was + misidentifying all files in a symbolically linked + directory as being symbolically linked + themselves. This particular problem was fixed; + however, there are now situations where + symbolically linked files will not be detected. + Really need an internal vim function to do this + identification. + Apr 17, 2008 * When g:netrw_keepdir==0, current directory + doesn't necessarily equal b:netrw_curdir + initially. Problem is due to the patch directly + above. + * Fixed qf to handle case where b:netrw_curdir + isn't the same as the current directory under + linux/macosx. + * New: |netrw-mg| (apply vimgrep to marked files) + May 05, 2008 * (Rick) pointed out that a "setlocal ts=32" was + interfering with g:netrw_maxfilenamelen + May 05, 2008 * (James Vega) a file inside a linked directory + was showing up as a symbolic link itself. + May 22, 2008 * symbolic links, fifos, and sockets are now + indicated by a trailing @, |, or =, respectively. + Jun 06, 2008 * Removed numerous bugs from the marked file + move and copy. Tested these changes under + Unix only thus far. + * :Rexplore returns to the screen position in the + netrw listing from whence the file was edited + v124: Apr 02, 2008 * (Adrian Rollett) change the line supporting the + "x" action for mac to use g:netrw_shq + v123: Feb 27, 2008 * Marked files now keeps a "global" marked file + list. The global marked file list is used to + support tag processing and vimdiff'ing + (|netrw-md| |netrw-mt|) + * Been insuring that mm and mc works with various + combinations of local and remote directories + * (Stefan Bittner) http://.../ should always have + filetype "html" -- fixed. + * (Stefan Bittner) a "?" in a http://.../ request + wasn't being handled correctly. Fixed by + removing ? from default |g:netrw_tmpfile_escape|. + * (Nico Weber) % codes in http://.../ requests + weren't being handled correctly. Fixed by + including % in default |g:netrw_fname_escape|. + * (Stefan Bittner) attempts to update Buffers.Refresh + were failing because locale use changed the menu + names. I implemented a workaround. + v122: Feb 12, 2008 * bugfix - first sorting sequence match now has + priority + Feb 14, 2008 * bugfix - sorting sequence was effectively ignoring + sequencing priority of anything following '*' + * toggling a marked file was showing incorrect list + (list was correct, but displayed matches weren't) + * |g:netrw_special_syntax| implemented + v121: Feb 11, 2008 * Bram M reported that :e file ... :e . would not + retain the alternate file. Fixed -- I hope! + * bugfix -- apparently v120 broke an explicit + :Explore dirname + v120: Jan 21, 2008 * |netrw-mt| changed to allow for target selection + based on whether or not word under cursor is a + directory or file, or if cursor is in banner + area. + * |netrw-mh| included (hiding by marked-file suffix) + * functions moved about a bit (improved + categorization) + * executable files now displayed with trailing (*) + * symbolically linked files now displayed with + trailing (@) + * Somewhen, s:NetrwMarkFileMove() got damaged. It + * is now restored (missing an endif, for example). + * |netrw-mu| implemented (unmarking marked files) + * many bugs have been removed from the marked file + system (tnx to Mark S. for feedback) + * |netrw-ms| implemented (sourcing marked files) + * fixed use of P with tree listing style + * multiple tree listing now supported + * ./ suppressed + * changed q -> qb (query bookmarks) + * implemented |netrw-qf| + * Explore now has four special list-generation + modes: */filepat **/filepat + *//pattern **//pattern + * gh (|netrw-gh|) is a shortcut for toggling the + hiding of files and directories beginning with a + dot + v119: Jan 10, 2008 * When g:netrw_keepdir is false, + NetrwOptionsRestore() had a problem + (Bill McCarthy) + Jan 11, 2008 * Netrw now shows symbolic links with a trailing + "@" and special highlighting. + Jan 15, 2008 * Changed g:netrw_noretmap -> |g:netrw_retmap|. + Changed: disabled by default at Bram's + preference. + v118: Jan 02, 2008 * Fixed a problem with Windows; + :Explore c:/path/ would not work, + but :Explore c:/path would. + * Fixed a bug in s:NetrwOptionRestore() - lcd's + argument wasn't being properly escaped so it + wouldn't handle spaces in directory names. + (Gary Johnson) + v117: Jan 02, 2008 * Fixed a problem with P; had to include + a b:netrw_curdir bypass (Bram Moolenaar) + v116: Nov 27, 2007 * netrw#LocalBrowseCheck() has &ft=="netrw" + check to prevent doing a directory listing + (was getting unexpected directory refreshes + in the middle of some function calls) + * NetrwOptionRestore moved after e! filename + in order to retain user options for editing + in s:NetrwBrowseChgDir() + Dec 12, 2007 * Bug fix -- netrw does a better job of retaining + user options when editing files under the aegis + of the browser + v115: Oct 04, 2007 * Erik Remmelzwaal pointed out that the use of + shellslash in s:GetTempfile() was incorrect + Oct 11, 2007 * Tracked down and eliminated a bug with editing + remote *.tar.gz and *.tar.bz2 files + Oct 11, 2007 * g:netrw_localmovecmd wasn't being initialized + properly, and g:netrw_localcopycmd was being + overwritten. + Oct 12, 2007 * Placed all :Rexplore and <2-leftmouse> setup + in a new support function (s:SetRexDir()). + Oct 15, 2007 * new: g:netrw_browse_split == 4; means + based selection will use previous window + Oct 20, 2007 * also checks on |'shellxquote'| to set g:netrw_shq + Oct 24, 2007 * Explore handles path/**/filename + Oct 27, 2007 * sourcing remote files often didn't work with ftp, + turns out that b:netrw_method was undefined, so + s:SaveBufVars and s:RestoreBufVars() fixed it. + v114: Sep 28, 2007 * mT, the map that invokes tags, has been improved + to support use of remote tags files. + Oct 02, 2007 * changed Netrw menu to use more submenus + v113: Sep 07, 2007 * worked out why the cursor position wasn't being + saved and restored as intended after doing such + things as deleting and renaming files. + Sep 11, 2007 * Fixed bug which effectively disabled and + maps + Sep 18, 2007 * there used to be one NetrwOptionRestore() call at + the end of the s:NetrwBrowseChgDir() function; + they're now at the end of every if..elseif..else + block. The edit-a-file one is not quite at the end + of its block; instead, it's just before the edit. + Restores user options, then this new placement + allows ftplugins, autocmds, etc to change settings + (ex. ftplugin/cpp.vim sets cindent). + Sep 19, 2007 * changed all strlen() calls to use s:Strlen(), a + function which handles utf-8 wide characters + correctly. + Sep 20, 2007 * (Nico Weber) the "x" command has been extended + to Mac's OS/X (macunix); it now uses open to + handle |netrw-x| browsing with special files. + Sep 22, 2007 * Added g:netrw_noretmap to netrw at Tony M's + request. + * Included path to NetrwRemoteRmFile() + v112: Aug 18, 2007 * added mx (|netrw-mx|) for executing arbitrary + commands on marked files + Aug 22, 2007 * more option save/restore work for + s:NetrwBrowseChgDir(); s:NetrwOptionSave() + and s:NetrwOptionRestore() now take a parameter + specifying the type of variables to be used for + saving and restoring (either "w:" or "s:") + Sep 04, 2007 * added the :NetrwClean[!] command + v111: Jul 25, 2007 * using Windows but not using Cygwin, netrw does a + "file bufname" where the bufname uses /s + instead of \s; Vim "fixes" it by changing the + bufname to use \s anyway. This meant that + NetrwGetBuffer() didn't find the appropriately + named buffer, and so would generate a new + buffer listing; hence the cursor would appear + to have been moved when doing a preview. + * added <2-leftmouse> map to return to netrw's + browser display + Aug 16, 2007 * added the mark-file system, including + maps for mf mp mt mz and mu. Modifications + made to maps for a D O and R to support + marked files. + v110: May 10, 2007 * added [ and ] maps to NetrwTreeListing + May 25, 2007 * |g:netrw_preview| included + May 29, 2007 * modified netrw#NetBrowseX to consistently use + g:netrw_shq instead of hardcoded quotes, + and modified the snippet that sets up redir + so Windows machines use "nul" instead of + "/dev/null". + Jun 01, 2007 * fixed bug -- NetGetBuffer() wasn't always + recognizing a buffer name match when it should, + thus resulting in [Scratch] buffers. + Jun 04, 2007 * Gary Johnson found a bugfix for the "c" mapping + when the directory is to be made current but + the name contains spaces. + v109: Mar 26, 2007 * if a directory name includes a "$" character, + Explore() will use expand() in an attempt to + decipher the name. + May 07, 2007 * g:netrw_use_errorwindow now allows one to + have error messages go to a reliable window + or to use a less reliable but recallable + echoerr method + May 07, 2007 * g:netrw_scpport and g:netrw_sshport support + use of -P and -p, respectively, to set port + for scp/ssh. + v108: Jan 03, 2007 * included preview map (|netrw-p|), supporting + remote browsing + * netrw can now source remote files + Jan 26, 2007 * Colton Jamieson noted that remote directory + browsing did not support alternate port + selection. This feature has now been extended + to apply to all remote browsing commands via ssh. + (list, remove/delete, rename) + Jan 31, 2007 * Luis Florit reported that @* was an invalid + register. The @* register is now only saved and + restored if |'guioptions'| contains "a". + Feb 02, 2007 * Fixed a bug that cropped up when writing files + via scp using cygwin + Feb 08, 2007 * tree listing mode managed to stop working again; + fixed again! + Feb 15, 2007 * Guido Van Hoecke reported that netrw didn't + handle browsing well with M$ ftp servers. He even + set up a temporary account for me to test with + (thanks!). Netrw now can browse M$ ftp servers. + v107: Oct 12, 2006 * bypassed the autowrite option + Oct 24, 2006 * handles automatic decompression of *.gz and *.bz2 + files + Nov 03, 2006 * Explore will highlight matching files when + **/pattern is used (and if the |'hls'| option + is set) + Nov 09, 2006 * a debugging line, when enabled, was inadvertently + bringing up help instead of simply reporting on + list contents + Nov 21, 2006 * tree listing improved (cursor remains put) + Nov 27, 2006 * fixed b:netrw_curdir bug when repeated "i"s were + pressed. + Dec 15, 2006 * considerable qty of changes, mostly to share more + code between local and remote browsing. Includes + support for tree-style listing for both remote + and local browsing. + Dec 15, 2006 * Included Peter Bengtsson's modifications to + support the Amiga. + v106: Sep 21, 2006 * removed old v:version<700 code as netrw now + requires vim 7.0 + * worked around a bug where register * was + overwritten during local browsing + v104: Sep 05, 2006 * as suggested by Rodolfo Borges, :Explore and + variants will position the cursor on the file + just having been edited + * changed default |g:netrw_sort_sequence| order + * changed b, Nb to simply mb (see |netrw-mb|) + * changed B, NB to simply gb (see |netrw-gb|) + * tree listing style (see |g:netrw_liststyle|) + * attempts to retain the alternate file + v103: Jul 26, 2006 * used Yakov Lerner's tip#1289 to improve netrw + error message display + * wide listings didn't handle files with backslashes + in their names properly. A symptom was an + inability to open files. + Aug 09, 2006 * included "t" mapping for opening tabbed windows, + both for remote and local browsing + * changed netrw_longlist to netrw_liststyle + Aug 15, 2006 * fixed one of the NB maps + Aug 22, 2006 * changed *Explore commands to use -nargs=* instead + of -nargs=?. Allows both -complete=dir _and_ the + starstar arguments to work (-nargs=? seems to + require one or the other). + Aug 23, 2006 * copied all w:.. variables across splits to + new windows + Aug 25, 2006 * when g:netrw_browsex_viewer was '-' + (see |g:netrw_browsex_viewer|) it wasn't causing + netrwFileHandlers#Invoke() to be called as it + was expected to. (tnx Steve Dugaro) + Aug 29, 2006 * changed NetBrowseX() to use "setlocal ... noswf" + instead of "set ... noswf" (tnx Benji Fisher) + Aug 31, 2006 * tabs and fastbrowse<=1 didn't work together. + v102: Jun 15, 2006 * chgd netrwPlugin to call netrw#LocalBrowseCheck() + * bugfix: g:netrw_keepdir==0 had stopped working + Jul 06, 2006 * bugfix: NetOptionSave/Restore now saves/restores + the unnamed register (|registers|) + Jul 07, 2006 * |g:netrw_menu| support included + Jul 13, 2006 * :Texplore command implemented + Jul 17, 2006 * NetSplit and (Local|Net)BrowseChgDir() were both + splitting windows. This affected o, v, and + g:netrw_browse_split. + Jul 20, 2006 * works around wildignore setting (was causing + netrw's local browser not to list wildignore'd + files) + Jul 24, 2006 * acts as a for selecting a file + acts as a for deleting a file + v100: May 14, 2006 * when using Windows and shell==cmd.exe, the + default for g:netrw_ignorenetrc is now 1 + * bugfix: unwanted ^Ms now removed + (affected shell==cmd.exe - Windows) + * added Bookmarks and History to the menu + * an error message about non-existing + w:netrw_longlist was appearing during attempts to + Explore (fixed) + * g:netrw_shq now available to make netrw use + specified style of quotes for commands + May 29, 2006 * user NFH_*() functions were inadvertently being + ignored + * fixed a Windows non-cygwin ftp handling problem. + * hiding pattern candidate separators included some + characters it shouldn't have (tnx to Osei Poku) + Jun 01, 2006 * for browsing, netrw was supposed to use "dir" + instead of "ls -lF" when using + ftp+non-cygwin+windows. Fixed. + * an inadvertently left-in-place debugging statement + was preventing use of the "x" key with browsing. + Jun 05, 2006 * g:netrw_nogx available to prevent making the gx + map (see |g:netrw_nogx|) + * bugfix, Explore wouldn't change directory + properly (vim ., :Explore subdirname) + Jun 06, 2006 * moved history to 2nd line in Netrw menu + * fixed delete for unix-based systems + Jun 07, 2006 * x key now works for windows-noncygwin-ftp + Jun 08, 2006 * Explore */pat and **//pat now wraps + v99: May 09, 2006 * g:netrw_browse_split=3 for opening files in new + tabs implemented. + May 12, 2006 * deletes temporary file at end of NetRead() + * visual mode based Obtain implemented + * added -complete=dir to the various Explore + commands + v98: May 02, 2006 * the "p" key didn't work properly when the browsing + directory name had spaces in it. + v97: May 01, 2006 * exists("&acd") now used to determine if + the 'acd' option exists + * "obtain" now works again under Windows + v96: * bugfix - the |'acd'| option is not always defined + but is now bypassed only when it is + v95: * bugfix - Hiding mode worked correctly (don't show + any file matching any of the g:netrw_hide + patterns), but showing mode was showing only those + files that didn't match any of the g:netrw_hide + patterns. Instead, it now shows all files that + match any of the g:netrw_hide patterns (the + difference between a logical and and logical or). + v94: * bugfix - a Decho() had a missing quote; only + affects things when debugging was enabled. + v93: * bugfix - removed FocusGained event from causing a + slow-browser refresh for Windows + v92: * :Explore **//pattern implemented + (**/filepattern was already taken) + v91: * :Explore */pattern implemented + * |'acd'| option bypassed + v90: * mark ', as suggested by Yegappan Lakshmanan, used + to help guarantee entry into the jump list when + appropriate. + * and are no longer defined until a + :Explore **/pattern is used (if the user already + has a map for them). They will be defined for new + browser windows from that point forward. + v89: * A , , :Nexplore, or a :Pexplore + without having first done an :Explore **/pattern + (see |netrw-starstar|) caused + a lot of unhelpful error messages to appear + v88: * moved DrChip.Netrw menu to Netrw. Now has + priority 80 by default. + g:NetrwTopLvlMenu == "Netrw" and can be changed + by the user to suit. The priority is given by + g:NetrwMenuPriority. + * Changed filetype for browser displays from + netrwlist to netrw. + v87: * bug fix -- menus were partially disappearing + v85: * bug fix -- missing an endif + * bug fix -- handles spaces in names and directories + when using ftp-based browsing + v83: * disabled stop-acd handling; the change in directory + handling may allow acd to be used again. + * D was refusing to delete remote files/directories + in wide listing mode. + v81: * FocusGained also used to refresh/wipe local browser + directory buffers + * (bugfix) netrw was leaving [Scratch] buffers behind + when the user had the "hidden" option set. The + 'hidden' option is now bypassed. + v80: * ShellCmdPost event used in conjunction with + g:netrw_fastbrowse to refresh/wipe local browser + directory buffers. + v79: * directories are now displayed with nowrap + * (bugfix) if the column width was smaller than the + largest file's name, then netrw would hang when + using wide-listing mode - fixed + * g:netrw_fastbrowse introduced + v78: * progress has been made on allowing spaces inside + directory names for remote work (reading, writing, + browsing). (scp) + v77: * Mikolaj Machowski fixed a bug in a substitute cmd + * g:netrw_browsex_viewer implemented + * Mikolaj Machowski pointed out that gnome-open is + often executable under KDE systems, although it is + effectively not functional. NetBrowseX now looks + for "kicker" as a running process to determine if + KDE is actually running. + * Explorer's O functionality was inadvertently left + out. Netrw now does the same thing, but with the + "P" key. + * added g:netrw_browse_split option + * fixed a bug where the directory contained a "." but + the file didn't (was treating the dirname from "." + onwards as a suffix) + v76: * "directory is missing" error message now restores + echo highlighting + v75: * file://... now conforms to RFC2396 (thanks to + S. Zacchiroli) + * if the binary option is set, then NetWrite() will + only write the whole file (line numbers don't make + sense with this). Supports writing of tar and zip + files. + v74: * bugfix (vim, then :Explore) now works + * ctrl-L keeps cursor at same screen location (both + local and remote browsing) + * netrw now can read remote zip and tar files + * Obtain now uses WinXP ftp+.netrc successfully + v73: * bugfix -- scp://host/path/file was getting named + incorrectly + * netrw detects use of earlier-than-7.0 version of + vim and issues a pertinent error message. + * netrwSettings.vim is now uses autoloading. Only + is needed as a pure plugin + (ie. always loaded). + v72: * bugfix -- formerly, one could prevent the loading + of netrw by "let g:loaded_netrw=1"; when + autoloading became supported, this feature was + lost. It is now restored. + v71: * bugfix -- made some "set nomodifiable"s into + setlocal variants (allows :e somenewfile to be + modifiable as usual) + * NetrwSettings calls a netrw function, thereby + assuring that netrw has loaded. However, if netrw + does not load for whatever reason, then + NetrwSettings will now issue a warning message. + * For what reason I don't recall, when wget and fetch + are both not present, and an attempt to read a + http://... url is made, netrw exited. It now only + returns. + * When ch=1, on the second and subsequent uses of + browsing Netrw would issue a blank line to clear + the echo'd messages. This caused an annoying + "Hit-Enter" prompt; now a blank line message + is echo'd only if &ch>1. + v70: * when using |netrw-O|, the "Obtaining filename" + message is now shown using |hl-User9|. If User9 + has not been defined, netrw itself will define it. + v69: * Bugfix: win95/98 machines were experiencing a + "E121: Undefined variable: g:netrw_win95ftp" + message + v68: * double-click-leftmouse selects word under mouse + v67: * Passwords which contain blanks will now be + surrounded by double-quotes automatically (Yongwei) + v66: * Netrw now seems to work with a few more Windows + situations + * O now obtains a file: remote browsing + file -> local copy, locally browsing + file -> current directory (see :pwd) + * i now cycles between thin, long, and wide listing + styles + * NB and Nb are maps that are always available; + corresponding B and b maps are only available when + not using wide listing in order to allow them to + be used for motions + v65: * Browser functions now use NetOptionSave/Restore; in + particular, netrw now works around the report + setting + v64: * Bugfix - browsing a "/" directory (Unix) yielded + buffers named "[Scratch]" instead of "/" + * Bugfix - remote browsing with ftp was omitting + the ./ and ../ + v63: * netrw now takes advantage of autoload (needs 7.0) + * Bugfix - using r (to reverse sort) working again + v62: * Bugfix - spaces allowed again in directory names + with g:netrw_keepdir=0. In fact, I've tested netrw + with most ANSI punctuation marks for directory + names. + * Bugfix - NetrwSettings gave errors when + g:netrw_silent had not be set. + v61: * Document upgrade -- netrw variable-based settings + all should have tags. Supports NetrwSettings cmd. + * Several important variables are window-oriented. + Netrw has to transfer these across a window split. + See s:BufWinVars() and s:UseBufWinVars(). + v60: * When using the i map to switch between long and + short listings, netrw will now keep cursor on same + line + * "Match # of #" now uses status line + * :Explore **/*.c will now work from a + non-netrw-browser window + * :Explore **/patterns can now be run in separate + browser windows + * active banner (hit will cause various things + to happen) + v59: * bugfix -- another keepalt work-around installed + (for vim6.3) + * "Match # of #" for Explore **/pattern matches + v58: * Explore and relatives can now handle + **/somefilepattern (v7) + * Nexplore and Pexplore introduced (v7). shift-down + and shift-up cursor keys will invoke Nexplore and + Pexplore, respectively. + * bug fixed with o and v + * autochdir only worked around for vim when it has + been compiled with either + |+netbeans_intg| or |+sun_workshop| + * Under Windows, all directories and files were + being preceded with a "/" when local browsing. + Fixed. + * When: syntax highlighting is off, laststatus=2, and + remote browsing is used, sometimes the laststatus + highlighting bleeds into the entire display. Work + around - do an extra redraw in that case. + * Bugfix: when g:netrw_keepdir=0, due to re-use of + buffers, netrw didn't change the directory when it + should've + * Bugfix: D and R commands work again + v57: * Explore and relatives can now handle RO files + * reverse sort restored with vim7's sort command + * g:netrw_keepdir now being used to keep the current + directory unchanged as intended (sense change) + * vim 6.3 still supported + v56: * LocalBrowse now saves autochdir setting, unsets it, + and restores it before returning. + * using vim's rename() instead of system + + local_rename variable + * avoids changing directory when g:netrw_keepdir is + false + v55: * -bar used with :Explore :Sexplore etc to allow + multiple commands to be separated by |s + * browser listings now use the "nowrap" option + * browser: some unuseful error messages now + suppressed + v54: * For backwards compatibility, Explore and Sexplore + have been implemented. In addition, Hexplore and + Vexplore commands are available, too. + * used instead of in the + transparency support (BufReadCmd, FileReadCmd, + FileWriteCmd) + * ***netrw*** prepended to various error messages + netrw may emit + * g:netrw_port used instead of b:netrw_port for scp + * any leading [:#] is removed from port numbers + v53: * backslashes as well as slashes placed in various + patterns (ex. g:netrw_sort_sequence) to better + support Windows + v52: * nonumber'ing now set for browsing buffers + * when the hiding list hid all files, error messages + ensued. Fixed + * when browsing, swf is set, but directory is not + set, when netrw was attempting to restore options, + vim wanted to save a swapfile to a local directory + using an url-style path. Fixed + v51: * cygwin detection now automated + (using windows and &shell is bash) + * customizable browser "file" rejection patterns + * directory history + * :[range]w url now supported (ie. netrw uses a + FileWriteCmd event) + * error messages have a "Press to continue" to + allow them to be seen + * directory browser displays no longer bother the + swapfile + * u/U commands to go up and down the history stack + * history stack may be saved with viminfo with it's + "!" option + * bugfixes associated with unwanted [No Files] + entries + v50: * directories now displayed using buftype=nofile; + should keep the directory names as-is + * attempts to remove empty "[No File]" buffers + leftover from :file ..name.. commands + * bugfix: a "caps-lock" editing difficulty left in + v49 was fixed + * syntax highlighting for "Showing:" the hiding list + included + * bookmarks can now be retained if "!" is in the + viminfo option + v49: * will use ftp for http://.../ browsing + v48: * One may use ftp to do remote host file browsing + * (windows and !cygwin) remote browsing with ftp can + now use the "dir" command internally to provide + listings + * g:netrw_keepdir now allows one to keep the initial + current directory as the current directory + (normally the local file browser makes the + currently viewed directory the current directory) + * g:netrw_alto and g:netrw_altv now support + alternate placement of windows started with o or v + * Nread ? and Nwrite ? now uses echomsg (instead of + echo) so :messages can repeat showing the help + * bugfix: avoids problems with partial matches of + directory names to prior buffers with longer names + * one can suppress error messages with g:netrw_quiet + ctrl-h used + * instead of h for editing hiding list one + may edit the sorting sequence with the S map, which + now allows confirmation of deletion with + [y(es) n(o) a(ll) q(uit)] + * the "x" map now handles special file viewing with: + (windows) rundll32 url.dll (gnome) gnome-open (kde) + kfmclient If none of these are on the executable + path, then netrwFileHandlers.vim is used. + * directory bookmarking during both local and remote + browsing implemented + * one may view all, use the hiding list to suppress, + or use the hiding list to show-only remote and + local file/directory listings + * improved unusual file and directory name handling + preview window support + v47: * now handles local browsing. + v46: * now handles remote browsing + * g:netrw_silent (if 1) will cause all transfers to + be silent + v45: * made the [user@]hostname:path form a bit more + restrictive to better handle errors in using + protocols (e.g. scp:usr@host:file was being + recognized as an rcp request) + v44: * changed from "rsync -a" to just "rsync" + * somehow an editing error messed up the test to + recognize use of the fetch method for NetRead. + * more debugging statements included + v43: * moved "Explanation" comments to help + file as "Network Reference" (|netrw-ref|) + * now uses Dfunc() Decho() and Dret() for + debugging + * removed superfluous NetRestorePosn() calls + v42: * now does BufReadPre and BufReadPost events on + file:///* and file://localhost/* + v41: * installed file:///* and file://localhost/* handling + v40: * prevents redraw when a protocol error occurs so + that the user may see it + v39: * sftp support + v38: * Now uses NetRestorePosn() calls with Nread/Nwrite + commands + * Temporary files now removed via bwipe! instead of + bwipe (thanks to Dave Roberts) + v37: * Claar's modifications which test if ftp is + successful, otherwise give an error message + * After a read, the alternate file was pointing to + the temp file. The temp file buffer is now wiped + out. + * removed silent from transfer methods so user can + see what's happening + + +============================================================================== +13. Todo *netrw-todo* {{{1 + +07/29/09 : banner :|g:netrw_banner| can be used to suppress the + suppression banner. This feature is new and experimental, + so its in the process of being debugged. +09/04/09 : "gp" : See if it can be made to work for remote systems. + : See if it can be made to work with marked files. + +============================================================================== +14. Credits *netrw-credits* {{{1 + + Vim editor by Bram Moolenaar (Thanks, Bram!) + dav support by C Campbell + fetch support by Bram Moolenaar and C Campbell + ftp support by C Campbell + http support by Bram Moolenaar + rcp + rsync support by C Campbell (suggested by Erik Warendorph) + scp support by raf + sftp support by C Campbell + + inputsecret(), BufReadCmd, BufWriteCmd contributed by C Campbell + + Jérôme Augé -- also using new buffer method with ftp+.netrc + Bram Moolenaar -- obviously vim itself, :e and v:cmdarg use, + fetch,... + Yasuhiro Matsumoto -- pointing out undo+0r problem and a solution + Erik Warendorph -- for several suggestions (g:netrw_..._cmd + variables, rsync etc) + Doug Claar -- modifications to test for success with ftp + operation + +============================================================================== +Modelines: {{{1 + vim:tw=78:ts=8:ft=help:norl:fdm=marker diff --git a/.vim/doc/supertab.txt b/.vim/doc/supertab.txt new file mode 100644 index 0000000..038bcb5 --- /dev/null +++ b/.vim/doc/supertab.txt @@ -0,0 +1,307 @@ +*supertab.txt* + +Authors: + Original: Gergely Kontra + Current: Eric Van Dewoestine (as of version 0.4) + +Contributors: + Christophe-Marie Duquesne (documentation) + +Please direct all correspondence to Eric. + +This plugin is licensed under the terms of the BSD License. Please see +supertab.vim for the license in its entirety. + +============================================================================== +Supertab *supertab* + +1. Introduction |supertab-intro| +2. Supertab Usage |supertab-usage| +3. Supertab Options |supertab-options| + Default completion type |supertab-defaultcompletion| + Secondary default completion type |supertab-contextdefault| + Completion contexts |supertab-completioncontexts| + Context text |supertab-contexttext| + Context Discover |supertab-contextdiscover| + Example |supertab-contextexample| + Completion Duration |supertab-duration| + Preventing Completion After/Before... |supertab-preventcomplete| + Changing default mapping |supertab-forwardbackward| + Inserting true tabs |supertab-mappingtabliteral| + Enhanced longest match support |supertab-longestenhanced| + Preselecting the first entry |supertab-longesthighlight| + +============================================================================== +1. Introduction *supertab-intro* + +Supertab is a plugin which allows you to perform all your insert completion +(|ins-completion|) using the tab key. + +Supertab requires Vim version 7.0 or above. + +============================================================================== +2. Supertab usage *supertab-usage* + +Using Supertab is as easy as hitting or (shift+tab) while in +insert mode, with at least one non whitespace character before the cursor, to +start the completion and then or again to cycle forwards or +backwards through the available completions. + +Example ('|' denotes the cursor location): + +bar +baz +b| Hitting here will start the completion, allowing you to + then cycle through the suggested words ('bar' and 'baz'). + +============================================================================== +3. Supertab Options *supertab-options* + +Supertab is configured via several global variables that you can set in your +|vimrc| file according to your needs. Below is a comprehensive list of +the variables available. + + +Default Completion Type *supertab-defaultcompletion* + *g:SuperTabDefaultCompletionType* + +g:SuperTabDefaultCompletionType (default value: "") + +Used to set the default completion type. There is no need to escape this +value as that will be done for you when the type is set. + + Example: setting the default completion to 'user' completion: + + let g:SuperTabDefaultCompletionType = "" + +Note: a special value of 'context' is supported which will result in +super tab attempting to use the text preceding the cursor to decide which +type of completion to attempt. Currently super tab can recognize method +calls or attribute references via '.', '::' or '->', and file path +references containing '/'. + + let g:SuperTabDefaultCompletionType = "context" + + /usr/l # will use filename completion + myvar.t # will use user completion if completefunc set, + # or omni completion if omnifunc set. + myvar-> # same as above + +When using context completion, super tab will fall back to a secondary default +completion type set by |g:SuperTabContextDefaultCompletionType|. + +Note: once the buffer has been initialized, changing the value of this setting +will not change the default complete type used. If you want to change the +default completion type for the current buffer after it has been set, perhaps +in an ftplugin, you'll need to call SuperTabSetDefaultCompletionType like so, +supplying the completion type you wish to switch to: + + call SuperTabSetDefaultCompletionType("") + + +Secondary default completion type *supertab-contextdefault* + *g:SuperTabContextDefaultCompletionType* + +g:SuperTabContextDefaultCompletionType (default value: "") + +Sets the default completion type used when g:SuperTabDefaultCompletionType is +set to 'context' and no completion type is returned by any of the configured +contexts. + + +Completion contexts *supertab-completioncontexts* + *g:SuperTabCompletionContexts* + +g:SuperTabCompletionContexts (default value: ['s:ContextText']) + +Sets the list of contexts used for context completion. This value should +be a list of function names which provide the context implementation. + +When supertab starts the default completion, each of these contexts will be +consulted, in the order they were supplied, to determine the completion type +to use. If a context returns a completion type, that type will be used, +otherwise the next context in the list will be consulted. If after executing +all the context functions, no completion type has been determined, then the +value of g:SuperTabContextDefaultCompletionType will be used. + +Built in completion contexts: + + s:ContextText *supertab-contexttext* + + The text context will examine the text near the cursor to decide which type + of completion to attempt. Currently the text context can recognize method + calls or attribute references via '.', '::' or '->', and file path + references containing '/'. + + /usr/l # will use filename completion + myvar.t # will use user completion if completefunc set, or + # omni completion if omnifunc set. + myvar-> # same as above + + Supported configuration attributes: + + g:SuperTabContextTextFileTypeExclusions + List of file types for which the text context will be skipped. + + g:SuperTabContextTextOmniPrecedence + List of omni completion option names in the order of precedence that they + should be used if available. By default, user completion will be given + precedence over omni completion, but you can use this variable to give + omni completion higher precedence by placing it first in the list. + + s:ContextDiscover *supertab-contextdiscover* + + This context will use the 'g:SuperTabContextDiscoverDiscovery' variable to + determine the completion type to use. It will evaluate each value, in the + order they were defined, until a variable evaluates to a non-zero or + non-empty value, then the associated completion type is used. + + Supported configuration properties: + + g:SuperTabContextDiscoverDiscovery + List of variable:completionType mappings. + + Example context configuration: *supertab-contextexample* + + let g:SuperTabCompletionContexts = ['s:ContextText', 's:ContextDiscover'] + let g:SuperTabContextTextOmniPrecedence = ['&omnifunc', '&completefunc'] + let g:SuperTabContextDiscoverDiscovery = + \ ["&completefunc:", "&omnifunc:"] + + In addition to the default completion contexts, you can plug in your own + implementation by creating a globally accessible function that returns + the completion type to use (eg. "\\"). + + function MyTagContext() + if filereadable(expand('%:p:h') . '/tags') + return "\\" + endif + " no return will result in the evaluation of the next + " configured context + endfunction + let g:SuperTabCompletionContexts = + \ ['MyTagContext', 's:ContextText', 's:ContextDiscover'] + + Note: supertab also supports the b:SuperTabCompletionContexts variable + allowing you to set the list of contexts separately for the current buffer, + like from an ftplugin for example. + + +Completion Duration *supertab-duration* + *g:SuperTabRetainCompletionDuration* + +g:SuperTabRetainCompletionDuration (default value: 'insert') + +Determines if, and for how long, the current completion type is retained. +The possible values include: +'completion' - The current completion type is only retained for the + current completion. Once you have chosen a completion + result or exited the completion mode, the default + completion type is restored. +'insert' - The current completion type is saved until you exit insert + mode (via ESC). Once you exit insert mode the default + completion type is restored. (supertab default) +'session' - The current completion type is saved for the duration of + your vim session or until you enter a different completion + mode. + + +Preventing completion after... *supertab-preventcomplete* + *g:SuperTabNoCompleteBefore* + *g:SuperTabNoCompleteAfter* + +g:SuperTabNoCompleteBefore (default value: []) +g:SuperTabNoCompleteAfter (default value: ['\s']) + +These two variables are used to control when supertab will attempt completion +or instead fall back to inserting a literal , by specifying a list of +patterns which are tested against the text before and after the current cursor +position that when matched, prevent completion. So if you don't want supertab +to start completion after a comma or space, you can set +g:SuperTabNoCompleteAfter to [',', '\s']. + +Note: That a buffer local version of these variables +(b:SuperTabNoCompleteBefore, b:SuperTabNoCompleteAfter) is also supported +should you wish to have different values depending on the file type for +instance. + +Changing the default mapping *supertab-forwardbackward* + *g:SuperTabMappingForward* + *g:SuperTabMappingBackward* + +g:SuperTabMappingForward (default value: '') +g:SuperTabMappingBackward (default value: '') + +These two variables allow you to set the keys used to kick off the current +completion. By default this is and . To change to something +like and , you can add the following to your |vimrc|. + + let g:SuperTabMappingForward = '' + let g:SuperTabMappingBackward = '' + +Note: if the above does not have the desired effect (which may happen in +console version of vim), you can try the following mappings. Although the +backwards mapping still doesn't seem to work in the console for me, your +milage may vary. + + let g:SuperTabMappingForward = '' + let g:SuperTabMappingBackward = '' + + +Inserting true tabs *supertab-mappingtabliteral* + *g:SuperTabMappingTabLiteral* + +g:SuperTabMappingTabLiteral (default value: '') + +Sets the key mapping used to insert a literal tab where supertab would +otherwise attempt to kick off insert completion. The default is '' +(ctrl-tab) which unfortunately might not work at the console. So if you are +using a console vim and want this functionality, you may have to change it to +something that is supported. Alternatively, you can escape the with + (see |i_CTRL-V| for more infos). + + +Enhanced longest match support *supertab-longestenhanced* + *g:SuperTabLongestEnhanced* + +g:SuperTabLongestEnhanced (default value: 0) + +When enabled and 'longest' is in your |completeopt| setting, supertab will +provide an enhanced longest match support where typing one or more letters and +hitting tab again while in a completion mode will complete the longest common +match using the new text in the buffer. + +For example, say you have a buffer with the following contents: + FooBarFoo + FooBar + Foo + FooBarBaz +And you then type F. Vim's builtin longest support will complete the +longest common text 'Foo' and offer 'FooBarFoo', 'FooBar', 'Foo', and +'FooBarBaz' as possible completions. With supertab's longest match +enhancement disabled, typing B while still in the completion mode will +end up completing 'FooBarBaz' or 'FooBarFoo' depending your settings, instead +of the next longest common match of 'FooBar'. With supertab's enhanced +longest match feature enabled, the typing of B will result in the next +longest text being completed. + + +Preselecting the first entry *supertab-longesthighlight* + *g:SuperTabLongestHighlight* + +g:SuperTabLongestHighlight (default value: 0) + +Sets whether or not to pre-highlight the first match when completeopt has the +popup menu enabled and the 'longest' option as well. When enabled, will +kick off completion and pre-select the first entry in the popup menu, allowing +you to simply hit to use it. + + +Mapping to end completion *supertab-crmapping* + *g:SuperTabCrMapping* + +g:SuperTabCrMapping (default value: 1) + +When enabled, will cancel completion mode preserving the current text. + +vim:tw=78:ts=8:ft=help:norl: diff --git a/.vim/doc/tags b/.vim/doc/tags new file mode 100644 index 0000000..a1b80be --- /dev/null +++ b/.vim/doc/tags @@ -0,0 +1,431 @@ +'NERDChristmasTree' NERD_tree.txt /*'NERDChristmasTree'* +'NERDTreeAutoCenter' NERD_tree.txt /*'NERDTreeAutoCenter'* +'NERDTreeAutoCenterThreshold' NERD_tree.txt /*'NERDTreeAutoCenterThreshold'* +'NERDTreeBookmarksFile' NERD_tree.txt /*'NERDTreeBookmarksFile'* +'NERDTreeCaseSensitiveSort' NERD_tree.txt /*'NERDTreeCaseSensitiveSort'* +'NERDTreeChDirMode' NERD_tree.txt /*'NERDTreeChDirMode'* +'NERDTreeHighlightCursorline' NERD_tree.txt /*'NERDTreeHighlightCursorline'* +'NERDTreeHijackNetrw' NERD_tree.txt /*'NERDTreeHijackNetrw'* +'NERDTreeIgnore' NERD_tree.txt /*'NERDTreeIgnore'* +'NERDTreeMouseMode' NERD_tree.txt /*'NERDTreeMouseMode'* +'NERDTreeQuitOnOpen' NERD_tree.txt /*'NERDTreeQuitOnOpen'* +'NERDTreeShowBookmarks' NERD_tree.txt /*'NERDTreeShowBookmarks'* +'NERDTreeShowFiles' NERD_tree.txt /*'NERDTreeShowFiles'* +'NERDTreeShowHidden' NERD_tree.txt /*'NERDTreeShowHidden'* +'NERDTreeShowLineNumbers' NERD_tree.txt /*'NERDTreeShowLineNumbers'* +'NERDTreeSortOrder' NERD_tree.txt /*'NERDTreeSortOrder'* +'NERDTreeStatusline' NERD_tree.txt /*'NERDTreeStatusline'* +'NERDTreeWinPos' NERD_tree.txt /*'NERDTreeWinPos'* +'NERDTreeWinSize' NERD_tree.txt /*'NERDTreeWinSize'* +'loaded_nerd_tree' NERD_tree.txt /*'loaded_nerd_tree'* +:Explore pi_netrw.txt /*:Explore* +:Hexplore pi_netrw.txt /*:Hexplore* +:NERDTree NERD_tree.txt /*:NERDTree* +:NERDTreeClose NERD_tree.txt /*:NERDTreeClose* +:NERDTreeFind NERD_tree.txt /*:NERDTreeFind* +:NERDTreeFromBookmark NERD_tree.txt /*:NERDTreeFromBookmark* +:NERDTreeMirror NERD_tree.txt /*:NERDTreeMirror* +:NERDTreeToggle NERD_tree.txt /*:NERDTreeToggle* +:NetrwClean pi_netrw.txt /*:NetrwClean* +:Nexplore pi_netrw.txt /*:Nexplore* +:Nr pi_netrw.txt /*:Nr* +:Nread pi_netrw.txt /*:Nread* +:Ns pi_netrw.txt /*:Ns* +:Nsource pi_netrw.txt /*:Nsource* +:Nw pi_netrw.txt /*:Nw* +:Nwrite pi_netrw.txt /*:Nwrite* +:Pexplore pi_netrw.txt /*:Pexplore* +:Rexplore pi_netrw.txt /*:Rexplore* +:Sexplore pi_netrw.txt /*:Sexplore* +:Texplore pi_netrw.txt /*:Texplore* +:Vexplore pi_netrw.txt /*:Vexplore* +AnsiEsc AnsiEsc.txt /*AnsiEsc* +AnsiEsc-contents AnsiEsc.txt /*AnsiEsc-contents* +AnsiEsc-copyright AnsiEsc.txt /*AnsiEsc-copyright* +AnsiEsc-history AnsiEsc.txt /*AnsiEsc-history* +AnsiEsc-manual AnsiEsc.txt /*AnsiEsc-manual* +AnsiEsc.txt AnsiEsc.txt /*AnsiEsc.txt* +LargeFile-copyright LargeFile.txt /*LargeFile-copyright* +LargeFile.txt LargeFile.txt /*LargeFile.txt* +NERDTree NERD_tree.txt /*NERDTree* +NERDTree-? NERD_tree.txt /*NERDTree-?* +NERDTree-A NERD_tree.txt /*NERDTree-A* +NERDTree-B NERD_tree.txt /*NERDTree-B* +NERDTree-C NERD_tree.txt /*NERDTree-C* +NERDTree-C-J NERD_tree.txt /*NERDTree-C-J* +NERDTree-C-K NERD_tree.txt /*NERDTree-C-K* +NERDTree-D NERD_tree.txt /*NERDTree-D* +NERDTree-F NERD_tree.txt /*NERDTree-F* +NERDTree-I NERD_tree.txt /*NERDTree-I* +NERDTree-J NERD_tree.txt /*NERDTree-J* +NERDTree-K NERD_tree.txt /*NERDTree-K* +NERDTree-O NERD_tree.txt /*NERDTree-O* +NERDTree-P NERD_tree.txt /*NERDTree-P* +NERDTree-R NERD_tree.txt /*NERDTree-R* +NERDTree-T NERD_tree.txt /*NERDTree-T* +NERDTree-U NERD_tree.txt /*NERDTree-U* +NERDTree-X NERD_tree.txt /*NERDTree-X* +NERDTree-cd NERD_tree.txt /*NERDTree-cd* +NERDTree-contents NERD_tree.txt /*NERDTree-contents* +NERDTree-e NERD_tree.txt /*NERDTree-e* +NERDTree-f NERD_tree.txt /*NERDTree-f* +NERDTree-gi NERD_tree.txt /*NERDTree-gi* +NERDTree-go NERD_tree.txt /*NERDTree-go* +NERDTree-gs NERD_tree.txt /*NERDTree-gs* +NERDTree-i NERD_tree.txt /*NERDTree-i* +NERDTree-m NERD_tree.txt /*NERDTree-m* +NERDTree-o NERD_tree.txt /*NERDTree-o* +NERDTree-p NERD_tree.txt /*NERDTree-p* +NERDTree-q NERD_tree.txt /*NERDTree-q* +NERDTree-r NERD_tree.txt /*NERDTree-r* +NERDTree-s NERD_tree.txt /*NERDTree-s* +NERDTree-t NERD_tree.txt /*NERDTree-t* +NERDTree-u NERD_tree.txt /*NERDTree-u* +NERDTree-x NERD_tree.txt /*NERDTree-x* +NERDTreeAPI NERD_tree.txt /*NERDTreeAPI* +NERDTreeAbout NERD_tree.txt /*NERDTreeAbout* +NERDTreeAddKeyMap() NERD_tree.txt /*NERDTreeAddKeyMap()* +NERDTreeAddMenuItem() NERD_tree.txt /*NERDTreeAddMenuItem()* +NERDTreeAddMenuSeparator() NERD_tree.txt /*NERDTreeAddMenuSeparator()* +NERDTreeAddSubmenu() NERD_tree.txt /*NERDTreeAddSubmenu()* +NERDTreeBookmarkCommands NERD_tree.txt /*NERDTreeBookmarkCommands* +NERDTreeBookmarkTable NERD_tree.txt /*NERDTreeBookmarkTable* +NERDTreeBookmarks NERD_tree.txt /*NERDTreeBookmarks* +NERDTreeChangelog NERD_tree.txt /*NERDTreeChangelog* +NERDTreeCredits NERD_tree.txt /*NERDTreeCredits* +NERDTreeFunctionality NERD_tree.txt /*NERDTreeFunctionality* +NERDTreeGlobalCommands NERD_tree.txt /*NERDTreeGlobalCommands* +NERDTreeInvalidBookmarks NERD_tree.txt /*NERDTreeInvalidBookmarks* +NERDTreeKeymapAPI NERD_tree.txt /*NERDTreeKeymapAPI* +NERDTreeLicense NERD_tree.txt /*NERDTreeLicense* +NERDTreeMappings NERD_tree.txt /*NERDTreeMappings* +NERDTreeMenu NERD_tree.txt /*NERDTreeMenu* +NERDTreeMenuAPI NERD_tree.txt /*NERDTreeMenuAPI* +NERDTreeOptionDetails NERD_tree.txt /*NERDTreeOptionDetails* +NERDTreeOptionSummary NERD_tree.txt /*NERDTreeOptionSummary* +NERDTreeOptions NERD_tree.txt /*NERDTreeOptions* +NERDTreeRender() NERD_tree.txt /*NERDTreeRender()* +NERD_tree.txt NERD_tree.txt /*NERD_tree.txt* +NetUserPass() pi_netrw.txt /*NetUserPass()* +b:netrw_lastfile pi_netrw.txt /*b:netrw_lastfile* +bufexplorer bufexplorer.txt /*bufexplorer* +bufexplorer-changelog bufexplorer.txt /*bufexplorer-changelog* +bufexplorer-credits bufexplorer.txt /*bufexplorer-credits* +bufexplorer-customization bufexplorer.txt /*bufexplorer-customization* +bufexplorer-installation bufexplorer.txt /*bufexplorer-installation* +bufexplorer-todo bufexplorer.txt /*bufexplorer-todo* +bufexplorer-usage bufexplorer.txt /*bufexplorer-usage* +bufexplorer-windowlayout bufexplorer.txt /*bufexplorer-windowlayout* +bufexplorer.txt bufexplorer.txt /*bufexplorer.txt* +buffer-explorer bufexplorer.txt /*buffer-explorer* +dav pi_netrw.txt /*dav* +davs pi_netrw.txt /*davs* +fetch pi_netrw.txt /*fetch* +ftp pi_netrw.txt /*ftp* +g:NetrwTopLvlMenu pi_netrw.txt /*g:NetrwTopLvlMenu* +g:Netrw_funcref pi_netrw.txt /*g:Netrw_funcref* +g:SuperTabCompletionContexts supertab.txt /*g:SuperTabCompletionContexts* +g:SuperTabContextDefaultCompletionType supertab.txt /*g:SuperTabContextDefaultCompletionType* +g:SuperTabCrMapping supertab.txt /*g:SuperTabCrMapping* +g:SuperTabDefaultCompletionType supertab.txt /*g:SuperTabDefaultCompletionType* +g:SuperTabLongestEnhanced supertab.txt /*g:SuperTabLongestEnhanced* +g:SuperTabLongestHighlight supertab.txt /*g:SuperTabLongestHighlight* +g:SuperTabMappingBackward supertab.txt /*g:SuperTabMappingBackward* +g:SuperTabMappingForward supertab.txt /*g:SuperTabMappingForward* +g:SuperTabMappingTabLiteral supertab.txt /*g:SuperTabMappingTabLiteral* +g:SuperTabNoCompleteAfter supertab.txt /*g:SuperTabNoCompleteAfter* +g:SuperTabNoCompleteBefore supertab.txt /*g:SuperTabNoCompleteBefore* +g:SuperTabRetainCompletionDuration supertab.txt /*g:SuperTabRetainCompletionDuration* +g:bufExplorerChgWin bufexplorer.txt /*g:bufExplorerChgWin* +g:bufExplorerDefaultHelp bufexplorer.txt /*g:bufExplorerDefaultHelp* +g:bufExplorerDetailedHelp bufexplorer.txt /*g:bufExplorerDetailedHelp* +g:bufExplorerFindActive bufexplorer.txt /*g:bufExplorerFindActive* +g:bufExplorerFuncRef bufexplorer.txt /*g:bufExplorerFuncRef* +g:bufExplorerReverseSort bufexplorer.txt /*g:bufExplorerReverseSort* +g:bufExplorerShowDirectories bufexplorer.txt /*g:bufExplorerShowDirectories* +g:bufExplorerShowRelativePath bufexplorer.txt /*g:bufExplorerShowRelativePath* +g:bufExplorerShowTabBuffer bufexplorer.txt /*g:bufExplorerShowTabBuffer* +g:bufExplorerShowUnlisted bufexplorer.txt /*g:bufExplorerShowUnlisted* +g:bufExplorerSortBy bufexplorer.txt /*g:bufExplorerSortBy* +g:bufExplorerSplitBelow bufexplorer.txt /*g:bufExplorerSplitBelow* +g:bufExplorerSplitOutPathName bufexplorer.txt /*g:bufExplorerSplitOutPathName* +g:bufExplorerSplitRight bufexplorer.txt /*g:bufExplorerSplitRight* +g:netrw_alto pi_netrw.txt /*g:netrw_alto* +g:netrw_altv pi_netrw.txt /*g:netrw_altv* +g:netrw_banner pi_netrw.txt /*g:netrw_banner* +g:netrw_browse_split pi_netrw.txt /*g:netrw_browse_split* +g:netrw_browsex_viewer pi_netrw.txt /*g:netrw_browsex_viewer* +g:netrw_bufsettings pi_netrw.txt /*g:netrw_bufsettings* +g:netrw_chgperm pi_netrw.txt /*g:netrw_chgperm* +g:netrw_chgwin pi_netrw.txt /*g:netrw_chgwin* +g:netrw_compress pi_netrw.txt /*g:netrw_compress* +g:netrw_ctags pi_netrw.txt /*g:netrw_ctags* +g:netrw_cursor pi_netrw.txt /*g:netrw_cursor* +g:netrw_cygwin pi_netrw.txt /*g:netrw_cygwin* +g:netrw_dav_cmd pi_netrw.txt /*g:netrw_dav_cmd* +g:netrw_decompress pi_netrw.txt /*g:netrw_decompress* +g:netrw_dirhistmax pi_netrw.txt /*g:netrw_dirhistmax* +g:netrw_fastbrowse pi_netrw.txt /*g:netrw_fastbrowse* +g:netrw_fetch_cmd pi_netrw.txt /*g:netrw_fetch_cmd* +g:netrw_fname_escape pi_netrw.txt /*g:netrw_fname_escape* +g:netrw_ftp pi_netrw.txt /*g:netrw_ftp* +g:netrw_ftp_browse_reject pi_netrw.txt /*g:netrw_ftp_browse_reject* +g:netrw_ftp_cmd pi_netrw.txt /*g:netrw_ftp_cmd* +g:netrw_ftp_list_cmd pi_netrw.txt /*g:netrw_ftp_list_cmd* +g:netrw_ftp_sizelist_cmd pi_netrw.txt /*g:netrw_ftp_sizelist_cmd* +g:netrw_ftp_timelist_cmd pi_netrw.txt /*g:netrw_ftp_timelist_cmd* +g:netrw_ftpextracmd pi_netrw.txt /*g:netrw_ftpextracmd* +g:netrw_ftpmode pi_netrw.txt /*g:netrw_ftpmode* +g:netrw_glob_escape pi_netrw.txt /*g:netrw_glob_escape* +g:netrw_hide pi_netrw.txt /*g:netrw_hide* +g:netrw_home pi_netrw.txt /*g:netrw_home* +g:netrw_http_cmd pi_netrw.txt /*g:netrw_http_cmd* +g:netrw_http_xcmd pi_netrw.txt /*g:netrw_http_xcmd* +g:netrw_ignorenetrc pi_netrw.txt /*g:netrw_ignorenetrc* +g:netrw_keepdir pi_netrw.txt /*g:netrw_keepdir* +g:netrw_list_cmd pi_netrw.txt /*g:netrw_list_cmd* +g:netrw_list_hide pi_netrw.txt /*g:netrw_list_hide* +g:netrw_liststyle pi_netrw.txt /*g:netrw_liststyle* +g:netrw_local_mkdir pi_netrw.txt /*g:netrw_local_mkdir* +g:netrw_local_rmdir pi_netrw.txt /*g:netrw_local_rmdir* +g:netrw_localcopycmd pi_netrw.txt /*g:netrw_localcopycmd* +g:netrw_localmovecmd pi_netrw.txt /*g:netrw_localmovecmd* +g:netrw_maxfilenamelen pi_netrw.txt /*g:netrw_maxfilenamelen* +g:netrw_menu pi_netrw.txt /*g:netrw_menu* +g:netrw_mkdir_cmd pi_netrw.txt /*g:netrw_mkdir_cmd* +g:netrw_mousemaps pi_netrw.txt /*g:netrw_mousemaps* +g:netrw_nogx pi_netrw.txt /*g:netrw_nogx* +g:netrw_preview pi_netrw.txt /*g:netrw_preview* +g:netrw_rcp_cmd pi_netrw.txt /*g:netrw_rcp_cmd* +g:netrw_retmap pi_netrw.txt /*g:netrw_retmap* +g:netrw_rm_cmd pi_netrw.txt /*g:netrw_rm_cmd* +g:netrw_rmdir_cmd pi_netrw.txt /*g:netrw_rmdir_cmd* +g:netrw_rmf_cmd pi_netrw.txt /*g:netrw_rmf_cmd* +g:netrw_rsync_cmd pi_netrw.txt /*g:netrw_rsync_cmd* +g:netrw_scp_cmd pi_netrw.txt /*g:netrw_scp_cmd* +g:netrw_scpport pi_netrw.txt /*g:netrw_scpport* +g:netrw_sepchr pi_netrw.txt /*g:netrw_sepchr* +g:netrw_sftp_cmd pi_netrw.txt /*g:netrw_sftp_cmd* +g:netrw_silent pi_netrw.txt /*g:netrw_silent* +g:netrw_sort_by pi_netrw.txt /*g:netrw_sort_by* +g:netrw_sort_direction pi_netrw.txt /*g:netrw_sort_direction* +g:netrw_sort_options pi_netrw.txt /*g:netrw_sort_options* +g:netrw_sort_sequence pi_netrw.txt /*g:netrw_sort_sequence* +g:netrw_special_syntax pi_netrw.txt /*g:netrw_special_syntax* +g:netrw_ssh_browse_reject pi_netrw.txt /*g:netrw_ssh_browse_reject* +g:netrw_ssh_cmd pi_netrw.txt /*g:netrw_ssh_cmd* +g:netrw_sshport pi_netrw.txt /*g:netrw_sshport* +g:netrw_timefmt pi_netrw.txt /*g:netrw_timefmt* +g:netrw_tmpfile_escape pi_netrw.txt /*g:netrw_tmpfile_escape* +g:netrw_uid pi_netrw.txt /*g:netrw_uid* +g:netrw_use_errorwindow pi_netrw.txt /*g:netrw_use_errorwindow* +g:netrw_use_noswf pi_netrw.txt /*g:netrw_use_noswf* +g:netrw_use_nt_rcp pi_netrw.txt /*g:netrw_use_nt_rcp* +g:netrw_win95ftp pi_netrw.txt /*g:netrw_win95ftp* +g:netrw_winsize pi_netrw.txt /*g:netrw_winsize* +g:netrw_xstrlen pi_netrw.txt /*g:netrw_xstrlen* +global_markfilelist pi_netrw.txt /*global_markfilelist* +http pi_netrw.txt /*http* +largefile LargeFile.txt /*largefile* +largefile-history LargeFile.txt /*largefile-history* +local_markfilelist pi_netrw.txt /*local_markfilelist* +markfilelist pi_netrw.txt /*markfilelist* +netreadfixup pi_netrw.txt /*netreadfixup* +netrw pi_netrw.txt /*netrw* +netrw-% pi_netrw.txt /*netrw-%* +netrw-- pi_netrw.txt /*netrw--* +netrw-C pi_netrw.txt /*netrw-C* +netrw-D pi_netrw.txt /*netrw-D* +netrw-O pi_netrw.txt /*netrw-O* +netrw-P pi_netrw.txt /*netrw-P* +netrw-R pi_netrw.txt /*netrw-R* +netrw-S pi_netrw.txt /*netrw-S* +netrw-T pi_netrw.txt /*netrw-T* +netrw-U pi_netrw.txt /*netrw-U* +netrw-a pi_netrw.txt /*netrw-a* +netrw-activate pi_netrw.txt /*netrw-activate* +netrw-bookmark pi_netrw.txt /*netrw-bookmark* +netrw-bookmarks pi_netrw.txt /*netrw-bookmarks* +netrw-browse pi_netrw.txt /*netrw-browse* +netrw-browse-cmds pi_netrw.txt /*netrw-browse-cmds* +netrw-browse-maps pi_netrw.txt /*netrw-browse-maps* +netrw-browser pi_netrw.txt /*netrw-browser* +netrw-browser-options pi_netrw.txt /*netrw-browser-options* +netrw-browser-var pi_netrw.txt /*netrw-browser-var* +netrw-browsing pi_netrw.txt /*netrw-browsing* +netrw-c pi_netrw.txt /*netrw-c* +netrw-cadaver pi_netrw.txt /*netrw-cadaver* +netrw-chgup pi_netrw.txt /*netrw-chgup* +netrw-clean pi_netrw.txt /*netrw-clean* +netrw-contents pi_netrw.txt /*netrw-contents* +netrw-copyright pi_netrw.txt /*netrw-copyright* +netrw-cr pi_netrw.txt /*netrw-cr* +netrw-createfile pi_netrw.txt /*netrw-createfile* +netrw-credits pi_netrw.txt /*netrw-credits* +netrw-ctrl-h pi_netrw.txt /*netrw-ctrl-h* +netrw-ctrl-l pi_netrw.txt /*netrw-ctrl-l* +netrw-ctrl_l pi_netrw.txt /*netrw-ctrl_l* +netrw-curdir pi_netrw.txt /*netrw-curdir* +netrw-d pi_netrw.txt /*netrw-d* +netrw-debug pi_netrw.txt /*netrw-debug* +netrw-del pi_netrw.txt /*netrw-del* +netrw-delete pi_netrw.txt /*netrw-delete* +netrw-dir pi_netrw.txt /*netrw-dir* +netrw-dirlist pi_netrw.txt /*netrw-dirlist* +netrw-downdir pi_netrw.txt /*netrw-downdir* +netrw-edithide pi_netrw.txt /*netrw-edithide* +netrw-ex pi_netrw.txt /*netrw-ex* +netrw-explore pi_netrw.txt /*netrw-explore* +netrw-explore-cmds pi_netrw.txt /*netrw-explore-cmds* +netrw-externapp pi_netrw.txt /*netrw-externapp* +netrw-file pi_netrw.txt /*netrw-file* +netrw-filigree pi_netrw.txt /*netrw-filigree* +netrw-fixup pi_netrw.txt /*netrw-fixup* +netrw-ftp pi_netrw.txt /*netrw-ftp* +netrw-ftype pi_netrw.txt /*netrw-ftype* +netrw-gb pi_netrw.txt /*netrw-gb* +netrw-gd pi_netrw.txt /*netrw-gd* +netrw-getftype pi_netrw.txt /*netrw-getftype* +netrw-gf pi_netrw.txt /*netrw-gf* +netrw-gh pi_netrw.txt /*netrw-gh* +netrw-gp pi_netrw.txt /*netrw-gp* +netrw-gx pi_netrw.txt /*netrw-gx* +netrw-handler pi_netrw.txt /*netrw-handler* +netrw-help pi_netrw.txt /*netrw-help* +netrw-hexplore pi_netrw.txt /*netrw-hexplore* +netrw-hide pi_netrw.txt /*netrw-hide* +netrw-hiding pi_netrw.txt /*netrw-hiding* +netrw-history pi_netrw.txt /*netrw-history* +netrw-horiz pi_netrw.txt /*netrw-horiz* +netrw-i pi_netrw.txt /*netrw-i* +netrw-incompatible pi_netrw.txt /*netrw-incompatible* +netrw-intro-browse pi_netrw.txt /*netrw-intro-browse* +netrw-leftmouse pi_netrw.txt /*netrw-leftmouse* +netrw-list pi_netrw.txt /*netrw-list* +netrw-listbookmark pi_netrw.txt /*netrw-listbookmark* +netrw-listhack pi_netrw.txt /*netrw-listhack* +netrw-login pi_netrw.txt /*netrw-login* +netrw-mB pi_netrw.txt /*netrw-mB* +netrw-mT pi_netrw.txt /*netrw-mT* +netrw-mb pi_netrw.txt /*netrw-mb* +netrw-mc pi_netrw.txt /*netrw-mc* +netrw-md pi_netrw.txt /*netrw-md* +netrw-me pi_netrw.txt /*netrw-me* +netrw-mf pi_netrw.txt /*netrw-mf* +netrw-mg pi_netrw.txt /*netrw-mg* +netrw-mh pi_netrw.txt /*netrw-mh* +netrw-middlemouse pi_netrw.txt /*netrw-middlemouse* +netrw-ml_get pi_netrw.txt /*netrw-ml_get* +netrw-mm pi_netrw.txt /*netrw-mm* +netrw-mouse pi_netrw.txt /*netrw-mouse* +netrw-move pi_netrw.txt /*netrw-move* +netrw-mp pi_netrw.txt /*netrw-mp* +netrw-mr pi_netrw.txt /*netrw-mr* +netrw-ms pi_netrw.txt /*netrw-ms* +netrw-mt pi_netrw.txt /*netrw-mt* +netrw-mu pi_netrw.txt /*netrw-mu* +netrw-mx pi_netrw.txt /*netrw-mx* +netrw-mz pi_netrw.txt /*netrw-mz* +netrw-netrc pi_netrw.txt /*netrw-netrc* +netrw-nexplore pi_netrw.txt /*netrw-nexplore* +netrw-noload pi_netrw.txt /*netrw-noload* +netrw-nread pi_netrw.txt /*netrw-nread* +netrw-nwrite pi_netrw.txt /*netrw-nwrite* +netrw-o pi_netrw.txt /*netrw-o* +netrw-options pi_netrw.txt /*netrw-options* +netrw-p pi_netrw.txt /*netrw-p* +netrw-p1 pi_netrw.txt /*netrw-p1* +netrw-p10 pi_netrw.txt /*netrw-p10* +netrw-p11 pi_netrw.txt /*netrw-p11* +netrw-p12 pi_netrw.txt /*netrw-p12* +netrw-p13 pi_netrw.txt /*netrw-p13* +netrw-p14 pi_netrw.txt /*netrw-p14* +netrw-p15 pi_netrw.txt /*netrw-p15* +netrw-p2 pi_netrw.txt /*netrw-p2* +netrw-p3 pi_netrw.txt /*netrw-p3* +netrw-p4 pi_netrw.txt /*netrw-p4* +netrw-p5 pi_netrw.txt /*netrw-p5* +netrw-p6 pi_netrw.txt /*netrw-p6* +netrw-p7 pi_netrw.txt /*netrw-p7* +netrw-p8 pi_netrw.txt /*netrw-p8* +netrw-p9 pi_netrw.txt /*netrw-p9* +netrw-passwd pi_netrw.txt /*netrw-passwd* +netrw-password pi_netrw.txt /*netrw-password* +netrw-path pi_netrw.txt /*netrw-path* +netrw-pexplore pi_netrw.txt /*netrw-pexplore* +netrw-preview pi_netrw.txt /*netrw-preview* +netrw-problems pi_netrw.txt /*netrw-problems* +netrw-protocol pi_netrw.txt /*netrw-protocol* +netrw-prvwin pi_netrw.txt /*netrw-prvwin* +netrw-pscp pi_netrw.txt /*netrw-pscp* +netrw-psftp pi_netrw.txt /*netrw-psftp* +netrw-putty pi_netrw.txt /*netrw-putty* +netrw-qb pi_netrw.txt /*netrw-qb* +netrw-qf pi_netrw.txt /*netrw-qf* +netrw-quickcom pi_netrw.txt /*netrw-quickcom* +netrw-quickcoms pi_netrw.txt /*netrw-quickcoms* +netrw-quickhelp pi_netrw.txt /*netrw-quickhelp* +netrw-quickmap pi_netrw.txt /*netrw-quickmap* +netrw-quickmaps pi_netrw.txt /*netrw-quickmaps* +netrw-r pi_netrw.txt /*netrw-r* +netrw-read pi_netrw.txt /*netrw-read* +netrw-ref pi_netrw.txt /*netrw-ref* +netrw-rename pi_netrw.txt /*netrw-rename* +netrw-reverse pi_netrw.txt /*netrw-reverse* +netrw-rexplore pi_netrw.txt /*netrw-rexplore* +netrw-rightmouse pi_netrw.txt /*netrw-rightmouse* +netrw-s pi_netrw.txt /*netrw-s* +netrw-settings pi_netrw.txt /*netrw-settings* +netrw-sexplore pi_netrw.txt /*netrw-sexplore* +netrw-sort pi_netrw.txt /*netrw-sort* +netrw-sortsequence pi_netrw.txt /*netrw-sortsequence* +netrw-source pi_netrw.txt /*netrw-source* +netrw-ssh-hack pi_netrw.txt /*netrw-ssh-hack* +netrw-star pi_netrw.txt /*netrw-star* +netrw-starpat pi_netrw.txt /*netrw-starpat* +netrw-starstar pi_netrw.txt /*netrw-starstar* +netrw-starstarpat pi_netrw.txt /*netrw-starstarpat* +netrw-start pi_netrw.txt /*netrw-start* +netrw-t pi_netrw.txt /*netrw-t* +netrw-texplore pi_netrw.txt /*netrw-texplore* +netrw-todo pi_netrw.txt /*netrw-todo* +netrw-trailingslash pi_netrw.txt /*netrw-trailingslash* +netrw-transparent pi_netrw.txt /*netrw-transparent* +netrw-u pi_netrw.txt /*netrw-u* +netrw-updir pi_netrw.txt /*netrw-updir* +netrw-urls pi_netrw.txt /*netrw-urls* +netrw-userpass pi_netrw.txt /*netrw-userpass* +netrw-v pi_netrw.txt /*netrw-v* +netrw-var pi_netrw.txt /*netrw-var* +netrw-variables pi_netrw.txt /*netrw-variables* +netrw-vexplore pi_netrw.txt /*netrw-vexplore* +netrw-write pi_netrw.txt /*netrw-write* +netrw-x pi_netrw.txt /*netrw-x* +netrw-xfer pi_netrw.txt /*netrw-xfer* +netrw.vim pi_netrw.txt /*netrw.vim* +netrw_filehandler pi_netrw.txt /*netrw_filehandler* +network pi_netrw.txt /*network* +pi_netrw.txt pi_netrw.txt /*pi_netrw.txt* +rcp pi_netrw.txt /*rcp* +rsync pi_netrw.txt /*rsync* +s:netrw_passwd pi_netrw.txt /*s:netrw_passwd* +scp pi_netrw.txt /*scp* +sftp pi_netrw.txt /*sftp* +supertab supertab.txt /*supertab* +supertab-completioncontexts supertab.txt /*supertab-completioncontexts* +supertab-contextdefault supertab.txt /*supertab-contextdefault* +supertab-contextdiscover supertab.txt /*supertab-contextdiscover* +supertab-contextexample supertab.txt /*supertab-contextexample* +supertab-contexttext supertab.txt /*supertab-contexttext* +supertab-crmapping supertab.txt /*supertab-crmapping* +supertab-defaultcompletion supertab.txt /*supertab-defaultcompletion* +supertab-duration supertab.txt /*supertab-duration* +supertab-forwardbackward supertab.txt /*supertab-forwardbackward* +supertab-intro supertab.txt /*supertab-intro* +supertab-longestenhanced supertab.txt /*supertab-longestenhanced* +supertab-longesthighlight supertab.txt /*supertab-longesthighlight* +supertab-mappingtabliteral supertab.txt /*supertab-mappingtabliteral* +supertab-options supertab.txt /*supertab-options* +supertab-preventcomplete supertab.txt /*supertab-preventcomplete* +supertab-usage supertab.txt /*supertab-usage* +supertab.txt supertab.txt /*supertab.txt* diff --git a/.vim/ftdetect/markdown.vim b/.vim/ftdetect/markdown.vim new file mode 100644 index 0000000..8e10a06 --- /dev/null +++ b/.vim/ftdetect/markdown.vim @@ -0,0 +1,2 @@ +" Markdown +autocmd BufNewFile,BufRead *.{md,mkd,mkdn,mark*} set filetype=markdown diff --git a/.vim/ftdetect/perl.vim b/.vim/ftdetect/perl.vim new file mode 100644 index 0000000..1c877fe --- /dev/null +++ b/.vim/ftdetect/perl.vim @@ -0,0 +1 @@ +autocmd BufNewFile,BufRead *.{pl,pm,t} set filetype=perl diff --git a/.vim/indent/python.vim b/.vim/indent/python.vim new file mode 100644 index 0000000..7b9c17c --- /dev/null +++ b/.vim/indent/python.vim @@ -0,0 +1,196 @@ +" Python indent file +" Language: Python +" Maintainer: Eric Mc Sween +" Original Author: David Bustos +" Last Change: 2004 Jun 07 + +" Only load this indent file when no other was loaded. +if exists("b:did_indent") + finish +endif +let b:did_indent = 1 + +setlocal expandtab +setlocal nolisp +setlocal autoindent +setlocal indentexpr=GetPythonIndent(v:lnum) +setlocal indentkeys=!^F,o,O,<:>,0),0],0},=elif,=except + +let s:maxoff = 50 + +" Find backwards the closest open parenthesis/bracket/brace. +function! s:SearchParensPair() + let line = line('.') + let col = col('.') + + " Skip strings and comments and don't look too far + let skip = "line('.') < " . (line - s:maxoff) . " ? dummy :" . + \ 'synIDattr(synID(line("."), col("."), 0), "name") =~? ' . + \ '"string\\|comment"' + + " Search for parentheses + call cursor(line, col) + let parlnum = searchpair('(', '', ')', 'bW', skip) + let parcol = col('.') + + " Search for brackets + call cursor(line, col) + let par2lnum = searchpair('\[', '', '\]', 'bW', skip) + let par2col = col('.') + + " Search for braces + call cursor(line, col) + let par3lnum = searchpair('{', '', '}', 'bW', skip) + let par3col = col('.') + + " Get the closest match + if par2lnum > parlnum || (par2lnum == parlnum && par2col > parcol) + let parlnum = par2lnum + let parcol = par2col + endif + if par3lnum > parlnum || (par3lnum == parlnum && par3col > parcol) + let parlnum = par3lnum + let parcol = par3col + endif + + " Put the cursor on the match + if parlnum > 0 + call cursor(parlnum, parcol) + endif + return parlnum +endfunction + +" Find the start of a multi-line statement +function! s:StatementStart(lnum) + let lnum = a:lnum + while 1 + if getline(lnum - 1) =~ '\\$' + let lnum = lnum - 1 + else + call cursor(lnum, 1) + let maybe_lnum = s:SearchParensPair() + if maybe_lnum < 1 + return lnum + else + let lnum = maybe_lnum + endif + endif + endwhile +endfunction + +" Find the block starter that matches the current line +function! s:BlockStarter(lnum, block_start_re) + let lnum = a:lnum + let maxindent = 10000 " whatever + while lnum > 1 + let lnum = prevnonblank(lnum - 1) + if indent(lnum) < maxindent + if getline(lnum) =~ a:block_start_re + return lnum + else + let maxindent = indent(lnum) + " It's not worth going further if we reached the top level + if maxindent == 0 + return -1 + endif + endif + endif + endwhile + return -1 +endfunction + +function! GetPythonIndent(lnum) + + " First line has indent 0 + if a:lnum == 1 + return 0 + endif + + " If we can find an open parenthesis/bracket/brace, line up with it. + call cursor(a:lnum, 1) + let parlnum = s:SearchParensPair() + if parlnum > 0 + let parcol = col('.') + let closing_paren = match(getline(a:lnum), '^\s*[])}]') != -1 + if match(getline(parlnum), '[([{]\s*$', parcol - 1) != -1 + if closing_paren + return indent(parlnum) + else + return indent(parlnum) + &shiftwidth + endif + else + if closing_paren + return parcol - 1 + else + return parcol + endif + endif + endif + + " Examine this line + let thisline = getline(a:lnum) + let thisindent = indent(a:lnum) + + " If the line starts with 'elif' or 'else', line up with 'if' or 'elif' + if thisline =~ '^\s*\(elif\|else\)\>' + let bslnum = s:BlockStarter(a:lnum, '^\s*\(if\|elif\)\>') + if bslnum > 0 + return indent(bslnum) + else + return -1 + endif + endif + + " If the line starts with 'except' or 'finally', line up with 'try' + " or 'except' + if thisline =~ '^\s*\(except\|finally\)\>' + let bslnum = s:BlockStarter(a:lnum, '^\s*\(try\|except\)\>') + if bslnum > 0 + return indent(bslnum) + else + return -1 + endif + endif + + " Examine previous line + let plnum = a:lnum - 1 + let pline = getline(plnum) + let sslnum = s:StatementStart(plnum) + + " If the previous line is blank, keep the same indentation + if pline =~ '^\s*$' + return -1 + endif + + " If this line is explicitly joined, try to find an indentation that looks + " good. + if pline =~ '\\$' + let compound_statement = '^\s*\(if\|while\|for\s.*\sin\|except\)\s*' + let maybe_indent = matchend(getline(sslnum), compound_statement) + if maybe_indent != -1 + return maybe_indent + else + return indent(sslnum) + &sw * 2 + endif + endif + + " If the previous line ended with a colon, indent relative to + " statement start. + if pline =~ ':\s*$' + return indent(sslnum) + &sw + endif + + " If the previous line was a stop-execution statement or a pass + if getline(sslnum) =~ '^\s*\(break\|continue\|raise\|return\|pass\)\>' + " See if the user has already dedented + if indent(a:lnum) > indent(sslnum) - &sw + " If not, recommend one dedent + return indent(sslnum) - &sw + endif + " Otherwise, trust the user + return -1 + endif + + " In all other cases, line up with the start of the previous statement. + return indent(sslnum) +endfunction diff --git a/.vim/local/.gitignore b/.vim/local/.gitignore new file mode 100644 index 0000000..8509d22 --- /dev/null +++ b/.vim/local/.gitignore @@ -0,0 +1,5 @@ +* +!.gitignore +!backup +!swap +!undo diff --git a/.vim/plugin/AnsiEscPlugin.vim b/.vim/plugin/AnsiEscPlugin.vim new file mode 100644 index 0000000..0dd710b --- /dev/null +++ b/.vim/plugin/AnsiEscPlugin.vim @@ -0,0 +1,30 @@ +" AnsiEscPlugin.vim +" Author: Charles E. Campbell, Jr. +" Date: Apr 07, 2010 +" Version: 12 +" --------------------------------------------------------------------- +" Load Once: {{{1 +if &cp || exists("g:loaded_AnsiEscPlugin") + finish +endif +let g:loaded_AnsiEscPlugin = "v12" +let s:keepcpo = &cpo +set cpo&vim + +" --------------------------------------------------------------------- +" Public Interface: {{{1 +com! -bang -nargs=0 AnsiEsc :call AnsiEsc#AnsiEsc(0) + +" DrChip Menu Support: {{{2 +if has("gui_running") && has("menu") && &go =~ 'm' + if !exists("g:DrChipTopLvlMenu") + let g:DrChipTopLvlMenu= "DrChip." + endif + exe 'menu '.g:DrChipTopLvlMenu.'AnsiEsc.Start:AnsiEsc :AnsiEsc' +endif + +" --------------------------------------------------------------------- +" Restore: {{{1 +let &cpo= s:keepcpo +unlet s:keepcpo +" vim: ts=4 fdm=marker diff --git a/.vim/plugin/cecutil.vim b/.vim/plugin/cecutil.vim new file mode 100644 index 0000000..e45e798 --- /dev/null +++ b/.vim/plugin/cecutil.vim @@ -0,0 +1,536 @@ +" cecutil.vim : save/restore window position +" save/restore mark position +" save/restore selected user maps +" Author: Charles E. Campbell, Jr. +" Version: 18h ASTRO-ONLY +" Date: Apr 05, 2010 +" +" Saving Restoring Destroying Marks: {{{1 +" call SaveMark(markname) let savemark= SaveMark(markname) +" call RestoreMark(markname) call RestoreMark(savemark) +" call DestroyMark(markname) +" commands: SM RM DM +" +" Saving Restoring Destroying Window Position: {{{1 +" call SaveWinPosn() let winposn= SaveWinPosn() +" call RestoreWinPosn() call RestoreWinPosn(winposn) +" \swp : save current window/buffer's position +" \rwp : restore current window/buffer's previous position +" commands: SWP RWP +" +" Saving And Restoring User Maps: {{{1 +" call SaveUserMaps(mapmode,maplead,mapchx,suffix) +" call RestoreUserMaps(suffix) +" +" GetLatestVimScripts: 1066 1 :AutoInstall: cecutil.vim +" +" You believe that God is one. You do well. The demons also {{{1 +" believe, and shudder. But do you want to know, vain man, that +" faith apart from works is dead? (James 2:19,20 WEB) +"redraw!|call inputsave()|call input("Press to continue")|call inputrestore() + +" --------------------------------------------------------------------- +" Load Once: {{{1 +if &cp || exists("g:loaded_cecutil") + finish +endif +let g:loaded_cecutil = "v18h" +let s:keepcpo = &cpo +set cpo&vim +"DechoRemOn + +" ======================= +" Public Interface: {{{1 +" ======================= + +" --------------------------------------------------------------------- +" Map Interface: {{{2 +if !hasmapto('SaveWinPosn') + map swp SaveWinPosn +endif +if !hasmapto('RestoreWinPosn') + map rwp RestoreWinPosn +endif +nmap SaveWinPosn :call SaveWinPosn() +nmap RestoreWinPosn :call RestoreWinPosn() + +" --------------------------------------------------------------------- +" Command Interface: {{{2 +com! -bar -nargs=0 SWP call SaveWinPosn() +com! -bar -nargs=? RWP call RestoreWinPosn() +com! -bar -nargs=1 SM call SaveMark() +com! -bar -nargs=1 RM call RestoreMark() +com! -bar -nargs=1 DM call DestroyMark() + +com! -bar -nargs=1 WLR call s:WinLineRestore() + +if v:version < 630 + let s:modifier= "sil! " +else + let s:modifier= "sil! keepj " +endif + +" =============== +" Functions: {{{1 +" =============== + +" --------------------------------------------------------------------- +" SaveWinPosn: {{{2 +" let winposn= SaveWinPosn() will save window position in winposn variable +" call SaveWinPosn() will save window position in b:cecutil_winposn{b:cecutil_iwinposn} +" let winposn= SaveWinPosn(0) will *only* save window position in winposn variable (no stacking done) +fun! SaveWinPosn(...) +" echomsg "Decho: SaveWinPosn() a:0=".a:0 + if line("$") == 1 && getline(1) == "" +" echomsg "Decho: SaveWinPosn : empty buffer" + return "" + endif + let so_keep = &l:so + let siso_keep = &siso + let ss_keep = &l:ss + setlocal so=0 siso=0 ss=0 + + let swline = line(".") " save-window line in file + let swcol = col(".") " save-window column in file + if swcol >= col("$") + let swcol= swcol + virtcol(".") - virtcol("$") " adjust for virtual edit (cursor past end-of-line) + endif + let swwline = winline() - 1 " save-window window line + let swwcol = virtcol(".") - wincol() " save-window window column + let savedposn = "" +" echomsg "Decho: sw[".swline.",".swcol."] sww[".swwline.",".swwcol."]" + let savedposn = "call GoWinbufnr(".winbufnr(0).")" + let savedposn = savedposn."|".s:modifier.swline + let savedposn = savedposn."|".s:modifier."norm! 0z\" + if swwline > 0 + let savedposn= savedposn.":".s:modifier."call s:WinLineRestore(".(swwline+1).")\" + endif + if swwcol > 0 + let savedposn= savedposn.":".s:modifier."norm! 0".swwcol."zl\" + endif + let savedposn = savedposn.":".s:modifier."call cursor(".swline.",".swcol.")\" + + " save window position in + " b:cecutil_winposn_{iwinposn} (stack) + " only when SaveWinPosn() is used + if a:0 == 0 + if !exists("b:cecutil_iwinposn") + let b:cecutil_iwinposn= 1 + else + let b:cecutil_iwinposn= b:cecutil_iwinposn + 1 + endif +" echomsg "Decho: saving posn to SWP stack" + let b:cecutil_winposn{b:cecutil_iwinposn}= savedposn + endif + + let &l:so = so_keep + let &siso = siso_keep + let &l:ss = ss_keep + +" if exists("b:cecutil_iwinposn") " Decho +" echomsg "Decho: b:cecutil_winpos{".b:cecutil_iwinposn."}[".b:cecutil_winposn{b:cecutil_iwinposn}."]" +" else " Decho +" echomsg "Decho: b:cecutil_iwinposn doesn't exist" +" endif " Decho +" echomsg "Decho: SaveWinPosn [".savedposn."]" + return savedposn +endfun + +" --------------------------------------------------------------------- +" RestoreWinPosn: {{{2 +" call RestoreWinPosn() +" call RestoreWinPosn(winposn) +fun! RestoreWinPosn(...) +" echomsg "Decho: RestoreWinPosn() a:0=".a:0 +" echomsg "Decho: getline(1)<".getline(1).">" +" echomsg "Decho: line(.)=".line(".") + if line("$") == 1 && getline(1) == "" +" echomsg "Decho: RestoreWinPosn : empty buffer" + return "" + endif + let so_keep = &l:so + let siso_keep = &l:siso + let ss_keep = &l:ss + setlocal so=0 siso=0 ss=0 + + if a:0 == 0 || a:1 == "" + " use saved window position in b:cecutil_winposn{b:cecutil_iwinposn} if it exists + if exists("b:cecutil_iwinposn") && exists("b:cecutil_winposn{b:cecutil_iwinposn}") +" echomsg "Decho: using stack b:cecutil_winposn{".b:cecutil_iwinposn."}<".b:cecutil_winposn{b:cecutil_iwinposn}.">" + try + exe s:modifier.b:cecutil_winposn{b:cecutil_iwinposn} + catch /^Vim\%((\a\+)\)\=:E749/ + " ignore empty buffer error messages + endtry + " normally drop top-of-stack by one + " but while new top-of-stack doesn't exist + " drop top-of-stack index by one again + if b:cecutil_iwinposn >= 1 + unlet b:cecutil_winposn{b:cecutil_iwinposn} + let b:cecutil_iwinposn= b:cecutil_iwinposn - 1 + while b:cecutil_iwinposn >= 1 && !exists("b:cecutil_winposn{b:cecutil_iwinposn}") + let b:cecutil_iwinposn= b:cecutil_iwinposn - 1 + endwhile + if b:cecutil_iwinposn < 1 + unlet b:cecutil_iwinposn + endif + endif + else + echohl WarningMsg + echomsg "***warning*** need to SaveWinPosn first!" + echohl None + endif + + else " handle input argument +" echomsg "Decho: using input a:1<".a:1.">" + " use window position passed to this function + exe a:1 + " remove a:1 pattern from b:cecutil_winposn{b:cecutil_iwinposn} stack + if exists("b:cecutil_iwinposn") + let jwinposn= b:cecutil_iwinposn + while jwinposn >= 1 " search for a:1 in iwinposn..1 + if exists("b:cecutil_winposn{jwinposn}") " if it exists + if a:1 == b:cecutil_winposn{jwinposn} " and the pattern matches + unlet b:cecutil_winposn{jwinposn} " unlet it + if jwinposn == b:cecutil_iwinposn " if at top-of-stack + let b:cecutil_iwinposn= b:cecutil_iwinposn - 1 " drop stacktop by one + endif + endif + endif + let jwinposn= jwinposn - 1 + endwhile + endif + endif + + " Seems to be something odd: vertical motions after RWP + " cause jump to first column. The following fixes that. + " Note: was using wincol()>1, but with signs, a cursor + " at column 1 yields wincol()==3. Beeping ensued. + let vekeep= &ve + set ve=all + if virtcol('.') > 1 + exe s:modifier."norm! hl" + elseif virtcol(".") < virtcol("$") + exe s:modifier."norm! lh" + endif + let &ve= vekeep + + let &l:so = so_keep + let &l:siso = siso_keep + let &l:ss = ss_keep + +" echomsg "Decho: RestoreWinPosn" +endfun + +" --------------------------------------------------------------------- +" s:WinLineRestore: {{{2 +fun! s:WinLineRestore(swwline) +" echomsg "Decho: s:WinLineRestore(swwline=".a:swwline.")" + while winline() < a:swwline + let curwinline= winline() + exe s:modifier."norm! \" + if curwinline == winline() + break + endif + endwhile +" echomsg "Decho: s:WinLineRestore" +endfun + +" --------------------------------------------------------------------- +" GoWinbufnr: go to window holding given buffer (by number) {{{2 +" Prefers current window; if its buffer number doesn't match, +" then will try from topleft to bottom right +fun! GoWinbufnr(bufnum) +" call Dfunc("GoWinbufnr(".a:bufnum.")") + if winbufnr(0) == a:bufnum +" call Dret("GoWinbufnr : winbufnr(0)==a:bufnum") + return + endif + winc t + let first=1 + while winbufnr(0) != a:bufnum && (first || winnr() != 1) + winc w + let first= 0 + endwhile +" call Dret("GoWinbufnr") +endfun + +" --------------------------------------------------------------------- +" SaveMark: sets up a string saving a mark position. {{{2 +" For example, SaveMark("a") +" Also sets up a global variable, g:savemark_{markname} +fun! SaveMark(markname) +" call Dfunc("SaveMark(markname<".a:markname.">)") + let markname= a:markname + if strpart(markname,0,1) !~ '\a' + let markname= strpart(markname,1,1) + endif +" call Decho("markname=".markname) + + let lzkeep = &lz + set lz + + if 1 <= line("'".markname) && line("'".markname) <= line("$") + let winposn = SaveWinPosn(0) + exe s:modifier."norm! `".markname + let savemark = SaveWinPosn(0) + let g:savemark_{markname} = savemark + let savemark = markname.savemark + call RestoreWinPosn(winposn) + else + let g:savemark_{markname} = "" + let savemark = "" + endif + + let &lz= lzkeep + +" call Dret("SaveMark : savemark<".savemark.">") + return savemark +endfun + +" --------------------------------------------------------------------- +" RestoreMark: {{{2 +" call RestoreMark("a") -or- call RestoreMark(savemark) +fun! RestoreMark(markname) +" call Dfunc("RestoreMark(markname<".a:markname.">)") + + if strlen(a:markname) <= 0 +" call Dret("RestoreMark : no such mark") + return + endif + let markname= strpart(a:markname,0,1) + if markname !~ '\a' + " handles 'a -> a styles + let markname= strpart(a:markname,1,1) + endif +" call Decho("markname=".markname." strlen(a:markname)=".strlen(a:markname)) + + let lzkeep = &lz + set lz + let winposn = SaveWinPosn(0) + + if strlen(a:markname) <= 2 + if exists("g:savemark_{markname}") && strlen(g:savemark_{markname}) != 0 + " use global variable g:savemark_{markname} +" call Decho("use savemark list") + call RestoreWinPosn(g:savemark_{markname}) + exe "norm! m".markname + endif + else + " markname is a savemark command (string) +" call Decho("use savemark command") + let markcmd= strpart(a:markname,1) + call RestoreWinPosn(markcmd) + exe "norm! m".markname + endif + + call RestoreWinPosn(winposn) + let &lz = lzkeep + +" call Dret("RestoreMark") +endfun + +" --------------------------------------------------------------------- +" DestroyMark: {{{2 +" call DestroyMark("a") -- destroys mark +fun! DestroyMark(markname) +" call Dfunc("DestroyMark(markname<".a:markname.">)") + + " save options and set to standard values + let reportkeep= &report + let lzkeep = &lz + set lz report=10000 + + let markname= strpart(a:markname,0,1) + if markname !~ '\a' + " handles 'a -> a styles + let markname= strpart(a:markname,1,1) + endif +" call Decho("markname=".markname) + + let curmod = &mod + let winposn = SaveWinPosn(0) + 1 + let lineone = getline(".") + exe "k".markname + d + put! =lineone + let &mod = curmod + call RestoreWinPosn(winposn) + + " restore options to user settings + let &report = reportkeep + let &lz = lzkeep + +" call Dret("DestroyMark") +endfun + +" --------------------------------------------------------------------- +" QArgSplitter: to avoid \ processing by , is needed. {{{2 +" However, doesn't split at all, so this one returns a list +" with splits at all whitespace (only!), plus a leading length-of-list. +" The resulting list: qarglist[0] corresponds to a:0 +" qarglist[i] corresponds to a:{i} +fun! QArgSplitter(qarg) +" call Dfunc("QArgSplitter(qarg<".a:qarg.">)") + let qarglist = split(a:qarg) + let qarglistlen = len(qarglist) + let qarglist = insert(qarglist,qarglistlen) +" call Dret("QArgSplitter ".string(qarglist)) + return qarglist +endfun + +" --------------------------------------------------------------------- +" ListWinPosn: {{{2 +"fun! ListWinPosn() " Decho +" if !exists("b:cecutil_iwinposn") || b:cecutil_iwinposn == 0 " Decho +" call Decho("nothing on SWP stack") " Decho +" else " Decho +" let jwinposn= b:cecutil_iwinposn " Decho +" while jwinposn >= 1 " Decho +" if exists("b:cecutil_winposn{jwinposn}") " Decho +" call Decho("winposn{".jwinposn."}<".b:cecutil_winposn{jwinposn}.">") " Decho +" else " Decho +" call Decho("winposn{".jwinposn."} -- doesn't exist") " Decho +" endif " Decho +" let jwinposn= jwinposn - 1 " Decho +" endwhile " Decho +" endif " Decho +"endfun " Decho +"com! -nargs=0 LWP call ListWinPosn() " Decho + +" --------------------------------------------------------------------- +" SaveUserMaps: this function sets up a script-variable (s:restoremap) {{{2 +" which can be used to restore user maps later with +" call RestoreUserMaps() +" +" mapmode - see :help maparg for details (n v o i c l "") +" ex. "n" = Normal +" The letters "b" and "u" are optional prefixes; +" The "u" means that the map will also be unmapped +" The "b" means that the map has a qualifier +" ex. "un" = Normal + unmapping +" ex. "bn" = Normal + +" ex. "bun" = Normal + + unmapping +" ex. "ubn" = Normal + + unmapping +" maplead - see mapchx +" mapchx - "" handled as a single map item. +" ex. "" +" - "string" a string of single letters which are actually +" multiple two-letter maps (using the maplead: +" maplead . each_character_in_string) +" ex. maplead="\" and mapchx="abc" saves user mappings for +" \a, \b, and \c +" Of course, if maplead is "", then for mapchx="abc", +" mappings for a, b, and c are saved. +" - :something handled as a single map item, w/o the ":" +" ex. mapchx= ":abc" will save a mapping for "abc" +" suffix - a string unique to your plugin +" ex. suffix= "DrawIt" +fun! SaveUserMaps(mapmode,maplead,mapchx,suffix) +" call Dfunc("SaveUserMaps(mapmode<".a:mapmode."> maplead<".a:maplead."> mapchx<".a:mapchx."> suffix<".a:suffix.">)") + + if !exists("s:restoremap_{a:suffix}") + " initialize restoremap_suffix to null string + let s:restoremap_{a:suffix}= "" + endif + + " set up dounmap: if 1, then save and unmap (a:mapmode leads with a "u") + " if 0, save only + let mapmode = a:mapmode + let dounmap = 0 + let dobuffer = "" + while mapmode =~ '^[bu]' + if mapmode =~ '^u' + let dounmap = 1 + let mapmode = strpart(a:mapmode,1) + elseif mapmode =~ '^b' + let dobuffer = " " + let mapmode = strpart(a:mapmode,1) + endif + endwhile +" call Decho("dounmap=".dounmap." dobuffer<".dobuffer.">") + + " save single map :...something... + if strpart(a:mapchx,0,1) == ':' +" call Decho("save single map :...something...") + let amap= strpart(a:mapchx,1) + if amap == "|" || amap == "\" + let amap= "\".amap + endif + let amap = a:maplead.amap + let s:restoremap_{a:suffix} = s:restoremap_{a:suffix}."|:silent! ".mapmode."unmap ".dobuffer.amap + if maparg(amap,mapmode) != "" + let maprhs = substitute(maparg(amap,mapmode),'|','','ge') + let s:restoremap_{a:suffix} = s:restoremap_{a:suffix}."|:".mapmode."map ".dobuffer.amap." ".maprhs + endif + if dounmap + exe "silent! ".mapmode."unmap ".dobuffer.amap + endif + + " save single map + elseif strpart(a:mapchx,0,1) == '<' +" call Decho("save single map ") + let amap = a:mapchx + if amap == "|" || amap == "\" + let amap= "\".amap +" call Decho("amap[[".amap."]]") + endif + let s:restoremap_{a:suffix} = s:restoremap_{a:suffix}."|silent! ".mapmode."unmap ".dobuffer.amap + if maparg(a:mapchx,mapmode) != "" + let maprhs = substitute(maparg(amap,mapmode),'|','','ge') + let s:restoremap_{a:suffix} = s:restoremap_{a:suffix}."|".mapmode."map ".dobuffer.amap." ".maprhs + endif + if dounmap + exe "silent! ".mapmode."unmap ".dobuffer.amap + endif + + " save multiple maps + else +" call Decho("save multiple maps") + let i= 1 + while i <= strlen(a:mapchx) + let amap= a:maplead.strpart(a:mapchx,i-1,1) + if amap == "|" || amap == "\" + let amap= "\".amap + endif + let s:restoremap_{a:suffix} = s:restoremap_{a:suffix}."|silent! ".mapmode."unmap ".dobuffer.amap + if maparg(amap,mapmode) != "" + let maprhs = substitute(maparg(amap,mapmode),'|','','ge') + let s:restoremap_{a:suffix} = s:restoremap_{a:suffix}."|".mapmode."map ".dobuffer.amap." ".maprhs + endif + if dounmap + exe "silent! ".mapmode."unmap ".dobuffer.amap + endif + let i= i + 1 + endwhile + endif +" call Dret("SaveUserMaps : restoremap_".a:suffix.": ".s:restoremap_{a:suffix}) +endfun + +" --------------------------------------------------------------------- +" RestoreUserMaps: {{{2 +" Used to restore user maps saved by SaveUserMaps() +fun! RestoreUserMaps(suffix) +" call Dfunc("RestoreUserMaps(suffix<".a:suffix.">)") + if exists("s:restoremap_{a:suffix}") + let s:restoremap_{a:suffix}= substitute(s:restoremap_{a:suffix},'|\s*$','','e') + if s:restoremap_{a:suffix} != "" +" call Decho("exe ".s:restoremap_{a:suffix}) + exe "silent! ".s:restoremap_{a:suffix} + endif + unlet s:restoremap_{a:suffix} + endif +" call Dret("RestoreUserMaps") +endfun + +" ============== +" Restore: {{{1 +" ============== +let &cpo= s:keepcpo +unlet s:keepcpo + +" ================ +" Modelines: {{{1 +" ================ +" vim: ts=4 fdm=marker diff --git a/.vim/snippets/markdown.snippets b/.vim/snippets/markdown.snippets new file mode 100644 index 0000000..7388bf1 --- /dev/null +++ b/.vim/snippets/markdown.snippets @@ -0,0 +1,43 @@ +# [link][] +snippet [] + [${1:link_id}][]${2} +# [link][id] +snippet [[ + [${1:link}][${2:id}]${3} +# [link](url) +snippet [( + [${1:link}](http://${2:url})${3} +# [link](email) +snippet [@ + [${1:link}(mailto:${2:email})${3} +# [link](url "title") +snippet [(" + [${1:link}](${2:url} "${3:title}")${4} +# [id]: url "title" +snippet [: + [${1:id}]: http://${2:url} "${3:title}" +# [id]: email "title" +snippet [:@ + [${1:id}]: mailto:${2:url} "${3:title}" +# ![alt][id] +snippet ![ + ![${1:alt}][${2:id}]${3} +# ![alt](url) +snippet !( + ![${1:alt}](${2:url})${3} +# ![alt](url "title") +snippet !(" + ![${1:alt}](${2:url} "${3:title}")${4} +# *emphasis* or _emphasis_ +snippet * + *${1}*${2} +snippet _ + _${1}_${2} +# **strong** or __strong__ +snippet ** + **${1}**${2} +snippet __ + __${1}__${2} +# `code` +snippet ` + \`${1}\`${2} diff --git a/.vim/spell/en.utf-8.add b/.vim/spell/en.utf-8.add new file mode 100644 index 0000000..7f843d2 --- /dev/null +++ b/.vim/spell/en.utf-8.add @@ -0,0 +1,8 @@ +asdf +repo +metadata +namespaces +hostnames +namespace +synecdoche +wikis diff --git a/.vim/spell/en.utf-8.add.spl b/.vim/spell/en.utf-8.add.spl new file mode 100644 index 0000000..204fdcd Binary files /dev/null and b/.vim/spell/en.utf-8.add.spl differ diff --git a/.vim/view/.gitignore b/.vim/view/.gitignore new file mode 100644 index 0000000..d6b7ef3 --- /dev/null +++ b/.vim/view/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore diff --git a/.vimrc b/.vimrc new file mode 100644 index 0000000..9c1dd53 --- /dev/null +++ b/.vimrc @@ -0,0 +1,674 @@ +" ============================================================================== +" clear all inherited settings +" ============================================================================== + +set all& +set nocompatible + + +" ============================================================================== +" Pathogen (initial setup) +" ============================================================================== + +" settings + +let g:pathogen_disabled = ['bufexplorer', 'neocomplcache',] +if v:version < 702 + let g:pathogen_disabled += ['tagbar', 'neocomplcache',] +endif +if v:version < 703 || !has('python') + let g:pathogen_disabled += ['jedi-vim', 'gundo'] +endif + +" bring in Pathogen + +runtime bundle/pathogen/autoload/pathogen.vim +if exists("g:loaded_pathogen") + execute pathogen#infect() + execute pathogen#helptags() +endif + +" fix up rtp a bit to exclude rusty old default scripts if they exist + +if exists("g:loaded_pathogen") + let list = [] + for dir in pathogen#split(&rtp) + if dir !~# '/usr/share/vim/vimfiles' + call add(list, dir) + endif + endfor + let &rtp = pathogen#join(list) +endif + +" ============================================================================== +" general settings +" ============================================================================== + +set encoding=utf-8 fileencoding=utf-8 termencoding=utf-8 +set shortmess+=I +set completeopt+=preview,menu +if exists('+cryptmethod') + set cryptmethod=blowfish +endif +let mapleader = "," +"set digraph +set modeline +set gdefault +set magic +set showmode +set showcmd +set showmatch +set history=5000 +set notitle +set ttyfast +set titlestring=%f title +"set ttyscroll=0 +set scrolloff=3 +set sidescrolloff=5 +set nostartofline +set backup +set writebackup +set backupdir=~/.vim/local/backup// +set directory=~/.vim/local/swap// +set backspace=indent,eol,start +set splitbelow +set splitright +set switchbuf=useopen,usetab +set viminfo^=% +"filetype plugin indent on +"set spell +set winminheight=0 +if exists('+relativenumber') + set relativenumber +endif +set updatetime=500 + + +" ============================================================================== +" appearance +" ============================================================================== + +syntax enable +set t_Co=256 +set background=dark +colorscheme tomorrow-night-eighties +set cursorline +"set cursorcolumn +"if exists('+colorcolumn') | set colorcolumn+=80,120 | endif +if exists('+colorcolumn') + let &colorcolumn=join(range(81,999), ',') +endif + +set list +set listchars+=tab:▸\ " +set listchars+=trail:· +set listchars+=nbsp:␣ +set listchars+=extends:› +set listchars+=precedes:‹ +set listchars+=eol:\ " + +set fillchars+=stl:\ +set fillchars+=stlnc:\ +set fillchars+=fold:\ +set fillchars+=diff:\ +set fillchars+=vert:\ + +"set showbreak=→ + +" gui +if has('gui_running') + set linespace=1 + set guifont=Inconsolata:h13 + if has('transparency') + set transparency=0 + endif +endif + +" Use a bar-shaped cursor for insert mode, even through tmux. + +if exists('$TMUX') + let &t_SI = "\Ptmux;\\]50;CursorShape=1\x7\\\" + let &t_EI = "\Ptmux;\\]50;CursorShape=0\x7\\\" +else + let &t_SI = "\]50;CursorShape=1\x7" + let &t_EI = "\]50;CursorShape=0\x7" +endif + + +" ============================================================================== +" custom highlights +" ============================================================================== + +hi LineNr ctermbg=234 guibg=#222222 cterm=bold gui=bold +hi SignColumn ctermbg=234 guibg=#222222 cterm=bold gui=bold +hi CursorLineNr ctermbg=234 guibg=#222222 cterm=bold gui=bold +hi CursorLine ctermbg=234 guibg=#222222 +hi ColorColumn ctermbg=234 guibg=#222222 + + +" ============================================================================== +" formatting +" ============================================================================== + +set nowrap +set whichwrap+=<>[] +set textwidth=80 +set formatoptions=qrn1 +set lbr +set smartindent +filetype indent on +set virtualedit+=block,onemore + + +" ============================================================================== +" clipboard +" ============================================================================== + +set clipboard=unnamed,unnamedplus + + +" ============================================================================== +" undo +" ============================================================================== + +if has('persistent_undo') + set undodir=~/.vim/local/undo/ + set undofile + set undolevels=1000 + if exists('+undoreload') + set undoreload=10000 + endif +endif + + +" ============================================================================== +" folding +" ============================================================================== + +set foldenable +set foldmethod=manual +set foldlevel=100 " Don't autofold anything + +function! MyFoldText() " {{{ + let line = getline(v:foldstart) + + let nucolwidth = &fdc + &number * &numberwidth + let windowwidth = winwidth(0) - nucolwidth - 3 + let foldedlinecount = v:foldend - v:foldstart + + " expand tabs into spaces + let onetab = strpart(' ', 0, &tabstop) + let line = substitute(line, '\t', onetab, 'g') + + let line = strpart(line, 0, windowwidth - 2 -len(foldedlinecount)) + let fillcharcount = windowwidth - len(line) - len(foldedlinecount) + return line . '…' . repeat(" ",fillcharcount) . foldedlinecount . '…' . ' ' +endfunction " }}} +set foldtext=MyFoldText() + + +" ============================================================================== +" searching +" ============================================================================== + +nnoremap / /\v +vnoremap / /\v +set ignorecase +set smartcase +set gdefault +set incsearch +set showmatch +set hlsearch +nnoremap :noh +nnoremap % +vnoremap % + + +" ============================================================================== +" spelling +" ============================================================================== + +"set spell +set spelllang=en_us + + +" ============================================================================== +" menu (for command tab-complete) +" ============================================================================== + +set wildmenu +set wildmode=list:longest +set wildignore+=*.o,*.obj,.git,*.rbc,*.class,.svn,vendor/gems/*,*.bak,*.exe +set wildignore+=*.pyc,*.DS_Store,*.db + + +" ============================================================================== +" status bar +" ============================================================================== + +if has('statusline') + set laststatus=2 + set statusline=%<%f\ " Filename + set statusline+=%w%h%m%r " Options + set statusline+=%{fugitive#statusline()} " Git Hotness + set statusline+=\ [%{&ff}/%Y] " filetype + set statusline+=\ [%{getcwd()}] " current dir + set statusline+=%=%-14.(%l,%c%V%)\ %p%% " Right aligned file nav info +endif + + +" ============================================================================== +" ruler +" ============================================================================== + +if has('cmdline_info') + set ruler " show the ruler + set rulerformat=%30(%=\:b%n%y%m%r%w\ %l,%c%V\ %P%) " a ruler on steroids + set showcmd " show partial commands in status line and selected characters/lines in visual mode +endif + + +" ============================================================================== +" mouse +" ============================================================================== + +if has('mouse') + set mouse=a + set mousemodel=popup_setpos +endif + + +" ============================================================================== +" Shell +" ============================================================================== + +function! s:ExecuteInShell(command) " {{{ + let command = join(map(split(a:command), 'expand(v:val)')) + let winnr = bufwinnr('^' . command . '$') + silent! execute winnr < 0 ? 'botright new ' . fnameescape(command) : winnr . 'wincmd w' + setlocal buftype=nowrite bufhidden=wipe nobuflisted noswapfile nowrap nonumber + echo 'Execute ' . command . '...' + silent! execute 'silent %!'. command + silent! redraw + silent! execute 'au BufUnload execute bufwinnr(' . bufnr('#') . ') . ''wincmd w''' + silent! execute 'nnoremap r :call ExecuteInShell(''' . command . '''):AnsiEsc' + silent! execute 'nnoremap q :q' + silent! execute 'AnsiEsc' + echo 'Shell command ' . command . ' executed.' +endfunction " }}} +command! -complete=shellcmd -nargs=+ Shell call s:ExecuteInShell() +nnoremap ! :Shell + + +" ============================================================================== +" keyboard mappings +" ============================================================================== + +" Wrapped lines goes down/up to next row, rather than next line in file. +noremap gk +noremap gj +noremap k gk +noremap j gj +inoremap gj +inoremap gk + +" retain selection when changing indent level +vnoremap < >gv + +" easier to enter ex commands +nnoremap ; : +vnoremap ; : + +" folding (if enabled) +nnoremap @=(foldlevel('.')?'za':'l') +vnoremap zf + +" clean trailing whitespace +nnoremap W :%s/\s\+$//:let @/='' + +" wrap a paragraph +vnoremap Q gq +nnoremap Q gqap + +" reselect what was just pasted +nnoremap v V`] + +" quickly open .vimrc as split window +nnoremap ev :exec 'vsplit ' . resolve(expand($MYVIMRC)) + +" toggle special characters +nmap l :set invlist! + +" Prev/Next Buffer +nmap :bn +nmap :bp + +" switch splits more easily +nnoremap h +nnoremap j +nnoremap k +nnoremap l + +" move lines with leader-{j,k}, indent with leader-{h,l} + +nnoremap k :m-2== +nnoremap j :m+== +nnoremap h << +nnoremap l >> + +inoremap j :m+==gi +inoremap k :m-2==gi +inoremap h <<`]a +inoremap l >>`]a + +vnoremap j :m'>+gv=gv +vnoremap k :m-2gv=gv +vnoremap h l >gv + +" clear old search +nnoremap / :let @/ = "" + +" display unprintable characters +nnoremap :set list! + +" toggle spellcheck +nnoremap :set spell! + +" toggle paste mode +nnoremap :set invpaste! +set pastetoggle= + +" Locally (local to block) rename a variable +function! Refactor() + call inputsave() + let @z=input("What do you want to rename '" . @z . "' to? ") + call inputrestore() +endfunction +nnoremap rf "zyiw:call Refactor()mx:silent! norm gd[{V%:s///z/g`x + +" Increment a visual selection (like a column of numbers) +function! Incr() + let a = line('.') - line("'<") + let c = virtcol("'<") + if a > 0 + execute 'normal! '.c.'|'.a."\" + endif + normal `< +endfunction +vnoremap :call Incr() + +" sort CSS +nnoremap S ?{jV/^\s*\}?$k:sort:noh + +" fold HTML tag +noremap ft Vatzf + +" block select with control-click-and-drag +noremap +noremap + + +" ============================================================================== +" auto commands +" ============================================================================== + +if has('autocmd') + " settings immediately take effect + "augroup InstantSettings + " au! + " au BufWritePost ~/.vimrc :exec 'source ' . resolve(expand($MYVIMRC)) + "augroup END + + augroup RedrawOnResize + au! + au VimResized * silent! redraw! + augroup END + + augroup RememberLastView + au! + au BufWinLeave * silent! mkview "make vim save view (state) (folds, cursor, etc) + au BufWinEnter * silent! loadview "make vim load view (state) (folds, cursor, etc) + augroup END + + "augroup AlwaysRelative + "au! + "au BufEnter * + "\ if exists('+relativenumber') | + "\ silent! setl relativenumber | + "\ endif + "augroup END +endif + + +" ============================================================================== +" RTK +" ============================================================================== + +if filereadable('/usr/local/etc/vimrc_files/reasonably_stable_mappings.vim') + source /usr/local/etc/vimrc_files/reasonably_stable_mappings.vim +endif + +if has('autocmd') && filereadable(expand("$HOME/bin/touch_handler_cgis")) + augroup TouchHandlerScript + au! + au BufWritePost * + \ let output = system(expand("$HOME/bin/touch_handler_cgis")) + augroup END +endif + +" workarounds +au! BufEnter * +let $TEST_DB=1 + +function! s:SwitchToFromTest() " {{{ + let currentfilename = expand("%:t") + let pathtocurrentfile = expand("%:p:h") + let endofpath = fnamemodify(pathtocurrentfile, ":t") + + if endofpath == "TEST" + let filename = fnamemodify(pathtocurrentfile, ":h") . "/" . currentfilename + else + let filename = pathtocurrentfile . "/TEST/" . currentfilename + endif + + silent! execute "e " . filename + echo "Switched to " . filename +endfunction " }}} +command! SwitchToFromTest call s:SwitchToFromTest() +nnoremap gt :SwitchToFromTest + + +" ============================================================================== +" NERDTree settings +" ============================================================================== + +noremap :NERDTreeTabsToggle +noremap :NERDTreeTabsToggle +"noremap e :NERDTreeFind +"noremap nt :NERDTreeFind + +let NERDTreeMinimalUI = 1 +let NERDTreeDirArrows = 1 +let NERDTreeHijackNetrw=1 +let NERDTreeShowBookmarks=1 +let NERDTreeIgnore=['\.pyc', '\~$', '\.swo$', '\.swp$', '\.git', '\.hg', '\.svn', '\.bzr'] +let NERDTreeChDirMode=0 +let NERDTreeQuitOnOpen=0 +let NERDTreeMouseMode=3 +let NERDTreeShowHidden=1 +let NERDTreeKeepTreeInNewTab=1 +let g:nerdtree_tabs_open_on_gui_startup=0 + +if has('autocmd') + augroup CloseNERDTreeIfLastWindow + autocmd! + autocmd BufEnter * + \ if winnr("$") == 1 | + \ if exists("b:NERDTreeType") | + \ if b:NERDTreeType == "primary" | + \ quit | + \ endif | + \ endif | + \ endif | + augroup END + + " returns true iff is NERDTree open/active + function! rc:isNTOpen() + return exists("t:NERDTreeBufName") && (bufwinnr(t:NERDTreeBufName) != -1) + endfunction + + " returns true iff focused window is NERDTree window + function! rc:isNTFocused() + return -1 != match(expand('%'), 'NERD_Tree') + endfunction + + " calls NERDTreeFind iff NERDTree is active, current window contains a modifiable file, and we're not in vimdiff + function! rc:syncTree() + if &modifiable && rc:isNTOpen() && !rc:isNTFocused() && strlen(expand('%')) > 0 && !&diff + NERDTreeFind + wincmd p + endif + endfunction + + augroup SyncNERDTree + au! + au BufEnter * call rc:syncTree() + augroup END +endif + + +" ============================================================================== +" CtrlP settings +" ============================================================================== + +noremap o :CtrlPMixed +noremap p :CtrlP +noremap b :CtrlPBuffer +noremap u :CtrlPUndo +noremap T :CtrlPTag +noremap t :CtrlPBufTagAll +noremap m :CtrlPMRUFiles + +let g:ctrlp_regexp = 1 +let g:ctrlp_max_files = 50000 + +" ============================================================================== +" TagBar settings +" ============================================================================== + +noremap :TagbarToggle +noremap :TagbarToggle + +if filereadable(expand('~/.local/bin/ctags')) + let g:tagbar_ctags_bin = expand('~/.local/bin/ctags') +endif +let g:tagbar_autoclose = 0 +let g:tagbar_singleclick = 1 +let g:tagbar_iconchars = ['+','-'] + + +" ============================================================================== +" Jedi-vim settings +" ============================================================================== + +let g:jedi#squelch_py_warning = 1 + + +" ============================================================================== +" Tabular +" ============================================================================== + +nnoremap aa :Tabularize argument_list +vnoremap aa :Tabularize argument_list + +nnoremap a :Tabularize / / +vnoremap a :Tabularize / / + +nnoremap a& :Tabularize /& +vnoremap a& :Tabularize /& + +nnoremap a= :Tabularize /= +vnoremap a= :Tabularize /= + +nnoremap a: :Tabularize /: +vnoremap a: :Tabularize /: + +nnoremap a:: :Tabularize /:\zs +vnoremap a:: :Tabularize /:\zs + +nnoremap a, :Tabularize /, +vnoremap a, :Tabularize /, + +nnoremap a,, :Tabularize /,\zs +vnoremap a,, :Tabularize /,\zs + +nnoremap a :Tabularize / +vnoremap a :Tabularize / + + +" ============================================================================== +" NeoComplCache settings +" ============================================================================== + +"let g:neocomplcache_enable_at_startup = 0 +" Use smartcase. +"let g:neocomplcache_enable_smart_case = 1 +"" Use camel case completion. +"let g:neocomplcache_enable_camel_case_completion = 1 +"" Use underscore completion. +"let g:neocomplcache_enable_underbar_completion = 1 +"" Sets minimum char length of syntax keyword. +"let g:neocomplcache_min_syntax_length = 3 + +"" Enable omni completion +"autocmd FileType css setlocal omnifunc=csscomplete#CompleteCSS +"autocmd FileType html,markdown setlocal omnifunc=htmlcomplete#CompleteTags +"autocmd FileType javascript setlocal omnifunc=javascriptcomplete#CompleteJS +"autocmd FileType python setlocal omnifunc=pythoncomplete#Complete +"autocmd FileType perl setlocal omnifunc=perlcomplete#Complete +"autocmd FileType xml setlocal omnifunc=xmlcomplete#CompleteTags + + +" ============================================================================== +" Solarized settings +" ============================================================================== + +"let g:solarized_termcolors = 256 +let g:solarized_style = "dark" + + +" ============================================================================== +" Syntastic settings +" ============================================================================== + +let g:syntastic_error_symbol='✗' +let g:syntastic_warning_symbol='⚠' +"let g:syntastic_python_checker_args='--ignore=E501' +let syntastic_python_flake8_args='--ignore=E501' +let g:syntastic_auto_loc_list=1 +let g:syntastic_loc_list_height=5 + +let g:syntastic_mode_map = { 'mode': 'active', + \ 'active_filetypes': [], + \ 'passive_filetypes': ['perl'] } + +" ============================================================================== +" SuperTab settings +" ============================================================================== + +let g:SuperTabCompletionContexts = ['s:ContextText', 's:ContextDiscover'] +let g:SuperTabContextTextOmniPrecedence = ['&omnifunc', '&completefunc'] +let g:SuperTabContextDiscoverDiscovery = + \ ["&omnifunc:", "&completefunc:",] +let g:SuperTabDefaultCompletionType = "context" + + +" ============================================================================== +" Ack settings +" ============================================================================== + +nnoremap a :Ack +nnoremap * :Ack! '\b\b' " ack word under cursor +cnoreabbrev ack ((getcmdtype() is# ':' && getcmdline() is# 'ack')?('Ack'):('ack'))