-
Notifications
You must be signed in to change notification settings - Fork 0
/
keys.h
96 lines (83 loc) · 1.53 KB
/
keys.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#ifndef KEYS_H
#define KEYS_H
typedef union keyarg_u keyarg_u;
typedef void key_func(const keyarg_u *, unsigned repeat, const int ch);
typedef void word_func(const char *word, bool flag);
union keyarg_u
{
int i;
bool b;
struct
{
motion m;
unsigned repeat;
} motion;
struct filter_input
{
enum
{
FILTER_SELF, FILTER_CMD
} type;
char *s;
} filter;
point_t pos;
struct
{
word_func *fn;
bool flag;
} word_action;
struct
{
cmd_t fn;
const char **argv;
bool force;
} cmd;
};
typedef struct nkey_t
{
const char *str;
key_func *func;
keyarg_u arg;
enum buf_mode mode;
} nkey_t;
typedef struct motionkey_t
{
const char *keys;
motion motion;
} motionkey_t;
/* returns 0 on success */
const motion *motion_read(unsigned *repeat, bool apply_maps);
int keys_filter(
enum io io_m,
char *struc, unsigned n_ents,
unsigned st_off, unsigned st_sz,
int mode_off);
key_func k_prompt_cmd, k_docmd, k_set_mode;
key_func k_escape;
key_func k_redraw;
key_func k_scroll, k_jumpscroll;
key_func k_winsel, k_winmove, k_winabsolute;
key_func k_show, k_showch;
key_func k_open;
key_func k_del, k_change, k_yank;
key_func k_motion;
key_func k_replace;
key_func k_join;
key_func k_indent;
key_func k_put;
key_func k_case;
key_func k_filter;
key_func k_ins_colcopy;
key_func k_on_word, k_on_fname;
key_func k_normal1;
key_func k_inc_dec;
key_func k_vtoggle;
key_func k_go_visual;
key_func k_go_insert;
key_func k_go_tab;
word_func word_search;
word_func word_list;
word_func word_tag;
word_func word_man;
word_func word_gofile;
#endif