1
0
Fork 0
mirror of synced 2024-09-08 15:29:03 -04:00

Updated plugins

This commit is contained in:
amix 2017-09-02 12:43:18 +02:00
parent 3be3af28e5
commit 7fc202ec88
64 changed files with 1659 additions and 525 deletions

View file

@ -1006,7 +1006,9 @@ fu! s:KeyLoop()
wh exists('s:init') && s:keyloop
try
set t_ve=
set guicursor=a:NONE
if guicursor != ''
set guicursor=a:NONE
en
let nr = getchar()
fina
let &t_ve = t_ve
@ -2009,7 +2011,7 @@ fu! s:bufnrfilpath(line)
if (a:line =~ '[\/]\?\[\d\+\*No Name\]$')
let bufnr = str2nr(matchstr(a:line, '[\/]\?\[\zs\d\+\ze\*No Name\]$'))
let filpath = bufnr
else
els
let bufnr = bufnr(a:line)
retu [bufnr, a:line]
en
@ -2414,7 +2416,7 @@ fu! s:buildpat(lst)
let c = a:lst[item - 1]
let pat .= (c == '/' ? '[^/]\{-}' : '[^'.c.'/]\{-}').a:lst[item]
endfo
else
els
for item in range(1, len(a:lst) - 1)
let pat .= '[^'.a:lst[item - 1].']\{-}'.a:lst[item]
endfo

View file

@ -638,7 +638,6 @@ Set this to 1 to save every MRU file path $HOME/$filepath in the $HOME dir
let g:ctrlp_tilde_homedir = 0
<
Note: This applies also to all dir paths stored by :CtrlPBookmarkDirAdd!
<
*'g:ctrlp_mruf_relative'*
Set this to 1 to show only MRU files in the current working directory: >
@ -873,12 +872,12 @@ COMMANDS *ctrlp-commands*
*:CtrlPCurFile*
:CtrlPCurFile
This acts like |:CtrlP| with |g:ctrlp_working_path_mode| = '' and ignores
This acts like |:CtrlP| with |g:ctrlp_working_path_mode| = 'c' and ignores
the variable's current value.
*:CtrlPCurWD*
:CtrlPCurWD
This acts like |:CtrlP| with |g:ctrlp_working_path_mode| = '' and ignores
This acts like |:CtrlP| with |g:ctrlp_working_path_mode| = 'd' and ignores
the variable's current value.
*:CtrlPMRU*

View file

@ -65,8 +65,8 @@ Features
--------
* Lots of style-customization options (contrast, color invertion, italics usage etc.)
* Extended filetype highlighting: Html, Xml, Vim (and ES6 with [yajs.vim](https://github.com/othree/yajs.vim)), Clojure, C, Python, JavaScript, CoffeeScript, Ruby, Objective-C, Go, Lua, MoonScript, Java, Markdown, Haskell
* Supported plugins: [EasyMotion][], [vim-sneak][], [Indent Guides][], [indentLine][], [Rainbow Parentheses][], [Airline][], [Lightline][], [GitGutter][], [Signify][], [ShowMarks][], [Signature][], [Syntastic][], [CtrlP][], [Startify][]
* Extended filetype highlighting: Html, Xml, Vim, Clojure, C, Python, JavaScript, TypeScript, PureScript, CoffeeScript, Ruby, Objective-C, Go, Lua, MoonScript, Java, Markdown, Haskell, Elixir
* Supported plugins: [EasyMotion][], [vim-sneak][], [Indent Guides][], [indentLine][], [Rainbow Parentheses][], [Airline][], [Lightline][], [GitGutter][], [Signify][], [ShowMarks][], [Signature][], [Syntastic][], [Ale][], [CtrlP][], [Startify][], [NERDTree][], [Dirvish][]
[EasyMotion]: https://github.com/Lokaltog/vim-easymotion
[vim-sneak]: https://github.com/justinmk/vim-sneak
@ -80,8 +80,11 @@ Features
[ShowMarks]: http://www.vim.org/scripts/script.php?script_id=152
[Signature]: https://github.com/kshenoy/vim-signature
[Syntastic]: https://github.com/scrooloose/syntastic
[Ale]: https://github.com/w0rp/ale
[CtrlP]: https://github.com/kien/ctrlp.vim
[Startify]: https://github.com/mhinz/vim-startify
[NERDTree]: https://github.com/scrooloose/nerdtree
[Dirvish]: https://github.com/justinmk/vim-dirvish
Contributions
-------------
@ -93,8 +96,8 @@ See [gruvbox-contrib][] repo for contributions, ports and extras.
ToDo
----
* Filetype syntax highlighting (R, TeX, Swift, Erlang, Purescript and I'm still dissatisfied with CSS)
* Plugin support (MiniBufExplorer, Tagbar, Netrw, VimPLug)
* Filetype syntax highlighting (R, TeX, Swift, Erlang)
* Plugin support (Tagbar, VimPlug)
Self-Promotion
--------------

View file

@ -3,7 +3,7 @@
" Description: Retro groove color scheme for Airline
" Author: morhetz <morhetz@gmail.com>
" Source: https://github.com/morhetz/gruvbox
" Last Modified: 22 Aug 2014
" Last Modified: 12 Aug 2017
" -----------------------------------------------------------------------------
let g:airline#themes#gruvbox#palette = {}
@ -17,7 +17,7 @@ function! airline#themes#gruvbox#refresh()
let error_group = airline#themes#get_highlight2(['Normal', 'bg'], ['WarningMsg', 'fg'])
let s:N1 = airline#themes#get_highlight2(['Normal', 'bg'], ['StatusLineNC', 'bg'])
let s:N2 = airline#themes#get_highlight2(['StatusLineNC', 'bg'], ['StatusLineNC', 'fg'])
let s:N2 = airline#themes#get_highlight2(['StatusLineNC', 'bg'], ['Pmenu', 'bg'])
let s:N3 = airline#themes#get_highlight2(['StatusLineNC', 'bg'], ['CursorLine', 'bg'])
let g:airline#themes#gruvbox#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
let g:airline#themes#gruvbox#palette.normal_modified = { 'airline_c': modified_group }
@ -28,7 +28,7 @@ function! airline#themes#gruvbox#refresh()
let s:I1 = airline#themes#get_highlight2(['Normal', 'bg'], ['Identifier', 'fg'])
let s:I2 = s:N2
let s:I3 = airline#themes#get_highlight2(['Normal', 'fg'], ['StatusLineNC', 'fg'])
let s:I3 = airline#themes#get_highlight2(['Normal', 'fg'], ['Pmenu', 'bg'])
let g:airline#themes#gruvbox#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3)
let g:airline#themes#gruvbox#palette.insert_modified = g:airline#themes#gruvbox#palette.normal_modified
let g:airline#themes#gruvbox#palette.insert.airline_warning = g:airline#themes#gruvbox#palette.normal.airline_warning
@ -46,7 +46,7 @@ function! airline#themes#gruvbox#refresh()
let g:airline#themes#gruvbox#palette.replace.airline_error = g:airline#themes#gruvbox#palette.normal.airline_error
let g:airline#themes#gruvbox#palette.replace_modified.airline_error = g:airline#themes#gruvbox#palette.normal_modified.airline_error
let s:V1 = airline#themes#get_highlight2(['Normal', 'bg'], ['ModeMsg', 'fg'])
let s:V1 = airline#themes#get_highlight2(['Normal', 'bg'], ['Question', 'fg'])
let s:V2 = s:N2
let s:V3 = airline#themes#get_highlight2(['Normal', 'bg'], ['TabLine', 'fg'])
let g:airline#themes#gruvbox#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3)

View file

@ -25,8 +25,9 @@ if exists('g:lightline')
let s:blue = s:getGruvColor('GruvboxBlue')
let s:aqua = s:getGruvColor('GruvboxAqua')
let s:orange = s:getGruvColor('GruvboxOrange')
let s:green = s:getGruvColor('GruvboxGreen')
let s:p = {'normal':{}, 'inactive':{}, 'insert':{}, 'replace':{}, 'visual':{}, 'tabline':{}}
let s:p = {'normal':{}, 'inactive':{}, 'insert':{}, 'replace':{}, 'visual':{}, 'tabline':{}, 'terminal':{}}
let s:p.normal.left = [ [ s:bg0, s:fg4 ], [ s:fg4, s:bg2 ] ]
let s:p.normal.right = [ [ s:bg0, s:fg4 ], [ s:fg4, s:bg2 ] ]
let s:p.normal.middle = [ [ s:fg4, s:bg1 ] ]
@ -36,6 +37,9 @@ if exists('g:lightline')
let s:p.insert.left = [ [ s:bg0, s:blue ], [ s:fg1, s:bg2 ] ]
let s:p.insert.right = [ [ s:bg0, s:blue ], [ s:fg1, s:bg2 ] ]
let s:p.insert.middle = [ [ s:fg4, s:bg2 ] ]
let s:p.terminal.left = [ [ s:bg0, s:green ], [ s:fg1, s:bg2 ] ]
let s:p.terminal.right = [ [ s:bg0, s:green ], [ s:fg1, s:bg2 ] ]
let s:p.terminal.middle = [ [ s:fg4, s:bg2 ] ]
let s:p.replace.left = [ [ s:bg0, s:aqua ], [ s:fg1, s:bg2 ] ]
let s:p.replace.right = [ [ s:bg0, s:aqua ], [ s:fg1, s:bg2 ] ]
let s:p.replace.middle = [ [ s:fg4, s:bg2 ] ]

View file

@ -3,7 +3,7 @@
" Description: Retro groove color scheme for Vim
" Author: morhetz <morhetz@gmail.com>
" Source: https://github.com/morhetz/gruvbox
" Last Modified: 04 Sep 2015
" Last Modified: 12 Aug 2017
" -----------------------------------------------------------------------------
" Supporting code -------------------------------------------------------------
@ -18,7 +18,7 @@ endif
let g:colors_name='gruvbox'
if !has('gui_running') && &t_Co != 256
if !(has('termguicolors') && &termguicolors) && !has('gui_running') && &t_Co != 256
finish
endif
@ -269,7 +269,35 @@ let s:gb.aqua = s:aqua
let s:gb.orange = s:orange
" }}}
" Setup Terminal Colors For Neovim: {{{
if has('nvim')
let g:terminal_color_0 = s:bg0[0]
let g:terminal_color_8 = s:gray[0]
let g:terminal_color_1 = s:gb.neutral_red[0]
let g:terminal_color_9 = s:red[0]
let g:terminal_color_2 = s:gb.neutral_green[0]
let g:terminal_color_10 = s:green[0]
let g:terminal_color_3 = s:gb.neutral_yellow[0]
let g:terminal_color_11 = s:yellow[0]
let g:terminal_color_4 = s:gb.neutral_blue[0]
let g:terminal_color_12 = s:blue[0]
let g:terminal_color_5 = s:gb.neutral_purple[0]
let g:terminal_color_13 = s:purple[0]
let g:terminal_color_6 = s:gb.neutral_aqua[0]
let g:terminal_color_14 = s:aqua[0]
let g:terminal_color_7 = s:fg4[0]
let g:terminal_color_15 = s:fg1[0]
endif
" }}}
" Overload Setting: {{{
let s:hls_cursor = s:orange
@ -300,7 +328,7 @@ if exists('g:gruvbox_color_column')
let s:color_column = get(s:gb, g:gruvbox_color_column)
endif
let s:vert_split = s:bg2
let s:vert_split = s:bg0
if exists('g:gruvbox_vert_split')
let s:vert_split = get(s:gb, g:gruvbox_vert_split)
endif
@ -451,9 +479,9 @@ if version >= 700
hi! link CursorColumn CursorLine
" Tab pages line filler
call s:HL('TabLineFill', s:bg4, s:vim_bg, s:invert_tabline)
call s:HL('TabLineFill', s:bg4, s:bg1, s:invert_tabline)
" Active tab page label
call s:HL('TabLineSel', s:vim_bg, s:bg4, s:bold . s:invert_tabline)
call s:HL('TabLineSel', s:green, s:bg1, s:invert_tabline)
" Not active tab page label
hi! link TabLine TabLineFill
@ -483,11 +511,11 @@ call s:HL('IncSearch', s:hls_cursor, s:bg0, s:inverse)
call s:HL('Underlined', s:blue, s:none, s:underline)
call s:HL('StatusLine', s:bg4, s:bg0, s:bold . s:inverse)
call s:HL('StatusLineNC', s:bg2, s:fg4, s:bold . s:inverse)
call s:HL('StatusLine', s:bg2, s:fg1, s:inverse)
call s:HL('StatusLineNC', s:bg1, s:fg4, s:inverse)
" The column separating vertically split windows
call s:HL('VertSplit', s:fg4, s:vert_split)
call s:HL('VertSplit', s:bg3, s:vert_split)
" Current match in wildmenu completion
call s:HL('WildMenu', s:blue, s:bg2, s:bold)
@ -541,7 +569,7 @@ hi! link lCursor Cursor
if g:gruvbox_improved_strings == 0
hi! link Special GruvboxOrange
else
call s:HL('Special', s:bg1, s:orange, s:italic)
call s:HL('Special', s:orange, s:bg1, s:italicize_strings)
endif
call s:HL('Comment', s:gray, s:none, s:italicize_comments)
@ -587,7 +615,7 @@ hi! link Character GruvboxPurple
if g:gruvbox_improved_strings == 0
call s:HL('String', s:green, s:none, s:italicize_strings)
else
call s:HL('String', s:bg1, s:fg1, s:italicize_strings)
call s:HL('String', s:fg1, s:bg1, s:italicize_strings)
endif
" Boolean constant: TRUE, false
hi! link Boolean GruvboxPurple
@ -660,10 +688,8 @@ hi! link EasyMotionShade Comment
" }}}
" Sneak: {{{
hi! link SneakPluginTarget Search
hi! link SneakStreakTarget Search
call s:HL('SneakStreakMask', s:yellow, s:yellow)
hi! link SneakStreakStatusLine Search
autocmd ColorScheme gruvbox hi! link Sneak Search
autocmd ColorScheme gruvbox hi! link SneakLabel Search
" }}}
" Indent Guides: {{{
@ -779,7 +805,7 @@ call s:HL('CtrlPStats', s:fg4, s:bg2, s:bold)
" Startify: {{{
hi! link StartifyBracket GruvboxFg3
hi! link StartifyFile GruvboxFg0
hi! link StartifyFile GruvboxFg1
hi! link StartifyNumber GruvboxBlue
hi! link StartifyPath GruvboxGray
hi! link StartifySlash GruvboxGray
@ -806,6 +832,62 @@ call s:HL('BufTabLineActive', s:fg4, s:bg2)
call s:HL('BufTabLineHidden', s:bg4, s:bg1)
call s:HL('BufTabLineFill', s:bg0, s:bg0)
" }}}
" Asynchronous Lint Engine: {{{
call s:HL('ALEError', s:none, s:none, s:undercurl, s:red)
call s:HL('ALEWarning', s:none, s:none, s:undercurl, s:yellow)
call s:HL('ALEInfo', s:none, s:none, s:undercurl, s:blue)
hi! link ALEErrorSign GruvboxRedSign
hi! link ALEWarningSign GruvboxYellowSign
hi! link ALEInfoSign GruvboxBlueSign
" }}}
" Dirvish: {{{
hi! link DirvishPathTail GruvboxAqua
hi! link DirvishArg GruvboxYellow
" }}}
" Netrw: {{{
hi! link netrwDir GruvboxAqua
hi! link netrwClassify GruvboxAqua
hi! link netrwLink GruvboxGray
hi! link netrwSymLink GruvboxFg1
hi! link netrwExe GruvboxYellow
hi! link netrwComment GruvboxGray
hi! link netrwList GruvboxBlue
hi! link netrwHelpCmd GruvboxAqua
hi! link netrwCmdSep GruvboxFg3
hi! link netrwVersion GruvboxGreen
" }}}
" NERDTree: {{{
hi! link NERDTreeDir GruvboxAqua
hi! link NERDTreeDirSlash GruvboxAqua
hi! link NERDTreeOpenable GruvboxOrange
hi! link NERDTreeClosable GruvboxOrange
hi! link NERDTreeFile GruvboxFg1
hi! link NERDTreeExecFile GruvboxYellow
hi! link NERDTreeUp GruvboxGray
hi! link NERDTreeCWD GruvboxGreen
hi! link NERDTreeHelp GruvboxFg1
hi! link NERDTreeToggleOn GruvboxGreen
hi! link NERDTreeToggleOff GruvboxRed
" }}}
" Vim Multiple Cursors: {{{
call s:HL('multiple_cursors_cursor', s:none, s:none, s:inverse)
call s:HL('multiple_cursors_visual', s:none, s:bg2)
" }}}
" Filetype specific -----------------------------------------------------------
@ -932,9 +1014,13 @@ hi! link pythonImport GruvboxBlue
hi! link pythonRun GruvboxBlue
hi! link pythonCoding GruvboxBlue
hi! link pythonOperator GruvboxRed
hi! link pythonException GruvboxRed
hi! link pythonExceptions GruvboxPurple
hi! link pythonBoolean GruvboxPurple
hi! link pythonDot GruvboxFg3
hi! link pythonConditional GruvboxRed
hi! link pythonRepeat GruvboxRed
hi! link pythonDottedName GruvboxGreenBold
" }}}
" CSS: {{{
@ -999,9 +1085,24 @@ hi! link javascriptEndColons GruvboxFg1
hi! link javascriptFuncArg GruvboxFg1
hi! link javascriptGlobalMethod GruvboxFg1
hi! link javascriptNodeGlobal GruvboxFg1
hi! link javascriptBOMWindowProp GruvboxFg1
hi! link javascriptArrayMethod GruvboxFg1
hi! link javascriptArrayStaticMethod GruvboxFg1
hi! link javascriptCacheMethod GruvboxFg1
hi! link javascriptDateMethod GruvboxFg1
hi! link javascriptMathStaticMethod GruvboxFg1
" hi! link javascriptVariable GruvboxOrange
hi! link javascriptVariable GruvboxRed
" hi! link javascriptProp GruvboxFg1
hi! link javascriptURLUtilsProp GruvboxFg1
hi! link javascriptBOMNavigatorProp GruvboxFg1
hi! link javascriptDOMDocMethod GruvboxFg1
hi! link javascriptDOMDocProp GruvboxFg1
hi! link javascriptBOMLocationMethod GruvboxFg1
hi! link javascriptBOMWindowMethod GruvboxFg1
hi! link javascriptStringMethod GruvboxFg1
hi! link javascriptVariable GruvboxOrange
" hi! link javascriptVariable GruvboxRed
" hi! link javascriptIdentifier GruvboxOrange
" hi! link javascriptClassSuper GruvboxOrange
hi! link javascriptIdentifier GruvboxOrange
@ -1030,7 +1131,7 @@ hi! link javascriptObjectLabel GruvboxFg1
hi! link javascriptPropertyName GruvboxFg1
hi! link javascriptLogicSymbols GruvboxFg1
hi! link javascriptArrowFunc GruvboxFg1
hi! link javascriptArrowFunc GruvboxYellow
hi! link javascriptDocParamName GruvboxFg4
hi! link javascriptDocTags GruvboxFg4
@ -1038,11 +1139,38 @@ hi! link javascriptDocNotation GruvboxFg4
hi! link javascriptDocParamType GruvboxFg4
hi! link javascriptDocNamedParamType GruvboxFg4
hi! link javascriptBrackets GruvboxFg1
hi! link javascriptDOMElemAttrs GruvboxFg1
hi! link javascriptDOMEventMethod GruvboxFg1
hi! link javascriptDOMNodeMethod GruvboxFg1
hi! link javascriptDOMStorageMethod GruvboxFg1
hi! link javascriptHeadersMethod GruvboxFg1
hi! link javascriptAsyncFuncKeyword GruvboxRed
hi! link javascriptAwaitFuncKeyword GruvboxRed
" }}}
" PanglossJS: {{{
hi! link jsClassKeyword GruvboxAqua
hi! link jsExtendsKeyword GruvboxAqua
hi! link jsExportDefault GruvboxAqua
hi! link jsTemplateBraces GruvboxAqua
hi! link jsGlobalNodeObjects GruvboxFg1
hi! link jsGlobalObjects GruvboxFg1
hi! link jsFunction GruvboxAqua
hi! link jsFuncParens GruvboxFg3
hi! link jsParens GruvboxFg3
hi! link jsNull GruvboxPurple
hi! link jsUndefined GruvboxPurple
hi! link jsClassDefinition GruvboxYellow
" }}}
" TypeScript: {{{
hi! link typeScriptReserved GruvboxAqua
hi! link typeScriptLabel GruvboxAqua
hi! link typeScriptFuncKeyword GruvboxAqua
hi! link typeScriptIdentifier GruvboxOrange
hi! link typeScriptBraces GruvboxFg1
hi! link typeScriptEndColons GruvboxFg1
@ -1052,6 +1180,32 @@ hi! link typeScriptLogicSymbols GruvboxFg1
hi! link typeScriptDocSeeTag Comment
hi! link typeScriptDocParam Comment
hi! link typeScriptDocTags vimCommentTitle
hi! link typeScriptGlobalObjects GruvboxFg1
hi! link typeScriptParens GruvboxFg3
hi! link typeScriptOpSymbols GruvboxFg3
hi! link typeScriptHtmlElemProperties GruvboxFg1
hi! link typeScriptNull GruvboxPurple
hi! link typeScriptInterpolationDelimiter GruvboxAqua
" }}}
" PureScript: {{{
hi! link purescriptModuleKeyword GruvboxAqua
hi! link purescriptModuleName GruvboxFg1
hi! link purescriptWhere GruvboxAqua
hi! link purescriptDelimiter GruvboxFg4
hi! link purescriptType GruvboxFg1
hi! link purescriptImportKeyword GruvboxAqua
hi! link purescriptHidingKeyword GruvboxAqua
hi! link purescriptAsKeyword GruvboxAqua
hi! link purescriptStructure GruvboxAqua
hi! link purescriptOperator GruvboxBlue
hi! link purescriptTypeVar GruvboxFg1
hi! link purescriptConstructor GruvboxFg1
hi! link purescriptFunction GruvboxFg1
hi! link purescriptConditional GruvboxOrange
hi! link purescriptBacktick GruvboxOrange
" }}}
" CoffeeScript: {{{

View file

@ -0,0 +1,10 @@
{
"name": "gruvbox",
"version": "2.0.0",
"repository": "git@github.com:morhetz/gruvbox.git",
"author": "Pavel Pertsev <morhetz@gmail.com>",
"license": "MIT",
"vim": {
"opt": true
}
}

View file

@ -2,7 +2,7 @@
" Filename: autoload/lightline.vim
" Author: itchyny
" License: MIT License
" Last Change: 2016/12/03 12:08:08.
" Last Change: 2017/08/21 08:19:52.
" =============================================================================
let s:save_cpo = &cpo
@ -118,6 +118,7 @@ let s:_lightline = {
\ 'component_type': {
\ 'tabs': 'tabsel', 'close': 'raw'
\ },
\ 'component_raw': {},
\ 'tab_component': {},
\ 'tab_component_function': {
\ 'filename': 'lightline#tab#filename', 'modified': 'lightline#tab#modified',
@ -338,7 +339,9 @@ endfunction
function! s:convert(name, index) abort
if has_key(s:lightline.component_expand, a:name)
let type = get(s:lightline.component_type, a:name, a:index)
return filter(s:map(s:evaluate_expand(s:lightline.component_expand[a:name]), '[v:val, 1, v:key == 1 ? "' . type . '" : "' . a:index . '"]'), 'v:val[0] != []')
let is_raw = get(s:lightline.component_raw, a:name) || type ==# 'raw'
return filter(s:map(s:evaluate_expand(s:lightline.component_expand[a:name]),
\ '[v:val, 1 + ' . is_raw . ', v:key == 1 && ' . (type !=# 'raw') . ' ? "' . type . '" : "' . a:index . '"]'), 'v:val[0] != []')
else
return [[[a:name], 0, a:index]]
endif
@ -393,7 +396,7 @@ function! s:line(tabline, inactive) abort
endif
let [l, r] = a:tabline ? [s:lightline.tab_llen, s:lightline.tab_rlen] : [s:lightline.llen, s:lightline.rlen]
let [p, s] = a:tabline ? [s:lightline.tabline_separator, s:lightline.tabline_subseparator] : [s:lightline.separator, s:lightline.subseparator]
let [c, f, t] = [s:lightline.component, s:lightline.component_function, s:lightline.component_type]
let [c, f, t, w] = [s:lightline.component, s:lightline.component_function, s:lightline.component_type, s:lightline.component_raw]
let mode = a:tabline ? 'tabline' : a:inactive ? 'inactive' : 'active'
let l_ = has_key(s:lightline, mode) ? s:lightline[mode].left : s:lightline.active.left
let [lt, lc, ll] = s:expand(copy(l_))
@ -403,7 +406,7 @@ function! s:line(tabline, inactive) abort
let _ .= '%#LightlineLeft_' . mode . '_' . ll[i] . '#'
for j in range(len(lt[i]))
let x = lc[i][j] ? lt[i][j] : has_key(f, lt[i][j]) ? (exists('*' . f[lt[i][j]]) ? '%{' . f[lt[i][j]] . '()}' : '%{exists("*' . f[lt[i][j]] . '")?' . f[lt[i][j]] . '():""}') : get(c, lt[i][j], '')
let _ .= has_key(t, lt[i][j]) && t[lt[i][j]] ==# 'raw' || x ==# '' ? x : '%( ' . x . ' %)'
let _ .= has_key(t, lt[i][j]) && t[lt[i][j]] ==# 'raw' || get(w, lt[i][j]) || lc[i][j] ==# 2 || x ==# '' ? x : '%( ' . x . ' %)'
if j < len(lt[i]) - 1 && s.left !=# ''
let _ .= s:subseparator(lt[i][(j):], s.left, lc[i][(j):])
endif
@ -418,7 +421,7 @@ function! s:line(tabline, inactive) abort
let _ .= '%#LightlineRight_' . mode . '_' . rl[i] . '#'
for j in range(len(rt[i]))
let x = rc[i][j] ? rt[i][j] : has_key(f, rt[i][j]) ? (exists('*' . f[rt[i][j]]) ? '%{' . f[rt[i][j]] . '()}' : '%{exists("*' . f[rt[i][j]] . '")?' . f[rt[i][j]] . '():""}') : get(c, rt[i][j], '')
let _ .= has_key(t, rt[i][j]) && t[rt[i][j]] ==# 'raw' || x ==# '' ? x : '%( ' . x . ' %)'
let _ .= has_key(t, rt[i][j]) && t[rt[i][j]] ==# 'raw' || get(w, rt[i][j]) || rc[i][j] ==# 2 || x ==# '' ? x : '%( ' . x . ' %)'
if j < len(rt[i]) - 1 && s.right !=# ''
let _ .= s:subseparator(rt[i][(j):], s.right, rc[i][(j):])
endif

View file

@ -4,7 +4,7 @@ Version: 0.1
Author: itchyny (https://github.com/itchyny)
License: MIT License
Repository: https://github.com/itchyny/lightline.vim
Last Change: 2017/05/28 01:07:02.
Last Change: 2017/08/21 08:33:12.
CONTENTS *lightline-contents*
@ -188,11 +188,22 @@ OPTIONS *lightline-option*
|g:lightline.component_expand|. The types are used to specify
the color. Specifically, the type raw is used to specify a
component which should not be wrapped by item group: %(...%).
If you want to specify the type of a raw component, please use
|g:lightline.component_raw|.
The default value is: >
let g:lightline.component_type = {
\ 'tabs': 'tabsel',
\ 'close': 'raw' }
<
g:lightline.component_raw *g:lightline.component_raw*
A dictionary to specify the raw type components. When you
register a component to this dictionary (like >
let g:lightline.component_raw = { 'example': 1 }
< ), the example component is not wrapped by item group: %(...%).
The default value is: >
let g:lightline.component_raw = {}
<
g:lightline.tab_component *g:lightline.tab_component*
A dictionary for components in one tab.

View file

@ -45,6 +45,32 @@ function! s:suite.custom_type()
delfunction Custom
endfunction
function! s:suite.raw_type()
function! Custom()
return [ ['left'], ['middle'], ['right'] ]
endfunction
let g:lightline = { 'component_expand': { 'custom': 'Custom' }, 'component_type': { 'custom': 'raw' } }
call lightline#init()
call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]),
\ [[['readonly', 'filename'], ['left', 'middle', 'right'], ['modified']], [[0, 0], [2, 2, 2], [0]], ['0', '1', '2', '3']])
call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
\ [[['readonly', 'filename', 'left', 'middle', 'right', 'modified']], [[0, 0, 2, 2, 2, 0]], ['0', '1']])
delfunction Custom
endfunction
function! s:suite.component_raw()
function! Custom()
return [ ['left'], ['middle'], ['right'] ]
endfunction
let g:lightline = { 'component_expand': { 'custom': 'Custom' }, 'component_type': { 'custom': 'custom' }, 'component_raw': { 'custom': 1 } }
call lightline#init()
call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]),
\ [[['readonly', 'filename'], ['left'], ['middle'], ['right'], ['modified']], [[0, 0], [2], [2], [2], [0]], ['0', '1', 'custom', '1', '2', '3']])
call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
\ [[['readonly', 'filename', 'left'], ['middle'], ['right', 'modified']], [[0, 0, 2], [2], [2, 0]], ['0', 'custom', '0', '1']])
delfunction Custom
endfunction
function! s:suite.multiple()
function! Custom()
return [ ['x0', 'x1', 'x2'], ['y0', 'y1', 'y2'], ['z0', 'z1', 'z2'] ]

View file

@ -1,56 +1,18 @@
The NERD Tree
The NERDTree
=============
Intro
-----
Introduction
------------
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 NERDTree is a file system explorer for the Vim editor. Using this plugin,
users can visually browse complex directory hierarchies, quickly open files for
reading or editing, and perform basic file system operations.
The following features and functionality are provided by the NERD tree:
This plugin can also be extended with custom mappings using a special API. The
details of this API and of other NERDTree features are described in the
included documentation.
* 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 (netrw), so if
you :edit a directory a (slightly 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 filesystem
operations (create/delete/move/copy files/directories)
* There's an API for adding your own keymappings
![NERDTree Screenshot](https://github.com/scrooloose/nerdtree/raw/master/screenshot.png)
Installation
------------
@ -66,10 +28,8 @@ Then reload Vim, run `:helptags ~/.vim/bundle/nerdtree/doc/`, and check out `:he
apt-vim install -y https://github.com/scrooloose/nerdtree.git
Faq
---
F.A.Q.
------
> Is there any support for `git` flags?

View file

@ -293,23 +293,26 @@ function! s:Bookmark.str()
endfunction
" FUNCTION: Bookmark.toRoot(nerdtree) {{{1
" Make the node for this bookmark the new tree root
" Set the root of the given NERDTree to the node for this Bookmark. If a node
" for this Bookmark does not exist, a new one is initialized.
function! s:Bookmark.toRoot(nerdtree)
if self.validate()
try
let targetNode = self.getNode(a:nerdtree, 1)
let l:targetNode = self.getNode(a:nerdtree, 1)
call l:targetNode.closeChildren()
catch /^NERDTree.BookmarkedNodeNotFoundError/
let targetNode = g:NERDTreeFileNode.New(s:Bookmark.BookmarkFor(self.name).path, a:nerdtree)
let l:targetNode = g:NERDTreeFileNode.New(s:Bookmark.BookmarkFor(self.name).path, a:nerdtree)
endtry
call a:nerdtree.changeRoot(targetNode)
call a:nerdtree.changeRoot(l:targetNode)
endif
endfunction
" FUNCTION: Bookmark.ToRoot(name, nerdtree) {{{1
" Make the node for this bookmark the new tree root
" Class method that makes the Bookmark with the given name the root of
" specified NERDTree.
function! s:Bookmark.ToRoot(name, nerdtree)
let bookmark = s:Bookmark.BookmarkFor(a:name)
call bookmark.toRoot(a:nerdtree)
let l:bookmark = s:Bookmark.BookmarkFor(a:name)
call l:bookmark.toRoot(a:nerdtree)
endfunction
" FUNCTION: Bookmark.validate() {{{1

View file

@ -1,15 +1,20 @@
"CLASS: Opener
"============================================================
" ============================================================================
" CLASS: Opener
"
" The Opener class defines an API for "opening" operations.
" ============================================================================
let s:Opener = {}
let g:NERDTreeOpener = s:Opener
"FUNCTION: s:Opener._bufInWindows(bnum){{{1
"[[STOLEN FROM VTREEEXPLORER.VIM]]
"Determine the number of windows open to this buffer number.
"Care of Yegappan Lakshman. Thanks!
" FUNCTION: s:Opener._bufInWindows(bnum) {{{1
" [[STOLEN FROM VTREEEXPLORER.VIM]]
" Determine the number of windows open to this buffer number.
" Care of Yegappan Lakshman. Thanks!
"
"Args:
"bnum: the subject buffers buffer number
" Args:
" bnum: the subject buffers buffer number
function! s:Opener._bufInWindows(bnum)
let cnt = 0
let winnum = 1
@ -26,14 +31,15 @@ function! s:Opener._bufInWindows(bnum)
return cnt
endfunction
"FUNCTION: Opener._checkToCloseTree(newtab) {{{1
"Check the class options and global options (i.e. NERDTreeQuitOnOpen) to see
"if the tree should be closed now.
" FUNCTION: Opener._checkToCloseTree(newtab) {{{1
" Check the class options and global options (i.e. NERDTreeQuitOnOpen) to see
" if the tree should be closed now.
"
"Args:
"a:newtab - boolean. If set, only close the tree now if we are opening the
"target in a new tab. This is needed because we have to close tree before we
"leave the tab
" Args:
" a:newtab - boolean. If set, only close the tree now if we are opening the
" target in a new tab. This is needed because we have to close tree before we
" leave the tab
function! s:Opener._checkToCloseTree(newtab)
if self._keepopen
return
@ -44,9 +50,8 @@ function! s:Opener._checkToCloseTree(newtab)
endif
endfunction
"FUNCTION: s:Opener._firstUsableWindow(){{{1
"find the window number of the first normal window
" FUNCTION: s:Opener._firstUsableWindow() {{{1
" find the window number of the first normal window
function! s:Opener._firstUsableWindow()
let i = 1
while i <= winnr("$")
@ -62,7 +67,7 @@ function! s:Opener._firstUsableWindow()
return -1
endfunction
"FUNCTION: Opener._gotoTargetWin() {{{1
" FUNCTION: Opener._gotoTargetWin() {{{1
function! s:Opener._gotoTargetWin()
if b:NERDTree.isWinTree()
if self._where == 'v'
@ -89,12 +94,12 @@ function! s:Opener._gotoTargetWin()
endif
endfunction
"FUNCTION: s:Opener._isWindowUsable(winnumber) {{{1
"Returns 0 if opening a file from the tree in the given window requires it to
"be split, 1 otherwise
" FUNCTION: s:Opener._isWindowUsable(winnumber) {{{1
" Returns 0 if opening a file from the tree in the given window requires it to
" be split, 1 otherwise
"
"Args:
"winnumber: the number of the window in question
" Args:
" winnumber: the number of the window in question
function! s:Opener._isWindowUsable(winnumber)
"gotta split if theres only one window (i.e. the NERD tree)
if winnr("$") ==# 1
@ -120,21 +125,21 @@ function! s:Opener._isWindowUsable(winnumber)
return !modified || self._bufInWindows(winbufnr(a:winnumber)) >= 2
endfunction
"FUNCTION: Opener.New(path, opts) {{{1
"Args:
" FUNCTION: Opener.New(path, opts) {{{1
" Args:
"
"a:path: The path object that is to be opened.
" a:path: The path object that is to be opened.
"
"a:opts:
" a:opts:
"
"A dictionary containing the following keys (all optional):
" 'where': Specifies whether the node should be opened in new split/tab or in
" the previous window. Can be either 'v' or 'h' or 't' (for open in
" new tab)
" 'reuse': if a window is displaying the file then jump the cursor there. Can
" 'all', 'currenttab' or empty to not reuse.
" 'keepopen': dont close the tree window
" 'stay': open the file, but keep the cursor in the tree win
" A dictionary containing the following keys (all optional):
" 'where': Specifies whether the node should be opened in new split/tab or in
" the previous window. Can be either 'v' or 'h' or 't' (for open in
" new tab)
" 'reuse': if a window is displaying the file then jump the cursor there. Can
" 'all', 'currenttab' or empty to not reuse.
" 'keepopen': dont close the tree window
" 'stay': open the file, but keep the cursor in the tree win
function! s:Opener.New(path, opts)
let newObj = copy(self)
@ -155,7 +160,7 @@ function! s:Opener.New(path, opts)
return newObj
endfunction
"FUNCTION: Opener._newSplit() {{{1
" FUNCTION: Opener._newSplit() {{{1
function! s:Opener._newSplit()
" Save the user's settings for splitbelow and splitright
let savesplitbelow=&splitbelow
@ -215,23 +220,27 @@ function! s:Opener._newSplit()
let &splitright=savesplitright
endfunction
"FUNCTION: Opener._newVSplit() {{{1
" FUNCTION: Opener._newVSplit() {{{1
function! s:Opener._newVSplit()
let winwidth = winwidth(".")
if winnr("$")==#1
let winwidth = g:NERDTreeWinSize
let l:winwidth = winwidth('.')
if winnr('$') == 1
let l:winwidth = g:NERDTreeWinSize
endif
call nerdtree#exec("wincmd p")
call nerdtree#exec('wincmd p')
vnew
"resize the nerd tree back to the original size
let l:currentWindowNumber = winnr()
" Restore the NERDTree to its original width.
call g:NERDTree.CursorToTreeWin()
exec("silent vertical resize ". winwidth)
call nerdtree#exec('wincmd p')
execute 'silent vertical resize ' . l:winwidth
call nerdtree#exec(l:currentWindowNumber . 'wincmd w')
endfunction
"FUNCTION: Opener.open(target) {{{1
" FUNCTION: Opener.open(target) {{{1
function! s:Opener.open(target)
if self._path.isDirectory
call self._openDirectory(a:target)
@ -240,7 +249,7 @@ function! s:Opener.open(target)
endif
endfunction
"FUNCTION: Opener._openFile() {{{1
" FUNCTION: Opener._openFile() {{{1
function! s:Opener._openFile()
if self._reuseWindow()
return
@ -253,7 +262,7 @@ function! s:Opener._openFile()
endif
endfunction
"FUNCTION: Opener._openDirectory(node) {{{1
" FUNCTION: Opener._openDirectory(node) {{{1
function! s:Opener._openDirectory(node)
if self._nerdtree.isWinTree()
call self._gotoTargetWin()
@ -274,7 +283,7 @@ function! s:Opener._openDirectory(node)
endif
endfunction
"FUNCTION: Opener._previousWindow() {{{1
" FUNCTION: Opener._previousWindow() {{{1
function! s:Opener._previousWindow()
if !self._isWindowUsable(winnr("#")) && self._firstUsableWindow() ==# -1
call self._newSplit()
@ -294,16 +303,16 @@ function! s:Opener._previousWindow()
endif
endfunction
"FUNCTION: Opener._restoreCursorPos(){{{1
" FUNCTION: Opener._restoreCursorPos() {{{1
function! s:Opener._restoreCursorPos()
call nerdtree#exec('normal ' . self._tabnr . 'gt')
call nerdtree#exec(bufwinnr(self._bufnr) . 'wincmd w')
endfunction
"FUNCTION: Opener._reuseWindow(){{{1
"put the cursor in the first window we find for this file
" FUNCTION: Opener._reuseWindow() {{{1
" put the cursor in the first window we find for this file
"
"return 1 if we were successful
" return 1 if we were successful
function! s:Opener._reuseWindow()
if empty(self._reuse)
return 0
@ -334,7 +343,7 @@ function! s:Opener._reuseWindow()
return 0
endfunction
"FUNCTION: Opener._saveCursorPos(){{{1
" FUNCTION: Opener._saveCursorPos() {{{1
function! s:Opener._saveCursorPos()
let self._bufnr = bufnr("")
let self._tabnr = tabpagenr()

View file

@ -1,13 +1,20 @@
"we need to use this number many times for sorting... so we calculate it only
"once here
let s:NERDTreeSortStarIndex = index(g:NERDTreeSortOrder, '*')
" ============================================================================
" CLASS: Path
"
" The Path class provides an abstracted representation of a file system
" pathname. Various operations on pathnames are provided and a number of
" representations of a given path name can be accessed here.
" ============================================================================
" This constant is used throughout this script for sorting purposes.
let s:NERDTreeSortStarIndex = index(g:NERDTreeSortOrder, '*')
lockvar s:NERDTreeSortStarIndex
"CLASS: Path
"============================================================
let s:Path = {}
let g:NERDTreePath = s:Path
"FUNCTION: Path.AbsolutePathFor(str) {{{1
" FUNCTION: Path.AbsolutePathFor(str) {{{1
function! s:Path.AbsolutePathFor(str)
let prependCWD = 0
if nerdtree#runningWindows()
@ -24,7 +31,7 @@ function! s:Path.AbsolutePathFor(str)
return toReturn
endfunction
"FUNCTION: Path.bookmarkNames() {{{1
" FUNCTION: Path.bookmarkNames() {{{1
function! s:Path.bookmarkNames()
if !exists("self._bookmarkNames")
call self.cacheDisplayString()
@ -32,7 +39,7 @@ function! s:Path.bookmarkNames()
return self._bookmarkNames
endfunction
"FUNCTION: Path.cacheDisplayString() {{{1
" FUNCTION: Path.cacheDisplayString() {{{1
function! s:Path.cacheDisplayString() abort
let self.cachedDisplayString = self.getLastPathComponent(1)
@ -59,7 +66,7 @@ function! s:Path.cacheDisplayString() abort
endif
endfunction
"FUNCTION: Path.changeToDir() {{{1
" FUNCTION: Path.changeToDir() {{{1
function! s:Path.changeToDir()
let dir = self.str({'format': 'Cd'})
if self.isDirectory ==# 0
@ -74,16 +81,16 @@ function! s:Path.changeToDir()
endtry
endfunction
"FUNCTION: Path.compareTo() {{{1
" FUNCTION: Path.compareTo() {{{1
"
"Compares this Path to the given path and returns 0 if they are equal, -1 if
"this Path is "less than" the given path, or 1 if it is "greater".
" Compares this Path to the given path and returns 0 if they are equal, -1 if
" this Path is "less than" the given path, or 1 if it is "greater".
"
"Args:
"path: the path object to compare this to
" Args:
" path: the path object to compare this to
"
"Return:
"1, -1 or 0
" Return:
" 1, -1 or 0
function! s:Path.compareTo(path)
let thisPath = self.getLastPathComponent(1)
let thatPath = a:path.getLastPathComponent(1)
@ -118,16 +125,16 @@ function! s:Path.compareTo(path)
endif
endfunction
"FUNCTION: Path.Create(fullpath) {{{1
" FUNCTION: Path.Create(fullpath) {{{1
"
"Factory method.
" Factory method.
"
"Creates a path object with the given path. The path is also created on the
"filesystem. If the path already exists, a NERDTree.Path.Exists exception is
"thrown. If any other errors occur, a NERDTree.Path exception is thrown.
" Creates a path object with the given path. The path is also created on the
" filesystem. If the path already exists, a NERDTree.Path.Exists exception is
" thrown. If any other errors occur, a NERDTree.Path exception is thrown.
"
"Args:
"fullpath: the full filesystem path to the file/dir to create
" Args:
" fullpath: the full filesystem path to the file/dir to create
function! s:Path.Create(fullpath)
"bail if the a:fullpath already exists
if isdirectory(a:fullpath) || filereadable(a:fullpath)
@ -155,12 +162,12 @@ function! s:Path.Create(fullpath)
return s:Path.New(a:fullpath)
endfunction
"FUNCTION: Path.copy(dest) {{{1
" FUNCTION: Path.copy(dest) {{{1
"
"Copies the file/dir represented by this Path to the given location
" Copies the file/dir represented by this Path to the given location
"
"Args:
"dest: the location to copy this dir/file to
" Args:
" dest: the location to copy this dir/file to
function! s:Path.copy(dest)
if !s:Path.CopyingSupported()
throw "NERDTree.CopyingNotSupportedError: Copying is not supported on this OS"
@ -181,20 +188,20 @@ function! s:Path.copy(dest)
endif
endfunction
"FUNCTION: Path.CopyingSupported() {{{1
" FUNCTION: Path.CopyingSupported() {{{1
"
"returns 1 if copying is supported for this OS
" returns 1 if copying is supported for this OS
function! s:Path.CopyingSupported()
return exists('g:NERDTreeCopyCmd') || (exists('g:NERDTreeCopyDirCmd') && exists('g:NERDTreeCopyFileCmd'))
endfunction
"FUNCTION: Path.copyingWillOverwrite(dest) {{{1
" FUNCTION: Path.copyingWillOverwrite(dest) {{{1
"
"returns 1 if copy this path to the given location will cause files to
"overwritten
" returns 1 if copy this path to the given location will cause files to
" overwritten
"
"Args:
"dest: the location this path will be copied to
" Args:
" dest: the location this path will be copied to
function! s:Path.copyingWillOverwrite(dest)
if filereadable(a:dest)
return 1
@ -208,13 +215,13 @@ function! s:Path.copyingWillOverwrite(dest)
endif
endfunction
"FUNCTION: Path.createParentDirectories(path) {{{1
" FUNCTION: Path.createParentDirectories(path) {{{1
"
"create parent directories for this path if needed
"without throwing any errors if those directories already exist
" create parent directories for this path if needed
" without throwing any errors if those directories already exist
"
"Args:
"path: full path of the node whose parent directories may need to be created
" Args:
" path: full path of the node whose parent directories may need to be created
function! s:Path.createParentDirectories(path)
let dir_path = fnamemodify(a:path, ':h')
if !isdirectory(dir_path)
@ -222,11 +229,11 @@ function! s:Path.createParentDirectories(path)
endif
endfunction
"FUNCTION: Path.delete() {{{1
" FUNCTION: Path.delete() {{{1
"
"Deletes the file or directory represented by this path.
" Deletes the file or directory represented by this path.
"
"Throws NERDTree.Path.Deletion exceptions
" Throws NERDTree.Path.Deletion exceptions
function! s:Path.delete()
if self.isDirectory
@ -250,10 +257,10 @@ function! s:Path.delete()
endfor
endfunction
"FUNCTION: Path.displayString() {{{1
" FUNCTION: Path.displayString() {{{1
"
"Returns a string that specifies how the path should be represented as a
"string
" Returns a string that specifies how the path should be represented as a
" string
function! s:Path.displayString()
if self.cachedDisplayString ==# ""
call self.cacheDisplayString()
@ -262,14 +269,14 @@ function! s:Path.displayString()
return self.cachedDisplayString
endfunction
"FUNCTION: Path.edit() {{{1
" FUNCTION: Path.edit() {{{1
function! s:Path.edit()
exec "edit " . self.str({'format': 'Edit'})
endfunction
"FUNCTION: Path.extractDriveLetter(fullpath) {{{1
" FUNCTION: Path.extractDriveLetter(fullpath) {{{1
"
"If running windows, cache the drive letter for this path
" If running windows, cache the drive letter for this path
function! s:Path.extractDriveLetter(fullpath)
if nerdtree#runningWindows()
if a:fullpath =~ '^\(\\\\\|\/\/\)'
@ -285,14 +292,14 @@ function! s:Path.extractDriveLetter(fullpath)
endfunction
"FUNCTION: Path.exists() {{{1
"return 1 if this path points to a location that is readable or is a directory
" FUNCTION: Path.exists() {{{1
" return 1 if this path points to a location that is readable or is a directory
function! s:Path.exists()
let p = self.str()
return filereadable(p) || isdirectory(p)
endfunction
"FUNCTION: Path._escChars() {{{1
" FUNCTION: Path._escChars() {{{1
function! s:Path._escChars()
if nerdtree#runningWindows()
return " `\|\"#%&,?()\*^<>$"
@ -301,12 +308,12 @@ function! s:Path._escChars()
return " \\`\|\"#%&,?()\*^<>[]$"
endfunction
"FUNCTION: Path.getDir() {{{1
" FUNCTION: Path.getDir() {{{1
"
"Returns this path if it is a directory, else this paths parent.
" Returns this path if it is a directory, else this paths parent.
"
"Return:
"a Path object
" Return:
" a Path object
function! s:Path.getDir()
if self.isDirectory
return self
@ -315,12 +322,12 @@ function! s:Path.getDir()
endif
endfunction
"FUNCTION: Path.getParent() {{{1
" FUNCTION: Path.getParent() {{{1
"
"Returns a new path object for this paths parent
" Returns a new path object for this paths parent
"
"Return:
"a new Path object
" Return:
" a new Path object
function! s:Path.getParent()
if nerdtree#runningWindows()
let path = self.drive . '\' . join(self.pathSegments[0:-2], '\')
@ -331,13 +338,13 @@ function! s:Path.getParent()
return s:Path.New(path)
endfunction
"FUNCTION: Path.getLastPathComponent(dirSlash) {{{1
" FUNCTION: Path.getLastPathComponent(dirSlash) {{{1
"
"Gets the last part of this path.
" Gets the last part of this path.
"
"Args:
"dirSlash: if 1 then a trailing slash will be added to the returned value for
"directory nodes.
" Args:
" dirSlash: if 1 then a trailing slash will be added to the returned value for
" directory nodes.
function! s:Path.getLastPathComponent(dirSlash)
if empty(self.pathSegments)
return ''
@ -349,8 +356,8 @@ function! s:Path.getLastPathComponent(dirSlash)
return toReturn
endfunction
"FUNCTION: Path.getSortOrderIndex() {{{1
"returns the index of the pattern in g:NERDTreeSortOrder that this path matches
" FUNCTION: Path.getSortOrderIndex() {{{1
" returns the index of the pattern in g:NERDTreeSortOrder that this path matches
function! s:Path.getSortOrderIndex()
let i = 0
while i < len(g:NERDTreeSortOrder)
@ -362,8 +369,8 @@ function! s:Path.getSortOrderIndex()
return s:NERDTreeSortStarIndex
endfunction
"FUNCTION: Path._splitChunks(path) {{{1
"returns a list of path chunks
" FUNCTION: Path._splitChunks(path) {{{1
" returns a list of path chunks
function! s:Path._splitChunks(path)
let chunks = split(a:path, '\(\D\+\|\d\+\)\zs')
let i = 0
@ -377,8 +384,8 @@ function! s:Path._splitChunks(path)
return chunks
endfunction
"FUNCTION: Path.getSortKey() {{{1
"returns a key used in compare function for sorting
" FUNCTION: Path.getSortKey() {{{1
" returns a key used in compare function for sorting
function! s:Path.getSortKey()
if !exists("self._sortKey")
let path = self.getLastPathComponent(1)
@ -399,14 +406,14 @@ function! s:Path.getSortKey()
endfunction
"FUNCTION: Path.isUnixHiddenFile() {{{1
"check for unix hidden files
" FUNCTION: Path.isUnixHiddenFile() {{{1
" check for unix hidden files
function! s:Path.isUnixHiddenFile()
return self.getLastPathComponent(0) =~# '^\.'
endfunction
"FUNCTION: Path.isUnixHiddenPath() {{{1
"check for unix path with hidden components
" FUNCTION: Path.isUnixHiddenPath() {{{1
" check for unix path with hidden components
function! s:Path.isUnixHiddenPath()
if self.getLastPathComponent(0) =~# '^\.'
return 1
@ -420,8 +427,8 @@ function! s:Path.isUnixHiddenPath()
endif
endfunction
"FUNCTION: Path.ignore(nerdtree) {{{1
"returns true if this path should be ignored
" FUNCTION: Path.ignore(nerdtree) {{{1
" returns true if this path should be ignored
function! s:Path.ignore(nerdtree)
"filter out the user specified paths to ignore
if a:nerdtree.ui.isIgnoreFilterEnabled()
@ -450,8 +457,8 @@ function! s:Path.ignore(nerdtree)
return 0
endfunction
"FUNCTION: Path._ignorePatternMatches(pattern) {{{1
"returns true if this path matches the given ignore pattern
" FUNCTION: Path._ignorePatternMatches(pattern) {{{1
" returns true if this path matches the given ignore pattern
function! s:Path._ignorePatternMatches(pattern)
let pat = a:pattern
if strpart(pat,len(pat)-7) == '[[dir]]'
@ -469,10 +476,10 @@ function! s:Path._ignorePatternMatches(pattern)
return self.getLastPathComponent(0) =~# pat
endfunction
"FUNCTION: Path.isAncestor(path) {{{1
"return 1 if this path is somewhere above the given path in the filesystem.