Skip to content

Instantly share code, notes, and snippets.

@calbertts
Last active August 6, 2017 21:42
Show Gist options
  • Save calbertts/c91d8e70e2d33a7727772b60bacbb4fd to your computer and use it in GitHub Desktop.
Save calbertts/c91d8e70e2d33a7727772b60bacbb4fd to your computer and use it in GitHub Desktop.
"Figitive color scheme
hi DiffAdd guifg=NONE ctermfg=NONE guibg=#464632 ctermbg=238 gui=NONE cterm=NONE
hi DiffChange guifg=NONE ctermfg=NONE guibg=#335261 ctermbg=239 gui=NONE cterm=NONE
hi DiffDelete guifg=#f43753 ctermfg=203 guibg=#79313c ctermbg=237 gui=NONE cterm=NONE
hi DiffText guifg=NONE ctermfg=NONE guibg=NONE ctermbg=NONE gui=reverse cterm=reverse
"New line without insert mode
nnoremap <C-J> a<CR><Esc>k$
"Enable mouse
set mouse=a
"Hightlight search
set hlsearch
nnoremap <CR> :nohlsearch<CR><CR>
"Folding options
setlocal foldmethod=syntax
set foldlevelstart=20
"Move all swp files to tmp folder
set backupdir=$TMPDIR
set directory=$TMPDIR
"Avoid ESCAPE key
let g:easyescape_chars = { "j": 2 }
cnoremap jj <ESC>
"Autocomplete
"imap <Leader><Tab><Tab> <plug>(fzf-complete-word)
"imap <Leader><Tab-1><1> <plug>(fzf-complete-path)
autocmd InsertEnter * :set number
autocmd InsertLeave * :set relativenumber
set rtp+=/usr/local/opt/fzf
syntax on
filetype plugin indent on
set tabstop=2
set shiftwidth=2
set expandtab
set cursorline
set number
set nowrap
set numberwidth=5
set lazyredraw
set wildignore+=**/node_modules/**,**/dbData/**,**/jspm_packages/**,**/bundles/**,**/builds/**,**/dist/**
hi CursorLine cterm=NONE ctermbg=236 ctermfg=NONE
set fillchars+=vert:\│
hi clear VertSplit
hi LineNr ctermfg=grey
hi Visual guibg=black
let g:jsx_ext_required = 0
let g:airline#extensions#tabline#enabled = 1
let g:airline_powerline_fonts = 1
set laststatus=2
let g:gitgutter_sign_column_always = 1
let g:Powerline_symbols = 'fancy'
set encoding=utf-8
let g:airline_theme="wombat"
let $FZF_DEFAULT_COMMAND= 'ag -g ""'
"Cursors
let &t_SI = "\<Esc>]50;CursorShape=1\x7"
let &t_SR = "\<Esc>]50;CursorShape=2\x7"
let &t_EI = "\<Esc>]50;CursorShape=0\x7"
"Javascript stuff
let g:javascript_plugin_jsdoc = 1
let g:javascript_plugin_ngdoc = 1
let g:javascript_plugin_flow = 1
"Linter
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*
let g:syntastic_always_populate_loc_list = 0
let g:syntastic_auto_loc_list = 0
let g:syntastic_check_on_open = 1
let g:syntastic_check_on_wq = 0
let g:syntastic_javascript_checkers = ['jshint']
let g:syntastic_error_symbol = '✖'
let g:syntastic_style_error_symbol = '>>'
let g:syntastic_warning_symbol = '⚠'
let g:syntastic_style_warning_symbol = '🤦'
highlight link SyntasticErrorSign SignColumn
highlight link SyntasticWarningSign SignColumn
highlight link SyntasticStyleErrorSign SignColumn
highlight link SyntasticStyleWarningSign SignColumn
"End Linter
"End JS stuff
" Git stuff
set diffopt+=vertical
set rtp+=/Users/calbertts/.vim/plugged/powerline/bindings/vim
"keys stuff
set showcmd
let mapleader = "\<Space>"
"Horizontal scroll
map <C-L> 10zl " Scroll 10 characters to the right
map <C-H> 10zh " Scroll 10 characters to the left
"Working with files
nnoremap <Leader>o :FZF<CR>
nnoremap <Leader>w :bd<CR>
nnoremap <Leader>n :bnext<CR>
nnoremap <Leader>b :bprev<CR>
nnoremap <Leader>c :Buffers<CR>
nnoremap <leader>z <C-^>
noremap <C-N> :enew<CR>
inoremap <C-S> <C-[>:w<CR>
"Copy/Paste from clipboard
vnoremap <Leader>y "*y
nnoremap <Leader>p "+p
"Save
nnoremap <Leader>s :w<CR>
"Resize windows
nnoremap <Leader>+ :exe "resize " . (winheight(0) * 3/2)<CR>
nnoremap <Leader>- :exe "resize " . (winheight(0) * 2/3)<CR>
" Plugins
call plug#begin('~/.vim/plugged')
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
Plug 'junegunn/fzf.vim'
Plug 'pangloss/vim-javascript'
Plug 'maxmellon/vim-jsx-pretty'
Plug 'powerline/powerline'
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
Plug 'airblade/vim-gitgutter'
Plug 'airblade/vim-gitgutter'
Plug 'pangloss/vim-javascript'
Plug 'mxw/vim-jsx'
Plug 'tpope/vim-fugitive'
Plug 'zhou13/vim-easyescape'
Plug 'scrooloose/nerdtree'
Plug 'herrbischoff/cobalt2.vim'
Plug 'vim-syntastic/syntastic'
Plug 'JamshedVesuna/vim-markdown-preview'
Plug 'jiangmiao/auto-pairs'
Plug 'nicwest/QQ.vim'
Plug 'tpope/vim-surround'
call plug#end()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment