Skip to content

Commit 0c792ef

Browse files
authored
Merge branch 'master' into lib/completion/components
2 parents d5cbbcf + 8474502 commit 0c792ef

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+1269
-492
lines changed

.git-blame-ignore-revs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Ignore shfmt related commits
2+
003b0ce802c10ab6e161d7ba5a7d9b6722312cc5
3+
7c2c2a5525557cbfee98e73de921fd7f7e6811a1
4+
d37505b636ca7bc95301d8daaf9c58a3186ce57a
5+
d7695d5456b980190b6d1c4a4715b13d1b63c332

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jobs:
77
bats-test:
88
strategy:
99
matrix:
10-
os: [ubuntu-20.04, ubuntu-24.04, macos-14]
10+
os: [ubuntu-24.04, macos-14]
1111

1212
runs-on: ${{ matrix.os }}
1313

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,5 @@ tmp/
2222
profiles/*
2323
# apart from the default one
2424
!profiles/default.bash_it
25+
26+
/vendor/github.com/nojhan/liquidprompt
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# shellcheck shell=bash
2+
about-alias 'Shortcuts for directory commands: ls, cd, &c.'
3+
4+
if command ls --color -d . &> /dev/null; then
5+
alias ls='ls --color=auto'
6+
# BSD `ls` doesn't need an argument (`-G`) when `$CLICOLOR` is set.
7+
fi
8+
9+
# List directory contents
10+
alias sl=ls
11+
alias la='ls -AF' # Compact view, show hidden
12+
alias ll='ls -Al'
13+
alias l='ls -A'
14+
alias l1='ls -1'
15+
alias lf='ls -F'
16+
17+
# Change directory
18+
alias ..='cd ..' # Go up one directory
19+
alias cd..='cd ..' # Common misspelling for going up one directory
20+
alias ...='cd ../..' # Go up two directories
21+
alias ....='cd ../../..' # Go up three directories
22+
alias -- -='cd -' # Go back
23+
24+
# Create or remove directory
25+
alias md='mkdir -p'
26+
alias rd='rmdir'

aliases/available/editor.aliases.bash

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# shellcheck shell=bash
2+
about-alias 'shortcuts for editing'
3+
4+
alias edit='${EDITOR:-${ALTERNATE_EDITOR:-nano}}'
5+
alias e='edit'
6+
7+
# sudo editors
8+
alias svim='sudo ${VISUAL:-vim}'
9+
alias snano='sudo ${ALTERNATE_EDITOR:-nano}'
10+
alias sedit='sudo ${EDITOR:-${ALTERNATE_EDITOR:-nano}}'
11+
12+
# Shortcuts to edit startup files
13+
alias vbrc='${VISUAL:-vim} ~/.bashrc'
14+
alias vbpf='${VISUAL:-vim} ~/.bash_profile'

aliases/available/general.aliases.bash

Lines changed: 13 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,9 @@
11
# shellcheck shell=bash
2+
# shellcheck source-path=SCRIPTDIR
23
about-alias 'general aliases'
34

4-
if command ls --color -d . &> /dev/null; then
5-
alias ls='ls --color=auto'
6-
# BSD `ls` doesn't need an argument (`-G`) when `$CLICOLOR` is set.
7-
fi
8-
9-
# List directory contents
10-
alias sl=ls
11-
alias la='ls -AF' # Compact view, show hidden
12-
alias ll='ls -al'
13-
alias l='ls -a'
14-
alias l1='ls -1'
15-
alias lf='ls -F'
16-
175
alias _='sudo'
186

19-
# Shortcuts to edit startup files
20-
alias vbrc='${VISUAL:-vim} ~/.bashrc'
21-
alias vbpf='${VISUAL:-vim} ~/.bash_profile'
22-
237
# colored grep
248
# Need to check an existing file for a pattern that will be found to ensure
259
# that the check works when on an OS that supports the color option
@@ -39,23 +23,24 @@ alias pager='${PAGER:=less}'
3923

4024
alias q='exit'
4125

42-
alias irc='${IRC_CLIENT:=irc}'
26+
alias irc='${IRC_CLIENT:-irc}'
4327

4428
# Language aliases
4529
alias rb='ruby'
4630
alias py='python'
4731
alias ipy='ipython'
4832

4933
# Pianobar can be found here: http://github.com/PromyLOPh/pianobar/
34+
if _command_exists pianobar; then
35+
alias piano='pianobar'
36+
fi
5037

51-
alias piano='pianobar'
52-
53-
alias ..='cd ..' # Go up one directory
54-
alias cd..='cd ..' # Common misspelling for going up one directory
55-
alias ...='cd ../..' # Go up two directories
56-
alias ....='cd ../../..' # Go up three directories
57-
alias -- -='cd -' # Go back
58-
alias dow='cd /home/$USER/Downloads' # Go to the Downloads directory
38+
alias ..='cd ..' # Go up one directory
39+
alias cd..='cd ..' # Common misspelling for going up one directory
40+
alias ...='cd ../..' # Go up two directories
41+
alias ....='cd ../../..' # Go up three directories
42+
alias -- -='cd -' # Go back
43+
alias dow='cd $HOME/Downloads' # Go to the Downloads directory
5944

6045
# Shell History
6146
alias h='history'
@@ -92,5 +77,6 @@ function catt() {
9277
# aliases and enable just the ones for Bash-it explicitly:
9378
# bash-it disable alias general
9479
# bash-it enable alias bash-it
95-
# shellcheck source-path=SCRIPTDIR
9680
source "$BASH_IT/aliases/available/bash-it.aliases.bash"
81+
source "$BASH_IT/aliases/available/directory.aliases.bash"
82+
source "$BASH_IT/aliases/available/editor.aliases.bash"
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# shellcheck shell=bash
2+
cite 'about-alias'
3+
about-alias 'git aliases from oh-my-zsh (incompatible with regular git aliases option)'
4+
5+
if _bash-it-component-item-is-enabled aliases git; then
6+
_log_warning "git-omz aliases are incompatible with regular git aliases"
7+
return 1
8+
fi
9+
10+
# Load after regular git aliases
11+
# BASH_IT_LOAD_PRIORITY: 160
12+
13+
# Setup git version
14+
read -ra git_version_arr <<< "$(git version 2> /dev/null)"
15+
# shellcheck disable=SC2034
16+
git_version="${git_version_arr[2]}"
17+
18+
# Setup is-at-least
19+
function is-at-least {
20+
local expected_version=$1
21+
local actual_version=$2
22+
local versions
23+
24+
printf -v versions '%s\n%s' "$expected_version" "$actual_version"
25+
[[ $versions = "$(sort -V <<< "$versions")" ]]
26+
}
27+
28+
# Setup git_current_branch
29+
function git_current_branch {
30+
_git-branch
31+
}
32+
33+
# shellcheck disable=SC1090
34+
source "${BASH_IT}"/vendor/github.com/ohmyzsh/ohmyzsh/plugins/git/git.plugin.zsh

aliases/available/git.aliases.bash

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
11
# shellcheck shell=bash
22
about-alias 'common git abbreviations'
33

4+
# We can use this variable to make sure that we don't accidentally clash with git-zsh aliases
5+
if _bash-it-component-item-is-enabled aliases git-omz; then
6+
_log_warning "The aliases from 'git' and from 'git-omz' conflict with each other; please only enable one."
7+
return 1
8+
fi
9+
410
alias g='git'
511
alias get='git'
6-
alias got='git '
12+
alias got='git'
713

814
# add
915
alias ga='git add'
@@ -105,6 +111,7 @@ alias gm='git merge'
105111
alias gma='git merge --abort'
106112
alias gmc='git merge --continue'
107113
alias gms='git merge --squash'
114+
alias gmt='git mergetool'
108115

109116
# mv
110117
alias gmv='git mv'

aliases/available/laravel.aliases.bash

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,14 @@ about-alias 'laravel artisan abbreviations'
33

44
# A list of useful laravel aliases
55

6-
alias laravel='${HOME?}/.composer/vendor/bin/laravel'
6+
if [[ -x "${HOME?}/.config/composer/vendor/bin/laravel" ]]; then
7+
alias laravel='${HOME?}/.config/composer/vendor/bin/laravel'
8+
elif [[ -x "${HOME?}/.composer/vendor/bin/laravel" ]]; then
9+
alias laravel='${HOME?}/.composer/vendor/bin/laravel'
10+
else
11+
return
12+
fi
13+
714
# asset
815
alias a:apub='php artisan asset:publish'
916

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,22 @@
11
# shellcheck shell=bash
2-
about-alias 'Aliases for Terraform and Terragrunt'
2+
about-alias 'Aliases for Terraform/OpenTofu and Terragrunt'
33

4-
alias tf='terraform'
5-
alias tfi='tf init'
6-
alias tfv='terraform validate'
7-
alias tfp='terraform plan'
8-
alias tfa='terraform apply'
9-
alias tfd='terraform destroy'
10-
alias tfw='terraform workspace'
4+
if _command_exists terraform; then
5+
alias tf='terraform'
6+
elif _command_exists tofu; then
7+
alias tf='tofu'
8+
fi
9+
10+
if _command_exists tf; then
11+
alias tfa='tf apply'
12+
alias tfp='tf plan'
13+
alias tfd='tf destroy'
14+
alias tfv='tf validate'
15+
alias tfi='tf init'
16+
alias tfo='tf output'
17+
alias tfr='tf refresh'
18+
alias tfw='tf workspace'
19+
alias tfae='tf apply -auto-approve'
20+
alias tfpa='tf plan -out=tfplan && tf apply tfplan'
21+
alias tfpaf='tf plan -out=tfplan && tf apply -auto-approve tfplan'
22+
fi

0 commit comments

Comments
 (0)