Skip to content

Instantly share code, notes, and snippets.

@DanielOberg
Created February 5, 2014 12:51
Show Gist options
  • Save DanielOberg/8822976 to your computer and use it in GitHub Desktop.
Save DanielOberg/8822976 to your computer and use it in GitHub Desktop.
set nocompatible " Must come first because it changes other options.
filetype off " Necessary on some Linux distros for pathogen to properly load bundles
" *********************************************
" * Vundle - Vim Plugins *
" *********************************************
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
" Let Vundle manage Vundle
Bundle 'gmarik/vundle'
Bundle 'kien/ctrlp.vim'
Bundle 'scrooloose/syntastic'
Bundle 'benmills/vimux'
Bundle 'altercation/vim-colors-solarized'
" *********************************************
" * Settings *
" *********************************************
set encoding=utf-8
syntax enable
filetype plugin indent on " load file type plugins + indentation
set showcmd " Display incomplete commands.
set showmode " Display the mode you're in.
set showmatch " Show matching brackets/parenthesis
set nowrap " don't wrap lines
set tabstop=2 shiftwidth=2 " a tab is two spaces (or set this to 4)
set expandtab " use spaces, not tabs (optional)
set backspace=indent,eol,start " backspace through everything in insert mode"
set autoindent " match indentation of previous line
set incsearch " Find as you type search
set hlsearch " Highlight search terms
set ignorecase " Case-insensitive searching.
set smartcase " But case-sensitive if expression contains a capital letter.
set foldmethod=indent "fold based on indent
set foldnestmax=3 "deepest fold is 3 levels
set nofoldenable "dont fold by default
set hidden " Handle multiple buffers better.
set title " Set the terminal's title
set number " Show line numbers.
set relativenumber " Show relative number.
set ruler " Show cursor position.
set cursorline " Highlight current line
set wildmode=list:longest " Complete files like a shell.
set wildmenu " Enhanced command line completion.
set wildignore=*.o,*.obj,*~ " Stuff to ignore when tab completing
set novisualbell
set noerrorbells
set history=1000 " Store lots of :cmdline history
set scrolloff=3
set sidescrolloff=7
set splitbelow
set splitright
set nobackup " Don't make a backup before overwriting a file.
set nowritebackup " And again.
set directory=/tmp " Keep swap files in one location
set timeoutlen=500
set laststatus=2 " Show the status line all the time
set paste
set t_Co=256
let g:solarized_termcolors=256
syntax enable
set background=dark
colorscheme solarized
set ttyfast
set lazyredraw
" *********************************************
" * Functions *
" *********************************************
" *********************************************
" * Key Bindings *
" *********************************************
let mapleader = ","
" Clear last search highlighting
nnoremap <Space> :noh<cr>
" Easier navigation between split windows
nnoremap <c-j> <c-w>j
nnoremap <c-k> <c-w>k
nnoremap <c-h> <c-w>h
nnoremap <c-l> <c-w>l
" Open the definition in a new split
nnoremap <c-\> <c-w>g<c-]>
" Insert blank lines without going into insert mode
nmap go o<esc>
nmap gO O<esc>
" indent/unindent visual mode selection with tab/shift+tab
vmap <tab> >gv
vmap <s-tab> <gv
nnoremap <F1> :call ToggleFocusMode()<cr>
" *********************************************
" * Plugin Customization *
" *********************************************
"# ctrlp.vim
set wildignore+=*/.git/*,*/.hg/*,*/.svn/* " for Linux/MacOSX
set wildignore+=*/tmp/*,*.so,*.swp,*.zip
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment