dotfiles/profiles/zsh/default.nix

73 lines
1.8 KiB
Nix
Raw Normal View History

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;
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
autoload -U down-line-or-beginning-search
autoload -U up-line-or-beginning-search
2022-04-02 04:01:58 +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
2020-06-17 19:01:57 +02:00
ZLE_RPROMPT_INDENT=0
'';
};
programs.direnv = {
enable = true;
};
home.packages = [
pkgs.dan.mesloNFp10k
];
};
}