diff options
Diffstat (limited to 'modules/tools/zsh')
| -rw-r--r-- | modules/tools/zsh/default.nix | 25 | ||||
| -rw-r--r-- | modules/tools/zsh/zshrc | 23 |
2 files changed, 48 insertions, 0 deletions
diff --git a/modules/tools/zsh/default.nix b/modules/tools/zsh/default.nix new file mode 100644 index 0000000..0f10e72 --- /dev/null +++ b/modules/tools/zsh/default.nix @@ -0,0 +1,25 @@ +{ config, lib, pkgs, ... }: + +{ + options.tools.zsh = { + enable = lib.mkEnableOption "Enables zsh."; + }; + + config = lib.mkIf config.tools.zsh.enable { + programs.zsh.enable = true; + programs.zsh.dotDir = ".config/zsh"; + programs.zsh.history.path = "${config.xdg.cacheHome}/zsh/history"; + programs.zsh.initContent = '' +${if config.tools.fzf.enable then + "eval \"$(fzf --zsh)\"" +else ""} +${builtins.readFile ./zshrc} +${if config.scripts.enable then + "export PATH=${config.home.homeDirectory}/scripts:$PATH" +else ""} + ''; + programs.kitty.settings.shell = lib.mkIf config.tools.kitty.enable "zsh"; + programs.zsh.shellAliases."nnn" = lib.mkIf config.tools.nnn.enable "nnn -H -d"; + # programs.zsh.shellAliases."ls" = lib.mkIf config.tools.lsd.enable "lsd"; + }; +} diff --git a/modules/tools/zsh/zshrc b/modules/tools/zsh/zshrc new file mode 100644 index 0000000..3465071 --- /dev/null +++ b/modules/tools/zsh/zshrc @@ -0,0 +1,23 @@ +setopt PROMPT_SUBST + +autoload -U colors && colors + +autoload -Uz vcs_info +precmd() { vcs_info } + +zstyle ':vcs_info:git:*' formats '%F{red}┄[%F{cyan}%b%c%F{blue}%a%F{red}]' +zstyle ':vcs_info:git:*' actionformats '%F{red}┄[%F{cyan}%b%c%F{blue}%a%F{red}]' + +zstyle ':vcs_info:*+set-message:*' hooks git-untracked git-dirty + +zstyle ':vcs_info:git:*' check-for-changes true +zstyle ':vcs_info:git:*' stagedstr ' %F{green}✓%f' +zstyle ':vcs_info:git:*' unstagedstr ' %F{red}✗%f' +zstyle ':vcs_info:git:*' aheadstr ' %F{blue}⬆%f' +zstyle ':vcs_info:git:*' behindstr ' %F{yellow}⬇%f' + +PROMPT='%F{red}╭──[%F{green}%m%F{red}@%F{blue}%n%F{red}]┄[%F{magenta}%~%F{red}]${vcs_info_msg_0_}%(?..%F{red}┄[%F{white}Exit status: %F{yellow}%?%F{red}] ) +╰─>%f ' + +bindkey "^[[3~" delete-char +bindkey "^?" backward-delete-char |
