diff options
author | Shubham Saini <ssaini@fispan.com> | 2023-09-30 03:22:05 +0000 |
---|---|---|
committer | Shubham Saini <ssaini@fispan.com> | 2023-09-30 03:22:05 +0000 |
commit | 88a10686f7cd9e15feb8d3464c20749dbd51f7c4 (patch) | |
tree | 95bf4dc5b411986b33b4c8038a87eab13209dc11 | |
parent | 1a1e7a13b015932119770e4a0e550de0dc83268b (diff) |
zsh: vim mode
-rw-r--r-- | darwin/home.nix | 53 | ||||
-rw-r--r-- | hosts/morpheus/configuration.nix | 1 | ||||
-rw-r--r-- | hosts/oracle/configuration.nix | 13 |
3 files changed, 53 insertions, 14 deletions
diff --git a/darwin/home.nix b/darwin/home.nix index ffed46f..e0b1bb0 100644 --- a/darwin/home.nix +++ b/darwin/home.nix | |||
@@ -27,6 +27,7 @@ | |||
27 | kubectl | 27 | kubectl |
28 | kubelogin-oidc | 28 | kubelogin-oidc |
29 | terraform | 29 | terraform |
30 | kops | ||
30 | k9s | 31 | k9s |
31 | kubernetes-helm | 32 | kubernetes-helm |
32 | python38 | 33 | python38 |
@@ -45,7 +46,7 @@ | |||
45 | 46 | ||
46 | home.sessionVariables = { | 47 | home.sessionVariables = { |
47 | PATH = "$PATH:$HOME/.bin"; | 48 | PATH = "$PATH:$HOME/.bin"; |
48 | VISUAL = "nvim"; | 49 | EDITOR = "nvim"; |
49 | MANPAGER = "nvim +Man!"; | 50 | MANPAGER = "nvim +Man!"; |
50 | }; | 51 | }; |
51 | 52 | ||
@@ -53,22 +54,56 @@ | |||
53 | programs.zsh = { | 54 | programs.zsh = { |
54 | enable = true; | 55 | enable = true; |
55 | enableCompletion = true; | 56 | enableCompletion = true; |
57 | enableAutosuggestions = true; | ||
58 | dotDir = ".zsh"; | ||
59 | history = { | ||
60 | ignoreAllDups = true; | ||
61 | path = "$HOME/.zsh/history"; | ||
62 | }; | ||
63 | initExtra = '' | ||
64 | zstyle ':completion:*' menu select | ||
65 | 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:|=*' | ||
66 | zmodload zsh/complist | ||
67 | bindkey -M menuselect 'h' vi-backward-char | ||
68 | bindkey -M menuselect 'k' vi-up-line-or-history | ||
69 | bindkey -M menuselect 'l' vi-forward-char | ||
70 | bindkey -M menuselect 'j' vi-down-line-or-history | ||
71 | bindkey '^f' autosuggest-accept | ||
72 | source ${pkgs.zsh-vi-mode}/share/zsh-vi-mode/zsh-vi-mode.plugin.zsh | ||
73 | zvm_after_init_commands+=('source ${pkgs.fzf}/share/fzf/completion.zsh && source ${pkgs.fzf}/share/fzf/key-bindings.zsh') | ||
74 | ''; | ||
56 | shellAliases = { | 75 | shellAliases = { |
57 | ll = "ls -l"; | 76 | ".." = "cd .."; |
77 | l = "ls --color -al"; | ||
78 | ls = "ls --color"; | ||
58 | v = "nvim"; | 79 | v = "nvim"; |
59 | o = "xdg-open"; | 80 | o = "xdg-open"; |
60 | t = "tmux"; | 81 | t = "tmux"; |
61 | f = "lf"; | 82 | f = "lf"; |
83 | tf = "terraform"; | ||
84 | k = "kubectl"; | ||
85 | gst = "git status --short"; | ||
86 | ga = "git add"; | ||
87 | gp = "git push"; | ||
88 | gl = "git log --oneline --decorate --graph"; | ||
89 | gc = "git commit -v -S"; | ||
90 | gd = "git diff --minimal"; | ||
62 | }; | 91 | }; |
63 | oh-my-zsh = { | 92 | plugins = [ |
64 | enable = true; | 93 | { |
65 | plugins = [ "git" "kubectl" "sudo" "terraform" "kops" ]; | 94 | name = "pure"; |
66 | theme = "robbyrussell"; | 95 | src = pkgs.fetchFromGitHub { |
67 | }; | 96 | owner = "sindresorhus"; |
97 | repo = "pure"; | ||
98 | rev = "v1.22.0"; | ||
99 | sha256 = "177vabhvgrxdcwvc29rmfmfr96wl75hrkhymnd8qcaky2v4047jd"; | ||
100 | }; | ||
101 | } | ||
102 | ]; | ||
68 | }; | 103 | }; |
69 | programs.fzf = { | 104 | programs.fzf = { |
70 | enable = true; | 105 | enable = true; |
71 | enableZshIntegration = true; | 106 | enableZshIntegration = false; |
72 | defaultOptions = [ "--height 40%" "--layout=reverse" "--border" ]; | 107 | defaultOptions = [ "--height 40%" "--layout=reverse" "--border" ]; |
73 | }; | 108 | }; |
74 | programs.git = { | 109 | programs.git = { |
@@ -106,7 +141,7 @@ | |||
106 | open = '' | 141 | open = '' |
107 | %{{ | 142 | %{{ |
108 | case $(file --mime-type -Lb $f) in | 143 | case $(file --mime-type -Lb $f) in |
109 | text/*) lf -remote "send $id \$$VISUAL \$fx";; | 144 | text/*) lf -remote "send $id \$$EDITOR \$fx";; |
110 | *) for f in $fx; do $OPENER $f > /dev/null 2> /dev/null & done;; | 145 | *) for f in $fx; do $OPENER $f > /dev/null 2> /dev/null & done;; |
111 | esac | 146 | esac |
112 | }} | 147 | }} |
diff --git a/hosts/morpheus/configuration.nix b/hosts/morpheus/configuration.nix index 7b39b4b..395494c 100644 --- a/hosts/morpheus/configuration.nix +++ b/hosts/morpheus/configuration.nix | |||
@@ -18,6 +18,7 @@ | |||
18 | ''; | 18 | ''; |
19 | }; | 19 | }; |
20 | 20 | ||
21 | environment.pathsToLink = ["/share/zsh"]; | ||
21 | system.activationScripts.applications.text = pkgs.lib.mkForce ( | 22 | system.activationScripts.applications.text = pkgs.lib.mkForce ( |
22 | '' | 23 | '' |
23 | echo "setting up ~/Applications..." >&2 | 24 | echo "setting up ~/Applications..." >&2 |
diff --git a/hosts/oracle/configuration.nix b/hosts/oracle/configuration.nix index 500906b..9782959 100644 --- a/hosts/oracle/configuration.nix +++ b/hosts/oracle/configuration.nix | |||
@@ -35,11 +35,14 @@ | |||
35 | 35 | ||
36 | nixpkgs.config.allowUnfree = true; | 36 | nixpkgs.config.allowUnfree = true; |
37 | 37 | ||
38 | environment.systemPackages = with pkgs; [ | 38 | environment = { |
39 | neovim | 39 | pathsToLink = ["/share/zsh"]; |
40 | git | 40 | systemPackages = with pkgs; [ |
41 | interception-tools | 41 | neovim |
42 | ]; | 42 | git |
43 | interception-tools | ||
44 | ]; | ||
45 | }; | ||
43 | 46 | ||
44 | services = { | 47 | services = { |
45 | xserver = { | 48 | xserver = { |