diff options
author | Kjell Wooding <kjell@cvs.openbsd.org> | 2008-08-27 04:11:53 +0000 |
---|---|---|
committer | Kjell Wooding <kjell@cvs.openbsd.org> | 2008-08-27 04:11:53 +0000 |
commit | 5866f3b4c9740559a3dafad9fc60029bd493e4ec (patch) | |
tree | a377f8f5929cae9e141f569b3a1efac134f0bdfb /usr.bin/mg | |
parent | c1b66d4ac4471c24fe8a0c19cb6205b9532fdaf1 (diff) |
add a C-c target, so we can use it as a prefix for keybindings.
Now you can do something like:
global-set-key "\^c\^c" compile
in your ~/.mg
Diffstat (limited to 'usr.bin/mg')
-rw-r--r-- | usr.bin/mg/keymap.c | 33 |
1 files changed, 26 insertions, 7 deletions
diff --git a/usr.bin/mg/keymap.c b/usr.bin/mg/keymap.c index 10ebb85ca00..4918a14007c 100644 --- a/usr.bin/mg/keymap.c +++ b/usr.bin/mg/keymap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: keymap.c,v 1.42 2008/06/14 08:46:30 kjell Exp $ */ +/* $OpenBSD: keymap.c,v 1.43 2008/08/27 04:11:52 kjell Exp $ */ /* This file is in the public domain. */ @@ -41,6 +41,18 @@ struct KEYMAPE (2 + IMAPEXT) helpmap = { }; #endif /* !NO_HELP */ +struct KEYMAPE (1 + IMAPEXT) ccmap = { + 1, + 1 + IMAPEXT, + rescan, + { + { + CCHR('@'), CCHR('@'), (PF[]){ rescan }, NULL + } + } +}; + + static PF cX4cF[] = { poptofile, /* ^f */ ctrlg /* ^g */ @@ -304,11 +316,14 @@ static PF fund_at[] = { setmark, /* ^@ */ gotobol, /* ^A */ backchar, /* ^B */ - rescan, /* ^C */ + NULL, /* ^C */ forwdel, /* ^D */ gotoeol, /* ^E */ forwchar, /* ^F */ ctrlg, /* ^G */ +}; + +static PF fund_h[] = { #ifndef NO_HELP NULL, /* ^H */ #else /* !NO_HELP */ @@ -316,6 +331,7 @@ static PF fund_at[] = { #endif /* !NO_HELP */ }; + /* ^I is selfinsert */ static PF fund_CJ[] = { lfindent, /* ^J */ @@ -357,18 +373,21 @@ static PF fund_cb[] = { #define NFUND_XMAPS 0 /* extra map sections after normal ones */ #endif -static struct KEYMAPE (5 + NFUND_XMAPS + IMAPEXT) fundmap = { - 5 + NFUND_XMAPS, - 5 + NFUND_XMAPS + IMAPEXT, +static struct KEYMAPE (6 + NFUND_XMAPS + IMAPEXT) fundmap = { + 6 + NFUND_XMAPS, + 6 + NFUND_XMAPS + IMAPEXT, selfinsert, { + { + CCHR('@'), CCHR('G'), fund_at, (KEYMAP *) & ccmap + }, #ifndef NO_HELP { - CCHR('@'), CCHR('H'), fund_at, (KEYMAP *) & helpmap + CCHR('H'), CCHR('H'), fund_h, (KEYMAP *) & helpmap }, #else /* !NO_HELP */ { - CCHR('@'), CCHR('H'), fund_at, NULL + CCHR('@'), CCHR('H'), fund_h, NULL }, #endif /* !NO_HELP */ { |