Skip to content

Instantly share code, notes, and snippets.

@chjj chjj/.vimrc
Created Feb 12, 2019

What would you like to do?
mini vimrc
" ~/.vimrc
set nocompatible
set hidden
set ruler
set visualbell
set noerrorbells
set nostartofline
set t_vb=
set autoindent
set backspace=2
set ttimeoutlen=100
set shiftwidth=2
set tabstop=2
set expandtab
set hlsearch
set laststatus=2
set undolevels=1000
set nobackup
if exists('&undodir') | set undodir= | end
set noswapfile
set noundofile
set nowritebackup
set viminfo=
syntax on
nnoremap Y y$
if exists("&cryptmethod")
set cm=blowfish2
if exists("&autochdir")
set autochdir
nnoremap gb :bnext<cr>
nnoremap gB :bprev<cr>
nnoremap <leader>a :ls<cr>:b<space>
nnoremap <leader>/ :noh<cr>
set clipboard=unnamed,exclude:linux\|cons
nnoremap <silent> <leader>c
\ :if stridx(&clipboard, 'unnamedplus', 0) == 0
\ \| let &clipboard = substitute(&clipboard, 'unnamedplus', 'unnamed', '')
\ \| echo 'Selection: primary'
\ \| else
\ \| let &clipboard = substitute(&clipboard, 'unnamed', 'unnamedplus', '')
\ \| echo 'Selection: clipboard'
\ \| end
\ <cr>
set pastetoggle=<leader>q
hi StatusLine term=reverse,bold cterm=none ctermbg=none ctermfg=lightgrey
hi StatusLineNC term=reverse cterm=none ctermbg=none
autocmd BufWinEnter * match ErrorMsg /\%>80v.\%<83v/
autocmd BufWritePre * if !&bin | %s/\s\+$//ge | end
autocmd BufEnter * if &ft == 'help' | wincmd o | end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.