konr
konr

Reputation: 1194

Rebinding C-c to C-c

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!

Upvotes: 1

Views: 604

Answers (2)

Emerick Rogul
Emerick Rogul

Reputation: 6804

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").

Upvotes: 6

Trey Jackson
Trey Jackson

Reputation: 74430

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.

Upvotes: 2

Related Questions