Skip to content

Instantly share code, notes, and snippets.

@andrewdelprete
Created April 29, 2017 05:30
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 andrewdelprete/d92664337d492327b523843aff84929f to your computer and use it in GitHub Desktop.
Save andrewdelprete/d92664337d492327b523843aff84929f 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()
" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'
Plugin 'FuzzyFinder'
Plugin 'L9'
Plugin 'Raimondi/delimitMate'
Plugin 'Valloric/YouCompleteMe'
Plugin 'airblade/vim-gitgutter'
Plugin 'amiorin/vim-project'
Plugin 'christoomey/vim-tmux-navigator'
Plugin 'ctrlpvim/ctrlp.vim'
Plugin 'itchyny/lightline.vim'
Plugin 'jelera/vim-javascript-syntax'
Plugin 'jiangmiao/auto-pairs'
Plugin 'jlanzarotta/bufexplorer'
Plugin 'kristijanhusak/vim-hybrid-material'
Plugin 'mxw/vim-jsx'
Plugin 'nathanaelkane/vim-indent-guides'
Plugin 'nelstrom/vim-markdown-preview'
Plugin 'pangloss/vim-javascript'
Plugin 'posva/vim-vue'
Plugin 'scrooloose/nerdtree'
Plugin 'scrooloose/syntastic'
Plugin 'terryma/vim-multiple-cursors'
Plugin 'tomtom/tcomment_vim'
Plugin 'tpope/vim-fugitive'
Plugin 'tpope/vim-sensible'
Plugin 'tpope/vim-sleuth'
Plugin 'whatyouhide/vim-gotham'
Plugin 'mtscout6/syntastic-local-eslint.vim'
Plugin 'sbdchd/neoformat'
Plugin 'tpope/vim-surround.git'
Plugin 'tpope/vim-repeat.git'
Plugin 'heavenshell/vim-jsdoc'
Plugin 'gabesoft/vim-ags'
Plugin 'tmhedberg/matchit'
Plugin 'ryanoasis/vim-devicons'
Plugin 'tiagofumo/vim-nerdtree-syntax-highlight'
Plugin 'terryma/vim-expand-region'
Plugin 'svermeulen/vim-easyclip'
Plugin 'easymotion/vim-easymotion'
Plugin 'lepture/vim-jinja'
Plugin 'haya14busa/incsearch.vim'
" All of your Plugins must be added before the following line
call vundle#end() " required
filetype plugin indent on " required
" Open .vimrc
nnoremap <leader>v :tabedit $MYVIMRC<cr>
set shell=/bin/zsh
set background=dark
set guifont=FuraMonoForPowerline\ Nerd\ Font:h13
set linespace=6
colorscheme gotham
set macmeta
set t_CO=256
set autoindent
set autoread
set autowrite " Save on buffer switch
set autowriteall " Save *all* buffers on switch
set clipboard=unnamed " Use system clipboard for yanking and pasting
set colorcolumn=+1
set cursorline " Highlight the current cursor's line
set noswapfile
set encoding=utf-8
set expandtab " expand tabs to spaces
set guioptions-=T " Removes top toolbar
set guioptions-=e " We don't want Gui tabs.
set guioptions-=l "Disable Gui scrollbars.
set guioptions-=L
set guioptions-=r
set guioptions-=R
set hidden " Disable Vim's error message when switching edited buffers without saving
set hlsearch
set ignorecase
set incsearch
set laststatus=2
set list " show trailing whitespace
set listchars=tab:→\ ,trail:▒,nbsp:·
set macligatures " We want pretty symbols, when available.
set mouse=a
set noerrorbells " don't beep
set noshowmode
set nowrap
set numberwidth=1 " Show line numbers
set relativenumber " Show relative line numbers in normal mode
set ruler " show where you are
set scrolloff=10 " show context above/below cursorline
set sidescrolloff=15
set sidescroll=1
set shiftwidth=2 " normal mode indentation commands use 2 spaces
set showcmd
set smartcase " case-sensitive search if any caps
set splitbelow
set splitright
set softtabstop=2 " insert mode tab and backspace use 2 spaces
set tabstop=2 " actual tabs occupy 2 characters
set textwidth=80
set timeout timeoutlen=200 ttimeoutlen=100
set visualbell " don't beep
set wildmenu " show a navigable menu for tab completion
let g:netrw_liststyle=3
let g:netrw_banner=0
" CtrlP
nnoremap <leader>b :CtrlPBuffer<CR>
nnoremap <leader>t :CtrlP<CR>
nnoremap <leader>e :CtrlPMRUFiles<CR>:CtrlP<CR>
nnoremap <leader>T :CtrlPClearCache<CR>:CtrlP<CR>
nmap <D-e> :CtrlPMRUFiles<CR>
map <D-p> :CtrlP<cr>
let g:ctrlp_max_files=0
let g:ctrlp_match_window = 'bottom,order:btt,min:1,max:15,results:15'
let g:ctrlp_custom_ignore = {
\ 'dir': '\.git$\|\.hg$\|dist\|app.min.js|bundle\|node_modules\|bower_components\|purescript\/output'
\ }
let g:ctrlp_buffer_func = { 'enter': 'BrightHighlightOn', 'exit': 'BrightHighlightOff' }
function! BrightHighlightOn()
hi CursorLine guibg=#0a1f2d
endfunction
function! BrightHighlightOff()
hi CursorLine guibg=#191919
endfunction
" The Silver Searcher
if executable('ag')
let g:ags_no_stats = 1
" 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
" Indent Guidelines
let g:indent_guides_enable_on_vim_startup=1
set ts=2 sw=2 et
"let g:indent_guides_start_level = 1
let g:indent_guides_guide_size = 1
let g:indent_guides_auto_colors = 0
autocmd VimEnter,Colorscheme * :hi IndentGuidesOdd guibg=#1d2329 ctermbg=black
autocmd VimEnter,Colorscheme * :hi IndentGuidesEven guibg=#1d2329 ctermbg=darkgrey
"JSX
let g:jsx_ext_required = 0
" Comment out lines like Sublime and Atom
map <D-/> :TComment<cr>
vmap <D-/> :TComment<cr>gv
" Indent lines with cmd+[ and cmd+]
nmap <D-]> >>
nmap <D-[> <<
vmap <D-[> <gv
vmap <D-]> >gv
map <Tab> >
imap <Tab> <Esc> >
vmap <Tab> >gv
map <S-Tab> <
imap <S-Tab> <Esc> <
vmap <S-Tab> <gv
" Move lined with option
nnoremap <M-j> :m .+1<CR>==
nnoremap <M-k> :m .-2<CR>==
inoremap <M-j> <Esc>:m .+1<CR>==gi
inoremap <M-k> <Esc>:m .-2<CR>==gi
vnoremap <M-j> :m '>+1<CR>gv=gv
vnoremap <M-k> :m '<-2<CR>gv=gv
" Auto-remove trailing spaces
autocmd BufWritePre *.php :%s/\s\+$//e
autocmd BufWritePre *.js :%s/\s\+$//e
" When you close a buffer, open a new blank one (good for NERDTree)
map <leader>q :bp<bar>sp<bar>bn<bar>bd<CR>
" NERDTree
nmap <leader>d :NERDTreeToggle<cr>
nmap <d>kb :NERDTreeToggle<cr>
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif
autocmd FileType nerdtree setlocal nolist
let g:NERDTreeHijackNetrw=0
let g:NERDTreeAutoDeleteBuffer=1
let g:NERDTreeMinimalUI=1
let g:NERDTreeChDirMode=2
let g:NERDTreeShowBookmarks=1
let g:NERDTreeShowHidden=1
let g:WebDevIconsNerdTreeAfterGlyphPadding = ''
" EasyMotion
let g:EasyMotion_smartcase = 1
let g:EasyMotion_startofline = 0 " keep cursor column when JK motion
map <Leader>l <Plug>(easymotion-lineforward)
map <Leader>j <Plug>(easymotion-j)
map <Leader>k <Plug>(easymotion-k)
map <Leader>h <Plug>(easymotion-linebackward)
" IncSearch
map / <Plug>(incsearch-forward)
map ? <Plug>(incsearch-backward)
map g/ <Plug>(incsearch-stay)
set hlsearch
map ; :noh<CR>
let g:incsearch#auto_nohlsearch = 1
map n <Plug>(incsearch-nohl-n)
map N <Plug>(incsearch-nohl-N)
map * <Plug>(incsearch-nohl-*)
map # <Plug>(incsearch-nohl-#)
map g* <Plug>(incsearch-nohl-g*)
map g# <Plug>(incsearch-nohl-g#)
" Lightline
let g:lightline = {
\ 'colorscheme': 'gotham',
\ 'active': {
\ 'left': [ [ 'mode', 'paste' ],
\ [ 'fugitive', 'readonly', 'filename', 'modified' ] ]
\ },
\ 'component': {
\ 'readonly': '%{&filetype=="help"?"":&readonly?"|":""}',
\ 'modified': '%{&filetype=="help"?"":&modified?"+":&modifiable?"":"-"}',
\ 'fugitive': '%{exists("*fugitive#head")?fugitive#head():""}'
\ },
\ 'component_visible_condition': {
\ 'readonly': '(&filetype!="help"&& &readonly)',
\ 'modified': '(&filetype!="help"&&(&modified||!&modifiable))',
\ 'fugitive': '(exists("*fugitive#head") && ""!=fugitive#head())'
\ },
\ 'separator': { 'left': "\ue0b0", 'right': "\ue0b2" },
\ 'subseparator': { 'left': "\ue0b1", 'right': "\ue0b3" }
\ }
" Syntastic
let g:syntastic_javascript_checkers = ['eslint']
let g:syntastic_always_populate_loc_list = 1
let g:syntastic_auto_loc_list = 0
let g:syntastic_check_on_open = 0
let g:syntastic_check_on_wq = 0
let g:go_list_type = "quickfix"
let g:syntastic_loc_list_height = 5
map <leader>f :silent !standard --fix %<CR> :SyntasticReset<CR> :SyntasticCheck<CR>
" Make 0 go to the first non-space character in a line (the true beginning of the line)
nmap 0 ^
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment