浏览代码

added glow.sh, modified grep-color.sh

Ralf Beckesch 1 月之前
父节点
当前提交
ae95f9ca4b
共有 2 个文件被更改,包括 19 次插入 和 14 次删除
  1. 11 0
      dot_bashrc.d/applications/glow.sh
  2. 8 14
      dot_bashrc.d/applications/grep-color.sh

+ 11 - 0
dot_bashrc.d/applications/glow.sh

@@ -0,0 +1,11 @@
+#!/bin/bash
+scriptname=$(basename ${BASH_SOURCE[0]})
+scriptdirname=$(dirname ${BASH_SOURCE[0]})
+
+
+if [ -n "$(command -v glow)" ]; then
+	debug "Loading 'glow' completion."
+	env "$(glow completion bash)"
+fi
+
+

+ 8 - 14
dot_bashrc.d/applications/grep-color.sh

@@ -2,25 +2,19 @@
 scriptname=$(basename ${BASH_SOURCE[0]})
 scriptdirname=$(dirname ${BASH_SOURCE[0]})
 
-function debug () {
-    if [ -n "$DEBUG" ]; then
-        echo -e "$*" >&2
-    fi
-}
-
-debug "Colorizing grep aliases."
-
-## Colorize the grep command output for ease of use (good for log files)##
 
 if [ -n "$(command -v grep)" ]; then
-    alias grep='grep --color=auto'
+	debug "Colorizing grep."
+	alias grep='grep --color=auto'
 fi
 
-if [ -n "$(command -v grep)" ]; then
-    alias egrep='egrep --color=auto'
+if [ -n "$(command -v egrep)" ]; then
+	debug "Colorizing egrep."
+	alias egrep='egrep --color=auto'
 fi
 
-if [ -n "$(command -v grep)" ]; then
-    alias fgrep='fgrep --color=auto'
+if [ -n "$(command -v fgrep)" ]; then
+	debug "Colorizing fgrep."
+	alias fgrep='fgrep --color=auto'
 fi