From 5ff9164f0a89294cfa5da750b427e830b48e409f Mon Sep 17 00:00:00 2001 From: "Juan J. Martinez" Date: Wed, 22 Jan 2020 09:26:15 +0000 Subject: Migrated to vim-plug --- .gitignore | 1 + .gitmodules | 45 ------ README.md | 42 +++--- autoload/pathogen.vim | 328 ------------------------------------------- bundle/fugitive | 1 - bundle/gen_tags.vim | 1 - bundle/gruvbox-community | 1 - bundle/nerdtree | 1 - bundle/syntastic | 1 - bundle/tcomment_vim | 1 - bundle/terminus | 1 - bundle/vim-autoformat | 1 - bundle/vim-bufkill | 1 - bundle/vim-gitgutter | 1 - bundle/vim-go | 1 - bundle/vim-lsc | 1 - bundle/vim-tmux-clipboard | 1 - bundle/vim-tmux-focus-events | 1 - bundle/vim-z80 | 1 - gvimrc | 14 -- vimrc | 33 ++++- 21 files changed, 46 insertions(+), 432 deletions(-) delete mode 100644 .gitmodules delete mode 100644 autoload/pathogen.vim delete mode 160000 bundle/fugitive delete mode 160000 bundle/gen_tags.vim delete mode 160000 bundle/gruvbox-community delete mode 160000 bundle/nerdtree delete mode 160000 bundle/syntastic delete mode 160000 bundle/tcomment_vim delete mode 160000 bundle/terminus delete mode 160000 bundle/vim-autoformat delete mode 160000 bundle/vim-bufkill delete mode 160000 bundle/vim-gitgutter delete mode 160000 bundle/vim-go delete mode 160000 bundle/vim-lsc delete mode 160000 bundle/vim-tmux-clipboard delete mode 160000 bundle/vim-tmux-focus-events delete mode 160000 bundle/vim-z80 delete mode 100644 gvimrc diff --git a/.gitignore b/.gitignore index 2ad9359..1560e33 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ .netrwhist .tags +plugged/ diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index ec35967..0000000 --- a/.gitmodules +++ /dev/null @@ -1,45 +0,0 @@ -[submodule "bundle/syntastic"] - path = bundle/syntastic - url = https://github.com/scrooloose/syntastic.git -[submodule "bundle/vim-autoformat"] - path = bundle/vim-autoformat - url = https://github.com/Chiel92/vim-autoformat -[submodule "bundle/vim-go"] - path = bundle/vim-go - url = https://github.com/fatih/vim-go.git -[submodule "bundle/fugitive"] - path = bundle/fugitive - url = https://github.com/tpope/vim-fugitive.git -[submodule "bundle/nerdtree"] - path = bundle/nerdtree - url = https://github.com/scrooloose/nerdtree.git -[submodule "bundle/tcomment_vim"] - path = bundle/tcomment_vim - url = https://github.com/tomtom/tcomment_vim -[submodule "bundle/vim-gitgutter"] - path = bundle/vim-gitgutter - url = git://github.com/airblade/vim-gitgutter.git -[submodule "bundle/vim-z80"] - path = bundle/vim-z80 - url = https://github.com/samsaga2/vim-z80.git -[submodule "bundle/vim-tmux-focus-events"] - path = bundle/vim-tmux-focus-events - url = https://github.com/tmux-plugins/vim-tmux-focus-events.git -[submodule "bundle/vim-tmux-clipboard"] - path = bundle/vim-tmux-clipboard - url = https://github.com/roxma/vim-tmux-clipboard.git -[submodule "bundle/gen_tags.vim"] - path = bundle/gen_tags.vim - url = https://github.com/jsfaint/gen_tags.vim.git -[submodule "bundle/terminus"] - path = bundle/terminus - url = https://github.com/wincent/terminus -[submodule "bundle/vim-bufkill"] - path = bundle/vim-bufkill - url = https://github.com/qpkorr/vim-bufkill -[submodule "bundle/gruvbox-community"] - path = bundle/gruvbox-community - url = https://github.com/gruvbox-community/gruvbox.git -[submodule "bundle/vim-lsc"] - path = bundle/vim-lsc - url = https://github.com/natebosch/vim-lsc.git diff --git a/README.md b/README.md index ebcfa28..2003352 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,7 @@ # My ~/.vim -I borrowed from different sources, one of them being this: - -https://gist.github.com/manasthakur/d4dc9a610884c60d944a4dd97f0b3560 - -Few differences: - - - My repo is in `~/.vim/` - - I use pathogen to manage the plugins (should move to Vim 8's packages, but I - still have few Vim 7.x boxes) - - Includes gvim configuration (outdated, I don't use it anymore) +Managed by [vim-plug](https://github.com/junegunn/vim-plug) and compatible with +Neovim. For further information on installed plugins: @@ -17,7 +9,7 @@ For further information on installed plugins: ## Using it in a new location -You shouldn't have a `~/.vimrc` or `~/.vim` directory. +My repo is in `~/.vim/`! You shouldn't have a `~/.vimrc` or `~/.vim` directory. cd && git clone --recursive https://github.com/reidrac/dotvim.git .vim @@ -28,29 +20,27 @@ If you're not using vim 8; create a `.vimrc` with: This can be also be used to customise your local vim configuration without having uncommitted changes in your repository. -## Adding plugins +In case of Neovim, you can link the provided `init.vim` into `~/.config/nvim/init.vim`. - git submodule add https://github.com/user/foo.git bundle/foo - git commit -m "Added foo plugin" +Then it is recommended you run: -## Updating plugins + :PlugUpgrade + :PlugInstall - git submodule foreach git pull origin master - git commit -am "Updated plugins" +The *upgrade* part is only needed if the plugin manager is not up to date. Then +you can commit and push the updated version. -### Updating you .vim on a different machine +## Adding plugins - git pull +Add a new `Plug` entry in `~/.vim/vimrc`. - # Only if a plugin was added - git submodule init +## Updating plugins - git submodule update + :PlugUpdate ## Removing plugins - git submodule deinit -f bundle/foo - git rm -r bundle/foo - git commit -am "Removed plugin" - rm -rf .git/modules/bundle/foo +Remove the `Plug` line and run: + + :PlugClean diff --git a/autoload/pathogen.vim b/autoload/pathogen.vim deleted file mode 100644 index 16c21fe..0000000 --- a/autoload/pathogen.vim +++ /dev/null @@ -1,328 +0,0 @@ -" pathogen.vim - path option manipulation -" Maintainer: Tim Pope -" Version: 2.2 - -" Install in ~/.vim/autoload (or ~\vimfiles\autoload). -" -" For management of individually installed plugins in ~/.vim/bundle (or -" ~\vimfiles\bundle), adding `call pathogen#infect()` to the top of your -" .vimrc is the only other setup necessary. -" -" The API is documented inline below. For maximum ease of reading, -" :set foldmethod=marker - -if exists("g:loaded_pathogen") || &cp - finish -endif -let g:loaded_pathogen = 1 - -function! s:warn(msg) - if &verbose - echohl WarningMsg - echomsg a:msg - echohl NONE - endif -endfunction - -" Point of entry for basic default usage. Give a relative path to invoke -" pathogen#incubate() (defaults to "bundle/{}"), or an absolute path to invoke -" pathogen#surround(). For backwards compatibility purposes, a full path that -" does not end in {} or * is given to pathogen#runtime_prepend_subdirectories() -" instead. -function! pathogen#infect(...) abort " {{{1 - for path in a:0 ? reverse(copy(a:000)) : ['bundle/{}'] - if path =~# '^[^\\/]\+$' - call s:warn('Change pathogen#infect('.string(path).') to pathogen#infect('.string(path.'/{}').')') - call pathogen#incubate(path . '/{}') - elseif path =~# '^[^\\/]\+[\\/]\%({}\|\*\)$' - call pathogen#incubate(path) - elseif path =~# '[\\/]\%({}\|\*\)$' - call pathogen#surround(path) - else - call s:warn('Change pathogen#infect('.string(path).') to pathogen#infect('.string(path.'/{}').')') - call pathogen#surround(path . '/{}') - endif - endfor - call pathogen#cycle_filetype() - return '' -endfunction " }}}1 - -" Split a path into a list. -function! pathogen#split(path) abort " {{{1 - if type(a:path) == type([]) | return a:path | endif - let split = split(a:path,'\\\@"),'!isdirectory(v:val)')) && (!filereadable(dir.sep.'doc'.sep.'tags') || filewritable(dir.sep.'doc'.sep.'tags')) - helptags `=dir.'/doc'` - endif - endfor - endfor -endfunction " }}}1 - -command! -bar Helptags :call pathogen#helptags() - -" Execute the given command. This is basically a backdoor for --remote-expr. -function! pathogen#execute(...) abort " {{{1 - for command in a:000 - execute command - endfor - return '' -endfunction " }}}1 - -" Like findfile(), but hardcoded to use the runtimepath. -function! pathogen#runtime_findfile(file,count) abort "{{{1 - let rtp = pathogen#join(1,pathogen#split(&rtp)) - let file = findfile(a:file,rtp,a:count) - if file ==# '' - return '' - else - return fnamemodify(file,':p') - endif -endfunction " }}}1 - -" Backport of fnameescape(). -function! pathogen#fnameescape(string) abort " {{{1 - if exists('*fnameescape') - return fnameescape(a:string) - elseif a:string ==# '-' - return '\-' - else - return substitute(escape(a:string," \t\n*?[{`$\\%#'\"|!<"),'^[+>]','\\&','') - endif -endfunction " }}}1 - -if exists(':Vedit') - finish -endif - -let s:vopen_warning = 0 - -function! s:find(count,cmd,file,lcd) " {{{1 - let rtp = pathogen#join(1,pathogen#split(&runtimepath)) - let file = pathogen#runtime_findfile(a:file,a:count) - if file ==# '' - return "echoerr 'E345: Can''t find file \"".a:file."\" in runtimepath'" - endif - if !s:vopen_warning - let s:vopen_warning = 1 - let warning = '|echohl WarningMsg|echo "Install scriptease.vim to continue using :V'.a:cmd.'"|echohl NONE' - else - let warning = '' - endif - if a:lcd - let path = file[0:-strlen(a:file)-2] - execute 'lcd `=path`' - return a:cmd.' '.pathogen#fnameescape(a:file) . warning - else - return a:cmd.' '.pathogen#fnameescape(file) . warning - endif -endfunction " }}}1 - -function! s:Findcomplete(A,L,P) " {{{1 - let sep = pathogen#separator() - let cheats = { - \'a': 'autoload', - \'d': 'doc', - \'f': 'ftplugin', - \'i': 'indent', - \'p': 'plugin', - \'s': 'syntax'} - if a:A =~# '^\w[\\/]' && has_key(cheats,a:A[0]) - let request = cheats[a:A[0]].a:A[1:-1] - else - let request = a:A - endif - let pattern = substitute(request,'/\|\'.sep,'*'.sep,'g').'*' - let found = {} - for path in pathogen#split(&runtimepath) - let path = expand(path, ':p') - let matches = split(glob(path.sep.pattern),"\n") - call map(matches,'isdirectory(v:val) ? v:val.sep : v:val') - call map(matches,'expand(v:val, ":p")[strlen(path)+1:-1]') - for match in matches - let found[match] = 1 - endfor - endfor - return sort(keys(found)) -endfunction " }}}1 - -command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Ve :execute s:find(,'edit',,0) -command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vedit :execute s:find(,'edit',,0) -command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vopen :execute s:find(,'edit',,1) -command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vsplit :execute s:find(,'split',,1) -command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vvsplit :execute s:find(,'vsplit',,1) -command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vtabedit :execute s:find(,'tabedit',,1) -command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vpedit :execute s:find(,'pedit',,1) -command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vread :execute s:find(,'read',,1) - -" vim:set et sw=2: diff --git a/bundle/fugitive b/bundle/fugitive deleted file mode 160000 index 06e3420..0000000 --- a/bundle/fugitive +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 06e34204af04643d96d30132de6ba9066368de15 diff --git a/bundle/gen_tags.vim b/bundle/gen_tags.vim deleted file mode 160000 index 208cd04..0000000 --- a/bundle/gen_tags.vim +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 208cd0490547bc8f7615eea1b26e4635d2e60a96 diff --git a/bundle/gruvbox-community b/bundle/gruvbox-community deleted file mode 160000 index 290d103..0000000 --- a/bundle/gruvbox-community +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 290d103d944c1527c612e350b5a8693b7063becf diff --git a/bundle/nerdtree b/bundle/nerdtree deleted file mode 160000 index ee79ecf..0000000 --- a/bundle/nerdtree +++ /dev/null @@ -1 +0,0 @@ -Subproject commit ee79ecfb67e4403e54ea59c175ca4d39544395e8 diff --git a/bundle/syntastic b/bundle/syntastic deleted file mode 160000 index 3b3f4ee..0000000 --- a/bundle/syntastic +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 3b3f4ee8abf81191d1eca4350448148b86e8a741 diff --git a/bundle/tcomment_vim b/bundle/tcomment_vim deleted file mode 160000 index c9cecef..0000000 --- a/bundle/tcomment_vim +++ /dev/null @@ -1 +0,0 @@ -Subproject commit c9cecefc639b6019e0f12b7e9fb5a2375cd550c1 diff --git a/bundle/terminus b/bundle/terminus deleted file mode 160000 index 0c826f1..0000000 --- a/bundle/terminus +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 0c826f1eb31f68648fa82cb25ed06031dc846a44 diff --git a/bundle/vim-autoformat b/bundle/vim-autoformat deleted file mode 160000 index a350538..0000000 --- a/bundle/vim-autoformat +++ /dev/null @@ -1 +0,0 @@ -Subproject commit a350538f8a5a8f08cf64a520d456282080c3968f diff --git a/bundle/vim-bufkill b/bundle/vim-bufkill deleted file mode 160000 index 795dd38..0000000 --- a/bundle/vim-bufkill +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 795dd38f3cff69d0d8fe9e71847907e200860959 diff --git a/bundle/vim-gitgutter b/bundle/vim-gitgutter deleted file mode 160000 index 320b7a3..0000000 --- a/bundle/vim-gitgutter +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 320b7a33e78b22c05d25186fbeea853201627635 diff --git a/bundle/vim-go b/bundle/vim-go deleted file mode 160000 index 17c53d3..0000000 --- a/bundle/vim-go +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 17c53d38f17b0978323868ac12573f33a6fb8100 diff --git a/bundle/vim-lsc b/bundle/vim-lsc deleted file mode 160000 index 2384903..0000000 --- a/bundle/vim-lsc +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 2384903e1dd6314934f58e3c88b10924dd1bf4f7 diff --git a/bundle/vim-tmux-clipboard b/bundle/vim-tmux-clipboard deleted file mode 160000 index 4718774..0000000 --- a/bundle/vim-tmux-clipboard +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 47187740b88f9dab213f44678800cc797223808e diff --git a/bundle/vim-tmux-focus-events b/bundle/vim-tmux-focus-events deleted file mode 160000 index 0f89b1a..0000000 --- a/bundle/vim-tmux-focus-events +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 0f89b1ada151e22882a5a47a1ee2b6d6135bc5c1 diff --git a/bundle/vim-z80 b/bundle/vim-z80 deleted file mode 160000 index 85892d8..0000000 --- a/bundle/vim-z80 +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 85892d8411aa9745d934a55dec85735fd2edc2cc diff --git a/gvimrc b/gvimrc deleted file mode 100644 index 49ffd91..0000000 --- a/gvimrc +++ /dev/null @@ -1,14 +0,0 @@ -" Tab headings -set gtl=%t gtt=%F - -" disable guff -set guioptions-=Tm -set guioptions=cLrA - -set guifont=Inconsolata\ Medium\ 12 - -set guicursor+=i:ver100-Cursor/iCursor -set guicursor+=i:blinkon0 - -highlight Cursor guifg=black guibg=orange - diff --git a/vimrc b/vimrc index a389486..91dc081 100644 --- a/vimrc +++ b/vimrc @@ -31,6 +31,34 @@ set laststatus=2 " enable mouse set mouse=a +" plugin dependent conf starts + +call plug#begin('~/.vim/plugged') + +" git +Plug 'tpope/vim-fugitive.git' +Plug 'airblade/vim-gitgutter.git' + +" tmux +Plug 'tmux-plugins/vim-tmux-focus-events.git' +Plug 'roxma/vim-tmux-clipboard.git' +Plug 'wincent/terminus' + +" life improvements +Plug 'gruvbox-community/gruvbox.git' +Plug 'scrooloose/nerdtree.git' +Plug 'qpkorr/vim-bufkill' +Plug 'Chiel92/vim-autoformat' +Plug 'jsfaint/gen_tags.vim.git' + +" language support +Plug 'fatih/vim-go.git' +Plug 'natebosch/vim-lsc.git' +Plug 'samsaga2/vim-z80.git' +Plug 'scrooloose/syntastic.git' + +call plug#end() + set statusline = " Buffer number set statusline +=[%n] @@ -66,10 +94,7 @@ noremap :Autoformat " enable omnicompletion set omnifunc=syntaxcomplete#Complete -call pathogen#infect() -call pathogen#helptags() - -" looks nice; apparently needs to go after pathogen +" looks nice set termguicolors set background=dark let g:gruvbox_italic=1 -- cgit v1.2.3