TryHackMe- Toolbox: Vim

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. You can access the room through this link: https://tryhackme.com/room/toolboxvim

Hi everyone, this is Mrinal Prakash aka EMPHAY on TryHackMe and today I am going to take you all to the walkthrough of the room on TryHackMe called “Toolbox: Vim” which is a pretty basic beginner friendly room and it falls into the category of easy rooms. So lets go ahead and dive in.

TASK 1

  1. Install Vim
    No Answers needed
  2. Launch Vim
    No Answers needed

TASK 2

  1. How do we enter “INSERT” mode?
    i
  2. How do we start entering text into our new Vim document?
    typing
  3. How do we return to command mode?
    esc
  4. How do we move the cursor left?
    h
  5. How do we move the cursor right?
    l
  6. How do we move the cursor up?
    k
  7. How do we move the cursor down?
    j
  8. How do we jump to the start of a word?
    w
  9. How do we jump to the end of a word?
    e
  10. How do we insert (before the cursor)
    i
  11. How do we insert (at the beginning of the line?)
    I
  12. How do we append (after the cursor)
    a
  13. How do we append (at the end of the line)
    A
  14. How do we make a new line under the current line?
    o

TASK 3

  1. How do we write the file, but don’t exit?
    :w
  2. How do we write the file, but don’t exit- as root?
    :w !sudo tee %
  3. How do we write and quit?
    :wq
  4. How do we quit?
    :q
  5. How do we force quit?
    :q!
  6. How do we save and quit, for all active tabs?
    :wqa

TASK 4

  1. How do we copy a line?
    yy
  2. how do we copy 2 lines?
    2yy
  3. How do we copy to the end of the line?
    y$
  4. How do we paste the clipboard contents after the cursor?
    p
  5. How do we paste the clipboard contents before the cursor?
    p
  6. How do we cut a line?
    d
  7. How do we cut two lines?
    2dd
  8. How do we cut to the end of the line?
    d
  9. How do we cut a character?
    x

TASK 5

  1. How do we search forwards for a pattern (use “pattern” for your answer)
    /pattern
  2. How do we search backwards for a pattern (use “pattern” for your answer)
    ?pattern
  3. How do we repeat this search in the same direction?
    n
  4. How do we repeat this search in the opposite direction?
    N
  5. How do we search for “old” and replace it with “new”
    :%s/old/new/g
  6. How do we use “grep” to search for a pattern in multiple files?
    :vimgrep

This completes our room and that was it from me. If you enjoyed reading this, do give it a clap and follow me on medium. If you face any problem regarding any solution, feel free to reach me out. Hope you enjoyed reading my work. If you really liked this article, then follow me on medium and follow me up on Twitter and connect with me on LinkedIn. Till then goodbye from my side and Happy Hacking.

Hacker || Student || CTF Player || Coder || Editor at A&M Publications

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store