-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update zsh config cleanup wip update default plugin path
- Loading branch information
1 parent
54ae135
commit 30195d5
Showing
12 changed files
with
343 additions
and
1,805 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,59 @@ | ||
ZDOTDIR=${ZDOTDIR:-$HOME/.config/zsh} | ||
INIT_PATH=$ZDOTDIR/init | ||
export ZDOTDIR=${ZDOTDIR:-$HOME/.config/zsh} | ||
export ZPLUGINDIR=${ZPLUGINDIR:-$HOME/.local/share/zsh/plugins} | ||
export ZDIR=$ZDOTDIR | ||
export KERNEL=$(uname -s) | ||
|
||
source $INIT_PATH/prompt.zsh | ||
source $INIT_PATH/tools.zsh | ||
source $INIT_PATH/zinit.zsh | ||
autoload -Uz compinit && compinit | ||
|
||
source $ZDIR/tools.zsh | ||
|
||
# Add to PATH | ||
add_path $HOME/.cargo/bin | ||
add_path $HOME/.local/bin | ||
[[ -v ZRUNTIMEDEPS ]] && add_path $ZRUNTIMEDEPS | ||
|
||
# Initialize plugins | ||
plugin jeffreytse zsh-vi-mode | ||
plugin zsh-users zsh-syntax-highlighting | ||
plugin zsh-users zsh-autosuggestions | ||
plugin Aloxaf fzf-tab | ||
plugin zsh-users zsh-completions | ||
|
||
# Shell integration hooks | ||
try_hook fzf --zsh | ||
try_hook zoxide init zsh | ||
try_hook direnv hook zsh | ||
try_hook /opt/homebrew/bin/brew shellenv | ||
try_hook atuin init zsh --disable-up-arrow | ||
|
||
# Key bindings | ||
bindkey '^r' search-hist | ||
|
||
# Aliases | ||
alias cat='bat -pp' | ||
alias md='mkdir -p' | ||
alias ll='ls -l' | ||
alias la='ls -la' | ||
alias ..='cd ..' | ||
alias ...='cd ../..' | ||
alias hist='atuin search -i' | ||
alias grep='grep --colour=auto' | ||
alias mkexe='chmod +x' | ||
alias mkmine='chown $(whoami) -R' | ||
alias lg='lazygit' | ||
alias sctl='sudo systemctl' | ||
alias spt='spotify_player' | ||
alias sqlite='litecli' | ||
alias md='mkdir -p' | ||
alias open='xdg-open' | ||
|
||
# Plugins | ||
# Linux specific aliases | ||
if [[ $KERNEL == "Linux" ]]; then | ||
alias open='xdg-open' | ||
alias sctl='sudo systemctl' | ||
fi | ||
|
||
# Use Neovim as manpager when available | ||
if command -v nvim > /dev/null; then | ||
plugin 'jeffreytse/zsh-vi-mode' | ||
export MANPAGER='nvim +Man!' | ||
fi | ||
|
||
plugin 'romkatv/powerlevel10k' | ||
plugin 'zsh-users/zsh-syntax-highlighting' | ||
plugin 'zsh-users/zsh-completions' | ||
plugin 'zsh-users/zsh-autosuggestions' | ||
plugin 'Aloxaf/fzf-tab' | ||
plugin 'hlissner/zsh-autopair' | ||
|
||
add_path $HOME/.cargo/bin | ||
add_path $HOME/.local/bin | ||
add_path $HOME/.local/share/flatpak/exports/shar | ||
add_path /var/lib/flatpak/exports/share | ||
|
||
source $INIT_PATH/cleanup.zsh | ||
# Initialize prompt | ||
source $ZDIR/prompt.zsh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,68 @@ | ||
{ pkgs, wrapPackage, ... }: | ||
wrapPackage { | ||
name = "zsh"; | ||
package = pkgs.zsh; | ||
extraArgs = "--set ZDOTDIR '${./.}' --set EDITOR nvim"; | ||
dependencies = with pkgs; [ | ||
{ | ||
pkgs, | ||
wrapPackage, | ||
symlinkJoin, | ||
combineDerivations, | ||
... | ||
}: | ||
let | ||
mkPlugins = p: combineDerivations "zsh-plugin-sources" p; | ||
mkDeps = | ||
deps: | ||
symlinkJoin { | ||
name = "zsh-runtime-dependencies"; | ||
paths = deps; | ||
}; | ||
|
||
pluginPackages = | ||
with pkgs; | ||
mkPlugins [ | ||
(fetchFromGitHub { | ||
owner = "jeffreytse"; | ||
repo = "zsh-vi-mode"; | ||
rev = "cd730cd347dcc0d8ce1697f67714a90f07da26ed"; | ||
hash = "sha256-UQo9shimLaLp68U3EcsjcxokJHOTGhOjDw4XDx6ggF4="; | ||
}) | ||
(fetchFromGitHub { | ||
owner = "zsh-users"; | ||
repo = "zsh-syntax-highlighting"; | ||
rev = "5eb677bb0fa9a3e60f0eff031dc13926e093df92"; | ||
hash = "sha256-KRsQEDRsJdF7LGOMTZuqfbW6xdV5S38wlgdcCM98Y/Q="; | ||
}) | ||
(fetchFromGitHub { | ||
owner = "zsh-users"; | ||
repo = "zsh-completions"; | ||
rev = "c160d09fddd28ceb3af5cf80e9253af80e450d96"; | ||
hash = "sha256-EG6bwbwZW9Cya/BGZ83J5YEAUdfJ0UAQC7bRG7cFL2k="; | ||
}) | ||
(fetchFromGitHub { | ||
owner = "zsh-users"; | ||
repo = "zsh-autosuggestions"; | ||
rev = "0e810e5afa27acbd074398eefbe28d13005dbc15"; | ||
hash = "sha256-85aw9OM2pQPsWklXjuNOzp9El1MsNb+cIiZQVHUzBnk="; | ||
}) | ||
(fetchFromGitHub { | ||
owner = "Aloxaf"; | ||
repo = "fzf-tab"; | ||
rev = "6aced3f35def61c5edf9d790e945e8bb4fe7b305"; | ||
hash = "sha256-EWMeslDgs/DWVaDdI9oAS46hfZtp4LHTRY8TclKTNK8="; | ||
}) | ||
]; | ||
|
||
runtimeDependencies = with pkgs; [ | ||
bat | ||
atuin | ||
jq | ||
zoxide | ||
]; | ||
in | ||
wrapPackage { | ||
name = "zsh"; | ||
package = pkgs.zsh; | ||
extraArgs = [ | ||
"--set ZDOTDIR '${./.}'" | ||
"--set ZRUNTIMEDEPS '${mkDeps runtimeDependencies}/bin'" | ||
"--set ZPLUGINDIR '${pluginPackages}'" | ||
"--set EDITOR nvim" | ||
]; | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.