Latest LQ Deal: Latest LQ Deals
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 04-18-2006, 06:21 AM   #1
LQ Newbie
Registered: Apr 2006
Posts: 10

Rep: Reputation: 0
commenting more than one line in VI editor

# is used to comment a line in vi editor. Can anyone help me by saying the command to comment selected number of lines in VI editor. To replace the text "hi" with "hello" in the entire file I used:

the above command. Like this i want to comment various lines in my program. How to do this??????
Old 04-18-2006, 08:09 AM   #2
Registered: Jul 2005
Location: France
Distribution: Arch Linux
Posts: 540

Rep: Reputation: Disabled
Put the cursor to the first line of the selection you want to comment out, and mark it by typing ma,
then go to the last line of the selection and mark it by mb, then use the command:
you can also just put the cursor to the last line of the selection without marking it, and use:


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
php commenting, and api generation dakomoon Programming 2 12-12-2005 12:13 AM
proper commenting in C joesbox Programming 6 02-14-2005 12:11 AM
vi editor/command line free guide fhameed Linux - Software 3 12-12-2003 10:16 AM
VI text editor in command line InSane103 Linux - Software 4 07-09-2003 10:04 PM
vi as Command Line Editor taz75 Linux - Newbie 8 01-04-2002 02:30 PM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:40 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration