From 7195f92017bf791d9f2db955022001c547f11f91 Mon Sep 17 00:00:00 2001 From: Lucien Cartier-Tilet Date: Sat, 18 Dec 2021 11:54:32 +0100 Subject: [PATCH] [Fish] Switch to starship shell prompt --- org/config/fish.org | 132 +++++++++++++++++++++++++++++++++++++++----- 1 file changed, 118 insertions(+), 14 deletions(-) diff --git a/org/config/fish.org b/org/config/fish.org index 2f0a3c2..944b207 100644 --- a/org/config/fish.org +++ b/org/config/fish.org @@ -66,22 +66,126 @@ function fish_greeting end #+END_SRC -The theme I use for fish is [[https://github.com/oh-my-fish/theme-bobthefish][bobthefish]], which by default puts a really long -timestamp to the right of the prompt. I want something shorter, so here is the -variable to set, using the format specified in ~date(1)~. -#+BEGIN_SRC fish -set -g theme_date_format "+%g-%m-%d %H:%M:%S" -#+END_SRC +For my fish prompt, I use [[https://starship.rs][starship]], a shell-agnostic prompt. Let’s load it: +#+begin_src fish +starship init fish | source +#+end_src -I also wish to have a kinda different newline prompt, so let’s set it: -#+BEGIN_SRC fish -set -g theme_newline_prompt 'λ ' -#+END_SRC +* Starship configuration +:PROPERTIES: +:header-args:toml: :tangle ~/.config/starship.toml +:CUSTOM_ID: Starship-configuration-lpz4tz410bj0 +:END: +As mentioned above, starship is a shell-agnostic prompt, written in Rust and which can be configured separately from the shell. I decided to configure it here though, since fish is the only shell I use which is compatible with starship. -Finally, let’s set our prompt’s theme to the Nord theme. -#+BEGIN_SRC fish -set -g theme_color_scheme nord -#+END_SRC +First I’ll modify the default format variable, removing the modules I don’t need. +#+begin_src toml +format = """ +$username\ +$hostname\ +$shlvl\ +$singularity\ +$kubernetes\ +$directory\ +$vcsh\ +$git_branch\ +$git_commit\ +$git_state\ +$git_metrics\ +$git_status\ +$hg_branch\ +$docker_context\ +$package\ +$cmake\ +$dart\ +$deno\ +$lua\ +$nodejs\ +$python\ +$rlang\ +$rust\ +$scala\ +$zig\ +$memory_usage\ +$env_var\ +$custom\ +$cmd_duration\ +$line_break\ +$jobs\ +$battery\ +$time\ +$status\ +$shell\ +$character""" +#+end_src + +I want starship to be able to detect Lisp files, be it CommonLisp or EmacsLisp. Unfortunately, it seems nerd-font doesn’t have any symbol for either language, so I’m just using a lambda character. +#+begin_src toml +[custom.lisp] +extensions = ["lisp", "el"] +symbol = "λ" +style = "bold green" +#+end_src + +Finally, let’s disable all modules I don’t need. +#+begin_src toml +[cobol] +disable = true +[dotnet] +disable = true +[elixir] +disable = true +[elm] +disable = true +[erlang] +disable = true +[golang] +disable = true +[helm] +disable = true +[java] +disable = true +[julia] +disable = true +[kotlin] +disable = true +[nim] +disable = true +[ocaml] +disable = true +[perl] +disable = true +[php] +disable = true +[pulumi] +disable = true +[purescript] +disable = true +[red] +disable = true +[ruby] +disable = true +[swift] +disable = true +[terraform] +disable = true +[vlang] +disable = true +[vagrant] +disable = true +[nix_shell] +disable = true +[conda] +disable = true +[aws] +disable = true +[gcloud] +disable = true +[openstack] +disable = true +[crystal] +disable = true +#+end_src * Global variables :PROPERTIES: