By Manny Fernandez

November 14, 2017

VI Cheat Sheet

VI Cheat Sheet

Here is a simple VI cheat sheet. I like β€˜vi’ because it is pretty much included by default in everything. Just like in my Cisco life, I have always used the CLI and not GUIs because sometimes, those GUIs don’t work or they are not present. This way you can always be ready for anything that comes your way.


Scrolling and Searching

Command Function
<ctrl>d Scroll down (half a screen)
<ctrl>u Scroll up (half a screen)
<ctrl>f Page forward
<ctrl>b Page backward
/string Search forward
?string Search backward
<ctrl>l Redraw screen
<ctrl>g Display current line number and file information
n Repeat search
N Repeat search reverse G Go to last line
nG Go to line n
:n Go to line n
z<CR> Reposition window: cursor at top
z. Reposition window: cursor in middle
z- Reposition window: cursor at bottom

Delete Commands

Command Function
dd or ndd Delete n lines to general buffer
dw Delete word to general buffer
dnw Delete n words
d) Delete to end of sentence
db Delete previous word
D Delete to end of line
x Delete character

Undo Commands
Command Function
u Undo last change
U Undo all changes made to the line

Copy / Paste

Command Function
v Select Charecters
V Select the entire Line
d Delete (AKA Cut)
y Yank (AKA Copy)
P Paste before the cursor
p Paste afer the cursor

snmp-check: SNMP Enumeration From Kali in One Command

snmp-check: SNMP Enumeration From Kali in One Command

Use snmp-check SNMP enumeration in Kali to pull hosts, ports, processes and software from a community string, then lock down SNMP.

Read More
Clear Your Bash and Zsh History (and Keep API Keys Out of It)

Clear Your Bash and Zsh History (and Keep API Keys Out of It)

Clear Bash and Zsh history the right way, delete a single leaked line, and run sessions that keep API keys out of history, scrollback...

Read More
GitLab CVE-2026-97229: Patch, Verify and Hunt the CI Regex RCE

GitLab CVE-2026-97229: Patch, Verify and Hunt the CI Regex RCE

GitLab CVE-2026-97229 is a CVSS 10 RCE now in CISA KEV. Find the build that really fixes it, apply stopgaps, and hunt for exploitation.

Read More