Skip to content
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
226 lines (198 sloc) 6.99 KB
call plug#begin('~/.vim/vendor')
Plug 'semanser/vim-outdated-plugins'
Plug 'joshdick/onedark.vim'
Plug 'mhinz/vim-startify'
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
Plug 'junegunn/fzf.vim'
Plug 'jiangmiao/auto-pairs'
Plug 'junegunn/vim-easy-align'
Plug 'easymotion/vim-easymotion'
Plug 'Yggdroot/indentLine'
Plug 'itchyny/lightline.vim'
Plug 'tpope/vim-commentary'
Plug 'tpope/vim-surround'
Plug 'airblade/vim-gitgutter'
Plug 'tpope/vim-fugitive'
Plug 'machakann/vim-highlightedyank'
Plug 'ntpeters/vim-better-whitespace'
Plug 'mhinz/vim-startify'
Plug 'kassio/neoterm'
Plug 'SirVer/ultisnips'
Plug 'honza/vim-snippets'
Plug 'epilande/vim-react-snippets'
Plug 'dbakker/vim-projectroot'
Plug 'editorconfig/editorconfig-vim'
Plug 'w0rp/ale'
Plug 'sheerun/vim-polyglot'
Plug 'pangloss/vim-javascript'
Plug 'elzr/vim-json'
Plug 'chemzqm/vim-jsx-improve'
Plug 'maxmellon/vim-jsx-pretty'
Plug 'jelera/vim-javascript-syntax'
Plug 'Quramy/vim-js-pretty-template'
" Plug 'neoclide/coc.nvim', {'tag': '*', 'do': { -> coc#util#install()}}
Plug 'neoclide/coc.nvim', {'do': { -> coc#util#install()}}
call plug#end()
" Watch for VIMrc changes
augroup myvimrc
au BufWritePost .vimrc,init.vim so $MYVIMRC | if has('gui_running') | so $MYGVIMRC | endif
augroup END
" Basic Config set path+=** set undodir=~/.vim/undodir
set undofile
set number
set relativenumber
" UI / Appearance
syntax on " enable syntax highlighting
let g:onedark_terminal_italics=1
colorscheme onedark
set lazyredraw " faster scrolling
set splitbelow " open new split panes to right and bottom
set splitright
set hidden
set guifont=Fura\ Code\ Regular\ Nerd\ Font\ Complete:14
set diffopt+=vertical " use vertical diffs
highlight ColorColumn ctermbg=236 guibg=#303030
let &colorcolumn=join(range(120,999),',')
set guicursor=n-v-c:block,i-ci-ve:ver25,r-cr:hor20,o:hor50
set previewheight=28
" Files Indentation
filetype indent on " load indent settings based on file type
set shiftwidth=2 " number of spaces to use for indenting
set softtabstop=4 " number of spaces to use when inserting a tab
set tabstop=4 " show tabs as 2 spaces
set expandtab " convert tabs into spaces
" Text
set textwidth=120
set nowrap " nowrap by default
set list " show invisible characters
set listchars=tab:»·,trail:·,nbsp:· " display extra whitespace
set iskeyword+=- " treat dash separated words as word text object
" Search
set smartcase " use case sensitive if capital letter present or \C
set ignorecase " ignore case in searches
set magic " use "magic" patterns
" Mouse
set mouse=a " enable mouse
" CoC
set cmdheight=2
set updatetime=300
set shortmess+=c
set signcolumn=yes
augroup toggle_relative_number
autocmd InsertEnter * :setlocal norelativenumber
autocmd InsertLeave * :setlocal relativenumber
augroup END
" Mappings
let g:mapleader="\<Space>"
inoremap jk <c-c>`^
" Remap colon operator semicolon for ease of use
nnoremap ; :
" Reize panes on window resize
nnoremap <C-w>r :WinResizerStartResize<CR>
" Hide found words on esc press
map <silent> <esc> :nohlsearch<CR>
" Maintain visual modes on indent and remap the keys
xnoremap <Tab> >gv
xnoremap <S-Tab> <gv
xnoremap > >gv
xnoremap < <gv
nnoremap <C-p> :FZF!<cr>
nnoremap <Leader>s :Rg <CR>
" Terminal Mappings tnoremap <leader><esc> <C-\><C-n><esc><cr> tnoremap <C-o> <C-\><C-n><esc><cr>
nnoremap <silent> <leader>o :vertical botright Ttoggle<cr><C-w>l
nnoremap <silent> <leader>O :horizontal rightbelow Ttoggle<cr><C-w>j
nnoremap <silent> <leader><space> :vertical botright Ttoggle<cr><C-w>l
tnoremap <silent> <leader>o <C-\><C-n>:Ttoggle<cr>
tnoremap <silent> <leader><space> <C-\><C-n>:Ttoggle<cr>
tnoremap <leader><esc> <C-\><C-n><esc><cr>
tnoremap <C-o> <C-\><C-n><esc><cr>
" Git Mappings
nnoremap <silent> <leader>gs :G<CR>
nnoremap <silent> <leader>gd :Gdiff<CR>
nnoremap <silent> <leader>gp :Gpush<CR>
" Plugin Options
" Better Whitespace
let g:strip_whitespace_on_save=1
" IndentLine
let g:indentLine_char='|'
let g:indentLine_color_term=238
let g:indentLine_color_gui="#454C5A"
" lightline
let g:lightline = { 'colorscheme': 'onedark' }
" Ale
let g:ale_linters = {
\ 'javascript': ['eslint'],
let g:ale_fixers = {
\ '*': ['remove_trailing_lines', 'trim_whitespace'],
\ 'javascript': ['eslint'],
let g:ale_sign_error = '' " Less aggressive than the default '>>'
let g:ale_sign_warning = '.'
let g:ale_lint_on_enter = 0 " Less distracting when opening a new file
let g:ale_completion_enabled = 0
highlight link ALEWarningSign Directory
highlight link ALEErrorSign WarningMsg
nnoremap <silent> <leader>ne :ALENextWrap<CR>
nnoremap <silent> <leader>pe :ALEPreviousWrap<CR>
let g:ale_sh_shfmt_options = '-i 2 -ci'
let g:ale_fix_on_save = 1
let g:ale_lint_on_text_changed = 'normal'
let g:ale_lint_on_insert_leave = 1
" Buffers
nnoremap <leader>b :Buffers<cr>
nnoremap <leader>bn :bnext<cr>
nnoremap <leader>bp :bprev<cr>
" Easy Align
xmap ga <Plug>(EasyAlign)
nmap gal <Plug>(EasyAlign)
" Ctags
map <Leader>ct :!ctags -R .<CR>
" CoC
inoremap <silent><expr> <TAB>
\ pumvisible() ? "\<C-n>" :
\ <SID>check_back_space() ? "\<TAB>" :
\ coc#refresh()
inoremap <expr><S-TAB> pumvisible() ? "\<C-p>" : "\<C-h>"
inoremap <expr> <cr> pumvisible() ? "\<C-y>" : "\<cr>"
function! s:check_back_space() abort
let col = col('.') - 1
return !col || getline('.')[col - 1] =~# '\s'
inoremap <silent><expr> <c-space> coc#refresh()
nnoremap <silent> K :call <SID>show_documentation()<CR>
function! s:show_documentation()
if &filetype == 'vim'
execute 'h '.expand('<cword>')
call CocAction('doHover')
" UltiSnips
let g:UltiSnipsExpandTrigger="<c-j>"
let g:UltiSnipsEditSplit="vertical"
" Project Root
function! Guess()
return projectroot#guess()
nnoremap <leader>t :execute 'Files ' . Guess()<CR>
" Vim JSX pretty
let g:vim_jsx_pretty_colorful_config=1
" Remap Split Navigation
nnoremap <C-H> <C-W><C-H>
nnoremap <C-J> <C-W><C-J>
nnoremap <C-K> <C-W><C-K>
nnoremap <C-L> <C-W><C-L>
" ALE mappings
nmap <silent> [W <Plug>(ale_first)
nmap <silent> [w <Plug>(ale_previous)
nmap <silent> ]w <Plug>(ale_next)
nmap <silent> ]W <Plug>(ale_last)
" Switch between 2 files faster
nnoremap <tab><tab> <c-^>
" Change word everywhere
nnoremap <Leader>c :%s/\<<C-r><C-w>\>//gc<Left><Left><Left>
You can’t perform that action at this time.