Skip to content

Instantly share code, notes, and snippets.

@karlbright
Created September 20, 2013 07:36
Show Gist options
  • Save karlbright/6634394 to your computer and use it in GitHub Desktop.
Save karlbright/6634394 to your computer and use it in GitHub Desktop.
"---------------------------------------------------"
" Author: Karl Brightman "
" Homepage: http://karlbrig.ht "
" Source: http://github.com/karlbright/vimrc "
"---------------------------------------------------"
" vim:set ts=2 sts=2 sw=2 expandtab:
autocmd!
filetype off "Turn off file type detection. Required for Vundle
set nocompatible " Disable vi compatibility
set hidden " Allow buffers to be hidden without writing to the disk
set history=10000 " Large command history
set encoding=utf-8 " Character encoding
set shell=/bin/zsh " Set shell to use zsh
set ch=1 " Number of lines to use for the command-line
set showcmd " Show incomplete commands in status line
set nolazyredraw " Redraw while executing macros
set nostartofline " Do not move cursor to first non blank in line
set shortmess+=I " Do not show the introduction screen
set wildmode=longest:full " Complete longest common string, then list alternatives
set wildmenu " Use menu for command line completion
set ignorecase smartcase " Ignore case until another other case is used
set switchbuf=useopen " Jump to first open window that contains specified buffer on open
set laststatus=2 " Always show status line
set cmdheight=1 " Use one line height for command
set showtabline=2 "Always show tab bar
set visualbell " Stop beeping
set cursorline " Highlight current line
set ruler " Show column and line
set number " Show line numbers
set guioptions-=T guioptions-=e guioptions-=L guioptions-=r " Remove toolbars, scrollbars etc if around
set showmatch " Briefly jump to matching bracket if insert one
set mat=5 " Time for showing matching bracket
set incsearch " Highlight match while typing search pattern
set hlsearch " Highlight search results
set expandtab " Use spaces for tabs
set tabstop=2 " Use 2 spaces for indenting here...
set shiftwidth=2 " here, and...
set softtabstop=2 " here
set autoindent " Take indentation from previous line
set splitright " Open new vertical splits to the right of the current buffer
set splitbelow " Open new horizontal splits below current buffer
set winwidth=79 " Minimal number of columns for current window
set t_ti= t_te= " Fix vim clobbering scrollback buffer (http://bit.ly/158EoqS)
set scrolloff=3 " Minimum number of lines to show above and below cursor
set nowrap " Do not wrap lines
set textwidth=0 " The text must flow (http://bit.ly/pWJOw)
set nowritebackup " We don't need backups...
set nobackup " when we have version control
set directory=~/.tmp,~/tmp,/var/tmp,/tmp " Set swap file directories with alternatives
set foldmethod=manual " Disable automatic folding
set nofoldenable " Always open folds when opening file
set backspace=indent,eol,start " Make backspace work as it should
" ******
" VUNDLE
" Automatically setting up Vundle, taken from
" http://www.erikzaadi.com/2012/03/19/auto-installing-vundle-from-your-vimrc/
" ******
let vundle_virgin=0
if !filereadable($HOME."/.vim/bundle/vundle/README.md")
" Clone vundle via github
echo "Installing Vundle..."
echo ""
silent !mkdir -p $HOME/.vim/bundle
silent !git clone https://github.com/gmarik/vundle $HOME/.vim/bundle/vundle
let vundle_virgin=1
endif
set rtp+=$HOME/.vim/bundle/vundle/ " Add vundle directory to runtime path
call vundle#rc() " Initialize vundle
" Include Vundle its self
Bundle 'gmarik/vundle'
" File finder
Bundle 'kien/ctrlp.vim'
" Ack replacement via the_silver_searcher (requires: brew install ag)
Bundle 'rking/ag.vim'
" Tomorrow is my theme of choice
Bundle 'chriskempson/tomorrow-theme', {'rtp': 'vim'}
set t_Co=256 " Set 256 colors
set background=dark " Background should be dark like my coffee
let transparency=10 " A little bit of transparency never killed anyone..
colorscheme tomorrow-night-eighties " Make things pretty
if vundle_virgin == 1
" Install bundles if this is the first time vim has been run with this config
ech "Installing bundles..."
echo ""
:BundleInstall
source $HOME/.vimrc
:q
endif
syntax on " Enable syntax highlighting
filetype plugin indent on "Automatically detect file types
" Basic key mappings
imap <c-c> <esc>
nmap <space> :nohlsearch<cr>
" Disable the arrow keys, its bad practice...
map <Left> <Nop>
map <Right> <Nop>
map <Up> <Nop>
map <Down> <Nop>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment