comparison lisp/viper/viper-init.el @ 175:2d532a89d707 r20-3b14

Import from CVS: tag r20-3b14
author cvs
date Mon, 13 Aug 2007 09:50:14 +0200
parents 0132846995bd
children bfd6434d15b3
comparison
equal deleted inserted replaced
174:bb3568571b84 175:2d532a89d707
24 (provide 'viper-init) 24 (provide 'viper-init)
25 25
26 ;; compiler pacifier 26 ;; compiler pacifier
27 (defvar mark-even-if-inactive) 27 (defvar mark-even-if-inactive)
28 (defvar viper-version) 28 (defvar viper-version)
29 (defvar viper-expert-level)
30 (defvar vip-expert-level)
29 ;; end pacifier 31 ;; end pacifier
30 32
31 33
32 ;; Viper version 34 ;; Viper version
33 (defun viper-version () 35 (defun viper-version ()
46 (device-type (selected-device)))) 48 (device-type (selected-device))))
47 ;; in XEmacs: device-type is tty on tty and stream in batch. 49 ;; in XEmacs: device-type is tty on tty and stream in batch.
48 (defun vip-window-display-p () 50 (defun vip-window-display-p ()
49 (and (vip-device-type) (not (memq (vip-device-type) '(tty stream pc))))) 51 (and (vip-device-type) (not (memq (vip-device-type) '(tty stream pc)))))
50 52
51 (defvar vip-ms-style-os-p (memq system-type '(ms-dos windows-nt windows-95)) 53 (defcustom vip-ms-style-os-p (memq system-type '(ms-dos windows-nt windows-95))
52 "Tells if Emacs is running under an MS-style OS: ms-dos, windows-nt, W95.") 54 "Tells if Emacs is running under an MS-style OS: ms-dos, windows-nt, W95."
53 (defvar vip-vms-os-p (memq system-type '(vax-vms axp-vms)) 55 :type 'boolean
54 "Tells if Emacs is running under VMS.") 56 :tag "Is it Microsoft-made OS?"
55 57 :group 'viper)
56 (defvar vip-force-faces nil 58 (defcustom vip-vms-os-p (memq system-type '(vax-vms axp-vms))
59 "Tells if Emacs is running under VMS."
60 :type 'boolean
61 :tag "Is it VMS?"
62 :group 'viper)
63
64 (defcustom vip-force-faces nil
57 "If t, Viper will think that it is running on a display that supports faces. 65 "If t, Viper will think that it is running on a display that supports faces.
58 This is provided as a temporary relief for users of face-capable displays 66 This is provided as a temporary relief for users of graphics-capable terminals
59 that Viper doesn't know about.") 67 that Viper doesn't know about.
68 In all likelihood, you don't need to bother with this setting."
69 :type 'boolean
70 :group 'viper)
60 71
61 (defun vip-has-face-support-p () 72 (defun vip-has-face-support-p ()
62 (cond ((vip-window-display-p)) 73 (cond ((vip-window-display-p))
63 (vip-force-faces) 74 (vip-force-faces)
64 (vip-emacs-p (memq (vip-device-type) '(pc))) 75 (vip-emacs-p (memq (vip-device-type) '(pc)))
233 244
234 ;; Is t until viper-mode executes for the very first time. 245 ;; Is t until viper-mode executes for the very first time.
235 ;; Prevents recursive descend into startup messages. 246 ;; Prevents recursive descend into startup messages.
236 (defvar vip-first-time t) 247 (defvar vip-first-time t)
237 248
238 (defvar vip-expert-level 0 249 (defvar viper-expert-level (if (boundp 'vip-expert-level) vip-expert-level 0)
239 "User's expert level. 250 "User's expert level.
240 The minor mode vip-vi-diehard-minor-mode is in effect when 251 The minor mode vip-vi-diehard-minor-mode is in effect when
241 vip-expert-level is 1 or 2 or when vip-want-emacs-keys-in-vi is t. 252 viper-expert-level is 1 or 2 or when vip-want-emacs-keys-in-vi is t.
242 The minor mode vip-insert-diehard-minor-mode is in effect when 253 The minor mode vip-insert-diehard-minor-mode is in effect when
243 vip-expert-level is 1 or 2 or if vip-want-emacs-keys-in-insert is t. 254 viper-expert-level is 1 or 2 or if vip-want-emacs-keys-in-insert is t.
244 Use `M-x vip-set-expert-level' to change this.") 255 Use `M-x viper-set-expert-level' to change this.")
245 256
246 ;; Max expert level supported by Viper. This is NOT a user option. 257 ;; Max expert level supported by Viper. This is NOT a user option.
247 ;; It is here to make it hard for the user from resetting it. 258 ;; It is here to make it hard for the user from resetting it.
248 (defconst vip-max-expert-level 5) 259 (defconst viper-max-expert-level 5)
249 260
250 ;; Contains user settings for vars affected by vip-set-expert-level function.
251 ;; Not a user option.
252 (defvar vip-saved-user-settings nil)
253
254 261
255 ;;; ISO characters 262 ;;; ISO characters
256 263
257 (vip-deflocalvar vip-automatic-iso-accents nil 264 (vip-deflocalvar vip-automatic-iso-accents nil "")
265 (defcustom vip-automatic-iso-accents nil
258 "*If non-nil, ISO accents will be turned on in insert/replace emacs states and turned off in vi-state. 266 "*If non-nil, ISO accents will be turned on in insert/replace emacs states and turned off in vi-state.
259 For some users, this behavior may be too primitive. In this case, use 267 For some users, this behavior may be too primitive. In this case, use
260 insert/emacs/vi state hooks.") 268 insert/emacs/vi state hooks."
269 :type 'boolean
270 :group 'viper)
261 271
262 272
263 ;; VI-style Undo 273 ;; VI-style Undo
264 274
265 ;; Used to 'undo' complex commands, such as replace and insert commands. 275 ;; Used to 'undo' complex commands, such as replace and insert commands.
269 ;; A mark that Viper puts on buffer-undo-list. Marks the beginning of a 279 ;; A mark that Viper puts on buffer-undo-list. Marks the beginning of a
270 ;; complex command that must be undone atomically. If inserted, it is 280 ;; complex command that must be undone atomically. If inserted, it is
271 ;; erased by vip-change-state-to-vi and vip-repeat. 281 ;; erased by vip-change-state-to-vi and vip-repeat.
272 (defconst vip-buffer-undo-list-mark 'viper) 282 (defconst vip-buffer-undo-list-mark 'viper)
273 283
274 (defvar vip-keep-point-on-undo nil 284 (defcustom vip-keep-point-on-undo nil
275 "*Non-nil means not to move point while undoing commands. 285 "*Non-nil means not to move point while undoing commands.
276 This style is different from Emacs and Vi. Try it to see if 286 This style is different from Emacs and Vi. Try it to see if
277 it better fits your working style.") 287 it better fits your working style."
288 :type 'boolean
289 :tag "Preserve Position of Point After Undo"
290 :group 'viper)
278 291
279 ;; Replace mode and changing text 292 ;; Replace mode and changing text
280 293
281 ;; Viper's own after/before change functions, which get vip-add-hook'ed to 294 ;; Viper's own after/before change functions, which get vip-add-hook'ed to
282 ;; Emacs's 295 ;; Emacs's
289 (vip-deflocalvar vip-intermediate-command nil "") 302 (vip-deflocalvar vip-intermediate-command nil "")
290 303
291 ;; Indicates that the current destructive command has started in replace mode. 304 ;; Indicates that the current destructive command has started in replace mode.
292 (vip-deflocalvar vip-began-as-replace nil "") 305 (vip-deflocalvar vip-began-as-replace nil "")
293 306
294 (defvar vip-allow-multiline-replace-regions t 307 (defcustom vip-allow-multiline-replace-regions t
295 "If non-nil, Viper will allow multi-line replace regions. 308 "If non-nil, Viper will allow multi-line replace regions.
296 This is an extension to standard Vi. 309 This is an extension to standard Vi.
297 If nil, commands that attempt to replace text spanning multiple lines first 310 If nil, commands that attempt to replace text spanning multiple lines first
298 delete the text being replaced, as in standard Vi.") 311 delete the text being replaced, as in standard Vi."
299 312 :type 'boolean
300 (defvar vip-replace-overlay-cursor-color "Red" 313 :group 'viper)
301 "*Cursor color to use in Replace state") 314
302 (defvar vip-insert-state-cursor-color nil 315 (defcustom vip-replace-overlay-cursor-color "Red"
303 "Cursor color for Viper insert state.") 316 "*Cursor color when Viper is in Replace state."
304 (put 'vip-insert-state-cursor-color 'permanent-local t) 317 :type 'string
318 :group 'viper)
319 (defcustom vip-insert-state-cursor-color "Green"
320 "Cursor color when Viper is in insert state."
321 :type 'string
322 :group 'viper)
323
305 ;; place to save cursor colow when switching to insert mode 324 ;; place to save cursor colow when switching to insert mode
306 (vip-deflocalvar vip-saved-cursor-color nil "") 325 (vip-deflocalvar vip-saved-cursor-color nil "")
307 326
308 (vip-deflocalvar vip-replace-overlay nil "") 327 (vip-deflocalvar vip-replace-overlay nil "")
309 (put 'vip-replace-overlay 'permanent-local t) 328 (put 'vip-replace-overlay 'permanent-local t)
310 329
311 (defvar vip-replace-overlay-pixmap "gray3" 330 (defcustom vip-replace-overlay-pixmap "gray3"
312 "Pixmap to use for search face on non-color displays.") 331 "Pixmap to use for search face on non-color displays."
313 (defvar vip-search-face-pixmap "gray3" 332 :type 'string
314 "Pixmap to use for search face on non-color displays.") 333 :group 'viper)
315 334 (defcustom vip-search-face-pixmap "gray3"
316 335 "Pixmap to use for search face on non-color displays."
317 (defvar vip-replace-region-end-delimiter "$" 336 :type 'string
337 :group 'viper)
338
339
340 (defcustom vip-replace-region-end-delimiter "$"
318 "A string marking the end of replacement regions. 341 "A string marking the end of replacement regions.
319 It is used only with TTYs or if `vip-use-replace-region-delimiters' 342 It is used only with TTYs or if `vip-use-replace-region-delimiters'
320 is non-nil.") 343 is non-nil."
321 (defvar vip-replace-region-start-delimiter "" 344 :type 'string
345 :group 'viper)
346 (defcustom vip-replace-region-start-delimiter ""
322 "A string marking the beginning of replacement regions. 347 "A string marking the beginning of replacement regions.
323 It is used only with TTYs or if `vip-use-replace-region-delimiters' 348 It is used only with TTYs or if `vip-use-replace-region-delimiters'
324 is non-nil.") 349 is non-nil."
325 (defvar vip-use-replace-region-delimiters (not (vip-has-face-support-p)) 350 :type 'string
351 :group 'viper)
352 (defcustom vip-use-replace-region-delimiters (not (vip-has-face-support-p))
326 "*If non-nil, Viper will always use `vip-replace-region-end-delimiter' and 353 "*If non-nil, Viper will always use `vip-replace-region-end-delimiter' and
327 `vip-replace-region-start-delimiter' to delimit replacement regions, even on 354 `vip-replace-region-start-delimiter' to delimit replacement regions, even on
328 color displays. By default, the delimiters are used only on TTYs.") 355 color displays. By default, the delimiters are used only on TTYs."
356 :type 'boolean
357 :group 'viper)
329 358
330 ;; XEmacs requires glyphs 359 ;; XEmacs requires glyphs
331 (if vip-xemacs-p 360 (if vip-xemacs-p
332 (progn 361 (progn
333 (or (glyphp vip-replace-region-end-delimiter) 362 (or (glyphp vip-replace-region-end-delimiter)
356 ;; mode to compensate for the inserted characters. 385 ;; mode to compensate for the inserted characters.
357 (vip-deflocalvar vip-replace-chars-to-delete 0 "") 386 (vip-deflocalvar vip-replace-chars-to-delete 0 "")
358 (vip-deflocalvar vip-replace-chars-deleted 0 "") 387 (vip-deflocalvar vip-replace-chars-deleted 0 "")
359 388
360 ;; Insertion ring and command ring 389 ;; Insertion ring and command ring
361 (defvar vip-insertion-ring-size 14 390 (defcustom vip-insertion-ring-size 14
362 "The size of the insertion ring.") 391 "The size of history of inserted text.
392 This is a list where Viper keeps the history of previously inserted pieces of
393 text."
394 :type 'integer
395 :group 'viper)
363 ;; The insertion ring. 396 ;; The insertion ring.
364 (defvar vip-insertion-ring nil) 397 (defvar vip-insertion-ring nil)
365 ;; This is temp insertion ring. Used to do rotation for display purposes. 398 ;; This is temp insertion ring. Used to do rotation for display purposes.
366 ;; When rotation just started, it is initialized to vip-insertion-ring. 399 ;; When rotation just started, it is initialized to vip-insertion-ring.
367 (defvar vip-temp-insertion-ring nil) 400 (defvar vip-temp-insertion-ring nil)
368 (defvar vip-last-inserted-string-from-insertion-ring "") 401 (defvar vip-last-inserted-string-from-insertion-ring "")
369 402
370 (defvar vip-command-ring-size 14 403 (defcustom vip-command-ring-size 14
371 "The size of the command ring.") 404 "The size of history of Vi commands repeatable with dot."
405 :type 'integer
406 :group 'viper)
372 ;; The command ring. 407 ;; The command ring.
373 (defvar vip-command-ring nil) 408 (defvar vip-command-ring nil)
374 ;; This is temp command ring. Used to do rotation for display purposes. 409 ;; This is temp command ring. Used to do rotation for display purposes.
375 ;; When rotation just started, it is initialized to vip-command-ring. 410 ;; When rotation just started, it is initialized to vip-command-ring.
376 (defvar vip-temp-command-ring nil) 411 (defvar vip-temp-command-ring nil)
377 412
413 ;; Fast keyseq and ESC keyseq timeouts
414 (defcustom vip-fast-keyseq-timeout 200
415 "*Key sequence separated by no more than this many milliseconds is viewed as a Vi-style macro, if such a macro is defined.
416 Setting this too high may slow down your typing. Setting this value too low
417 will make it hard to use Vi-stile timeout macros."
418 :type 'integer
419 :group 'viper)
420
421 (defcustom vip-ESC-keyseq-timeout (if (vip-window-display-p)
422 0 vip-fast-keyseq-timeout)
423 "*Key sequence beginning with ESC and separated by no more than this many milliseconds is considered to be generated by a keyboard function key.
424 Setting this too high may slow down switching from insert to vi state. Setting
425 this value too low will make it impossible to use function keys in insert mode
426 on a dumb terminal."
427 :type 'integer
428 :group 'viper)
429
378 ;; Modes and related variables 430 ;; Modes and related variables
379 431
380 ;; Current mode. One of: `emacs-state', `vi-state', `insert-state' 432 ;; Current mode. One of: `emacs-state', `vi-state', `insert-state'
381 (vip-deflocalvar vip-current-state 'emacs-state) 433 (vip-deflocalvar vip-current-state 'emacs-state)
382 434
390 (vip-deflocalvar vip-current-indent 0) 442 (vip-deflocalvar vip-current-indent 0)
391 443
392 ;; Whether to preserve the indent, used by C-d in insert mode. 444 ;; Whether to preserve the indent, used by C-d in insert mode.
393 (vip-deflocalvar vip-preserve-indent nil) 445 (vip-deflocalvar vip-preserve-indent nil)
394 446
395 (vip-deflocalvar vip-auto-indent nil 447 (vip-deflocalvar vip-auto-indent nil "")
396 "*Autoindent if t.") 448 (defcustom vip-auto-indent nil
397 (vip-deflocalvar vip-electric-mode t 449 "*Enable autoindent, if t.
398 "*If t, enable electric behavior. 450 This is a buffer-local variable."
399 Currently only enables auto-indentation `according to mode'.") 451 :type 'boolean
400 452 :group 'viper)
401 (defconst vip-shift-width 8 453
402 "*The shiftwidth variable.") 454 (vip-deflocalvar vip-electric-mode t "")
455 (defcustom vip-electric-mode t
456 "*If t, electrify Viper.
457 Currently, this only electrifies auto-indentation, making it appropriate to the
458 mode of the buffer.
459 This means that auto-indentation will depart from standard Vi and will indent
460 appropriate to the mode of the buffer. This is especially useful for editing
461 programs and LaTeX documents."
462 :type 'boolean
463 :group 'viper)
464
465 (defcustom vip-shift-width 8
466 "*The shiftwidth variable."
467 :type 'integer
468 :group 'viper)
403 469
404 ;; Variables for repeating destructive commands 470 ;; Variables for repeating destructive commands
405 471
406 (defconst vip-keep-point-on-repeat t 472 (defcustom vip-keep-point-on-repeat t
407 "*If t, don't move point when repeating previous command. 473 "*If t, don't move point when repeating previous command.
408 This is useful for doing repeated changes with the '.' key. 474 This is useful for doing repeated changes with the '.' key.
409 The user can change this to nil, if she likes when the cursor moves 475 The user can change this to nil, if she likes when the cursor moves
410 to a new place after repeating previous Vi command.") 476 to a new place after repeating previous Vi command."
477 :type 'boolean
478 :group 'viper)
411 479
412 ;; Remember insert point as a marker. This is a local marker that must be 480 ;; Remember insert point as a marker. This is a local marker that must be
413 ;; initialized to nil and moved with `vip-move-marker-locally'. 481 ;; initialized to nil and moved with `vip-move-marker-locally'.
414 (vip-deflocalvar vip-insert-point nil) 482 (vip-deflocalvar vip-insert-point nil)
415 (put 'vip-insert-point 'permanent-local t) 483 (put 'vip-insert-point 'permanent-local t)
480 (defvar vip-f-offset nil) 548 (defvar vip-f-offset nil)
481 549
482 ;; Last search string 550 ;; Last search string
483 (defvar vip-s-string "") 551 (defvar vip-s-string "")
484 552
485 (defvar vip-quote-string "> " 553 (defcustom vip-quote-string "> "
486 "String inserted at the beginning of quoted region.") 554 "String inserted at the beginning of quoted region."
555 :type 'string
556 :group 'viper)
487 557
488 ;; If t, search is forward. 558 ;; If t, search is forward.
489 (defvar vip-s-forward nil) 559 (defvar vip-s-forward nil)
490 560
491 (defconst vip-case-fold-search nil 561 (defcustom vip-case-fold-search nil
492 "*If not nil, search ignores cases.") 562 "*If not nil, search ignores cases."
493 563 :type 'boolean
494 (defconst vip-re-search t 564 :group 'viper)
495 "*If not nil, search is reg-exp search, otherwise vanilla search.") 565
496 566 (defcustom vip-re-search t
497 (defvar vip-search-scroll-threshold 2 567 "*If not nil, search is regexp search, otherwise vanilla search."
568 :type 'boolean
569 :tag "Regexp Search"
570 :group 'viper)
571
572 (defcustom vip-search-scroll-threshold 2
498 "*If search lands within this threshnold from the window top/bottom, 573 "*If search lands within this threshnold from the window top/bottom,
499 the window will be scrolled up or down appropriately, to reveal context. 574 the window will be scrolled up or down appropriately, to reveal context.
500 If you want Viper search to behave as usual in Vi, set this variable to a 575 If you want Viper search to behave as usual in Vi, set this variable to a
501 negative number.") 576 negative number."
502 577 :type 'boolean
503 (defconst vip-re-query-replace t 578 :group 'viper)
504 "*If t then do regexp replace, if nil then do string replace.") 579
505 580 (defcustom vip-re-query-replace t
506 (defconst vip-re-replace t 581 "*If t then do regexp replace, if nil then do string replace."
507 "*If t, do regexp replace. nil means do string replace.") 582 :type 'boolean
508 583 :tag "Regexp Query Replace"
509 (defvar vip-parse-sexp-ignore-comments t 584 :group 'viper)
510 "*If t, `%' ignores the parentheses that occur inside comments.") 585
511 586 (defcustom vip-re-replace t
512 (vip-deflocalvar vip-ex-style-motion t 587 "*If t, do regexp replace. nil means do string replace."
513 "*Ex-style: the commands l,h do not cross lines, etc.") 588 :type 'boolean
514 589 :tag "Regexp Replace"
515 (vip-deflocalvar vip-ex-style-editing-in-insert t 590 :group 'viper)
516 "*The keys ^H, ^? don't jump lines in insert, ESC moves cursor back, etc. 591
517 Note: this doesn't preclude ^H and ^? from deleting characters by moving 592 (defcustom vip-parse-sexp-ignore-comments t
518 past the insertion point. This is a feature, not a bug. ") 593 "*If t, `%' ignores the parentheses that occur inside comments."
519 594 :type 'boolean
520 (vip-deflocalvar vip-delete-backwards-in-replace nil 595 :group 'viper)
596
597 (vip-deflocalvar vip-ex-style-motion t "")
598 (defcustom vip-ex-style-motion t
599 "*If t, the commands l,h do not cross lines, etc (Ex-style).
600 If nil, these commands cross line boundaries."
601 :type 'boolean
602 :group 'viper)
603
604 (vip-deflocalvar vip-ex-style-editing-in-insert t "")
605 (defcustom vip-ex-style-editing-in-insert t
606 "*If t, `Backspace' and `Delete' don't cross line boundaries in insert, etc.
607 Note: this doesn't preclude `Backspace' and `Delete' from deleting characters
608 by moving past the insertion point. This is a feature, not a bug."
609 :type 'boolean
610 :group 'viper)
611
612 (vip-deflocalvar vip-ESC-moves-cursor-back vip-ex-style-editing-in-insert "")
613 (defcustom vip-ESC-moves-cursor-back nil
614 "*If t, ESC moves cursor back when changing from insert to vi state.
615 If nil, the cursor stays where it was."
616 :type 'boolean
617 :group 'viper)
618
619 (vip-deflocalvar vip-delete-backwards-in-replace nil "")
620 (defcustom vip-delete-backwards-in-replace nil
521 "*If t, DEL key will delete characters while moving the cursor backwards. 621 "*If t, DEL key will delete characters while moving the cursor backwards.
522 If nil, the cursor will move backwards without deleting anything.") 622 If nil, the cursor will move backwards without deleting anything."
523 623 :type 'boolean
524 (defconst vip-buffer-search-char nil 624 :group 'viper)
525 "*Key bound for buffer-searching.") 625
526 626 (defcustom vip-buffer-search-char nil
527 (defconst vip-search-wrap-around-t t 627 "*Key used for buffer-searching. Must be a character type, e.g., ?g."
528 "*If t, search wraps around.") 628 :type '(choice (const nil) character)
529 629 :group 'viper)
530 (vip-deflocalvar vip-related-files-and-buffers-ring nil 630
531 "*Ring of file and buffer names that are considered to be related to the 631 (defcustom vip-search-wrap-around-t t
532 current buffer. 632 "*If t, search wraps around."
533 These buffers can be cycled through via :R and :P commands.") 633 :type 'boolean
634 :tag "Search Wraps Around"
635 :group 'viper)
636
637 (vip-deflocalvar vip-related-files-and-buffers-ring nil "")
638 (defcustom vip-related-files-and-buffers-ring nil
639 "*List of file and buffer names that are considered to be related to the current buffer.
640 Related buffers can be cycled through via :R and :P commands."
641 :type 'boolean
642 :group 'viper)
534 (put 'vip-related-files-and-buffers-ring 'permanent-local t) 643 (put 'vip-related-files-and-buffers-ring 'permanent-local t)
535 644
536 ;; Used to find out if we are done with searching the current buffer. 645 ;; Used to find out if we are done with searching the current buffer.
537 (vip-deflocalvar vip-local-search-start-marker nil) 646 (vip-deflocalvar vip-local-search-start-marker nil)
538 ;; As above, but global 647 ;; As above, but global
597 ;;; Miscellaneous 706 ;;; Miscellaneous
598 707
599 (defvar vip-inhibit-startup-message nil 708 (defvar vip-inhibit-startup-message nil
600 "Whether Viper startup message should be inhibited.") 709 "Whether Viper startup message should be inhibited.")
601 710
602 (defvar vip-custom-file-name (vip-convert-standard-file-name "~/.viper") 711 (defcustom vip-spell-function 'ispell-region
603 "Viper customisation file. 712 "Spell function used by #s<move> command to spell."
604 This variable must be set _before_ loading Viper.") 713 :type 'function
605 714 :group 'viper)
606 715
607 (defvar vip-spell-function 'ispell-region 716 (defcustom vip-tags-file-name "TAGS"
608 "Spell function used by #s<move> command to spell.") 717 "The tags file used by Viper."
609 718 :type 'string
610 (defvar vip-tags-file-name "TAGS" 719 :group 'viper)
611 "The tags file used by Viper.")
612 720
613 ;; Indicates if we are in the middle of executing a command that takes another 721 ;; Indicates if we are in the middle of executing a command that takes another
614 ;; command as an argument, e.g., cw, dw, etc. 722 ;; command as an argument, e.g., cw, dw, etc.
615 (defvar vip-inside-command-argument-action nil) 723 (defvar vip-inside-command-argument-action nil)
616 724
617 ;; Minibuffer 725 ;; Minibuffer
618 726
619 (defvar vip-vi-style-in-minibuffer t 727 (defcustom vip-vi-style-in-minibuffer t
620 "If t, use vi-style editing in minibuffer. 728 "If t, use vi-style editing in minibuffer.
621 Should be set in `~/.vip' file.") 729 Should be set in `~/.vip' file."
730 :type 'boolean
731 :group 'viper)
622 732
623 ;; overlay used in the minibuffer to indicate which state it is in 733 ;; overlay used in the minibuffer to indicate which state it is in
624 (vip-deflocalvar vip-minibuffer-overlay nil) 734 (vip-deflocalvar vip-minibuffer-overlay nil)
625 735
626 ;; Hook, specific to Viper, which is run just *before* exiting the minibuffer. 736 ;; Hook, specific to Viper, which is run just *before* exiting the minibuffer.
638 "Mode line tag identifying the Insert mode of Viper.") 748 "Mode line tag identifying the Insert mode of Viper.")
639 (defconst vip-replace-state-id "<R> " 749 (defconst vip-replace-state-id "<R> "
640 "Mode line tag identifying the Replace mode of Viper.") 750 "Mode line tag identifying the Replace mode of Viper.")
641 751
642 752
643 (defvar vip-vi-state-hook nil 753 (defcustom vip-vi-state-hook nil
644 "*Hooks run just before the switch to Vi mode is completed.") 754 "*Hooks run just before the switch to Vi mode is completed."
645 (defvar vip-insert-state-hook nil 755 :type 'hook
646 "*Hooks run just before the switch to Insert mode is completed.") 756 :group 'viper)
647 (defvar vip-replace-state-hook nil 757 (defcustom vip-insert-state-hook nil
648 "*Hooks run just before the switch to Replace mode is completed.") 758 "*Hooks run just before the switch to Insert mode is completed."
649 (defvar vip-emacs-state-hook nil 759 :type 'hook
650 "*Hooks run just before the switch to Emacs mode is completed.") 760 :group 'viper)
651 761 (defcustom vip-replace-state-hook nil
652 (defvar vip-load-hook nil 762 "*Hooks run just before the switch to Replace mode is completed."
653 "Hooks run just after loading Viper.") 763 :type 'hook
654 764 :group 'viper)
765 (defcustom vip-emacs-state-hook nil
766 "*Hooks run just before the switch to Emacs mode is completed."
767 :type 'hook
768 :group 'viper)
769
770 (defcustom vip-load-hook nil
771 "Hooks run just after loading Viper."
772 :type 'hook
773 :group 'viper)
774
775
776 ;;; Local Variables:
777 ;;; eval: (put 'vip-deflocalvar 'lisp-indent-hook 'defun)
778 ;;; End:
779
655 ;;; viper-ex.el ends here 780 ;;; viper-ex.el ends here