Skip to content

Instantly share code, notes, and snippets.

@jorge-lavin
Last active November 22, 2016 23:40
Show Gist options
  • Save jorge-lavin/6155f4215092a2ef69a7f9068bd35ab9 to your computer and use it in GitHub Desktop.
Save jorge-lavin/6155f4215092a2ef69a7f9068bd35ab9 to your computer and use it in GitHub Desktop.
vimrc
" Set marker as fold method
" vim:fdm=marker
" Prepare Vundle {{{
set nocompatible " be iMproved
filetype off " must be off before Vundle has run
" Bootstrap Vundle, as seen in krisleech/turbo-vim
if !isdirectory(expand("~/.vim/bundle/Vundle.vim/.git"))
!git clone https://github.com/gmarik/Vundle.vim.git ~/.vim/bundle/Vundle.vim
endif
set runtimepath+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" }}}
" Plugins {{{
" let Vundle manage Vundle, required
Plugin 'gmarik/Vundle.vim'
" Zenburn colorscheme
Plugin 'jnurmine/Zenburn'
" ControlP file finder
Plugin 'ctrlpvim/ctrlp.vim'
" Cross-language commenter
Plugin 'scrooloose/nerdcommenter'
" Cross-language syntax checker
Plugin 'vim-syntastic/syntastic'
" Markdown
Plugin 'tpope/vim-markdown'
" Javascript
Plugin 'mxw/vim-jsx'
Plugin 'ternjs/tern_for_vim'
Plugin 'moll/vim-node' " Use gf at imports to go to file definition
Plugin 'othree/javascript-libraries-syntax.vim'
Plugin 'epilande/vim-react-snippets' " Useful snippets (SirVer/ultisnips required)
Plugin 'epilande/vim-es2015-snippets'
" HTML
Plugin 'othree/html5.vim'
" Tagbar, generate ctags files. Requires exuberant-ctags
Plugin 'majutsushi/tagbar'
" Snippets manager
Plugin 'SirVer/ultisnips'
" Trail whitespace
Plugin 'ntpeters/vim-better-whitespace'
" Gists
Plugin 'mattn/webapi-vim'
Plugin 'mattn/gist-vim'
" All of your Plugins must be added before the following line
call vundle#end() " required
filetype plugin on " required
" }}}
" Plugin Config {{{
" othree/javascript-libraries-syntax.vim
let g:used_javascript_libs = 'jquery,react'
" mxw/vim-jsx
" Also use JSX for .js files
let g:jsx_ext_required = 0
" vim-syntastic/syntastic
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*
let g:syntastic_always_populate_loc_list = 1
let g:syntastic_auto_loc_list = 1
let g:syntastic_check_on_open = 1
let g:syntastic_check_on_wq = 0
" You will need a global installation of eslint and the airbnb packages
" sudo npm install -g eslint eslint-plugin-import eslint-plugin-react
" and a hardcoded version of jsx-a11y, see https://github.com/evcohen/eslint-plugin-jsx-a11y/issues/116
" sudo npm install -g eslint-plugin-jsx-a11y@2.2.3
" and Add 'extends': 'airbnb' to your ~/.eslintrc
let g:syntastic_javascript_checkers = ['eslint']
" }}}
" Mappings {{{
" Leader Map
let mapleader=","
" Paste toggle to avoid autoindent in insert mode
set pastetoggle=<F10>
" Enable TagBar
nmap <F8> :TagbarToggle<CR>
" Search visual selected text
vnoremap // y/<C-R>"<CR>
" }}}
" Editor settings {{{
" Enable syntax highlighting
syntax on
" Backspace over autoindent, line breaks, start of insert (see :help 'backspace')
set backspace=indent,eol,start
" Use relative number to fast jump in normal mode
set relativenumber
" Always display status line
set laststatus=2
" You should set t_Co before colorscheme
set t_Co=256
" Colorscheme
try
" Zenburn may not be installed yet
colors zenburn
catch
echom "[WARN] zenburn is not yet installed, please run PluginInstall"
colors torte
endtry
" }}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment