From 25996d5c5ec8380f4df61d7d8d9aea8dbf2d785e Mon Sep 17 00:00:00 2001 From: wsdjeg Date: Sun, 18 Mar 2018 19:43:23 +0800 Subject: [PATCH] Update tools layer --- autoload/SpaceVim/default.vim | 1 - autoload/SpaceVim/layers/core.vim | 12 +++++- autoload/SpaceVim/layers/edit.vim | 5 ++- autoload/SpaceVim/layers/tools.vim | 57 +++++++++-------------------- autoload/SpaceVim/mapping/space.vim | 4 -- 5 files changed, 33 insertions(+), 46 deletions(-) diff --git a/autoload/SpaceVim/default.vim b/autoload/SpaceVim/default.vim index 7e20e9082..e6a7571c8 100644 --- a/autoload/SpaceVim/default.vim +++ b/autoload/SpaceVim/default.vim @@ -138,7 +138,6 @@ function! SpaceVim#default#layers() abort call SpaceVim#layers#load('checkers') call SpaceVim#layers#load('format') call SpaceVim#layers#load('edit') - call SpaceVim#layers#load('tools') call SpaceVim#layers#load('ui') call SpaceVim#layers#load('core') call SpaceVim#layers#load('core#banner') diff --git a/autoload/SpaceVim/layers/core.vim b/autoload/SpaceVim/layers/core.vim index ac34627b8..1d9a9df8a 100644 --- a/autoload/SpaceVim/layers/core.vim +++ b/autoload/SpaceVim/layers/core.vim @@ -11,6 +11,7 @@ function! SpaceVim#layers#core#plugins() abort if g:spacevim_filemanager ==# 'nerdtree' call add(plugins, ['scrooloose/nerdtree', { 'on_cmd' : 'NERDTreeToggle', \ 'loadconf' : 1}]) + call add(plugins, ['Xuyuanp/nerdtree-git-plugin', {'merged' : 0}]) elseif g:spacevim_filemanager ==# 'vimfiler' call add(plugins, ['Shougo/vimfiler.vim',{'merged' : 0, 'loadconf' : 1 , 'loadconf_before' : 1, 'on_cmd' : ['VimFiler', 'VimFilerBufferDir']}]) call add(plugins, ['Shougo/unite.vim',{ 'merged' : 0 , 'loadconf' : 1}]) @@ -22,7 +23,16 @@ function! SpaceVim#layers#core#plugins() abort call add(plugins, ['andymass/vim-matchup']) call add(plugins, ['morhetz/gruvbox', {'loadconf' : 1, 'merged' : 0}]) - + call add(plugins, ['tyru/open-browser.vim', { + \'on_cmd' : ['OpenBrowserSmartSearch', 'OpenBrowser', + \ 'OpenBrowserSearch'], + \'on_map' : '(openbrowser-', + \ 'loadconf' : 1, + \}]) + call add(plugins, ['tpope/vim-projectionist', { 'on_cmd' : ['A', 'AS', 'AV', + \ 'AT', 'AD', 'Cd', 'Lcd', 'ProjectDo']}]) + call add(plugins, ['mhinz/vim-grepper' , { 'on_cmd' : 'Grepper', + \ 'loadconf' : 1} ]) return plugins endfunction diff --git a/autoload/SpaceVim/layers/edit.vim b/autoload/SpaceVim/layers/edit.vim index 027eb0324..f7acc3fc1 100644 --- a/autoload/SpaceVim/layers/edit.vim +++ b/autoload/SpaceVim/layers/edit.vim @@ -30,6 +30,9 @@ function! SpaceVim#layers#edit#plugins() abort \ ['editorconfig/editorconfig-vim', { 'merged' : 0}], \ ['floobits/floobits-neovim', { 'on_cmd' : ['FlooJoinWorkspace','FlooShareDirPublic','FlooShareDirPrivate']}], \ ['osyo-manga/vim-jplus', { 'on_map' : '(jplus' }], + \ ['godlygeek/tabular', { 'on_cmd' : 'Tabularize'}], + \ ['ntpeters/vim-better-whitespace', { 'on_cmd' : 'StripWhitespace'}], + \ ['ianva/vim-youdao-translater', { 'on_cmd' : ['Ydv','Ydc','Yde']}], \ ] if executable('fcitx') call add(plugins,['lilydjwg/fcitx.vim', { 'on_event' : 'InsertEnter'}]) @@ -517,6 +520,6 @@ function! s:add_buffer_head() abort endif endfunction -function! SpaceVim#layers#edit#add_ft_head_tamplate(ft, tamp) +function! SpaceVim#layers#edit#add_ft_head_tamplate(ft, tamp) abort call extend(s:ft_head_tp, {a:ft : a:tamp}) endfunction diff --git a/autoload/SpaceVim/layers/tools.vim b/autoload/SpaceVim/layers/tools.vim index a12d2ee1f..c83ae06aa 100644 --- a/autoload/SpaceVim/layers/tools.vim +++ b/autoload/SpaceVim/layers/tools.vim @@ -7,45 +7,20 @@ "============================================================================= function! SpaceVim#layers#tools#plugins() abort - let plugins = [ - \ ['tpope/vim-scriptease'], - \ ['mbbill/fencview', { 'on_cmd' : 'FencAutoDetect'}], - \ ['wsdjeg/vim-cheat', { 'on_cmd' : 'Cheat'}], - \ ['wsdjeg/SourceCounter.vim', { 'on_cmd' : 'SourceCounter'}], - \ ['junegunn/goyo.vim', { 'on_cmd' : 'Goyo', - \ 'loadconf' : 1}], - \ ['junegunn/limelight.vim', { 'on_cmd' : 'Limelight'}], - \ ['MattesGroeger/vim-bookmarks', { 'on_map' : 'Bookmark', - \ 'on_cmd' : 'BookmarkShowAll', - \ 'loadconf_before' : 1}], - \ ['simnalamburt/vim-mundo', { 'on_cmd' : 'MundoToggle'}], - \ ['mhinz/vim-grepper' , { 'on_cmd' : 'Grepper', - \ 'loadconf' : 1} ], - \ ['tpope/vim-projectionist', { 'on_cmd' : ['A', 'AS', 'AV', - \ 'AT', 'AD', 'Cd', 'Lcd', 'ProjectDo']}], - \ ['ntpeters/vim-better-whitespace', { 'on_cmd' : 'StripWhitespace'}], - \ ['junegunn/rainbow_parentheses.vim', - \ { 'on_cmd' : 'RainbowParentheses'}], - \ ['tyru/open-browser.vim', { - \'on_cmd' : ['OpenBrowserSmartSearch', 'OpenBrowser', - \ 'OpenBrowserSearch'], - \'on_map' : '(openbrowser-', - \ 'loadconf' : 1, - \}], - \ ['godlygeek/tabular', { 'on_cmd' : 'Tabularize'}], - \ ['itchyny/calendar.vim', { 'on_cmd' : 'Calendar'}], - \ ['wsdjeg/Mysql.vim', { 'on_cmd' : 'SQLGetConnection'}], - \ ['wsdjeg/job.vim', { 'merged' : 0}], - \ ['ianva/vim-youdao-translater', { 'on_cmd' : ['Ydv','Ydc','Yde']}], - \ ['vim-scripts/TaskList.vim', { 'on_cmd' : 'TaskList'}], - \ ['MarcWeber/vim-addon-mw-utils'], - \ ['vim-scripts/taglist.vim', { 'on_cmd' : 'TlistToggle', 'loadconf' : 1}], - \ ['Xuyuanp/nerdtree-git-plugin'], - \ ['lymslive/vimloo', {'merged' : 0}], - \ ['lymslive/vnote', {'depends' : 'vimloo', - \ 'on_cmd' : ['NoteBook','NoteNew','NoteEdit', 'NoteList', 'NoteConfig', 'NoteIndex', 'NoteImport']}], - \ ] - + let plugins = [] + call add(plugins, ['tpope/vim-scriptease', { 'merged' : 0}]) + call add(plugins, ['lymslive/vimloo', { 'merged' : 0}]) + call add(plugins, ['lymslive/vnote', { 'depends' : 'vimloo', 'on_cmd' : ['NoteBook','NoteNew','NoteEdit', 'NoteList', 'NoteConfig', 'NoteIndex', 'NoteImport']}]) + call add(plugins, ['junegunn/rainbow_parentheses.vim', { 'on_cmd' : 'RainbowParentheses'}]) + call add(plugins, ['mbbill/fencview', { 'on_cmd' : 'FencAutoDetect'}]) + call add(plugins, ['simnalamburt/vim-mundo', { 'on_cmd' : 'MundoToggle'}]) + call add(plugins, ['wsdjeg/vim-cheat', { 'on_cmd' : 'Cheat'}]) + call add(plugins, ['wsdjeg/Mysql.vim', { 'on_cmd' : 'SQLGetConnection'}]) + call add(plugins, ['wsdjeg/SourceCounter.vim', { 'on_cmd' : 'SourceCounter'}]) + call add(plugins, ['itchyny/calendar.vim', { 'on_cmd' : 'Calendar'}]) + call add(plugins, ['junegunn/limelight.vim', { 'on_cmd' : 'Limelight'}]) + call add(plugins, ['junegunn/goyo.vim', { 'on_cmd' : 'Goyo', 'loadconf' : 1}]) + call add(plugins, ['MattesGroeger/vim-bookmarks', { 'on_map' : 'Bookmark', 'on_cmd' : 'BookmarkShowAll', 'loadconf_before' : 1}]) let s:CMP = SpaceVim#api#import('vim#compatible') if s:CMP.has('python') call add(plugins, ['gregsexton/VimCalc', {'on_cmd' : 'Calc'}]) @@ -62,6 +37,10 @@ function! SpaceVim#layers#tools#config() abort call SpaceVim#mapping#space#def('nnoremap', ['e', 'a'], 'FencAutoDetect', \ 'Auto detect the file encoding', 1) call SpaceVim#mapping#space#def('nnoremap', ['a', 'c'], 'Calc', 'vim calculator', 1) + call SpaceVim#mapping#space#def('nnoremap', ['w', 'c'], + \ 'Goyo', 'centered-buffer-mode', 1) + call SpaceVim#mapping#space#def('nnoremap', ['w', 'C'], + \ 'ChooseWin | Goyo', 'centered-buffer-mode(other windows)', 1) nmap mm BookmarkToggle nmap mi BookmarkAnnotate nmap ma BookmarkShowAll diff --git a/autoload/SpaceVim/mapping/space.vim b/autoload/SpaceVim/mapping/space.vim index 2fdc51921..883d9ad94 100644 --- a/autoload/SpaceVim/mapping/space.vim +++ b/autoload/SpaceVim/mapping/space.vim @@ -55,10 +55,6 @@ function! SpaceVim#mapping#space#init() abort \ 'call call(' \ . string(function('s:windows_layout_toggle')) \ . ', [])', 'windows-layout-toggle', 1) - call SpaceVim#mapping#space#def('nnoremap', ['w', 'c'], - \ 'Goyo', 'centered-buffer-mode', 1) - call SpaceVim#mapping#space#def('nnoremap', ['w', 'C'], - \ 'ChooseWin | Goyo', 'centered-buffer-mode(other windows)', 1) call SpaceVim#mapping#space#def('nnoremap', ['w', 'd'], \ 'close', 'delete window', 1) call SpaceVim#mapping#space#def('nnoremap', ['w', 'D'],