views:

141

answers:

2

Hi!

I'm using Viper, and I want to change its C-c and C-g to the original emacs functions. I can rebind C-g with (define-key viper-vi-global-user-map "C-g" 'keyboard-quit), but how can I rebind C-c, since it's a prefix key?

Thanks!

+2  A: 

The original binding for C-c can be set with the following:

(define-key viper-vi-global-user-map (kbd "C-c") 'mode-specific-command-prefix)

The info page for this is Prefix Keys.

Trey Jackson
+6  A: 

It may make sense for you to run M-x viper-set-expert-level with an argument of 2 ("Master"). As the viper-mode documentation explains:

2 -- MASTER: C-c now has its standard Emacs meaning in Vi command state, so most Emacs commands can be used when Viper is in Vi state.

As you master viper-mode, you're meant to increase your expert-level setting gradually over time, making more Emacs features available to you (or, as the Viper documentation puts it, "To use Emacs productively, you must reach level 3 or higher").

Emerick Rogul