Last active
December 20, 2015 20:18
-
-
Save bluej100/6189076 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" necessary for system-wide vimrcs (http://stackoverflow.com/questions/5845557/in-a-vimrc-is-set-nocompatible-completely-useless) | |
set nocompatible | |
" enable plugin manager | |
" http://stackoverflow.com/questions/14642956/why-vundle-requires-filetype-off | |
filetype off | |
set rtp+=~/.vim/bundle/vundle/ | |
call vundle#rc() | |
Bundle 'gmarik/vundle' | |
" limited autocomplete | |
" https://github.com/Valloric/YouCompleteMe | |
Bundle 'Valloric/YouCompleteMe' | |
" indentation level lines | |
" https://github.com/nathanaelkane/vim-indent-guides | |
Bundle 'nathanaelkane/vim-indent-guides' | |
" syntax warnings | |
" https://github.com/scrooloose/syntastic | |
Bundle 'scrooloose/syntastic' | |
" color-code pairs of brackets | |
" https://github.com/kien/rainbow_parentheses.vim | |
Bundle 'kien/rainbow_parentheses.vim' | |
" magic cursor motion | |
" https://github.com/Lokaltog/vim-easymotion | |
Bundle 'Lokaltog/vim-easymotion' | |
" silver searcher | |
Bundle 'rking/ag.vim' | |
" load filetype-specific plugins and use their indentation rules | |
filetype plugin indent on | |
" insert spaces when tab key is pressed | |
set expandtab | |
" render tab characters as two characters wide | |
set tabstop=2 | |
" use two spaces per indentation level | |
set shiftwidth=2 | |
" traverse two spaces with backspace | |
set softtabstop=2 | |
" find search results as you type, ignoring case if all lowercase | |
set incsearch ignorecase smartcase | |
" preserve indentation level if no filetype rules are known | |
set autoindent | |
" highlight syntax | |
syntax on | |
" use nice dark background, bright colors colorscheme | |
colorscheme tomorrow-night-eighties | |
autocmd ColorScheme * highlight Normal ctermbg=None ctermfg=None | |
autocmd ColorScheme * highlight NonText ctermbg=None | |
" present file and cursor information in status line | |
set statusline+=%F "full path | |
set statusline +=%1*%=%5l%* "current line | |
set statusline +=%2*/%L%* "total lines | |
set statusline +=%1*%4v\ %* "virtual column number | |
set laststatus=2 | |
" remember undo history across sessions | |
set undofile | |
" NOTE: you must mkdir ~/.vim/undo or delete this line | |
set undodir=$HOME/.vim/undo | |
" remap 'f' to delete into the black hole buffer | |
map f "_d | |
map ff "_dd | |
" remap 'r' to delete the selection into the black hole buffer and paste | |
vmap r "_dP | |
" use native OS clipboard instead of vim default buffer | |
set clipboard=unnamed | |
" remember state across sessions | |
set viminfo='20,\"100,:20,%,n~/.viminfo | |
" restore cursor position | |
:au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g`\"" | endif | |
" indent guides settings | |
set background=dark | |
let g:indent_guides_enable_on_vim_startup = 1 | |
let g:indent_guides_auto_colors = 0 | |
hi IndentGuidesOdd ctermbg=235 | |
hi IndentGuidesEven ctermbg=237 | |
" highlight extra whitespace | |
:highlight ExtraWhitespace ctermbg=22 | |
:match ExtraWhitespace /\s\+$/ | |
" remove last newline if it was originally missing | |
:let g:PreserveNoEOL = 1 | |
" In many terminal emulators the mouse works just fine, thus enable it. | |
if has('mouse') | |
set mouse=a | |
endif | |
" Make the window titlebar read 'vim[filename]' | |
set title | |
set titlestring=vim[%f] | |
" use ,, for easymotion | |
let mapleader = "," |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment