| www.delorie.com/gnu/docs/emacs/viper_25.html | search |
![]() Buy the book! | |
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
An easy way to customize Viper is to change the values of constants used in
Viper. Here is the list of the constants used in Viper and their default
values. The corresponding :se command is also indicated. (The symbols
t and nil represent "true" and "false" in Lisp).
Viper supports both the abbreviated Vi variable names and their full names. Variable completion is done on full names only. TAB and SPC complete variable names. Typing `=' will complete the name and then will prompt for a value, if applicable. For instance, :se au SPC will complete the command to :set autoindent; :se ta SPC will complete the command and prompt further like this: :set tabstop = . However, typing :se ts SPC will produce a "No match" message because ts is an abbreviation for tabstop and Viper supports completion on full names only. However, you can still hit RET or =, which will complete the command like this: :set ts = and Viper will be waiting for you to type a value for the tabstop variable. To get the full list of Vi variables, type :se SPC TAB.
viper-auto-indent nil
:se ai (:se autoindent)
:se ai-g (:se autoindent-global)
t, enable auto indentation.
by RET, o or O command.
viper-auto-indent is a local variable. To change the value globally, use
setq-default. It may be useful for certain major modes to have their
own values of viper-auto-indent. This can be achieved by using
setq to change the local value of this variable in the hooks to the
appropriate major modes.
:se ai changes the value of viper-auto-indent in the current
buffer only; :se ai-g does the same globally.
viper-electric-mode t
nil, auto-indentation becomes electric, which means that
RET, O, and o indent cursor according to the current
major mode. In the future, this variable may control additional electric
features.
This is a local variable: setq changes the value of this variable
in the current buffer only. Use setq-default to change the value in
all buffers.
viper-case-fold-search nil
:se ic (:se ignorecase)
nil, search ignores cases.
This can also be toggled by quickly hitting / twice.
viper-re-search nil
:se magic
nil, search will use regular expressions; if nil then
use vanilla search.
This behavior can also be toggled by quickly hitting / trice.
buffer-read-only
:se ro (:se readonly)
(setq-default buffer-read-only t) in your `.emacs' file.
blink-matching-paren t
:se sm (:se showmatch)
tab-width t (default setting via setq-default)
:se ts=value (:se tabstop=value)
:se ts-g=value (:se tabstop-global=value)
tab-width is a local variable that controls the width of the tab stops.
To change the value globally, use setq-default; for local settings,
use setq.
The command :se ts sets the tab width in the current buffer only; it has no effect on other buffers.
The command :se ts-g sets tab width globally, for all buffers where the tab is not yet set locally, including the new buffers.
Note that typing TAB normally
doesn't insert the tab, since this key is usually bound to
a text-formatting function, indent-for-tab-command (which facilitates
programming and document writing). Instead, the tab is inserted via the
command viper-insert-tab, which is bound to S-tab (shift + tab).
On some non-windowing terminals, Shift doesn't modify the TAB key, so
S-tab behaves as if it were TAB. In such a case, you will have
to bind viper-insert-tab to some other convenient key.
viper-shift-width 8
:se sw=value (:se shiftwidth=value)
viper-search-wrap-around t
:se ws (:se wrapscan)
nil, search wraps around the end/beginning of buffer.
viper-search-scroll-threshold 2
viper-tags-file-name "TAGS"
viper-re-query-replace nil
nil, use reg-exp replace in query replace.
viper-want-ctl-h-help nil
nil, C-h is bound to help-command;
otherwise, C-h is bound as usual in Vi.
viper-vi-style-in-minibuffer t
nil, Viper provides a high degree of compatibility with Vi
insert mode when you type text in the Minibuffer; if nil, typing in
the Minibuffer feels like plain Emacs.
viper-no-multiple-ESC t
nil, you can use ESC as Meta in Vi state.
Normally, this is not necessary, since graphical displays have separate
Meta keys (usually on each side of the space bar). On a dumb terminal, Viper
sets this variable to twice, which is almost like nil, except
that double ESC beeps. This, too, lets ESC to be used as a Meta.
viper-ESC-keyseq-timeout 200 on tty, 0 on windowing display
viper-fast-keyseq-timeout 200
Setting this variable too high may slow down your typing. Setting it too low may make it hard to type macros quickly enough.
viper-translate-all-ESC-keysequences t on tty, nil on windowing display
viper-ex-style-motion t
nil, if you want l,h to cross
lines, etc. See section 2.8 Movement and Markers, for more info.
viper-ex-style-editing t
nil, if you want
C-h and DEL to not stop
at the beginning of a line in Insert state, X and x to delete
characters across lines in Vi command state, etc.
viper-ESC-moves-cursor-back t
viper-always t
t means: leave it to Viper to decide when a buffer must be brought
up in Vi state,
Insert state, or Emacs state. This heuristics works well in virtually all
cases. nil means you either has to invoke viper-mode manually
for each buffer (or you can add viper-mode to the appropriate major mode
hooks using viper-load-hook).
This option must be set in the file `~/.viper'.
viper-custom-file-name "~/.viper"
viper-spell-function 'ispell-region
viper-glob-function
viper-glob-unix-files and viper-glob-mswindows-files in
`viper-util.el' as examples.
This feature is used to expand wildcards in the Ex command :e. Note that Viper doesn't support wildcards in the :r and :w commands, because file completion is a better mechanism.
ex-cycle-other-window t
nil, :n and :b will cycle through files in another
window, if one exists.
ex-cycle-through-non-files nil
viper-want-emacs-keys-in-insert
nil for user levels 1 and 2 and to t for user
levels 3 and 4. Users who specify level 5 are allowed to set this variable
as they please (the default for this level is t). If set to
nil, complete Vi compatibility is provided in Insert state. This is
really not recommended, as this precludes you from using language-specific
features provided by the major modes.
viper-want-emacs-keys-in-vi
nil for user
level 1 and to t for user levels 2--4.
At level 5, users are allowed to set this variable as they please (the
default for this level is t).
If set to nil, complete Vi compatibility is provided
in Vi command state. Setting this to nil is really a bad idea,
unless you are a novice, as this precludes the use
of language-specific features provided by the major modes.
viper-keep-point-on-repeat t
nil, point is not moved when the user repeats the previous
command by typing `.' This is very useful for doing repeated changes with
the . key.
viper-repeat-from-history-key 'f12
viper-repeat-from-history,
which checks the second key by which it is invoked to see which of the
previous commands to invoke. Viper binds f12 1 and f12 2 only,
but the user can bind more in `~/.viper'. See section 3.4 Vi Macros, for how to do
this.
viper-keep-point-on-undo nil
nil, Viper tries to not move point when undoing commands.
Instead, it will briefly move the cursor to the place where change has
taken place. However, if the undone piece of text is not seen in window,
then point will be moved to the place where the change took place.
Set it to t and see if you like it better.
viper-delete-backwards-in-replace nil
nil, DEL key will delete characters while moving the cursor
backwards. If nil, the cursor will move backwards without deleting
anything.
viper-replace-overlay-face 'viper-replace-overlay-face
By default, viper-replace-overlay-face underlines the replacement on
monochrome displays and also lays a stipple over them. On color displays,
replacement regions are highlighted with color.
If you know something about Emacs faces and don't like how Viper highlights
replacement regions, you can change viper-replace-overlay-face by
specifying a new face. (Emacs faces are described in the Emacs Lisp
reference.) On a color display, the following customization method is
usually most effective:
(set-face-foreground viper-replace-overlay-face "DarkSlateBlue") (set-face-background viper-replace-overlay-face "yellow") |
(x-defined-colors). (Type it in the buffer *scratch* and then
hit the C-j key.
viper-replace-overlay-cursor-color "Red"
viper-insert-state-cursor-color nil
viper-replace-region-end-delimiter "$"
viper-use-replace-region-delimiters is non-nil.
viper-replace-region-start-delimiter ""
viper-use-replace-region-delimiters is non-nil.
viper-use-replace-region-delimiters
viper-replace-region-end-delimiter and
viper-replace-region-start-delimiter to delimit replacement regions,
even on color displays (where this is unnecessary). By default, this
variable is non-nil only on TTYs or monochrome displays.
viper-allow-multiline-replace-regions t
nil, Viper will
emulate the standard Vi behavior, which supports only intra-line
replacement regions (and multi-line replacement regions are deleted).
viper-toggle-key "\C-z"
In Insert state, this key acts as a temporary escape to Vi state, i.e., it will set Viper up so that the very next command will be executed as if it were typed in Vi state.
viper-ESC-key "\e"
viper-buffer-search-char nil
viper-surrounding-word-function 'viper-surrounding-word
viper-search-face 'viper-search-face
viper-vi-state-hook nil
viper-insert-state-hook nil
viper-replace-state-hook nil
viper-insert-state-hook).
viper-emacs-state-hook nil
viper-load-hook nil
(setq viper-case-fold-search t) |
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
| webmaster donations bookstore | delorie software privacy |
| Copyright © 2003 by The Free Software Foundation | Updated Jun 2003 |