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"; keyMap = "de-latin1-nodeadkeys";
} }
// lib.mkIf config.video.hidpi.enable { // lib.mkIf config.hardware.video.hidpi.enable {
font = "ter-v28n"; font = "ter-v28n";
packages = with pkgs; [terminus_font]; packages = with pkgs; [terminus_font];
}; };

View file

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

View file

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

View file

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

View file

@ -6,36 +6,37 @@
format = lib.concatStrings [ format = lib.concatStrings [
"$username" "$username"
"$hostname" "$hostname"
"$directory" " $directory "
"$git_branch" "($git_branch )"
"$git_commit" "($git_commit )"
"$git_state" "$git_state"
"$git_status" "$git_status"
"$character" "$character"
]; ];
right_format = lib.concatStrings [ right_format = lib.concatStrings [
"$status" "($status )"
"$cmd_duration" "($cmd_duration )"
"$jobs" "($jobs )"
"$package" "($python )"
"$python" "($rust )"
"$rust" "($nix_shell )"
"$nix_shell"
"$time" "$time"
]; ];
username = { username = {
format = "[$user]($style) "; format = "[$user]($style)";
style_root = "red"; style_root = "red";
style_user = "cyan"; style_user = "cyan";
show_always = true;
}; };
hostname = { hostname = {
format = "[$ssh_symbol$hostname]($style) "; format = "[$ssh_symbol$hostname]($style)";
ssh_only = false; ssh_only = false;
ssh_symbol = "🌐"; ssh_symbol = "🌐";
style = "cyan"; style = "cyan";
}; };
directory = { directory = {
format = "[$path]($style)[$read_only]($read_only_style)";
fish_style_pwd_dir_length = 1; fish_style_pwd_dir_length = 1;
style = "bold blue"; style = "bold blue";
}; };
@ -48,41 +49,56 @@
vimcmd_visual_symbol = "[](bold yellow)"; vimcmd_visual_symbol = "[](bold yellow)";
}; };
git_branch = { git_branch = {
format = "[$symbol$branch]($style) "; format = "[$symbol$branch]($style)";
symbol = " "; symbol = " ";
style = "green"; style = "green";
}; };
git_commit = { git_commit = {
commit_hash_length = 8; commit_hash_length = 8;
format = "[$hash$tag]($style) "; format = "[$hash$tag]($style)";
style = "green"; style = "green";
}; };
git_status = { git_status = {
conflicted = "$count "; conflicted = "$count";
ahead = "$count "; ahead = "$count";
behind = "$count "; behind = "$count";
diverged = "$ahead_count$behind_count "; diverged = "$ahead_count$behind_count";
untracked = "?$count "; untracked = "?$count";
stashed = "\\$$count "; stashed = "\\$$count";
modified = "!$count "; modified = "!$count";
staged = "+$count "; staged = "+$count";
renamed = "$count "; renamed = "$count";
deleted = "-$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 = { status = {
pipestatus = true;
disabled = false; disabled = false;
pipestatus_format = "$pipestatus => [$symbol$common_meaning$signal_name$maybe_int]($style)"; pipestatus = true;
pipestatus_segment_format = "[$symbol$status]($style)"; pipestatus_format = "$pipestatus => [$int( $signal_name)]($style)";
format = "[$symbol$status$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 = { cmd_duration = {
format = "[ $duration]($style) "; format = "[ $duration]($style)";
style = "yellow"; style = "yellow";
}; };
time = { time = {
format = "[ $time]($style) "; format = "[ $time]($style)";
style = "cyan"; style = "cyan";
disabled = false; disabled = false;
}; };