Skip to content

Instantly share code, notes, and snippets.

@z3oc
Last active February 3, 2018 19:18
Show Gist options
  • Save z3oc/b1b4594c0d75e94b85ed17c2460543e4 to your computer and use it in GitHub Desktop.
Save z3oc/b1b4594c0d75e94b85ed17c2460543e4 to your computer and use it in GitHub Desktop.
my .vimrc
"******* Chong's vimrc *******"
" true color
set termguicolors
" No Vi
set nocompatible
" auto read file changed from outside
set autoread
" Enable syntax highlighting
syntax on
" Enable filetype detection
filetype off
" Set runtime path to include Vundle & initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
" Generic
Plugin 'godlygeek/tabular'
Plugin 'tpope/vim-commentary'
Plugin 'tpope/vim-surround'
Plugin 'Valloric/YouCompleteMe'
Plugin 'SirVer/ultisnips'
Plugin 'honza/vim-snippets'
Plugin 'alvan/vim-closetag'
Plugin 'jiangmiao/auto-pairs'
" Looks
Plugin 'plasticboy/vim-markdown'
Plugin 'vim-airline/vim-airline'
Plugin 'vim-airline/vim-airline-themes'
Plugin 'kien/rainbow_parentheses.vim'
Plugin 'yuttie/comfortable-motion.vim'
" Color schemes
Plugin 'sickill/vim-monokai'
Plugin 'tomasr/molokai'
Plugin 'nanotech/jellybeans.vim'
call vundle#end()
" let g:jellybeans_overrides = {
" \ 'background': { 'guibg': '23241E' },
" \}
" youcompleteme settings
" let g:ycm_log_level='critical'
" UltiSnips settings
let g:UltiSnipsExpandTrigger="<c-CR>"
let g:UltiSnipsJumpForwardTrigger="<c-b>"
let g:UltiSnipsJumpBackwardTrigger="<c-z>"
let g:UltiSnipsEditSplit="vertical"
" auto-pairs settings
" let g:AutoPairsFlyMode=1
" let g:AutoPairsShortcutBackInsert='<M-b>'
" rainbow parentheses settings
" Always on
" autocmd VimEnter * RainbowParenthesesToggle
" autocmd Syntax * RainbowParenthesesLoadRound
" autocmd Syntax * RainbowParenthesesLoadSquare
" autocmd Syntax * RainbowParenthesesLoadBraces
" airline theme
let g:airline_theme='minimalist'
filetype indent plugin on
colo monokai
" Show line number
set nu
" Show command while typing
set showcmd
" Searching
set smartcase
set magic
set hlsearch
set incsearch
" Spaces, tabs, indenting
set autoindent
set smartindent
set tabstop=4
set shiftwidth=4
set softtabstop=4
" Show whitespace characters with :set list
set listchars=eol:¬,tab:>·,trail:~,extends:>,precedes:<,space:␣
" Use autocmd for specific filetypes
" since some settings are overridden with filetype plugin on
autocmd FileType html setlocal shiftwidth=2 tabstop=2
autocmd FileType c,cpp,java,python setlocal shiftwidth=4 tabstop=4
" Let backspace work like most other apps
set backspace=indent,eol,start
set whichwrap+=<,>,h,l
set noerrorbells
set novisualbell
set t_vb=
set tm=500
" File settings
set encoding=utf8
set ffs=unix,mac,dos
set nobackup
set nowb
set noswapfile
set laststatus=2
" :WW for sudo saving
if !exists(":WW")
command WW w !sudo tee % > /dev/null
endif
" Hide the tildes(~) that extend beyond end of buffer
" highlight EndOfBuffer ctermfg=bg guifg=bg
" Change background color
highlight Normal guibg=#191919
highlight LineNr guibg=#191919
" Disable search highlighting using space
nnoremap <space> :noh<cr><space>:<backspace>
" source vimrc when saved so that it takes effect immediately
" autocmd BufWritePost ~/.vimrc so %
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment