dotfiles

$HOME is where the <3 is
git clone git://git.alexkarle.com/dotfiles.git
Log | Files | Refs | Submodules | README

commit e9d435f193a3c44f045660f056fc26b9cdd977c1 (patch)
parent c9d3efb5c433b4b61144b3409225f6734746936b
Author: Alexander Karle <akarle@umass.edu>
Date:   Sun, 16 Dec 2018 15:03:29 -0500

vim: goodbye pathogen, hello native packages

I've known about Vim 8's packages for a while as a native solution to
package management, but I've never gotten around to reading about it
enough to transition off of pathogen.

I finally got the motivation, and it was easier than I thought! Most of
the effort went to deciding which packages to be start/opt (which I
really like, actually), and writing a home-brewed solution to Helptags.

Diffstat:
Mvim/.gitignore | 6++----
Mvim/autoload/vimrc.vim | 8++++++++
Mvim/vimrc | 10+++-------
3 files changed, 13 insertions(+), 11 deletions(-)

diff --git a/vim/.gitignore b/vim/.gitignore @@ -7,10 +7,8 @@ undo/ # Ignore plugin artifacts .netrwhist -# Ignore dependencies (TODO: use submodules?) -autoload/pathogen.vim -autoload/plug.vim -bundle/ +# Ignore plugins (TODO: consider submodules) +pack/ # Ignore tags tags diff --git a/vim/autoload/vimrc.vim b/vim/autoload/vimrc.vim @@ -64,3 +64,11 @@ function! vimrc#SetPasteAndPasteFromClipboard() abort normal! "*p set nopaste endfunction + +" Generates helptags for all doc a la pathogen (using native Vim 8 packages) +function! vimrc#Helptags() abort + let dirs = split(glob(expand('<sfile>:p:h') . '/pack/*/*/*/doc'), '\n') + for d in dirs + exe 'helptags ' . d + endfor +endfunction diff --git a/vim/vimrc b/vim/vimrc @@ -11,11 +11,6 @@ else let s:vimdir = expand($HOME . '/.vim') endif -" Add all the plugins to the path -if filereadable(s:vimdir . "/autoload/pathogen.vim") - execute pathogen#infect() -endif - " Space related set softtabstop=4 " <TAB> is 4 spaces (when expandtab set) set shiftwidth=4 " >> will indent 4 spaces @@ -89,7 +84,7 @@ set listchars=space:·,tab:>–,trail:~,eol:¬ " COLORSCHEME " if can use truecolor, do if (has("termguicolors") || has('gui_running')) && - \ filereadable(s:vimdir . "/bundle/gruvbox/colors/gruvbox.vim") + \ filereadable(s:vimdir . "/pack/mine/start/gruvbox/colors/gruvbox.vim") set termguicolors colorscheme gruvbox @@ -159,7 +154,7 @@ nnoremap <leader>D :set background=dark<CR> nnoremap <expr> <leader>C vimrc#ToggleColorColumn() " Quick open current directory of file being edited -if isdirectory(s:vimdir . '/bundle/vim-dirvish') +if isdirectory(s:vimdir . '/pack/plugins/start/vim-dirvish') nnoremap <leader>d :Dirvish %:p:h<CR> else nnoremap <leader>d :Explore<CR> @@ -201,6 +196,7 @@ nnoremap <leader>V :edit $MYVIMRC<CR> " COMMANDS {{{ command! -nargs=1 GitGrep call vimrc#GitGrep('<args>') | copen command! CD exe 'cd ' . expand('%:h') +command! Helptags call vimrc#Helptags() " }}} " vim:fdm=marker:sts=4:sw=4