Skip to content

Commit

Permalink
bash updates
Browse files Browse the repository at this point in the history
  • Loading branch information
moukoublen committed Aug 8, 2024
1 parent 5d31478 commit 8f8b36e
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 15 deletions.
18 changes: 18 additions & 0 deletions lib/00-common.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
bind 'set mark-symlinked-directories on'

HISTSIZE=30000
HISTFILESIZE=30000

alias path-to-lines='echo $PATH | tr ":" "\n"'
alias xdg-data-to-lines='echo $XDG_DATA_DIRS | tr ":" "\n"'
alias infopath-to-lines='echo $INFOPATH | tr ":" "\n"'
alias ld-to-lines='echo $LD_LIBRARY_PATH | tr ":" "\n"'
S() {
find . -name "*${*}*"
}

bb() {
local cmd='source-highlight --no-doc --out-format=esc --tab=2'
${cmd} --infer-lang --input "${@}" 2>/dev/null || ${cmd} --src-lang=shell --input "${@}"
}

4 changes: 2 additions & 2 deletions lib/90-ww.bash
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ ww() {
local file_of
file_of="$(file "${full_path}")"
if [[ "${file_of}" == *text* ]]; then
${cat_cmd} --infer-lang --input="${full_path}"
${cat_cmd} --infer-lang --input="${full_path}" 2>/dev/null || ${cat_cmd} --src-lang=shell --input="${full_path}"
return
fi

Expand All @@ -42,7 +42,7 @@ ww() {

file_of="$(file "${full_path}")"
if [[ "${file_of}" == *text* ]]; then
${cat_cmd} --infer-lang --input="${full_path}"
${cat_cmd} --infer-lang --input="${full_path}" 2>/dev/null || ${cat_cmd} --src-lang=shell --input="${full_path}"
return
fi

Expand Down
13 changes: 0 additions & 13 deletions root.bash
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,3 @@ unset src

path-add "${DOTFILES_PATH}/bin"
path-add "${HOME}/bin"

bind 'set mark-symlinked-directories on'

HISTSIZE=30000
HISTFILESIZE=30000

alias path-to-lines='echo $PATH | tr ":" "\n"'
alias xdg-data-to-lines='echo $XDG_DATA_DIRS | tr ":" "\n"'
alias infopath-to-lines='echo $INFOPATH | tr ":" "\n"'
alias ld-to-lines='echo $LD_LIBRARY_PATH | tr ":" "\n"'
S() {
find . -name "*${*}*"
}

0 comments on commit 8f8b36e

Please sign in to comment.