Vi editor basic commands


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Vi editor basic commands
# 1  
Old 10-19-2006
Vi editor basic commands

I would be thankful if anyone could show me commands to do the following tasks in vi:
Code:
1) How can I undo or redo my last action in vi editor.
2) How can I copy only a word or a portion of line (not the whole line) in vi, like
   we can select text and press ctrl+c in notepad to copy any text.
3) Suppose, I have 10 lines in a shell script, I want to comment out those lines
   i.e. I want to insert a "#" at the begining of more than one lines, how can I do that?
4) How can I join two lines to make them one, like we can press DELETE key at the
   end of first line to bring 2nd line up and make both lines a single line.

Thanks in advance for any replies.
# 2  
Old 10-19-2006
Perhaps this will help: http://www.eng.hawaii.edu/Tutor/vi.html
# 3  
Old 10-19-2006
Or see this Cheat Sheet on vi.
# 4  
Old 10-19-2006
This is one of the good site where you can all the commands in vi.
I recommend you to go through once with all the commands. Later on
when you are working, you will realize the importance of each.

http://www.lagmonster.org/docs/vi2.html
# 5  
Old 10-19-2006
I have a vi reference coffee mug I picked up several years ago when I need to look at crib notes in class Smilie

http://www.cafepress.com/geekcheat.11507711

Carl
 
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Android

Basic commands for android!!

Hi, I have a n android phone and just rooted it. I access it using 'terminal Emulator'. I performed many basic linux-like commands in the terminal like rm,ls,df,reboot etc and they are working fine. But many of them are not like man <something>, clear,du etc. Can any of you please help to... (20 Replies)
Discussion started by: shekhar_4_u
20 Replies

2. Shell Programming and Scripting

Using Ex editor commands in a shell script - Help!

Hi all, I am trying to use the Ex editor and its commands in a script - more specifically within an if statement within a while loop. Here are the basics of the loop: cat $file1 | while read line do grep $line $file2 if ] then echo $line > $file2 elseex $file2 /ESI185... (4 Replies)
Discussion started by: luke222010
4 Replies

3. Solaris

Required list of all basic commands for a beginners

I want the commands list to view only files, and only directories and all the basic commands for a beginner of solaris (1 Reply)
Discussion started by: omsingh2k5
1 Replies

4. Red Hat

Segmentation fault on basic linux commands

Hello out there!!! I have a Red Hat Entreprise Linux 4 server and I am encountering this error # grep Segmentation Fault I know it is not the right use of grep command, but I did that just for testing purpose,then I did # which grep /bin/grep # ls -l /bin/grep -rwxr-xr-x 1 root... (4 Replies)
Discussion started by: inhaki
4 Replies

5. UNIX for Dummies Questions & Answers

Why do basic unix commands not work in BASH

Why do basic unix commands such as "ls" not work in "BASH" mode?? I am frustrated!! (10 Replies)
Discussion started by: PixelLover
10 Replies

6. Windows & DOS: Issues & Discussions

Basic Unix Commands for cygwin

Hi. I'm New user for this Forum.Presently i'm working with Cygwin I want to know the basic commands that will be used for Cygwin. Can anyone guide me on this regards Thanks & Regards Sanjay (0 Replies)
Discussion started by: sanjay.karthik
0 Replies

7. Shell Programming and Scripting

Need help in sftp basic commands

I'm trying to make use of some common generic functions already present in the scripts loaded in the environment. A variable VAR1 is declared and used in the generic functions. Its value is also set in the generic function. Now I need to use that generic function for PURGING of some old files... (2 Replies)
Discussion started by: livetaurean19
2 Replies

8. UNIX for Dummies Questions & Answers

basic commands documentation

I'm training a newbie on unix. He's in another site and I can't share my unix books with him - is there any documentation on basic unix commands he can download? (1 Reply)
Discussion started by: kdgorton
1 Replies

9. UNIX for Dummies Questions & Answers

Unix basic commands

I need a sheet with the basic unix commands , and commands for VI editor. Does anyone know where i can get them. (3 Replies)
Discussion started by: Peter Spellman
3 Replies
Login or Register to Ask a Question