Skip to content

Instantly share code, notes, and snippets.

@anthonycrumley
Created January 9, 2015 03:02
Show Gist options
  • Save anthonycrumley/270f09266dc5c437f1d7 to your computer and use it in GitHub Desktop.
Save anthonycrumley/270f09266dc5c437f1d7 to your computer and use it in GitHub Desktop.
execute pathogen#infect()
syntax on
filetype plugin indent on
augroup vimrc
set hlsearch
set tabstop=2
set shiftwidth=2
set expandtab
set ruler
set number
au BufWinEnter * let w:m2=matchadd('ErrorMsg', '\%>80v.\+', -1)
au BufNewFile,BufRead *.thor set filetype=ruby
augroup END
set t_Co=256
set background=dark
colorscheme vividchalk
" Change pane
nnoremap <C-h> <C-w>h
nnoremap <C-j> <C-w>j
nnoremap <C-k> <C-w>k
nnoremap <C-l> <C-w>l
" Search for selected text, forwards or backwards.
vnoremap <silent> * :<C-U>
\let old_reg=getreg('"')<Bar>let old_regtype=getregtype('"')<CR>
\gvy/<C-R><C-R>=substitute(
\escape(@", '/\.*$^~['), '\_s\+', '\\_s\\+', 'g')<CR><CR>
\gV:call setreg('"', old_reg, old_regtype)<CR>
vnoremap <silent> # :<C-U>
\let old_reg=getreg('"')<Bar>let old_regtype=getregtype('"')<CR>
\gvy?<C-R><C-R>=substitute(
\escape(@", '?\.*$^~['), '\_s\+', '\\_s\\+', 'g')<CR><CR>
\gV:call setreg('"', old_reg, old_regtype)<CR>
" Fix backspace
set backspace=indent,eol,start
" Trim trailing spaces
autocmd BufWritePre *.rb :%s/\s\+$//e
autocmd BufWritePre *.haml :%s/\s\+$//e
autocmd BufWritePre *.erb :%s/\s\+$//e
autocmd BufWritePre *.js :%s/\s\+$//e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment