TryHackMe -Vim Toolbox-WriteUp
3 min readAug 12, 2024
Learn vim, a universal text editor that can be incredibly powerful when used properly. From basic text editing to editing of binary files, Vim can be an important arsenal in a security toolkit.
Make every campaign better than the last with GetResponse Email Marketing + Landing Pages + Marketing Automation — $49 only
Find Room : https://tryhackme.com/r/room/toolboxvim
Task 1
Lets get started!
To check whether Vim is installed:
- Launch a Terminal Window
- Type “vim”
If you’re looking at the Vim splash page
Task 2
#1 Q :How do we enter "INSERT" mode?
Ans : i
Open Your Teminal and type vim
You reach into vim but this is command mode
You can Change into Insert Mode with shortcut i
#2 Q :How do we start entering text into our new Vim document?
Ans : typing
#3 Q :How do we return to command mode?
Ans : esc
You can use Esc key to change command mode
#4 Q :How do we move the cursor left?
Ans : h
You can use h to move cursor to left
#5 Q :How do we move the cursor right?
Ans : l
You can use l to move cursor to right
#6 Q :How do we move the cursor up?
Ans : k
You can use k to move cursor to up
#7 Q :How do we move the cursor down?
Ans : j
You can use j to move cursor to down
#8 Q: How do we jump to the start of a word?
Ans : w
You can use w to jump to the start of a word
#9 Q: How do we jump to the end of a word?
Ans : e
You can use e to jump to the end of a word
#10 Q: How do we insert (before the cursor)
Ans: i
#11 Q: How do we insert (at the beginning of the line?)
Ans: I
#12 Q: How do we append (after the cursor)
Ans: a
#13 Q: How do we append (at the end of the line)
Ans : A
#14 Q: How do we make a new line under the current line?
Ans: o
#15 No Answer Need
Task 3
#1 Q : How do we write the file, but don't exit?
Ans: :w
#2 Q: How do we write the file, but don't exit- as root?
Ans: :w !sudo tee %
#3 Q: How do we write and quit?
Ans: :wq
#4 Q: How do we quit?
Ans: :q
#5 Q: How do we force quit?
Ans: :q!
#6 Q: How do we save and quit, for all active tabs?
Ans: :wqa
Task 4
#1 Q: How do we copy a line?
Ans: yy
#2 Q: How do we copy 2 lines?
Ans: 2yy
#3 Q: How do we copy to the end of the line?
Ans: y$
#4 Q: How do we paste the clipboard contents after the cursor?
Ans: p
#5 Q:How do we paste the clipboard contents before the cursor?
Ans: P
#6 Q:How do we cut a line?
Ans: dd
#7 Q:How do we cut two lines?
Ans: 2dd
#8 Q:How do we cut to the end of the line?
Ans: D
#9 Q:How do we cut a character?
Ans: x
Task 5
#1 Q: How do we copy a line?
Ans: yy
#2 Q: How do we copy 2 lines?
Ans: 2yy
#3 Q: How do we copy to the end of the line?
Ans: y$
#4 Q: How do we paste the clipboard contents after the cursor?
Ans: p
#5 Q:How do we paste the clipboard contents before the cursor?
Ans: P
#6 Q:How do we cut a line?
Ans: dd
#7 Q:How do we cut two lines?
Ans: 2dd
#8 Q:How do we cut to the end of the line?
Ans: D
#9 Q:How do we cut a character?
Ans: x
Have A Nice Day