From 78004d80676e2dd5f7458623846d8fcfd1bdbabe Mon Sep 17 00:00:00 2001 From: "Kenneth Benzie (Benie)" Date: Wed, 1 Aug 2018 21:19:18 +0100 Subject: [PATCH] Add readline and editline config files Enable vi mode in readline and editline configs. --- .conduit.yaml | 3 +++ README.md | 14 ++++++++++++++ editrc | 1 + inputrc | 13 +++++++++++++ 4 files changed, 31 insertions(+) create mode 100644 editrc create mode 100644 inputrc diff --git a/.conduit.yaml b/.conduit.yaml index 0fdb7a1..010edba 100644 --- a/.conduit.yaml +++ b/.conduit.yaml @@ -3,3 +3,6 @@ - tic xterm-256color.terminfo - tic screen-256color.terminfo - tic tmux-256color.terminfo +- symlink: + - {src: inputrc, dst: ~/.inputrc} + - {src: editrc, dst: ~/.editrc} diff --git a/README.md b/README.md index 862199b..1ae4602 100644 --- a/README.md +++ b/README.md @@ -17,5 +17,19 @@ To compile a [terminfo][terminfo] database for the current user, output to $ tic xterm-256color.terminfo ``` +## readline + +Enable vi mode in tools which use [readline][readline] e.g. [gdb][gdb], setup +vim like mappings for navigation. Settings are placed in `~/.inputrc`. + +## editline + +Enable vi mode in tools which use [editline][editline] e.g. [lldb][lldb]. +Settings are places in `~/.editrc`. + [terminfo]: https://linux.die.net/man/5/terminfo [tic]: https://linux.die.net/man/1/tic +[readline]: https://linux.die.net/man/3/readline +[gdb]: https://www.gnu.org/software/gdb +[editline]: https://linux.die.net/man/3/editline +[lldb]: https://lldb.llvm.org diff --git a/editrc b/editrc new file mode 100644 index 0000000..cf779a7 --- /dev/null +++ b/editrc @@ -0,0 +1 @@ +bind -v diff --git a/inputrc b/inputrc new file mode 100644 index 0000000..0bee929 --- /dev/null +++ b/inputrc @@ -0,0 +1,13 @@ +# Enable vi mode +set editing-mode vi + +# Normal mode mappings +set keymap vi-command +"gg": beginning-of-history +"G": end-of-history + +# Insert mode mappings +set keymap vi-insert +"\C-[": vi-movement-mode +"\C-p": history-search-backward +"\C-n": history-search-forward