feat(home-manager): add starship prompt and reorganize CLI features
- Move zsh configuration from global/ to features/cli/ - Add starship.nix with custom prompt configuration - Left prompt: username@hostname, directory, git status, vi-mode indicator - Right prompt: language/environment indicators (C, direnv, Haskell, Bun, Python, Rust) - Git status with semantic colors (green=staged, yellow=modified/untracked, red=conflicted/deleted, cyan=stashed/renamed) - Vi-mode aware prompt character (red heart in insert, blue in normal) - Update features/cli to import starship via zsh.nix - Remove empty imports section from global/default.nix
This commit is contained in:
parent
65f6a14f69
commit
bdf7c14c6c
4 changed files with 75 additions and 5 deletions
|
|
@ -7,6 +7,7 @@
|
|||
./git.nix
|
||||
./mpd.nix
|
||||
./ssh.nix
|
||||
./zsh.nix
|
||||
];
|
||||
|
||||
home.packages = with pkgs;
|
||||
|
|
|
|||
70
home-manager/sajenim/features/cli/starship.nix
Normal file
70
home-manager/sajenim/features/cli/starship.nix
Normal file
|
|
@ -0,0 +1,70 @@
|
|||
{...}: {
|
||||
programs.starship = {
|
||||
enable = true;
|
||||
enableZshIntegration = true;
|
||||
settings = {
|
||||
# Left prompt: username@hostname directory git ♥
|
||||
format = "$username$hostname$directory$git_branch$git_status$character";
|
||||
|
||||
# Right prompt: language indicators
|
||||
right_format = "$c$direnv$haskell$bun$python$rust";
|
||||
|
||||
# Blue username
|
||||
username = {
|
||||
style_user = "blue";
|
||||
style_root = "red";
|
||||
format = "[$user]($style)";
|
||||
show_always = true;
|
||||
};
|
||||
|
||||
# Blue @hostname
|
||||
hostname = {
|
||||
ssh_only = false;
|
||||
format = "[@$hostname]($style) ";
|
||||
style = "blue";
|
||||
};
|
||||
|
||||
# Cyan directory
|
||||
directory = {
|
||||
style = "cyan";
|
||||
format = "[$path]($style) ";
|
||||
truncation_length = 0;
|
||||
truncate_to_repo = false;
|
||||
};
|
||||
|
||||
# Git branch (purple, no bold)
|
||||
git_branch = {
|
||||
style = "purple";
|
||||
};
|
||||
|
||||
# Git status with semantic colors (no bold, no brackets)
|
||||
git_status = {
|
||||
format = "$conflicted$stashed$deleted$renamed$modified$staged$untracked$ahead_behind";
|
||||
conflicted = "[=$count](red) ";
|
||||
ahead = "[⇡$count](cyan) ";
|
||||
behind = "[⇣$count](cyan) ";
|
||||
diverged = "[⇡$ahead_count](cyan)[⇣$behind_count](cyan) ";
|
||||
untracked = "[?$count](yellow) ";
|
||||
stashed = "[\\$$count](cyan) ";
|
||||
modified = "[!$count](yellow) ";
|
||||
staged = "[+$count](green) ";
|
||||
renamed = "[»$count](cyan) ";
|
||||
deleted = "[✘$count](red) ";
|
||||
};
|
||||
|
||||
# Heart prompt character (red in insert mode, blue in normal mode)
|
||||
character = {
|
||||
success_symbol = "[♥](red)";
|
||||
error_symbol = "[♥](red)";
|
||||
vicmd_symbol = "[♥](blue)";
|
||||
};
|
||||
|
||||
# Language modules for right prompt (only configure non-defaults)
|
||||
|
||||
# Enable direnv (disabled by default)
|
||||
direnv.disabled = false;
|
||||
|
||||
# C, Python, Haskell, Bun, Rust: use defaults
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -1,4 +1,8 @@
|
|||
{pkgs, ...}: {
|
||||
imports = [
|
||||
./starship.nix
|
||||
];
|
||||
|
||||
home.packages = with pkgs; [
|
||||
fzf # command-line fuzzy finder
|
||||
];
|
||||
|
|
@ -47,7 +51,6 @@
|
|||
bindkey "^[[1;5C" forward-word
|
||||
bindkey "^[[1;5D" backward-word
|
||||
export PATH
|
||||
PROMPT='%F{blue}%n@%m %F{cyan}%~ %F{red}♥ %f';
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
|
@ -2,10 +2,6 @@
|
|||
# This module provides base user settings, nixpkgs configuration, and core imports
|
||||
# that are inherited across all hosts where this user is configured.
|
||||
{outputs, lib, ...}: {
|
||||
imports = [
|
||||
./zsh.nix # Shell configuration and plugins
|
||||
];
|
||||
|
||||
# Nixpkgs configuration - applies overlays and sets package acceptance policy
|
||||
nixpkgs = {
|
||||
# Apply custom overlays to extend/modify the package set
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue