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

Gokul Deepak

GoCool and Debug

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

Vi and Vim Editor commands

August 23, 2020 by Gokul Deepak S Leave a Comment

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

Authored by Gokul Deepak S

Leave a Reply Cancel reply

0 Comments
Inline Feedbacks
View all comments

Primary Sidebar

Popular Pages

  • How to find the date of the Facebook group it was created
  • How to add ads.txt on Bluehost
  • Elementor Plugin and Nginx Configuration
  • Home
  • CORS error in Apache Tomcat - Solved
  • Combine two separate files line by line in Notepad++

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
  • 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 © 2023 · Maintained by GokulDeepak

wpDiscuz