" .vimrc 3.1 by Joe " Plugins call plug#begin('~/.vim/plugged') Plug 'vim-airline/vim-airline' Plug 'vim-airline/vim-airline-themes' Plug 'jreybert/vimagit' Plug 'preservim/nerdtree' Plug 'mbbill/undotree' Plug 'jiangmiao/auto-pairs' Plug 'tpope/vim-surround' Plug 'tpope/vim-fugitive' Plug 'luochen1990/rainbow' Plug 'preservim/nerdcommenter' call plug#end() let mapleader="," " Some basics: "set bg=light set go=a set mouse=a set nohlsearch set clipboard=unnamedplus set tabstop=4 set softtabstop=4 set shiftwidth=4 nnoremap c "_c set nocompatible filetype plugin indent on set encoding=utf-8 set number set ruler syntax on set hidden " Nerdtree autocmd StdinReadPre * let s:std_in=1 autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif " Enable autocompletion: set wildmode=longest,list,full " Some quick bindings noremap g :G noremap :call NERDComment(0,"toggle") noremap :bprevious noremap :bnext noremap h noremap j noremap k noremap l noremap o noremap 0 q noremap :e noremap w :w :bp :bd # noremap k :w :bp :bd # " Airline let g:airline#extensions#tabline#enabled = 1 let g:airline#extensions#tabline#fnamemod = ':t' let g:airline_detect_modified = 1 let g:airline_detect_paste = 1 let g:airline_detect_crypt = 1 let g:airline_theme = 'term' let g:airline_powerline_fonts = 1 let g:airline_symbols_ascii = 1 let g:airline#parts#ffenc#skip_expected_string='utf-8[unix]' " Rainbow let g:rainbow_active = 1 " NERD Commenter let g:NERDSpaceDelims = 1 let g:NERDCompactSexyComs = 1 let g:NERDDefaultAlign = 'left' let g:NERDAltDelims_java = 1 let g:NERDCustomDelimiters = { 'c': { 'left': '/*','right': '*/' } } let g:NERDCommentEmptyLines = 1 let g:NERDTrimTrailingWhitespace = 1 let g:NERDToggleCheckAllLines = 1 " Cursor mode let g:airline#extensions#cursormode#enabled = 1 let g:cursormode_color_map = { \ "i": "#7da9c7", \ "n": "#eac179", \ "R": "#bb5653", \ "r": "#bb5653", \ "v": "#b06597", \ "V": "#b06597", \ "\": "#b06597", \} " 10 buffers jump let g:airline#extensions#tabline#buffer_idx_mode = 1 noremap :spj:term:resize -10i noremap :NERDTreeToggle noremap :UndotreeToggle nmap 1 AirlineSelectTab1 nmap 2 AirlineSelectTab2 nmap 3 AirlineSelectTab3 nmap 4 AirlineSelectTab4 nmap 5 AirlineSelectTab5 nmap 6 AirlineSelectTab6 nmap 7 AirlineSelectTab7 nmap 8 AirlineSelectTab8 nmap 9 AirlineSelectTab9 nmap 0 AirlineSelectTab10 " Disables automatic commenting on newline: autocmd FileType * setlocal formatoptions-=c formatoptions-=r formatoptions-=o " Powerline set laststatus=2 set t_Co=256 " Runs a script that cleans out tex build files whenever I close out of a .tex file. autocmd VimLeave *.tex !texclear % " Compile document, be it groff/LaTeX/markdown/etc. "map c :w! \| !compiler % autocmd BufWritePost *.tex !compiler % " Compile C file autocmd FileType * noremap :w :!clear :!make -j5 ASAN=1 autocmd FileType * noremap :w :!clear :!./a.out; ret=$?; echo "~>"; if [ $ret -ne 0 ]; then echo -n "$ret"; if [ $ret -eq 127 ]; then echo " - Missing a.out"; exit; elif [ $ret -eq 134 ]; then echo " - Abort\!"; elif [ $ret -eq 138 ]; then echo " - Bus error\!"; elif [ $ret -eq 139 ]; then echo " - Segmentation fault\!"; fi; fi; echo "\n\n.vimrc v3.0 Tilde Edition by Joe" " === Comfy === " C autocmd FileType c nnoremap m o#include#include#include#includeintmain(void){return0;}O autocmd FileType c nnoremap M o#include#include#include#includeintmain(intargc,char*argv[]){if(argc!=1){printf("NOTENOUGHARGS\n");return1;}return0;}Oprintf(); " C++ autocmd FileType cpp nnoremap m ointmain(void){return0;}O autocmd FileType cpp nnoremap M ointmain(intargc,char*argv[]){if(argc!=1)return0;if(argv[]){}return0;}O autocmd FileType cpp nnoremap M ointmain(intargc,char*argv[]){if(argc!=1){cout<<"NOTENOUGHARGS"<<endl;return1;}return0;}O " .vimrc 3.1 by Joe