Configure less to show colors by default
To see more informations, see: https://superuser.com/a/337640/881905
This commit is contained in:
3
.bashrc
3
.bashrc
@@ -71,6 +71,9 @@ alias markdown_pdf="docker run --rm -v \$PWD:/opt/docs auchida/markdown-pdf mark
|
|||||||
alias vimwiki='vim -c VimwikiIndex -c "cd %:p:h" -c "silent Git pull"'
|
alias vimwiki='vim -c VimwikiIndex -c "cd %:p:h" -c "silent Git pull"'
|
||||||
alias wiki='vim -c VimwikiIndex -c "cd %:p:h" -c "silent Git pull"'
|
alias wiki='vim -c VimwikiIndex -c "cd %:p:h" -c "silent Git pull"'
|
||||||
|
|
||||||
|
export LESS='-R'
|
||||||
|
export LESSOPEN='|~/.local/bin/lessfilter %s'
|
||||||
|
|
||||||
# Enable autocompletion for "config" to manage dotfiles
|
# Enable autocompletion for "config" to manage dotfiles
|
||||||
__git_complete config __git_main
|
__git_complete config __git_main
|
||||||
|
|
||||||
|
|||||||
22
.local/bin/lessfilter
Executable file
22
.local/bin/lessfilter
Executable file
@@ -0,0 +1,22 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
case "$1" in
|
||||||
|
*.awk|*.groff|*.java|*.js|*.m4|*.php|*.pl|*.pm|*.pod|*.sh|\
|
||||||
|
*.ad[asb]|*.asm|*.inc|*.[ch]|*.[ch]pp|*.[ch]xx|*.cc|*.hh|\
|
||||||
|
*.lsp|*.l|*.pas|*.p|*.xml|*.xps|*.xsl|*.axp|*.ppd|*.pov|\
|
||||||
|
*.diff|*.patch|*.py|*.rb|*.sql|*.ebuild|*.eclass|*.vim|\
|
||||||
|
.vimrc|*.yaml|*.yml|*.json|*.properties|*.html|*.scss|\
|
||||||
|
*.css|*.ts)
|
||||||
|
pygmentize -f 256 "$1";;
|
||||||
|
|
||||||
|
.bashrc|.bash_aliases|.bash_environment|.profile)
|
||||||
|
pygmentize -f 256 -l sh "$1";;
|
||||||
|
|
||||||
|
*)
|
||||||
|
if grep -q "#\!/bin/bash" "$1" 2> /dev/null; then
|
||||||
|
pygmentize -f 256 -l sh "$1"
|
||||||
|
else
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
esac
|
||||||
|
|
||||||
|
exit 0
|
||||||
Reference in New Issue
Block a user