diff --git a/lib/00-common.bash b/lib/00-common.bash new file mode 100644 index 0000000..5a019ad --- /dev/null +++ b/lib/00-common.bash @@ -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 "${@}" +} + diff --git a/lib/90-ww.bash b/lib/90-ww.bash index 52be032..e45198c 100644 --- a/lib/90-ww.bash +++ b/lib/90-ww.bash @@ -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 @@ -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 diff --git a/root.bash b/root.bash index a2c80d7..17e47fd 100644 --- a/root.bash +++ b/root.bash @@ -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 "*${*}*" -}