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";
|
|
|
|
enableAutosuggestions = true;
|
|
|
|
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 = {
|
2022-04-02 03:53:25 +02:00
|
|
|
cat = "bat";
|
|
|
|
ls = "exa";
|
|
|
|
tree = "exa -T";
|
|
|
|
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";
|
|
|
|
gds = "git diff --staged";
|
|
|
|
glg = "git log --oneline";
|
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
|
|
|
|
2021-12-22 04:58:46 +01:00
|
|
|
autoload -U history-search-end
|
|
|
|
zle -N history-beginning-search-backward-end history-search-end
|
|
|
|
zle -N history-beginning-search-forward-end history-search-end
|
2022-04-02 04:01:58 +02:00
|
|
|
|
|
|
|
bindkey '^[OA' history-beginning-search-backward-end
|
|
|
|
bindkey '^[OB' history-beginning-search-forward-end
|
|
|
|
|
|
|
|
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;
|
|
|
|
};
|
|
|
|
|
|
|
|
home.packages = [
|
|
|
|
pkgs.dan.mesloNFp10k
|
|
|
|
];
|
|
|
|
};
|
|
|
|
}
|