diff --git a/.install.conf.yaml b/.install.conf.yaml index c824e74..e87a65e 100644 --- a/.install.conf.yaml +++ b/.install.conf.yaml @@ -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 \ No newline at end of file + - git submodule sync --recursive + \ No newline at end of file diff --git a/vim/init.vim b/vim/init.vim deleted file mode 100644 index 63cc3cd..0000000 --- a/vim/init.vim +++ /dev/null @@ -1,3 +0,0 @@ -echom "Init" - -source ~/.config/vim/setup-vim-plug.vim diff --git a/vim/setup-vim-plug.vim b/vim/setup-vim-plug.vim index 1884265..88a9b68 100644 --- a/vim/setup-vim-plug.vim +++ b/vim/setup-vim-plug.vim @@ -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() + \ No newline at end of file diff --git a/vim/vimrc b/vim/vimrc index e69de29..3f7f37c 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -0,0 +1,5 @@ + +" Setup Vim Plugged, and load plugins +source ~/.config/vim/setup-vim-plug.vim + +filetype plugin on