diff options
author | Přemysl Eric Janouch <p@janouch.name> | 2020-10-07 20:49:58 +0200 |
---|---|---|
committer | Přemysl Eric Janouch <p@janouch.name> | 2020-10-07 20:57:37 +0200 |
commit | c18630295ca074b801aa8a4ad1f9004ba8cf44f5 (patch) | |
tree | 51ef5ed61f1db93f45c59c864f59bc38c688ff41 | |
parent | b53a3a098144ed87d51076c87beacac02d039a70 (diff) | |
download | sdn-c18630295ca074b801aa8a4ad1f9004ba8cf44f5.tar.gz sdn-c18630295ca074b801aa8a4ad1f9004ba8cf44f5.tar.xz sdn-c18630295ca074b801aa8a4ad1f9004ba8cf44f5.zip |
README.adoc: add configuration for elvish
And remove it from the "similar software" section.
Our relationship has progressed.
Other unusual shells I've checked before I gave up:
- nushell lacks the ability to bind keys to user functions
- yash can but is otherwise way too basic
-rw-r--r-- | README.adoc | 35 |
1 files changed, 29 insertions, 6 deletions
diff --git a/README.adoc b/README.adoc index b9ddbd5..103078c 100644 --- a/README.adoc +++ b/README.adoc @@ -124,6 +124,35 @@ bind -x '"\201": sdn-restore' bind '"\eo":"\200\C-m\201"' ---- +elvish +~~~~~~ +To start using this navigator, put the following in your 'rc.elv': + +---- +use str +edit:insert:binding[Alt-o] = { + local:reesc = [posix]{ str:replace "'\\''" "''" $posix } + local:posix = [cmd]{ eval ($reesc $cmd)" </dev/tty >/dev/tty 2>&1" } + + # XXX: the -dot is not a stable API, and may hence break soon + local:buffer = $edit:current-command + local:cursor = (str:to-codepoints $buffer[0..$edit:-dot] | count) + local:ns = (ns [&]) + while ?(eval ($reesc (sdn $buffer $cursor | + sed 's/^local //' | slurp)) &ns=$ns) { + if (not-eq $ns[cd] "") { cd $ns[cd] } + if (not-eq $ns[insert] "") { edit:insert-at-dot $ns[insert]" " } + if (or (eq $ns[helper] "") (not ?($posix $ns[helper]))) { break } + } + edit:redraw &full=$true +} +---- + +This shell 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). Version 0.14.1 or +newer is required. + Configuration ------------- @@ -168,12 +197,6 @@ 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 can't show the program help. 'sdn' is currently optimised for 'less' as the pager. -Similar software ----------------- - * https://elvish.io/ is an entire shell with an integrated ranger-like file - manager on Ctrl-N (I find this confusing and resource-demanding, preferring - to keep closer to "orthodox file managers") - Contributing and Support ------------------------ Use https://git.janouch.name/p/sdn to report any bugs, request features, |