summaryrefslogtreecommitdiff
path: root/users/seth/shell/zsh/default.nix
diff options
context:
space:
mode:
authorseth <[email protected]>2022-12-02 02:12:40 -0500
committerseth <[email protected]>2022-12-02 02:12:40 -0500
commitb673b76f41a1f48c38acb9b67657e097e5b8a61f (patch)
treefe0090a667d419d6a27544c492d1e911eb6541ff /users/seth/shell/zsh/default.nix
parentaca5eff381f76bc29f25191efc281ccf50cf0e3e (diff)
now *most* things work :p
Diffstat (limited to 'users/seth/shell/zsh/default.nix')
-rw-r--r--users/seth/shell/zsh/default.nix103
1 files changed, 103 insertions, 0 deletions
diff --git a/users/seth/shell/zsh/default.nix b/users/seth/shell/zsh/default.nix
new file mode 100644
index 0000000..d8e7bc6
--- /dev/null
+++ b/users/seth/shell/zsh/default.nix
@@ -0,0 +1,103 @@
+{ config, lib, pkgs, ... }:
+
+{
+ programs.zsh = {
+ enable = true;
+ enableAutosuggestions = true;
+ enableSyntaxHighlighting = true;
+ enableVteIntegration = true;
+ completionInit = ''
+ autoload -Uz bashcompinit compinit
+ local zdump="${config.xdg.cacheHome}/zsh/zdump"
+ bashcompinit
+ compinit -d "$zdump"
+ if [[ ! "$zdump.zwc" -nt "$zdump" ]]
+ then
+ zcompile "$zdump"
+ fi
+ unset zdump
+ '';
+ defaultKeymap = "emacs";
+ dotDir = ".config/zsh";
+ initExtra = ''
+ zmodload zsh/zutil
+ zmodload zsh/complist
+ zstyle ":completion::*" group-name ""
+ zstyle ":completion:*" menu "select"
+ zstyle ":completion:*" squeeze-slashes "true"
+ zstyle ":completion::*" use-cache "true"
+ zstyle ":completion::*" cache-path "$zdump"
+
+ unsetopt beep
+ unsetopt hist_beep
+ unsetopt ignore_braces
+ unsetopt list_beep
+ setopt always_to_end
+ setopt inc_append_history
+ setopt prompt_subst
+ setopt share_history
+
+ # clear backbuffer with ctrl-l
+ function clear-screen-and-scrollback() {
+ echoti civis >"$TTY"
+ printf '%b' '\e[H\e[2J' >"$TTY"
+ zle .reset-prompt
+ zle -R
+ printf '%b' '\e[3J' >"$TTY"
+ echoti cnorm >"$TTY"
+ }
+
+ zle -N clear-screen-and-scrollback
+ bindkey '^L' clear-screen-and-scrollback
+ '';
+ history = {
+ expireDuplicatesFirst = true;
+ path = "${config.xdg.stateHome}/zsh/zsh_history";
+ save = 1000;
+ size = 100;
+ };
+ plugins = [
+ {
+ name = "powerlevel10k";
+ src = pkgs.zsh-powerlevel10k;
+ file = "share/zsh-powerlevel10k/powerlevel10k.zsh-theme";
+ }
+
+ {
+ name = "zsh-completions";
+ src = pkgs.zsh-completions;
+ file = "share/zsh-completions/zsh-completions.plugin.zsh";
+ }
+
+ {
+ name = "zsh-autosuggestions";
+ src = pkgs.zsh-autosuggestions;
+ file = "share/zsh-autosuggestions/zsh-autosuggestions.zsh";
+ }
+
+ {
+ name = "zsh-syntax-highlighting";
+ src = pkgs.zsh-syntax-highlighting;
+ file = "share/zsh-syntax-highlighting/zsh-syntax-highlighting.plugin.zsh";
+ }
+
+ {
+ name = "cattppuccin-zsh-syntax-highlighting";
+ src = pkgs.fetchFromGitHub {
+ owner = "catppuccin";
+ repo = "zsh-syntax-highlighting";
+ rev = "06d519c20798f0ebe275fc3a8101841faaeee8ea";
+ sha256 = "sha256-Q7KmwUd9fblprL55W0Sf4g7lRcemnhjh4/v+TacJSfo=";
+ };
+
+ file = "themes/catppuccin_mocha-zsh-syntax-highlighting.zsh";
+ }
+
+ {
+ name = "powerlevel10k-config";
+ src = ./files;
+ file = ".p10k.zsh";
+ }
+ ];
+ };
+}