From 6b235beb3962257a99bc5c85219d6091bd33bf92 Mon Sep 17 00:00:00 2001 From: Gokcehan Date: Sat, 21 Apr 2018 00:11:54 +0300 Subject: [PATCH] update documentation --- README.md | 3 +-- doc.go | 30 ++++++++++++++++++++++++++++++ docstring.go | 34 ++++++++++++++++++++++++++++++++++ 3 files changed, 65 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index efa9b81..d403aee 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ See [faq](https://github.com/gokcehan/lf/wiki/FAQ) for more information. - Single binary without any runtime dependencies (except for terminfo database) - Fast startup and low memory footprint (due to native code and static binaries) - Server/client architecture to share file selection between multiple instances -- Configurable with shell commands (sync or async) +- Configuration with shell commands - Customizable keybindings (vi and readline defaults) - Preview filtering (for source highlight, archives, pdfs/images as text etc.) @@ -39,7 +39,6 @@ See [faq](https://github.com/gokcehan/lf/wiki/FAQ) for more information. ## May-Futures - Bookmarks -- Colorschemes ## Installation diff --git a/doc.go b/doc.go index dc75943..0a6495b 100644 --- a/doc.go +++ b/doc.go @@ -516,5 +516,35 @@ relevant for big files. lf automatically closes the previewer script output pipe with a SIGPIPE when enough lines are read. When everything else fails, you can make use of the height argument to only feed the first portion of the file to a program for preview. + +Colorschemes + +lf tries to automatically adapt its colors to the environment. On startup, +first '$LS_COLORS' environment variable is checked. This variable is used by +GNU ls to configure its colors based on file types and extensions. The value of +this variable is often set by GNU dircolors in a shell configuration file. +dircolors program itself can be configured with a configuration file. dircolors +supports 256 colors along with common attributes such as bold and underline. + +If '$LS_COLORS' variable is not set, '$LSCOLORS' variable is checked instead. +This variable is used by ls programs on unix systems such as Mac and BSDs. This +variable has a simple syntax and supports 8 colors and bold attribute. + +If both of these environment variables are not set, then lf fallbacks to its +default colorscheme. Default lf colors are taken from GNU dircolors defaults. +These defaults use 8 basic colors and bold attribute. + +Keeping this mechanism in mind, you can configure lf colors in two different +ways. First, you can configure 8 basic colors used by your terminal and lf +should pick up those colors automatically. Depending on your terminal, you +should be able to select your colors from a 24-bit palette. This is the +recommended approach as colors used by other programs will also match each +other. + +Second, you can set the values of environmental variables mentioned above for +fine grained customization. This is useful to change colors used for different +file types and extensions. '$LS_COLORS' is more powerful than '$LSCOLORS' and +it can be used even when GNU programs are not installed on the system. You can +combine this second method with the first method for best results. */ package main diff --git a/docstring.go b/docstring.go index 55666c2..5d4f56a 100644 --- a/docstring.go +++ b/docstring.go @@ -544,4 +544,38 @@ especially relevant for big files. lf automatically closes the previewer script output pipe with a SIGPIPE when enough lines are read. When everything else fails, you can make use of the height argument to only feed the first portion of the file to a program for preview. + + +Colorschemes + +lf tries to automatically adapt its colors to the environment. On startup, +first '$LS_COLORS' environment variable is checked. This variable is used by +GNU ls to configure its colors based on file types and extensions. The value +of this variable is often set by GNU dircolors in a shell configuration +file. dircolors program itself can be configured with a configuration file. +dircolors supports 256 colors along with common attributes such as bold and +underline. + +If '$LS_COLORS' variable is not set, '$LSCOLORS' variable is checked +instead. This variable is used by ls programs on unix systems such as Mac +and BSDs. This variable has a simple syntax and supports 8 colors and bold +attribute. + +If both of these environment variables are not set, then lf fallbacks to its +default colorscheme. Default lf colors are taken from GNU dircolors +defaults. These defaults use 8 basic colors and bold attribute. + +Keeping this mechanism in mind, you can configure lf colors in two different +ways. First, you can configure 8 basic colors used by your terminal and lf +should pick up those colors automatically. Depending on your terminal, you +should be able to select your colors from a 24-bit palette. This is the +recommended approach as colors used by other programs will also match each +other. + +Second, you can set the values of environmental variables mentioned above +for fine grained customization. This is useful to change colors used for +different file types and extensions. '$LS_COLORS' is more powerful than +'$LSCOLORS' and it can be used even when GNU programs are not installed on +the system. You can combine this second method with the first method for +best results. `