Xref: utzoo comp.emacs:10173 comp.editors:2592 Path: utzoo!censor!geac!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!uunet!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!cbnewsh!cbnewse!danj1 From: ascott@fws214.intel.com, Dan_Jacobson@ATT.COM Newsgroups: comp.emacs,comp.editors Subject: GNU Emacs' vip-mode improvments wanted Message-ID: Date: 22 Feb 91 20:12:45 GMT Sender: danj1@cbnewse.att.com (Dan Jacobson) Reply-To: ascott@fws214.intel.com, Dan_Jacobson@ATT.COM Organization: AT&T-BL, Naperville IL, USA Lines: 172 To: ascott@fws214.intel.com In-Reply-To: <9102220143.AA23980@fws214> [This e-mail is much more appropriately answered by real VIP mode users, and as not to waste all Andy's keystrokes, I must forward it to the net... please forgive if necessary. -Dan J.] > On Thu, 21 Feb 91 17:43:17 PST, ascott@fws214.intel.com (Andy Scott ~) said: ################################# beginning of Andy's message Dan, I have been using emacs for a while (VM5.22, gnus, calc, etc.) and have noticed your plugs for it (I heartily agree, by the way.) I have vip-mode mapped to Control-Z as suggested. [^Z was a bad astetic coice if you ask me, as it usually means "suspend" in UNIX... but I'm not a VI[P] guy -Dan J.] Question: I am looking for better customization via the .vip file. Having such would help me personally, and help others migrate to the emacs environment (I like elements of both. I use emacs-mode for mail and freeform text entry, and vip-mode for heavy text editing. I'm very proficient/confortable with vi, and end up using it on the platforms here that don't have emacs yet (I use elvis on the dept laptop.) Attached at the end is my .vip file. I arranged it the way I did to document the difference between my setup and the default. My questions, which maybe could form a .vip FAQ start, if any such animal exists: Major desires: 1. I miss the strict vi "R" command a lot (see my .vip code comments); have you found a better solution? 2. :wq blows away the whole emacs session. Very nasty for the new user. Could it be changed to save-and-kill-buffer or save-and-bury-buffer? The prefix key code intimidates me. 3. ESC key annoyance. I've developed a bad habit of sometimes hitting the ESC key one time too many (just to *make sure*) in vi, and carried that over to vip. Then I end of capitalizing some entire region by mistake. Any suggestions? (Change normal emacs ESC prefix to something else locally?) Minor desires: 4. Some uses have complained that if the cursor is at the top/bottom of a window and scrolls, it scrolls by more than vi's one line. Personally, I like it, but I'd like to know how to defeat it. Things I noticed along the way: 5. Use with VM. With VM4.41 I could toggle Control-Z and the emacs mode-line would change to ** Vi **. In VM5.22 it doesn't, but seems to still work otherwise. 6. Have you or anyone else further embellished vip-mode? Thanks for listening to my drivel :-) Andy Scott ;;; .vip ;;; Customization file for EMACS vip-mode ;;; 02/13/90 A. Scott, ascott@fws214.intel.com ;;; This makes EMACs look very close to standard ;;; unix vi mode. ;;; 01/09/91 AMS Modified binding to be closer to ;;; strict vi. ;;; ;;;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. ;;; (setq vip-inhibit-startup-message t) (setq vip-shift-width 8) (setq vip-re-replace nil) (setq vip-search-wrap-around t) (setq vip-re-search nil) (setq vip-case-fold-search t) (setq vip-re-query-replace nil) (setq vip-open-with-indent t) (setq vip-tags-filename "TAGS") ;(define-key vip-mode-map "\C-h" 'vip-backward-char) (setq vip-help-in-insert-mode t) ;; The following mapping is for Emacs conformance, where ;; C-g is the standard "abort command" function (define-key vip-mode-map "\C-g" 'vip-keyboard-quit) ;default vip (define-key vip-mode-map "g" 'vip-info-on-file) ;default vip ;(define-key vip-mode-map "g" 'vip-goto-line) ;optional vip ;; The following mapping is for strict vi conformance ;(define-key vip-mode-map "\C-g" 'vip-info-on-file) ;strict vi ;(define-key vip-mode-map "g" 'vip-keyboard-quit) ;unused in vi (define-key vip-mode-map "\C-m" 'vip-next-line-at-bol) ;strict vi ;(define-key vip-mode-map "\C-m" 'vip-scroll-back) ;default vip (define-key vip-mode-map " " 'vip-forward-char) ;strict vi ;(define-key vip-mode-map " " 'vip-scroll) ;default vip (define-key vip-mode-map "s" 'vip-substitute) ;strict vi (define-key vip-mode-map "S" 'vip-substitute-line) ;strict vi ;(define-key vip-mode-map "s" 'vip-switch-to-buffer) ;default vip ;(define-key vip-mode-map "S" 'vip-switch-to-buffer-other-window) ;default vip (define-key vip-mode-map "C" 'vip-change-to-eol) ;strict vi ;(define-key vip-mode-map "C" 'vip-ctl-c-equivalent) ;default vip ;; 01/09/91 AMS - Fixing R to be like strict vi isn't easy. The ESC ;; prefix would probably have to be changed to that if it was hit ;; after R mode, it would return to command mode. Hmm, maybe this ;; means that R mode should invoke something similar to "insert ;; mode"; I should check that out sometime. I use R mode a lot in ;; real vi. R mode could also be 'overwrite-mode if ESC would ;; terminate it. ;(define-key vip-mode-map "R" 'vip-replace-string) ;default vip ;(define-key vip-mode-map "R" 'vip-change-to-eol) ;"C" in strict vi ;(define-key vip-mode-map "R" 'overwrite-mode) ;emacs mode option (define-key vip-mode-map "R" 'vip-substitute) ;closest to strict vi (define-key vip-mode-map "X" 'vip-delete-backward-char) ;strict vi ;(define-key vip-mode-map "X" 'vip-ctl-x-equivalent) ;default vip ;(define-key vip-mode-map "Q" 'vip-query-replace) ;default vip ;unused in vi ;(define-key vip-mode-map "\C-q" 'quoted-insert) ;default emacs ;(define-key vip-mode-map "\C-v" 'scroll-up) ;default vip & emacs (define-key vip-mode-map "\C-v" 'quoted-insert) ;strict vi ;; Unused in vip and available for mapping ;(define-key vip-mode-map "~" 'vip-goto-line) ;(define-key vip-mode-map "_" 'vip-goto-line) ;(define-key vip-mode-map "]" 'vip-goto-line) ;(define-key vip-mode-map "[" 'vip-goto-line) ;(define-key vip-mode-map "&" 'vip-goto-line) ;(define-key vip-mode-map "@" 'vip-goto-line) ;(define-key vip-mode-map "q" 'vip-goto-line) ;; How about unused ctl- sequences? ;Nate Hess's configuration (He was at Intel, now nhess@oracle.com) ;(define-key vip-mode-map "\C-r" 'name-last-kbd-macro) ;(define-key vip-mode-map "\C-r" 'isearch-backward) ;default emacs ;(define-key vip-mode-map "~" 'upcase-region) ;(define-key vip-mode-map "`" 'downcase-region) ;(define-key vip-mode-map "t" 'transpose-chars) ;(define-key vip-mode-map "v" 'set-mark-command) ;(define-key vip-mode-map "y" 'kill-region) ;emacs kill definition ;(define-key vip-mode-map "Y" 'yank) ;emacs yank definition ;(define-key vip-mode-map "Q" 'spell-buffer) ;(define-key vip-mode-map "F" 'fill-paragraph) ;(define-key vip-mode-map "Z" 'suspend-emacs) ;(define-key vip-mode-map "B" 'electric-buffer-list) ;(define-key vip-mode-map "M" 'rmail) ------------------------------------------------------------- Andrew M. Scott Intel Corporation, M/S FM2-26 ascott@fws214.intel.com 1900 Prairie City Road (916) 351-6369 Folsom, CA 95630, USA ################################# end of Andy's message -- Dan_Jacobson@ATT.COM Naperville IL USA +1 708-979-6364 Brought to you by Super Global Mega Corp .com