Skip to content

Instantly share code, notes, and snippets.

@nevinera
Created September 7, 2011 20:21
Show Gist options
  • Save nevinera/1201615 to your computer and use it in GitHub Desktop.
Save nevinera/1201615 to your computer and use it in GitHub Desktop.
filetype off
call pathogen#runtime_append_all_bundles()
call pathogen#helptags()
au! BufRead,BufNewFile *.haml setfiletype haml
set nocompatible
set vb t_vb=
let mapleader = ","
set history=1000
set formatoptions=""
" Tabs -----------------------------------
" Use 2 spaces
set softtabstop=2
set shiftwidth=2
set tabstop=2
set expandtab
set backspace=indent,eol,start
match ErrorMsg /[\t]/
" Indenting ------------------------------
set ai
set si
filetype plugin indent on
" Numbers --------------------------------
set number
set scrolloff=3
set sidescrolloff=2
set numberwidth=4
set cursorline
" Status Line ----------------------------
set showcmd
set wildmenu
set wildmode=list:longest
set ruler
set shortmess=atI
" Searching ------------------------------
set hlsearch
set incsearch
set ignorecase
set smartcase
"match begin-end, etc just like () and {}
runtime macros/matchit.vim
" Colors ---------------------------------
set background=dark
syntax on
colorscheme ir_black
" Line Wrapping --------------------------
set nowrap
set linebreak
" Directories ----------------------------
set backupdir=~/.vim/backups
set backup
set directory=~/.vim/swap
set viminfo='10,\"100,:20,%,n~/.vim/viminfo
" Mouse ----------------------------------
set mousehide
set mouse=a
"" BINDINGS +++++++++++++++++++++++++++++++++++++++++++++++
" Motion ---------------------------------
nnoremap <C-e> 3<C-e>
nnoremap <C-j> 3<C-e>
nnoremap <C-y> 3<C-y>
nnoremap <C-k> 3<C-y>
imap <C-e> <Esc><C-e>a
imap <C-y> <Esc><C-y>a
map <C-l> zt
map H ^
map <C-left> ^
imap <C-left> <C-o>^
map L $
map <C-right> $
imap <C-right> <C-o>$
" TextMateish ----------------------------
imap <D-Return> <Esc>o
nmap <D-Return> o
imap <C-w> <Esc>:q<CR>
nmap <C-w> :q<CR>
" command-t ------------------------------
nmap <leader>T :tabnew<CR>:CommandT<CR>
nmap <leader>t :CommandT<CR>
imap <D-T> <Esc>:tabnew<CR>:CommandT<CR>
nmap <leader>R :CommandTFlush<CR>
" toggle visible whitespace with ,s
nmap <silent> <leader>s :set nolist!<CR>
" Move by wrapped lines ------------------
map <up> gk
map k gk
imap <up> <C-o>gk
map <down> gj
map j gj
imap <down> <C-o>gj
" Tab manipulation ----------------------
map <C-j> gt
map <C-k> gT
" imode shorts --------------------------
imap jk <Esc>
imap jj <Esc>
imap hh =>
imap kk end<CR>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment