CLean and fix things
This commit is contained in:
parent
2e10f2350e
commit
22092f7786
1 changed files with 33 additions and 36 deletions
|
|
@ -7,9 +7,6 @@ autoload -Uz _zi
|
|||
(( ${+_comps} )) && _comps[zi]=_zi
|
||||
# end of zi init
|
||||
|
||||
# init completion
|
||||
autoload -Uz compinit && compinit
|
||||
|
||||
# register multiple hooks
|
||||
#autoload -Uz add-zsh-hook
|
||||
|
||||
|
|
@ -20,10 +17,6 @@ bindkey -v
|
|||
# If you come from bash you might have to change your $PATH.
|
||||
export PATH=$HOME/bin:$HOME/.local/bin:$PATH
|
||||
|
||||
if [[ -f "$HOME/.zshrc.local" ]]; then
|
||||
source "$HOME/.zshrc.local"
|
||||
fi
|
||||
|
||||
zi snippet OMZL::history.zsh
|
||||
zi snippet OMZL::directories.zsh
|
||||
|
||||
|
|
@ -33,7 +26,14 @@ zi light spaceship-prompt/spaceship-prompt
|
|||
zi light zsh-users/zsh-syntax-highlighting
|
||||
|
||||
zi is-snippet wait lucid for \
|
||||
OMZP::fzf
|
||||
OMZP::fzf
|
||||
|
||||
# init completion (after plugins so all completions are registered)
|
||||
autoload -Uz compinit && compinit
|
||||
|
||||
if [[ -f "$HOME/.zshrc.local" ]]; then
|
||||
source "$HOME/.zshrc.local"
|
||||
fi
|
||||
|
||||
export FAVORITE_COMMAND1="{{ .tmux_favorite1 }}"
|
||||
export FAVORITE_COMMAND2="{{ .tmux_favorite2 }}"
|
||||
|
|
@ -73,11 +73,11 @@ chpwd() {
|
|||
# Editor
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
if hash nvim 2>/dev/null; then
|
||||
if command -v nvim &>/dev/null; then
|
||||
export EDITOR=nvim
|
||||
elif hash vim 2>/dev/null; then
|
||||
elif command -v vim &>/dev/null; then
|
||||
export EDITOR=vim
|
||||
elif hash vi 2>/dev/null; then
|
||||
elif command -v vi &>/dev/null; then
|
||||
export EDITOR=vi
|
||||
else
|
||||
export EDITOR=nano
|
||||
|
|
@ -95,21 +95,17 @@ alias vi=$EDITOR
|
|||
if command -v tmux &>/dev/null; then
|
||||
alias ta='tmux attach'
|
||||
|
||||
alias tkill="for s in \$(tmux list-sessions | awk -F ':' '{print \$1}' | fzf); do
|
||||
tmux kill-session -t \$s;
|
||||
done"
|
||||
fi
|
||||
tkill() {
|
||||
local session
|
||||
session=$(tmux list-sessions | awk -F ':' '{print $1}' | fzf) && tmux kill-session -t "$session"
|
||||
}
|
||||
|
||||
set_tmux_title() {
|
||||
tmux rename-window "$1"
|
||||
}
|
||||
|
||||
# Function to set tmux window title
|
||||
function set_tmux_title {
|
||||
if [[ -n "$TMUX" ]]; then
|
||||
tmux rename-window "$1"
|
||||
fi
|
||||
}
|
||||
|
||||
# SSH wrapper to change the tmux title locally
|
||||
function ssh() {
|
||||
# SSH wrapper to change the tmux title locally
|
||||
ssh() {
|
||||
if [[ -n "$TMUX" ]]; then
|
||||
# Save the original tmux window title
|
||||
original_title=$(tmux display-message -p '#W')
|
||||
|
|
@ -126,15 +122,8 @@ function ssh() {
|
|||
set_tmux_title "$original_title"
|
||||
tmux set-window-option automatic-rename on
|
||||
fi
|
||||
}
|
||||
|
||||
export ZSH_TMUX_AUTOSTART=false
|
||||
export ZSH_TMUX_AUTOSTART_ONCE=false
|
||||
export ZSH_TMUX_AUTOCONNECT=true
|
||||
export ZSH_TMUX_CONFIG=$HOME/.tmux.conf
|
||||
export ZSH_TMUX_DEFAULT_SESSION_NAME=build
|
||||
|
||||
#zi snippet OMZP::tmux
|
||||
}
|
||||
fi
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Fzf
|
||||
|
|
@ -157,8 +146,16 @@ fi
|
|||
# Sesh / Zoxide
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
alias t='sesh connect $(sesh list | fzf)'
|
||||
eval "$(zoxide init zsh)"
|
||||
if command -v sesh &>/dev/null; then
|
||||
alias t='sesh connect $(sesh list | fzf)'
|
||||
else
|
||||
echo "warning: sesh is not installed" >&2
|
||||
fi
|
||||
if command -v zoxide &>/dev/null; then
|
||||
eval "$(zoxide init zsh)"
|
||||
else
|
||||
echo "warning: zoxide is not installed" >&2
|
||||
fi
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Maven
|
||||
|
|
@ -174,7 +171,7 @@ if command -v mvn &>/dev/null; then
|
|||
alias mvnd='m -Dmaven.test.skip -Dmaven.javadoc.skip=true deploy -P profile-nexus'
|
||||
alias mvni='m -Dmaven.test.skip -Dmaven.javadoc.skip=true clean install'
|
||||
|
||||
function mbump() {
|
||||
mbump() {
|
||||
if [ $# -eq 0 ]; then
|
||||
echo "Usage: mbump <version> (means -SNAPSHOT) or mbump <version> <kind> (kind is R or S)"
|
||||
else
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue