syselement's Blog
search
⌘Ctrlk
🏠 Home BlogXGitHubπŸ“š Buy Me a BookπŸ“§ Contact
syselement's Blog
  • 🏠Home
  • πŸ”³Operating Systems
    • 🐧Linux
    • πŸͺŸWindows
  • πŸ“Courses Notes
    • eLearnSecurity / INE
    • Practical Networking
    • TCM Security
  • πŸ–₯️Cyber Everything
    • πŸ“ŒGeneric Resources
    • πŸ“±Mobile
    • 🧬Network
    • 🌐Web
    • ✍️Writeups & Walkthroughs
  • ♾️DevOps Everything
    • πŸ”—DevOps Resources
      • Introduction to DevOps
      • Ansible
      • Docker
      • Git
      • Kubernetes
      • Terraform
      • Vim
  • πŸ”¬Home Lab
    • πŸ–₯️Hypervisors
    • πŸ”΄Offensive Labs
    • πŸ”΅Defensive Labs
    • βšͺMisc Labs
gitbookPowered by GitBook
block-quoteOn this pagechevron-down
githubEdit
  1. ♾️DevOps Everythingchevron-right
  2. πŸ”—DevOps Resources

Vim

vim.org

hashtag
🌐 Resources πŸ”—

  • VIM Docsarrow-up-right

  • Vim Cheat Sheetarrow-up-right


hashtag
Commands


PreviousTerraformchevron-leftNextHypervisorschevron-right

Last updated 2 months ago

  • 🌐 Resources πŸ”—
  • Commands
sudo apt install vim
vim <filename>
# "i" key - enters insert mode
# "ESC" key - switch to command mode

# In command mode
:wq # save and quit
:q!	# force quit without save
dd	# delete entire line
d5	# delete next 5 lines
u 	# undo

A	# jump to end of line and switch to insert mode
0	# jump to start of the line
$	# jump to end of the line
10G # jump to line 10

/<string> # search for string
	n # jump to next match
	N # search in opposite direction

:%s/old/new # replace 'old' with 'new' throughout the file