From db6ff53243fec16fa05460b2ff1d713a3db87aed Mon Sep 17 00:00:00 2001 From: teutat3s Date: Thu, 2 Feb 2023 17:28:43 +0100 Subject: [PATCH] bash: ble.sh tweaks and starship ricing --- modules/terminal-life/bash/default.nix | 11 ++++++++++- modules/terminal-life/starship.toml.nix | 19 +++++++++++-------- overlays/blesh.nix | 6 +++--- 3 files changed, 24 insertions(+), 12 deletions(-) diff --git a/modules/terminal-life/bash/default.nix b/modules/terminal-life/bash/default.nix index 05ea4ecc..3be672a5 100644 --- a/modules/terminal-life/bash/default.nix +++ b/modules/terminal-life/bash/default.nix @@ -30,7 +30,6 @@ in { # Syntax highlighting, auto suggestions, vim modes, etc. # https://github.com/akinomyoga/ble.sh/wiki/Manual-A1-Installation#user-content-nixpkgs source "$(blesh-share)" --attach=none - [[ ''${BLE_VERSION-} ]] && ble-attach # ctrl + space to accept autocomplete suggestion ble-bind -m 'auto_complete' -f 'C-@' 'auto_complete/insert-on-end' # Meta (Alt) + Backspace to delete a word @@ -46,9 +45,19 @@ in { ble-bind -f down 'history-search-forward hide-status:immediate-accept:empty=emulate-readline:point=end' ble-bind -f C-n 'history-search-forward hide-status:immediate-accept:empty=emulate-readline:point=end' + function my/complete-load-hook { + bleopt complete_auto_delay=300 + } + blehook/eval-after-load complete my/complete-load-hook + + bleopt exec_errexit_mark= + bleopt history_share=1 bleopt filename_ls_colors="$LS_COLORS" source ${config.age.secrets.environment-secrets.path} + + # end of .bashrc + [[ ''${BLE_VERSION-} ]] && ble-attach ''; shellAliases = { diff --git a/modules/terminal-life/starship.toml.nix b/modules/terminal-life/starship.toml.nix index ab6dfa7f..0fd21ad0 100644 --- a/modules/terminal-life/starship.toml.nix +++ b/modules/terminal-life/starship.toml.nix @@ -1,5 +1,5 @@ { - format = "$directory($git_branch$git_commit$git_state$git_status)($c$deno$golang$haskell$nix_shell$nodejs$php$python$ruby$rust$terraform[](fg:#86BBD8 bg:#06969A))($docker_context[](fg:#06969A))($container)$fill(\${custom.triton})[ ](fg:#F85E84)$line_break$character"; + format = "$directory($git_branch$git_commit$git_state$git_status)($c$deno$golang$haskell$nodejs$php$python$ruby$rust$terraform[](fg:#86BBD8 bg:#06969A))($docker_context[](fg:#06969A))($container)$fill(\${custom.triton})$nix_shell$status[ |](fg:#F85E84)$line_break$character"; # Disable the blank line at the start of the prompt add_newline = false; @@ -13,13 +13,18 @@ #}; character = { success_symbol = "[❯](bold purple)"; - error_symbol = "[✗](#ff4b00)"; - vicmd_symbol = "[❮](bold purple)"; + error_symbol = "[✗](#FF4B00)"; + }; + + status = { + disabled = false; + style = "#FF4B00"; }; fill = { symbol = "-"; - style = "bold green"; + #style = "bold green"; + style = "black"; }; directory = { @@ -118,10 +123,8 @@ }; nix_shell = { - format = ''[$symbol$state]($style) ''; - symbol = " "; - pure_msg = "λ"; - impure_msg = "⎔"; + format = ''[$symbol]($style) ''; + symbol = " "; }; nodejs = { diff --git a/overlays/blesh.nix b/overlays/blesh.nix index 01874da8..72fd6bcc 100644 --- a/overlays/blesh.nix +++ b/overlays/blesh.nix @@ -1,11 +1,11 @@ final: prev: { blesh = prev.blesh.overrideAttrs (oldAttrs: rec { - version = "unstable-2022-12-15"; + version = "unstable-2023-02-01"; src = prev.fetchFromGitHub { owner = "akinomyoga"; repo = "ble.sh"; - rev = "32277dae20f004c3a65aeb3adae881b8b8e0318f"; - hash = "sha256-qh5z0rkDOKhgi4/LQX2WHShzqwlOUpe+CuJArEmuKMo="; + rev = "0ceb0cb38157c2c37650ffb069098783338eb02c"; + hash = "sha256-f3w3gHKysRafBGcZbCPUvy9e/fOrQc9TBZAjb0ioxpo="; fetchSubmodules = true; leaveDotGit = true; };