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
This commit is contained in:
Jiří Štefka 2024-11-22 01:43:38 +01:00
parent 1638c8ff98
commit d8f14a58e6
Signed by: jiriks74
GPG Key ID: 1D5E30D3DB2264DE

91
zsh.nix

@ -43,73 +43,73 @@
prj = "$HOME/Projects/"; prj = "$HOME/Projects/";
}; };
zplug = { antidote = {
enable = true; enable = true;
plugins = [ plugins = [
{ "getantidote/use-omz" # Handle OMZ dependencies
name = "romkatv/powerlevel10k"; "ohmyzsh/ohmyzsh path:lib" # Load OMZ's library
tags = ["as:theme" "depth:1"]; "ohmyzsh/ohmyzsh path:plugins/colored-man-pages" # Load OMZ plugins
} # Installations with additional options. For the list of options, please refer to Zplug README. # "ohmyzsh/ohmyzsh path:plugins/magic-enter"
{name = "z-shell/F-Sy-H";} # Feature-rich Syntax Highlighting for Zsh "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-syntax-highlighting"; }
{name = "zsh-users/zsh-completions";} # Adds some missing completions to zsh "zsh-users/zsh-completions kind:fpath path:src" # Adds some missing completions to zsh
{name = "zsh-users/zsh-autosuggestions";} # Simple plugin installation "zsh-users/zsh-history-substring-search kind:defer" # ZSH port of Fish history search (up arrow)
{name = "MichaelAquilina/zsh-you-should-use";} # Did you forget to use an alias?
{name = "jiriks74/git-aliases";} # Aliases for git "jiriks74/git-aliases kind:defer" # Aliases for git
{ "MichaelAquilina/zsh-you-should-use" # Did you forget to use an alias?
name = "babarot/enhancd";
tags = ["use:init.sh"]; "babarot/enhancd" # Includes simmilar functionality to zsh-z
} # Includes simmilar functionality to zsh-z "agkozak/zsh-z" # Jump arount your filesystem with ease
{name = "supercrabtree/k";} # Directory listings for Zsh with git features. "supercrabtree/k" # Directory listings for Zsh with git features.
{
name = "plugins/command-not-found"; "belak/zsh-utils path:completion" # Load and initialize the built-in zsh completion system
tags = ["from:oh-my-zsh"]; "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
{
name = "gko/ssh-connect"; "gko/ssh-connect" # List of most used ssh connections
tags = ["use:ssh-connect.sh"]; "sineto/web-search kind:defer" # zsh plugin for web searching
} # List of most used ssh connections "zsh-users/zaw" # Desctiptions for command outputs (afaik)zplug "plugins/git", from:oh-my-zsh
{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" ]; }
]; ];
}; };
initExtraFirst = '' initExtraFirst = ''
if [[ "''${ZSH_PROFILE}" -eq 1 ]]; then if [[ "''${ZSH_PROFILE}" -eq 1 ]]; then
zmodload zsh/zprof # Profiling. Enable `zprof` at the end of initExtra too. zmodload zsh/zprof # Profiling. Enable `zprof` at the end of initExtra too.
else # else
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc. # # Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
# Initialization code that may require console input (password prompts, [y/n] # # Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below. # # 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 # if [[ -r "''${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-''${(%):-%n}.zsh" ]]; then
source "''${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-''${(%):-%n}.zsh" # source "''${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-''${(%):-%n}.zsh"
fi # fi
fi fi
''; '';
initExtra = '' 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) # Remove nix from path if we are in a container (distrobox)
if [ -v DISTROBOX_ENTER_PATH ]; then 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 | 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/:$//') export PATH=$(echo $PATH | sed 's/:$//')
fi fi
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
if [ -v ASCIINEMA_REC ]; then if [ -v ASCIINEMA_REC ]; then
_zsh_autosuggest_disable _zsh_autosuggest_disable
fi fi
# Custom ZSH Binds bindkey '^ ' autosuggest-accept # Bind CTRL + Space
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
# Extracting # Extracting
ex () ex ()
@ -150,6 +150,7 @@
if [[ "''${ZSH_PROFILE}" -eq 1 ]]; then if [[ "''${ZSH_PROFILE}" -eq 1 ]]; then
zprof zprof
fi fi
''; '';
localVariables = { localVariables = {
@ -225,6 +226,8 @@
home.packages = with pkgs; [ home.packages = with pkgs; [
nix-zsh-completions nix-zsh-completions
python312Packages.pygments # For antidote
# tools for aliases, etc. # tools for aliases, etc.
lsd lsd
bat bat