dotfiles.nix/home-manager/sajenim/features/cli/zsh.nix

68 lines
1.8 KiB
Nix
Raw Normal View History

2024-08-08 09:02:42 +08:00
{pkgs, ...}: {
2023-04-06 09:31:23 +08:00
home.packages = with pkgs; [
fzf # command-line fuzzy finder
];
programs.zsh = {
enable = true;
2024-08-08 09:02:42 +08:00
2023-04-06 09:31:23 +08:00
# Enable extra features
autosuggestion = {
enable = true;
};
2023-12-23 05:40:18 +08:00
syntaxHighlighting = {
enable = true;
};
enableCompletion = true;
2023-04-06 09:31:23 +08:00
dotDir = ".config/zsh";
2024-08-08 09:02:42 +08:00
2023-04-06 09:31:23 +08:00
# Commands that should be added to to top of '.zshrc'
initExtraFirst = ''
'';
# Aliases
shellAliases = {
2024-08-08 09:02:42 +08:00
c = "clear";
r = "cd ~/.repositories";
p = "cd ~/.print";
d = "cd ~/.repositories/dotfiles.nix";
2023-04-06 09:31:23 +08:00
la = "ls -a";
ll = "ls -l";
2023-04-23 05:48:20 +08:00
tt = "wezterm cli set-tab-title ";
2024-01-22 19:58:43 +08:00
deploy-viridian = "nixos-rebuild switch --flake .#viridian --target-host viridian --use-remote-sudo";
2024-10-01 11:58:33 +08:00
mount-backup = "sshfs sajenim@viridian.kanto.dev:/srv/shares/sajenim /home/sajenim/.backup -o IdentityFile=/home/sajenim/.ssh/sajenim_sk";
2023-04-06 09:31:23 +08:00
};
# An attribute set that adds to named directory hash table
dirHashes = {
# QMK Keymaps
2024-01-21 21:01:42 +08:00
crkbd = "$HOME/.github/qmk_keymaps/keyboards/crkbd/keymaps/sajenim";
kchrn = "$HOME/.github/qmk_keymaps/keyboards/keychron/q4/ansi_v2/keymaps/sajenim";
2023-04-06 09:31:23 +08:00
};
2024-08-08 09:02:42 +08:00
2023-04-06 09:31:23 +08:00
# Install plugins
plugins = [
{
name = "fzf-tab";
src = pkgs.fetchFromGitHub {
owner = "Aloxaf";
repo = "fzf-tab";
rev = "5a81e13792a1eed4a03d2083771ee6e5b616b9ab";
sha256 = "dPe5CLCAuuuLGRdRCt/nNruxMrP9f/oddRxERkgm1FE=";
};
}
];
2024-08-08 09:02:42 +08:00
2023-04-06 09:31:23 +08:00
# Extra commands that should be added to '.zshrc'
initExtra = ''
2023-07-25 11:12:02 +08:00
eval "$(direnv hook zsh)"
2024-02-02 22:00:14 +08:00
source ${pkgs.zsh-vi-mode}/share/zsh-vi-mode/zsh-vi-mode.plugin.zsh
2024-01-01 07:17:16 +08:00
path+=('/home/sajenim/.local/bin')
bindkey "^[[1;5C" forward-word
bindkey "^[[1;5D" backward-word
2024-01-01 07:17:16 +08:00
export PATH
2023-11-05 22:03:13 +08:00
PROMPT='%F{blue}%n@%m %F{cyan}%~ %F{red} %f';
2023-04-06 09:31:23 +08:00
'';
};
}