tagfmt and errorfmt (#1086)
* Allow separate styles for cursor in normal and preview panes This defines new `cursorfmt` and `crusorpreviewfmt` options to style cursor in normal/preview panes. This allows using a different style for the normal and preview cursor. The documentation includes several possible values these options can be set to. The default behavior is an underline, same as in https://github.com/gokcehan/lf/pull/1072, since it should not cause severe problems and be visible on all terminals. It can now be easily changed, as explained in the docs. I also added an example to `etc/lfrc.example`. See linked issues and PRs for the more context. Fixes https://github.com/gokcehan/lf/issues/1038 Follows up on: https://github.com/gokcehan/lf/pull/1072 https://github.com/gokcehan/lf/pull/924 https://github.com/gokcehan/lf/commit/b47cf6d5a5 * Simplify configuration of several formatting options This simplifies the configuration of `cursorfmt`, `cursorpreviewfmt`, `tagfmt`, and `errorfmt` options. In almost all usecases, the value of these options had to end with `%s\033[0m` to print the contents of filename/tag/error and reset the terminal style. Now, if `%s` is not part of the option's value, `%s\033[0m` is appended automatically. This simplifies configuration. I retained the same behavior as before when `%s` is part of the string for backwards compatibility. I think it should be considered deprecated, but it also causes no harm.
LF
Google Groups | Wiki | #lf (on Libera.Chat) | #lf:matrix.org (with IRC bridge)
This is a work in progress. Use at your own risk.
lf (as in "list files") is a terminal file manager written in Go with a heavy inspiration from ranger file manager.
See faq for more information and tutorial for a gentle introduction with screencasts.
Features
- Cross-platform (Linux, macOS, BSDs, Windows)
- Single binary without any runtime dependencies
- Fast startup and low memory footprint due to native code and static binaries
- Asynchronous IO operations to avoid UI locking
- Server/client architecture and remote commands to manage multiple instances
- Extendable and configurable with shell commands
- Customizable keybindings (vi and readline defaults)
- A reasonable set of other features (see the documentation)
Non-Features
- Tabs or windows (better handled by window manager or terminal multiplexer)
- Builtin pager/editor (better handled by your pager/editor of choice)
Installation
See packages for community maintained packages.
See releases for pre-built binaries.
Building from the source requires Go.
On Unix (Go version < 1.17):
env CGO_ENABLED=0 GO111MODULE=on go get -u -ldflags="-s -w" github.com/gokcehan/lf
On Unix (Go version >= 1.17):
env CGO_ENABLED=0 go install -ldflags="-s -w" github.com/gokcehan/lf@latest
On Windows cmd (Go version < 1.17):
set CGO_ENABLED=0
set GO111MODULE=on
go get -u -ldflags="-s -w" github.com/gokcehan/lf
On Windows cmd (Go version >= 1.17):
set CGO_ENABLED=0
go install -ldflags="-s -w" github.com/gokcehan/lf@latest
On Windows powershell (Go version < 1.17):
$env:CGO_ENABLED = '0'
$env:GO111MODULE = 'on'
go get -u -ldflags="-s -w" github.com/gokcehan/lf
On Windows powershell (Go version >= 1.17):
$env:CGO_ENABLED = '0'
go install -ldflags="-s -w" github.com/gokcehan/lf@latest
Usage
After the installation lf command should start the application in the current directory.
Run lf -help to see command line options.
Run lf -doc to see the documentation.
See etc directory to integrate lf to your shell and/or editor.
Example configuration files along with example colors and icons files can also be found in this directory.
See integrations to integrate lf to other tools.
See tips for more examples.
Contributing
See contributing for guidelines.

