Optionally select theme for hl command
This commit is contained in:
@@ -121,11 +121,17 @@ function gci() {
|
|||||||
|
|
||||||
# syntax highlight the contents of a file or the clipboard and place the result on the clipboard
|
# syntax highlight the contents of a file or the clipboard and place the result on the clipboard
|
||||||
function hl() {
|
function hl() {
|
||||||
if [ -z "$2" ]; then
|
if [ -z "$3" ]; then
|
||||||
src=$( pbpaste )
|
src=$( pbpaste )
|
||||||
else
|
else
|
||||||
src=$( cat $2 )
|
src=$( cat $3 )
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo $src | highlight -O rtf --syntax $1 --font Inconsoloata --style moria --font-size 24 | pbcopy
|
if [ -z "$2" ]; then
|
||||||
|
style="moria"
|
||||||
|
else
|
||||||
|
style="$2"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo $src | highlight -O rtf --syntax $1 --font Inconsoloata --style $style --line-number --font-size 24 | pbcopy
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user