News for hackers. Stuff that matters.
Re: by djbusby on Wednesday September 27, 2023 @05:41PM (#37681739)
Any thoughts on Midnight Commander?

https://midnight-commander.org/

Re: by dankco on Wednesday September 27, 2023 @06:35PM (#37682366)
I have to admit that I had not come across midnight-commander. It certainly looks interesting and I'll be giving it a spin. Thanks for pointing me in its direction!

I do intend to expand nav's feature set to come close to an `ls` replacement, at least for the most common workflows, whereas midnight-commander and other similar tools are perhaps closer to being (or are) file managers. I'm also hopeful that by using the completely awesome Charm [0] libraries that I can make for a pleasing/modern UI. Either way, I had a blast building nav and look forward to continuing on.

Thanks again for the comment!

[0] https://github.com/charmbracelet

Re: by visarga on Wednesday September 27, 2023 @07:04PM (#37682685)
How about Norton Commander?
Re: by Brian_K_White on Wednesday September 27, 2023 @09:56PM (#37684243)
Same thing. MC was made to emulate NC. And of course there are actually countless filesystem browsers. Even xtree was probably not the first since that was on ms-dos, and I bet there were some on the 8-bit machines before that.

But this one's aim seems to be a bit specific and not simply to be a filesystem browser (file manager) but specifically to try to be an "interactive ls". IE somehow feel like ls. Though I don't know why. It doesn't seem more useful than a normal file manager. I think it's just down to a very fine point of aesthetics, which is fair enough.

Re: by alchemist1e9 on Wednesday September 27, 2023 @07:56PM (#37683253)
nnn could be another to compare against.
Re: by blooalien on Thursday September 28, 2023 @12:46AM (#37685334)
Midnight Commander also includes a really decent little text editor (mcedit) with syntax highlighting for a decent range of text file formats.
Re: by renewiltord on Wednesday September 27, 2023 @08:10PM (#37683410)
It can edit zip files and stuff. I actually had no idea it was a Miguel de Icaza project. Quite a prolific fellow.
Re: by JNRowe on Wednesday September 27, 2023 @10:48PM (#37684581)
The beauty of that feature is the system to implement it - extfs(EXTernal virtual File System) - is built with simple scripts, so you can add your own little tools to make other things navigable beyond the ~40 that come bundled.

There is a simple introduction in /usr/lib/mc/extfs.d/README, or https://github.com/MidnightCommander/mc/blob/master/src/vfs/... .

Re: by cstrahan on Wednesday September 27, 2023 @06:46PM (#37682469)
Nice! For inspiration, you may want to look at `lf`: https://github.com/gokcehan/lf
Re: by dankco on Wednesday September 27, 2023 @07:24PM (#37682881)
Thanks! This does look like a similar tool, and as you said, I love seeing what others have done for inspiration for new features to tools I'm working on. Thanks again.
Re: by pxc on Wednesday September 27, 2023 @07:00PM (#37682653)
Also Broot, which is-- like OP's tool-- intended as an ls replacement rather than a full file manager: https://github.com/Canop/broot
Re: by dankco on Wednesday September 27, 2023 @07:23PM (#37682869)
Broot looks really nice. I love the tree-like output - `tree` is one of my favorite tools. Interactive tree is a great idea, makes me wish I had perhaps started there instead.
Re: by pxc on Wednesday September 27, 2023 @09:54PM (#37684230)
I love tree, too!

Sometimes broot feels a little busy or complex to me, though. I'm interested in your tool's UI as well.

Re: by dystroy on Thursday September 28, 2023 @04:55AM (#37687045)
broot can be used to replace tree (i.e. be non interactive): https://dystroy.org/broot/tricks/#replace-tree

This is convenient when you don't want to browse or search, just want what tree does but without scrolling.

Re: by soupbowl on Wednesday September 27, 2023 @07:55PM (#37683252)
Broot is incredible!
Re: by nilsherzig on Wednesday September 27, 2023 @08:35PM (#37683616)
Oh wow that's nice, exactly what I needed as an external file picker for helix
Re: by taffit on Thursday September 28, 2023 @06:45AM (#37687745)
Also `yazi` https://github.com/sxyazi/yazi , which is the closest nnn-replacement on Windows up until now.
Re: by linhns on Wednesday September 27, 2023 @08:36PM (#37683631)
Decent effort. Have you tried looking at fzf? I managed to combine it with ripgrep to create a similar experience to what you have.
Re: by dankco on Wednesday September 27, 2023 @09:04PM (#37683854)
Yes, fzf and ripgrep are the best! Together they are the heart of at least half of my .zshrc functions, and it would be fun to see about writing something similar by composing them together in various ways. Great idea!
Re: by metadat on Wednesday September 27, 2023 @09:48PM (#37684181)
Can you share your full bash or Z fu to merd these creatures?

Gratzi, amigo.

Re: by pmarreck on Wednesday September 27, 2023 @09:33PM (#37684065)
Someone stick this up on search.nixos.org! Love me some good CL tooling
Re: by jraph on Thursday September 28, 2023 @02:37AM (#37686110)
Seems nice :-)

For this part specifically:

> the all-too-familiar cycle of `ls` to view a directory, followed by `cd`, then `ls`, and repeat

I use (oh-my-)zsh for this. Tab would autocomplete (with some basic support for fuzzy "search" - case insensitive, part for the file works). If there are several options it displays them and they can be selected. When completed, another tab press displays the folder content. For some commands, it tries to show only relevant files. For cd, it won't complete with the name of a (non-folder) file.

This is very effective. I feel like one of my hands is missing when I don't have this, for instance when I'm using bash.

Re: by dankco on Thursday September 28, 2023 @10:02AM (#37689746)
I agree! nav supports this workflow in search mode as well, and I could easily support fuzzy searching rather than exact match if that would be valuable.
Re: by shashurup on Thursday September 28, 2023 @04:38AM (#37686945)
Looks interesting.

Have you thought about implementing marks, so that you can select some files for further operations?

Re: by dankco on Thursday September 28, 2023 @10:02AM (#37689754)
I love this idea and will look into implementing it in the next few days! Thanks!
Re: by dankco on Saturday September 30, 2023 @07:45PM (#37721071)
Thanks again for the great suggestion. I've implemented this and it is part of the latest release (v1.1.0).
Re: by turboponyy on Thursday September 28, 2023 @09:46AM (#37689543)
There's also ranger and yazi.
Re: by janderland on Thursday September 28, 2023 @12:02PM (#37691550)
I’ve used ranger for years, even fixed a bug I found while using it.

For my work patterns it’s too feature rich. I only use it for browsing directory structures. Everything else just gets in the way because I haven’t taken the time to learn the other features.