From d8f14a58e674f57a8a630270694fc01f35af03a1 Mon Sep 17 00:00:00 2001 From: jiriks74 Date: Fri, 22 Nov 2024 01:43:38 +0100 Subject: [PATCH] feat(plugins): Move from `zplug` to `antidote`, add 6 plugins Plugins added: - zsh-users/zsh-history-substring-search # ZSH port of Fish history search (up arrow) - belak/zsh-utils completion # Load and initialize the built-in zsh completion system - belak/zsh-utils editor # Override and fill in the gaps of the default keybinds - belak/zsh-utils utility kind:defer # Common shell utilities - ohmyzsh/ohmyzsh plugins/colored-man-pages # This plugin adds colors to man pages Plugins readded: - ohmyzsh/ohmyzsh plugins/dirhistory --- zsh.nix | 91 +++++++++++++++++++++++++++++---------------------------- 1 file changed, 47 insertions(+), 44 deletions(-) diff --git a/zsh.nix b/zsh.nix index c148c5c..3e8d1c0 100644 --- a/zsh.nix +++ b/zsh.nix @@ -43,73 +43,73 @@ prj = "$HOME/Projects/"; }; - zplug = { + antidote = { enable = true; plugins = [ - { - name = "romkatv/powerlevel10k"; - tags = ["as:theme" "depth:1"]; - } # Installations with additional options. For the list of options, please refer to Zplug README. - {name = "z-shell/F-Sy-H";} # Feature-rich Syntax Highlighting for Zsh + "getantidote/use-omz" # Handle OMZ dependencies + "ohmyzsh/ohmyzsh path:lib" # Load OMZ's library + "ohmyzsh/ohmyzsh path:plugins/colored-man-pages" # Load OMZ plugins + # "ohmyzsh/ohmyzsh path:plugins/magic-enter" + "ohmyzsh/ohmyzsh path:plugins/command-not-found" # Provide suggested packages to be installed if a command cannot be found + "ohmyzsh/ohmyzsh path:plugins/dirhistory kind:defer" # shortcuts for navigating directory history and hierarchy + + "romkatv/powerlevel10k kind:fpath" # A Zsh theme + + "z-shell/F-Sy-H kind:defer" # Feature-rich Syntax Highlighting for Zsh + "zsh-users/zsh-autosuggestions kind:defer" # Simple plugin installation # { name = "zsh-users/zsh-syntax-highlighting"; } - {name = "zsh-users/zsh-completions";} # Adds some missing completions to zsh - {name = "zsh-users/zsh-autosuggestions";} # Simple plugin installation - {name = "MichaelAquilina/zsh-you-should-use";} # Did you forget to use an alias? - {name = "jiriks74/git-aliases";} # Aliases for git - { - name = "babarot/enhancd"; - tags = ["use:init.sh"]; - } # Includes simmilar functionality to zsh-z - {name = "supercrabtree/k";} # Directory listings for Zsh with git features. - { - name = "plugins/command-not-found"; - tags = ["from:oh-my-zsh"]; - } - { - name = "gko/ssh-connect"; - tags = ["use:ssh-connect.sh"]; - } # List of most used ssh connections - {name = "agkozak/zsh-z";} # Jump arount your filesystem with ease - {name = "sineto/web-search";} - {name = "zsh-users/zaw";} # Desctiptions for command outputs (afaik)zplug "plugins/git", from:oh-my-zsh - # { name = "plugins/dirhistory"; tags = [ "from:oh-my-zsh" ]; } + "zsh-users/zsh-completions kind:fpath path:src" # Adds some missing completions to zsh + "zsh-users/zsh-history-substring-search kind:defer" # ZSH port of Fish history search (up arrow) + + "jiriks74/git-aliases kind:defer" # Aliases for git + "MichaelAquilina/zsh-you-should-use" # Did you forget to use an alias? + + "babarot/enhancd" # Includes simmilar functionality to zsh-z + "agkozak/zsh-z" # Jump arount your filesystem with ease + "supercrabtree/k" # Directory listings for Zsh with git features. + + "belak/zsh-utils path:completion" # Load and initialize the built-in zsh completion system + "belak/zsh-utils path:editor" # Override and fill in the gaps of the default keybinds + "belak/zsh-utils path:utility kind:defer" # Common shell utilities + + "gko/ssh-connect" # List of most used ssh connections + "sineto/web-search kind:defer" # zsh plugin for web searching + "zsh-users/zaw" # Desctiptions for command outputs (afaik)zplug "plugins/git", from:oh-my-zsh ]; }; initExtraFirst = '' if [[ "''${ZSH_PROFILE}" -eq 1 ]]; then zmodload zsh/zprof # Profiling. Enable `zprof` at the end of initExtra too. - else - # Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc. - # Initialization code that may require console input (password prompts, [y/n] - # confirmations, etc.) must go above this block; everything else may go below. - if [[ -r "''${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-''${(%):-%n}.zsh" ]]; then - source "''${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-''${(%):-%n}.zsh" - fi + # else + # # Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc. + # # Initialization code that may require console input (password prompts, [y/n] + # # confirmations, etc.) must go above this block; everything else may go below. + # if [[ -r "''${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-''${(%):-%n}.zsh" ]]; then + # source "''${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-''${(%):-%n}.zsh" + # fi fi ''; initExtra = '' + # From antidote (for p10k): + # prompts: + # with prompt plugins, remember to add this to your .zshrc: + # To customize prompt, run `p10k configure` or edit ~/.p10k.zsh. + [[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh + autoload -Uz promptinit && promptinit && prompt powerlevel10k + # Remove nix from path if we are in a container (distrobox) if [ -v DISTROBOX_ENTER_PATH ]; then export PATH=$(echo $PATH | tr ':' '\n' | grep -vE '/nix/|/run/wrappers|\.nix-profile|/etc/profiles/per-user/jirka/bin|/run/current-system/sw/bin' | tr '\n' ':') export PATH=$(echo $PATH | sed 's/:$//') fi - # To customize prompt, run `p10k configure` or edit ~/.p10k.zsh. - [[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh - if [ -v ASCIINEMA_REC ]; then _zsh_autosuggest_disable fi - # Custom ZSH Binds - bindkey '^ ' autosuggest-accept - bindkey "^[[H" beginning-of-line - bindkey "^[[F" end-of-line - bindkey "^[[1;5C" forward-word - bindkey "^[[1;5D" backward-word - bindkey "^[[3~" delete-char + bindkey '^ ' autosuggest-accept # Bind CTRL + Space # Extracting ex () @@ -150,6 +150,7 @@ if [[ "''${ZSH_PROFILE}" -eq 1 ]]; then zprof fi + ''; localVariables = { @@ -225,6 +226,8 @@ home.packages = with pkgs; [ nix-zsh-completions + python312Packages.pygments # For antidote + # tools for aliases, etc. lsd bat