- Create or open file:
vi <filename>
- Normal mode:
ESC
| Insert mode:i
| Command mode::
In normal mode, we can execute Vim commands to search, and transform text. In Insert mode, we can edit the file content. - Write and quit:
:wq
- Select lines: Press
v
to startvisual selection
. Select lines with arrow keys. - Copy with
y
| Paste withp
- Delete or cut line:
d
- Repeat last action:
.
Press dot as many times as you want to repeat the command (e.g. indent) - Search:
/<term>
E.g./nodePort
- Case insensitive search:
/<term>\c
E.g./nodeport\c
- Navigate search results:
*
for next and#
for the previous occurrence - Indent: Select lines with
v
,shift + <
to indent left. Press dot.
multiple times to indent further.shift + >
to indent right.
Created
March 11, 2024 11:02
-
-
Save nirdosh17/a0b42399b15c6ea6ed00b3988a5db105 to your computer and use it in GitHub Desktop.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
good content bruh