🥳 Vim working with VimPlug

This commit is contained in:
Alicia Sykes 2022-03-17 18:22:01 +00:00
parent 33d740bc06
commit bf95988be4
4 changed files with 54 additions and 17 deletions

View File

@ -10,9 +10,11 @@
path: zsh/.zshenv
force: true
~/.config/zsh: zsh
~/.tmux.conf: tmux/.tmux.conf
~/.config/vim: vim
~/.config/nvim: vim
~/.config/bash: bash
~/.tmux.conf: tmux/.tmux.conf
~/.local/share/tmux: tpm
# ~/.config/tmux/plugins: tpm
- shell:
- git submodule sync --recursive
- git submodule sync --recursive

View File

@ -1,3 +0,0 @@
echom "Init"
source ~/.config/vim/setup-vim-plug.vim

View File

@ -1,11 +1,12 @@
" Get version of Vim running
if has('nvim') | let vim_type='nvim' | else | let vim_type='vim' | endif
let vim_rc=$XDG_CONFIG_HOME.'/vim/vimrc'
" Location of vim plug script
let vim_plug_location=$XDG_DATA_HOME."/".vim_type."/autoload/plug.vim"
" Set paths for plug.vim and directory for plugins
if has('nvim')
let vim_plug_location=$XDG_DATA_HOME."/nvim/autoload/plug.vim"
let vim_plug_plugins_dir = $XDG_DATA_HOME."/nvim/plugins"
else
let vim_plug_location=$HOME.'/.vim/autoload/plug.vim'
let vim_plug_plugins_dir = $XDG_DATA_HOME."/vim/plugins"
endif
" If vim-plug not present, install it now
if !filereadable(expand(vim_plug_location))
@ -14,8 +15,40 @@ if !filereadable(expand(vim_plug_location))
\ ' https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
endif
" Run PlugInstall if there are missing plugins
autocmd VimEnter * if len(filter(values(g:plugs), '!isdirectory(v:val.dir)'))
\| PlugInstall --sync | exec 'source ' . vim_rc
\| endif
" If Plugins directory not yet exist, create it
if empty(vim_plug_plugins_dir)
call mkdir(vim_plug_plugins_dir, 'p')
endif
" Initialize Vim Plugged
call plug#begin(vim_plug_plugins_dir)
" Light-weight status line
Plug 'vim-airline/vim-airline'
" A tree explorer plugin for vim
Plug 'preservim/nerdtree'
" Highlight, navigate, and operate on sets of matching text
Plug 'andymass/vim-matchup'
" Displays and browse tags in a file
Plug 'preservim/tagbar'
" Fuzzy-file finder in vim
Plug 'junegunn/fzf'
" Smoothe scrolling
Plug 'psliwka/vim-smoothie'
" File icons for most languages
Plug 'ryanoasis/vim-devicons'
" Easy comments in most languages
Plug 'preservim/nerdcommenter'
" Check syntax in real-time
Plug 'dense-analysis/ale'
" Surround selected text with brackets, quotes, tags etc
Plug 'tpope/vim-surround'
" Better incremenal searching
Plug 'haya14busa/incsearch.vim'
" Multi-cursor support
Plug 'mg979/vim-visual-multi'
" Easily generate number/ letter sequences
Plug 'triglav/vim-visual-increment'
" Wraper for running tests
Plug 'janko/vim-test'
call plug#end()

View File

@ -0,0 +1,5 @@
" Setup Vim Plugged, and load plugins
source ~/.config/vim/setup-vim-plug.vim
filetype plugin on