1
0
mirror of https://github.com/amix/vimrc synced 2025-06-17 19:35:00 +08:00

Updated plugins

This commit is contained in:
Amir
2020-01-07 13:45:07 +01:00
parent b56966e13c
commit 46195e4ca4
42 changed files with 1299 additions and 892 deletions

View File

@ -11,7 +11,9 @@
"
" SECTION: Script init stuff {{{1
"============================================================
if exists("loaded_nerd_tree")
scriptencoding utf-8
if exists('loaded_nerd_tree')
finish
endif
if v:version < 703
@ -20,9 +22,9 @@ if v:version < 703
endif
let loaded_nerd_tree = 1
"for line continuation - i.e dont want C in &cpo
let s:old_cpo = &cpo
set cpo&vim
"for line continuation - i.e dont want C in &cpoptions
let s:old_cpo = &cpoptions
set cpoptions&vim
"Function: s:initVariable() function {{{2
"This function is used to initialise a given variable to a given value. The
@ -36,65 +38,65 @@ set cpo&vim
"1 if the var is set, 0 otherwise
function! s:initVariable(var, value)
if !exists(a:var)
exec 'let ' . a:var . ' = ' . "'" . substitute(a:value, "'", "''", "g") . "'"
exec 'let ' . a:var . ' = ' . "'" . substitute(a:value, "'", "''", 'g') . "'"
return 1
endif
return 0
endfunction
"SECTION: Init variable calls and other random constants {{{2
call s:initVariable("g:NERDTreeAutoCenter", 1)
call s:initVariable("g:NERDTreeAutoCenterThreshold", 3)
call s:initVariable("g:NERDTreeCaseSensitiveSort", 0)
call s:initVariable("g:NERDTreeNaturalSort", 0)
call s:initVariable("g:NERDTreeSortHiddenFirst", 1)
call s:initVariable("g:NERDTreeUseTCD", 0)
call s:initVariable("g:NERDTreeChDirMode", 0)
call s:initVariable("g:NERDTreeCreatePrefix", "silent")
call s:initVariable("g:NERDTreeMinimalUI", 0)
call s:initVariable("g:NERDTreeMinimalMenu", 0)
if !exists("g:NERDTreeIgnore")
call s:initVariable('g:NERDTreeAutoCenter', 1)
call s:initVariable('g:NERDTreeAutoCenterThreshold', 3)
call s:initVariable('g:NERDTreeCaseSensitiveSort', 0)
call s:initVariable('g:NERDTreeNaturalSort', 0)
call s:initVariable('g:NERDTreeSortHiddenFirst', 1)
call s:initVariable('g:NERDTreeUseTCD', 0)
call s:initVariable('g:NERDTreeChDirMode', 0)
call s:initVariable('g:NERDTreeCreatePrefix', 'silent')
call s:initVariable('g:NERDTreeMinimalUI', 0)
call s:initVariable('g:NERDTreeMinimalMenu', 0)
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: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:NERDTreeMarkBookmarks', 1)
call s:initVariable("g:NERDTreeMouseMode", 1)
call s:initVariable("g:NERDTreeNotificationThreshold", 100)
call s:initVariable("g:NERDTreeQuitOnOpen", 0)
call s:initVariable("g:NERDTreeRespectWildIgnore", 0)
call s:initVariable("g:NERDTreeShowBookmarks", 0)
call s:initVariable("g:NERDTreeShowFiles", 1)
call s:initVariable("g:NERDTreeShowHidden", 0)
call s:initVariable("g:NERDTreeShowLineNumbers", 0)
call s:initVariable("g:NERDTreeSortDirs", 1)
call s:initVariable('g:NERDTreeMouseMode', 1)
call s:initVariable('g:NERDTreeNotificationThreshold', 100)
call s:initVariable('g:NERDTreeQuitOnOpen', 0)
call s:initVariable('g:NERDTreeRespectWildIgnore', 0)
call s:initVariable('g:NERDTreeShowBookmarks', 0)
call s:initVariable('g:NERDTreeShowFiles', 1)
call s:initVariable('g:NERDTreeShowHidden', 0)
call s:initVariable('g:NERDTreeShowLineNumbers', 0)
call s:initVariable('g:NERDTreeSortDirs', 1)
if !nerdtree#runningWindows() && !nerdtree#runningCygwin()
call s:initVariable("g:NERDTreeDirArrowExpandable", "▸")
call s:initVariable("g:NERDTreeDirArrowCollapsible", "▾")
call s:initVariable('g:NERDTreeDirArrowExpandable', '▸')
call s:initVariable('g:NERDTreeDirArrowCollapsible', '▾')
else
call s:initVariable("g:NERDTreeDirArrowExpandable", "+")
call s:initVariable("g:NERDTreeDirArrowCollapsible", "~")
call s:initVariable('g:NERDTreeDirArrowExpandable', '+')
call s:initVariable('g:NERDTreeDirArrowCollapsible', '~')
endif
call s:initVariable("g:NERDTreeCascadeOpenSingleChildDir", 1)
call s:initVariable("g:NERDTreeCascadeSingleChildDir", 1)
call s:initVariable('g:NERDTreeCascadeOpenSingleChildDir', 1)
call s:initVariable('g:NERDTreeCascadeSingleChildDir', 1)
if !exists("g:NERDTreeSortOrder")
if !exists('g:NERDTreeSortOrder')
let g:NERDTreeSortOrder = ['\/$', '*', '\.swp$', '\.bak$', '\~$']
endif
let g:NERDTreeOldSortOrder = []
call s:initVariable("g:NERDTreeGlyphReadOnly", "RO")
call s:initVariable('g:NERDTreeGlyphReadOnly', 'RO')
if has("conceal")
call s:initVariable("g:NERDTreeNodeDelimiter", "\x07")
elseif (g:NERDTreeDirArrowExpandable == "\u00a0" || g:NERDTreeDirArrowCollapsible == "\u00a0")
call s:initVariable("g:NERDTreeNodeDelimiter", "\u00b7")
if has('conceal')
call s:initVariable('g:NERDTreeNodeDelimiter', "\x07")
elseif (g:NERDTreeDirArrowExpandable ==# "\u00a0" || g:NERDTreeDirArrowCollapsible ==# "\u00a0")
call s:initVariable('g:NERDTreeNodeDelimiter', "\u00b7")
else
call s:initVariable("g:NERDTreeNodeDelimiter", "\u00a0")
call s:initVariable('g:NERDTreeNodeDelimiter', "\u00a0")
endif
if !exists('g:NERDTreeStatusline')
@ -105,60 +107,60 @@ if !exists('g:NERDTreeStatusline')
let g:NERDTreeStatusline = "%{exists('b:NERDTree')?b:NERDTree.root.path.str():''}"
endif
call s:initVariable("g:NERDTreeWinPos", "left")
call s:initVariable("g:NERDTreeWinSize", 31)
call s:initVariable('g:NERDTreeWinPos', 'left')
call s:initVariable('g:NERDTreeWinSize', 31)
"init the shell commands that will be used to copy nodes, and remove dir trees
"
"Note: the space after the command is important
if nerdtree#runningWindows()
call s:initVariable("g:NERDTreeRemoveDirCmd", 'rmdir /s /q ')
call s:initVariable("g:NERDTreeCopyDirCmd", 'xcopy /s /e /i /y /q ')
call s:initVariable("g:NERDTreeCopyFileCmd", 'copy /y ')
call s:initVariable('g:NERDTreeRemoveDirCmd', 'rmdir /s /q ')
call s:initVariable('g:NERDTreeCopyDirCmd', 'xcopy /s /e /i /y /q ')
call s:initVariable('g:NERDTreeCopyFileCmd', 'copy /y ')
else
call s:initVariable("g:NERDTreeRemoveDirCmd", 'rm -rf ')
call s:initVariable("g:NERDTreeCopyCmd", 'cp -r ')
call s:initVariable('g:NERDTreeRemoveDirCmd', 'rm -rf ')
call s:initVariable('g:NERDTreeCopyCmd', 'cp -r ')
endif
"SECTION: Init variable calls for key mappings {{{2
call s:initVariable("g:NERDTreeMapCustomOpen", "<CR>")
call s:initVariable("g:NERDTreeMapActivateNode", "o")
call s:initVariable("g:NERDTreeMapChangeRoot", "C")
call s:initVariable("g:NERDTreeMapChdir", "cd")
call s:initVariable("g:NERDTreeMapCloseChildren", "X")
call s:initVariable("g:NERDTreeMapCloseDir", "x")
call s:initVariable("g:NERDTreeMapDeleteBookmark", "D")
call s:initVariable("g:NERDTreeMapMenu", "m")
call s:initVariable("g:NERDTreeMapHelp", "?")
call s:initVariable("g:NERDTreeMapJumpFirstChild", "K")
call s:initVariable("g:NERDTreeMapJumpLastChild", "J")
call s:initVariable("g:NERDTreeMapJumpNextSibling", "<C-j>")
call s:initVariable("g:NERDTreeMapJumpParent", "p")
call s:initVariable("g:NERDTreeMapJumpPrevSibling", "<C-k>")
call s:initVariable("g:NERDTreeMapJumpRoot", "P")
call s:initVariable("g:NERDTreeMapOpenExpl", "e")
call s:initVariable("g:NERDTreeMapOpenInTab", "t")
call s:initVariable("g:NERDTreeMapOpenInTabSilent", "T")
call s:initVariable("g:NERDTreeMapOpenRecursively", "O")
call s:initVariable("g:NERDTreeMapOpenSplit", "i")
call s:initVariable("g:NERDTreeMapOpenVSplit", "s")
call s:initVariable("g:NERDTreeMapPreview", "g" . NERDTreeMapActivateNode)
call s:initVariable("g:NERDTreeMapPreviewSplit", "g" . NERDTreeMapOpenSplit)
call s:initVariable("g:NERDTreeMapPreviewVSplit", "g" . NERDTreeMapOpenVSplit)
call s:initVariable("g:NERDTreeMapQuit", "q")
call s:initVariable("g:NERDTreeMapRefresh", "r")
call s:initVariable("g:NERDTreeMapRefreshRoot", "R")
call s:initVariable("g:NERDTreeMapToggleBookmarks", "B")
call s:initVariable("g:NERDTreeMapToggleFiles", "F")
call s:initVariable("g:NERDTreeMapToggleFilters", "f")
call s:initVariable("g:NERDTreeMapToggleHidden", "I")
call s:initVariable("g:NERDTreeMapToggleZoom", "A")
call s:initVariable("g:NERDTreeMapUpdir", "u")
call s:initVariable("g:NERDTreeMapUpdirKeepOpen", "U")
call s:initVariable("g:NERDTreeMapCWD", "CD")
call s:initVariable("g:NERDTreeMenuDown", "j")
call s:initVariable("g:NERDTreeMenuUp", "k")
call s:initVariable('g:NERDTreeMapCustomOpen', '<CR>')
call s:initVariable('g:NERDTreeMapActivateNode', 'o')
call s:initVariable('g:NERDTreeMapChangeRoot', 'C')
call s:initVariable('g:NERDTreeMapChdir', 'cd')
call s:initVariable('g:NERDTreeMapCloseChildren', 'X')
call s:initVariable('g:NERDTreeMapCloseDir', 'x')
call s:initVariable('g:NERDTreeMapDeleteBookmark', 'D')
call s:initVariable('g:NERDTreeMapMenu', 'm')
call s:initVariable('g:NERDTreeMapHelp', '?')
call s:initVariable('g:NERDTreeMapJumpFirstChild', 'K')
call s:initVariable('g:NERDTreeMapJumpLastChild', 'J')
call s:initVariable('g:NERDTreeMapJumpNextSibling', '<C-j>')
call s:initVariable('g:NERDTreeMapJumpParent', 'p')
call s:initVariable('g:NERDTreeMapJumpPrevSibling', '<C-k>')
call s:initVariable('g:NERDTreeMapJumpRoot', 'P')
call s:initVariable('g:NERDTreeMapOpenExpl', 'e')
call s:initVariable('g:NERDTreeMapOpenInTab', 't')
call s:initVariable('g:NERDTreeMapOpenInTabSilent', 'T')
call s:initVariable('g:NERDTreeMapOpenRecursively', 'O')
call s:initVariable('g:NERDTreeMapOpenSplit', 'i')
call s:initVariable('g:NERDTreeMapOpenVSplit', 's')
call s:initVariable('g:NERDTreeMapPreview', 'g' . NERDTreeMapActivateNode)
call s:initVariable('g:NERDTreeMapPreviewSplit', 'g' . NERDTreeMapOpenSplit)
call s:initVariable('g:NERDTreeMapPreviewVSplit', 'g' . NERDTreeMapOpenVSplit)
call s:initVariable('g:NERDTreeMapQuit', 'q')
call s:initVariable('g:NERDTreeMapRefresh', 'r')
call s:initVariable('g:NERDTreeMapRefreshRoot', 'R')
call s:initVariable('g:NERDTreeMapToggleBookmarks', 'B')
call s:initVariable('g:NERDTreeMapToggleFiles', 'F')
call s:initVariable('g:NERDTreeMapToggleFilters', 'f')
call s:initVariable('g:NERDTreeMapToggleHidden', 'I')
call s:initVariable('g:NERDTreeMapToggleZoom', 'A')
call s:initVariable('g:NERDTreeMapUpdir', 'u')
call s:initVariable('g:NERDTreeMapUpdirKeepOpen', 'U')
call s:initVariable('g:NERDTreeMapCWD', 'CD')
call s:initVariable('g:NERDTreeMenuDown', 'j')
call s:initVariable('g:NERDTreeMenuUp', 'k')
"SECTION: Load class files{{{2
call nerdtree#loadClassFiles()
@ -171,20 +173,20 @@ call nerdtree#ui_glue#setupCommands()
"============================================================
augroup NERDTree
"Save the cursor position whenever we close the nerd tree
exec "autocmd BufLeave,WinLeave ". g:NERDTreeCreator.BufNamePrefix() ."* if g:NERDTree.IsOpen() | call b:NERDTree.ui.saveScreenState() | endif"
exec 'autocmd BufLeave,WinLeave '. g:NERDTreeCreator.BufNamePrefix() .'* if g:NERDTree.IsOpen() | call b:NERDTree.ui.saveScreenState() | endif'
"disallow insert mode in the NERDTree
exec "autocmd BufEnter,WinEnter ". g:NERDTreeCreator.BufNamePrefix() ."* stopinsert"
exec 'autocmd BufEnter,WinEnter '. g:NERDTreeCreator.BufNamePrefix() .'* stopinsert'
augroup END
if g:NERDTreeHijackNetrw
augroup NERDTreeHijackNetrw
autocmd VimEnter * silent! autocmd! FileExplorer
au BufEnter,VimEnter * call nerdtree#checkForBrowse(expand("<amatch>"))
au BufEnter,VimEnter * call nerdtree#checkForBrowse(expand('<amatch>'))
augroup END
endif
if g:NERDTreeChDirMode == 3
if g:NERDTreeChDirMode ==# 3
augroup NERDTreeChDirOnTabSwitch
autocmd TabEnter * if g:NERDTree.ExistsForTab()|call g:NERDTree.ForCurrentTab().getRoot().path.changeToDir()|endif
augroup END
@ -217,7 +219,7 @@ function! NERDTreeFocus()
if g:NERDTree.IsOpen()
call g:NERDTree.CursorToTreeWin()
else
call g:NERDTreeCreator.ToggleTabTree("")
call g:NERDTreeCreator.ToggleTabTree('')
endif
endfunction
@ -253,7 +255,7 @@ endfunction
" SECTION: Post Source Actions {{{1
call nerdtree#postSourceActions()
"reset &cpo back to users setting
let &cpo = s:old_cpo
"reset &cpoptions back to users setting
let &cpoptions = s:old_cpo
" vim: set sw=4 sts=4 et fdm=marker: