sdn/sdn.1
Přemysl Eric Janouch fdb338fe12
Allow binding to custom key sequences
And document this feature in the manual page.
2021-07-07 21:21:32 +02:00

3.9 KiB
Raw Blame History

SDN(1) General Commands Manual SDN(1)

NAME

sdn — directory navigator

SYNOPSIS

sdn [line point]
sdn --version

DESCRIPTION

sdn is a simple directory navigator that you can launch while editing shell commands. Use the sdn-install(1) script to integrate it with your shell, then invoke it at any time with M-o.

Press F1 to get a list of active key bindings and their assigned actions, grouped by their contexts.

Program arguments are only used by integration snippets to forward the parent shells command line. The point is given in terms of characters.

OPTIONS

While some behaviour can be toggled from within the program, some can only be changed by modifying configuration files manually.

The files follow a simple syntax derived from the Bourne shell: each option is on its own line, with words separated by linear whitespace. Comments start with a hash (#) and continue until the end of the line. All special characters may be quoted using either a backslash or single-quoted strings.

The options and the default key bindings controlling them are as follows:

full-view bool (t)

If non-zero, the equivalent format to ls -l is used to display directory contents rather than simply listing the filenames.

gravity bool

If non-zero, all entries stick to the bottom of the screen, i.e., all empty space is at the top.

reverse-sort bool (R)

If non-zero, the order of entries is reversed.

show-hidden bool (M-.)

If non-zero, filenames beginning with a full stop are shown.

ext-helpers bool

If non-zero, viewers and editors are launched from the parent shell. This way you can suspend them and use job control features of the shell. However it also enforces any pending change to the shells working directory.

sort-column number (< >)

The zero-based index of the full-view column that entries are ordered by.

ENVIRONMENT
LS_COLORS

Used to retrieve filename colours. The format is described in dir_colors(5) and you can use the dircolors(1) utility to initialize this variable.

PAGER

The viewer program to be launched by the F3 key binding as well as to show the internal help message. If none is set, it defaults to less(1).

VISUAL, EDITOR

The editor program to be launched by the F4 key binding. If neither variable is set, it defaults to vi(1).

FILES
˜/.config/sdn/config

Program configuration and navigation state, initialized or overwritten on exit.

˜/.config/sdn/bindings

Custom key binding overrides.

˜/.config/sdn/look

Redefine terminal attributes for UI elements.

EXAMPLES

bindings

Key names or combinations follow the Emacs syntax for Control and Meta prefixes and terminfo(5) names are used for special keys. To obtain more vifm-like controls and Windows-like quit abilities:

normal h parent
normal l choose
normal M-f4 quit

Midnight Commander binds the same traversal actions to sequences normally unknown to ncurses, due to them being missing from terminfo. Youll need to define them manually to match your terminal. For rxvt, that would be:

define C-ppage ˆ[[5ˆ
define C-npage ˆ[[6ˆ
normal C-ppage parent
normal C-npage choose

Escape characters must be inserted verbatim, e.g., by pressing C-v ESC in vi, or C-q ESC in Emacs.

look

Terminal attributes are accepted in a format similar to that of git-config(1), only named colours arent supported. For a black-on-white terminal supporting 256 colours, a theme such as the following may work:

cursor 231 202
bar 16 255 ul
cwd bold
input
cmdline 145

REPORTING BUGS

Use https://git.janouch.name/p/sdn to report bugs, request features, or submit pull requests. Linux October 27, 2020 SDN(1)