vile—vi like Emacs

vile is a vi clone based originally on MicroEmacs, whose main goal is to provide the “finger feel” of vi.

Important Command-Line Options

-g N

vile begins editing on the first file at the specified line number; this can also be given as +N.

-h

Invokes vile on the help file.

-R

Invokes vile in “read-only” mode; no writes are permitted while in this mode.

-s pattern

In the first file, vile executes an initial search for the given pattern; this can also be given as +/pattern.

-v

Invokes vile in “view” mode; no changes are permitted to any buffer while in this mode.

-?

vile prints a short usage summary and exits.

@ cmdfile

vile runs the specified file as its startup file and bypasses any normal startup file.

vile Window Management Commands

Command

Key
sequences

Function

delete-other-windows

^O, ^X 1

Eliminate all windows except the current one

delete-window

^K, ^X 0

Destroy the current window unless it’s the last one

edit-fileEe
find-file

^X e

Bring given (or under-cursor, for ^X e) file or existing buffer into window

grow-window

V

Increase the size of the current window by count

move-next-window-down

^A ^E

Move next window down (or buffer up) by count lines

move-next-window-up

^A ^Y

Move next window up (or buffer down) by count lines

move-window-left

^X ^L

Scroll window to left by count columns, half-screen if count unspecified

move-window-right

^X ^R

Scroll window to right by count columns, half-screen if count unspecified

next-window

^X o

Move to the next window

position-window

z where

Reframe with cursor specified by where, as follows: center (., M, m), top (ENTER, H, t), or bottom (-, L, b)

previous-window

^X O

Move to the previous window

resize-window

 

Change the current window to count lines

restore-window

 

Return to window saved with save-window

save-window

 

Mark a window for later return with restore-window

scroll-next-window-down

^A ^D

Move next window down by count half-screens

scroll-next-window-up

^A ^U

Move next window up by count half-screens

shrink-window

v

Decrease the size of the current window by count lines

split-current-window

^X 2

Split the window in half; a count of 1 or 2 determines which becomes current

view-file

 

Bring given file or existing buffer into window; mark it “view-only”

historical-buffer

_

Display a list of the first nine buffers; a digit moves to the given buffer, _ _ moves to the most recently edited file

toggle-buffer-list

*

Pop up/down a window showing all the vile buffers

vile Extended Regular Expressions

|

Indicates alternation.

+

Matches one or more of the preceding regular expressions.

?

Matches zero or one of the preceding regular expressions.

s S

Matches whitespace and nonwhitespace characters, respectively.

w W

Matches “word-constituent” characters (alphanumerics and the underscore, “_”) and nonword-constituent characters, respectively.

d D

Matches digits and nondigits, respectively.

p P

Matches printable and nonprintable characters, respectively. Whitespace is considered to be printable.

(...)

Provides grouping for *, +, and ?, as well as making matched subtexts available in the replacement part of a substitute command.

vile allows the escape sequences , f, , , and to appear in the replacement part of a substitute command. They stand for backspace, formfeed, carriage return, tab, and newline, respectively. Also, from the vile documentation:

Note that vile mimics perl’s handling of uL1E instead of vi’s. Given :s/(abc)/uL1E/, vi will replace with abc whereas vile and perl will replace with Abc. This is somewhat more useful for capitalizing words.

Command-Line History and Completion

vile stores all your ex commands in a buffer named [History]. Options control your access to it and the use of the minibuffer (the colon command line).

History commands—vi

Key

Meaning

↑, ↓

Move up (previous), down (more recent) in the history

,

Move left, right on the recalled line

BACKSPACE

Delete characters

The ex command line provides completion of various sorts. Completion applies to built-in and user-defined vile commands, tags, filenames, modes, and variables, and to the terminal characters (the character setting, such as backspace, suspend, and so on, derived from your stty settings).

History options

Option

Meaning

history

Log commands from the colon command line in the [History] buffer.

mini-edit

The character that toggles the editing mode in the minibuffer to use vi motion commands. You can also use the vi commands i, I, a, and A.

mini-hilite

Define the highlight attribute to use when the user toggles the editing mode in the minibuffer. The value should be one of none, underline, bold, italic, or reverse; the default is reverse.

Tag Stacks

vile 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

pop[!]

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

next-tag

Continue searching through the tags file for more matches

show-tagstack

Create a new window that displays the tag stack; the display changes as tags are pushed to or popped off the stack

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 to the tag stack

^T
^X ^]

Return to the previous location in the tag stack, i.e., pop off one element

^A ^]

Same as the :next-tag command

Edit-Compile Speedup

Unlike the other clones, vile only provides vi commands for increasing programmer productivity.

Program development commands—vi

Command

Function

^X ! command ENTER

Run command, saving the output in a buffer named [Output]

^X ^X

Find the next error; vile parses the output and moves to the location of each successive error

The error messages are parsed using regular expressions in the buffer [Error Expressions]. vile creates this buffer automatically and uses it when you use ^X ^X. You can add expressions to it as needed.

You can point the error finder at an arbitrary buffer (not just the output of shell commands) using the :error-buffer command. This lets you use the error finder on the output of previous compiler or egrep runs.

vile 9.8 set Options

Option

Default

alt-tabpos (atp)noatp
animatedanimated
autobuffer (ab)autobuffer
autocolor (ac)0
autosave (as)noautosave
autosavecnt (ascnt)256
backspacelimit (bl)backspacelimit
backup-styleoff
bcolordefault
byteorder-mark (bom)auto
check-accesscurrent
check-modtimenocheck-modtime
cindentnocindent
cindent-chars:#{}()[]
cmodeoff
color-scheme (cs)default
comment-prefix^s*((s*[#*>])|(///*))+
comments^s*/?(s*[#*>/])+/?s*$
cursor-tokensregex
dircnodirc
dosnodos
fcolordefault
fence-begin/*
fence-end*/
fence-if^s*#s*if
fence-elif^s*#s*elif>
fence-else^s*#s*else>
fence-fi^s*#s*endif>
fence-pairs{}()[]
file-encodingauto
filtername (fn)
for-buffers (fb)mixed
glob!echo %s
highlight (hl)highlight
history (hi)history
ignoresuffix (is)(.orig|~)$
horizscroll (hs)horizscroll
linewrap (lw)nolinewrap
maplongernomaplonger
meta-insert-bindings (mib)mib
mini-hilite (mh)reverse
modelinenomodeline
modelines5
overlap-matchesoverlap-matches
percent-crlf50
percent-utf890
popup-choices (pc)delayed
popup-msgs (pm)nopopup-msgs
recordseparator (rs)lf[a]
resolve-linksnoresolve-links
reuse-positionnoreuse-position
rulernoruler
showchar (sc)noshowchar
showformat (sf)foreign
showmode (smd)showmode
sideways0
tabinsert (ti)tabinsert
tagignorecase (tc)notagignorecase
taglength (tl)0
tagrelative (tr)notagrelative
tagstags
tagword (tw)notagword
undolimit (ul)10
unicode-as-hex (uh)nounicode-as-hex
unprintable-as-octal (uo)nounprintable-as-octal
visual-matchesnone
xterm-fkeysnoxterm-fkeys
xterm-mousenoxterm-mouse
xterm-titlenoxterm-title

[a] This depends on the platform for which vile is compiled.

..................Content has been hidden....................

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