Skip to content

Instantly share code, notes, and snippets.

@willopez
Last active June 13, 2017 03:40
Show Gist options
  • Save willopez/5b8f3ae254ecd4d1945d to your computer and use it in GitHub Desktop.
Save willopez/5b8f3ae254ecd4d1945d to your computer and use it in GitHub Desktop.
VIM Shortcuts
" Use space as leader
let mapleader = " "
" Use Ag to search files via ctrlp
unlet g:ctrlp_user_command
let g:ctrlp_user_command = 'ag %s -l --nocolor -g ""'
" NERDTree
map <Leader>nn :NERDTreeToggle<cr>
map <Leader>nf :NERDTreeFind<cr>
" CTRL-P
map <Leader>b :CtrlPBuffer<cr>
" Disable search highlighting
map <Leader>h :noh<cr>
" CTRL-P
map <Leader>f :CtrlPFunky<cr>
" Replace word with contents of register 0
map <leader>r cw<C-r>0<ESC>
" Write buffer
map <Leader>p :w<cr>
" Navigate to quickfix window
map <Leader>c :cope<cr>
" close quickfix window
map <Leader>q :cclose<cr>
" Delete buffer
map <Leader>d :bp<bar>sp<bar>bn<bar>bd<CR>
" Seach with Ag
map <Leader>s :Ag<Space>
" load file using CtrlP
map <Leader>l :CtrlP<cr>
" Add semicolon to end of line
map <leader>e :nohlsearch<cr> :s/$/;/<cr> :noh<cr>
" Move between splits by Ctrl + vim motion
nnoremap <C-J> <C-W><C-J>
nnoremap <C-K> <C-W><C-K>
nnoremap <C-L> <C-W><C-L>
nnoremap <C-H> <C-W><C-H>
" Allow JSX in normal JS files"
let g:jsx_ext_required = 0
" Use eslint checkker for JS files
let g:syntastic_javascript_checkers = ['eslint']
" Theme
color solarized
"color OceanicNext
" color mango
" 256 colors
set t_Co=256
" Disable swap files
set noswapfile
" Use two spaces for tabs
set tabstop=2
set shiftwidth=2
set expandtab
" Do not show hidden files
let NERDTreeIgnore=['\.\.$', '\.$', '\~$', '.DS_Store']
" YCM - organize popup
let g:ycm_add_preview_to_completeopt=0
let g:ycm_confirm_extra_conf=0
set completeopt-=preview
" Map snippet trigger to spacebar
let g:UltiSnipsExpandTrigger = '<c-space>'
" Indent guides
let g:indentLine_color_term = 239
set list
set listchars=tab:»-,trail:·,extends:>,precedes:<
" Add Nginx syntax highlighting
au BufRead,BufNewFile /etc/nginx/*,/usr/local/nginx/conf/* if &ft == '' | setfiletype nginx | endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment