help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Define colon commands in viper?


From: Edward O'Connor
Subject: Re: Define colon commands in viper?
Date: Wed, 04 Sep 2002 08:53:44 GMT
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2

> How do I define a colon command in viper, such that `:meep' calls
> the `ding' function, say?

There's probably a better way to do this, but here's what I do in my
.emacs file WRT :open and the like:

;; Make :o and :open work in viper. Why isn't this the default?
(defadvice ex-cmd-assoc (after ted-open-fix activate)
  "Make vi's :o and :open work correctly."
  (when (string-equal (car ad-return-value) "open")
      (setq ad-return-value
            '("open" (find-file
                      (read-file-name "Find file: "))))))

Perhaps you could do something similar for :meep, or :make?


Ted

-- 
Edward O'Connor
address@hidden


reply via email to

[Prev in Thread] Current Thread [Next in Thread]