diff --git a/deploy.sh b/deploy.sh index d4bad0c..8dcdbce 100755 --- a/deploy.sh +++ b/deploy.sh @@ -62,8 +62,9 @@ for option in "$@"; do cp scripts/* "$HOME/.local/bin" ;; vim) - git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim - link "$PWD/vim/vimrc" "$HOME/.vim/vimrc" + mkdir -p ~/.config/vim + git clone https://github.com/VundleVim/Vundle.vim.git ~/.config/vim/bundle/Vundle.vim + link "$PWD/vim/vimrc" "$HOME/.config/vim/vimrc" vim +PluginInstall +qall ;; yay) diff --git a/vim/vimrc b/vim/vimrc index 4dff32e..637c13d 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -1,5 +1,5 @@ set nocompatible -filetype off +filetype plugin indent on syntax on " enable syntax highlighting set number relativenumber " relative line numbers set ai " Sets auto-indentation @@ -27,20 +27,19 @@ set bg=dark " set dark background set wildmode=longest,list,full set mouse=a " enable mouse set splitright " always split right -set viminfo+=n$HOME/.vim/viminfo " save viminfo in .vim dir to keep ~/ clean +set viminfo+=n~/.config/vim/viminfo " save viminfo in .vim dir to keep ~/ clean " Set the runtime path to include Vundle and initialize -set rtp+=~/.vim/bundle/Vundle.vim +set rtp+=~/.config/vim/bundle/Vundle.vim -" Download plug-ins to the ~/.vim/plugged/ directory -call vundle#begin('~/.vim/plugged') +" Download plug-ins to the ~/.config/vim/plugged/ directory +call vundle#begin('~/.config/vim/plugged') Plugin 'VundleVim/Vundle.vim' " Let Vundle manage Vundle Plugin 'sheerun/vim-polyglot' " Syntax highlighting Plugin 'jiangmiao/auto-pairs' " Pair completion Plugin 'lervag/vimtex' " LaTeX tools Plugin 'vim-airline/vim-airline' " Nicer info line -Plugin 'junegunn/goyo.vim' " Zen Workspace Plugin 'alvan/vim-closetag' " Auto close HTML tags Plugin 'https://github.com/morhetz/gruvbox' " Color scheme Plugin 'https://github.com/ap/vim-css-color' " highlight color codes in their color @@ -48,36 +47,28 @@ Plugin 'https://github.com/907th/vim-auto-save.git' " auto save call vundle#end() -colorscheme gruvbox - -filetype plugin indent on +try + colorscheme gruvbox +catch +endtry let g:auto_save = 1 let g:AutoPairsShortcutToggle = '' " Press Ctrl+P to disable pair completion let g:vimtex_view_method = 'zathura' let g:airline#extensions#tabline#enabled = 1 -" REMAPPING " jump to last known position when opening a file au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$") | exe "normal! g'\"" | endif -map :Goyo -imap :Goyoa - " indent with tab vnoremap >gv vnoremap >> -inoremap >>a nnoremap >> -inoremap < << " jump to beginning of selection when exiting visual mode vnoremap o -autocmd BufWritePre,BufRead *.tex :VimtexCompile " autocompile tex docs -autocmd VimLeave *.tex :!texclear % " clear tex junk when closing tex file autocmd BufWritePre * %s/\s\+$//e " auto delete trailing white space on save -autocmd BufWritePost *.vim source %