;ELC ;;; compiled by kwzh@hal.gnu.ai.mit.edu on Tue Apr 25 18:09:05 1995 ;;; from file /gd/gnu/emacs/19.0/lisp/vi.el ;;; emacs version 19.28.90.40. ;;; bytecomp version FSF 2.10 ;;; optimization is on. ;;; this file uses opcodes which do not exist in Emacs 18. (if (and (boundp 'emacs-version) (or (and (boundp 'epoch::version) epoch::version) (string-lessp emacs-version "19"))) (error "`/gd/gnu/emacs/19.0/lisp/vi.el' was compiled for Emacs 19")) #@92 Switch the major mode of current buffer as specified by the following char \{vi-tilde-map} (defalias 'vi-switch-mode #[(arg mode-char) " !\"Ő!! q )* \f\f\" )" [lookup-key vi-tilde-map char-to-string mode-char mode-cmd "*Help*" princ substitute-command-keys "Possible major modes to switch to: \\{vi-tilde-map}" standard-output help-mode arg prefix-arg command-execute nil force-mode-line-update] 5 (#$ . 473) "P\nc"]) (byte-code " \"\f#" [where-is-internal vi-switch-mode current-local-map define-key ctl-x-map "~"] 4) #@77 Keymap used for \[vi-switch-mode] prefix key. Link to various major modes. (defvar vi-tilde-map nil (#$ . 1037)) (byte-code "s ##################" [vi-tilde-map make-keymap define-key "a" abbrev-mode "c" c-mode "d" vi-debugging "e" emacs-lisp-mode "f" auto-fill-mode "g" prolog-mode "h" hanoi "i" info-mode "l" lisp-mode "n" nroff-mode "o" overwrite-mode "O" outline-mode "P" picture-mode "r" vi-readonly-mode "t" text-mode "v" vi-mode "x" tex-mode "~" vi-back-to-old-mode] 4) #@61 Toggle debug-on-error flag. If prefix arg is given, set t. (defalias 'vi-debugging #[(arg) " \f\n?\n!!" [arg t debug-on-error message "Debug-on-error ..." "NO more debug-on-error"] 2 (#$ . 1618) "P"]) #@64 Go back to the previous mode without setting up for insertion. (defalias 'vi-back-to-old-mode #[nil " \f! " [vi-mode-old-major-mode vi-mode-old-mode-name mode-name use-local-map vi-mode-old-local-map major-mode vi-mode-old-case-fold case-fold-search force-mode-line-update] 2 (#$ . 1843) nil]) #@40 Toggle current buffer's readonly flag. (defalias 'vi-readonly-mode #[nil "?" [buffer-read-only] 2 (#$ . 2158) nil]) #@128 Keymap used in Evi's command state Command state includes most of the vi editing commands, with some Emacs command extensions. (defvar vi-com-map nil (#$ . 2285)) (byte-code "#\f \f#\f#\f#\f#\f#\f#\f#\f#\f#\f#\f#\f#\f#\f#\f#\f#\f#\f#\f#\f#\f#\f#\f#\f#\f#\f#\f#\f#\f#\f@A#\fB#\fCD#\fEF#\fGH#\fIJ#\fKL#\fMN#\fO#\fPQ#\fRS#\fTU#\fVW#\fX#\fYZ#\f[\\#\f]^#\f_`#\fab#\fcd#\fed#\ffd#\fgd#\fhd#\fid#\fjd#\fkd#\fld#\fmn#\fop#\fqF#\frF#\fsF#\ftu#\fvw#\fxy#\fz{#\f|}#\f~#\f#\f#\f#\f#\f#\f#\f#\f#\f#\f#\f#\f#\f#\f#\f#\f#\f#\f#\f#\f#\f#\f #\f#\f#\fF#\f#\f#\f#\f#\f#\f#\fF#\fF#\f#\f#\f#\f#\f#\f#\f#\fD#\f#\f#\f#\f#\f#\f#\f#\f#\f#\f#\f#\f#\fF#\f#\f#\f#\f#\f#\f##ځ#####u##`#D#L#N#Q#S#U##\\#Z##b##p##{###############################" [put vi-undefined suppress-keymap t vi-com-map make-keymap define-key "" vi-mark-region "" vi-ask-for-info "" vi-backward-windowfull "" vi-do-old-mode-C-c-command "" vi-scroll-down-window "" vi-expose-line-below "" vi-forward-windowfull "" keyboard-quit " " indent-relative-maybe "\n" vi-next-line " " vi-kill-line "\f" recenter " " vi-next-line-first-nonwhite "" "" vi-split-open-line "" previous-line "" vi-query-replace "" vi-isearch-backward "" vi-isearch-forward "" vi-transpose-objects "" vi-scroll-up-window "" scroll-up "" vi-kill-region "" Control-X-prefix "" vi-expose-line-above "" suspend-emacs "" ESC-prefix "" vi-unimplemented "" find-tag "" vi-locate-def "" " " forward-char "!" vi-operator "\"" vi-char-argument "#" universal-argument "$" end-of-line "%" vi-find-matching-paren "&" "'" vi-goto-line-mark "(" backward-sexp ")" forward-sexp "*" vi-name-last-change-or-macro "+" "," vi-reverse-last-find-char "-" vi-previous-line-first-nonwhite "." vi-redo-last-change-command "/" vi-search-forward "0" beginning-of-line "1" vi-digit-argument "2" "3" "4" "5" "6" "7" "8" "9" ":" vi-ex-cmd ";" vi-repeat-last-find-char "<" "=" ">" "?" vi-search-backward "@" vi-call-named-change-or-macro "A" vi-append-at-end-of-line "B" vi-backward-blank-delimited-word "C" vi-change-rest-of-line "D" "E" vi-end-of-blank-delimited-word "F" vi-backward-find-char "G" vi-goto-line "H" vi-home-window-line "I" vi-insert-before-first-nonwhite "J" vi-join-lines "K" "L" vi-last-window-line "M" vi-middle-window-line "N" vi-reverse-last-search "O" vi-open-above "P" vi-put-before "Q" vi-quote-words "R" vi-replace-chars "S" vi-substitute-lines "T" vi-backward-upto-char "U" "V" "W" vi-forward-blank-delimited-word "X" call-last-kbd-macro "Y" vi-yank-line "Z" make-sparse-keymap "ZZ" vi-save-all-and-exit "[" "\\" "]" "^" back-to-indentation "_" "`" vi-goto-char-mark "a" vi-insert-after "b" backward-word "c" "d" "e" vi-end-of-word "f" vi-forward-find-char "g" vi-beginning-of-buffer "h" backward-char "i" vi-insert-before "j" "k" "l" "m" vi-set-mark "n" vi-repeat-last-search "o" vi-open-below "p" vi-put-after "q" vi-replace "r" vi-replace-1-char "s" vi-substitute-chars "t" vi-forward-upto-char "u" undo "v" vi-verify-spelling "w" vi-forward-word "x" vi-kill-char "y" "z" vi-adjust-window "{" backward-paragraph "|" vi-goto-column "}" forward-paragraph "~" vi-change-case "" delete-backward-char point-moving-unit char line next-line forward-line search match sexp rev-find vi-re-search-forward find vi-re-search-backward WORD rev-search word vi-forward-char paragraph mark-page region mark-paragraph mark-word mark-sexp mark-defun mark-whole-buffer mark-end-of-sentence mark-c-function] 4) #@57 Alist of (NAME . MARK), marks are local to each buffer. (defvar vi-mark-alist nil (#$ . 7102)) #@49 Default amount of lines for scrolling (used by  (defvar vi-scroll-amount (byte-code " " [window-height 2] 2) (#$ . 7203) ^D "/" ^U ").") #@19 Shift amount for  (defvar vi-shift-width 4 (#$ . 7350) < "/" > " operators.") #@51 Last insertion point. Should use 'mark' instead. (defvar vi-ins-point nil (#$ . 7434)) #@27 Length of last insertion. (defvar vi-ins-length nil (#$ . 7528)) #@45 The repetition required for last insertion. (defvar vi-ins-repetition nil (#$ . 7599)) #@45 T if last insertion was a replace actually. (defvar vi-ins-overwrt-p nil (#$ . 7692)) #@52 Code to be eval'ed before (redo-)insertion begins. (defvar vi-ins-prefix-code nil (#$ . 7784)) #@64 Save last direction, char and upto-flag used for char finding. (defvar vi-last-find-char nil (#$ . 7885)) #@111 Save commands for redoing last changes. Each command is in (FUNC . ARGS) form that is ready to be 'apply'ed. (defvar vi-last-change-command nil (#$ . 7998)) #@49 Save last shell command given for "!" operator. (defvar vi-last-shell-command nil (#$ . 8162)) #@29 T if it is in insert state. (defvar vi-insert-state nil (#$ . 8263)) #@45 Save last search command for possible redo. (defvar vi-search-last-command nil (#$ . 8338)) #@50 Save the local-map used before entering vi-mode. (defvar vi-mode-old-local-map nil (#$ . 8436)) #@45 Save the mode-name before entering vi-mode. (defvar vi-mode-old-mode-name nil (#$ . 8538)) #@46 Save the major-mode before entering vi-mode. (defvar vi-mode-old-major-mode nil (#$ . 8635)) (byte-code "! B‡" [boundp vi-mode-old-case-fold nil current-load-list] 2) #@74 Setup a buffer for vi-mode by creating necessary buffer-local variables. (defalias 'vi-mode-setup #[nil "! å!!!!!!!!!!!!!!!!" [make-local-variable vi-scroll-amount window-height 2 vi-shift-width 4 vi-ins-point vi-ins-length vi-ins-repetition vi-ins-overwrt-p vi-ins-prefix-code vi-last-change-command vi-last-shell-command vi-last-find-char vi-mark-alist vi-insert-state vi-mode-old-local-map vi-mode-old-mode-name vi-mode-old-major-mode vi-mode-old-case-fold run-hooks vi-mode-hook] 2 (#$ . 8818)]) #@2275 Major mode that acts like the `vi' editor. The purpose of this mode is to provide you the combined power of vi (namely, the "cross product" effect of commands and repeat last changes) and Emacs. This command redefines nearly all keys to look like vi commands. It records the previous major mode, and any vi command for input (`i', `a', `s', etc.) switches back to that mode. Thus, ordinary Emacs (in whatever major mode you had been using) is "input" mode as far as vi is concerned. To get back into vi from "input" mode, you must issue this command again. Therefore, it is recommended that you assign it to a key. Major differences between this mode and real vi : * Limitations and unsupported features - Search patterns with line offset (e.g. /pat/+3 or /pat/z.) are not supported. - Ex commands are not implemented; try ':' to get some hints. - No line undo (i.e. the 'U' command), but multi-undo is a standard feature. * Modifications - The stopping positions for some point motion commands (word boundary, pattern search) are slightly different from standard 'vi'. Also, no automatic wrap around at end of buffer for pattern searching. - Since changes are done in two steps (deletion then insertion), you need to undo twice to completely undo a change command. But this is not needed for undoing a repeated change command. - No need to set/unset 'magic', to search for a string with regular expr in it just put a prefix arg for the search commands. Replace cmds too. - ^R is bound to incremental backward search, so use ^L to redraw screen. * Extensions - Some standard (or modified) Emacs commands were integrated, such as incremental search, query replace, transpose objects, and keyboard macros. - In command state, ^X links to the 'ctl-x-map', and ESC can be linked to esc-map or set undefined. These can give you the full power of Emacs. - See vi-com-map for those keys that are extensions to standard vi, e.g. `vi-name-last-change-or-macro', `vi-verify-spelling', `vi-locate-def', `vi-mark-region', and 'vi-quote-words'. Some of them are quite handy. - Use \[vi-switch-mode] to switch among different modes quickly. Syntax table and abbrevs while in vi mode remain as they were in Emacs. (defalias 'vi-mode #[nil " \n= \"  \n\n \f ! 8 " [vi-mode-old-major-mode vi-mode-setup major-mode vi-mode message "Already in vi-mode." ding current-local-map vi-mode-old-local-map mode-name vi-mode-old-mode-name case-fold-search vi-mode-old-case-fold nil use-local-map vi-com-map "VI" force-mode-line-update vi-insert-state vi-end-of-insert-state] 3 (#$ . 9382) nil]) #@8 Ding ! (defalias 'vi-ding #[nil " " [ding] 1 (#$ . 12071) nil]) #@61 Save all modified buffers without asking, then exits emacs. (defalias 'vi-save-all-and-exit #[nil "! " [save-some-buffers t kill-emacs] 2 (#$ . 12143) nil]) (byte-code "! B! B‡" [boundp vi-replaced-string nil current-load-list vi-replacing-string] 2) #@495 Ex commands are not implemented in Evi mode. For some commonly used ex commands, you can use the following alternatives for similar effect : w C-x C-s (save-buffer) wq C-x C-c (save-buffers-kill-emacs) w fname C-x C-w (write-file) e fname C-x C-f (find-file) r fname C-x i (insert-file) s/old/new use q (vi-replace) to do unconditional replace use C-q (vi-query-replace) to do query replace set sw=n M-x set-variable vi-shift-width n  (defalias 'vi-ex-cmd #[nil "!!\fq )" ["*Help*" princ documentation vi-ex-cmd standard-output help-mode] 4 (#$ . 12425) nil]) (defalias 'vi-undefined #[nil " !\" " [message "Command key \"%s\" is undefined in Evi." single-key-description last-command-char ding] 4 nil nil]) (defalias 'vi-unimplemented #[nil " !\" " [message "Command key \"%s\" is not implemented in Evi." single-key-description last-command-char ding] 4 nil nil]) #@291 Go into insert state, the text entered will be repeated if REPETITION > 1. If PREFIX-CODE is given, do it before insertion begins if DO-IT-NOW-P is T. In any case, the prefix-code will be done before each 'redo-insert'. This function expects 'overwrite-mode' being set properly beforehand. (defalias 'vi-goto-insert-state #[(repetition &optional prefix-code do-it-now-p) " \n@\nA\"`\f\n \n\f!  Љ" [do-it-now-p apply prefix-code vi-ins-point repetition vi-ins-repetition vi-ins-prefix-code vi-mode-old-mode-name mode-name vi-mode-old-case-fold case-fold-search use-local-map vi-mode-old-local-map vi-mode-old-major-mode major-mode force-mode-line-update t vi-insert-state] 3 (#$ . 13380)]) #@53 Terminate insertion and set up last change command. (defalias 'vi-end-of-insert-state #[nil "`W`U \nX!\nV7`{\nV6c\nS&)`\n %!" [vi-ins-point vi-ins-prefix-code vi-ins-repetition 0 vi-goto-command-state t 1 str vi-set-last-change-command vi-first-redo-insertion overwrite-mode] 7 (#$ . 14102)]) #@148 Redo last insertion the first time. Extract the string and save it for future redoes. Do prefix-code if it's given, use overwrite mode if asked. (defalias 'vi-first-redo-insertion #[(begin end &optional overwrite-p prefix-code) " {  @ A\" ``\nG\\|\nc\n $)" [begin end str prefix-code apply overwrite-p vi-set-last-change-command vi-more-redo-insertion] 5 (#$ . 14444)]) #@135 Redo more insertion : copy string from STR to point, use overwrite mode if overwrite-p is T; apply prefix-code first if it's non-nil. (defalias 'vi-more-redo-insertion #[(str &optional overwrite-p prefix-code) " @A\"\n`` G\\| c" [prefix-code apply overwrite-p str] 3 (#$ . 14839)]) #@87 Go to vi-mode command state. If optional arg exists, means return from insert state. (defalias 'vi-goto-command-state #[(&optional from-insert-state-p) " !\f !" [use-local-map vi-com-map nil vi-insert-state from-insert-state-p overwrite-mode 0] 2 (#$ . 15139)]) #@68 kill specified number of lines (=d$), text saved in the kill ring. (defalias 'vi-kill-line #[(arg) " ! \"" [kill-line arg vi-set-last-change-command] 3 (#$ . 15421) "*P"]) (defalias 'vi-kill-region #[(start end) " \n\"!" [kill-region start end vi-set-last-change-command] 3 nil "*r"]) #@53 go to end of line and then go into vi insert state. (defalias 'vi-append-at-end-of-line #[(arg) " #" [vi-goto-insert-state arg (end-of-line) t] 4 (#$ . 15722) "*p"]) #@46 Change the rest of (ARG) lines (= c$ in vi). (defalias 'vi-change-rest-of-line #[(arg) " D#" [vi-goto-insert-state 1 kill-line arg t] 4 (#$ . 15898) "*P"]) #@14 (= ^i in vi) (defalias 'vi-insert-before-first-nonwhite #[(arg) " #" [vi-goto-insert-state arg (back-to-indentation) t] 4 (#$ . 16065) "*p"]) #@61 open new line(s) above current line and enter insert state. (defalias 'vi-open-above #[(arg) " D#" [vi-goto-insert-state 1 #[(x) "y\n!" [0 open-line x] 2] arg t] 4 (#$ . 16217) "*p"]) #@60 open new line(s) and go into insert mode on the last line. (defalias 'vi-open-below #[(arg) " D#" [vi-goto-insert-state 1 #[(x) " \n! \ny" [nil open-line x] 2] arg t] 4 (#$ . 16416) "*p"]) #@37 start vi insert state after cursor. (defalias 'vi-insert-after #[(arg) " C#" [vi-goto-insert-state arg #[nil "l?u" [nil] 1] t] 4 (#$ . 16624) "*p"]) #@39 enter insert state before the cursor. (defalias 'vi-insert-before #[(arg) " !" [vi-goto-insert-state arg] 2 (#$ . 16788) "*p"]) #@19 Go to ARGth line. (defalias 'vi-goto-line #[(arg) " ! !!" [vi-raw-numeric-prefix arg end-of-buffer goto-line vi-prefix-numeric-value] 3 (#$ . 16924) "P"]) #@48 Move point to the beginning of current buffer. (defalias 'vi-beginning-of-buffer #[nil "eb" [] 1 (#$ . 17095) nil]) #@68 Incremental search forward. Use regexp version if ARG is non-nil. (defalias 'vi-isearch-forward #[(arg) " `\f! `U?#Ƃ lj*" [arg isearch-forward-regexp isearch-forward opoint scmd call-interactively re-search-forward search-forward vi-search-last-command] 2 (#$ . 17218) "P"]) #@69 Incremental search backward. Use regexp version if ARG is non-nil. (defalias 'vi-isearch-backward #[(arg) " `\f! `U?#Ƃ lj*" [arg isearch-backward-regexp isearch-backward opoint scmd call-interactively re-search-backward search-backward vi-search-last-command] 2 (#$ . 17523) "P"]) #@70 Nonincremental search forward. Use regexp version if ARG is non-nil. (defalias 'vi-search-forward #[(arg string) " \fGV\f lj$" [arg re-search-forward search-forward vi-search-last-command string 0 search-last-string nil 1] 5 (#$ . 17834) (byte-code " \"D\"D" [current-prefix-arg t read-string "regexp/" nil "/"] 4)]) #@72 Nonincremental search backward. Use regexp version if ARG is non-nil. (defalias 'vi-search-backward #[(arg string) " \fGV\f lj$" [arg re-search-backward search-backward vi-search-last-command string 0 search-last-string nil 1] 5 (#$ . 18189) (byte-code " \"D\"D" [current-prefix-arg t read-string "regexp?" nil "?"] 4)]) #@112 Repeat last search command. If optional search-command/string are given, use those instead of the ones saved. (defalias 'vi-repeat-last-search #[(arg &optional search-command search-string) " \n\f  \"\nlj$" [search-command vi-search-last-command search-string search-last-string message "No last search command to repeat." ding nil arg] 5 (#$ . 18550) "p"]) #@124 Redo last search command in reverse direction. If the optional search args are given, use those instead of the ones saved. (defalias 'vi-reverse-last-search #[(arg &optional search-command search-string) " \n\f  \"= Ȃ;=*ǂ;=4ʂ;=;\nˉ\f$" [search-command vi-search-last-command search-string search-last-string message "No last search command to repeat." ding re-search-forward re-search-backward search-forward search-backward nil arg] 5 (#$ . 18936) "p"]) #@72 join ARG lines from current line (default 2), cleaning up white space. (defalias 'vi-join-lines #[(arg) " ! !\" !Y\"! S \"" [vi-raw-numeric-prefix arg delete-indentation t vi-prefix-numeric-value count 2 vi-set-last-change-command vi-join-lines] 4 (#$ . 19439) "P"]) #@53 kill the current line. Only works in insert state. (defalias 'vi-backward-kill-line #[nil "??\fy!" [vi-insert-state 0 kill-line nil] 2 (#$ . 19737) nil]) #@70 abort insert state, kill inserted text and go back to command state. (defalias 'vi-abort-ins #[nil "??` V `\"!" [vi-insert-state vi-ins-point kill-region vi-goto-command-state t] 3 (#$ . 19906) nil]) #@45 Backward COUNT windowfulls. Default is one. (defalias 'vi-backward-windowfull #[(count) "V!S" [count 0 scroll-down nil] 3 (#$ . 20124) "p"]) #@152 Scrolls down window COUNT lines. If COUNT is nil (actually, non-integer), scrolls default amount. The given COUNT is remembered for future scrollings. (defalias 'vi-scroll-down-window #[(count) " !" [count vi-scroll-amount scroll-up] 2 (#$ . 20287) "P"]) #@72 Expose COUNT more lines below the current window. Default COUNT is 1. (defalias 'vi-expose-line-below #[(count) " !" [scroll-up count] 2 (#$ . 20557) "p"]) #@44 Forward COUNT windowfulls. Default is one. (defalias 'vi-forward-windowfull #[(count) "V!S" [count 0 scroll-up nil] 3 (#$ . 20722) "p"]) #@54 Go down count lines, try to keep at the same column. (defalias 'vi-next-line #[(count) "` !\n`U " [next-line this-command line-move count ding last-command] 3 (#$ . 20880) "p"]) #@48 Go down COUNT lines. Stop at first non-white. (defalias 'vi-next-line-first-nonwhite #[(count) "`y `U " [count back-to-indentation ding] 2 (#$ . 21078) "p"]) #@46 Go up COUNT lines. Stop at first non-white. (defalias 'vi-previous-line-first-nonwhite #[(count) " ! " [previous-line count back-to-indentation] 2 (#$ . 21252) "p"]) #@150 Scrolls up window COUNT lines. If COUNT is nil (actually, non-integer), scrolls default amount. The given COUNT is remembered for future scrollings. (defalias 'vi-scroll-up-window #[(count) " !" [count vi-scroll-amount scroll-down] 2 (#$ . 21430) "P"]) #@72 Expose COUNT more lines above the current window. Default COUNT is 1. (defalias 'vi-expose-line-above #[(count) " !" [scroll-down count] 2 (#$ . 21698) "p"]) #@155 Get following character (could be any CHAR) as part of the prefix argument. Possible prefix-arg cases are NIL, INTEGER, (NIL . CHAR) or (INTEGER . CHAR). (defalias 'vi-char-argument #[(arg) " \n B\"\n\n B\"\n@ B)" [read-char char arg nil prefix-arg] 2 (#$ . 21866) "P"]) #@125 Go to marked position or line (if line-flag is given). Goto mark '@' means jump into and pop the top mark on the mark ring. (defalias 'vi-goto-mark #[(mark-char &optional line-flag) " \n\" \fC \"#!\fC !\n4 \"B!\nb\fB )" [char-equal mark-char last-command-char exchange-point-and-mark line-flag back-to-indentation 64 set-mark-command t vi-get-mark mark message "Mark register undefined." vi-ding nil] 4 (#$ . 22165)]) #@58 Go to the line (at first non-white) marked by next char. (defalias 'vi-goto-line-mark #[(char) " \"" [vi-goto-mark char t] 3 (#$ . 22631) "c"]) #@51 Go to the char position marked by next mark-char. (defalias 'vi-goto-char-mark #[(char) " !" [vi-goto-mark char] 2 (#$ . 22784) "c"]) #@30 Set numeric prefix argument. (defalias 'vi-digit-argument #[(arg) "!! _! @%Ă'@_AB" [arg digit-argument nil prefix-arg 1] 2 (#$ . 22926) "P"]) #@55 Return the raw value of numeric part prefix argument. (defalias 'vi-raw-numeric-prefix #[(arg) ":@" [arg] 1 (#$ . 23106)]) #@148 Return numeric meaning of the raw prefix argument. This is a modification to the standard one provided in `callint.c' to handle (_ . CHAR) cases. (defalias 'vi-prefix-numeric-value #[(arg) " :@@" [arg 1] 1 (#$ . 23244)]) #@118 Reverse last f F t T operation COUNT times. If the optional FIND-ARG is given, it is used instead of the saved one. (defalias 'vi-reverse-last-find-char #[(count &optional find-arg) "  \"@[AB\"" [find-arg vi-last-find-char message "No last find char to repeat." ding vi-find-char count] 3 (#$ . 23497) "p"]) #@144 Find in DIRECTION (1/-1) for CHAR of COUNT'th times on current line. If UPTO-FLAG is T, stop before the char. ARG = (DIRECTION.CHAR.UPTO-FLAG. (defalias 'vi-find-char #[(arg count) "@A@AA` \\ƍ\fb ," [arg direction char upto-flag pos exit-find-char (byte-code "f \"Df\"\"Df\"DSUD A\nZB\"\n\\" [pos throw exit-find-char nil char-equal 10 char count 0 upto-flag direction] 5) ding] 2 (#$ . 23832)]) #@113 Repeat last f F t T operation COUNT times. If optional FIND-ARG is given, it is used instead of the saved one. (defalias 'vi-repeat-last-find-char #[(count &optional find-arg) "  \"\"" [find-arg vi-last-find-char message "No last find char to repeat." ding vi-find-char count] 3 (#$ . 24307) "p"]) #@50 Find the COUNT'th CHAR backward on current line. (defalias 'vi-backward-find-char #[(count char) " BB !" [-1 char nil vi-last-find-char vi-repeat-last-find-char count] 3 (#$ . 24630) "p\nc"]) #@49 Find the COUNT'th CHAR forward on current line. (defalias 'vi-forward-find-char #[(count char) " BB !" [1 char nil vi-last-find-char vi-repeat-last-find-char count] 3 (#$ . 24833) "p\nc"]) #@55 Find upto the COUNT'th CHAR backward on current line. (defalias 'vi-backward-upto-char #[(count char) " BB !" [-1 char t vi-last-find-char vi-repeat-last-find-char count] 3 (#$ . 25033) "p\nc"]) #@54 Find upto the COUNT'th CHAR forward on current line. (defalias 'vi-forward-upto-char #[(count char) " BB !" [1 char t vi-last-find-char vi-repeat-last-find-char count] 3 (#$ . 25239) "p\nc"]) #@92 Move forward until encountering the end of a word. With argument, do this that many times. (defalias 'vi-end-of-word #[(count) "mu\f$ " [nil re-search-forward "\\W*\\w+\\>" t count backward-char] 5 (#$ . 25442) "p"]) #@56 Replace char after point by CHAR. Repeat COUNT times. (defalias 'vi-replace-1-char #[(count char) " \"  ! #" [delete-char count nil char last-command-char self-insert-command vi-set-last-change-command vi-replace-1-char] 4 (#$ . 25679) "p\nc"]) #@30 Replace chars over old ones. (defalias 'vi-replace-chars #[(arg) "! !" [overwrite-mode 1 vi-goto-insert-state arg] 2 (#$ . 25941) "*p"]) #@64 Substitute COUNT chars by the input chars, enter insert state. (defalias 'vi-substitute-chars #[(count) " D#" [vi-goto-insert-state 1 #[(c) "``\\|" [c] 3] count t] 4 (#$ . 26089) "*p"]) #@56 Substitute COUNT lines by the input chars. (=cc in vi) (defalias 'vi-substitute-lines #[(count) "\fSE#" [vi-goto-insert-state 1 vi-delete-op next-line count t] 5 (#$ . 26288) "*p"]) #@51 Get the char part of the current prefix argument. (defalias 'vi-prefix-char-value #[(arg) " :A" [arg nil] 1 (#$ . 26482)]) #@120 Handling vi operators (d/c//!/=/y). Current implementation requires the key bindings of the operators being fixed. (defalias 'vi-operator #[(arg) "" [vi-exit-op (byte-code " \f!\"= *! \f!\" \"B  !S !B#I  #)" [last-command-char this-op-char read-char lookup-key vi-com-map char-to-string this-command vi-digit-argument arg prefix-arg char-equal vi-execute-op next-line vi-prefix-numeric-value vi-prefix-char-value] 7)] 2 (#$ . 26632) "P"]) #@120 Execute vi edit operator as specified by OP-CHAR, the operand is the region determined by the MOTION-COMMAND with ARG. (defalias 'vi-execute-op #[(op-char motion-command arg) "U \f\" !\f#U- \f\" !\fE#UB \f\" !\f#UY \f\" !\f$Ut \f[# !\f[$U \f# !\f$U \f\" !\f#U \f\"" [op-char 100 vi-delete-op motion-command arg vi-set-last-change-command vi-repeat-command-of 99 vi-goto-insert-state 1 nil 121 vi-yank-op 33 vi-shell-op vi-last-shell-command 60 vi-shift-op vi-shift-width 62 61 vi-indent-op 92 vi-narrow-op] 5 (#$ . 27133)]) #@48 Return the command for redo the given command. (defalias 'vi-repeat-command-of #[(command) "N=Ă\n=Ƃ)" [command point-moving-unit cmd-type search vi-repeat-last-search find vi-repeat-last-find-char] 3 (#$ . 27769)]) #@158 Return (begin . end) of the range spanned by executing the given MOTION-COMMAND with ARG. MOTION-COMMAND in ready-to-eval list form is not yet supported. (defalias 'vi-effective-range #[(motion-command arg) "` N` \"`\fU) =)\fB =7 5``XC`I` =U =[ Tw =wby` b!y` dVd B-" [nil motion-command point-moving-unit moving-unit opoint end begin arg prefix-arg command-execute line region mark match find 0 next-line 1] 5 (#$ . 28011)]) #@52 Delete range specified by MOTION-COMMAND with ARG. (defalias 'vi-delete-op #[(motion-command arg) " \n\"@ A\f U?I\n!&\f \"HY@X@\f $H\f $," [vi-effective-range motion-command arg range begin end nil reg vi-prefix-char-value kill-region 65 90 append-to-register t copy-to-register] 6 (#$ . 28524)]) #@64 Yank (in vi sense) range specified by MOTION-COMMAND with ARG. (defalias 'vi-yank-op #[(motion-command arg) " \n\"@ A\f U?I\n!&\f \"HY@X@\f $H\f $," [vi-effective-range motion-command arg range begin end nil reg vi-prefix-char-value copy-region-as-kill 65 90 append-to-register copy-to-register t] 6 (#$ . 28872)]) #@44 Yank (in vi sense) lines (= `yy' command). (defalias 'vi-yank-line #[(arg) " !S !B \" #" [vi-prefix-numeric-value arg vi-prefix-char-value vi-yank-op next-line vi-set-last-change-command] 4 (#$ . 29238) "*P"]) #@118 See if STRING ends with a newline char. Used in checking whether the yanked text should be put back as lines or not. (defalias 'vi-string-end-with-nl-p #[(string) "GSHU" [string 10] 2 (#$ . 29467)]) #@210 Put yanked (in vi sense) text back before/above cursor. If a numeric prefix value (currently it should be >1) is given, put back text as lines. If the optional after-p is given, put after/below the cursor. (defalias 'vi-put-before #[(arg &optional after-p) " !#\fW\fV#\f!#\f\"\f)\fYA\fXA \fZ\"R\f!;N\f!R\f\" !nh!yvyvvu`! c #*" [vi-prefix-char-value arg nil put-text reg 49 57 get-register error "Nothing in register %c" yank this-command current-kill do-not-rotate "Register %c is not containing text string" vi-string-end-with-nl-p after-p next-line 1 0 push-mark exchange-point-and-mark vi-set-last-change-command vi-put-before] 5 (#$ . 29677) "P"]) #@56 Put yanked (in vi sense) text back after/below cursor. (defalias 'vi-put-after #[(arg) " \"" [vi-put-before arg t] 3 (#$ . 30421) "P"]) #@229 Perform shell command (as filter). Performs command on range specified by MOTION-COMMAND with ARG. If SHELL-COMMAND is not given, ask for one from minibuffer. If char argument is given, it directs the output to a *temp* buffer. (defalias 'vi-shell-op #[(motion-command arg &optional shell-command) " \n\"@ A\f U?, \"\n\f \n!?$+" [vi-effective-range motion-command arg range begin end shell-command read-string "!" nil vi-last-shell-command shell-command-on-region vi-prefix-char-value t] 7 (#$ . 30567)]) #@202 Perform shift command on range specified by MOTION-COMMAND with ARG for AMOUNT on each line. Negative amount means shift left. SPECIAL FEATURE: char argument can be used to specify shift amount(1-9). (defalias 'vi-shift-op #[(motion-command arg amount) " \n\"@ A\f U?6\n!.V'\n!Z,\n!Z\f #+" [vi-effective-range motion-command arg range begin end vi-prefix-char-value amount 0 48 indent-rigidly t] 5 (#$ . 31104)]) #@71 Perform indent command on range specified by MOTION-COMMAND with ARG. (defalias 'vi-indent-op #[(motion-command arg) " \n\"@ A\f U?\f #+" [vi-effective-range motion-command arg range begin end indent-region nil t] 5 (#$ . 31553)]) #@56 Narrow to region specified by MOTION-COMMAND with ARG. (defalias 'vi-narrow-op #[(motion-command arg) " \n\"@ A\f U?\f }," [vi-effective-range motion-command arg range begin end nil reg] 4 (#$ . 31803)]) #@70 Return contents of vi mark register named CHAR, or nil if undefined. (defalias 'vi-get-mark #[(char) " A" [char vi-mark-alist] 2 (#$ . 32025)]) #@107 Set contents of vi mark register named CHAR to current point. '@' is the special anonymous mark register. (defalias 'vi-set-mark #[(char) " \" ! A`ē) `!B B)" [char-equal char 64 set-mark-command nil vi-mark-alist aelt copy-marker] 4 (#$ . 32179) "c"]) #@52 Locate the matching paren. It's a hack right now. (defalias 'vi-find-matching-paren #[nil "!!!!u! " [looking-at "[[({]" forward-sexp 1 backward-char "[])}]" backward-sexp ding] 2 (#$ . 32464) nil]) #@39 Backward COUNT blank-delimited words. (defalias 'vi-backward-blank-delimited-word #[(count) "\f$o?u" [re-search-backward "[ \n`][^ \n`]+" nil t count 1] 5 (#$ . 32692) "p"]) #@38 Forward COUNT blank-delimited words. (defalias 'vi-forward-blank-delimited-word #[(count) "\f$m?!" [re-search-forward "[^ \n]*[ \n]+[^ \n]" nil t count backward-char 1] 5 (#$ . 32886) "p"]) #@58 Forward to the end of the COUNT'th blank-delimited word. (defalias 'vi-end-of-blank-delimited-word #[(count) "\f$m?!" [re-search-forward "[^ \n']+[ \n']" nil t count backward-char 2] 5 (#$ . 33098) "p"]) #@59 To window home or arg'th line from the top of the window. (defalias 'vi-home-window-line #[(arg) " S! " [move-to-window-line arg back-to-indentation] 2 (#$ . 33323) "p"]) #@67 To window last line or arg'th line from the bottom of the window. (defalias 'vi-last-window-line #[(arg) " [! " [move-to-window-line arg back-to-indentation] 2 (#$ . 33504) "p"]) #@35 To the middle line of the window. (defalias 'vi-middle-window-line #[nil "! " [move-to-window-line nil back-to-indentation] 2 (#$ . 33693) nil]) #@57 Stop at the beginning of the COUNT'th words from point. (defalias 'vi-forward-word #[(count) "\f$ Ç " [re-search-forward "\\w*\\W+\\<" nil t count vi-ding] 5 (#$ . 33849) "p"]) #@48 Set (FUN . ARGS) as the `last-change-command'. (defalias 'vi-set-last-change-command #[(fun &rest args) " B" [fun args vi-last-change-command] 2 (#$ . 34041)]) #@131 Redo last change command COUNT times. If the optional COMMAND is given, it is used instead of the current `last-change-command'. (defalias 'vi-redo-last-change-command #[(count &optional command) " !\fV\"@A\"\fS" [command vi-last-change-command message "No last change command available." count 0 apply] 4 (#$ . 34212) "p"]) #@38 Kill COUNT chars from current point. (defalias 'vi-kill-char #[(count) " \" #" [delete-char count t vi-set-last-change-command] 4 (#$ . 34569) "*p"]) #@233 Transpose objects. The following char specifies unit of objects to be transposed -- "c" for chars, "l" for lines, "w" for words, "s" for sexp, "p" for paragraph. For the use of the prefix-arg, refer to individual functions called. (defalias 'vi-transpose-objects #[(arg unit) " \"!  # \"!! \"/!! \"=!! \"K!! \"Y!!\"" [char-equal unit 63 message "Transpose: c(har), l(ine), p(aragraph), s(-exp), w(ord)," read-char vi-set-last-change-command vi-transpose-objects arg 99 transpose-chars 108 transpose-lines vi-prefix-numeric-value 112 transpose-paragraphs 115 transpose-sexps 119 transpose-words] 4 (#$ . 34733) "*P\nc"]) #@54 Query replace, use regexp version if ARG is non-nil. (defalias 'vi-query-replace #[(arg) "  \")" [arg query-replace-regexp query-replace rcmd call-interactively nil] 3 (#$ . 35424) "*P"]) #@56 Replace strings, use regexp version if ARG is non-nil. (defalias 'vi-replace #[(arg) "  \")" [arg replace-regexp replace-string rcmd call-interactively nil] 3 (#$ . 35630) "*P"]) #@59 Move current line to the top/center/bottom of the window. (defalias 'vi-adjust-window #[(arg position) " \" ! \"! \"$ ɥ!!  \"" [char-equal position 13 recenter 0 45 -1 46 window-height 2 message "Move current line to: \\r(top) -(bottom) .(middle)" read-char vi-adjust-window arg] 3 (#$ . 35827) "p\nc"]) #@41 Go to given column of the current line. (defalias 'vi-goto-column #[(col) "`y\nVlu\nS\nU)Ă.b )" [opoint 0 col 1 t ding] 3 (#$ . 36169) "p"]) #@206 Give name to the last change command or just defined kbd macro. If prefix ARG is given, name last macro, otherwise name last change command. The following CHAR will be the name for the command or macro. (defalias 'vi-name-last-change-or-macro #[(arg char) "\f\f!!! @=7 A@A@{8\n8\f\n\f$,\f!! M" [arg name-last-kbd-macro intern char-to-string char vi-last-change-command vi-first-redo-insertion args str 2 overwrite-p 3 prefix-code vi-set-last-change-command vi-more-redo-insertion] 6 (#$ . 36349) "P\nc"]) #@80 Execute COUNT times the keyboard macro definition named by the following CHAR. (defalias 'vi-call-named-change-or-macro #[(count char) "\n!!K;\n!!\f\"\f\n!!K\"" [intern char-to-string char execute-kbd-macro count vi-redo-last-change-command] 5 (#$ . 36897) "p\nc"]) #@42 Change the case of the char after point. (defalias 'vi-change-case #[(arg) "" [exit (byte-code "!`` \\\"(! `` \\\"( \" \" u" [looking-at "[a-z]" upcase-region arg "[A-Z]" downcase-region ding throw exit nil vi-set-last-change-command vi-change-case] 4)] 2 (#$ . 37182) "*p"]) #@80 Inquire status info. The next CHAR will specify the particular info requested. (defalias 'vi-ask-for-info #[(char) " \"\n \" \" !  !" [char-equal char 108 what-line 99 what-cursor-position 112 what-page message "Ask for: l(ine number), c(ursor position), p(age number)" read-char vi-ask-for-info] 3 (#$ . 37495) "c"]) #@165 Mark region appropriately. The next char REGION is d(efun),s(-exp),b(uffer), p(aragraph), P(age), f(unction in C/Pascal etc.), w(ord), e(nd of sentence), l(ines). (defalias 'vi-mark-region #[(arg region) " \"\n \"! \" \"* \"6! \"@ \"L! \"X! \"d!!  \"" [char-equal region 100 mark-defun 115 mark-sexp arg 98 mark-whole-buffer 112 mark-paragraph 80 mark-page 102 mark-c-function 119 mark-word 101 mark-end-of-sentence 108 vi-mark-lines message "Mark: d(efun),s(-exp),b(uf),p(arag),P(age),f(unct),w(ord),e(os),l(ines)" read-char vi-mark-region] 3 (#$ . 37849) "p\nc"]) #@56 Mark NUM of lines from current line as current region. (defalias 'vi-mark-lines #[(num) "y \n" [0 push-mark num] 1 (#$ . 38501)]) #@99 Verify spelling for the objects specified by char UNIT : [b(uffer), r(egion), s(tring), w(ord) ]. (defalias 'vi-verify-spelling #[(arg unit) " \" ! \"! \"#! \".!!  \"" [arg prefix-arg char-equal unit 98 call-interactively spell-buffer 114 spell-region 115 spell-string 119 spell-word message "Spell check: b(uffer), r(egion), s(tring), w(ord)" read-char vi-verify-spelling] 3 (#$ . 38643) "P\nc"]) #@69 This is a hack for accessing mode specific C-c commands in vi-mode. (defalias 'vi-do-old-mode-C-c-command #[(arg) " !P\"Ǎ  \n \")" [lookup-key vi-mode-old-local-map "" char-to-string read-char cmd exit-vi-mode (byte-code " ‡  \")‡" [cmd ding nil vi-mode-old-case-fold case-fold-search arg prefix-arg command-execute] 3) vi-back-to-old-mode arg prefix-arg command-execute nil] 5 (#$ . 39086) "P"]) #@122 Quote ARG words from the word point is on with pattern specified by CHAR. Currently, CHAR could be [,{,(,",',`,<,*, etc. (defalias 'vi-quote-words #[(arg char) " !\"!  #!#v c \"2_ \">_ \"J_ \"V_ \"_ !u c" [string-match "[[({<\"'`*]" char-to-string char message "Enter any of [,{,(,<,\",',`,* as quoting character." read-char vi-set-last-change-command vi-quote-words arg looking-at "\\<" -1 char-equal 91 93 123 125 60 62 40 41 96 39 vi-end-of-word 1] 4 (#$ . 39524) "*p\nc"]) #@130 Locate definition in current file for the name before the point. It assumes a `(def..' always starts at the beginning of a line. (defalias 'vi-locate-def #[nil "!w`!ux`{)!eb P#?7 #!)" [nil name vi-backward-blank-delimited-word 1 "^a-zA-Z" vi-end-of-blank-delimited-word set-mark-command re-search-forward "^(def[unvarconst ]*" t message "No definition for \"%s\" in current file." ding] 4 (#$ . 40078) nil]) #@83 Insert a newline and leave point before it. With ARG, inserts that many newlines. (defalias 'vi-split-open-line #[(arg) " D#" [vi-goto-insert-state 1 #[(arg) "no?u\nV'c  c)\nS-u)" [flag -1 arg 0 10 fill-prefix 1] 3] arg t] 4 (#$ . 40528) "*p"])