Skip to content

Instantly share code, notes, and snippets.

@zorchp
Last active May 18, 2024 09:49
Show Gist options
  • Save zorchp/186b194be595a12b23e15c98008ee9d3 to your computer and use it in GitHub Desktop.
Save zorchp/186b194be595a12b23e15c98008ee9d3 to your computer and use it in GitHub Desktop.
My tiny vimrc config for base usage.
" syntax highlight
syntax on
" show line number and relative number
set number
set relativenumber
" indent when newline
set smartindent
" close mouse mode
set mouse=
" use plugin
" filetype plugin on
" cancel backup and no generate swp file
set nobackup
set nowb
set noswapfile
" tab width =4
set tabstop=4
" indent = 4
set softtabstop=4
set shiftwidth=4
set expandtab
" jk -> <ESC>
inoremap jk <ESC>
" v as visual and select mode
vnoremap jk <ESC>
" use emacs keymap in insert mode
inoremap <C-B> <LEFT>
inoremap <C-F> <RIGHT>
inoremap <C-A> <HOME>
inoremap <C-E> <END>
inoremap <C-D> <DEL>
inoremap <C-H> <BACKSPACE>
" cn to change multi place
nnoremap cn *``cgn
nnoremap cN *``cgN
" for multi line micro
imap <C-E> <ESC>A
xnoremap @ :<C-u>call ExecuteMacroOverVisualRange()<CR>
function! ExecuteMacroOverVisualRange()
echo "@".getcmdline()
execute ":'<,'>normal @".nr2char(getchar())
endfunction
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment