diff --git a/src/el.h b/src/el.h index c281bc0..1ce85db 100644 --- a/src/el.h +++ b/src/el.h @@ -42,7 +42,12 @@ /* * Local defaults */ +#define CUBRID_CSQL + +#ifndef CUBRID_CSQL #define KSHVI +#endif + #define VIDEFAULT #define ANCHOR diff --git a/src/map.c b/src/map.c index f72d272..d8e646d 100644 --- a/src/map.c +++ b/src/map.c @@ -384,7 +384,11 @@ static const el_action_t el_map_vi_insert[] = { /* 6 */ ED_NEXT_CHAR, /* ^F */ /* 7 */ ED_UNASSIGNED, /* ^G */ /* 8 */ VI_DELETE_PREV_CHAR, /* ^H */ /* BackSpace key */ +#ifdef CUBRID_CSQL + /* 9 */ ED_INSERT, /* ^I */ /* Tab Key */ +#else /* 9 */ ED_UNASSIGNED, /* ^I */ /* Tab Key */ +#endif /* 10 */ ED_NEWLINE, /* ^J */ /* 11 */ ED_KILL_LINE, /* ^K */ /* 12 */ ED_CLEAR_SCREEN, /* ^L */ diff --git a/src/readline.c b/src/readline.c index 2e0e2c4..391cfb9 100644 --- a/src/readline.c +++ b/src/readline.c @@ -325,12 +325,17 @@ rl_initialize(void) /* set default mode to "emacs"-style and read setting afterwards */ /* so this can be overridden */ +#ifdef CUBRID_CSQL + el_set(e, EL_EDITOR, "vi"); +#else el_set(e, EL_EDITOR, "emacs"); +#endif if (rl_terminal_name != NULL) el_set(e, EL_TERMINAL, rl_terminal_name); else el_get(e, EL_TERMINAL, &rl_terminal_name); +#ifndef CUBRID_CSQL /* * Word completion - this has to go AFTER rebinding keys * to emacs-style. @@ -339,6 +344,7 @@ rl_initialize(void) "ReadLine compatible completion function", _el_rl_complete); el_set(e, EL_BIND, "^I", "rl_complete", NULL); +#endif /* * Send TSTP when ^Z is pressed.