diff --git a/templates/aliases.bashrc b/templates/aliases.bashrc deleted file mode 100644 index 83cdd7c..0000000 --- a/templates/aliases.bashrc +++ /dev/null @@ -1 +0,0 @@ -alias ls="ls -I 'NTUSER.DAT*' --color=auto" \ No newline at end of file diff --git a/templates/aliases.bashrc.sh b/templates/aliases.bashrc.sh new file mode 100644 index 0000000..fe1d832 --- /dev/null +++ b/templates/aliases.bashrc.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +alias _wrapping_fix='kill -WINCH $$' +alias grep='grep --color=auto' +alias pip='python -m pip' +alias diff='diff --strip-trailing-cr' +alias ls="ls -I 'NTUSER.DAT*' --color=auto" diff --git a/templates/helper_functions.bashrc.sh b/templates/helper_functions.bashrc.sh index 06ee73a..062d652 100644 --- a/templates/helper_functions.bashrc.sh +++ b/templates/helper_functions.bashrc.sh @@ -1,5 +1,33 @@ #!/bin/bash -# TODO -function npp() { - -} \ No newline at end of file +function qff() { + printf "searching for files named '*"$*"*'\n" >&2 + find -type f -iname '*'$*'*' +} + +function rv() { + RV=$? + if [[ $RV -eq 0 ]]; then + COLOR='2' + elif [[ $RV -eq 1 ]]; then + COLOR='3' + else + COLOR='1' + fi + printf '\e[4%dm' $COLOR + printf ' RV=%d \e[0m\n' $RV >&2 +} + + +# When notepad++ is available, use it +function kate() { + export IFS=$'\n' + NOTEPADPP_EXE='/c/Program Files/Notepad++/notepad++.exe' + if [[ -e "${NOTEPADPP_EXE}" ]]; then + echo 'notepad++.exe '$*' &' + "${NOTEPADPP_EXE}" $* & + return 0 + else + echo "notepad++ not found." + return 1 + fi +} diff --git a/templates/misc.bashrc.sh b/templates/misc.bashrc.sh new file mode 100644 index 0000000..526128c --- /dev/null +++ b/templates/misc.bashrc.sh @@ -0,0 +1,8 @@ +#!/bin/bash + + +# prevent git from paging +export LESS='-rFX' + +export HISTIGNORE='pwd:exit:fg:bg:top:clear:history:ls:uptime:df' +