diff --git a/deploy.sh b/deploy.sh index 6d19b36..c2c57ab 100755 --- a/deploy.sh +++ b/deploy.sh @@ -61,6 +61,12 @@ for option in "$@"; do [ ! -d "$HOME/.local/bin" ] && mkdir -p "$HOME/.local/bin" 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" + vim +PluginInstall +qall + vim "+Copilot auth" +qall + ;; yay) link "$PWD/yay/config.json" "$HOME/.config/yay/config.json" ;; diff --git a/vim/vimrc b/vim/vimrc new file mode 100644 index 0000000..76b0cc5 --- /dev/null +++ b/vim/vimrc @@ -0,0 +1,82 @@ +set nocompatible +filetype off +syntax on " enable syntax highlighting +set number relativenumber " relative line numbers +set ai " Sets auto-indentation +set si " Sets smart-indentation +set cursorline " Highlight current cursor line +set tabstop=2 " Tab equal 2 spaces (default 4) +set shiftwidth=2 " Arrow function (>>) creates 2 spaces +set expandtab " Use spaces instead of a tab charater on TAB +set smarttab " Be smart when using tabs +set hlsearch " When searching (/), highlights matches as you go +set incsearch " When searching (/), display results as you type (instead of only upon ENTER) +set smartcase " When searching (/), automatically switch to a case-sensitive search if you use any capital letters +set ttyfast " Boost speed by altering character redraw rates to your terminal +set showmatch " Show matching brackets when text indicator is over them +set noerrorbells " Silence the error bell +set novisualbell " Visually hide the error bell +set encoding=utf8 " Set text encoding as utf8 +set clipboard+=unnamedplus " Use the OS clipboard by default +set showtabline=2 " Use tabline +set splitright " split to the right instead of left +set textwidth=80 " Limit to 80 characters in width +set colorcolumn=80 " Colored Column after 80 Characters +set wrap " enable line wrap +set bg=dark " set dark background +set wildmode=longest,list,full +set mouse=a " enable mouse +set splitright " always split right + +" Set the runtime path to include Vundle and initialize +set rtp+=~/.vim/bundle/Vundle.vim + +" Download plug-ins to the ~/.vim/plugged/ directory +call vundle#begin('~/.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 'morhetz/gruvbox' " Color scheme +Plugin 'https://github.com/ap/vim-css-color' " highlight color codes in their color +Plugin 'https://github.com/907th/vim-auto-save.git' " auto save +Plugin 'https://github.com/github/copilot.vim' " github copilot + +call vundle#end() + +colorscheme gruvbox + +filetype plugin indent on + +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 % +