diff --git a/dot_config/bash/bashrc.d/base.sh.tmpl b/dot_config/bash/bashrc.d/base.sh.tmpl index a0c7127..cf54301 100644 --- a/dot_config/bash/bashrc.d/base.sh.tmpl +++ b/dot_config/bash/bashrc.d/base.sh.tmpl @@ -1,4 +1,13 @@ -#!/usr/bin/env bash +if [[ ${BASH_VERSION} != "3.2*" ]]; then + shopt -s autocd +fi + +# append to the history file, don't overwrite it +shopt -s histappend + +# check the window size after each command and, if necessary, +# update the values of LINES and COLUMNS. +shopt -s checkwinsize # always save bash history before showing prompt; allow reloading bashrc if [[ ! $PROMPT_COMMAND =~ "history -a" ]]; then @@ -22,4 +31,10 @@ if test -r ~/.dircolors; then fi {{- end }} +if [[ -d "${XDG_DATA_HOME}/JetBrains/Toolbox/scripts" ]]; then + if [[ ":${PATH}:" != *":${XDG_DATA_HOME}/JetBrains/Toolbox/scripts:"* ]]; then + export PATH="${PATH}:${XDG_DATA_HOME}/JetBrains/Toolbox/scripts" + fi +fi + # vim: filetype=bash diff --git a/dot_config/bash/bashrc.d/completion.sh.tmpl b/dot_config/bash/bashrc.d/completion.sh.tmpl index 5635ca6..84bc249 100644 --- a/dot_config/bash/bashrc.d/completion.sh.tmpl +++ b/dot_config/bash/bashrc.d/completion.sh.tmpl @@ -48,4 +48,17 @@ source <(starship init bash) eval "$(trubka --completion-script-bash)" {{ end -}} -# vim: filetype=bash + +{{ if lookPath "rbenv" -}} +if [ "${RBENV_SHELL}" = "" ]; then + eval "$(rbenv init -)" +fi +{{ end -}} + +{{ if and (lookPath "rvm") (stat (joinPath .chezmoi.homeDir ".rvm" "bin") ) -}} +if [[ ! "${PATH}" =~ ${HOME}/.rvm/bin ]]; then + export PATH="$PATH:$HOME/.rvm/bin" +fi +{{ end -}} + +# vim: filetype=sh diff --git a/dot_config/bash/bashrc.d/functions.sh b/dot_config/bash/bashrc.d/functions.sh index 384bb55..bad47ee 100644 --- a/dot_config/bash/bashrc.d/functions.sh +++ b/dot_config/bash/bashrc.d/functions.sh @@ -1,6 +1,3 @@ -#!/usr/bin/env bash -#ft=bash - function min-jpg { min_jpg "${@}" } @@ -16,3 +13,5 @@ function get-create-date { function add-date-prefix { add_date_prefix "${@}" } + +# vim: filetype=bash diff --git a/dot_config/bash/bashrc.d/jetbrains.sh b/dot_config/bash/bashrc.d/jetbrains.sh deleted file mode 100644 index 5af6e87..0000000 --- a/dot_config/bash/bashrc.d/jetbrains.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env bash -#ft=bash - -if [[ -d "${XDG_DATA_HOME}/JetBrains/Toolbox/scripts" ]]; then - if [[ ":${PATH}:" != *":${XDG_DATA_HOME}/JetBrains/Toolbox/scripts:"* ]]; then - export PATH="${PATH}:${XDG_DATA_HOME}/JetBrains/Toolbox/scripts" - fi -fi diff --git a/dot_config/bash/bashrc.d/opts.sh b/dot_config/bash/bashrc.d/opts.sh deleted file mode 100644 index 4111f37..0000000 --- a/dot_config/bash/bashrc.d/opts.sh +++ /dev/null @@ -1,12 +0,0 @@ -if [[ ${BASH_VERSION} != "3.2*" ]]; then - shopt -s autocd -fi - -# append to the history file, don't overwrite it -shopt -s histappend - -# check the window size after each command and, if necessary, -# update the values of LINES and COLUMNS. -shopt -s checkwinsize - -# vim: ft=bash diff --git a/dot_config/bash/bashrc.d/ruby.sh.tmpl b/dot_config/bash/bashrc.d/ruby.sh.tmpl deleted file mode 100644 index 099d8e0..0000000 --- a/dot_config/bash/bashrc.d/ruby.sh.tmpl +++ /dev/null @@ -1,15 +0,0 @@ -{{ if lookPath "rbenv" -}} -# shellcheck shell=bash - -if [ "${RBENV_SHELL}" = "" ]; then - eval "$(rbenv init -)" -fi -{{ end }} -{{- if lookPath "rvm" -}} -if [[ -d "${HOME}/.rvm/bin" ]]; then - # shellcheck disable=SC2076 - if [[ ! "${PATH}" =~ "${HOME}/.rvm/bin" ]]; then - export PATH="$PATH:$HOME/.rvm/bin" - fi -fi -{{- end }} diff --git a/dot_config/fish/conf.d/erdtree.fish.tmpl b/dot_config/fish/completions/completions.fish.tmpl similarity index 50% rename from dot_config/fish/conf.d/erdtree.fish.tmpl rename to dot_config/fish/completions/completions.fish.tmpl index 9c3a0af..c40be7b 100644 --- a/dot_config/fish/conf.d/erdtree.fish.tmpl +++ b/dot_config/fish/completions/completions.fish.tmpl @@ -1,3 +1,6 @@ +{{ if lookPath "helm" -}} +eval "$(helm completion fish)" +{{- end }} {{ if lookPath "erd" -}} eval "$(erd --completions fish)" {{- end }} diff --git a/dot_config/fish/completions/helm.fish.tmpl b/dot_config/fish/completions/helm.fish.tmpl deleted file mode 100644 index b381531..0000000 --- a/dot_config/fish/completions/helm.fish.tmpl +++ /dev/null @@ -1,6 +0,0 @@ -{{ if lookPath "helm" -}} -# vim: ft=sh -if command -v helm > /dev/null 2>&1; then - eval "$(helm completion fish)" -fi -{{- end }}