Skip to content

Instantly share code, notes, and snippets.

@madmax
Created June 13, 2012 13:54
Show Gist options
  • Save madmax/2924211 to your computer and use it in GitHub Desktop.
Save madmax/2924211 to your computer and use it in GitHub Desktop.
set nocompatible
call pathogen#infect()
call pathogen#helptags()
syntax on
filetype plugin indent on
" swp to one directory outside project
" set backupdir=~/.vim/tmp,.
" set directory=~/.vim/tmp,.
set nobackup
set noswapfile
" set leaderkey
let mapleader=","
" display buffer lists and allow easy to swith
nnoremap § :buffers<CR>:buffer<Space>
nnoremap <leader>c :Bclose<CR>
" menu for competition in command line
set wildchar=<Tab> wildmenu wildmode=full
" Quickly edit/reload the vimrc file
nmap <silent> <leader>ev :e $MYVIMRC<CR>
nmap <silent> <leader>sv :so $MYVIMRC<CR>
" Making it so ; works like : for commands. Saves typing and eliminates :W style typos due to lazy holding shift.
nnoremap ; :
" Stupid shift key fixes
"cmap W w
"cmap WQ wq
"cmap wQ wq
"cmap Q q
"cmap Tabe tabe
""" Code folding options
nmap <leader>0 :set foldlevel=0<CR>
nmap <leader>1 :set foldlevel=1<CR>
nmap <leader>2 :set foldlevel=2<CR>
nmap <leader>3 :set foldlevel=3<CR>
nmap <leader>4 :set foldlevel=4<CR>
nmap <leader>5 :set foldlevel=5<CR>
nmap <leader>6 :set foldlevel=6<CR>
nmap <leader>7 :set foldlevel=7<CR>
nmap <leader>8 :set foldlevel=8<CR>
nmap <leader>9 :set foldlevel=9<CR>
" au FileType ruby setlocal foldmethod=syntax
" au FileType css setlocal foldmethod=indent
" au FileType scss setlocal foldmethod=indent
" Don't screw up folds when inserting text that might affect them, until
" leaving insert mode. Foldmethod is local to the window. Protect against
" screwing up folding when switching between windows.
" autocmd InsertEnter * if !exists('w:last_fdm') | let w:last_fdm=&foldmethod | setlocal foldmethod=manual | endif
" autocmd InsertLeave,WinLeave * if exists('w:last_fdm') | let &l:foldmethod=w:last_fdm | unlet w:last_fdm | endif
" visual shifting (does not exit Visual mode)
vnoremap < <gv
vnoremap > >gv
" shared clipboard
set clipboard=unnamed
" display incomplete commands
set showcmd
" auto fold code
set foldenable
" highlight current line
set cursorline
" softabs
set tabstop=2
set shiftwidth=2
set expandtab
" set default font
set gfn=Monaco:h14
" search highlight
set hlsearch
set incsearch
set ignorecase
nmap <silent> <leader>/ :nohlsearch<CR>
" misterious finction
set hidden
" make omni competition easier
inoremap <S-Tab> <C-x><C-o>
" paste 2 registers before
" nmap <silent> <leader>p "2p
" set theme
colo Tubster
" set background=light
" invisible charts
set list
set listchars=tab:▸\ ,eol:¬,trail:.,extends:#,nbsp:.
" let g:neocomplcache_enable_at_startup = 1
set wildignore+=*.gif,*.png,*.swf,*.jpg,tmp,.git,.DS_Store
set number
set numberwidth=5
if has("gui_running")
set guioptions=egmt
endif
nmap <leader>f :Ack
nmap <leader>d :NERDTreeToggle<CR>
nmap <leader>s :NERDTreeFind<CR>
let NERDChristmasTree = 1
let NERDTreeMinimalUI = 1
" command T
let g:CommandTMaxHeight = 10
"gist
let g:gist_open_browser_after_post = 1
let g:gist_detect_filetype = 1
" minibufexpl
" let g:miniBufExplCheckDupeBufs = 0
" ctrlp settings
" nmap <leader>t <C-p>
" let g:ctrlp_dont_split = 'NERD'
" let g:ctrlp_match_window_reversed = 0
" let g:ctrlp_user_command = 'find %s -type f| grep -v -P "\.gif|\.png,\.swf|\.jpg|tmp\/|\.git|\.DS_Store"'
" let g:ctrlp_use_caching = 1
" let g:ctrlp_clear_cache_on_exit = 1
" convert to new ruby 1.9 hash syntax
command! -bar -range=% NotRocket :<line1>,<line2>s/:\(\w\+\)\s*=>/\1:/ge
" syntax for god files
au BufReadPost *.god set filetype=ruby
au BufReadPost *.scss set filetype=scss.css
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment