Skip to content

Instantly share code, notes, and snippets.

@fourcolors
Created November 21, 2014 18:07
Show Gist options
  • Save fourcolors/3977606705cc02553953 to your computer and use it in GitHub Desktop.
Save fourcolors/3977606705cc02553953 to your computer and use it in GitHub Desktop.
Sterling's Vimrc
"" ----------------------------------------------------------------------------
"" Random other items
"" ----------------------------------------------------------------------------
" Custom ignore for ctrl-p
let g:ctrlp_custom_ignore = '\v[\/]\.(DS_Storegit|hg|svn|optimized|compiled|node_modules)$'
"let g:ctrlp_custom_ignore = 'node_modules\|DS_Store\|git'
" Ignore html in syntastic since it doesn't handle handlebars
let syntastic_mode_map = { 'passive_filetypes': ['html'] }
" Don't require saving a buffer before switching buffers
set hidden
" Set notes directory for vim notes
let g:notes_directories = ['~/Documents/Notes']
"" ----------------------------------------------------------------------------
"" Key bindings / Mappings
"" ----------------------------------------------------------------------------
" mapleader
let mapleader = ","
map <Leader>s :source $MYVIMRC<CR>
map <Leader>e :e $MYVIMRC<CR>
imap <Leader>a <C-n>
map <Leader>b :CtrlPBuffer<CR>
"" toggle and start nerdtree
map <Leader>ns :NERDTreeToggle<CR>
let g:NERDTreeWinPos = "right"
"" Add control tab support
noremap <c-tab> :tabnext<cr>
"" Fix command typos (stolen from Adam Katz)
nmap ; :
"" Highlight lines over 80 characters long by pressing leader H
nnoremap <Leader>H :call<SID>LongLineHLToggle()<cr>
hi OverLength ctermbg=none cterm=none
match OverLength /\%>80v/
fun! s:LongLineHLToggle()
if !exists('w:longlinehl')
let w:longlinehl = matchadd('ErrorMsg', '.\%>80v', 0)
echo "Long lines highlighted"
else
call matchdelete(w:longlinehl)
unl w:longlinehl
echo "Long lines unhighlighted"
endif
endfunction
"" End of highlighting lines
"" Treat <li> and <p> tags like the block tags they are
let g:html_indent_tags = 'li\|p'
"" ---------------------------------------------------------------------------
"" Text type
"" ---------------------------------------------------------------------------
""
"" For .rabl type
au BufRead,BufNewFile *.rabl setf ruby
"" For Stylus"
au BufRead,BufNewFile *.styl setf sass
"" For Haml
au! BufRead,BufNewFile *.haml setfiletype haml
"" Highlighting for .ejs files
au BufNewFile,BufRead *.ejs set filetype=html
"" Highlighting for .handlebars files
au BufRead,BufNewFile *.handlebars,*.hbs set ft=html syntax=handlebars
"" ---------------------------------------------------------------------------
"" Color Schemes
"" ---------------------------------------------------------------------------
""
"" Color scheme
syntax enable
set background=dark
colorscheme blazer
"" Font stuff
set guifont=Inconsolata-dz\ for\ Powerline:h13
"" Colors in your font
set t_Co=256
"set term=xterm-256color
set relativenumber
set number
set numberwidth=5
set nowrap
"" Stop Gitgutter from freaking out
set shell=/bin/bash
"" Setup powerline
source /usr/local/lib/python2.7/site-packages/powerline/bindings/vim/plugin/powerline.vim
set laststatus=2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment