Compare commits

...

9 Commits

Author SHA1 Message Date
9392c2eb19
feat(gchup): Add support for loading gchup environment. 2024-02-19 15:17:27 +00:00
169cf0c209
feat(greet): Add TODO.md
Automatically display `~/TODO.md` if glow is installed
2024-02-19 15:16:14 +00:00
0100d1c64f
feat(theme): Add theme support
Add support for both pywal and theme.sh terminal themes
2024-02-19 15:14:55 +00:00
654a2ad327 fix(prompt)!: New NerdFont glyphs
Use the new NerdFont glyphs so that the git branch portion of the prompt
displays correctly.
BREAKING CHANGE: Any install using old NerdFonts will display incorrect
glyphs, This should be resolved by updating your NerdFont.
2024-02-19 15:13:34 +00:00
2ad568db03
feat(keyboard): Use paste and quote magic
Use both bracketed-paste-magic and url-quote-magic to make pasting urls
into the terminal a little nicer.
NOTE: In rare cases this can break things, and will slow down pasting.
2024-02-19 15:12:31 +00:00
cd0ec0c563
fix(hooks): Fix glow hook overriding glow command
Fix the issue where as the glow hook was called glow it would be called
instead of the command glow.
2024-02-19 14:57:25 +00:00
6a7f432e33
refactor(dir_aliases): Change Projects
Change projects hash alias to try `$Z_PROJECT_DIR` first before using
`$HOME/Projects`
2024-02-19 14:54:53 +00:00
1a18c13306
feat(aliases): add gp (goProject) alias
Add a simple alias that finds all projects in `$Z_PROJECT_DIR` if set
otherwise searches `$HOME/Projects`
2024-02-19 14:52:56 +00:00
08539a0de6
feat(aliases): Add support for eza
Use eza first, then exa to replace ls and tree
2024-02-19 14:51:24 +00:00
9 changed files with 55 additions and 8 deletions

View File

@ -34,7 +34,10 @@
## Use Exa instead of ls
## REQUIRES NERD FONT
has exa && alias ls='exa --icons --group-directories-first'
has eza && EXA=eza || EXA=exa
has "$EXA" && alias ls="$EXA --icons --group-directories-first"
has "$EXA" && alias tree="$EXA --icons --group-directories-first --tree"
unset EXA
## Shorten xdg-open
has xdg-open && alias xopen='xdg-open'
@ -72,6 +75,8 @@ has wineselect && alias ws='source wineselect'
## zero a terminal session
alias zero='dirs -c && clear'
has fzf && alias gp='cd `find ${Z_PROJECT_DIR:-$HOME/Projects} -type d -name .git | sed "s/.git//" | fzf --preview="cd {} && git log"`'
#########################
# FileType Associations #
# extension=program #

View File

@ -6,5 +6,5 @@ hash -d dx="$HOME/Documents"
hash -d dl="$HOME/Downloads"
hash -d cn="${XDG_CONFIG_HOME:-$HOME/.config}"
hash -d px="$HOME/Pictures"
hash -d pr="$HOME/Projects"
hash -d pr="${Z_PROJECT_DIR:-$HOME/Projects}"
# vim: ft=zsh

1
greet
View File

@ -15,3 +15,4 @@ if [ -d "$HOME/tmp" ]; then
fi
has randomVerse && randomVerse
has colours.sh && colours.sh
has glow && [ -f ~/TODO.md ] && glow ~/TODO.md

2
hooks
View File

@ -3,7 +3,7 @@ for file in $(find $ZDOTDIR/hooks.d -type f); do
source "$file"
done
add-zsh-hook -Uz chpwd glow
add-zsh-hook -Uz chpwd _hook_glow
add-zsh-hook -Uz chpwd osc7
add-zsh-hook -Uz precmd termtitle
add-zsh-hook -Uz precmd osc113

View File

@ -1,5 +1,5 @@
## Load readme with glow (if available)
glow() {
_hook_glow() {
has glow || return 0
find $PWD -maxdepth 1 -iname 'readme.md' -exec glow {} \;
}

View File

@ -15,6 +15,8 @@ zle -N history-beginning-search-backward-end \
history-search-end
zle -N history-beginning-search-forward-end \
history-search-end
zle -N bracketed-paste bracketed-paste-magic
zle -N self-insert url-quote-magic
[[ -n "${key[Home]}" ]] && bindkey "${key[Home]}" beginning-of-line
[[ -n "${key[End]}" ]] && bindkey "${key[End]}" end-of-line

8
prompt
View File

@ -11,16 +11,16 @@ autoload -Uz vcs_info
zstyle ':vcs_info:*' enable git
## Set icons for Staged and Unstaged Changes
zstyle ':vcs_info:git*' stagedstr "%{%F{green%}%} %{%f%}"
zstyle ':vcs_info:git*' unstagedstr "%{%F{red%}%} %{%f%}"
zstyle ':vcs_info:git*' stagedstr "%{%F{green%}%}󰄳 %{%f%}"
zstyle ':vcs_info:git*' unstagedstr "%{%F{red%}%}󰅙 %{%f%}"
## Enable check for changes (CPU-intensive)
## DISABLE THIS ON LOW POWER SYSTEMS
zstyle ':vcs_info:git*' check-for-changes true
## Set format for Repo Information
zstyle ':vcs_info:git*' formats "-(%{%F{203}%} %{%f%}%s:%{%F{2}%}שׂ %{%f%}%b %u%c)"
zstyle ':vcs_info:git*' actionformats "-(%{%F{203}%} %{%f%}%s:%{%F{2}%}שׂ %{%f%}%b %u%c)(%a)"
zstyle ':vcs_info:git*' formats "-(%{%F{203}%} %{%f%}%s:%{%F{2}%} %{%f%}%b %u%c)"
zstyle ':vcs_info:git*' actionformats "-(%{%F{203}%} %{%f%}%s:%{%F{2}%} %{%f%}%b %u%c)(%a)"
## do precmd stuff
_vcsinfo() {

32
theme Normal file
View File

@ -0,0 +1,32 @@
# Attempt to load pywal theme first (unless disabled)
if has 'wal' ; then
if [[ -z $NO_PYWAL ]]; then
if [[ -e $XDG_CACHE_HOME/wal/sequences ]]; then
cat $XDG_CACHE_HOME/wal/sequences && return
fi
wal -qnR && return
fi
fi
# Load theme.sh theme uses theme_history to set
if has 'theme.sh'; then
# Load the last set theme automatically
[ -e ~/.config/.theme_history ] && theme.sh "$(theme.sh -l|tail -n1)"
# Toggle between last set themes
last_theme() {
theme.sh "$(theme.sh -l | tail -n2 | head -n1)"
}
zle -N last_theme
bindkey '^o' last_theme
alias th='theme.sh -i'
alias thl='theme.sh --light -i'
alias thd='theme.sh --dark -i'
fi
# vim: ft=zsh

7
zshrc
View File

@ -14,6 +14,8 @@ autoload -U run-help
autoload -U +X compinit
autoload -U edit-command-line
autoload -U add-zsh-hook
autoload -U url-quote-magic
autoload -U bracketed-paste-magic
## zmodload Modules
zmodload zsh/complist
@ -35,6 +37,7 @@ source ${ZDOTDIR}/prompt
source ${ZDOTDIR}/keyboard
source ${ZDOTDIR}/history
source ${ZDOTDIR}/hooks
source ${ZDOTDIR}/theme
## Set options
@ -72,6 +75,10 @@ if [[ -d "/home/linuxbrew" ]]; then
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
fi
if [[ -f ${XDG_DATA_HOME:="$HOME/.local/share"}/ghcup/env ]]; then
source ${XDG_DATA_HOME:="$HOME/.local/share"}/ghcup/env
fi
## Configure Plugins
export ZSH_AUTOSUGGEST_STRATEGY=(completion history) # suggest from completion then history
export ZSH_AUTOSUGGEST_USE_ASYNC=1 # make async for SPEED