• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
Gokul Deepak

Gokul Deepak

GoCool and Debug

  • Home
  • Terraform
  • Tools
  • WordPress
  • Android
  • How to
  • About Me

Vi and Vim Editor commands

August 23, 2020 by Gokul Deepak S Leave a Comment

Vi and Vim Editor commands

Here I’m mentioning all the commands related to Vi and Vim editor that I learn

Command to delete all lines in Vi Editor:

:1,$d 

Delete a single line where the cursor is

dd

Find and /replace

:%s/find_word/replace_word/g

To search a word that has the character forward slash / or any special characters then simply include backward slash \ before that \/

:%s/find\/words\~/replacewords/g

Add Text to beginning of every line – use ˆ
Add Text to end of every line- use $

:%s/ˆ/text/
:%s/$/text/

Remove Blank Lines

:g/^$/d

Remove Blank Lines that contains space

:g/^ *$/d

Filed Under: Linux

About Gokul Deepak S

Leave a ReplyCancel reply

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments

Primary Sidebar

Popular Pages

  • Home
  • WordPress - Display Ads only on posts not on pages
  • How to Install Windows without GRUB rescue
  • Vi and Vim Editor commands
  • Tools
  • PM2 Cheatsheet - Important Commands
  • Learn with Gokul
  • How to find the date of the Facebook group it was created
  • How to Remove Powered By Blogger Attribution in Blogger
  • Git Command Cheat Sheet from basic to advance

Archives

Categories

  • Android
  • Apache
  • AWS
  • Blogger
  • Computer Tips
  • DevOps
  • Docker
  • Earn
  • Facebook Tips
  • Git
  • Google Tips
  • Hosting
  • How to
  • Laptop Tips
  • Laptops
  • Linux
  • Mobile
  • MongoDB
  • Nginx
  • Node JS
  • Notepad++
  • PostgresQL
  • Terraform
  • Ubuntu
  • Wordpress
  • Xenforo

Tags

Android Android One AWS Bluehost Comparisions Custom ROM Elementor Facebook Genesis Genesis Sample Theme Google Drive How to Lineage OS Notes OnePlus One OwnCloud Rooting Smartphones Stock ROM Studiopress Tomcat Wordpress plugin

Copyright © 2025 · Maintained by GokulDeepak

wpDiscuz