Directory navigator
Go to file
Přemysl Eric Janouch c9b003735d
All checks were successful
Arch Linux AUR Success
Alpine 3.20 Success
OpenBSD 7.5 Success
Fix OpenBSD build
2024-12-21 07:59:44 +01:00
.clang-format Add clang-format configuration, clean up 2021-11-05 21:34:05 +01:00
CMakeLists.txt Fix OpenBSD build 2024-12-21 07:59:44 +01:00
LICENSE Fix passing filenames starting with - 2024-01-20 08:33:17 +01:00
Makefile Makefile: make the static build a non-phony target 2021-07-19 09:28:50 +02:00
README.adoc Add support for BSD derivatives, fix macOS 2024-12-21 07:37:06 +01:00
sdn-install bash integration: add helpers to command history 2021-11-05 22:11:30 +01:00
sdn-install.1 Make the manpages mostly acceptable 2020-10-27 04:17:52 +01:00
sdn.1 Allow binding to custom key sequences 2021-07-07 21:21:32 +02:00
sdn.cpp Fix OpenBSD build 2024-12-21 07:59:44 +01:00
sdn.png Add screenshot to README 2018-11-02 21:19:41 +01:00

sdn

sdn is a simple directory navigator that you can invoke while editing shell commands. It enables you to:

  • take a quick peek at directory contents without running ls

  • browse the filesystem without all the mess that Midnight Commander does: theres no need to create a subshell in a new pty. The current command line can be simply forwarded if it is to be edited. Whats more, it will always be obvious whether the navigator is running.

sdn runs on Linux and all BSD derivatives. I wanted to try a different, simpler approach here, and the end result is very friendly to tinkering.

sdn

Packages

Regular releases are sporadic. git master should be stable enough. You can get a package with the latest development version using Arch Linuxs AUR, or as a Nix derivation.

Building

Build dependencies: CMake and/or make, a C++14 compiler, pkg-config
Runtime dependencies: ncursesw, libacl

Unfortunately most LLVM libc++ versions have a bug that crashes sdn on start. Use GNU libstdc++ if youre affected.

$ git clone https://git.janouch.name/p/sdn.git
$ mkdir sdn/build
$ cd sdn/build
$ cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Debug
$ make

To install the application, you can do either the usual:

# make install

Or you can try telling CMake to make a package for you. For Debian it is:

$ cpack -G DEB
# dpkg -i sdn-*.deb

There is also a Makefile you can use to quickly build a binary to be copied into the PATH of any machine you want to have sdn on.

Configuration

For a slightly more technical explanation please refer to manual pages.

Integration

The package contains an installation script called sdn-install which will bind sdn to Alt-o in your shells initialisation file. The supported shells are:

  • zsh: works well

  • bash: minor issue: exiting the navigator confirms an empty prompt

  • fish: works well

  • elvish: version 0.14.1 and above, an unstable API is used, works well

    elvish is absolutely perverse. And so is integrating sdn into it because it already includes a custom file manager, bound to Ctrl-N (though I find the ranger-like interface confusing and resource-demanding).

Colours

Here is an example of a ~/.config/sdn/look file; the format is similar to that of git, only named colours arent supported:

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

Filename colours are taken from the LS_COLORS environment variable. Run dircolors to get some defaults.

Bindings

To obtain more vifm-like controls, you may write the following to your ~/.config/sdn/bindings file:

normal h parent
normal l choose

Helper programs

The F3 and F4 keys are normally bound to actions view and edit, similarly to Norton Commander and other orthodox file managers. The helper programs used here may be changed by setting the PAGER and VISUAL (or EDITOR) environment variables.

While it is mostly possible to get mcview working using an invocation like PAGER='mcview -u' sdn, beware that this helper cannot read files from its standard input, nor does it enable overstrike processing by default (F9, could be hacked around in mc.ext by turning on the nroff switch for a custom file extension, just without actually invoking nroff), and thus it cant show the program help. sdn is currently optimised for less as the pager.

Contributing and Support

Use https://git.janouch.name/p/sdn to report any bugs, request features, or submit pull requests. git send-email is tolerated. If you want to discuss the project, feel free to join me at ircs://irc.janouch.name, channel #dev.

Bitcoin donations are accepted at: 12r5uEWEgcHC46xd64tt3hHt9EUvYYDHe9

License

This software is released under the terms of the 0BSD license, the text of which is included within the package along with the list of authors.