feat: adjust starship prompt and install fish fzf

This commit is contained in:
oddlama 2023-02-07 21:35:59 +01:00
parent f25a7cc241
commit 6bfa0187c7
No known key found for this signature in database
GPG key ID: 14EFE510775FE39A
5 changed files with 80 additions and 74 deletions

View file

@ -35,7 +35,7 @@ in {
{
keyMap = "de-latin1-nodeadkeys";
}
// lib.mkIf config.video.hidpi.enable {
// lib.mkIf config.hardware.video.hidpi.enable {
font = "ter-v28n";
packages = with pkgs; [terminus_font];
};

View file

@ -12,6 +12,7 @@ with self.pkgs.${system};
ragenix
rnix-lsp
statix
update-nix-fetching
# Lua
stylua

View file

@ -21,6 +21,7 @@
bandwhich
btop
fd
file
neofetch
rclone
ripgrep
@ -29,6 +30,7 @@
tree
rage
];
shellAliases = {
l = "ls -lahF --group-directories-first --show-control-chars --quoting-style=escape --color=auto";
t = "tree -F --dirsfirst -L 2";
@ -46,6 +48,8 @@
ip = "ip --color";
tmux = "tmux -2";
rg = "rg -S";
zf = "zathura --fork";
};
};

View file

@ -2,50 +2,35 @@
lib,
pkgs,
...
}: {
}:
with lib; {
# FIXME: ctrl-del not working
# FIXME: esc goes into vim mode, i hate it.
# FIXME: fzf on tab missing
# FIXME: DEL also deletes to the left :(
programs = {
fish = {
# FIXME: ignore certain history entries (" .*", ...)
programs.fish = {
enable = true;
interactiveShellInit = lib.mkMerge [
(lib.mkBefore ''
interactiveShellInit = mkMerge [
(mkBefore ''
set -g ATUIN_NOBIND true
set -g fish_escape_delay_ms 300
set -g fish_greeting
set -g fish_autosuggestion_enabled 0
set -U FZF_COMPLETE 0
'')
(lib.mkAfter ''
enable_ayu_theme_dark
${pkgs.any-nix-shell}/bin/any-nix-shell fish | source
fish_vi_key_bindings insert
# atuin
bind -M insert \cr _atuin_search
# quickly open text file
bind -M insert \co 'fzf | xargs -r $VISUAL'
(mkAfter ''
bind \cr _atuin_search
'')
];
plugins = [
{
name = "ayu-theme.fish";
name = "fzf";
src = pkgs.fetchFromGitHub {
owner = "edouard-lopez";
repo = "ayu-theme.fish";
rev = "d351d24263d87bef3a90424e0e9c74746673e383";
hash = "sha256-rx9izD2pc3hLObOehuiMwFB4Ta5G1lWVv9Jdb+JHIz0=";
};
}
{
name = "autopair.fish";
src = pkgs.fetchFromGitHub {
owner = "jorgebucaran";
repo = "autopair.fish";
rev = "1.0.4";
hash = "sha256-s1o188TlwpUQEN3X5MxUlD/2CFCpEkWu83U9O+wg3VU=";
owner = "jethrokuan";
repo = "fzf";
rev = "479fa67d7439b23095e01b64987ae79a91a4e283";
sha256 = "0k6l21j192hrhy95092dm8029p52aakvzis7jiw48wnbckyidi6v";
};
}
];
};
};
}

View file

@ -7,20 +7,19 @@
"$username"
"$hostname"
" $directory "
"$git_branch"
"$git_commit"
"($git_branch )"
"($git_commit )"
"$git_state"
"$git_status"
"$character"
];
right_format = lib.concatStrings [
"$status"
"$cmd_duration"
"$jobs"
"$package"
"$python"
"$rust"
"$nix_shell"
"($status )"
"($cmd_duration )"
"($jobs )"
"($python )"
"($rust )"
"($nix_shell )"
"$time"
];
@ -28,6 +27,7 @@
format = "[$user]($style)";
style_root = "red";
style_user = "cyan";
show_always = true;
};
hostname = {
format = "[$ssh_symbol$hostname]($style)";
@ -36,6 +36,7 @@
style = "cyan";
};
directory = {
format = "[$path]($style)[$read_only]($read_only_style)";
fish_style_pwd_dir_length = 1;
style = "bold blue";
};
@ -68,14 +69,29 @@
staged = "+$count";
renamed = "$count";
deleted = "-$count";
format = "[$conflicted](red)[$stashed](magenta)[$staged](green)[$deleted](red)[$renamed](blue)[$modified](yellow)[$untracked](blue)[$ahead_behind](green)";
format = lib.concatStrings [
"[($conflicted )](red)"
"[($stashed )](magenta)"
"[($staged )](green)"
"[($deleted )](red)"
"[($renamed )](blue)"
"[($modified )](yellow)"
"[($untracked )](blue)"
"[($ahead_behind )](green)"
];
};
nix_shell.heuristic = true; # Also detect nix shell
status = {
pipestatus = true;
disabled = false;
pipestatus_format = "$pipestatus => [$symbol$common_meaning$signal_name$maybe_int]($style)";
pipestatus_segment_format = "[$symbol$status]($style)";
format = "[$symbol$status$signal_name]($style)";
pipestatus = true;
pipestatus_format = "$pipestatus => [$int( $signal_name)]($style)";
pipestatus_separator = "[|]($style)";
pipestatus_segment_format = "[$status]($style)";
format = "[$status( $signal_name)]($style)";
style = "red";
};
python = {
format = "[$symbol$pyenv_prefix($version )(\($virtualenv\) )]($style)";
};
cmd_duration = {
format = "[ $duration]($style)";