Skip to content

Instantly share code, notes, and snippets.

@dab
Created May 24, 2016 22:26
Show Gist options
  • Save dab/b30184371a75436826e197094f588ec5 to your computer and use it in GitHub Desktop.
Save dab/b30184371a75436826e197094f588ec5 to your computer and use it in GitHub Desktop.
.vimrc
set nocompatible
filetype off
silent! if plug#begin('~/.vim/plugged')
Plug 'lambdatoast/elm.vim'
Plug 'wavded/vim-stylus'
Plug 'scrooloose/syntastic'
Plug 'tmux-plugins/vim-tmux'
Plug '1995eaton/vim-better-javascript-completion'
Plug 'elzr/vim-json'
Plug 'pangloss/vim-javascript'
Plug 'scrooloose/nerdcommenter'
Plug 'jordwalke/flatlandia'
Plug 'flazz/vim-colorschemes'
Plug 'mxw/vim-jsx'
Plug 'gerw/vim-HiLinkTrace'
Plug 'leafgarland/typescript-vim'
Plug 'Shougo/vimproc.vim', { 'do': 'make' }
Plug 'mhartington/oceanic-next'
Plug 'altercation/vim-colors-solarized'
Plug 'gosukiwi/vim-atom-dark'
Plug 'kien/rainbow_parentheses.vim'
Plug 'chrisbra/Colorizer'
Plug 'Yggdroot/indentLine'
Plug 'Raimondi/delimitMate'
Plug 'zenorocha/dracula-theme', {'rtp': 'vim/'}
Plug 'tpope/vim-fugitive'
Plug 'airblade/vim-gitgutter'
Plug 'Xuyuanp/nerdtree-git-plugin'
Plug 'matze/vim-move'
Plug 'editorconfig/editorconfig-vim'
Plug 'scrooloose/nerdtree'
Plug 'terryma/vim-multiple-cursors'
Plug 'ctrlpvim/ctrlp.vim'
Plug 'christoomey/vim-tmux-navigator'
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
Plug 'tpope/vim-surround'
Plug 'tomtom/tcomment_vim'
Plug 'Chiel92/vim-autoformat'
Plug 'Shougo/neocomplete.vim'
Plug 'Quramy/tsuquyomi'
Plug 'rking/ag.vim'
Plug 'mileszs/ack.vim'
call plug#end()
endif
filetype plugin indent on
let mapleader = ","
let maplocalleader = ","
" Quit
nnoremap <Leader>q :q<cr>
nnoremap <Leader>Q :qa!<cr>
" <BS> | NERD Tree
nnoremap <BS> :NERDTreeToggle<cr>
" jk | Escaping!
inoremap jk <Esc>
xnoremap jk <Esc>
cnoremap jk <C-c>
" Movement in insert mode
inoremap <C-h> <C-o>h
inoremap <C-l> <C-o>a
inoremap <C-j> <C-o>j
inoremap <C-k> <C-o>k
inoremap <C-^> <C-o><C-^>
" Copy to osx clipboard
vnoremap <C-c> "*y<CR>
vnoremap y "*y<CR>
nnoremap Y "*Y<CR>
map <esc> :noh<cr>
" Save
inoremap <C-s> <C-O>:update<cr>
nnoremap <C-s> :update<cr>
nnoremap <leader>s :update<cr>
nnoremap <leader>w :update<cr>
" Open the .vimrc in a new tab
nnoremap <leader>v :<C-u>tabedit $MYVIMRC<CR>
" Space to toggle folds.
nnoremap <Space> za
vnoremap <Space> za
if exists('$TMUX')
let &t_SI = "\<Esc>Ptmux;\<Esc>\<Esc>]50;CursorShape=1\x7\<Esc>\\"
let &t_EI = "\<Esc>Ptmux;\<Esc>\<Esc>]50;CursorShape=0\x7\<Esc>\\"
else
let &t_SI = "\<Esc>]50;CursorShape=1\x7"
let &t_EI = "\<Esc>]50;CursorShape=0\x7"
endif
set syntax=whitespace
set noswapfile
set showcmd
set backspace=indent,eol,start
filetype on
set number
set tabstop=2
set shiftwidth=2
set expandtab
set conceallevel=0
let g:vim_json_syntax_conceal = 0
set mouse=a
syntax enable
colorscheme dracula
set background=dark
set pastetoggle=<leader>p
vnoremap <C-c> "*y<CR>
highlight MatchTag ctermfg=black ctermbg=lightgreen guifg=black guibg=lightgreen
highlight clear SignColumn
call gitgutter#highlight#define_highlights()
nnoremap ; :
let g:indent_guides_auto_colors = 0
autocmd VimEnter,Colorscheme * :hi IndentGuidesOdd guibg=red ctermbg=3
autocmd VimEnter,Colorscheme * :hi IndentGuidesEven guibg=green ctermbg=4
set wildmenu
set laststatus=2
set colorcolumn=100
set wrap linebreak nolist
set virtualedit=
set display+=lastline
nnoremap <C-h> <C-w>h
nnoremap <C-j> <C-w>j
nnoremap <C-k> <C-w>k
nnoremap <C-l> <C-w>l
nnoremap <tab> <c-w>w
nnoremap <S-tab> <c-w>W
let g:vim_markdown_folding_disabled = 1
autocmd BufRead,BufNewFile *.md setlocal spell complete+=kspell
autocmd BufRead,BufNewFile *.txt setlocal spell complete+=kspell
let g:move_key_modifier = 'S'
let g:jsx_ext_required = 0
let g:used_javascript_libs = 'react'
set wildignore+=*.o,*.a,*.obj,*/.git/*,*/node_modules/*,*.class,*.zip,*.aux
:let $NVIM_TUI_ENABLE_CURSOR_SHAPE=1
autocmd StdinReadPre * let s:std_in=1
autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif
let NERDTreeShowHidden=1
autocmd FileType css,scss,sass :ColorHighlight
noremap <c-f> :Autoformat<CR>
let g:vimjs#casesensistive = 1
let g:vimjs#smartcomplete = 0
let g:vimjs#chromeapis = 0
autocmd FileType typescript inoremap <expr><TAB> pumvisible() ? "\<C-n>" : "\<TAB>"
let g:typescript_indent_disable = 1
" let g:neocomplete#enable_at_startup = 1
autocmd FileType css setlocal omnifunc=csscomplete#CompleteCSS
autocmd FileType html,markdown setlocal omnifunc=htmlcomplete#CompleteTags
autocmd FileType javascript setlocal omnifunc=javascriptcomplete#CompleteJS
autocmd FileType typescript setlocal omnifunc=tsuquyomi#complete
let g:neocomplete#sources#syntax#min_keyword_length = 3
if !exists('g:neocomplete#force_omni_input_patterns')
let g:neocomplete#force_omni_input_patterns = {}
endif
let g:neocomplete#force_omni_input_patterns.typescript = '\h\w*\|[^. \t]\.\w*'
autocmd FileType typescript setlocal completeopt-=preview
function! SetupCtrlP()
if exists("g:loaded_ctrlp") && g:loaded_ctrlp
augroup CtrlPExtension
autocmd!
autocmd FocusGained * CtrlPClearCache
autocmd BufWritePost * CtrlPClearCache
augroup END
endif
endfunction
if has("autocmd")
autocmd VimEnter * :call SetupCtrlP()
endif
let g:airline#extensions#tabline#enabled = 1
let g:airline#extensions#tabline#fnamemod = ':t'
let g:airline#extensions#tabline#show_tab_nr = 1
let g:airline_powerline_fonts = 1
if !exists('g:airline_symbols')
let g:airline_symbols = {}
endif
let g:airline_symbols.space = "\ua0"
let g:airline_theme = 'dracula'
nmap <leader>x :bp <BAR> bd #<CR>
nmap <leader>n :enew<cr>
nmap <leader>, :bnext<CR>
nmap <leader>. :bprevious<CR>
let g:airline#extensions#tabline#buffer_idx_mode = 1
nmap <leader>1 <Plug>AirlineSelectTab1
nmap <leader>2 <Plug>AirlineSelectTab2
nmap <leader>3 <Plug>AirlineSelectTab3
nmap <leader>4 <Plug>AirlineSelectTab4
nmap <leader>5 <Plug>AirlineSelectTab5
nmap <leader>6 <Plug>AirlineSelectTab6
nmap <leader>7 <Plug>AirlineSelectTab7
nmap <leader>8 <Plug>AirlineSelectTab8
nmap <leader>9 <Plug>AirlineSelectTab9
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*
let g:syntastic_javascript_checkers = ['eslint']
let g:syntastic_check_on_open = 0
let g:syntastic_aggregate_errors = 1
let g:syntastic_error_symbol = '✗'
let g:syntastic_warning_symbol = '!'
let g:syntastic_style_error_symbol = '✗'
let g:syntastic_style_warning_symbol = '!'
noremap <leader>t :SyntasticToggleMode<CR>
let g:syntastic_mode_map = { 'passive_filetypes': ['sass', 'scss','html'] }
map <Leader>e :lnext<CR>
map <Leader>E :lprev<CR>
let &t_ZH="\e[3m"
let &t_ZR="\e[23m"
let &t_Co=256
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment