elvis

elvis is a vi clone written by Steve Kirkendall.

Important Command-Line Options

-a

Load each file named on the command line to a separate window.

-c command

Execute command at startup (POSIX version of the historical +command syntax).

-f filename

Use filename for the session file instead of the default name.

-G gui

Use the given interface. The default is the termcap interface. Other choices include x11, windows, curses, open, and quit. Not all the interfaces may be compiled into your version of elvis.

-i

Start editing in input mode instead of in command mode.

-o logfile

Redirect the startup messages out to a file, instead of stdout/stderr. This is of critical importance to MS Windows users because Windows discards anything written to standard output and standard error.

-R

Start editing each file in read-only mode.

-s

Read an ex script from standard input and execute (per the POSIX standard). This bypasses all initialization scripts.

-S

Set the option security=safer for the whole session, not just execution of .exrc files. This adds a certain amount of security, but should not necessarily be trusted blindly.

-SS

Set the option security=restricted, which is even more paranoid than security=safer.

-V

Output more verbose status information.

-?

Print a summary of the possible options.

elvis Window Management

elvis provides multiwindow editing.

Window management commands—ex

Command

Function

close

Close the current window; the buffer that the window was displaying remains intact

new

Create a new empty buffer and create a new window to show that buffer

qall

Issue a :q command for each window; buffers without windows are not affected

sa[ll]

Create a new window for any files named in the argument list that don’t already have a window

sl[ast]

Create a new window, showing the last file in the argument list

sne[w]

Same as new

sn[ext] [file...]

Create a new window, showing the next file in the argument list

sN[ext]

Create a new window, showing the previous file in the argument list

sp[lit] [file]

Create a new window; load it with file if supplied; otherwise, the new window shows the current file

sre[wind][!]

Create a new window, showing the first file in the argument list; reset the “current” file as the first with respect to the :next command

sta[g][!] tag

Create a new window, showing the file where the requested tag is found

wi[ndow] [target]

With no target, list all windows; the possible values for target are described in the next table

wquit

Write the buffer back to the file and close the window; the file is saved whether or not it has been modified

Arguments to the :window command

Argument

Meaning

+

Switch to the next window, like ^W k

++

Switch to the next window, wrapping like ^W ^W

-

Switch to the previous window, like ^W j

--

Switch to the previous window, wrapping

num

Switch to the window whose windowid = num

buffer-name

Switch to the window editing the named buffer

Window management commands—vi

Command

Function

^W c

Hide the buffer and close the window

^W d

Toggle the display mode between “normal” and the buffer’s usual display mode; this is a per-window option

^W j

Move down to the next window

^W k

Move up to the previous window

^W n

Create a new window and a new buffer to be displayed in the window

^W q

Save the buffer and close the window

^W s

Split the current window

^W S

Toggle the wrap option; this option controls whether long lines wrap or whether the whole screen scrolls to the right, and is a per-window option

[N] ^W ^W

Move to the next window, or to the Nth window

^W ]

Create a new window, then look up the tag underneath the cursor

^W +

Increase the size of the current window (termcap interface only)

^W -

Reduce the size of the current window (termcap interface only)

^W

Make the current window as large as possible (termcap interface only)

elvis Extended Regular Expressions

|

Indicates alternation.

+

Matches one or more of the preceding regular expressions.

?

Matches zero or one of the preceding regular expressions.

@

Matches the word under the cursor.

=

Indicates where to put the cursor when the text is matched.

(...)

Used for grouping to allow the application of additional regular expression operators.

{...}

Describes an interval expression (interval expressions were defined in Vim Extended Regular Expressions).

POSIX bracket expressions (character classes, etc.; see POSIX character classes) are available.

Command-Line History and Completion Movement Keys

Key

Effect

↑, ↓

Page up and down through the Elvis ex history buffer

,

Move around on the command line

Insert characters by typing and erase them by backspacing over them.

You can use the TAB key for filename expansion.

To get a real tab character, precede it with a ^V. Disable filename completion entirely by setting the Elvis ex history buffer’s inputtab option to tab via the following command:

:(Elvis ex history)set inputtab=tab

Tag Stacks

elvis provides both ex and vi commands for managing the tag stack.

Tag commands—ex

Command

Function

ta[g][!] [tagstring]

Edit the file containing tagstring as defined in the tags file

stac[k]

Display the current tag stack

po[p][!]

Pop a cursor position off the stack, restoring the cursor to its previous position

Tag commands—vi

Command

Function

^]

Look up the location of the identifier under the cursor in the tags file and move to that location; the current location is automatically pushed onto the tag stack

^T

Return to the previous location in the tag stack

Edit-Compile Speedup

elvis provides several commands to increase programmer productivity.

Program development commands—ex

Command

Option

Function

cc[!] [args]

ccprg

Run the C compiler; useful for recompiling an individual file

er[rlist][!] [file]

 

Move to the next error’s location

mak[e][!] [args]

makeprg

Recompile everything that needs recompiling (usually via make)

Display modes

Mode

Display appearance

hex

An interactive hex dump, reminiscent of mainframe hex dumps; good for editing binary files

html

A simple web page formatter; the tag commands can follow links and return to the starting web page

man

Simple manpage formatter; like the output of nroff -man

normal

No formatting; display text as it exists in the file

syntax

Like normal, but with syntax coloring turned on

tex

A simple subset of the TEX formatter

Display-mode commands—ex

Command

Function

di[splay] [mode [lang]]

Change the display mode to mode; use lang for syntax mode

no[rmal]

Same as :display normal, but much easier to type

Options for print management

Option

Function

lpcolor (lpcl)

Enable color printing for PostScript and MS Windows printers

lpcolumns (lpcols)

The printer’s width

lpcontrast (lpct)

Control shading and contrast; for use with the lpcolor option

lpconvert (lpcvt)

If set, convert Latin-8 extended ASCII to PC-8 extended ASCII

lpcrlf (lpc)

The printer needs <CR><LF> to end each line

lpformfeed (lpff)

Send a formfeed after the last page

lplines (lprows)

The length of the printer’s page

lpoptions (lpopt)

Control of various printer features; this matters only for PostScript printers

lpout (lpo)

The file or command to print to

lptype (lp)

The printer type

lpwrap (lpw)

Simulate line wrapping

Values for the lptype option

Name

Printer type

bs

Overtyping is done via backspace characters; this setting is the closest to traditional Unix nroff

cr

Line printers; overtyping is done with carriage return

dumb

Plain ASCII; no font control

epson

Most dot-matrix printers; no graphic characters supported

hp

Hewlett-Packard printers and most non-PostScript laser printers

ibm

Dot-matrix printers with IBM graphic characters

pana

Panasonic dot-matrix printers

ps

PostScript; one logical page per sheet of paper

ps2

PostScript; two logical pages per sheet of paper

elvis 2.2 set Options

elvis 2.2 has a total of 225 options that affect its behavior. The most important ones are summarized here. Options shared with vi are not repeated here.

Option

Default

autoiconify (aic)noautoiconify
backup (bk)nobackup
binary (bin)
boldfont (xfb)
bufdisplay (bd)normal
ccprg (cp)cc ($1?$1:$2)
directory (dir)
display (mode)normal
elvispath (epath)
equalprg (ep)fmt
focusnew (fn)focusnew
font (fnt)
gdefault (gd)nogdefault
home (home)$HOME
italicfont (xfi)
locked (lock)nolocked
lpcolor (lpcl)nolpcl
lpcolumns (lpcols)80
lpcrlf (lpc)nolpcrlf
lpformfeed (lpff)nolpformfeed
lpheader (lph)nolph
lplines (lprows)60
lpout (lpo)
lptype (lpt)dumb
lpwrap (lpw)lpwrap
makeprg (mp)make $1
prefersyntax (psyn)never
ruler (ru)noruler
security (sec)normal
showmarkups (smu)noshowmarkups
sidescroll (ss)0
smartargs (sa)nosmartargs
spell (sp)nospell
taglength (tl)0
tags (tagpath)tags
tagstack (tsk)tagstack
undolevels (ul)0
warpback (wb)nowarpback
warpto (wt)don't
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.188.175.182