mirror of
https://gitlab.com/sagidayan/linux-config.git
synced 2024-11-24 16:25:25 +00:00
Merge branch 'script-tweaks' into 'main'
Added some minor twekas to workspace scripts + new git tmux shortcut. See merge request sagidayan/linux-config!12
This commit is contained in:
commit
2d20980022
4 changed files with 14 additions and 13 deletions
|
@ -30,6 +30,7 @@
|
|||
ada = add .
|
||||
cm = commit -m
|
||||
ck = checkout
|
||||
fza = "!git ls-files -m -o --exclude-standard | fzf -m --print0 --reverse --header \"🞥 Select files to stage. use [tab] for multi selection\" --preview \"bat --diff --color=always --style=numbers,changes,grid {}\" | xargs -0 -t -o git add"
|
||||
|
||||
[diff]
|
||||
tool = vimdiff
|
||||
|
|
|
@ -5,13 +5,11 @@ JSON_PATH=~/.shellconfig/workspaces/workspaces.json
|
|||
function yes_no_question() {
|
||||
QUESTION=$1
|
||||
RESPONSE=$(cat <<EOF | fzf --reverse --header "${QUESTION}"
|
||||
No
|
||||
Yes
|
||||
⨯ No
|
||||
🗸 Yes
|
||||
EOF
|
||||
)
|
||||
|
||||
echo $RESPONSE
|
||||
|
||||
)
|
||||
echo $(echo $RESPONSE | awk '{print $2}')
|
||||
}
|
||||
|
||||
NAME=${1:-}
|
||||
|
|
|
@ -5,12 +5,11 @@ JSON_PATH=~/.shellconfig/workspaces/workspaces.json
|
|||
function yes_no_question() {
|
||||
QUESTION=$1
|
||||
RESPONSE=$(cat <<EOF | fzf --reverse --header "${QUESTION}"
|
||||
No
|
||||
Yes
|
||||
⨯ No
|
||||
🗸 Yes
|
||||
EOF
|
||||
)
|
||||
|
||||
echo $RESPONSE
|
||||
)
|
||||
echo $(echo $RESPONSE | awk '{print $2}')
|
||||
}
|
||||
|
||||
WSP=$(cat ${JSON_PATH} \
|
||||
|
@ -18,12 +17,12 @@ WSP=$(cat ${JSON_PATH} \
|
|||
| fzf --reverse --header "Select a Workspace to DELETE"
|
||||
)
|
||||
|
||||
if [ -z $WSP ]; then
|
||||
if [ -z "$WSP" ]; then
|
||||
echo "Aborted"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
RESPONSE=$(yes_no_question "❓ Are you sure you want to delete ${WSP}?")
|
||||
RESPONSE="$(yes_no_question "❓ Are you sure you want to delete ${WSP}?")"
|
||||
|
||||
if [ "$RESPONSE" == "No" ]; then
|
||||
echo "Aborted"
|
||||
|
|
|
@ -49,6 +49,9 @@ bind-key x run-shell "tmux neww -n '🖥Workspace Manager' ~/.shellconfig/worksp
|
|||
# Change git branches fast <prefix>-b
|
||||
bind-key b send-keys "gitB" C-m
|
||||
|
||||
# Git add + fzf
|
||||
bind-key g run-shell "tmux neww -n '🞥 📑 Git Add' 'cd #{pane_current_path} && (git ls-files -m -o --exclude-standard | fzf -m --print0 --reverse --header \"🞥 Select files to stage. use [tab] for multi selection\" --preview \"bat --diff --color=always --style=numbers,changes,grid {}\" | xargs -0 -o -t git add)'"
|
||||
|
||||
############################
|
||||
# Themes
|
||||
###########################
|
||||
|
|
Loading…
Reference in a new issue