Skip to content

Instantly share code, notes, and snippets.

@akaron
Created June 2, 2020 06:14
Show Gist options
  • Save akaron/9beeea852367f75a3feb2417b33f639f to your computer and use it in GitHub Desktop.
Save akaron/9beeea852367f75a3feb2417b33f639f to your computer and use it in GitHub Desktop.
vimrc light version
set nocompatible " be iMproved, required
" vim-plug, see https://github.com/junegunn/vim-plug
call plug#begin('~/.vim/plugged')
Plug 'tpope/vim-sensible'
Plug 'tpope/vim-commentary'
Plug 'tpope/vim-repeat'
Plug 'vim-airline/vim-airline'
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
Plug 'sheerun/vim-polyglot'
call plug#end()
" ==== Basic settings ====
" some settings are in vim-sensible plugin
syntax on
set number " or 'relativenumber'
set hlsearch
set wildmenu
set wildchar=<TAB> " start wild expansion in the command line using <TAB>
set wildignore=*.o,*.class,*.pyc,*.so,*.swp,*.zip
set nobackup " no *~ backup files
set copyindent " copy the previous indentation on autoindenting
set smartcase " ignore case if search pattern is all lowercase,case-sensitive otherwise
set noerrorbells
set lazyredraw
set nomodeline " in rare case it cause problem. Turn it off since and I never use it
" useful when open multiple buffers
set hidden "avoid 'No write since last change' while :bn or :bp
set confirm "avoid close un-saved (hidden) buffer
" TAB settings
set expandtab "replace <TAB> with spaces
set softtabstop=4
set shiftwidth=4
au FileType Makefile set noexpandtab
au FileType snippet set noexpandtab
" ==== key bindings ====
let mapleader = "\<Space>"
inoremap jk <Esc>
nnoremap <leader>bb :ls<CR>:b
nnoremap <leader>bn :bnext<CR>
nnoremap <leader>bp :bprev<CR>
nnoremap <leader>bd :bdelete<CR>
nnoremap <c-p> :FZF<cr>
let g:airline_extensions = ['tabline']
let g:airline_powerline_fonts = 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment