Skip to content

Instantly share code, notes, and snippets.

@MaciekBaron
Last active August 29, 2015 14: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 MaciekBaron/e2690d7f91a56eaf4663 to your computer and use it in GitHub Desktop.
Save MaciekBaron/e2690d7f91a56eaf4663 to your computer and use it in GitHub Desktop.
My vim config
" Fixes some issues
set nocompatible
" Required by Vundle (init)
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'bling/vim-airline'
Plugin 'airblade/vim-gitgutter'
Plugin 'mattn/emmet-vim'
Plugin 'tpope/vim-surround'
Bundle 'cakebaker/scss-syntax.vim'
Bundle 'scrooloose/nerdtree'
Bundle 'scrooloose/syntastic'
Bundle 'terryma/vim-multiple-cursors'
Bundle 'msanders/snipmate.vim'
Bundle 'ciaranm/detectindent'
" Required by Vundle (close)
call vundle#end()
filetype plugin indent on
" w!! will allow to save changes to a read-only file
cmap w!! %!sudo tee > /dev/null %
" Always display line numbers
set nu
" Activate mouse support
set mouse=a
" Lower update time to improve GitGutter's response time
set updatetime=750
" Set tab width to 4 spaces
set tabstop=4
set shiftwidth=4
set noexpandtab
" Enable syntax highlighting
syntax on
" Choose color scheme
colorscheme tnight
" Configure GitGutter (always have gutter and try realtime)
let g:gitgutter_sign_column_always = 1
let g:gitgutter_realtime = 1
let g:syntastic_check_on_open = 1
let g:syntastic_enable_signs = 1
" Open NERDTree on launch
autocmd vimenter * NERDTree
" Focus on the file window
autocmd VimEnter * wincmd p
" Close VIM if NERDTree is the only tab open
autocmd bufenter * if (winnr('$') == 1 && exists('b:NERDTreeType') && b:NERDTreeType == 'primary') | q | endif
" Run DetectIndent when a file is opened
autocmd BufReadPost * :DetectIndent
" Make sure the handlebars syntax is used for hbs files
au BufRead,BufNewFile *.handlebars,*.hbs set ft=html syntax=handlebar
" Highlight TODOs regardless of file opened
syn match myTodo contained "\<\(TODO\|FIXME\):"
hi def link myTodo Todo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment