Skip to content

Instantly share code, notes, and snippets.

@timrourke
Created June 17, 2015 18:26
Show Gist options
  • Save timrourke/93b0789fc099951c09b0 to your computer and use it in GitHub Desktop.
Save timrourke/93b0789fc099951c09b0 to your computer and use it in GitHub Desktop.
My very first .vimrc file
set nocompatible
filetype off " Required
" Define our bundle plugin block.
" After adding a plugin below, run the following 2 commands and restart vim:
" :source %
" :PluginInstall
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'gmarik/Vundle.vim' " Required
Plugin 'vim-colors-solarized' " solarized theme
Plugin 'nerdtree' " NERDtree plugin
Plugin 'pangloss/vim-javascript' " vim-javascript pugin
Plugin 'Valloric/YouCompleteMe'
Plugin 'marijnh/tern_for_vim'
call vundle#end() "All plugins should be added above this line
filetype plugin indent on " Required
" Set up powerline
python from powerline.vim import setup as powerline_setup
python powerline_setup()
python del powerline_setup
" various user settings
set laststatus=2
set bs=2
set encoding=utf8
set termencoding=utf8
" set up patched font for use with Powerline (this matches Source Code Pro,
" the font I'm currently using in macvim)
set guifont=Sauce\ Code\ Powerline:h14
set ts=2
set sw=2
set number
set ruler
set t_Co=256
let g:Powerline_symbols = "fancy"
syntax enable
" Use the solarized-dark color scheme for vim
set background=dark
colorscheme solarized
" Set up commands for NERDTree
autocmd StdinReadPre * let s:std_in=1
autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif
map <C-n> :NERDTreeToggle<CR> " set up NERDtree to use ctrl+n to open it
" NERDTress File highlighting
function! NERDTreeHighlightFile(extension, fg, bg, guifg, guibg)
exec 'autocmd filetype nerdtree highlight ' . a:extension .' ctermbg='. a:bg .' ctermfg='. a:fg .' guibg='. a:guibg .' guifg='. a:guifg
exec 'autocmd filetype nerdtree syn match ' . a:extension .' #^\s\+.*'. a:extension .'$#'
endfunction
" File extension-specific color highlighting.
" TODO: prettify this. These colors are fugly.
call NERDTreeHighlightFile('jade', 'green', 'none', 'green', '#151515')
call NERDTreeHighlightFile('ini', 'yellow', 'none', 'yellow', '#151515')
call NERDTreeHighlightFile('md', 'blue', 'none', '#3366FF', '#151515')
call NERDTreeHighlightFile('yml', 'yellow', 'none', 'yellow', '#151515')
call NERDTreeHighlightFile('config', 'yellow', 'none', 'yellow', '#151515')
call NERDTreeHighlightFile('conf', 'yellow', 'none', 'yellow', '#151515')
call NERDTreeHighlightFile('json', 'yellow', 'none', 'yellow', '#151515')
call NERDTreeHighlightFile('js', 'yellow', 'none', 'yellow', '#151515')
call NERDTreeHighlightFile('html', 'yellow', 'none', 'yellow', '#151515')
call NERDTreeHighlightFile('styl', 'cyan', 'none', 'cyan', '#151515')
call NERDTreeHighlightFile('css', 'cyan', 'none', 'cyan', '#151515')
call NERDTreeHighlightFile('scss', 'cyan', 'none', 'cyan', '#151515')
call NERDTreeHighlightFile('coffee', 'Red', 'none', 'red', '#151515')
call NERDTreeHighlightFile('js', 'Red', 'none', '#ffa500', '#151515')
call NERDTreeHighlightFile('php', 'Magenta', 'none', '#ff00ff', '#151515')
" A bit more NERDTree config
let NERDTreeShowHidden=1
let NERDTreeMinimalUI=1
let NERDTreeDirArrows=1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment