7 ms·
Show HN: Nav – A terminal navigator for interactive `ls` workflows
Hi Everyone,
I built a tool for interactive navigation in the terminal that is intended to replace the all-too-familiar cycle of `ls` to view a directory, followed by `cd`, then `ls`, and repeat.
nav is a terminal filesystem explorer built for interactive `ls` workflows. The key features I wanted to enable are interactivity and search without feeling like I'm using anything other than `ls`. nav supports common `ls` options/flags, as well as tab completion, and might expand its support for less common options in the future. These options exist as both CLI flags and interactive toggles.
nav works as a standalone tool or in a bash/zsh pipe or subshell to e.g., change directories, copy a file name to the clipboard, etc. For example, I use the simple functions from the README in my .zshrc for interactive `cd` and copy-to-clipboard workflows.
nav was inspired by the discussion of the excellent `walk` [0] tool and was written from the ground up to support its `ls`-centric interactive feature set. I hope you might find it useful and I'd love to take any feedback or suggestions that might come to mind!
[0] https://news.ycombinator.com/item?id=37220828 https://news.ycombinator.com/item?id=37220828
- cstrahan 3y agoNice! For inspiration, you may want to look at `lf`: https://github.com/gokcehan/lf https://github.com/gokcehan/lf
- pxc 3y agoAlso Broot, which is-- like OP's tool-- intended as an ls replacement rather than a full file manager: https://github.com/Canop/broot https://github.com/Canop/broot
- dankco 3y agoBroot 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.
- pxc 3y agoI love tree, too! Sometimes broot feels a little busy or complex to me, though. I'm interested in your tool's UI as well.
- dystroy 3y agobroot can be used to replace tree (i.e. be non interactive): https://dystroy.org/broot/tricks/#replace-tree 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.
- soupbowl 3y agoBroot is incredible!
- nilsherzig 3y agoOh wow that's nice, exactly what I needed as an external file picker for helix
- dankco 3y agoThanks! 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.
- taffit 3y agoAlso `yazi` https://github.com/sxyazi/yazi https://github.com/sxyazi/yazi , which is the closest nnn-replacement on Windows up until now.
- djbusby 3y agoAny thoughts on Midnight Commander? https://midnight-commander.org/ https://midnight-commander.org/
- deleted 3y ago[deleted]
- dankco 3y agoI 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 https://github.com/charmbracelet
- visarga 3y agoHow about Norton Commander?
- Brian_K_White 3y agoSame 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.
- alchemist1e9 3y agonnn could be another to compare against.
- linhns 3y agoDecent effort. Have you tried looking at fzf? I managed to combine it with ripgrep to create a similar experience to what you have.
- dankco 3y agoYes, 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!
- metadat 3y agoCan you share your full bash or Z fu to merd these creatures? Gratzi, amigo.
- pmarreck 3y agoSomeone stick this up on search.nixos.org! Love me some good CL tooling
- deleted 3y ago[deleted]
- jraph 3y agoSeems 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.
- dankco 3y agoI 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.
- shashurup 3y agoLooks interesting. Have you thought about implementing marks, so that you can select some files for further operations?
- turboponyy 3y agoThere's also ranger and yazi.
- janderland 3y agoI’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.