Skip to content

Instantly share code, notes, and snippets.

@ccaviness
Created November 5, 2015 19:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save ccaviness/a36f7534d9f5ef6000a1 to your computer and use it in GitHub Desktop.
Save ccaviness/a36f7534d9f5ef6000a1 to your computer and use it in GitHub Desktop.
H
/^#include/a
#include <stdlib.h>
.
/^get_history_item(/a
.
/^#ifdef *__APPLE__/c
/*
* Recent versions of libedit have corrected the off-by-one history indexes
* (though the Apple version emulates a true offset rather than using the
* event id). So we comment out the off-by-one fix.
*/
#if 0 /* __APPLE__ */
.
/^setup_readline/-1i
static char *
_dummy(const char *x, int y)
{
return NULL;
}
.
/using_history/i
rl_completion_entry_function = (Function *)_dummy;
.
/rl_initialize()/a
/* remove tab completion binding */
rl_parse_and_bind("bind ^I ed-insert");
.
/^call_readline(/a
.
/^#ifdef *__APPLE__/c
/*
* Recent versions of libedit have corrected the off-by-one history indexes
* (though the Apple version emulates a true offset rather than using the
* event id). So we comment out the off-by-one fix.
*/
#if 0 /* __APPLE__ */
.
w
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment