4 ms·
A lot of good features in nnn. Unfortunately, for me, the huge deal breaker is the (sorry, but I have to say it) terrible choices for one of the most important
by throwaway053934 8y ago
A lot of good features in nnn. Unfortunately, for me, the huge deal breaker is the (sorry, but I have to say it) terrible choices for one of the most important hotkey-functionality combinations.
I am not talking about some rarely used keys/functions, but the problem lies at the very core of the experience: the simple hjkl, vim-style navigation.
You see, as in vim, k/j ('up'/'down') obviously move up/down in the list of dirs/files. h ('left') moves up the directory hierarchy ('Parent dir' as nnn's help aptly describes the function.) Of course, now l ('right') moves down the directory hierarchy: IF you are sitting with the highlight on a DIRECTORY entry, obviously if moves down into that directory.
But here is the kicker: what if you have as your current highlight something OTHER than a directory, that is a FILE ?
It OPENS the file.
(The open operation is done through xdg-open, so whatever that is configured to recognize)
If xdg-open is not configured defensively, in the case when the file is executable it runs the program.
Or if the file has some associated program, it is launched with the file as an argument. (this was happening even on my machine, and I have a relatively conservative xdg-open config)
At the minimum it launches an editor, opening the file in read/WRITE.
In nnn's help, listed among the keys activating this 'Open file/enter dir' is the <Return> key, in addition to the usual move right keys (so 'l' and right arrow). A clear expression that in the authors intention those keys have equivalent functionality.
So imagine you're browsing around the file system as fast as your fingers and eyes allow (after, that's the beauty of the fast text/ncurses interfaces, yes?). You just want to examine stuff, look at files, poke into configurations, maybe for a archive you just downloaded. Archive that might or might not have executable stuff and/or potentially harmful things. You've located the dir path you want to go into, you dive in and before you realize you need to hit the brakes on that 'l' key, you end up moveing RIGHT on SOMETHING (it happened so fast you're not even sure what it was), and that SOMETHING was executed/loaded, now some application is opened, and on top of that you were continuing to type so that application receives your keys and does who-knows-what (well, depending on what was launched).
WTF ???
The first time it happened, I could not believe such a UI design decision: mixing NAVIGATION and OPEN operations on the SAME KEY. OPEN is a sensitive, potentially disruptive operation: there SHOULD be some minimal friction provided in the interface before one is allowed to proceed.
It moved this nnn from potentially one my favorite tools, into a totally love/hate relationship. Yes, "love" because indeed it does some things well. But the mistake of this RIGHT/OPEN snafu is enough to more than cancel any other qualities.
- apjana 8y ago> It OPENS the file. Oh, don't worry! I can drop an env var to disable the right-> open file thing. However, all dirs are listed on top separately and in a clearly different color. How often are you ending up pressing the right on a file? I am surprised because `nnn` has many users and no one ever mentioned this as an issue before!
- throwaway053934 8y agoThanks. I look forward to give nnn another spin then. While you're at it, please add more customization for mapping keys to operations. Nothing heavy, just a bit of freedom for the most used operations. (e.g. customizing the key for the 'preview in PAGER' would be great!) Also, I guess I owe you a bit of an apology: today I noticed noice has the same behavior and you simply carried it forward in nnn when you forked it (in the header, all those keys mapping to SEL_GOIN). So if there is a blame, it should be shared with the original design. > dirs ... in a clearly different color Hey, unless you launch nnn -c 10 I guess ? ;-) Or nnn -l -c 10 and there is even less to distinguish them other than that slash. > How often are you Maybe it's the file hierarchy on my machine, but I end up a lot, somehow. One easy example is a deeper path ending with, say, an .odt or .xcf as first entry in the last, leaf directory, e.g. a/b/c/d/e/bigfile.xcf; oops! one extra l and the gimp or libre office start up (for fun, try that on a RPi ;-) As someone else mentioned in the discussion, the intuition is that going up and down the SAME path will take you to the SAME positions in each directory: the example given was "/a/b/c/d -> /a/b/c -> /a/b -> /a/b/c -> /a/b/c/d;". That is not the case in noice/nnn and it can trip you off. To make it more clear, consider this tree: tmp/a/1b/huge.odt tmp/a/2b/c/some_other_stuff You are inside 'c'; you quickly go up 3 levels ('hhh') to glance at the content of 'tmp'; then you go back down 3 levels by quickly tapping 'lll', intuitively expecting to end up in the same place, inside 'c'; instead you'll go in 'a', but then in '1b' on the 'huge.odt' file , then the 3rd l launches libre office... > many users and no one ever mentioned selection bias or how do you call this effect ? People that are bothered by this simply moved away and didn't mention a thing ? Anyway, thanks again.
- apjana 8y agoHey no problem! Would it be possible for you to raise a PR? There's a case for regular files.