New Aliases, fixed tmux/term compability
This commit is contained in:
25
zsh/.zshrc
25
zsh/.zshrc
@@ -6,19 +6,30 @@ if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]
|
|||||||
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
|
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
|
||||||
fi
|
fi
|
||||||
POWERLEVEL9K_INSTANT_PROMPT=quiet # run instant prompt quietly
|
POWERLEVEL9K_INSTANT_PROMPT=quiet # run instant prompt quietly
|
||||||
|
# Fix for tmux compatibility
|
||||||
|
[[ $TERM == "tmux-256color" ]] && export TERM_PROGRAM="kitty"
|
||||||
# }}}
|
# }}}
|
||||||
|
|
||||||
# Environment variables {{{
|
# Environment variables {{{
|
||||||
export MYVIMRC="$HOME/.config/nvim/init.lua" # define MYVIMRC variable so you can use $MYVIMRC to access your init.lua
|
export MYVIMRC="$HOME/.config/nvim/init.lua" # define MYVIMRC variable so you can use $MYVIMRC to access your init.lua
|
||||||
|
export MANPAGER="nvim +Man!"
|
||||||
|
|
||||||
|
## Use IINA CLI
|
||||||
|
export YTFZF_PLAYER="iina"
|
||||||
# }}}
|
# }}}
|
||||||
|
|
||||||
|
# # ~/.config/secrets/.env
|
||||||
|
for f in ~/.config/secrets/.env; do
|
||||||
|
export $(grep -v '^#' "$f" | xargs)
|
||||||
|
done
|
||||||
|
|
||||||
# Load Oh My Zsh {{{
|
# Load Oh My Zsh {{{
|
||||||
export ZSH="$XDG_CONFIG_HOME/.oh-my-zsh" # set path to Oh My Zsh
|
export ZSH="$XDG_CONFIG_HOME/.oh-my-zsh" # set path to Oh My Zsh
|
||||||
|
ZSH_THEME="powerlevel10k/powerlevel10k" # set theme to Powerlevel10k BEFORE loading Oh My Zsh
|
||||||
source $ZSH/oh-my-zsh.sh # load Oh My Zsh framework (plugins, completions, themes)
|
source $ZSH/oh-my-zsh.sh # load Oh My Zsh framework (plugins, completions, themes)
|
||||||
# }}}
|
# }}}
|
||||||
|
|
||||||
# Theme and prompt {{{
|
# Theme and prompt {{{
|
||||||
ZSH_THEME="powerlevel10k/powerlevel10k" # set theme to Powerlevel10k
|
|
||||||
source $XDG_CONFIG_HOME/p10k/.p10k.zsh # load Powerlevel10k configuration
|
source $XDG_CONFIG_HOME/p10k/.p10k.zsh # load Powerlevel10k configuration
|
||||||
# }}}
|
# }}}
|
||||||
|
|
||||||
@@ -30,6 +41,9 @@ eval "$(zoxide init zsh)" # enable zoxide for fast directory jumping
|
|||||||
# Keybindings {{{
|
# Keybindings {{{
|
||||||
bindkey -v # enable vi-style keybindings
|
bindkey -v # enable vi-style keybindings
|
||||||
export KEYTIMEOUT=1 # make ESC faster when using vi keybindings
|
export KEYTIMEOUT=1 # make ESC faster when using vi keybindings
|
||||||
|
# Fix backspace for SSH connections
|
||||||
|
# bindkey "^?" backward-delete-char
|
||||||
|
# bindkey "^H" backward-delete-char
|
||||||
# }}}
|
# }}}
|
||||||
|
|
||||||
# Aliases and Functions {{{
|
# Aliases and Functions {{{
|
||||||
@@ -58,6 +72,7 @@ alias nyk='nvim ~/.config/yazi/keymap.toml' # edit Yazi keymap config
|
|||||||
|
|
||||||
alias nk='nvim ~/.config/kitty/kitty.conf' # edit Kitty terminal config
|
alias nk='nvim ~/.config/kitty/kitty.conf' # edit Kitty terminal config
|
||||||
alias nkk='nvim ~/.config/kitty/keymap.conf' # edit Kitty keymap config
|
alias nkk='nvim ~/.config/kitty/keymap.conf' # edit Kitty keymap config
|
||||||
|
alias ntc='nvim ~/.config/tmux/tmux.conf' # edit Kitty keymap config
|
||||||
|
|
||||||
# Git
|
# Git
|
||||||
alias g='git' # shorthand for git
|
alias g='git' # shorthand for git
|
||||||
@@ -76,7 +91,7 @@ alias nb='nvim ~/Library/Mobile\ Documents/iCloud~md~obsidian/Documents/Privat/P
|
|||||||
# Custom Functions
|
# Custom Functions
|
||||||
# Start yazi with "y", and when you quit yazi, your shell will "cd" to the folder you navigated to in yazi
|
# Start yazi with "y", and when you quit yazi, your shell will "cd" to the folder you navigated to in yazi
|
||||||
function y() {
|
function y() {
|
||||||
local tmp="$(mktemp -t "yazi-cwd.XXXXXX")"
|
local tmp="/tmp/yazi-cwd-$$"
|
||||||
yazi "$@" --cwd-file="$tmp"
|
yazi "$@" --cwd-file="$tmp"
|
||||||
if [ -f "$tmp" ]; then
|
if [ -f "$tmp" ]; then
|
||||||
local cwd="$(cat "$tmp")"
|
local cwd="$(cat "$tmp")"
|
||||||
@@ -84,7 +99,7 @@ function y() {
|
|||||||
cd "$cwd"
|
cd "$cwd"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
rm -f -- "$tmp"
|
rm -f "$tmp"
|
||||||
}
|
}
|
||||||
# }}}
|
# }}}
|
||||||
|
|
||||||
@@ -110,10 +125,6 @@ unset __conda_setup
|
|||||||
# <<< conda initialize <<<
|
# <<< conda initialize <<<
|
||||||
# }}}
|
# }}}
|
||||||
|
|
||||||
# OpenAI API Key {{{
|
|
||||||
export OPENAI_API_KEY="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" # OpenAI API key for ChatGPT or API access
|
|
||||||
# }}}
|
|
||||||
|
|
||||||
export NVM_DIR="$HOME/.nvm"
|
export NVM_DIR="$HOME/.nvm"
|
||||||
[ -s "/opt/homebrew/opt/nvm/nvm.sh" ] && \. "/opt/homebrew/opt/nvm/nvm.sh" # This loads nvm
|
[ -s "/opt/homebrew/opt/nvm/nvm.sh" ] && \. "/opt/homebrew/opt/nvm/nvm.sh" # This loads nvm
|
||||||
[ -s "/opt/homebrew/opt/nvm/etc/bash_completion.d/nvm" ] && \. "/opt/homebrew/opt/nvm/etc/bash_completion.d/nvm" # This loads nvm bash_completion
|
[ -s "/opt/homebrew/opt/nvm/etc/bash_completion.d/nvm" ] && \. "/opt/homebrew/opt/nvm/etc/bash_completion.d/nvm" # This loads nvm bash_completion
|
||||||
|
|||||||
Reference in New Issue
Block a user