SMK Muhammadiyah 2 Palembang
  • Introducation
  • The Basics
    • Basics of linux
    • Bash-scripting
    • Vim - Text Editor
    • Nano - Text Editor
  • Windows
    • Basics of windows
    • PowerShell
    • CMD - Windows commands
  • Scripting With Python
    • Python fundamentals
      • Useful Scripts
    • Transferring Files
      • Transferring Files on Linux
      • Transferring Files to Windows
    • Firewalls
  • Recon and Information Gathering Phase
    • Passive information gathering
    • Identify IP-addresses and Subdomains
      • Dorking Find Subdomains
      • Find Subdomains
      • DNS Basics
      • DNS Zone Transfer Attack
      • Identifying People
      • Search Engine Discovery
      • Active information gathering
      • Port Scanning
  • Vulnerability analysis
    • Server-side Vulnerabilities
      • Port knocking
    • HTTP - Web Vulnerabilities
      • Web-services
      • Common web-services
        • WAF - Web application firewall
          • WAF - Web application firewall
          • Attacking the System
          • Local File Inclusion (LFI)
          • Remote File Inclusion
          • Find hidden files and directories
          • SQL-injections
          • Nosql-injections
          • XML External Entity Attack
          • Bypass File Upload Filtering
          • Exposed Version Control
          • Failure to Restrict URL Access
    • Attacking the user
      • Clickjacking
      • Broken Authentication or Session Management
      • Text/content-injection
      • Subdomain Takeover
      • Cross Site Request Forgery
      • Cross-site-scripting
        • Examples
      • Browser vulnerabilities
      • Java applet
      • Automated Vulnerability Scanners
    • Exploiting
      • Social Engineering - Phishing
      • Default Layout of Apache on Different Versions
      • Shell
      • Webshell
      • Generate shellcode
      • Editing exploits
      • Compiling windows exploits
    • Post Exploitation
      • Spawning shells
      • Meterpreter shell for post-exploitation
      • Privilege Escalation
      • Privilege Escalation Windows
      • Escaping Restricted Shell
      • Bypassing antivirus
      • Loot and Enumerate
        • Loot Windows
        • Loot Linux
      • Persistence - Rootkit - Backdoor
      • Cover your tracks
  • Password Cracking
    • Generate custom wordlist
    • Offline password cracking
    • Online password cracking
    • Pass the hash - reusing hashes
  • Pivoting - Port forwarding - Tunneling
    • Pivoting
  • Network traffic
    • Arp-spoofing - Sniffing traffic
      • SSL-strip
    • DNS-spoofing
    • Wireshark
  • Wifi
    • WPS
    • WEP
  • Physical access to machine
  • Literature
Powered by GitBook
On this page
  • Core concepts
  • Movement - Motion commands
  • Operators
  • Combining Motions and Operators
  • Count - Numbers
  • Replace
  • Clipboard
  • Substitute - Search and replace
  • Entering insert-mode
  • .vimrc
  • Plugins
  1. The Basics

Vim - Text Editor

http://www.viemu.com/a-why-vi-vim.html And also this classic answer: https://stackoverflow.com/questions/1218390/what-is-your-most-productive-shortcut-with-vim

Core concepts

In vim you have the concept of buffers.

# List buffers
:buffers

# Switch buffer
# By number
b1
b2
# By name
b [name]


# Close/delete a buffer
:bdelete
:bd

Movement - Motion commands

Left,up,down,right

hjkl

start of line

0 (zero)

end of line

$

beginning of next word

w

beginning of next word, defined by white space

W

end of the next word

e

end of the next word, defined by white space

E

back to the beginning of previous word

b

back to the end of previous word

B

go to next character of your choice

If you want to go to the next comma

f,

start of file

gg

end of file

G

Operators

Operators are commands that do things. Like delete, change or copy.

c - change ce - change until end of the word. c$ - change until end of line.

Combining Motions and Operators

Now that you know some motion commands and operator commands. You can start combining them.

dw - delete word d$ - delete to the end of the line

Count - Numbers

You can add numbers before motion commands. To move faster.

4w - move cursor three words forward 0 - move curso to the start of the line

You can use numbers to perform operations. d3w - delete three words

3dd - delete three lines

Replace

If you need to replace a character, there is no need to enter insert-mode. You can just use replace

Go to a character and the press r followed by the character you want instead.

rp if you want to replace p.

R

Clipboard

In order to copy something FROM vim to the OS-clipboard you can do this:

The " means that we are not entering a registry. And the * means the OS-clipboard. So we are yanking something and putting it in the OS-clipboard registry.

"*y

Substitute - Search and replace

:s/thee/the/g

Entering insert-mode

i - current character o - next line O - line before a - end of word A - end of line

.vimrc

Here is all your vim-configuration.

Plugins

Install vundle here https://github.com/VundleVim/Vundle.vim

Add plugin

Add plugin to your .vimrc-file and then open vim and write

:PluginInstall

PreviousBash-scriptingNextNano - Text Editor

Last updated 2 years ago