2020-06-17 19:01:57 +02:00
|
|
|
{ pkgs, config, lib, ... }:
|
|
|
|
|
|
|
|
let
|
|
|
|
cfg = config.profiles.zsh;
|
|
|
|
in
|
|
|
|
{
|
|
|
|
options.profiles.zsh = {
|
|
|
|
enable = lib.mkEnableOption "Manage zsh from hm";
|
|
|
|
};
|
|
|
|
|
|
|
|
config = lib.mkIf cfg.enable {
|
|
|
|
programs.zsh = {
|
|
|
|
enable = true;
|
|
|
|
dotDir = ".config/zsh";
|
2024-06-01 10:52:37 +02:00
|
|
|
autosuggestion.enable = true;
|
2020-06-17 19:01:57 +02:00
|
|
|
enableCompletion = true;
|
|
|
|
history = {
|
|
|
|
expireDuplicatesFirst = true;
|
|
|
|
ignoreDups = true;
|
2021-12-22 04:58:46 +01:00
|
|
|
share = false;
|
2020-06-17 19:01:57 +02:00
|
|
|
};
|
|
|
|
shellAliases = {
|
2024-04-18 12:01:54 +02:00
|
|
|
cat = "bat -pp";
|
2023-11-30 04:32:11 +01:00
|
|
|
ls = "eza";
|
|
|
|
tree = "eza -T";
|
2022-04-02 03:53:25 +02:00
|
|
|
df = "df -h";
|
|
|
|
|
2022-04-02 04:33:44 +02:00
|
|
|
sysu = "systemctl --user";
|
|
|
|
jnlu = "journalctl --user";
|
|
|
|
|
2020-06-17 19:01:57 +02:00
|
|
|
mpvav1 = "mpv --vd-queue-enable=yes --ad-queue-enable=yes --vd-queue-max-bytes=4000MiB --vd-queue-max-samples=2000000 --vd-queue-max-secs=50";
|
2022-04-02 03:52:30 +02:00
|
|
|
|
|
|
|
gst = "git status -sb";
|
|
|
|
gcm = "git commit -m";
|
|
|
|
gca = "git commit --amend --no-edit";
|
2022-06-05 03:21:50 +02:00
|
|
|
grc = "git rc";
|
|
|
|
gne = "git n";
|
2022-04-02 03:52:30 +02:00
|
|
|
gds = "git diff --staged";
|
|
|
|
glg = "git log --oneline";
|
2022-06-05 15:46:48 +02:00
|
|
|
|
|
|
|
nano = "hx"; # Behavioral training
|
2020-06-17 19:01:57 +02:00
|
|
|
};
|
|
|
|
initExtra = ''
|
2021-04-12 01:41:56 +02:00
|
|
|
source ${pkgs.zsh-powerlevel10k}/share/zsh-powerlevel10k/powerlevel10k.zsh-theme
|
|
|
|
source ${./p10k.zsh}
|
2020-06-17 19:01:57 +02:00
|
|
|
|
2022-04-19 20:24:50 +02:00
|
|
|
autoload -U down-line-or-beginning-search
|
|
|
|
autoload -U up-line-or-beginning-search
|
2022-04-02 04:01:58 +02:00
|
|
|
|
2022-04-19 20:24:50 +02:00
|
|
|
zle -N down-line-or-beginning-search
|
|
|
|
zle -N up-line-or-beginning-search
|
|
|
|
|
|
|
|
bindkey '^[OA' up-line-or-beginning-search
|
|
|
|
bindkey '^[OB' down-line-or-beginning-search
|
2022-04-02 04:01:58 +02:00
|
|
|
|
|
|
|
bindkey '^[[1;5D' backward-word
|
|
|
|
bindkey '^[[1;5C' forward-word
|
|
|
|
bindkey '^H' backward-kill-word
|
|
|
|
|
|
|
|
bindkey '^[OH' beginning-of-line
|
|
|
|
bindkey '^[OF' end-of-line
|
|
|
|
bindkey '^[[3~' delete-char
|
2021-12-22 04:58:46 +01:00
|
|
|
|
2020-06-17 19:01:57 +02:00
|
|
|
ZLE_RPROMPT_INDENT=0
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
programs.direnv = {
|
|
|
|
enable = true;
|
|
|
|
};
|
2023-05-02 04:26:35 +02:00
|
|
|
|
|
|
|
programs.atuin = {
|
|
|
|
enable = true;
|
|
|
|
enableZshIntegration = true;
|
2023-06-03 19:14:34 +02:00
|
|
|
settings = {
|
|
|
|
filter_mode = "directory";
|
|
|
|
filter_mode_shell_up_key_binding = "session";
|
|
|
|
};
|
2023-05-02 04:26:35 +02:00
|
|
|
};
|
2020-06-17 19:01:57 +02:00
|
|
|
|
2024-04-18 12:01:54 +02:00
|
|
|
programs.zoxide.enable = true;
|
|
|
|
|
2023-11-04 23:34:27 +01:00
|
|
|
home.packages = lib.optionals (config.profiles.gui.enable && config ? nixpkgs) [
|
2020-06-17 19:01:57 +02:00
|
|
|
pkgs.dan.mesloNFp10k
|
|
|
|
];
|
|
|
|
};
|
|
|
|
}
|