Skip to content

Commit 448f12b

Browse files
authored
Merge branch 'master' into alias/general
2 parents 6a10c55 + dc25be3 commit 448f12b

28 files changed

+986
-283
lines changed

.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

aliases/available/general.aliases.bash

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,12 @@ if _command_exists pianobar; then
3535
alias piano='pianobar'
3636
fi
3737

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/$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
4444

4545
# Shell History
4646
alias h='history'
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

clean_files.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,15 +65,19 @@ themes/githelpers.theme.bash
6565
themes/gitline
6666
themes/inretio
6767
themes/lambda
68+
themes/liquidprompt
6869
themes/modern
6970
themes/norbu
7071
themes/oh-my-posh
7172
themes/p4helpers.theme.bash
7273
themes/pete
7374
themes/powerline
75+
themes/powerline-multiline
76+
themes/powerline-naked
7477
themes/pure
7578
themes/purity
7679
themes/rjorgenson
80+
themes/robbyrussell
7781

7882
# vendor init files
7983
#

completion/available/aliases.completion.bash

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ about-plugin 'Automatic completion of aliases'
99

1010
# Automatically add completion for all aliases to commands having completion functions
1111
function _bash-it-component-completion-callback-on-init-aliases() {
12-
local namespace="alias_completion"
12+
local aliasCommandFunction namespace="alias_completion"
1313
local tmp_file completion_loader alias_name line completions chars
1414
local alias_arg_words new_completion compl_func compl_wrapper alias_defn
1515

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,19 @@
11
# shellcheck shell=bash
22

3-
# Make sure terraform is installed
4-
_command_exists terraform || return
3+
if _command_exists terraform; then
54

6-
# Don't handle completion if it's already managed
7-
complete -p terraform &> /dev/null && return
5+
# Don't handle completion if it's already managed
6+
complete -p terraform &> /dev/null && return
87

9-
# Terraform completes itself
10-
complete -C terraform terraform
8+
# Terraform completes itself
9+
complete -C terraform terraform
10+
11+
elif _command_exists tofu; then
12+
13+
# Don't handle completion if it's already managed
14+
complete -p tofu &> /dev/null && return
15+
16+
# OpenTofu completes itself
17+
complete -C tofu tofu
18+
19+
fi

0 commit comments

Comments
 (0)