ble.sh: use fzf ctrl-r history, ble.sh built-in completion
All checks were successful
continuous-integration/drone/push Build is passing

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 committed by Benjamin Bädorf
parent 4a367cbf23
commit 77747848a3
No known key found for this signature in database
GPG key ID: 4406E80E13CD656C
2 changed files with 13 additions and 3 deletions

View file

@ -18,6 +18,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
@ -37,9 +40,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'
@ -47,6 +52,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=500
}

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