refactor: extract shell setup

This commit is contained in:
Michael Mandl 2024-07-10 13:21:28 +02:00
parent f6f01771ab
commit c2afb2c5d1
Signed by: mandlm
GPG key ID: 088ED38F036C7AF2
18 changed files with 33 additions and 58 deletions

29
shell/zsh.nix Normal file
View file

@ -0,0 +1,29 @@
{ theme, ... }:
let
zsh_autosuggest_highlight_style = if theme == "light" then "fg=180" else "fg=10";
in
{
programs.zsh = {
enable = true;
enableCompletion = true;
history.size = 10000;
autosuggestion = {
enable = true;
highlight = zsh_autosuggest_highlight_style;
};
syntaxHighlighting = {
enable = true;
};
initExtra = ''
function set_win_title(){
local TITLE=$(git config --get remote.origin.url || echo "$PWD")
echo -ne "\033]0; $(basename "$TITLE") \007"
}
precmd_functions+=(set_win_title)
'';
};
}