1

does anyone know how to enable Ctrl-o to switch to normal-mode for one command in viper-mode or vimpulse? In viper-mode it's bound to open-line (which is what it does for vanilla Emacs and in vimpulse it is bound to (vimpulse-jump-backward ARG). I'm using Viper-mode + vimpulse at level 2.

hatmatrix
  • 42,883
  • 45
  • 137
  • 231

1 Answers1

1

If you're in insert-mode and want to execute one Vimpulse command :

(vimpulse-imap "\C-o" 'viper-escape-to-vi)

(it is bound by default to C-z in insert-mode)

spk
  • 584
  • 5
  • 6
  • shoot, I'd basically given up vimpulse/viper months ago when I couldn't find this... – hatmatrix May 27 '11 at 13:20
  • This only escapes to vi for a single command. That is, it says "Switched to VI state for the next command..." and indeed after you do a single command it drops you back into insert mode. Is there a better option? – Frew Schmidt Jul 01 '11 at 17:20
  • @Frew : I don't get you, Frew. Better option for? The OP only wanted to escape to VI state for a single command. I imagine you would just switch to the real VI state for longer edits :) btw, I map M-h (Meta-h or Alt-h) to viper-intercept-ESC-key so that it's as easy as possible to get back to Normal mode. `(global-set-key (kbd "M-h") 'viper-intercept-ESC-key)` – spk Jul 05 '11 at 09:14