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 %