From 372ff20917204958c9845db89e4e052fdcb0493f Mon Sep 17 00:00:00 2001 From: cy Date: Wed, 25 Dec 2024 04:58:40 +0000 Subject: [PATCH] Zsh fast --- home/yt/common.nix | 2 +- home/zsh/default.nix | 24 +++++++----------------- hosts/common.nix | 7 +++++-- 3 files changed, 13 insertions(+), 20 deletions(-) diff --git a/home/yt/common.nix b/home/yt/common.nix index c7b2bb9..1bb3b85 100644 --- a/home/yt/common.nix +++ b/home/yt/common.nix @@ -2,7 +2,7 @@ { imports = [ ../tmux.nix - ../fish.nix + ../zsh ]; home.sessionVariables = { diff --git a/home/zsh/default.nix b/home/zsh/default.nix index fabb7ba..a62b19d 100644 --- a/home/zsh/default.nix +++ b/home/zsh/default.nix @@ -1,4 +1,4 @@ -{ ... }: +{ pkgs, ... }: { programs.zsh = { enable = true; @@ -9,28 +9,22 @@ "completion" ]; }; + enableCompletion = true; syntaxHighlighting = { enable = true; highlighters = [ "brackets" ]; }; autocd = true; defaultKeymap = "emacs"; - antidote = { - enable = true; - useFriendlyNames = true; # why not? - plugins = [ - "zsh-users/zsh-completions" - "romkatv/powerlevel10k" - "Aloxaf/fzf-tab" - "ohmyzsh/ohmyzsh path:plugins/colored-man-pages" - ]; - }; + + initExtraFirst = "source ${pkgs.zsh-powerlevel10k}/share/zsh-powerlevel10k/powerlevel10k.zsh-theme"; + history = { ignoreDups = true; ignoreAllDups = true; ignoreSpace = true; - save = 50000; - size = 50000; + save = 10000; + size = 10000; append = true; }; historySubstringSearch = { @@ -40,10 +34,6 @@ }; initExtra = '' source ${./p10k.zsh} - zstyle ':completion:*' matcher-list 'm:{a-z}={A-Za-z}' - zstyle ':completion:*' menu no - zstyle ':fzf-tab:complete:cd:*' fzf-preview 'ls $realpath' - zstyle ':fzf-tab:complete:__zoxide_z:*' fzf-prewview 'ls $realpath' #disable control+s to pause terminal unsetopt FLOW_CONTROL diff --git a/hosts/common.nix b/hosts/common.nix index a34e76b..d2c3c00 100644 --- a/hosts/common.nix +++ b/hosts/common.nix @@ -26,6 +26,9 @@ programs.command-not-found.enable = false; programs.nix-index.enable = true; - users.users.yt.shell = pkgs.fish; - programs.fish.enable = true; + users.users.yt.shell = pkgs.zsh; + programs.zsh.enable = true; + + # needed for zsh.enableCompletion to work + environment.pathsToLink = [ "/share/zsh" ]; }