type
Post
status
Published
date
Aug 3, 2025
slug
summary
I want to make it short, but Vim is too powerful
tags
Tool
Vim
category
Tech notes
icon
password
Prelude:
Yes, You can always type :h to see help, for example, :h windows
Vim in not so short
Preliminaries
- When vim is not available, you can temporarily use
catornanoas alternatives
- When using a new IDE, you should first learn or configure:
- save
- copy / paste
- duplicate line
- delete word / delete line
- line movement
- navigate forward / back
- undo / redo
- page navigation (page down, page up, center to middle, etc.)
- indent / unindent
- multi-cursor
- search / content search
- input commands (
Ctrl + Pin VSCode, doubleShiftin IntelliJ,:in vim…) - completion, suggestion, parameter hint, hover hint
- go to / peek definition, type, declaration, reference, implementation
- rename symbol / refactor (if available)
- AI controlling: toggle chat box, trigger inline chat…
- tabs / windows management
- Use the
:helpcommand to query anything you don’t understand
:set option?can view current settings
Windows and Tabs
Buffer: Can be understood as a temporary file. Even if this file is edited, it doesn’t mean it’s written to the actual file. We can observe buffers through windows and manage them through tabs.
- Use commands starting with
bin Ex (command line) mode for buffer operations: bdbuffer delete;bwipeoutclears more thoroughlybnorbnextswitch to next bufferbporbpreviousswitch to previous bufferctrl + ^switch to the last buffer
Ctrl + W window shortcuts and :sp split commands are the basics of window management. :sp can use parameters to specify files to split (open a new window for this file)Ctrl + W+wcycle windows,Ctrl + W+hjklswitch focus left/down/up/right (move cursor)
Ctrl + W+=(make window panes equal size)
Ctrl + W++Ctrl + W+Ctrl + W+<Ctrl + W+>(fine-tune window size)
:vspperforms vertical split, dividing into two sides
:resize 20sets height to 20 lines;:vertical resize 80sets width to 80 columns
:tabs is the basic tab management command.:tabnewopens a new tab,:tabe(edit) opens a tab for editing. Can be followed by filename.
:tabn:tabpswitch tabs, or usegtgTto switch
- Display current buffer in new tab:
:tab split
:tabmovemove tab, for example:tabmove 2
- Batch execution:
:tabdo {cmd}execute on all tabs, e.g.,:tabdo set nocursorline:windo {cmd}execute on each window in current tab, e.g.,:windo diffthis
:only and :close are universal management methods- Type
:close:onlydirectly to manage windows
- Type
:tabclose:tabonlyto manage tabs
Key Remapping
Here’s the key remapping configuration in VSCode vim extension:
Common key aliases:
<Backspace>
<C-c>-> Ctrl + C
<A-c>-> Alt + C
<Shift>
<CapsLock>
<Tab>
<Enter>
<Esc>
<Cmd->Mac specific
<Up>
<Down>
<Left>
<Right>
vim Configuration File
Use the
.vimrc file in the home directory:Unbound Keys
In VSCode and other IDEs, you can return Vim-controlled keys to the IDE, since they have no use in GUI interfaces.
Ctrl + Dscroll down
Ctrl + Zsuspend Vim
Ctrl + Xdecrease number at cursor by 1, in insert mode it’s completion, decrease by 1 is quite useful
Ctrl + Ccan be considered
Ctrl + Fscroll forward, in insert mode used to view command history
Ctrl + Wwindow command, delete one word before cursor
Ctrl + Pcompletion
Ctrl + Spause output
Ctrl + Qsame asCtrl + V, onlyqalone is for recording macros, VSCode defaults to Add cursor below, multi-cursor editing tool
Ctrl + Y / Escroll window up/down by 1 line
Ctrl + Tdepends on situation
Quick Reference
(jut for memory, may not be accurate)
w-> word
b-> back
e-> end
H-> page head;L-> low;M-> middle
zzmove current line to the middle position
Ctrl + U&Ctrl + Dhalf screen move up & down
- Author:Parker Chen
- URL:www.parkerchenca.com/article/244f0ccf-d7f8-8047-bbe6-e4a2c0088d27
- Copyright:All articles in this blog, except for special statements, adopt BY-NC-SA agreement. Please indicate the source!
Relate Posts

