4 ms·
> However, if the directory has many files or sub-directories, tree becomes much less helpful: you only see the last screen full of information as files scroll
by hnlmorg 5y ago
> However, if the directory has many files or sub-directories, tree becomes much less helpful: you only see the last screen full of information as files scroll past you.
tree | less
- CraigJPerry 5y agoRecently i’ve taken to using nnn for anything like this: https://github.com/jarun/nnn https://github.com/jarun/nnn - i never used cli file managers but now, it’s up there with my shell, vim & tmux as a core productivity tool. Show me files in this dir: $ n Show/hide details for each: . Filter / search file list: / Navigate subdirs (or parents) with vim or arrow keys. Cd into sub dirs by typing unique chars from dir names: ctrl-n Drop back to shell i started n from but cd into this new dir: ctrl-g Exit n without cd’ing to the new dir i navigated to: q https://github.com/craigjperry2/dotfiles/blob/main/dotfiles/zshrc#L59 https://github.com/craigjperry2/dotfiles/blob/main/dotfiles/... Although for deeply nested targets where i already know what im after, i’ll just: vim<ctrl+t> To launch an fzf fuzzy finder on the (.gitignore aware) results of an “fd” (cross platform alternative to gnu and bsd find)
- gen220 5y agoIf you’re already in vim, why not use whatever equivalent to NERDTree is popular? Unless you’re only interested in the structure and names, and not the file contents? It seems like they even have a neovim plugin, you might consider using it.
- CraigJPerry 5y agoThe integration is pretty decent in vim, i have it configured to open a window overlay on <leader>n (requires neovim) https://github.com/craigjperry2/dotfiles/blob/main/dotfiles/init.vim#L12 https://github.com/craigjperry2/dotfiles/blob/main/dotfiles/... That said, i don't find myself using that as much. Usually i'm in the shell when i invoke nnn - i might open a file in vim from nnn though. In vim, i typically lean on fzf.vim more often - usually i know something about the next file i want to open so it just feels more direct.
- RMPR 5y agoI very much like nnn because it's lightweight, but does it have autojump integration[0]? It's the only single reason I am still using ranger. Edit: That and the speed. And since I am more proficient with Python, hacking on Ranger is easier. 0: https://github.com/fdw/ranger-autojump https://github.com/fdw/ranger-autojump
- CraigJPerry 5y agoYeah it comes in the base distribution https://github.com/jarun/nnn/blob/master/plugins/autojump https://github.com/jarun/nnn/blob/master/plugins/autojump But - if you're happy with ranger, i'm not sure it's worth the switch - they're very similar. nnn is quite a bit faster than ranger but other than that, i think ranger has more community support.
- agbell 5y agoThanks for reading the article. broot does more than just piping tree to less, it gives you a TUI version of tree that you can navigate along around it. The fuzzy finder in it works like FZF but it keeps everything in a nice compact tree view. It might be overkill but I like it.
- hnlmorg 5y agoThere'll always be multiple ways to skin the proverbial cat. Shameless plug but I'd written my own $SHELL callewd `murex` as I kept running into pain points with Bash as a DevOps engineer. The shell doesn't have `tree` inbuilt but it does have FZF-like navigation built in. https://github.com/lmorg/murex https://github.com/lmorg/murex I've been using it as my primary shell for a few years now and I'm not going to pretend that it isn't BETA it does work. However it's not POSIX and some of the design decisions might rub people the wrong way (given how opinionated peoples work-flows are). But if you're curious then check it out.