Add readline and editline config files

Enable vi mode in readline and editline configs.
This commit is contained in:
Kenneth Benzie 2018-08-01 21:19:18 +01:00 committed by Benie
parent 4f08d9ee4b
commit 78004d8067
4 changed files with 31 additions and 0 deletions

View File

@ -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}

View File

@ -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

1
editrc Normal file
View File

@ -0,0 +1 @@
bind -v

13
inputrc Normal file
View File

@ -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