Replace manual GitHub fetchFromGitHub with packaged versions of zsh plugins and consolidate plugin loading through the plugins list instead of manual sourcing.
53 lines
1.1 KiB
Nix
53 lines
1.1 KiB
Nix
{pkgs, ...}: {
|
|
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
|
|
PROMPT='%F{blue}%n@%m %F{cyan}%~ %F{red}♥ %f';
|
|
'';
|
|
};
|
|
}
|