From fdb9ba23a2cff4b50a699eb89435aa9a9de77891 Mon Sep 17 00:00:00 2001 From: Shubham Saini Date: Fri, 29 Sep 2023 20:32:40 -0700 Subject: nix: trying modules --- modules/zsh.nix | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 modules/zsh.nix (limited to 'modules') diff --git a/modules/zsh.nix b/modules/zsh.nix new file mode 100644 index 0000000..bd7a30f --- /dev/null +++ b/modules/zsh.nix @@ -0,0 +1,52 @@ +{ + programs.zsh = { + enable = true; + enableCompletion = true; + enableAutosuggestions = true; + dotDir = ".zsh"; + history = { + ignoreAllDups = true; + path = "$HOME/.zsh/history"; + }; + initExtra = '' + zstyle ':completion:*' menu select + zstyle ':completion:*' matcher-list 'm:{[:lower:][:upper:]}={[:upper:][:lower:]}' 'm:{[:lower:][:upper:]}={[:upper:][:lower:]} l:|=* r:|=*' 'm:{[:lower:][:upper:]}={[:upper:][:lower:]} l:|=* r:|=*' 'm:{[:lower:][:upper:]}={[:upper:][:lower:]} l:|=* r:|=*' + zmodload zsh/complist + bindkey -M menuselect 'h' vi-backward-char + bindkey -M menuselect 'k' vi-up-line-or-history + bindkey -M menuselect 'l' vi-forward-char + bindkey -M menuselect 'j' vi-down-line-or-history + bindkey '^f' autosuggest-accept + source ${pkgs.zsh-vi-mode}/share/zsh-vi-mode/zsh-vi-mode.plugin.zsh + zvm_after_init_commands+=('source ${pkgs.fzf}/share/fzf/completion.zsh && source ${pkgs.fzf}/share/fzf/key-bindings.zsh') + ''; + shellAliases = { + ".." = "cd .."; + l = "ls --color -al"; + ls = "ls --color"; + v = "nvim"; + o = "xdg-open"; + t = "tmux"; + f = "lf"; + tf = "terraform"; + k = "kubectl"; + gst = "git status --short"; + ga = "git add"; + gp = "git push"; + gl = "git log --oneline --decorate --graph"; + gc = "git commit -v -S"; + gd = "git diff --minimal"; + }; + plugins = [ + { + name = "pure"; + src = pkgs.fetchFromGitHub { + owner = "sindresorhus"; + repo = "pure"; + rev = "v1.22.0"; + sha256 = "177vabhvgrxdcwvc29rmfmfr96wl75hrkhymnd8qcaky2v4047jd"; + }; + } + ]; + }; +} -- cgit v1.2.3