Added inputrc/readline config master
authorCian Bagshaw <cian@cianb.xyz>
Wed, 25 Sep 2024 22:27:23 +0000 (23:27 +0100)
committerCian Bagshaw <cian@cianb.xyz>
Wed, 25 Sep 2024 22:27:23 +0000 (23:27 +0100)
Buffered line input using GNU Readline is now configured globally.

Also, fixed Python Shell Readline history, so it is available for the current
session, though still not saved after that.

.bashrc
.config/python
.config/readline [new file with mode: 0644]
.profile

diff --git a/.bashrc b/.bashrc
index c68d549..318535f 100644 (file)
--- a/.bashrc
+++ b/.bashrc
@@ -21,9 +21,6 @@ man() {
     command man "$@"
 }
 
-# vim mode
-set -o vi
-
 # disable history
 unset HISTFILE
 
index e026454..94a4e40 100644 (file)
@@ -3,4 +3,4 @@
 
 # disable history
 import readline
-readline.set_auto_history(False)
+readline.write_history_file = lambda *args: None
diff --git a/.config/readline b/.config/readline
new file mode 100644 (file)
index 0000000..39a869f
--- /dev/null
@@ -0,0 +1,29 @@
+# vim: filetype=readline
+
+$include /etc/inputrc
+
+set editing-mode vi
+set keyseq-timeout 250
+
+set colored-stats
+set colored-completion-prefix
+
+set completion-ignore-case
+set completion-map-case
+set mark-symlinked-directories
+set show-all-if-ambiguous
+set blink-matching-paren
+set skip-completed-text
+set revert-all-at-newline
+
+"jj": "\e"
+
+Control-l: clear-screen
+Control-w: clear-screen line
+Control-a: beginning-of-line
+Control-e: end-of-line
+
+Control-k: history-search-backward
+Control-j: history-search-forward
+Control-n: menu-complete
+Control-b: menu-complete-backward
index 1b88f11..7bdfe10 100644 (file)
--- a/.profile
+++ b/.profile
@@ -22,6 +22,7 @@ export XDG_STATE_HOME="$HOME/.local/state"
 export XDG_RUNTIME_DIR="/run/user/$UID"
 
 # config file locations
+export INPUTRC="$XDG_CONFIG_HOME/readline"
 export VIMINIT="source $XDG_CONFIG_HOME/vim"
 export XINITRC="$XDG_CONFIG_HOME/x11"
 export NOTMUCH_CONFIG="$XDG_CONFIG_HOME/notmuch"