Skip to content

Instantly share code, notes, and snippets.

@cuongcua90
Created July 25, 2016 10:02
Show Gist options
  • Save cuongcua90/7e324f781f4657f4687ddc220ba44ecf to your computer and use it in GitHub Desktop.
Save cuongcua90/7e324f781f4657f4687ddc220ba44ecf to your computer and use it in GitHub Desktop.
execute pathogen#infect()
" General setting
set nocompatible
filetype indent plugin on
syntax on
colorscheme molokai
let mapleader = ' '
"Vundle
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
Plugin 'Valloric/YouCompleteMe'
Plugin 'tpope/vim-fugitive'
Plugin 'marijnh/tern_for_vim'
Plugin 'kien/ctrlp.vim'
Plugin 'scrooloose/syntastic'
Plugin 'tpope/vim-sensible'
Plugin 'easymotion/vim-easymotion'
Plugin 'tomasr/molokai'
Plugin 'pangloss/vim-javascript'
Plugin 'mxw/vim-jsx'
Plugin 'tpope/vim-fireplace'
Plugin 'guns/vim-clojure-static'
Plugin 'guns/vim-clojure-highlight'
Plugin 'kien/rainbow_parentheses.vim'
Plugin 'godlygeek/tabular'
Plugin 'plasticboy/vim-markdown'
Plugin 'fatih/vim-go'
Plugin 'wesQ3/vim-windowswap'
Plugin 'scrooloose/nerdcommenter'
Plugin 'Raimondi/delimitMate'
Plugin 'vim-scripts/Conque-GDB'
" vim-react-snippets:
Plugin 'justinj/vim-react-snippets'
"
" " SnipMate and its dependencies:
Plugin 'MarcWeber/vim-addon-mw-utils'
Plugin 'tomtom/tlib_vim'
Plugin 'garbas/vim-snipmate'
" Python
Plugin 'hynek/vim-python-pep8-indent'
" " Other sets of snippets (optional):
Plugin 'honza/vim-snippets'
Plugin 'terryma/vim-multiple-cursors'
" wakatime
Plugin 'wakatime/vim-wakatime'
call vundle#end()
" Clojure
au FileType clojure RainbowParenthesesActivate
au Syntax * RainbowParenthesesLoadRound
let g:clojure_fuzzy_indent=1
let g:clojure_align_multiline_strings = 1
let g:clojure_fuzzy_indent_patterns=['^GET', '^POST', '^PUT', '^DELETE', '^ANY', '^HEAD', '^PATCH', '^OPTIONS', '^def']
autocmd FileType clojure setlocal lispwords+=describe,it,testing,facts,fact,provided
:nmap <C-j> 20j
:nmap <C-k> 20k
:smap <C-j> 20j
:smap <C-k> 20k
set hidden
set wildmenu
set showcmd
set hlsearch
set ignorecase
set smartcase
set backspace=indent,eol,start
set autoindent
set nostartofline
set ruler
set laststatus=2
set visualbell
set mouse=a
set cmdheight=2
set number
set notimeout ttimeout ttimeoutlen=200
set tabstop=2
set shiftwidth=2
set softtabstop=2
set expandtab
let g:javascript_enable_domhtmlcss=1
let g:molokai_original = 1
let g:jsx_ext_required = 0
highlight OverLength ctermbg=red ctermfg=white guibg=#592929
match OverLength /\%81v.\+/
" Trailing space
autocmd BufWritePre * :%s/\s\+$//e
" Session
nmap SQ <ESC>:mksession! ~/.vim/Session.vim<CR>:wqa<CR>
function! RestoreSession()
if argc() == 0 "vim called without arguments
execute 'source ~/.vim/Session.vim'
end
endfunction
" autocmd VimEnter * call RestoreSession()"
" Nerd tree
autocmd StdinReadPre * let s:std_in=1
"autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif
nmap ,n :NERDTreeFind<CR>
nmap ,m :NERDTreeToggle<CR>
"resize map and move
set splitbelow
set splitright
nnoremap <silent> + :exe "vertical resize +20"<CR>
nnoremap <silent> - :exe "vertical resize -20"<CR>
nnoremap <silent> <Leader>+ :exe "resize +20"<CR>
nnoremap <silent> <Leader>- :exe "resize -20"<CR>
nnoremap <C-h> <C-w>h
nnoremap <C-l> <C-w>l
:map <C-U> <C-Y><C-Y><C-Y><C-Y><C-Y><C-Y><C-Y><C-Y><C-Y><C-Y><C-Y><C-Y><C-Y><C-Y><C-Y><C-Y>
:map <C-D> <C-E><C-E><C-E><C-E><C-E><C-E><C-E><C-E><C-E><C-E><C-E><C-E><C-E><C-E><C-E><C-E>
"CtrlP
let g:ctrlp_map = '<C-P>'
let g:ctrlp_cmd = 'CtrlP'
let g:ctrlp_working_path_mode = 'ra'
set wildignore+=*/tmp/*,*/node_modules/*,*.so,*.swp,*.zip
"Explore mode
let g:netrw_liststyle=3
map <leader>k :Explore<CR>
"Syntastic
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*
let g:syntastic_always_populate_loc_list = 1
let g:syntastic_auto_loc_list = 1
let g:syntastic_check_on_open = 1
let g:syntastic_check_on_wq = 0
let g:syntastic_aggregate_errors = 0
autocmd FileType javascript let b:syntastic_checkers = findfile('.eslintrc', '.;') != '' ? ['eslint'] : ['standard']
" Map Vim Go
au FileType go map <leader>r :!go run %<CR>
" The Silver Searcher
if executable('ag')
" 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
" Vim snippet
:imap <C-J> <Plug>snipMateNextOrTrigger
:smap <C-J> <Plug>snipMateNextOrTrigger
" Map Esc
:imap jk <Esc>
"Python3
let g:ycm_python_binary_path = '/usr/bin/python3'
let g:pymode_python = 'python3'
let g:ycm_server_python_interpreter = '/Users/cuongcua/anaconda/bin/python'
"let g:ycm_server_python_interpreter = '/Users/cuongcua/anaconda/envs/snakes/bin/python'
" Fun
map <F2> :echo 'Current time is ' .strftime('%c')<CR>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment