"""""""""" " DEFAULTS """""""""" set nocompatible filetype plugin indent on """""""""""""" " RELOAD VIMRC """""""""""""" nmap :source ~/.vimrc """""""""""""""""""" " BACKUP DIRECTORIES """""""""""""""""""" set undodir=~/.vim/.undo// set backupdir=~/.vim/.backup// set directory=~/.vim/.swap// """""""""""""""" " USER INTERFACE """""""""""""""" " Line numbers on by default set number " Show command as it is being inserted set showcmd " Provide 3 lines of context regardless of cursor position set so=3 " Enhanced tab completion menu set wildmenu " Show where I am in the file set ruler " Ignore case for searches set ignorecase " unless query contains uppercase chars set smartcase " Watch your searches complete in real time set incsearch " Highlight search matches throughout after query is entered (plus Ctrl-q to kill) set hlsearch nnoremap :noh " Ensure magic is on for regex set magic " Open splits to the right and below set splitright set splitbelow " Never hide the status line set laststatus=2 " Change the title of VIM windows set title " Create a leader key because I ran out of modifiers " Backslash is perhaps good? Modifier-like placement let mapleader='\' " Instant recognition of escape key (fuck sequences) set noesckeys " Timeout length for map leader keys "set timeoutlen=200 ttimeoutlen=200 """"""""" " BUFFERS """"""""" " make it easy to swap buffers at a glance nmap b :buffers:b " do not demand buffers be saved on switching set hidden """"""""""""""" " COLOR/STYLING """"""""""""""" " Enable syntax highlighting syntax enable " Color scheme settings set background=dark if &t_Co == 256 || has('gui_running') colorscheme diokai else colorscheme desert endif " The greatest font ever set guifont=Inconsolata\ 13 " Disable many bells and whistles on the GUI " -m(enu), -t(oolbar), " -r and -L are scrollbars " on right and left sides set go-=m set go-=T set go-=r set go-=L " Size the gvim instance sanely if has("gui_running") set lines=24 columns=80 endif """"""""""""""""" " TABBING OPTIONS """"""""""""""""" " Convert tab chars into spaces set expandtab " Don't add indents when they already exist set smarttab " Four spaces to an indent set shiftwidth=4 set tabstop=4 " HTML uses two spaces instead autocmd FileType html setlocal shiftwidth=2 tabstop=2 " Newline every 80 chars "set textwidth=80 set ai " Auto indent set nosi " Dumb indent set wrap " Wrap long lines to fit on screen set linebreak " Do not break up words when wrapping """""""" " MOTION """""""" " Navigate up/down through longlines instead of passing through them map j gj map k gk " Reduce keystrokes when moving between splits nnoremap h nnoremap j nnoremap k nnoremap l " Reduce keystrokes when relocating splits nnoremap H H nnoremap J J nnoremap K K nnoremap L L " Reduce keystrokes when resizing splits nnoremap h < nnoremap j + nnoremap k - nnoremap l > nnoremap = = nnoremap nnoremap _ _ " Reduce keystrokes when moving between tabs nnoremap a gT nnoremap d gt nnoremap q :-tabmove nnoremap w :tablast nnoremap e :+tabmove """""""""""""""""""" " THOUGHT MANAGEMENT """""""""""""""""""" nnoremap f :w !diff % - nnoremap t :w !colordiff -y % - \| less -R """""""" " BOTTOM """""""" noh