Skip to content

Instantly share code, notes, and snippets.

@devth
Created February 10, 2011 23:51
Show Gist options
  • Save devth/821644 to your computer and use it in GitHub Desktop.
Save devth/821644 to your computer and use it in GitHub Desktop.
set nocompatible
syntax on
set nowrap
set shell=/bin/zsh
let mapleader = ","
" hides buffers instead of closing them
set hidden
" Use pathogen to easily modify the runtime path to include all plugins under
" the ~/.vim/bundle directory
filetype off " force reloading *after* pathogen loaded
call pathogen#helptags()
call pathogen#runtime_append_all_bundles()
filetype plugin indent on " enable detection, plugins and indenting in one step
" Custom file type mappings
au BufRead,BufNewFile *.mustache set ft=mustache.html
set list
set listchars=tab:▸\ ,eol:¬
set pastetoggle=<F2> " when in insert mode, press <F2> to go to
" paste mode, where you can paste mass data
" that won't be autoindented
" Kill backup (USE GIT!)
set nobackup
set noswapfile
" NEW LINE
map <S-Enter> O<Esc>
map <CR> o<Esc>
" CTAGS
set tags=~/.tags
map <leader>tl :TlistToggle<cr>
" SPARKUP
" let g:sparkupExecuteMapping = '<c-s>'
" let g:sparkupNextMapping = ''
" SEARCHING
nnoremap / /\v
vnoremap / /\v
set ignorecase
set smartcase
nnoremap <leader>a :Ack
set gdefault
set incsearch
set showmatch
set hlsearch
nnoremap <leader><space> :nohlsearch<cr>
nnoremap <tab> %
vnoremap <tab> %
inoremap kj <Esc>
inoremap <Left> <NOP>
inoremap <Right> <NOP>
inoremap <Up> <NOP>
inoremap <Down> <NOP>
" TABS
set tabstop=2
" set smarttab
set shiftwidth=2
set autoindent
set noexpandtab " Don't Expand TABs to spaces
set backspace=start,indent
" VISUAL INDENT GUIDES
let g:indent_guides_guide_size = 1
" FOLDING
nnoremap <leader>ft Vatzf
" VISUALLY SELECT THE TEXT THAT WAS LAST EDITED/PASTED
nmap gV `[v`]
set history=1000
set undolevels=1000
set wildmenu
set wildmode=list:longest
set visualbell
set cursorline
set ttyfast
" COMMAND-T
" SNIPPETS
map ,rs :call ReloadAllSnippets()<cr>
" MATCHIT
runtime macros/matchit.vim
set title
set scrolloff=3
set ruler
set encoding=utf-8
set number
set hlsearch
" SCRATCH
function! ToggleScratch()
if expand('%') == g:ScratchBufferName
quit
else
Sscratch
endif
endfunction
map <leader>s :call ToggleScratch()<CR>
" SPLIT NAVIGATION
nnoremap <C-h> <C-w>h
nnoremap <C-j> <C-w>j
nnoremap <C-k> <C-w>k
nnoremap <C-l> <C-w>l
" SPLIT WINDOWS
nnoremap <leader>w <C-w>v<C-w>l
" HTML
nnoremap <leader>ft Vatzf
nnoremap <leader>q gqip
" YANKRING
nnoremap <silent> <F3> :YRShow<cr>
inoremap <silent> <F3> <ESC>:YRShow<cr>
" YANK TO END OF LINE
map Y y$
" PASTING
nnoremap <leader>v V`]
" ABBREVIATIONS
:ab teh the
" GUI
if has("gui_running")
set guioptions=egmt
set columns=220
set lines=110
colorscheme molokai
set guifont=Monaco:h12
set noautochdir
set relativenumber
" vsplit
" MANAGING BUFFERS WITH LUSTYJUGGLER
" map ,b :LustyJuggler<CR>
else
set term=ansi
endif
" RELOAD VIMRC UPON SAVING
" if has("autocmd")
" autocmd bufwritepost .vimrc source $MYVIMRC
" endif
" EDIT / RELOAD .vimrc
nnoremap <leader>ev <C-w><C-v><C-l>:e $MYVIMRC<cr>
nmap <silent> <leader>sv :so $MYVIMRC<CR>
" ALLOW SUDO AFTER FILE IS ALREADY OPEN
cmap w!! w !sudo tee % >/dev/null
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment