ble.sh: use fzf ctrl-r history, ble.sh built-in completion

Fix selected ble-face region_input

Fix jump words limited by space (uword)
This commit is contained in:
teutat3s 2023-05-31 20:54:31 +02:00
parent ca61200807
commit d3ed1bf9ae
Signed by: teutat3s
GPG key ID: 4FA1D3FA524F22C1
2 changed files with 13 additions and 3 deletions

View file

@ -19,6 +19,9 @@ in {
# Run when initializing an interactive shell
initExtra = ''
# Use fzf's CTRL-R history widget
source ${pkgs.fzf}/share/fzf/key-bindings.bash
# If a command is not found, show me where it is
source ${pkgs.nix-index}/etc/profile.d/command-not-found.sh
@ -38,9 +41,11 @@ in {
# Meta (Alt) + Backspace to delete a word
ble-bind -m 'vi_imap' -f 'M-C-?' 'kill-backward-cword'
# Meta (Alt) + p to jump one word backwards
ble-bind -m 'vi_imap' -f M-p '@nomarked backward-cword'
ble-bind -m 'vi_imap' -f M-p '@nomarked backward-uword'
ble-bind -m 'vi_imap' -f M-left '@nomarked backward-uword'
# Meta (Alt) + n to jump one word forwards
ble-bind -m 'vi_imap' -f M-n '@nomarked forward-cword'
ble-bind -m 'vi_imap' -f M-n '@nomarked forward-uword'
ble-bind -m 'vi_imap' -f M-right '@nomarked forward-uword'
# Arrow up and Ctrl + p searches history for entered input
ble-bind -m 'vi_imap' -f up 'history-search-backward hide-status:immediate-accept:empty=emulate-readline:point=end'
ble-bind -m 'vi_imap' -f C-p 'history-search-backward hide-status:immediate-accept:empty=emulate-readline:point=end'
@ -48,6 +53,8 @@ in {
ble-bind -m 'vi_imap' -f down 'history-search-forward hide-status:immediate-accept:empty=emulate-readline:point=end'
ble-bind -m 'vi_imap' -f C-n 'history-search-forward hide-status:immediate-accept:empty=emulate-readline:point=end'
ble-face region_insert='fg=black,bg=navy'
function my/complete-load-hook {
bleopt complete_auto_delay=250
}

View file

@ -10,5 +10,8 @@
"--color=fg:#d3d1d4,header:#7accd7,info:#e5c463,pointer:#ef9062"
"--color=marker:#ef9062,fg+:#303030,prompt:#e5c463,hl+:#7accd7"
];
enableBashIntegration = true;
# Use ble.sh for completions, see
# modules/terminal-life/bash/default.nix -> bleopt complete_menu_style=desc
# and https://github.com/akinomyoga/ble.sh/wiki/Manual-%C2%A77-Completion
enableBashIntegration = false;
}