From 8b3410692958d6aa7ea918d94501a7d63c969522 Mon Sep 17 00:00:00 2001 From: Jim Myhrberg Date: Wed, 7 Feb 2018 10:33:25 +0000 Subject: [PATCH] Enable syntax highlighting in less, and update less too --- bin/bootstrap-homebrew | 2 ++ shell/_main.sh | 1 + shell/less.sh | 11 +++++++++++ 3 files changed, 14 insertions(+) create mode 100644 shell/less.sh diff --git a/bin/bootstrap-homebrew b/bin/bootstrap-homebrew index f1c5e02..8676e82 100755 --- a/bin/bootstrap-homebrew +++ b/bin/bootstrap-homebrew @@ -48,6 +48,7 @@ main() { jq kubernetes-cli kubernetes-helm + less mysql openshift-cli peco @@ -60,6 +61,7 @@ main() { ruby-build shellcheck sshfs + source-highlight the_silver_searcher thefuck tmux diff --git a/shell/_main.sh b/shell/_main.sh index d4fff20..343e565 100755 --- a/shell/_main.sh +++ b/shell/_main.sh @@ -40,6 +40,7 @@ source "$DOTSHELL/git.sh" source "$DOTSHELL/tmux.sh" source "$DOTSHELL/thefuck.sh" source "$DOTSHELL/ctags.sh" +source "$DOTSHELL/less.sh" # Development source "$DOTSHELL/nodejs.sh" diff --git a/shell/less.sh b/shell/less.sh new file mode 100644 index 0000000..60c67db --- /dev/null +++ b/shell/less.sh @@ -0,0 +1,11 @@ +# +# less setup +# + +alias le="less" + +# Enable syntax highlighting via source-highlight +if command -v src-hilite-lesspipe.sh > /dev/null; then + export LESSOPEN="| src-hilite-lesspipe.sh %s" + export LESS=" -R " +fi