Skip to content

Instantly share code, notes, and snippets.

@mathias
Created September 7, 2011 15:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mathias/1200812 to your computer and use it in GitHub Desktop.
Save mathias/1200812 to your computer and use it in GitHub Desktop.
map <silent> <C-s> :NERDTree<CR><C-w>l:NERDTreeFind<CR>
autocmd User Rails Rnavcommand sass app/stylesheets -suffix=.sass -default=partials/_page
autocmd User Rails Rnavcommand coffee app/coffee -suffix=.coffee
autocmd User Rails Rnavcommand cell app/cells
autocmd User Rails Rnavcommand cellview app/cells -glob=**/* -suffix=.html.haml
set autoindent
set backupdir=~/.vimbackupdir,~/tmp,~/,.
set directory=~/.vimbackupdir,~/tmp,~/,.
set expandtab
set listchars=tab:⇀\ ,trail:␠
set hlsearch
set ignorecase
set matchpairs+=<:>
set modeline
set modelines=5
set ruler
set shiftwidth=2
set showmatch
set tabstop=2
set tildeop
set wildmode=longest,list,full
set wildmenu
syntax on
colorscheme vividchalk
filetype indent on
filetype plugin on
au! BufRead,BufNewFile *.rb
au! BufRead,BufNewFile *.xml
au BufNewFile,BufRead *.scss set filetype=sass
" Run rake from Rails files
autocmd User Rails nnoremap <buffer> <D-r> :<C-U>Rake<CR>
autocmd User Rails nnoremap <buffer> <D-R> :<C-U>.Rake<CR>
" find the current file
map <silent> <C-s> :NERDTree<CR>:wincmd l<CR>:NERDTreeFind<CR>:wincmd l<CR>
" clear search
nmap <silent> ,/ :nohlsearch<CR>
" sudo save with w!!
cmap w!! w !sudo tee % >/dev/null
" navigate windows
map <silent> <C-h> :wincmd h<CR>
map <silent> <C-Left> :wincmd h<CR>
map <silent> <C-k> :wincmd k<CR>
map <silent> <C-Up> :wincmd k<CR>
map <silent> <C-j> :wincmd j<CR>
map <silent> <C-Down> :wincmd j<CR>
map <silent> <C-l> :wincmd l<CR>
map <silent> <C-Right> :wincmd l<CR>
" bubble text
map <silent> <C-H> x<Left>P
map <silent> <C-L> xp
map <silent> <C-J> ddp
map <silent> <C-K> ddkP
" open tabs with command-<tab number>
map <silent> <D-1> :tabn 1<CR>
map <silent> <D-2> :tabn 2<CR>
map <silent> <D-3> :tabn 3<CR>
map <silent> <D-4> :tabn 4<CR>
map <silent> <D-5> :tabn 5<CR>
map <silent> <D-6> :tabn 6<CR>
map <silent> <D-7> :tabn 7<CR>
map <silent> <D-8> :tabn 8<CR>
map <silent> <D-9> :tabn 9<CR>
" Reindent xml pastes
vmap <silent> <leader>x :!tidy -qi -raw -xml<CR>:se filetype=xml<CR>
set visualbell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment