Skip to content

Commit cd214f4

Browse files
committedDec 13, 2024
Bash: add experimental instagit function
1 parent d7cf7f0 commit cd214f4

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed
 

‎home/bashrc

+7
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,13 @@ catch() {
184184
path=$(which "$1") && [[ $(file -L "$path") == *text* ]] && bat "$path"
185185
}
186186

187+
instagit() {
188+
cd ~/tmp || { mkdir ~/tmp && cd ~/tmp; } || return
189+
local d
190+
d=$(qualified-noun) && mkdir "$d" || { d=$(qualified-noun) && mkdir "$d"; } || return
191+
cd "$d" && git init --quiet
192+
}
193+
187194
# Select a line from oneliners.bash with fzf and paste the selection to stdin. This code
188195
# is copied and adapted from the `__fzf_history__` function in
189196
# /usr/share/fzf/key-bindings.bash (as of fzf 0.16.8-1 from Arch's community repo,

0 commit comments

Comments
 (0)
Please sign in to comment.