Show HN: Nnn – unorthodox terminal file manager
github.com
github.com
This was partly inspired by the 'to spend more time with his kid than at a computer' quote.
a bit off topic: do you have a rough idea about the number of actual users, other than github stars?
I am not trying to doxx you or anything :D, just thinking about the dynamics of open source and my own inspirations. ----- Disclaimer: I don't any experience with what I am talking about.
I started contributing to open source because I learn a lot from it since my graduation days. I think of it as a payback to the community. Having said that - I do appreciate users donating now and then. :)
> This was partly inspired by the 'to spend more time with his kid than at a computer' quote.
My regular job is a demanding one. So I have to work smart to save time for my kid and family. Some of the utilities were written to help with that.
> Do you have a rough idea about the number of actual users, other than github stars?
Not really. But I know for sure even some orgs use some of my utilities.
Hope you and your familly all the best.
Thank you!
Please don't hide your feature list under a toggle though! Put it all the way at the top - I nearly missed it.
I wonder what is the significance of avoiding floating point math in a program that will spend most of its time waiting for user input.
If I want something more rich or discoverable, I'll just move to a GUI, which handles this much better.
Also, find/fzf etc. are useful as long as you are not on a slow disk and a mid-range Android device/the Pi. If you are saying you are OK with scanning the whole filesystem every time you are looking for something that can be anywhere under /, I simply don't prefer that.
You can specify a target directory from which to start the search.
But you know what, let me share a smarter workflow:
find . -iname "*.mp3" -print0 | nnn -p -
Now you list all yours mp3 files in nnn, examine/play them and finally get to cherry-pick some and print them to stdout when you quit nnn.BTW, you can also run the find within nnn and list in nnn.
Better to have "chpwd() { ls }" in your .zshrc as this executes ls after cd'ing to save up on your infinite amount of ls typing.
If you only work inside messy folders with hundreds of files all the time, maybe it's time to tidy up.
Can someone who uses these tools explain ?
My question isn't snark. It's more like "what is the usecase and what advantages does it have over standard terminal workflows?"
FWIW: My main file manipulations I need to do are within vim when working on a project. I typically use nerdtree for this, but having a project that's consistent in my environment would be good.
I do other manipulations using standard tools like ls/rm/etc. what advantages does this have over those ?
I don't personally use them, but I live in emacs for many hours a day so I do use its integrated directory-manager (dired) to perform simple operations.
Add a drop-down temrminal file manager to the mix, so you never lose your context. ;)
With ranger[0], I can even use it as an alternative to cd, which is often the most convenient (I usually want a terminal in the last directory I browsed to, not the place where I opened the file manager[1]).
I hope to find a way to use nnn similarly, but it (like ranger) doesn't seem to support this out of the box.
[0]: https://github.com/ranger/ranger
[1]: https://unix.stackexchange.com/questions/342064/ranger-cd-in...
cd on quit works in nnn as well... and many other file managers.
https://github.com/jarun/nnn/wiki/Basic-use-cases#configure-...
No utility can support cd-on-quit out of the box because a spawned process can't send the $PWD to the parent directly when it quits. It needs tweaks in your shell's rc file. nnn also needs the same instrumentation.
Separately, I have a bunch of keybindings to load sets of files into fzf for easy access. Things like modified files, files changed in current branch, branches modified in the past six weeks. All of these have make working for a large code base much easier for me with little downside except have to piece them together on a new machine.
Do you have your dotfiles available to share? That sounds really useful
For other things like files changed in current branch I've just kludged together aliases: branch_files='git log --decorate --pretty=oneline --abbrev-commit --name-only --no-merges --first-parent main..HEAD | fpp'
(fpp extracts file paths from output)
If you use zsh it can also helpful to setup suffix aliases so just the filename is bound to an application. For instance `alias -s {rb,erb,rake,css,js}=vim`
Being realtively new to Linux both these commands will be super helpful to me. Are there any other command line tools you will recommend?
A terminal file manager has a GUI that works everywhere, including over SSH sessions (OK, technically could use X forwarding, but it's slow).
nnn takes care of these already. I don't think you would see a difference once you get used to.
Looks like emacs uses at least double the memory.
A gui doesn't help, because usually I'm on a remote server somewhere (using SSH).
List of features: https://github.com/jarun/nnn#features
nnn is much faster, but I was already used to ranger's keystrokes and I did not want to learn a new set of keystrokes.
Then learned about lf, a ranger clone written in go, which is much faster. That is what I use now.
It is possible that nnn is the fastest file manager out there.
You may also want to try Midnight commander, a timeless classic.
You don't really need to learn too many new keystrokes for the set of functionality you get in ranger. Many of them are same too.
Also mentioned in this thread, lf a ranger clone written in go [2].
[0]: https://github.com/jarun/nnn/wiki/Advanced-use-cases#custom-...
nnn also has an option to make the process simpler. Additional details - https://github.com/jarun/nnn/wiki/Advanced-use-cases#custom-...
I feel like I configure nnn via github issues xD
If you think maintaining a piece of software like nnn is easy, it's not. You can't make everyone happy.
Then I realized that I can accomplish this task already by running
vim .
It seems almost identical to nnn with the restriction that everything is opened vim.
alias nnn='nnn -e'
export VISUAL="gvim -v"
to my .bashrc and it really is much cleaner/nicer than using
vim .
so I think I will swtich to nnn
nnn - Supercharge your productivity! Latest release Availability Travis Status CircleCI Status Privacy Awareness License icons and colors asciicast [Features] [Quickstart] [Plugins] [Documentation] nnn (n³) is a full-featured terminal file manager.