nix-config/home-manager/sajenim/features/cli/zsh.nix
jasmine bdf7c14c6c
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
2025-10-25 23:14:17 +08:00

56 lines
1 KiB
Nix

{pkgs, ...}: {
imports = [
./starship.nix
];
home.packages = with pkgs; [
fzf # command-line fuzzy finder
];
programs.zsh = {
enable = true;
# Enable extra features
autosuggestion = {
enable = true;
};
syntaxHighlighting = {
enable = true;
};
enableCompletion = true;
# Configuration directory
dotDir = ".config/zsh";
shellAliases = {
# Single letter aliases
c = "clear";
v = "nvim";
# Double letter aliases
la = "ls -a";
ll = "ls -l";
};
# Install plugins
plugins = [
{ # vi(vim) mode for ZSH
name = "zsh-vi-mode";
src = "${pkgs.zsh-vi-mode}/share/zsh-vi-mode";
}
{ # replace zsh's completion with fzf
name = "fzf-tab";
src = "${pkgs.zsh-fzf-tab}/share/fzf-tab";
}
];
# Extra commands that should be added to '.zshrc'
initContent = ''
eval "$(direnv hook zsh)"
bindkey "^[[1;5C" forward-word
bindkey "^[[1;5D" backward-word
export PATH
'';
};
}