Merge pull request #331 from jinnko/add-bookmarks-sort-flag
Add flag to disable/enable bookmark sorting
This commit is contained in:
commit
23d2d19846
@ -637,6 +637,9 @@ NERD tree. These options should be set in your vimrc.
|
||||
|
||||
|'NERDTreeBookmarksFile'| Where the bookmarks are stored.
|
||||
|
||||
|'NERDTreeBookmarksSort'| Whether the bookmarks list is sorted on
|
||||
display.
|
||||
|
||||
|'NERDTreeMouseMode'| Tells the NERD tree how to handle mouse
|
||||
clicks.
|
||||
|
||||
@ -828,6 +831,14 @@ Default: $HOME/.NERDTreeBookmarks
|
||||
|
||||
This is where bookmarks are saved. See |NERDTreeBookmarkCommands|.
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
*'NERDTreeBookmarksSort'*
|
||||
Values: 0 or 1
|
||||
Default: 1
|
||||
|
||||
If set to 0 then the bookmarks list is not sorted.
|
||||
If set to 1 the bookmarks list is sorted.
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
*'NERDTreeMouseMode'*
|
||||
Values: 1, 2 or 3.
|
||||
|
@ -19,7 +19,9 @@ function! s:Bookmark.AddBookmark(name, path)
|
||||
endif
|
||||
endfor
|
||||
call add(s:Bookmark.Bookmarks(), s:Bookmark.New(a:name, a:path))
|
||||
call s:Bookmark.Sort()
|
||||
if g:NERDTreeBookmarksSort ==# 1
|
||||
call s:Bookmark.Sort()
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" FUNCTION: Bookmark.Bookmarks() {{{1
|
||||
@ -101,7 +103,9 @@ function! s:Bookmark.CacheBookmarks(silent)
|
||||
call nerdtree#echo(invalidBookmarksFound . " invalid bookmarks were read. See :help NERDTreeInvalidBookmarks for info.")
|
||||
endif
|
||||
endif
|
||||
call s:Bookmark.Sort()
|
||||
if g:NERDTreeBookmarksSort ==# 1
|
||||
call s:Bookmark.Sort()
|
||||
endif
|
||||
endif
|
||||
endfunction
|
||||
|
||||
|
@ -56,6 +56,7 @@ if !exists("g:NERDTreeIgnore")
|
||||
let g:NERDTreeIgnore = ['\~$']
|
||||
endif
|
||||
call s:initVariable("g:NERDTreeBookmarksFile", expand('$HOME') . '/.NERDTreeBookmarks')
|
||||
call s:initVariable("g:NERDTreeBookmarksSort", 1)
|
||||
call s:initVariable("g:NERDTreeHighlightCursorline", 1)
|
||||
call s:initVariable("g:NERDTreeHijackNetrw", 1)
|
||||
call s:initVariable("g:NERDTreeMouseMode", 1)
|
||||
|
Loading…
x
Reference in New Issue
Block a user