Beginning Your Editing Session
To edit a file vi [ filename ]
To recover an editing session vi -r [ filename ]
Notes on vi commands and modal editing
All vi commands are entered in command mode. To enter command mode, press the ESC key.
Some vi commands cause vi to enter another mode. For example, the i (insert command)
causes vi to enter insert mode after which all keystrokes are inserted as text. To return
to command mode from insert mode, press the ESC key. The :set showmode commandwill cause
vi to display the current editing mode in the lower right corner of the editing screen.
Controlling The Screen Display of Your Session
Repaint the current screen {ctrl-l}
Display line #, # of lines, etc.. {ctrl-g}
Moving the Cursor
Beginning of current line 0 or ^
Beginning of first screen line H
Beginning of last screen line L
Beginning of middle screen line M
Down one line j, {return}, +
End of current line $
Left one character h, {ctrl-h}
Left to beggining of word b, B
Right one character l, {space}
Right to end of word e, E
Right to beginning of word w, W
Up one line k, -
Beginning of next sentence )
Beginning of previous sentence (
Paging Through Text
Back one screen {ctrl-b}
Down half a screen {ctrl-d}
Down one screen {ctrl-f}
Forware to end of file G
Move cursor to specified line line no. G
Up half a screen {ctrl-j}
Special Pattern Characters
Beginning of line ^
End of line $
Any character except newline .
Any number of the preceding character *
Any set of characters (except newline) .*
Searching Through Text
Backward for pattern ?pattern
Forward for pattern /pattern
Repeat previous search n
Reverse direction of previous search N
Show *all* lines containing pattern :beg,endg/pattern/p
:1,$g/compiler/p Will print all lines with the pattern compiler.
Substitute patt2 for all patt1 found. :beg,ends/patt1/patt2/g
:%s/notfound/found/g Will change all occurences of notfound to found.
Creating Text
Append text after cursor a
Append text after end of line A
Insert text before cursor i
Insert text at beginning of line I
Open new line after current line o
Open new line before current line O
Take next character literally
(i.e. control characters...)
and display it {ctrl-v}
Modifying Text
Change current word cw, cW
Change current line (cursor to end) C
Delete character (cursor forward) x
Delete character (before cursor) X
Delete word dw, dW
Delete line dd
Delete text to end of line D
Duplicate text (use yank and put)
Join current line with next line J
Move text (use delete and put)
Put buffer text after/below cursor p
Put buffer text before/above cursor P
Repeat last modification command .
Replace current character r
Replace text to end of line R
Substitute text for character s
Undo your previous command u
Transpose characters xp
Yank (copy) word into buffer yw
Yank (copy) current line into buffer Y
Making Corrections During Text Insertions
Overwrite last character {delete}
Overwrite last word {ctrl-w}
Ending Your Editing Sessions
Quit (no changes made) :q
Quit and save changes ZZ, :wq
Quit and discard changes :q!
Using ex Commands From Within vi
Copy specified lines :co, t
Display line numbers :set nu
Disable display of line numbers :set nonu
Move lines after specified line :m
Read file in after specified line :r filename
Review current editor options :set
Review editor options :set all
Set new editor option :set option
Write changes to original file :w
Write to specified file :w filename
Force write to a file :w! filename
Some useful set options for your ~/.exrc file:
:set all Display all Set options
:set autoindent Automagically indent following lines to the indentation
of previous line.
:set ignorecase Ignore case during pattern matching.
:set list Show special characters in the file.
:set number Display line numbers.
:set shiftwidth=n Width for shifting operators <<>>
:set showmode Display mode when in Insert, Append, or Replace mode.
:set wrapmargin=n Set right margin 80-n for autowrapping lines
(inserting newlines). 0 turns it off.
How to Earn Rs.25000 every month in internet without Investment?
An Intro to vi editor
Labels:
free downloadsUnix Professional
Subscribe to:
Post Comments (Atom)
topics
-
▼
2007
(1406)
-
▼
November
(1359)
- Free Download SAP FI Certification study pdf books
- Implementing SAP R/3 on OS/400
- Update SAP Kernel in UNIX based
- Security Audit Log (BC-SEC).pdf
- Security Audit Log.pdf
- Securities,pdf
- Secure Store & Forward / Digital Signatures (BC-SE...
- Secure Network Communications (BC-SEC-SNC)
- Free download use ful T-codes
- I did not find any OSS notes appropriate for my pr...
- How to apply OSS notes number?
- What is OSS Notes number?
- Where can i access SAP OSS?
- WHAT IS OSS
- Disaster Recovery Plan to Restore Production System
- Steps to Install SAP Note in sap
- Difference Between SAP Notes and Support Package
- Question : Subject : Support packages testing
- Five Different "User Type"
- How to solve the Time Zone Definition Problems?
- Setting the User Decimals Format
- Schedule Manager
- Various Important SAP Basis T-Code
- Trace Functions in sap
- System Trace: Error Analysis in sap
- System Trace(ST01) in sap
- Roles and Authorizations Used in Background Proces...
- Deleting Multiple Spool Requests Simultaneously in...
- Logging and Tracing in spool
- Print and Output Management in spool
- Background Job Monitoring Monitor in CCMS
- Monitoring the Database Using the Alert Monitor
- Monitoring the Operating System Using the Alert Mo...
- Monitoring Memory Management Using the Alert Monitor
- Method Dispatching Monitor in CCMS
- Remote Application Server Status Monitor in CCMS
- GRMG Self-Monitoring Monitor in CCMS
- CCMS Selfmonitoring Monitor for System-Wide Data i...
- Logfile Monitoring Monitor in CCMS
- Logon Load Balancing Monitor in CCMS
- Transaction-Specific Dialog Monitor in CCMS
- Workload Collector Monitor in CCMS
- System Errors Monitor in CCMS
- System Configuration Monitor in CCMS
- Syslog Monitor in CCMS
- Spool System Monitor in CCMS
- Security Monitor in CCMS
- Performance Overview Monitor in CCMS
- Operating System Monitor in CCMS
- Filesystems Monitor in CCMS
- Entire System Monitor in CCMS
- Monitoring the Enqueue Service in CCMS
- Dialog per Application Server Monitor in CCMS
- Dialog Overview Monitor in CCMS
- Database Monitor in CCMS
- Transactional RFC and Queued RFC Monitor in CCMS
- Communications Monitor in CCMS
- Buffers Monitor in CCMS
- Background Job Monitoring Monitor(CCMS)
- Background Processing Monitor(CCMS)
- Availability and Performance Overview Monitor (CCMS)
- SAP CCMS Monitor Templates Monitor Set
- Creating and Changing a Monitoring Pause(CCMS)
- Creating and Changing Monitoring Rules(CCMS)
- Configuring Availability Monitoring(CCMS)
- Update Repositories(CCMS)
- Displaying Central Performance History Reports(CCMS)
- Displaying Report Properties
- Scheduling and Executing a Report
- Variables in Group Names
- Creating a Report Definition(CCMS)
- Maintaining Collection and Reorganization Schemata...
- Maintaining Collection and Reorganization Schemata...
- Creating and Editing a Calendar Schema(CCMS)
- Creating and Editing a Day Schema
- Customizing the Alert Monitor(CCMS)
- Resetting MTEs and Alerts(CCMS)
- Reorganizing Completed Alerts(CCMS)
- Display Completed Alerts(CCMS)
- Automatically Complete Alerts(CCMS)
- Completing Alerts(CCMS)
- Starting Methods (CCMS)
- Processing Alerts(CCMS_
- Displaying the Technical View: Central Performance...
- Displaying the Technical View: Threshold Values(CCMS)
- Displaying the Technical View: Status Autoreaction...
- Displaying the Technical View: Status Data Collector
- Displaying the Technical View: Method Allocation
- Displaying the Technical View: Info on MTE
- Display Types and Views of the Alert Monitor(CCMS)
- Properties of Status Attributes (CCMS)
- Properties of Performance Attributes(CCMS)
- Properties of Log Attributes (CCMS)
- General Properties of Monitoring Tree Elements(CCMS)
- Properties of Monitoring Objects and Attributes
- Elements of the Alert Monitoring Tree
- Alert Monitoring Tree(CCMS)
- Monitors(CCMS)
- Monitor Sets (CCMS)
- Elements of the Alert Monitor (CCMS)
-
▼
November
(1359)
No comments:
Post a Comment