summaryrefslogtreecommitdiff
path: root/modules/zsh.nix
diff options
context:
space:
mode:
authorShubham Saini <ssaini@fispan.com>2023-09-30 03:32:40 +0000
committerShubham Saini <ssaini@fispan.com>2023-09-30 03:32:40 +0000
commitfdb9ba23a2cff4b50a699eb89435aa9a9de77891 (patch)
tree025d7259ddaee08b1d11678ce6f2ba729c10b8cc /modules/zsh.nix
parent88a10686f7cd9e15feb8d3464c20749dbd51f7c4 (diff)
nix: trying modules
Diffstat (limited to 'modules/zsh.nix')
-rw-r--r--modules/zsh.nix52
1 files changed, 52 insertions, 0 deletions
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 @@
1{
2 programs.zsh = {
3 enable = true;
4 enableCompletion = true;
5 enableAutosuggestions = true;
6 dotDir = ".zsh";
7 history = {
8 ignoreAllDups = true;
9 path = "$HOME/.zsh/history";
10 };
11 initExtra = ''
12 zstyle ':completion:*' menu select
13 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:|=*'
14 zmodload zsh/complist
15 bindkey -M menuselect 'h' vi-backward-char
16 bindkey -M menuselect 'k' vi-up-line-or-history
17 bindkey -M menuselect 'l' vi-forward-char
18 bindkey -M menuselect 'j' vi-down-line-or-history
19 bindkey '^f' autosuggest-accept
20 source ${pkgs.zsh-vi-mode}/share/zsh-vi-mode/zsh-vi-mode.plugin.zsh
21 zvm_after_init_commands+=('source ${pkgs.fzf}/share/fzf/completion.zsh && source ${pkgs.fzf}/share/fzf/key-bindings.zsh')
22 '';
23 shellAliases = {
24 ".." = "cd ..";
25 l = "ls --color -al";
26 ls = "ls --color";
27 v = "nvim";
28 o = "xdg-open";
29 t = "tmux";
30 f = "lf";
31 tf = "terraform";
32 k = "kubectl";
33 gst = "git status --short";
34 ga = "git add";
35 gp = "git push";
36 gl = "git log --oneline --decorate --graph";
37 gc = "git commit -v -S";
38 gd = "git diff --minimal";
39 };
40 plugins = [
41 {
42 name = "pure";
43 src = pkgs.fetchFromGitHub {
44 owner = "sindresorhus";
45 repo = "pure";
46 rev = "v1.22.0";
47 sha256 = "177vabhvgrxdcwvc29rmfmfr96wl75hrkhymnd8qcaky2v4047jd";
48 };
49 }
50 ];
51 };
52}