Skip to content

Instantly share code, notes, and snippets.

@flarn2006
Created January 4, 2017 00:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save flarn2006/294e51853a6f07de9964f9a89cef095f to your computer and use it in GitHub Desktop.
Save flarn2006/294e51853a6f07de9964f9a89cef095f to your computer and use it in GitHub Desktop.
Patch to add vim-like cursor movement to hexedit
--- interact.c_ 2016-11-03 16:19:44.646114334 -0400
+++ interact.c 2016-11-03 16:15:20.402249954 -0400
@@ -339,6 +339,25 @@
oldbase = base;
/*printf("*******%d******\n", key);*/
+ if (hexOrAscii) {
+ /* Hex-mode-only key binds */
+ switch (key)
+ {
+ case 'l':
+ forward_char();
+ return TRUE;
+ case 'h':
+ backward_char();
+ return TRUE;
+ case 'j':
+ next_line();
+ return TRUE;
+ case 'k':
+ previous_line();
+ return TRUE;
+ }
+ }
+
switch (key)
{
case KEY_RIGHT:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment