chore(zsh): cleanup zsh config

This commit is contained in:
Afonso Franco 2025-02-05 17:02:50 +00:00
parent dc19d04ba3
commit 8406b0395a
Signed by: afonso
SSH key fingerprint: SHA256:gkVPzsQQJzqi21ntQBV6pXTx4bYI53rFGI4XtvCpwd4
4 changed files with 20 additions and 53 deletions

View file

@ -1,11 +1,6 @@
#This is used to reload the instance
if [[ ! $(tty) =~ ^/dev/tty[0-9]*$ ]]; then
TRAPUSR1() {
if [[ -o INTERACTIVE ]]; then
exec "${SHELL}"
fi
}
fi
export EDITOR=nvim
export VISUAL=nvim
export READER=mupdf
export XDG_CONFIG_HOME="${HOME}/.config"
export XDG_CACHE_HOME="${HOME}/.cache"
@ -13,17 +8,16 @@ export XDG_DATA_HOME="${HOME}/.local/share"
export XDG_STATE_HOME="${HOME}/.local/state"
export XDG_RUNTIME_DIR=/tmp
# Add exports
export GOPATH="$HOME/go"
export GOBIN="$GOPATH/bin"
# OS-specific exports
if [[ $(uname) == "Darwin" ]]; then
#ONLY MACOS
export JAVA_HOME=$(/usr/libexec/java_home)
export GEM_HOME=$HOME/.gem
export PATH="/opt/homebrew/bin:$PATH"
export PATH="/opt/homebrew/opt/texlive/bin:$PATH"
export GEM_HOME=$HOME/.gem
export PATH=$PATH:$GEM_HOME/bin
else
#ONLY LINUX
export LIBVA_DRIVER_NAME=nvidia
fi
@ -34,12 +28,6 @@ export PATH="$HOME/.local/bin:$PATH"
export PATH="$HOME/go/bin:$PATH"
export PATH="$HOME/.cargo/bin:$PATH"
export PATH="$HOME/.ghcup/bin:$PATH"
export PATH="$HOME/.miniforge3/bin:$PATH"
export PATH="$HOME/.cabal/bin:$PATH"
export PATH="$XDG_CONFIG_HOME/emacs/bin:$PATH"
export GOPATH="$HOME/go"
export GOBIN="$GOPATH/bin"
. "$HOME/.cargo/env"

View file

@ -1,26 +1,9 @@
# Setup History
HISTFILE=${ZDOTDIR:-$HOME}/.zsh_history
HISTSIZE=100000000
SAVEHIST=100000000
setopt BANG_HIST # Treat the '!' character specially during expansion.
setopt EXTENDED_HISTORY # Write the history file in the ":start:elapsed;command" format.
setopt INC_APPEND_HISTORY # Write to the history file immediately, not when the shell exits.
setopt SHARE_HISTORY # Share history between all sessions.
setopt HIST_FIND_NO_DUPS # Do not display a line previously found.
setopt HIST_IGNORE_SPACE # Don't record an entry starting with a space.
setopt HIST_REDUCE_BLANKS # Remove superfluous blanks before recording entry.
setopt HIST_SAVE_NO_DUPS
setopt HIST_IGNORE_ALL_DUPS
setopt HIST_VERIFY
if [[ -z "$TMUX" ]]; then
tmux new-session -A -s 0
fi
#Set EDITOR AND READER
export EDITOR=nvim
export VISUAL=nvim
export READER=mupdf
#Prompt
source $ZDOTDIR/setup-history.zsh
source $ZDOTDIR/prompts/simple-two-line.zsh
source $ZDOTDIR/functions.zsh
source $ZDOTDIR/plugins.zsh

View file

@ -16,9 +16,7 @@ function routevpn {
alias ls="eza --icons -l --sort type"
alias lg="lazygit"
alias calcurse-caldav='CALCURSE_CALDAV_PASSWORD=$(keyring get caldav afonso) calcurse-caldav'
alias routes="netstat -rn -f inet"
alias lc='lazygit --work-tree="$HOME" --git-dir="$HOME/dotfiles"'
alias config='git --work-tree="$HOME" --git-dir="$HOME/dotfiles"'

View file

@ -1,23 +1,21 @@
# Completions
ZSH_AUTOSUGGEST_STRATEGY=(match_prev_cmd history completion)
zstyle ':completion:*' rehash true
fpath+=$ZDOTDIR/plugins/zsh-completions/src
autoload -U compinit && compinit
# Autosuggestions
ZSH_AUTOSUGGEST_STRATEGY=(match_prev_cmd history completion)
source $ZDOTDIR/plugins/zsh-autosuggestions/zsh-autosuggestions.plugin.zsh
# Syntax Highlighting
source $ZDOTDIR/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.plugin.zsh
source $ZDOTDIR/plugins/zsh-history-substring-search/zsh-history-substring-search.plugin.zsh
# Fzf-Tab
zvm_after_init_commands+=('source <(fzf --zsh) && enable-fzf-tab')
source $ZDOTDIR/plugins/fzf-tab/fzf-tab.plugin.zsh
# Vi mode
source $ZDOTDIR/plugins/zsh-vi-mode/zsh-vi-mode.plugin.zsh
# MacOS
source $ZDOTDIR/plugins/zsh-macos.plugin.zsh
source $ZDOTDIR/plugins/zsh-git.plugin.zsh
source $ZDOTDIR/plugins/zsh-sudo.plugin.zsh
source $ZDOTDIR/plugins/zsh-tmux/zsh-tmux.plugin.zsh