-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathkeymap.h
More file actions
113 lines (107 loc) · 1.78 KB
/
keymap.h
File metadata and controls
113 lines (107 loc) · 1.78 KB
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
#ifndef KEYMAP_H
#define KEYMAP_H
/* Key constants */
#ifndef CTRL
#define CTRL(x) ((x) & 0x1f)
#endif
/* Prefix state for key sequences */
enum PrefixState { PREFIX_NONE, PREFIX_CTRL_X, PREFIX_CTRL_X_R, PREFIX_META };
enum editorKey {
BACKSPACE = 127,
ARROW_LEFT = 1000,
ARROW_RIGHT,
ARROW_UP,
ARROW_DOWN,
HOME_KEY,
DEL_KEY,
END_KEY,
PAGE_UP,
PAGE_DOWN,
UNICODE,
UNICODE_ERROR,
END_OF_FILE,
BEG_OF_FILE,
QUIT,
SAVE,
COPY,
CUT,
REDO,
FORWARD_WORD,
BACKWARD_WORD,
FORWARD_PARA,
BACKWARD_PARA,
SWITCH_BUFFER,
NEXT_BUFFER,
PREVIOUS_BUFFER,
MARK_BUFFER,
DELETE_WORD,
BACKSPACE_WORD,
OTHER_WINDOW,
CREATE_WINDOW,
DESTROY_WINDOW,
DESTROY_OTHER_WINDOWS,
KILL_BUFFER,
MACRO_RECORD,
MACRO_END,
MACRO_EXEC,
ALT_0,
ALT_1,
ALT_2,
ALT_3,
ALT_4,
ALT_5,
ALT_6,
ALT_7,
ALT_8,
ALT_9,
SUSPEND,
UPCASE_WORD,
DOWNCASE_WORD,
CAPCASE_WORD,
UPCASE_REGION,
DOWNCASE_REGION,
TOGGLE_TRUNCATE_LINES,
TRANSPOSE_WORDS,
EXEC_CMD,
FIND_FILE,
WHAT_CURSOR,
PIPE_CMD,
CUSTOM_INFO_MESSAGE,
QUERY_REPLACE,
GOTO_LINE,
BACKTAB,
SWAP_MARK,
JUMP_REGISTER,
MACRO_REGISTER,
POINT_REGISTER,
NUMBER_REGISTER,
REGION_REGISTER,
INC_REGISTER,
INSERT_REGISTER,
VIEW_REGISTER,
STRING_RECT,
COPY_RECT,
KILL_RECT,
YANK_RECT,
RECT_REGISTER,
EXPAND,
UNIVERSAL_ARGUMENT,
REGEX_SEARCH_FORWARD,
REGEX_SEARCH_BACKWARD,
INSERT_FILE,
HISTORY_PREV,
HISTORY_NEXT,
YANK_POP,
};
struct editorBuffer;
struct editorMacro;
struct editorConfig;
/* Function declarations */
void editorRecordKey(int c);
void editorProcessKeypress(int c);
void editorExecMacro(struct editorMacro *macro);
void setupCommands(struct editorConfig *ed);
void runCommand(char *cmd, struct editorConfig *ed, struct editorBuffer *buf);
void executeCommand(int key);
void showPrefix(const char *prefix);
#endif /* KEYMAP_H */