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
|
(( ${+_comps} )) && _comps[zi]=_zi
|
||||||
# end of zi init
|
# end of zi init
|
||||||
|
|
||||||
# init completion
|
|
||||||
autoload -Uz compinit && compinit
|
|
||||||
|
|
||||||
# register multiple hooks
|
# register multiple hooks
|
||||||
#autoload -Uz add-zsh-hook
|
#autoload -Uz add-zsh-hook
|
||||||
|
|
||||||
|
|
@ -20,10 +17,6 @@ bindkey -v
|
||||||
# If you come from bash you might have to change your $PATH.
|
# If you come from bash you might have to change your $PATH.
|
||||||
export PATH=$HOME/bin:$HOME/.local/bin:$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::history.zsh
|
||||||
zi snippet OMZL::directories.zsh
|
zi snippet OMZL::directories.zsh
|
||||||
|
|
||||||
|
|
@ -35,6 +28,13 @@ zi light zsh-users/zsh-syntax-highlighting
|
||||||
zi is-snippet wait lucid for \
|
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_COMMAND1="{{ .tmux_favorite1 }}"
|
||||||
export FAVORITE_COMMAND2="{{ .tmux_favorite2 }}"
|
export FAVORITE_COMMAND2="{{ .tmux_favorite2 }}"
|
||||||
export FAVORITE_COMMAND3="{{ .tmux_favorite3 }}"
|
export FAVORITE_COMMAND3="{{ .tmux_favorite3 }}"
|
||||||
|
|
@ -73,11 +73,11 @@ chpwd() {
|
||||||
# Editor
|
# Editor
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
|
|
||||||
if hash nvim 2>/dev/null; then
|
if command -v nvim &>/dev/null; then
|
||||||
export EDITOR=nvim
|
export EDITOR=nvim
|
||||||
elif hash vim 2>/dev/null; then
|
elif command -v vim &>/dev/null; then
|
||||||
export EDITOR=vim
|
export EDITOR=vim
|
||||||
elif hash vi 2>/dev/null; then
|
elif command -v vi &>/dev/null; then
|
||||||
export EDITOR=vi
|
export EDITOR=vi
|
||||||
else
|
else
|
||||||
export EDITOR=nano
|
export EDITOR=nano
|
||||||
|
|
@ -95,21 +95,17 @@ alias vi=$EDITOR
|
||||||
if command -v tmux &>/dev/null; then
|
if command -v tmux &>/dev/null; then
|
||||||
alias ta='tmux attach'
|
alias ta='tmux attach'
|
||||||
|
|
||||||
alias tkill="for s in \$(tmux list-sessions | awk -F ':' '{print \$1}' | fzf); do
|
tkill() {
|
||||||
tmux kill-session -t \$s;
|
local session
|
||||||
done"
|
session=$(tmux list-sessions | awk -F ':' '{print $1}' | fzf) && tmux kill-session -t "$session"
|
||||||
fi
|
}
|
||||||
|
|
||||||
|
set_tmux_title() {
|
||||||
# Function to set tmux window title
|
|
||||||
function set_tmux_title {
|
|
||||||
if [[ -n "$TMUX" ]]; then
|
|
||||||
tmux rename-window "$1"
|
tmux rename-window "$1"
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# SSH wrapper to change the tmux title locally
|
# SSH wrapper to change the tmux title locally
|
||||||
function ssh() {
|
ssh() {
|
||||||
if [[ -n "$TMUX" ]]; then
|
if [[ -n "$TMUX" ]]; then
|
||||||
# Save the original tmux window title
|
# Save the original tmux window title
|
||||||
original_title=$(tmux display-message -p '#W')
|
original_title=$(tmux display-message -p '#W')
|
||||||
|
|
@ -127,14 +123,7 @@ function ssh() {
|
||||||
tmux set-window-option automatic-rename on
|
tmux set-window-option automatic-rename on
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
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
|
|
||||||
|
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
# Fzf
|
# Fzf
|
||||||
|
|
@ -157,8 +146,16 @@ fi
|
||||||
# Sesh / Zoxide
|
# Sesh / Zoxide
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
if command -v sesh &>/dev/null; then
|
||||||
alias t='sesh connect $(sesh list | fzf)'
|
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)"
|
eval "$(zoxide init zsh)"
|
||||||
|
else
|
||||||
|
echo "warning: zoxide is not installed" >&2
|
||||||
|
fi
|
||||||
|
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
# Maven
|
# 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 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'
|
alias mvni='m -Dmaven.test.skip -Dmaven.javadoc.skip=true clean install'
|
||||||
|
|
||||||
function mbump() {
|
mbump() {
|
||||||
if [ $# -eq 0 ]; then
|
if [ $# -eq 0 ]; then
|
||||||
echo "Usage: mbump <version> (means -SNAPSHOT) or mbump <version> <kind> (kind is R or S)"
|
echo "Usage: mbump <version> (means -SNAPSHOT) or mbump <version> <kind> (kind is R or S)"
|
||||||
else
|
else
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue