2

I obtained a git clone of vimpulse and followed the instructions for installation. It basically says to put (require 'vimpulse) in my .emacs file - but this will start viper/vimpulse upon startup, so I tried to have vimpulse load only if I invoke viper-mode with (add-hook 'viper-mode-hook (lambda () (require 'vimpuse)). But when I do this visual mode does not work (tries to open file instead), so instead I now have something like (defun vimpulse-on () (interactive) (require 'vimpulse)). After that to toggle on and off I use C-z. Does that about sound right? So once vimpulse is loaded there's no equivalent of M-x viper-go-away and instead it's suspended until I hit C-z again... Also, any general tips with using viper/vimpulse would be appreciated! Thanks much in advance.

Edit: syntax error corrected. What I had tried was (add-hook 'viper-mode-hook (lambda () (require 'vimpulse)), which does not enable visual mode when viper-mode is started. v in normal-mode appears to be mapped to find-file (or ido-find-file).

hatmatrix
  • 42,883
  • 45
  • 137
  • 231
  • Even if I suspend vimpulse for a particular buffer `C-z`, vimpulse is enabled for new buffers by default... – hatmatrix Sep 10 '10 at 13:51
  • A feature is only loaded at the first `require'. Later `require' will do nothing if it's loaded. – Tao Peng Sep 14 '10 at 09:33
  • Yes, I call `require` only once. But it seems like I can do `C-z` to switch to vi-state and then do `M-x viper-go-away` to make it stop. – hatmatrix Sep 14 '10 at 11:16

1 Answers1

1
(add-hook 'viper-load-hook
   (lambda () (require 'vimpulse))

Just load vimpulse in the viper-load-hook.

Tao Peng
  • 2,688
  • 22
  • 20
  • Actually this is what I tried (sorry, syntax error in my post), I did add the `require` statement to `viper-mode-hook`, but then `visual-mode` does not work when `viper-mode` is enabled. And loading `vimpulse` will already load `viper-mode`. – hatmatrix Sep 14 '10 at 11:16
  • I can't find `viper-mode-hook' in my Emacs 23.2.1. Make sure you have loaded vimpulse in the right place (or manually), then check the function `vimpulse-visual-toggle-normal' which should be bound to v in vimpulse, if not found, make sure you have the latest vimpulse at http://www.emacswiki.org/emacs/vimpulse.el – Tao Peng Sep 14 '10 at 12:14