1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

lessに色を付ける

Posted at

Linuxを使っていると,しばしばlessでソースコードの中身を確認します.しかし,lessでソースコードを見るとシンタックスハイライトの機能がないため読みにくいです.そこで,lessでシンタックスハイライトを有効にします(ソースコードに色がついてカラフルになります).

手順

まず,source-hightをインストールします.

sudo apt install source-highlight

つぎに,zshを使っている人は.zshrc,bashを使っている人は.bashrcに次のコードを追加します.

export LESS="-R"
export LESSOPEN="| /usr/share/source-highlight/src-hilite-lesspipe.sh %s"

以上でlessでシンタックスハイライトが有効になりました.

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?