diff --git a/autoload/SpaceVim/layers/VersionControl.vim b/autoload/SpaceVim/layers/VersionControl.vim index acddb748b..eb8afe55d 100644 --- a/autoload/SpaceVim/layers/VersionControl.vim +++ b/autoload/SpaceVim/layers/VersionControl.vim @@ -93,7 +93,7 @@ function! s:git_branch() abort endif catch endtry - elseif exists('g:loaded_git') + else let prefix = g:spacevim_statusline_unicode ? '' : '' return printf('%%{git#branch#current("%s")}', prefix) endif diff --git a/autoload/SpaceVim/layers/core.vim b/autoload/SpaceVim/layers/core.vim index bfd9a4563..e5547cab3 100644 --- a/autoload/SpaceVim/layers/core.vim +++ b/autoload/SpaceVim/layers/core.vim @@ -196,7 +196,7 @@ function! SpaceVim#layers#core#plugins() abort \ }]) call add(plugins, [g:_spacevim_root_dir . 'bundle/vimproc.vim', {'build' : [(executable('gmake') ? 'gmake' : 'make')]}]) elseif g:spacevim_filemanager ==# 'defx' - call add(plugins, [g:_spacevim_root_dir . 'bundle/defx.nvim',{'merged' : 0, 'loadconf' : 1 , 'loadconf_before' : 1}]) + call add(plugins, [g:_spacevim_root_dir . 'bundle/defx.nvim',{'merged' : 0, 'loadconf' : 1 , 'loadconf_before' : 1, 'on_cmd' : 'Defx'}]) call add(plugins, [g:_spacevim_root_dir . 'bundle/defx-git',{'merged' : 0, 'loadconf' : 1}]) call add(plugins, [g:_spacevim_root_dir . 'bundle/defx-icons',{'merged' : 0}]) call add(plugins, [g:_spacevim_root_dir . 'bundle/defx-sftp',{'merged' : 0}]) diff --git a/autoload/SpaceVim/layers/edit.vim b/autoload/SpaceVim/layers/edit.vim index 93b2e1291..5b647c61a 100644 --- a/autoload/SpaceVim/layers/edit.vim +++ b/autoload/SpaceVim/layers/edit.vim @@ -115,12 +115,12 @@ function! SpaceVim#layers#edit#plugins() abort \ ['andrewradev/splitjoin.vim',{ 'on_cmd':['SplitjoinJoin', 'SplitjoinSplit'],'merged' : 0, 'loadconf' : 1}], \ ] if has('nvim-0.8.0') - call add(plugins,[g:_spacevim_root_dir . 'bundle/nvim-surround', { 'merged' : 0, 'loadconf' : 1}]) + call add(plugins,[g:_spacevim_root_dir . 'bundle/nvim-surround', { 'merged' : 0, 'loadconf' : 1, 'on_event' : ['BufReadPost']}]) else call add(plugins,[g:_spacevim_root_dir . 'bundle/vim-surround', { 'merged' : 0, 'loadconf' : 1}]) endif if has('nvim-0.6.0') && s:enable_hop - call add(plugins,[g:_spacevim_root_dir . 'bundle/hop.nvim', { 'merged' : 0, 'loadconf' : 1}]) + call add(plugins,[g:_spacevim_root_dir . 'bundle/hop.nvim', { 'merged' : 0, 'loadconf' : 1, 'on_cmd' : ['HopChar1', 'HopChar2', 'HopWord', 'HopLine']}]) else call add(plugins,[g:_spacevim_root_dir . 'bundle/vim-easymotion', { 'merged' : 0}]) call add(plugins,[g:_spacevim_root_dir . 'bundle/vim-easyoperator-line', { 'merged' : 0}]) diff --git a/autoload/SpaceVim/layers/git.vim b/autoload/SpaceVim/layers/git.vim index e1986180b..b86f8ea00 100644 --- a/autoload/SpaceVim/layers/git.vim +++ b/autoload/SpaceVim/layers/git.vim @@ -65,7 +65,7 @@ let s:git_plugin = 'git' function! SpaceVim#layers#git#plugins() abort let plugins = [ \ ] - call add(plugins, ['airblade/vim-gitgutter', { 'merged' : 0}]) + call add(plugins, ['airblade/vim-gitgutter', { 'merged' : 0, 'on_event' : ['BufReadPost']}]) if s:git_plugin ==# 'gina' call add(plugins, [g:_spacevim_root_dir . 'bundle/gina.vim', { 'merged' : 0}]) elseif s:git_plugin ==# 'fugitive' @@ -74,7 +74,7 @@ function! SpaceVim#layers#git#plugins() abort elseif s:git_plugin ==# 'gita' call add(plugins, ['lambdalisue/vim-gita', { 'on_cmd' : 'Gita'}]) else - call add(plugins, [g:_spacevim_root_dir . 'bundle/git.vim', { 'merged' : 0}]) + call add(plugins, [g:_spacevim_root_dir . 'bundle/git.vim', { 'merged' : 0, 'on_event' : 'Git', 'on_func' : 'git#branch#current'}]) endif return plugins endfunction diff --git a/autoload/SpaceVim/layers/lang/python.vim b/autoload/SpaceVim/layers/lang/python.vim index 0797f8915..1b2eeb1de 100644 --- a/autoload/SpaceVim/layers/lang/python.vim +++ b/autoload/SpaceVim/layers/lang/python.vim @@ -126,11 +126,11 @@ function! SpaceVim#layers#lang#python#plugins() abort call add(plugins, [g:_spacevim_root_dir . 'bundle/vim-pythonsense', \ { 'on_ft' : 'python'}]) call add(plugins, [g:_spacevim_root_dir . 'bundle/coveragepy.vim', - \ { 'merged' : 0}]) + \ { 'merged' : 0, 'on_ft' : 'python'}]) call add(plugins, [g:_spacevim_root_dir . 'bundle/python-imports.vim', - \ { 'merged' : 0}]) + \ { 'merged' : 0, 'on_ft' : 'python'}]) call add(plugins, [g:_spacevim_root_dir . 'bundle/vim-virtualenv', - \ { 'merged' : 0}]) + \ { 'merged' : 0, 'on_ft' : 'python'}]) return plugins endfunction diff --git a/autoload/SpaceVim/layers/lang/ruby.vim b/autoload/SpaceVim/layers/lang/ruby.vim index 042cf9873..d2cda18ec 100644 --- a/autoload/SpaceVim/layers/lang/ruby.vim +++ b/autoload/SpaceVim/layers/lang/ruby.vim @@ -101,7 +101,7 @@ endif function! SpaceVim#layers#lang#ruby#plugins() abort return [ - \ [g:_spacevim_root_dir . 'bundle/vim-ruby', {'merged' : 0}] + \ [g:_spacevim_root_dir . 'bundle/vim-ruby', {'merged' : 0, 'on_ft' : ['ruby']}] \ ] endfunction diff --git a/autoload/SpaceVim/layers/lsp.vim b/autoload/SpaceVim/layers/lsp.vim index 4f4db4154..5a5af634d 100644 --- a/autoload/SpaceVim/layers/lsp.vim +++ b/autoload/SpaceVim/layers/lsp.vim @@ -69,7 +69,7 @@ endfunction function! SpaceVim#layers#lsp#plugins() abort let plugins = [] if has('nvim-0.9.1') - call add(plugins, [g:_spacevim_root_dir . 'bundle/nvim-lspconfig-latest', {'merged' : 0, 'loadconf' : 1}]) + call add(plugins, [g:_spacevim_root_dir . 'bundle/nvim-lspconfig-latest', {'merged' : 0, 'loadconf' : 1, 'on_event' : ['BufReadPost']}]) if g:spacevim_autocomplete_method ==# 'deoplete' call add(plugins, [g:_spacevim_root_dir . 'bundle/deoplete-lsp', {'merged' : 0}]) elseif g:spacevim_autocomplete_method ==# 'nvim-cmp'