Go to the previous, next section.

Customization

If you have a file called `.vip' in your home directory, then it will also be loaded when VIP is loaded. This file is thus useful for customizing VIP.

Customizing Constants

An easy way to customize VIP is to change the values of constants used in VIP. Here is the list of the constants used in VIP and their default values.

vip-shift-width 8
The number of columns shifted by > and < command.
vip-re-replace nil
If t then do regexp replace, if nil then do string replace.
vip-search-wrap-around t
If t, search wraps around the buffer.
vip-re-search nil
If t then search is reg-exp search, if nil then vanilla search.
vip-case-fold-search nil
If t search ignores cases.
vip-re-query-replace nil
If t then do reg-exp replace in query replace.
vip-open-with-indent nil
If t then indent to the previous current line when open a new line by o or O command.
vip-tags-file-name "TAGS"
The name of the file used as the tag table.
vip-help-in-insert-mode nil
If t then C-h is bound to help-command in insert mode, if nil then it sis bound to delete-backward-char.
You can reset these constants in VIP by the Ex command set. Or you can include a line like this in your `.vip' file:
(setq vip-case-fold-search t)

Customizing Key Bindings

VIP uses vip-command-mode-map as the local keymap for vi mode. For example, in vi mode, SPC is bound to the function vip-scroll. But, if you wish to make SPC and some other keys behave like Vi, you can include the following lines in your `.vip' file.

(define-key vip-command-mode-map "\C-g" 'vip-info-on-file)
(define-key vip-command-mode-map "\C-h" 'vip-backward-char)
(define-key vip-command-mode-map "\C-m" 'vip-next-line-at-bol)
(define-key vip-command-mode-map " " 'vip-forward-char)
(define-key vip-command-mode-map "g" 'vip-keyboard-quit)
(define-key vip-command-mode-map "s" 'vip-substitute)
(define-key vip-command-mode-map "C" 'vip-change-to-eol)
(define-key vip-command-mode-map "R" 'vip-change-to-eol)
(define-key vip-command-mode-map "S" 'vip-substitute-line)
(define-key vip-command-mode-map "X" 'vip-delete-backward-char)

Go to the previous, next section.