diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2016-08-25 22:19:57 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2016-08-25 22:19:57 +1200 |
commit | 863ce6d447e41eca993e96a6250075ce0e6dc909 (patch) | |
tree | d0c1f1abc19a01eeb951f1ccf77390157a8501a8 | |
parent | Add note to issue (diff) | |
download | dotfiles-863ce6d447e41eca993e96a6250075ce0e6dc909.tar.gz dotfiles-863ce6d447e41eca993e96a6250075ce0e6dc909.zip |
Remove gore() and lore()
Changed my mind
-rw-r--r-- | README.markdown | 3 | ||||
-rw-r--r-- | sh/shrc.d/gore.sh | 22 | ||||
-rw-r--r-- | sh/shrc.d/lore.sh | 29 |
3 files changed, 0 insertions, 54 deletions
diff --git a/README.markdown b/README.markdown index 8e4c906f..8580b578 100644 --- a/README.markdown +++ b/README.markdown @@ -173,8 +173,6 @@ in `sh/shrc.d` to be loaded by any POSIX interactive shell. Those include: variables. * `gdb()` silences startup messages from `gdb(1)`. * `gpg()` quietens `gpg(1)` down for most commands. -* `gore(1)` runs the output of `grep(1)` through your pager, using color if - it can. * `grep()` tries to apply color and other options good for interactive use, depending on the capabilities of the system `grep(1)`. * `hgrep()` allows searching `$HISTFILE`. @@ -184,7 +182,6 @@ in `sh/shrc.d` to be loaded by any POSIX interactive shell. Those include: * `ls()` tries to apply color to `ls(1)` for interactive use if available. * `la()` runs `ls -A` if it can, or `ls -a` otherwise. * `ll()` runs `ls -Al` if it can, or `ls -al` otherwise. - * `lore(1)` runs the output of `ls(1)` with an `-lA` or `-la` switch through your pager, using color if it can. * `mkcd()` creates a directory and changes into it. * `mysql()` allows shortcuts to MySQL configuration files stored in diff --git a/sh/shrc.d/gore.sh b/sh/shrc.d/gore.sh deleted file mode 100644 index 2cdb8bd6..00000000 --- a/sh/shrc.d/gore.sh +++ /dev/null @@ -1,22 +0,0 @@ -# Pipe grep(1) output through PAGER; mostly to preserve coloring interactively -# through less(1), but it'll work fine with plain grep(1) and more(1) -gore() { - - # Add --color=always if the terminal has at least 8 colors; we have to add - # "always" to coax grep(1) into emitting colors even though it can tell its - # stdout isn't a terminal but a pager - [ -e "$HOME"/.cache/grep/color ] && - [ "$({ tput colors || tput Co ; } 2>/dev/null)" -ge 8 ] && - set -- --color=always "$@" - - # Run whatever `grep` gives us; it might be our function wrapper; that's OK - # Include -n to show line numbers; this is POSIX, which was a nice surprise - grep -n "$@" | - - # Run the appropriate pager; if it's less(1), we can tack on -R (though my - # ~/.lesskey does this anyway) - case $PAGER in - less) "$PAGER" -R ;; - *) "$PAGER" ;; - esac -} diff --git a/sh/shrc.d/lore.sh b/sh/shrc.d/lore.sh deleted file mode 100644 index e00b945a..00000000 --- a/sh/shrc.d/lore.sh +++ /dev/null @@ -1,29 +0,0 @@ -# Pipe ls(1) output through PAGER; mostly to preserve coloring interactively -# through less(1), but it'll work fine with plain ls(1) and more(1) -lore() { - - # Add --color=always if the terminal has at least 8 colors; we have to add - # "always" to coax ls(1) into emitting colors even though it can tell its - # stdout isn't a terminal but a pager - [ -e "$HOME"/.cache/ls/color ] && - [ "$({ tput colors || tput Co ; } 2>/dev/null)" -ge 8 ] && - set -- --color=always "$@" - - # Prefer -A/--almost-all (exclude "." and "..") if available - if [ -e "$HOME"/.cache/ls/almost-all ] ; then - set -- -Al "$@" - else - set -- -al "$@" - fi - - # Run whatever `ls` gives us; it might be our function wrapper; that's OK - # shellcheck disable=SC2012 - ls "$@" | - - # Run the appropriate pager; if it's less(1), we can tack on -R (though my - # ~/.lesskey does this anyway) - case $PAGER in - less) "$PAGER" -R ;; - *) "$PAGER" ;; - esac -} |