Skip to content

Instantly share code, notes, and snippets.

@fourcolors
Created July 15, 2016 16:48
Show Gist options
  • Save fourcolors/e24ad6da43f1815b06c03b5784db8a00 to your computer and use it in GitHub Desktop.
Save fourcolors/e24ad6da43f1815b06c03b5784db8a00 to your computer and use it in GitHub Desktop.
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'
Bundle 'Valloric/YouCompleteMe'
Bundle 'scrooloose/nerdtree'
Bundle 'airblade/vim-gitgutter'
Bundle 'ap/vim-css-color'
Bundle 'vim-scripts/colorsel.vim'
Bundle 'vim-scripts/hexHighlight.vim'
Bundle 'scrooloose/nerdcommenter'
Bundle 'nono/vim-handlebars'
Bundle 'chriskempson/base16-vim'
Bundle 'terryma/vim-multiple-cursors'
Bundle 'marijnh/tern_for_vim'
Bundle 'xolox/vim-notes'
Bundle 'xolox/vim-misc'
Bundle '29decibel/codeschool-vim-theme'
Bundle 'flazz/vim-colorschemes'
Bundle 'vim-scripts/Toggle-NERDTree-width'
Bundle 'pangloss/vim-javascript'
Bundle 'rizzatti/dash.vim'
Bundle 'djoshea/vim-autoread'
Bundle 'easymotion/vim-easymotion'
Plugin 'mileszs/ack.vim'
Plugin 'tmhedberg/matchit'
Plugin 'elixir-lang/vim-elixir'
Plugin 'alvan/vim-closetag'
Plugin 'jelera/vim-javascript-syntax'
Plugin 'nathanaelkane/vim-indent-guides'
Plugin 'rdnetto/YCM-Generator'
Plugin 'SirVer/ultisnips'
Plugin 'honza/vim-snippets'
Plugin 'Raimondi/delimitMate'
Plugin 'goatslacker/mango.vim'
Plugin 'othree/javascript-libraries-syntax.vim'
Plugin 'mxw/vim-jsx'
Plugin 'lifepillar/vim-wwdc16-theme'
Plugin 'JamshedVesuna/vim-markdown-preview'
Plugin 'tpope/vim-fugitive'
Plugin 'christoomey/vim-tmux-navigator'
Plugin 'ctrlpvim/ctrlp.vim'
Plugin 'scrooloose/syntastic'
Plugin 'kchmck/vim-coffee-script'
Plugin 'mtscout6/syntastic-local-eslint.vim'
" All of your Plugins must be added before the following line
call vundle#end() " required
filetype plugin indent on " required
" To ignore plugin indent changes, instead use:
"filetype plugin on
"
" Brief help
" :PluginList - lists configured plugins
" :PluginInstall - installs plugins; append `!` to update or just :PluginUpdate
" :PluginSearch foo - searches for foo; append `!` to refresh local cache
" :PluginClean - confirms removal of unused plugins; append `!` to auto-approve removal
"
" see :h vundle for more details or wiki for FAQ
" Put your non-Plugin stuff after this line
"" ----------------------------------------------------------------------------
"" Random other items
"" ----------------------------------------------------------------------------
" Custom ignore for ctrl-p
let g:ctrlp_custom_ignore = '\v[\/]\.(DS_Storegit|hg|svn|optimized|compiled|node_modules)$'
" Ignore html in syntastic since it doesn't handle handlebars
let syntastic_mode_map = { 'passive_filetypes': ['html'] }
"let g:syntastic_javascript_checkers = ['standard']
let g:used_javascript_libs = 'underscore,react,chai,jquery'
autocmd BufReadPre *.js let b:javascript_lib_use_jquery = 1
autocmd BufReadPre *.js let b:javascript_lib_use_underscore = 1
autocmd BufReadPre *.js let b:javascript_lib_use_react = 1
let g:jsx_ext_required = 0 " Allow JSX in normal JS files
let g:syntastic_javascript_checkers = ['eslint']
let vim_markdown_preview_github=1
command! Standard :call <SID>standard()
"command! Semistandard :call <SID>semistandard()
command! Eslint :call <SID>eslint()
function! s:eslint()
let g:syntastic_javascript_checkers = ['eslint']
let g:syntastic_javascript_standard_exec = 'standard'
SyntasticCheck
endfunction
function! s:standard()
let g:syntastic_javascript_checkers = ['standard']
let g:syntastic_javascript_standard_exec = 'standard'
SyntasticCheck
endfunction
function! s:semistandard()
let g:syntastic_javascript_checkers = ['standard']
let g:syntastic_javascript_standard_exec = 'semistandard'
SyntasticCheck
endfunction
let g:closetag_filenames = "*.html,*.xhtml,*.phtml, *.jsx, *.js"
" Don't require saving a buffer before switching buffers
set hidden
" Set notes directory for vim notes
let g:notes_directories = ['~/Documents/Notes']
" Scrolling in terminal vim
:set mouse=a
" Allow project based vimrc files
set exrc
"" ----------------------------------------------------------------------------
"" You Complete Me
"" ----------------------------------------------------------------------------
let g:ycm_register_as_syntastic_checker = 0
let g:ycm_autoclose_preview_window_after_completion = 1
let g:ycm_filetype_blacklist={'unite': 1}
let g:ycm_min_num_of_chars_for_completion = 1
nnoremap <leader>jd :YcmCompleter GoToDefinitionElseDeclaration<CR>
"" ----------------------------------------------------------------------------
"" UltiSnips
"" ----------------------------------------------------------------------------
let g:UltiSnipsExpandTrigger="<c-k>"
let g:UltiSnipsJumpForwardTrigger="<Tab>"
let g:UltiSnipsJumpBackwardTrigger="<c-b>"
"" ----------------------------------------------------------------------------
"" Silver Surfer
"" ----------------------------------------------------------------------------
nnoremap L :Ack "\b<C-R><C-W>\b"<CR>:cw<CR>
if executable('ag')
" Use ag over grep
set grepprg=ag\ --nogroup\ --nocolor
" Use ag in CtrlP for listing files. Lightning fast and respects .gitignore
let g:ctrlp_user_command = 'ag %s -l --nocolor -g ""'
" ag is fast enough that CtrlP doesn't need to cache
let g:ctrlp_use_caching = 0
endif
if executable('ag')
let g:ackprg = 'ag --vimgrep'
endif
"" ---------------------------------------------------------------------------
"" Easy Motion
"" ---------------------------------------------------------------------------
"map <Leader> <Plug>(easymotion-prefix)
nmap t <Plug>(easymotion-t2)
map / <Plug>(easymotion-sn)
omap / <Plug>(easymotion-tn)
omap n <Plug>(easymotion-next)
map N <Plug>(easymotion-prev)
map <Leader>l <Plug>(easymotion-lineforward)
map <Leader>j <Plug>(easymotion-j)
map <Leader>k <Plug>(easymotion-k)
map <Leader>h <Plug>(easymotion-linebackward)
nmap s <Plug>(easymotion-bd-w)
let g:EasyMotion_startofline = 0 " keep cursor colum when JK motion
let g:EasyMotion_smartcase = 1
"" ----------------------------------------------------------------------------
"" Key bindings / Mappings
"" ----------------------------------------------------------------------------
" mapleader
let mapleader = ","
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 wwdc16
"" Font stuff
set guifont=Roboto\ Mono\ for\ Powerline:h12
"" Colors in your font
"set t_Co=256
"set term=xterm-256color
set termguicolors
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
" Don't allow unsafe commands
set secure
" change swap file directory
set directory=$HOME/.vim/swp//
" manage tabs
set expandtab
set tabstop=2
set shiftwidth=2
set timeout timeoutlen=3000 ttimeoutlen=100
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment