Skip to content

Instantly share code, notes, and snippets.

@463f
Created April 17, 2024 11:54
Show Gist options
  • Save 463f/cd63c9927ffe5459b84c8dc380f17054 to your computer and use it in GitHub Desktop.
Save 463f/cd63c9927ffe5459b84c8dc380f17054 to your computer and use it in GitHub Desktop.
vimrc conf
" 1. Keyboard Shortcut
inoremap jk <ESC>
let mapleader=" "
noremap <Leader>ww <C-w>w
noremap <Leader>wh <C-w><left>
noremap <Leader>wl <C-w><right>
noremap <Leader>wk <C-w><up>
noremap <Leader>wj <C-w><down>
noremap <Leader>wv :vs<CR>
noremap <Leader>ws :sp<CR>
noremap <Leader>wd <C-w>q
noremap <Leader>w= <C-w>=
noremap <Leader>w+ <C-w>5>
noremap <Leader>w- <C-w>5<
noremap <Leader>bp :bp<CR>
noremap <Leader>bn :bn<CR>
noremap <Leader>tt :tabnew<CR>
noremap <Leader>tn :tabnext<CR>
noremap <Leader>tp :tabprevious<CR>
noremap <Leader>tc :tabclose<CR>
noremap <Leader>fs :w<CR>
noremap <Leader>fq :wq<CR>
nnoremap <leader>fe :Lexplore<CR>
" 2. Search
set ignorecase
set incsearch
set hlsearch " :nohl to cancel highlight
" 3. Indent
set cindent
set backspace=2
set tabstop=4
set softtabstop=4
set shiftwidth=4
set expandtab " tab to space
" 4. Edit
set mps+=<:> " add new matchpairs
au FileType c,cpp,java set mps+==:; " switch between = and ; in cpp and jave
set showmatch " jump to left bracket
" 5. Display
syntax on
set number
set ruler
set showmode
set scrolloff=10
set laststatus=2 " always show bottom status bar
" 6. Netrw
let g:netrw_banner=0 " no banner
let g:netrw_liststyle=3 " Tree Style
let g:netrw_browse_split=4 " editing in previous file
let g:netrw_altv=1 " stay left
let g:netrw_winsize=25 " set width 25%
let g:netrw_list_hide='^\..*' " no hidden file(use a to switch)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment