Repeating "vi" ex-editor 'command mode' commands


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Repeating "vi" ex-editor 'command mode' commands
Prev   Next
# 1  
Old 09-25-2007
Repeating "vi" ex-editor 'command mode' commands

Hi,

How to repeat the command which we typed and executed inside the "vi" editor 'command mode' (will be get by pressing "ESC" and ":" keys), since it cannot be repeated using the "." key?

Because I'm typing the lengthy command at the command mode and do not know the way to repeat it often. Your help is appreciated.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Extract delta records using with "comm" and "sort" commands combination

Hi All, I have 2 pipe delimited files viz., file_old and file_new. I'm trying to compare these 2 files, and extract all the different rows between them into a new_file. comm -3 < sort file_old < sort file_new > new_file I am getting the below error: -ksh: sort: cannot open But if I do... (7 Replies)
Discussion started by: njny
7 Replies

2. Red Hat

"rhgb quiet" controlling the display of commands in single user mode ?"rhgb quiet" controlling the d

Why does removing "rhgb quiet" from the kernel boot parameters control whether or not the commands I enter are displayed in single user mode ? For instance, if I do not remove "rhgb quiet", when I am in single user mode, whatever command I type will not be displayed on the screen. The... (0 Replies)
Discussion started by: Hijanoqu
0 Replies

3. UNIX for Dummies Questions & Answers

Using "mailx" command to read "to" and "cc" email addreses from input file

How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address and column 3 contains “cc” e-mail address to include with same email. Sample input file, email.txt Below is an sample code where... (2 Replies)
Discussion started by: asjaiswal
2 Replies

4. Red Hat

files having Script which works behind "who" & "w" commands

Dear All, plz print the path of files which have the script of "who" & "w" commands. thnx in advance. (6 Replies)
Discussion started by: saqlain.bashir
6 Replies

5. Solaris

Relation btw commands, "man" and "more" ???

Hi guys, Hope u r doing find. I have this query. When we check the manual pages for a certain command, say man cat we see the manual page with more What is UNIX really doing here, I mean why not less command instead of more command. And can we have UNIX display the manual pages with less command... (2 Replies)
Discussion started by: gabam
2 Replies

6. Shell Programming and Scripting

awk command to replace ";" with "|" and ""|" at diferent places in line of file

Hi, I have line in input file as below: 3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL My expected output for line in the file must be : "1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL" Can someone... (7 Replies)
Discussion started by: shis100
7 Replies

7. AIX

"/" doesn't work on command prompt for searching commands last typed

When I use "/" to look for a particular command that I typed in the current session it says D02:-/home/user1/temp> /job ksh: /job: not found. D02:-/home/user1/temp> previously it used to fetch all the commands which had job in it.. for example subjob, endjob, joblist etc... may I... (7 Replies)
Discussion started by: meetzap
7 Replies

8. Shell Programming and Scripting

Unix commands delete all files starting with "X" except "X" itself. HELP!!!!?

im a new student in programming and im stuck on this question so please please HELP ME. thanks. the question is this: enter a command to delete all files that have filenames starting with labtest, except labtest itself (delete all files startign with 'labtest' followed by one or more... (2 Replies)
Discussion started by: soccerball
2 Replies

9. UNIX for Dummies Questions & Answers

start top command in "solaris mode"

Ever noticed that using the top command on a multiple cpu box can often give totally misleading answers, like 230%, when you think that 100% should be the max? Well, that's because top has a bizarre mode called "Irix mode" wherein if you have 4 cpus, the %CPU column of top can go up to 400%. I... (1 Reply)
Discussion started by: fabulous2
1 Replies

10. UNIX for Advanced & Expert Users

Commands on Digital Unix equivalent to for "top" and "sar" on other Unix flavour

Hi, We have a DEC Alpha 4100 Server with OSF1 Digital Unix 4.0. Can any one tell me, if there are any commands on this Unix which are equivalent to "top" and "sar" on HP-UX or Sun Solaris ? I am particularly interested in knowing the CPU Load, what process is running on which CPU, etc. ... (1 Reply)
Discussion started by: sameerdes
1 Replies
Login or Register to Ask a Question
vi(1)							      General Commands Manual							     vi(1)

Name
       vi - screen editor

Syntax
       vi [ -t tag ] [ +command ] [ -l ] [ -r ] [ -wn ] [ -x ] name...

Description
       The  (visual)  editor is a display-oriented text editor based on The command and the command run the same code.	You can access the command
       mode of from within

       The following is a list of some of the commands.  See the vi Beginner's Reference Card and "An Introduction to Display Editing with vi"	in
       the Supplementary Documents, Volume 1: General User for more details on using

       Screen Control Commands

	    <CTRL/L>	 Reprints current screen.

	    <CTRL/Y>	 Exposes one more line at top of screen.

	    <CTRL/E>	 Exposes one more line at bottom of screen.

       Paging Commands

	    <CTRL/F>	 Pages forward one screen.

	    <CTRL/B>	 Pages back one screen.

	    <CTRL/D>	 Pages down half screen.

	    <CTRL/U>	 Pages up half screen.

       Cursor Positioning Commands

	    j		 Moves cursor down one line, same column.

	    k		 Moves cursor up one line, same column.

	    h		 Moves cursor back one character.

	    l		 Moves cursor forward one character.

	    <RETURN>	 Moves cursor to beginning of next line.

	    0		 Moves cursor to beginning of current line.

	    $		 Moves cursor to end of current line.

	    <SPACE>	 Moves cursor forward one character.

	    nG		 Moves cursor to beginning of line n.  Default is last line  of file.

	    /pattern	 Moves cursor forward to next occurrence of pattern.

	    ?pattern	 Moves cursor backward to next occurrence of pattern.

	    n		 Repeats last / or ? pattern search.

       Text Insertion Commands

	    a		 Appends text after cursor. Terminated by <ESC>.

	    A		 Appends text at the end of the line. Terminated by <ESC>.

	    i		 Inserts text before cursor. Terminated by <ESC>.

	    I		 Inserts text at the beginning of the line. Terminated by <ESC>.

	    o		 Opens new line below the current line for text insertion.  Terminated by <ESC>.

	    O		 Opens new line above the current line for text insertion.  Terminated by <ESC>.

	    <DELETE>	 Overwrites last character during text insertion.

	    <ESC>	 Stops text insertion.

       Text Deletion Commands

	    dw		 Deletes current word.

	    x		 Deletes current character.

	    dd		 Deletes current line.

	    D, d$	 Deletes from cursor to end of line.

	    P		 Puts back text from the previous delete.

       Text Change Commands

	    cw		 Changes characters of current word until stopped with escape key.

	    c$		 Changes text up to the end of the line.

	    C, c$	 Changes remaining text on current line until stopped by pressing the escape key.

	    ~		 Changes case of current character.

	    xp		 Transposes current and following characters.

	    J		 Joins current line with next line.

	    rx		 Replaces current character with x.

       Buffer Usage Commands

	    [a-z]n yy	 Yanks n lines to the [a-z] buffer.  Default is current line.

	    [a-z]n p	 Puts n yanked text lines from the a-z buffer, after the cursor.

       Exiting vi

	    ZZ		 Exits and saves changes

	    :wq 	 Writes changes to current file and quits edit session.

	    :q		 Quits edit session (no changes made).

       The command uses all of the same edit or commands as However, does not allow you to write the file. See

Options
       -t tag	 Specifies a list of tag files.  The tag files are preceded by a backslash () and are separated by spaces.  The tag option should
		 always be the first entry.

       +command  Tells the editor to begin by executing the specified command.	A useful example would be +/pattern to search for a pattern.

       -l	 Sets the showmatch and lisp options for editing LISP code.

       -r name	 Retrieves the last saved version of the name'd file in the event of an editor or system crash.  If no file is specified,  a  list
		 of saved files is produced.

       -wn	 Sets  the default window size to n.  This option is useful for starting in a small window on dialups.	The -x option is available
		 only if the Encryption layered product is installed.

       -x	 Causes to prompt for a key.  The key is used to encrypt and decrypt the contents of the file. If  the	file  contents	have  been
		 encrypted with one key, you must use the same key to decrypt the file.

Restrictions
       Software tabs using ^T work only immediately after the autoindent.

       Left and right shifts on intelligent terminals do not make use of insert and delete character operations in the terminal.

       The  wrapmargin option sometimes works incorrectly because it looks at output columns when blanks are typed.  If a long word passes through
       the margin and onto the next line without a break, then the line is not broken.

       Insert/delete within a line can be slow if tabs are present on intelligent terminals, since the terminals need  help  in  doing	this  cor-
       rectly.

       Saving text on deletes in the named buffers is somewhat inefficient.

       The  source  command does not work when executed as :source; there is no way to use the :append, :change, and :insert commands, since it is
       not possible to give on a :global you must Q to command mode, execute them, and then reenter the screen editor with or

See Also
       ed(1), ex(1), view(1)
       The Little Gray Book: An ULTRIX Primer
       The Big Gray Book: The Next Step with ULTRIX
       "An Introduction to Display Editing with Vi", Supplementary Documents, Volume 1: General User

																	     vi(1)