diff --git a/.gitmodules b/.gitmodules index 36a4ced..e69de29 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +0,0 @@ -[submodule "neobundle-initial"] - path = neobundle-initial - url = https://github.com/Shougo/neobundle.vim.git diff --git a/bundles-init/.keep b/bundles-init/.keep deleted file mode 100644 index e69de29..0000000 diff --git a/bundles-init/async.vim.load.vim b/bundles-init/async.vim.load.vim deleted file mode 100644 index 2df99d0..0000000 --- a/bundles-init/async.vim.load.vim +++ /dev/null @@ -1 +0,0 @@ -NeoBundle 'prabirshrestha/async.vim' diff --git a/bundles-init/asyncomplete-lsp.vim.load.vim b/bundles-init/asyncomplete-lsp.vim.load.vim deleted file mode 100644 index 255519f..0000000 --- a/bundles-init/asyncomplete-lsp.vim.load.vim +++ /dev/null @@ -1 +0,0 @@ -NeoBundle 'prabirshrestha/asyncomplete-lsp.vim' diff --git a/bundles-init/asyncomplete.vim.load.vim b/bundles-init/asyncomplete.vim.load.vim deleted file mode 100644 index 51f6010..0000000 --- a/bundles-init/asyncomplete.vim.load.vim +++ /dev/null @@ -1 +0,0 @@ -NeoBundle 'prabirshrestha/asyncomplete.vim' diff --git a/bundles-init/asyncrun.vim.load.vim b/bundles-init/asyncrun.vim.load.vim deleted file mode 100644 index c55fcc2..0000000 --- a/bundles-init/asyncrun.vim.load.vim +++ /dev/null @@ -1 +0,0 @@ -NeoBundle 'skywind3000/asyncrun.vim' diff --git a/bundles-init/ctrlp.vim.load.vim b/bundles-init/ctrlp.vim.load.vim deleted file mode 100644 index 4464d01..0000000 --- a/bundles-init/ctrlp.vim.load.vim +++ /dev/null @@ -1 +0,0 @@ -NeoBundle 'ctrlpvim/ctrlp.vim' diff --git a/bundles-init/jinja2.load.vim b/bundles-init/jinja2.load.vim deleted file mode 100644 index a2d4b01..0000000 --- a/bundles-init/jinja2.load.vim +++ /dev/null @@ -1 +0,0 @@ -NeoBundle 'Glench/Vim-Jinja2-Syntax' diff --git a/bundles-init/neomake.load.vim b/bundles-init/neomake.load.vim deleted file mode 100644 index 5dcdd51..0000000 --- a/bundles-init/neomake.load.vim +++ /dev/null @@ -1 +0,0 @@ -NeoBundle 'neomake/neomake' diff --git a/bundles-init/nerdtree-git-plugin.load.vim b/bundles-init/nerdtree-git-plugin.load.vim deleted file mode 100644 index 6809459..0000000 --- a/bundles-init/nerdtree-git-plugin.load.vim +++ /dev/null @@ -1,3 +0,0 @@ -NeoBundle 'Xuyuanp/nerdtree-git-plugin' , { - \ 'depends' : 'scrooloose/nerdtree' - \ } diff --git a/bundles-init/nerdtree.load.vim b/bundles-init/nerdtree.load.vim deleted file mode 100644 index 50c5513..0000000 --- a/bundles-init/nerdtree.load.vim +++ /dev/null @@ -1 +0,0 @@ -NeoBundle 'scrooloose/nerdtree' diff --git a/bundles-init/rust.vim.conf.vim b/bundles-init/rust.vim.conf.vim deleted file mode 100644 index 7ec2b5c..0000000 --- a/bundles-init/rust.vim.conf.vim +++ /dev/null @@ -1 +0,0 @@ -let g:autofmt_autosave = 1 diff --git a/bundles-init/rust.vim.load.vim b/bundles-init/rust.vim.load.vim deleted file mode 100644 index 89e34c0..0000000 --- a/bundles-init/rust.vim.load.vim +++ /dev/null @@ -1 +0,0 @@ -NeoBundle 'rust-lang/rust.vim' diff --git a/bundles-init/undotree.load.vim b/bundles-init/undotree.load.vim deleted file mode 100644 index a33462d..0000000 --- a/bundles-init/undotree.load.vim +++ /dev/null @@ -1 +0,0 @@ -NeoBundle 'mbbill/undotree' diff --git a/bundles-init/vim-airline-themes.load.vim b/bundles-init/vim-airline-themes.load.vim deleted file mode 100644 index ca1be15..0000000 --- a/bundles-init/vim-airline-themes.load.vim +++ /dev/null @@ -1,3 +0,0 @@ -NeoBundle 'vim-airline/vim-airline-themes' , { -\ 'depends' : [ 'bling/vim-airline' ] -\ } diff --git a/bundles-init/vim-airline.cfg.vim b/bundles-init/vim-airline.cfg.vim deleted file mode 100644 index 4f0b8a9..0000000 --- a/bundles-init/vim-airline.cfg.vim +++ /dev/null @@ -1,6 +0,0 @@ -let g:airline_powerline_fonts = 1 " Use really lovely patched fonts -let g:airline#extensions#tabline#enabled = 1 " Show buffers / tabs at the top -let g:airline#extensions#tabline#formatter = 'unique_tail_improved' " Buffer name formatter -let g:airline#extensions#tabline#show_buffers = 1 -let g:airline#extensions#tabline#show_tabs = 1 -set laststatus=2 " Always show status line diff --git a/bundles-init/vim-airline.load.vim b/bundles-init/vim-airline.load.vim deleted file mode 100644 index 6622f20..0000000 --- a/bundles-init/vim-airline.load.vim +++ /dev/null @@ -1,3 +0,0 @@ -NeoBundle 'bling/vim-airline' , { -\ 'depends' : [ 'ctrlpvim/ctrlp.vim' ] -\ } diff --git a/bundles-init/vim-cpp-enhanced-highlight.load.vim b/bundles-init/vim-cpp-enhanced-highlight.load.vim deleted file mode 100644 index 8749406..0000000 --- a/bundles-init/vim-cpp-enhanced-highlight.load.vim +++ /dev/null @@ -1 +0,0 @@ -NeoBundle 'octol/vim-cpp-enhanced-highlight' diff --git a/bundles-init/vim-flog.cfg.vim b/bundles-init/vim-flog.cfg.vim deleted file mode 100644 index 281449c..0000000 --- a/bundles-init/vim-flog.cfg.vim +++ /dev/null @@ -1,3 +0,0 @@ -" Key mappings -nmap gL :Flog -nmap gl :Flogsplit diff --git a/bundles-init/vim-flog.load.vim b/bundles-init/vim-flog.load.vim deleted file mode 100644 index 0dfe4af..0000000 --- a/bundles-init/vim-flog.load.vim +++ /dev/null @@ -1 +0,0 @@ -NeoBundle 'rbong/vim-flog' diff --git a/bundles-init/vim-fugitive.load.vim b/bundles-init/vim-fugitive.load.vim deleted file mode 100644 index 09403d1..0000000 --- a/bundles-init/vim-fugitive.load.vim +++ /dev/null @@ -1 +0,0 @@ -NeoBundle 'tpope/vim-fugitive' diff --git a/bundles-init/vim-gitgutter.load.vim b/bundles-init/vim-gitgutter.load.vim deleted file mode 100644 index edacfe2..0000000 --- a/bundles-init/vim-gitgutter.load.vim +++ /dev/null @@ -1 +0,0 @@ -NeoBundle 'airblade/vim-gitgutter' diff --git a/bundles-init/vim-glsl.load.vim b/bundles-init/vim-glsl.load.vim deleted file mode 100644 index 298e729..0000000 --- a/bundles-init/vim-glsl.load.vim +++ /dev/null @@ -1 +0,0 @@ -NeoBundle 'tikhomirov/vim-glsl' diff --git a/bundles-init/vim-go.cfg.vim b/bundles-init/vim-go.cfg.vim deleted file mode 100644 index f210223..0000000 --- a/bundles-init/vim-go.cfg.vim +++ /dev/null @@ -1,4 +0,0 @@ -" Terminal support -let g:go_term_enabled = 1 -let g:go_term_mode = "split" -let g:go_term_height = 15 diff --git a/bundles-init/vim-go.load.vim b/bundles-init/vim-go.load.vim deleted file mode 100644 index fdddfa5..0000000 --- a/bundles-init/vim-go.load.vim +++ /dev/null @@ -1 +0,0 @@ -NeoBundle 'fatih/vim-go' diff --git a/bundles-init/vim-javascript-syntax.load.vim b/bundles-init/vim-javascript-syntax.load.vim deleted file mode 100644 index 466b20d..0000000 --- a/bundles-init/vim-javascript-syntax.load.vim +++ /dev/null @@ -1,5 +0,0 @@ -NeoBundleLazy 'jelera/vim-javascript-syntax', { - \ 'autoload': { - \ 'filetypes': [ 'javascript' ] - \ } - \ } diff --git a/bundles-init/vim-json.load.vim b/bundles-init/vim-json.load.vim deleted file mode 100644 index a3e9c42..0000000 --- a/bundles-init/vim-json.load.vim +++ /dev/null @@ -1 +0,0 @@ -NeoBundle 'elzr/vim-json' diff --git a/bundles-init/vim-lsp-settings.load.vim b/bundles-init/vim-lsp-settings.load.vim deleted file mode 100644 index 9fd75c7..0000000 --- a/bundles-init/vim-lsp-settings.load.vim +++ /dev/null @@ -1 +0,0 @@ -NeoBundle 'mattn/vim-lsp-settings' diff --git a/bundles-init/vim-lsp.load.vim b/bundles-init/vim-lsp.load.vim deleted file mode 100644 index 302d13e..0000000 --- a/bundles-init/vim-lsp.load.vim +++ /dev/null @@ -1 +0,0 @@ -NeoBundle 'prabirshrestha/vim-lsp' diff --git a/bundles-init/vim-perl.load.vim b/bundles-init/vim-perl.load.vim deleted file mode 100644 index 278be9e..0000000 --- a/bundles-init/vim-perl.load.vim +++ /dev/null @@ -1 +0,0 @@ -NeoBundle 'vim-perl/vim-perl' diff --git a/bundles-init/vim-powershell.load.vim b/bundles-init/vim-powershell.load.vim deleted file mode 100644 index 3efda37..0000000 --- a/bundles-init/vim-powershell.load.vim +++ /dev/null @@ -1 +0,0 @@ -NeoBundle 'zigford/vim-powershell' diff --git a/bundles-init/vim-terraform.load.vim b/bundles-init/vim-terraform.load.vim deleted file mode 100644 index 87ed54c..0000000 --- a/bundles-init/vim-terraform.load.vim +++ /dev/null @@ -1 +0,0 @@ -NeoBundle 'hashivim/vim-terraform' diff --git a/bundles-init/vim-test.load.vim b/bundles-init/vim-test.load.vim deleted file mode 100644 index e77dfa8..0000000 --- a/bundles-init/vim-test.load.vim +++ /dev/null @@ -1 +0,0 @@ -NeoBundle 'vim-test/vim-test' diff --git a/bundles-init/vim-toml.load.vim b/bundles-init/vim-toml.load.vim deleted file mode 100644 index ef05c67..0000000 --- a/bundles-init/vim-toml.load.vim +++ /dev/null @@ -1 +0,0 @@ -NeoBundle 'cespare/vim-toml' diff --git a/bundles-init/vim-which-key.load.vim b/bundles-init/vim-which-key.load.vim deleted file mode 100644 index 76c5d62..0000000 --- a/bundles-init/vim-which-key.load.vim +++ /dev/null @@ -1 +0,0 @@ -NeoBundle 'tseeker/vim-which-key' diff --git a/bundles-init/vimproc.vim.load.vim b/bundles-init/vimproc.vim.load.vim deleted file mode 100644 index 2d49e3b..0000000 --- a/bundles-init/vimproc.vim.load.vim +++ /dev/null @@ -1,9 +0,0 @@ -NeoBundle 'Shougo/vimproc.vim' , { - \ 'build' : { - \ 'windows' : 'tools\\update-dll-mingw', - \ 'cygwin' : 'make -f make_cygwin.mak', - \ 'mac' : 'make -f make_mac.mak', - \ 'linux' : 'make', - \ 'unix' : 'gmake', - \ }, - \ } diff --git a/cfg-pre/00-vardata.vim b/cfg-pre/00-vardata.vim index 544eccb..b06f32f 100644 --- a/cfg-pre/00-vardata.vim +++ b/cfg-pre/00-vardata.vim @@ -33,7 +33,7 @@ if exists( 'g:vim_vardata' ) elseif $VIM_DATA != "" let s:vim_vardata_base = $VIM_DATA else - let s:vim_vardata_base = $HOME . '/.vimdata' + let s:vim_vardata_base = $HOME . '/.cache/vim' endif " Remove trailing slash diff --git a/cfg-pre/45-leaders.vim b/cfg-pre/45-leaders.vim index 2bbe4d4..ca3e895 100644 --- a/cfg-pre/45-leaders.vim +++ b/cfg-pre/45-leaders.vim @@ -4,4 +4,3 @@ let mapleader = ' ' " Space as leader character let maplocalleader = ',' " Comma as local leader character - diff --git a/cfg-pre/50-local-config.vim b/cfg-pre/50-local-config.vim index 256cc77..ab4102f 100644 --- a/cfg-pre/50-local-config.vim +++ b/cfg-pre/50-local-config.vim @@ -182,9 +182,11 @@ echo "Found local configuration in .vim.local ; validating..." try call CheckSignature( ".vim.local/vimrc" , ".vim.local/signature" ) catch /.*/ + echohl ErrorMsg echo " " echo " -> SIGNATURE VERIFICATION FAILED" echo " " + echohl None finish endtry echo " -> Using local configuration." diff --git a/cfg-pre/75-dein.vim b/cfg-pre/75-dein.vim new file mode 100644 index 0000000..eaf2e30 --- /dev/null +++ b/cfg-pre/75-dein.vim @@ -0,0 +1,74 @@ +" Load and initialise Dein and plugins + +if !exists( "g:bundles_dir" ) + if exists( "g:vim_local['local_bundles']" ) + if !exists( "g:vim_local['vardata']" ) + echo "Local bundles requested, but local data directory is not set." + endif + let g:bundles_dir = GetVardataPath( "bundles" ) + else + let g:bundles_dir = g:vim_vardata . "/bundles/" + endif +endif + +if g:bundles_dir !~ "/$" + let g:bundles_dir = g:bundles_dir . "/" +endif +if !CreateDirectoryIfNecessary( g:bundles_dir ) + unlet g:bundles_dir + function! CheckDeinInstall() + " Empty placeholder function + endfunction + finish +endif + +if has( 'vim_starting' ) + if &compatible + set nocompatible + endif + let s:dein_path = g:bundles_dir . "repos/github.com/Shougo/dein.vim" + if !isdirectory(s:dein_path) + execute '!git clone https://github.com/Shougo/dein.vim' s:dein_path + endif + let &g:runtimepath = &g:runtimepath . "," . s:dein_path +endif + +" Function that sets a hook to be executed before or after a plugin is loaded. +function! LoadPluginHook(plugins_dir, pname, hook, file_ext) + let l:cfgfile = GetConfigFilePath( a:plugins_dir , + \ s:pname . "." . a:file_ext . ".vim" ) + if l:cfgfile != "" + call dein#set_hook(a:pname, "hook_" . a:hook, + \ join(readfile(l:cfgfile), "\n") + \ ) + endif +endfunction + +" Start initializing plugins +call dein#begin( g:bundles_dir ) +call dein#options(#{ + \ lazy_plugins: v:true, + \ install_progress_type: 'floating', + \ }) +call dein#add(s:dein_path) + +" Load all plugins from ${plugins directory}/*.load.vim +let s:plugins_dir = "plugins" +let s:binit_dir = g:vim_home . "/" . s:plugins_dir +let s:bundle_load_files = GetConfigFiles( s:plugins_dir , "*.load.vim" ) +for s:plfn in values( s:bundle_load_files ) + execute "source" s:plfn + + let s:pname = fnamemodify( s:plfn , ":t:r:r" ) + call LoadPluginHook(s:plugins_dir, s:pname, "source", "cfg") + call LoadPluginHook(s:plugins_dir, s:pname, "post_source", "post") +endfor + +call dein#end() + +function! CheckDeinInstall() + " Let Dein check for installations + if dein#check_install() + call dein#install() + endif +endfunction diff --git a/cfg-pre/75-neobundle.vim b/cfg-pre/75-neobundle.vim deleted file mode 100644 index d9246b5..0000000 --- a/cfg-pre/75-neobundle.vim +++ /dev/null @@ -1,71 +0,0 @@ -" Load and initialise NeoBundle and plugins - -if !exists( "g:bundles_dir" ) - if exists( "g:vim_local['local_bundles']" ) - if !exists( "g:vim_local['vardata']" ) - echo "Local bundles requested, but local data directory is not set." - endif - let g:bundles_dir = GetVardataPath( "bundles" ) - else - let g:bundles_dir = g:vim_vardata . "/bundles/" - endif -endif - -if g:bundles_dir !~ "/$" - let g:bundles_dir = g:bundles_dir . "/" -endif -if !CreateDirectoryIfNecessary( g:bundles_dir ) - unlet g:bundles_dir - function! DoNeoBundleCheck() - " Empty placeholder function - endfunction - finish -endif - -if has( 'vim_starting' ) - if &compatible - set nocompatible - endif - - if isdirectory( g:bundles_dir . "neobundle.vim" ) - let s:neobundle_path = g:bundles_dir . "neobundle.vim" - else - let s:neobundle_path = g:vim_home . "/neobundle-initial" - endif - let &g:runtimepath = &g:runtimepath . "," . s:neobundle_path -endif - -call neobundle#begin( g:bundles_dir ) - -" Load NeoBundle itself, as well as VimProc -NeoBundleFetch 'Shougo/neobundle.vim' - -" Load all plugins from bundles-init/*.load.vim -let s:binit_dir = g:vim_home . "/bundles-init" -let s:bundle_load_files = GetConfigFiles( "bundles-init" , "*.load.vim" ) -for s:plfn in values( s:bundle_load_files ) - execute "source" s:plfn - - " Create configuration loading hooks - let s:pname = fnamemodify( s:plfn , ":t:r:r" ) - let s:bundle = neobundle#get( s:pname ) - if empty( s:bundle ) - continue - endif - - function! s:bundle.hooks.on_post_source( bundle ) - let cfgfile = GetConfigFilePath( "bundles-init" , - \ a:bundle.name . ".cfg.vim" ) - if l:cfgfile != "" - execute "source" l:cfgfile - endif - endfunction -endfor - -call neobundle#end() - -function! DoNeoBundleCheck() - " Let NeoBundle check for installations - NeoBundleCheck - call neobundle#call_hook( "on_post_source" ) -endfunction diff --git a/cfg/03-x-copy.vim b/cfg/03-x-copy.vim index 1dffd1c..63fe264 100644 --- a/cfg/03-x-copy.vim +++ b/cfg/03-x-copy.vim @@ -1,2 +1,2 @@ -" Map Ctrl+C to X-compatable copy +" Map Ctrl+C to X-compatible copy vnoremap "+y diff --git a/cfg/05-cursor.vim b/cfg/05-cursor.vim index 797ab11..e407a4b 100644 --- a/cfg/05-cursor.vim +++ b/cfg/05-cursor.vim @@ -10,3 +10,8 @@ endfunction set cursorline number nnoremap oc :set cursorline! cursorcolumn! nnoremap oC :call ToggleCursorMode() + +" Use a bar-like cursor in insert mode, and a blinking block in replace mode +let &t_SI = "\e[6 q" +let &t_SR = "\e[0 q" +let &t_EI = "\e[2 q" diff --git a/cfg/05-tabs.vim b/cfg/05-tabs.vim deleted file mode 100644 index 2c00601..0000000 --- a/cfg/05-tabs.vim +++ /dev/null @@ -1,7 +0,0 @@ -" Keys to control (actual) tabs -nnoremap :tabnew -nnoremap :tabclose -nnoremap :tabprevious -nnoremap :tabnext -nnoremap :execute 'silent! tabmove ' . (tabpagenr()-2) -nnoremap :execute 'silent! tabmove ' . tabpagenr() diff --git a/cfg/15-buffers.vim b/cfg/15-buffers.vim index 244e919..6f108aa 100644 --- a/cfg/15-buffers.vim +++ b/cfg/15-buffers.vim @@ -1,9 +1,5 @@ set hidden " Don't close buffers -" Buffer navigation -nnoremap :bprev -nnoremap :bnext - " Close buffer function CloseCurrentBuffer( ) let btarget = bufnr( '%' ) @@ -42,4 +38,14 @@ function CloseCurrentBuffer( ) execute l:wcurrent . 'wincmd w' endfunction +" Buffer navigation (Ctrl, Shift, Arrows...) +nnoremap :bprev +nnoremap :bnext nnoremap :call CloseCurrentBuffer() + +" Buffer navigation (Space sequences) +nnoremap bz :enew +nnoremap bq :bprev +nnoremap bd :bnext +nnoremap bw :call CloseCurrentBuffer() +nnoremap bW :bufdo call CloseCurrentBuffer() diff --git a/cfg/20-plugins.vim b/cfg/20-plugins.vim index cf3cb4a..9d1740b 100644 --- a/cfg/20-plugins.vim +++ b/cfg/20-plugins.vim @@ -1,7 +1,2 @@ -" Force NeoBundle to check the loaded plugins and install them - -call DoNeoBundleCheck( ) - -" Add key mappings for updates and installation -nnoremap Pu :NeoBundleCheckUpdate -nnoremap Pi :call DoNeoBundleCheck() +" Force Dein to check the loaded plugins and install them +call CheckDeinInstall( ) diff --git a/cfg/30-nerdtree-auto.vim b/cfg/30-nerdtree-auto.vim new file mode 100644 index 0000000..bdae226 --- /dev/null +++ b/cfg/30-nerdtree-auto.vim @@ -0,0 +1,6 @@ +" Open automatically NERDTree if there are more than 150 columns and no file was +" specified +autocmd VimEnter * if argc() == 0 && &columns > 150 + \ | call dein#source("nerdtree") + \ | NERDTree + \ | endif diff --git a/cfg/90-quickfix-toggle.vim b/cfg/90-quickfix-toggle.vim index 87bbd72..4b29e43 100644 --- a/cfg/90-quickfix-toggle.vim +++ b/cfg/90-quickfix-toggle.vim @@ -1,3 +1,6 @@ +" Toggle, open or close the quickfix window. The first argument is the size +" (0 for automatic), and the second argument, if present, determines which +" action to perform: 0 forces the window closed, 1 opens it, and 2 toggles it. function! ToggleQuickfix(size, ...) let l:mode = (a:0 == 0)? 2 : (a:1) function! s:WindowCheck(mode) @@ -39,5 +42,9 @@ function! ToggleQuickfix(size, ...) noautocmd silent! exec ''.l:winnr.'wincmd w' endfunc +command! -bar QuickfixClose call ToggleQuickfix(0, 0) +command! -bar QuickfixOpen call ToggleQuickfix(0, 1) +command! -bar QuickfixToggle call ToggleQuickfix(0, 2) + nmap :call ToggleQuickfix(0) nmap q :call ToggleQuickfix(0) diff --git a/neobundle-initial b/neobundle-initial deleted file mode 160000 index f5ace1d..0000000 --- a/neobundle-initial +++ /dev/null @@ -1 +0,0 @@ -Subproject commit f5ace1d749382ab5e5a22670d57c61303a927b72 diff --git a/plugins/async.vim.load.vim b/plugins/async.vim.load.vim new file mode 100644 index 0000000..d0ab7f7 --- /dev/null +++ b/plugins/async.vim.load.vim @@ -0,0 +1,3 @@ +call dein#add('prabirshrestha/async.vim', #{ + \ lazy: 1, + \ }) diff --git a/plugins/asyncomplete-lsp.vim.load.vim b/plugins/asyncomplete-lsp.vim.load.vim new file mode 100644 index 0000000..9abf418 --- /dev/null +++ b/plugins/asyncomplete-lsp.vim.load.vim @@ -0,0 +1,4 @@ +call dein#add('prabirshrestha/asyncomplete-lsp.vim', #{ + \ lazy: 1, + \ on_event: 'VimEnter', + \ }) diff --git a/plugins/asyncomplete.vim.load.vim b/plugins/asyncomplete.vim.load.vim new file mode 100644 index 0000000..9e94672 --- /dev/null +++ b/plugins/asyncomplete.vim.load.vim @@ -0,0 +1,4 @@ +call dein#add('prabirshrestha/asyncomplete.vim', #{ + \ lazy: 1, + \ on_event: 'VimEnter', + \ }) diff --git a/bundles-init/asyncrun.vim.cfg.vim b/plugins/asyncrun.vim.cfg.vim similarity index 100% rename from bundles-init/asyncrun.vim.cfg.vim rename to plugins/asyncrun.vim.cfg.vim diff --git a/plugins/asyncrun.vim.load.vim b/plugins/asyncrun.vim.load.vim new file mode 100644 index 0000000..684be1c --- /dev/null +++ b/plugins/asyncrun.vim.load.vim @@ -0,0 +1,5 @@ +call dein#add('skywind3000/asyncrun.vim', #{ + \ lazy: 1, + \ on_cmd: ['AsyncRun', 'AsyncStop'], + \ on_source: ['vim-test'], + \ }) diff --git a/bundles-init/ctrlp.vim.cfg.vim b/plugins/ctrlp.vim.cfg.vim similarity index 52% rename from bundles-init/ctrlp.vim.cfg.vim rename to plugins/ctrlp.vim.cfg.vim index 7fca27a..331583c 100644 --- a/bundles-init/ctrlp.vim.cfg.vim +++ b/plugins/ctrlp.vim.cfg.vim @@ -1,6 +1,2 @@ let g:ctrlp_working_path_mode = '' " Disable CtrlP-controlled chdir let g:ctrlp_map = '' " Disable default mapping - -nnoremap pp :CtrlPBuffer -nnoremap po :CtrlPMRUFiles -nnoremap pi :CtrlP diff --git a/plugins/ctrlp.vim.load.vim b/plugins/ctrlp.vim.load.vim new file mode 100644 index 0000000..2321c73 --- /dev/null +++ b/plugins/ctrlp.vim.load.vim @@ -0,0 +1,8 @@ +call dein#add('ctrlpvim/ctrlp.vim', #{ + \ lazy: 1, + \ on_cmd: ['CtrlPBuffer', 'CtrlPMRUFiles', 'CtrlP'] + \ }) + +nnoremap pp :CtrlPBuffer +nnoremap po :CtrlPMRUFiles +nnoremap pi :CtrlP diff --git a/plugins/ctrlp.vim.post.vim b/plugins/ctrlp.vim.post.vim new file mode 100644 index 0000000..c4e78b7 --- /dev/null +++ b/plugins/ctrlp.vim.post.vim @@ -0,0 +1,3 @@ +" Force vim-airline to load the CtrlP extension +let g:airline_extensions = ['ctrlp'] +call airline#extensions#load() diff --git a/plugins/dein-ui.vim.load.vim b/plugins/dein-ui.vim.load.vim new file mode 100644 index 0000000..5b773dc --- /dev/null +++ b/plugins/dein-ui.vim.load.vim @@ -0,0 +1,8 @@ +call dein#add('wsdjeg/dein-ui.vim', #{ + \ lazy: 1, + \ on_cmd: ['DeinUpdate'], + \ }) + +" Add key mappings for updates and installation +nnoremap Pu :DeinUpdate +nnoremap Pi :call CheckDeinInstall() diff --git a/plugins/jinja2.load.vim b/plugins/jinja2.load.vim new file mode 100644 index 0000000..393cfcd --- /dev/null +++ b/plugins/jinja2.load.vim @@ -0,0 +1,5 @@ +call dein#add('Glench/Vim-Jinja2-Syntax', #{ + \ lazy: 1, + \ merge_ftdetect: v:true, + \ on_ft: ['jinja'], + \ }) diff --git a/plugins/nerdtree-git-plugin.load.vim b/plugins/nerdtree-git-plugin.load.vim new file mode 100644 index 0000000..5cc4a10 --- /dev/null +++ b/plugins/nerdtree-git-plugin.load.vim @@ -0,0 +1,4 @@ +call dein#add('Xuyuanp/nerdtree-git-plugin', #{ + \ lazy: 1, + \ on_source: 'nerdtree', + \ }) diff --git a/bundles-init/nerdtree.cfg.vim b/plugins/nerdtree.cfg.vim similarity index 62% rename from bundles-init/nerdtree.cfg.vim rename to plugins/nerdtree.cfg.vim index e4162df..5999e1f 100644 --- a/bundles-init/nerdtree.cfg.vim +++ b/plugins/nerdtree.cfg.vim @@ -1,9 +1,5 @@ " NERDTree: ' e' = toggle side bar let g:NERDTreeGitStatusUpdateOnWrite = 1 -nnoremap e :NERDTreeToggle - -" Open automatically if there are more than 150 columns and no file was specified -autocmd VimEnter * if argc() == 0 && &columns > 150 | NERDTree | endif " Set the bookmarks file's path let g:NERDTreeBookmarksFile = GetVardataPath( 'NTBookmarks' ) diff --git a/plugins/nerdtree.load.vim b/plugins/nerdtree.load.vim new file mode 100644 index 0000000..c63f007 --- /dev/null +++ b/plugins/nerdtree.load.vim @@ -0,0 +1,6 @@ +call dein#add('scrooloose/nerdtree', #{ + \ lazy: 1, + \ on_cmd: [ 'NERDTree', 'NERDTreeToggle' ], + \ }) + +nnoremap e :NERDTreeToggle diff --git a/plugins/rust.vim.cfg.vim b/plugins/rust.vim.cfg.vim new file mode 100644 index 0000000..639877f --- /dev/null +++ b/plugins/rust.vim.cfg.vim @@ -0,0 +1,2 @@ +" Format Rust code automatically +let g:rustfmt_autosave = 1 diff --git a/plugins/rust.vim.load.vim b/plugins/rust.vim.load.vim new file mode 100644 index 0000000..5e44d07 --- /dev/null +++ b/plugins/rust.vim.load.vim @@ -0,0 +1,6 @@ +call dein#add('rust-lang/rust.vim', #{ + \ lazy: 1, + \ merge_ftdetect: v:true, + \ on_ft: ['rust'], + \ on_cmd: ['Cargo', 'RustFmt', 'RustRun', 'RustExpand', 'RustTest'] + \ }) diff --git a/bundles-init/undotree.cfg.vim b/plugins/undotree.cfg.vim similarity index 54% rename from bundles-init/undotree.cfg.vim rename to plugins/undotree.cfg.vim index b408cbf..a2c9c1b 100644 --- a/bundles-init/undotree.cfg.vim +++ b/plugins/undotree.cfg.vim @@ -1,5 +1,2 @@ -" Keyboard shortcut -nnoremap u :UndotreeToggle - " Hide the sign column autocmd FileType undotree setlocal signcolumn=no diff --git a/plugins/undotree.load.vim b/plugins/undotree.load.vim new file mode 100644 index 0000000..7fa5901 --- /dev/null +++ b/plugins/undotree.load.vim @@ -0,0 +1,6 @@ +call dein#add('mbbill/undotree', #{ + \ lazy: 1 , + \ on_cmd: [ 'UndotreeShow', 'UndotreeToggle' ], + \ }) + +nnoremap u :UndotreeToggle diff --git a/plugins/vim-airline-themes.load.vim b/plugins/vim-airline-themes.load.vim new file mode 100644 index 0000000..56e110b --- /dev/null +++ b/plugins/vim-airline-themes.load.vim @@ -0,0 +1,4 @@ +call dein#add('vim-airline/vim-airline-themes', #{ + \ lazy: 1, + \ on_event: 'VimEnter', + \ }) diff --git a/bundles-init/vim-airline-themes.cfg.vim b/plugins/vim-airline-themes.post.vim similarity index 100% rename from bundles-init/vim-airline-themes.cfg.vim rename to plugins/vim-airline-themes.post.vim diff --git a/plugins/vim-airline.cfg.vim b/plugins/vim-airline.cfg.vim new file mode 100644 index 0000000..b8d6dfe --- /dev/null +++ b/plugins/vim-airline.cfg.vim @@ -0,0 +1,12 @@ +" Use powerline fonts +let g:airline_powerline_fonts = 1 +" Show buffers / tabs at the top +let g:airline#extensions#tabline#enabled = 1 +" Buffer name formatter +let g:airline#extensions#tabline#formatter = 'unique_tail_improved' +" Show the list of buffers +let g:airline#extensions#tabline#show_buffers = 1 +" Show the list of tabs +let g:airline#extensions#tabline#show_tabs = 1 +" Always show status line +set laststatus=2 diff --git a/plugins/vim-airline.load.vim b/plugins/vim-airline.load.vim new file mode 100644 index 0000000..d14d24f --- /dev/null +++ b/plugins/vim-airline.load.vim @@ -0,0 +1,3 @@ +call dein#add('bling/vim-airline', #{ + \ lazy: 1, + \ }) diff --git a/plugins/vim-cpp-enhanced-highlight.load.vim b/plugins/vim-cpp-enhanced-highlight.load.vim new file mode 100644 index 0000000..c5e11f0 --- /dev/null +++ b/plugins/vim-cpp-enhanced-highlight.load.vim @@ -0,0 +1,4 @@ +call dein#add('octol/vim-cpp-enhanced-highlight', #{ + \ lazy: 1, + \ on_ft: ['cpp'], + \ }) diff --git a/plugins/vim-flog.load.vim b/plugins/vim-flog.load.vim new file mode 100644 index 0000000..d4cef64 --- /dev/null +++ b/plugins/vim-flog.load.vim @@ -0,0 +1,9 @@ +call dein#add('rbong/vim-flog', #{ + \ lazy: 1, + \ merge_ftdetect: v:true, + \ on_cmd: ['Flog', 'Flogsplit'], + \ }) + +" Key mappings +nmap gL :Flog +nmap gl :Flogsplit diff --git a/plugins/vim-fugitive.cfg.vim b/plugins/vim-fugitive.cfg.vim new file mode 100644 index 0000000..734b256 --- /dev/null +++ b/plugins/vim-fugitive.cfg.vim @@ -0,0 +1,16 @@ +" Don't display useless columns in the Git status window +autocmd FileType fugitive setlocal signcolumn=no nonumber norelativenumber + +" Timeouts need to be disabled in the Git status window. We need to switch +" them off when entering it, and on when leaving it. +let s:in_fugitive_buffer = v:false +autocmd BufEnter * + \ if &ft ==# 'fugitive' + \ | set notimeout + \ | let s:in_fugitive_buffer = v:true + \ | endif +autocmd BufLeave * + \ if s:in_fugitive_buffer + \ | let s:in_fugitive_buffer = v:false + \ | set timeout + \ | endif diff --git a/bundles-init/vim-fugitive.cfg.vim b/plugins/vim-fugitive.load.vim similarity index 84% rename from bundles-init/vim-fugitive.cfg.vim rename to plugins/vim-fugitive.load.vim index b4483c5..4578792 100644 --- a/bundles-init/vim-fugitive.cfg.vim +++ b/plugins/vim-fugitive.load.vim @@ -1,3 +1,8 @@ +call dein#add('tpope/vim-fugitive', #{ + \ lazy: 1, + \ on_source: 'vim-airline', + \ }) + " Fugitive commands that don't require interaction with GitGutter or NERDTree nnoremap ga :Git add %:p nnoremap gd :Gvdiffsplit @@ -5,6 +10,7 @@ nnoremap gs :Git nnoremap gc :Git commit -q nnoremap gz :Git reset %:p nnoremap gb :Git branch +nnoremap gP :Git! push " Note: dangerous commands don't have a . Also commands that need " arguments, obviously. @@ -12,6 +18,5 @@ nnoremap gB :Git checkout -b nnoremap gC :Git checkout nnoremap gM :GMove nnoremap gp :Git pull --recurse-submodules -nnoremap gP :Git push nnoremap gr :GRename nnoremap gR :GRemove diff --git a/bundles-init/vim-gitgutter.cfg.vim b/plugins/vim-gitgutter.cfg.vim similarity index 51% rename from bundles-init/vim-gitgutter.cfg.vim rename to plugins/vim-gitgutter.cfg.vim index 9124232..cc797d3 100644 --- a/bundles-init/vim-gitgutter.cfg.vim +++ b/plugins/vim-gitgutter.cfg.vim @@ -1,9 +1,28 @@ -" Key maps +" Function that generates the list of hunks and opens the quickfix window +function! ShowGitGutterQuickfix() + exe "GitGutterQuickFix" + call ToggleQuickfix(0, 1) +endfunction + +" Function that toggles the hunk preview window. +function! ToggleHunkPreviewWindow() + if gitgutter#hunk#is_preview_window_open() + call gitgutter#hunk#close_hunk_preview_window() + else + exe "GitGutterPreviewHunk" + endif +endfunction + +" Don't register default key mappings let g:gitgutter_map_keys = 0 + +" Keyboard mappings. nnoremap g< :GitGutterPrevHunk nnoremap g> :GitGutterNextHunk nnoremap g+ :GitGutterStageHunk -nnoremap g- :GitGutterRevertHunk +nnoremap g- :GitGutterUndoHunk +nnoremap gq :call ShowGitGutterQuickfix() +nnoremap g* :call ToggleHunkPreviewWindow() " Symbols let g:gitgutter_sign_added = '+' diff --git a/plugins/vim-gitgutter.load.vim b/plugins/vim-gitgutter.load.vim new file mode 100644 index 0000000..1d235ab --- /dev/null +++ b/plugins/vim-gitgutter.load.vim @@ -0,0 +1,4 @@ +call dein#add('airblade/vim-gitgutter', #{ + \ lazy: 1, + \ on_source: 'vim-airline', + \ }) diff --git a/plugins/vim-glsl.load.vim b/plugins/vim-glsl.load.vim new file mode 100644 index 0000000..b43d96d --- /dev/null +++ b/plugins/vim-glsl.load.vim @@ -0,0 +1,5 @@ +call dein#add('tikhomirov/vim-glsl', #{ + \ lazy: 1, + \ merge_ftdetect: v:true, + \ on_ft: ['glsl', 'html'], + \ }) diff --git a/plugins/vim-go.cfg.vim b/plugins/vim-go.cfg.vim new file mode 100644 index 0000000..3715b23 --- /dev/null +++ b/plugins/vim-go.cfg.vim @@ -0,0 +1,14 @@ +" Terminal support +let g:go_term_enabled = 1 +let g:go_term_mode = "split" +let g:go_term_height = 15 + +" Highlighting +let g:go_highlight_functions = 1 +let g:go_highlight_function_calls = 1 +let g:go_highlight_structs = 1 +let g:go_highlight_operators = 1 +let g:go_highlight_build_constraints = 1 + +" Formatting +let g:go_fmt_command = 'gopls' diff --git a/plugins/vim-go.load.vim b/plugins/vim-go.load.vim new file mode 100644 index 0000000..20afe10 --- /dev/null +++ b/plugins/vim-go.load.vim @@ -0,0 +1,32 @@ +call dein#add('fatih/vim-go', #{ + \ lazy: 1, + \ merge_ftdetect: v:true, + \ on_ft: ['go', 'gohtmltmpl', 'gosum', 'gowork'], + \ on_cmd: [ + \ 'GoReportGitHubIssue', 'GoPath', 'GoImport', + \ 'GoImportAs', 'GoDrop', 'GoLint', 'GoDoc', + \ 'GoDocBrowser', 'GoFmt', 'GoImports', 'GoPlay', + \ 'GoVet', 'GoDef', 'GoDefType', 'GoDefStack', + \ 'GoDefStackClear', 'GoDefPop', 'GoRun', 'GoBuild', + \ 'GoGenerate', 'GoInfo', 'GoInstall', 'GoTest', + \ 'GoTestFile', 'GoTestFunc', 'GoTestCompile', + \ 'GoCoverage', 'GoCoverageToggle', 'GoCoverageClear', + \ 'GoCoverageBrowser', 'GoCoverageOverlay', + \ 'GoErrCheck', 'GoFiles', 'GoDeps', + \ 'GoInstallBinaries', 'GoUpdateBinaries', + \ 'GoImplements', 'GoRename', 'GoGuruScope', + \ 'GoCallees', 'GoCallers', 'GoDescribe', 'GoCallstack', + \ 'GoFreevars', 'GoChannelPeers', 'GoReferrers', + \ 'GoSameIds', 'GoSameIdsClear', 'GoSameIdsToggle', + \ 'GoSameIdsAutoToggle', 'GoMetaLinter', + \ 'GoDiagnostics', 'GoBuildTags', 'AsmFmt', + \ 'GoAlternate', 'GoPointsTo', 'GoWhicherrs', 'GoDecls', + \ 'GoDeclsDir', 'GoImpl', 'GoAddTags', 'GoRemoveTags', + \ 'GoAutoTypeInfoToggle', 'GoFmtAutoSaveToggle', + \ 'GoModFmtAutoSaveToggle', 'GoAsmFmtAutoSaveToggle', + \ 'GoMetaLinterAutoSaveToggle', + \ 'GoTemplateAutoCreateToggle', 'GoKeyify', + \ 'GoFillStruct', 'GoIfErr', 'GoModFmt', 'GoModReload', + \ 'GoAddWorkspace', 'GoLSPDebugBrowser', 'GoExtract' + \ ], + \ }) diff --git a/plugins/vim-json.load.vim b/plugins/vim-json.load.vim new file mode 100644 index 0000000..562d793 --- /dev/null +++ b/plugins/vim-json.load.vim @@ -0,0 +1,5 @@ +call dein#add('elzr/vim-json', #{ + \ lazy: 1, + \ merge_ftdetect: v:true, + \ on_ft: ['json'], + \ }) diff --git a/bundles-init/vim-lsp-settings.cfg.vim b/plugins/vim-lsp-settings.cfg.vim similarity index 86% rename from bundles-init/vim-lsp-settings.cfg.vim rename to plugins/vim-lsp-settings.cfg.vim index bd2d2c2..81f8456 100644 --- a/bundles-init/vim-lsp-settings.cfg.vim +++ b/plugins/vim-lsp-settings.cfg.vim @@ -17,3 +17,5 @@ let g:lsp_settings = { \ } \ }, \} + +let g:lsp_settings['pylsp'] = g:lsp_settings['pylsp-all'] diff --git a/plugins/vim-lsp-settings.load.vim b/plugins/vim-lsp-settings.load.vim new file mode 100644 index 0000000..9a9aec9 --- /dev/null +++ b/plugins/vim-lsp-settings.load.vim @@ -0,0 +1,4 @@ +call dein#add('mattn/vim-lsp-settings', #{ + \ lazy: 1, + \ on_event: 'VimEnter', + \ }) diff --git a/bundles-init/vim-lsp.cfg.vim b/plugins/vim-lsp.cfg.vim similarity index 100% rename from bundles-init/vim-lsp.cfg.vim rename to plugins/vim-lsp.cfg.vim diff --git a/plugins/vim-lsp.load.vim b/plugins/vim-lsp.load.vim new file mode 100644 index 0000000..bcd59a4 --- /dev/null +++ b/plugins/vim-lsp.load.vim @@ -0,0 +1,4 @@ +call dein#add('prabirshrestha/vim-lsp', #{ + \ lazy: 1, + \ on_event: 'VimEnter', + \ }) diff --git a/plugins/vim-perl.load.vim b/plugins/vim-perl.load.vim new file mode 100644 index 0000000..9518696 --- /dev/null +++ b/plugins/vim-perl.load.vim @@ -0,0 +1,6 @@ +call dein#add('vim-perl/vim-perl', #{ + \ lazy: 1, + \ on_ft: ['perl'], + \ merged: 0, + \ build: 'make clean carp dancer highlight-all-pragmas moose test-more try-tiny', + \ }) diff --git a/plugins/vim-ps1.load.vim b/plugins/vim-ps1.load.vim new file mode 100644 index 0000000..4753140 --- /dev/null +++ b/plugins/vim-ps1.load.vim @@ -0,0 +1,5 @@ +call dein#add('PProvost/vim-ps1', #{ + \ lazy: 1, + \ merge_ftdetect: v:true, + \ on_ft: ['ps1', 'ps1xml'], + \ }) diff --git a/plugins/vim-terraform.cfg.vim b/plugins/vim-terraform.cfg.vim new file mode 100644 index 0000000..eed9aa1 --- /dev/null +++ b/plugins/vim-terraform.cfg.vim @@ -0,0 +1,2 @@ +" Format Terraform files automatically +let g:terraform_fmt_on_save = 1 diff --git a/plugins/vim-terraform.load.vim b/plugins/vim-terraform.load.vim new file mode 100644 index 0000000..a2a124f --- /dev/null +++ b/plugins/vim-terraform.load.vim @@ -0,0 +1,6 @@ +call dein#add('hashivim/vim-terraform', #{ + \ lazy: 1, + \ merge_ftdetect: v:true, + \ on_ft: ['hcl', 'terraform'], + \ on_cmd: ['Terraform', 'TerraformFmt'] + \ }) diff --git a/bundles-init/vim-test.cfg.vim b/plugins/vim-test.load.vim similarity index 55% rename from bundles-init/vim-test.cfg.vim rename to plugins/vim-test.load.vim index 933be8a..26a42a5 100644 --- a/bundles-init/vim-test.cfg.vim +++ b/plugins/vim-test.load.vim @@ -1,8 +1,17 @@ -" Run tests in the background, send results to the quickfix window -let test#strategy = 'asyncrun_background' +call dein#add('vim-test/vim-test', #{ + \ lazy: 1, + \ on_cmd: [ + \ 'TestSuite', 'TestFile', 'TestNearest', 'TestLast', + \ 'TestVisit', 'TestClass', + \ ], + \ }) " Shortcuts nmap Ta :TestSuite nmap Tf :TestFile nmap Tc :TestNearest nmap TT :TestLast + +" Run tests in the background, send results to the quickfix window +" NOTE: this must be set in this file, not in a .cfg / .post file +let test#strategy = 'asyncrun_background' diff --git a/plugins/vim-toml.load.vim b/plugins/vim-toml.load.vim new file mode 100644 index 0000000..d25ae07 --- /dev/null +++ b/plugins/vim-toml.load.vim @@ -0,0 +1,5 @@ +call dein#add('cespare/vim-toml', #{ + \ lazy: 1, + \ merge_ftdetect: v:true, + \ on_ft: ['toml'], + \ }) diff --git a/plugins/vim-which-key.load.vim b/plugins/vim-which-key.load.vim new file mode 100644 index 0000000..b2dca45 --- /dev/null +++ b/plugins/vim-which-key.load.vim @@ -0,0 +1,4 @@ +call dein#add('liuchengxu/vim-which-key', #{ + \ lazy: 1, + \ on_map: #{ n: '' }, + \ }) diff --git a/bundles-init/vim-which-key.cfg.vim b/plugins/vim-which-key.post.vim similarity index 89% rename from bundles-init/vim-which-key.cfg.vim rename to plugins/vim-which-key.post.vim index 73ab423..81fb275 100644 --- a/bundles-init/vim-which-key.cfg.vim +++ b/plugins/vim-which-key.post.vim @@ -2,7 +2,6 @@ nnoremap :WhichKey '' let g:which_key_map = {} call which_key#register('', 'g:which_key_map') -let g:which_key_fallback_to_native_key = 1 " Direct commands let g:which_key_map[' '] = [ 'call feedkeys(":nohlsearch\n")' , 'clear-search' ] @@ -21,6 +20,14 @@ let g:which_key_map.o.p = 'paste' let g:which_key_map.o.w = 'whitespace' let g:which_key_map.o.s = 'sign-column' +" Buffers +let g:which_key_map.b = { 'name' : '+buffers' } +let g:which_key_map.b.W = 'close-all' +let g:which_key_map.b.d = 'next' +let g:which_key_map.b.q = 'previous' +let g:which_key_map.b.w = 'close' +let g:which_key_map.b.z = 'new' + " Fuzzy finder let g:which_key_map.p = { 'name' : '+fuzzy-finder' } let g:which_key_map.p.p = 'buffers' @@ -29,8 +36,9 @@ let g:which_key_map.p.i = 'open-file' " Git commands let g:which_key_map.g = { 'name' : '+git' } +let g:which_key_map.g['*'] = 'hunk-preview' let g:which_key_map.g['+'] = 'add-hunk' -let g:which_key_map.g['-'] = 'revert-hunk' +let g:which_key_map.g['-'] = 'undo-hunk' let g:which_key_map.g['<'] = 'previous-hunk' let g:which_key_map.g['>'] = 'next-hunk' let g:which_key_map.g.a = 'add-file' @@ -39,6 +47,7 @@ let g:which_key_map.g.B = 'new-branch' let g:which_key_map.g.C = 'checkout-branch' let g:which_key_map.g.c = 'commit' let g:which_key_map.g.d = 'diff' +let g:which_key_map.g.q = 'show-hunks' let g:which_key_map.g.L = 'log-full' let g:which_key_map.g.l = 'log-split' let g:which_key_map.g.M = 'move' diff --git a/vimrc b/vimrc index 4856a3d..5d2067a 100644 --- a/vimrc +++ b/vimrc @@ -3,7 +3,7 @@ " If another runtime directory is specified, use it let s:own_path = expand( ':p:h' ) -let $VIM_HOME = $VIM_HOME == '' ? '' +let $VIM_HOME = $VIM_HOME == '' ? '' \ : fnamemodify( $VIM_HOME . '/x' , ':p:h' ) if $VIM_HOME == '' || $VIM_HOME == s:own_path