⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 vi_keymap.c

📁 早期freebsd实现
💻 C
📖 第 1 页 / 共 2 页
字号:
/* vi_keymap.c -- the keymap for vi_mode in readline (). *//* Copyright (C) 1988, 1989, 1991 Free Software Foundation, Inc.   This file is part of GNU Readline, a library for reading lines   of text with interactive input and history editing.   Readline is free software; you can redistribute it and/or modify   it under the terms of the GNU General Public License as published by   the Free Software Foundation; either version 2 of the License, or   (at your option) any later version.   Readline is distributed in the hope that it will be useful,   but WITHOUT ANY WARRANTY; without even the implied warranty of   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the   GNU General Public License for more details.   You should have received a copy of the GNU General Public License   along with this program; if not, write to the Free Software   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */extern KEYMAP_ENTRY_ARRAY vi_escape_keymap;/* The keymap arrays for handling vi mode. */KEYMAP_ENTRY_ARRAY vi_movement_keymap = {  /* The regular control keys come first. */  { ISFUNC, (Function *)0x0 },		/* Control-@ */  { ISFUNC, (Function *)0x0 },		/* Control-a */  { ISFUNC, (Function *)0x0 },		/* Control-b */  { ISFUNC, (Function *)0x0 },		/* Control-c */  { ISFUNC, rl_vi_eof_maybe },		/* Control-d */  { ISFUNC, rl_emacs_editing_mode },	/* Control-e */  { ISFUNC, (Function *)0x0 },		/* Control-f */  { ISFUNC, rl_abort },			/* Control-g */  { ISFUNC, rl_rubout },		/* Control-h */  { ISFUNC, (Function *)0x0 },		/* Control-i */  { ISFUNC, rl_newline },		/* Control-j */  { ISFUNC, rl_kill_line },		/* Control-k */  { ISFUNC, rl_clear_screen },		/* Control-l */  { ISFUNC, rl_newline },		/* Control-m */  { ISFUNC, rl_get_next_history },	/* Control-n */  { ISFUNC, (Function *)0x0 },		/* Control-o */  { ISFUNC, rl_get_previous_history },	/* Control-p */  { ISFUNC, rl_quoted_insert },		/* Control-q */  { ISFUNC, rl_reverse_search_history }, /* Control-r */  { ISFUNC, rl_forward_search_history }, /* Control-s */  { ISFUNC, rl_transpose_chars },	/* Control-t */  { ISFUNC, rl_unix_line_discard },	/* Control-u */  { ISFUNC, rl_quoted_insert },		/* Control-v */  { ISFUNC, rl_unix_word_rubout },	/* Control-w */  { ISFUNC, (Function *)0x0 },		/* Control-x */  { ISFUNC, rl_yank },			/* Control-y */  { ISFUNC, (Function *)0x0 },		/* Control-z */  { ISKMAP, (Function *)vi_escape_keymap }, /* Control-[ */  { ISFUNC, (Function *)0x0 },		/* Control-\ */  { ISFUNC, (Function *)0x0 },		/* Control-] */  { ISFUNC, (Function *)0x0 },		/* Control-^ */  { ISFUNC, rl_undo_command },		/* Control-_ */  /* The start of printing characters. */  { ISFUNC, rl_forward },		/* SPACE */  { ISFUNC, (Function *)0x0 },		/* ! */  { ISFUNC, (Function *)0x0 },		/* " */  { ISFUNC, rl_vi_comment },		/* # */  { ISFUNC, rl_end_of_line },		/* $ */  { ISFUNC, rl_vi_match },		/* % */  { ISFUNC, (Function *)0x0 },		/* & */  { ISFUNC, (Function *)0x0 },		/* ' */  { ISFUNC, (Function *)0x0 },		/* ( */  { ISFUNC, (Function *)0x0 },		/* ) */  { ISFUNC, rl_vi_complete },		/* * */  { ISFUNC, rl_get_next_history},	/* + */  { ISFUNC, rl_vi_char_search },	/* , */  { ISFUNC, rl_get_previous_history },	/* - */  { ISFUNC, (Function *)0x0 },		/* . */  { ISFUNC, rl_vi_search },		/* / */  /* Regular digits. */  { ISFUNC, rl_vi_arg_digit },		/* 0 */  { ISFUNC, rl_vi_arg_digit },		/* 1 */  { ISFUNC, rl_vi_arg_digit },		/* 2 */  { ISFUNC, rl_vi_arg_digit },		/* 3 */  { ISFUNC, rl_vi_arg_digit },		/* 4 */  { ISFUNC, rl_vi_arg_digit },		/* 5 */  { ISFUNC, rl_vi_arg_digit },		/* 6 */  { ISFUNC, rl_vi_arg_digit },		/* 7 */  { ISFUNC, rl_vi_arg_digit },		/* 8 */  { ISFUNC, rl_vi_arg_digit },		/* 9 */  /* A little more punctuation. */  { ISFUNC, (Function *)0x0 },		/* : */  { ISFUNC, rl_vi_char_search },	/* ; */  { ISFUNC, (Function *)0x0 },		/* < */  { ISFUNC, rl_vi_complete },		/* = */  { ISFUNC, (Function *)0x0 },		/* > */  { ISFUNC, rl_vi_search },		/* ? */  { ISFUNC, (Function *)0x0 },		/* @ */  /* Uppercase alphabet. */  { ISFUNC, rl_vi_append_eol },		/* A */  { ISFUNC, rl_vi_prev_word},		/* B */  { ISFUNC, rl_vi_change_to },		/* C */  { ISFUNC, rl_vi_delete_to },		/* D */  { ISFUNC, rl_vi_end_word },		/* E */  { ISFUNC, rl_vi_char_search },	/* F */  { ISFUNC, rl_vi_fetch_history },	/* G */  { ISFUNC, (Function *)0x0 },		/* H */  { ISFUNC, rl_vi_insert_beg },		/* I */  { ISFUNC, (Function *)0x0 },		/* J */  { ISFUNC, (Function *)0x0 },		/* K */  { ISFUNC, (Function *)0x0 },		/* L */  { ISFUNC, (Function *)0x0 },		/* M */  { ISFUNC, rl_vi_search_again },	/* N */  { ISFUNC, (Function *)0x0 },		/* O */  { ISFUNC, rl_vi_put },		/* P */  { ISFUNC, (Function *)0x0 },		/* Q */  { ISFUNC, rl_vi_replace },		/* R */  { ISFUNC, rl_vi_subst },		/* S */  { ISFUNC, rl_vi_char_search },	/* T */  { ISFUNC, rl_revert_line },		/* U */  { ISFUNC, (Function *)0x0 },		/* V */  { ISFUNC, rl_vi_next_word },		/* W */  { ISFUNC, rl_rubout },		/* X */  { ISFUNC, rl_vi_yank_to },		/* Y */  { ISFUNC, (Function *)0x0 },		/* Z */  /* Some more punctuation. */  { ISFUNC, (Function *)0x0 },		/* [ */  { ISFUNC, rl_vi_complete },		/* \ */  { ISFUNC, (Function *)0x0 },		/* ] */  { ISFUNC, rl_vi_first_print },	/* ^ */  { ISFUNC, rl_vi_yank_arg },		/* _ */  { ISFUNC, (Function *)0x0 },		/* ` */  /* Lowercase alphabet. */  { ISFUNC, rl_vi_append_mode },	/* a */  { ISFUNC, rl_vi_prev_word },		/* b */  { ISFUNC, rl_vi_change_to },		/* c */  { ISFUNC, rl_vi_delete_to },		/* d */  { ISFUNC, rl_vi_end_word },		/* e */  { ISFUNC, rl_vi_char_search },	/* f */  { ISFUNC, (Function *)0x0 },		/* g */  { ISFUNC, rl_backward },		/* h */  { ISFUNC, rl_vi_insertion_mode },	/* i */  { ISFUNC, rl_get_next_history },	/* j */  { ISFUNC, rl_get_previous_history },	/* k */  { ISFUNC, rl_forward },		/* l */  { ISFUNC, (Function *)0x0 },		/* m */  { ISFUNC, rl_vi_search_again },	/* n */  { ISFUNC, (Function *)0x0 },		/* o */  { ISFUNC, rl_vi_put },		/* p */  { ISFUNC, (Function *)0x0 },		/* q */  { ISFUNC, rl_vi_change_char },	/* r */  { ISFUNC, rl_vi_subst },		/* s */  { ISFUNC, rl_vi_char_search },	/* t */  { ISFUNC, rl_undo_command },		/* u */  { ISFUNC, (Function *)0x0 },		/* v */  { ISFUNC, rl_vi_next_word },		/* w */  { ISFUNC, rl_vi_delete },		/* x */  { ISFUNC, rl_vi_yank_to },		/* y */  { ISFUNC, (Function *)0x0 },		/* z */  /* Final punctuation. */  { ISFUNC, (Function *)0x0 },		/* { */  { ISFUNC, rl_vi_column },		/* | */  { ISFUNC, (Function *)0x0 },		/* } */  { ISFUNC, rl_vi_change_case },	/* ~ */  { ISFUNC, rl_backward }		/* RUBOUT */};KEYMAP_ENTRY_ARRAY vi_insertion_keymap = {  /* The regular control keys come first. */  { ISFUNC, (Function *)0x0 },		/* Control-@ */  { ISFUNC, rl_insert },		/* Control-a */  { ISFUNC, rl_insert },		/* Control-b */  { ISFUNC, rl_insert },		/* Control-c */  { ISFUNC, rl_vi_eof_maybe },		/* Control-d */  { ISFUNC, rl_insert },		/* Control-e */  { ISFUNC, rl_insert },		/* Control-f */  { ISFUNC, rl_insert },		/* Control-g */  { ISFUNC, rl_rubout },		/* Control-h */  { ISFUNC, rl_complete },		/* Control-i */  { ISFUNC, rl_newline },		/* Control-j */  { ISFUNC, rl_insert },		/* Control-k */  { ISFUNC, rl_insert },		/* Control-l */  { ISFUNC, rl_newline },		/* Control-m */  { ISFUNC, rl_insert },		/* Control-n */  { ISFUNC, rl_insert },		/* Control-o */  { ISFUNC, rl_insert },		/* Control-p */  { ISFUNC, rl_insert },		/* Control-q */  { ISFUNC, rl_reverse_search_history }, /* Control-r */  { ISFUNC, rl_forward_search_history }, /* Control-s */  { ISFUNC, rl_transpose_chars },	/* Control-t */  { ISFUNC, rl_unix_line_discard },	/* Control-u */  { ISFUNC, rl_quoted_insert },		/* Control-v */  { ISFUNC, rl_unix_word_rubout },	/* Control-w */  { ISFUNC, rl_insert },		/* Control-x */  { ISFUNC, rl_yank },			/* Control-y */  { ISFUNC, rl_insert },		/* Control-z */  { ISFUNC, rl_vi_movement_mode },	/* Control-[ */  { ISFUNC, rl_insert },		/* Control-\ */  { ISFUNC, rl_insert },		/* Control-] */  { ISFUNC, rl_insert },		/* Control-^ */  { ISFUNC, rl_undo_command },		/* Control-_ */  /* The start of printing characters. */  { ISFUNC, rl_insert },		/* SPACE */  { ISFUNC, rl_insert },		/* ! */  { ISFUNC, rl_insert },		/* " */  { ISFUNC, rl_insert },		/* # */  { ISFUNC, rl_insert },		/* $ */  { ISFUNC, rl_insert },		/* % */  { ISFUNC, rl_insert },		/* & */  { ISFUNC, rl_insert },		/* ' */  { ISFUNC, rl_insert },		/* ( */  { ISFUNC, rl_insert },		/* ) */  { ISFUNC, rl_insert },		/* * */  { ISFUNC, rl_insert },		/* + */  { ISFUNC, rl_insert },		/* , */  { ISFUNC, rl_insert },		/* - */  { ISFUNC, rl_insert },		/* . */  { ISFUNC, rl_insert },		/* / */  /* Regular digits. */  { ISFUNC, rl_insert },		/* 0 */  { ISFUNC, rl_insert },		/* 1 */  { ISFUNC, rl_insert },		/* 2 */  { ISFUNC, rl_insert },		/* 3 */  { ISFUNC, rl_insert },		/* 4 */  { ISFUNC, rl_insert },		/* 5 */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -