https://github.com/mikogs/ntree
Tiny program that displays directories and files of a given path and expands the subdirectories that are your current working directory
https://github.com/mikogs/ntree
Last synced: about 1 year ago
JSON representation
Tiny program that displays directories and files of a given path and expands the subdirectories that are your current working directory
- Host: GitHub
- URL: https://github.com/mikogs/ntree
- Owner: mikogs
- License: bsd-2-clause
- Archived: true
- Created: 2022-08-02T19:28:54.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2023-06-12T19:45:33.000Z (almost 3 years ago)
- Last Synced: 2025-02-05T10:50:07.869Z (over 1 year ago)
- Language: Go
- Size: 11.7 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ntree
ntree is a tiny program that displays directories and files of a given path and
expands the subdirectories that are your current working directory.
**This project is no longer maintained**
Check the screenshot for the following command:
```
ntree start -r /Users/miko -w /Users/miko/Repos/MikolajGasior/ntree
```

It was initially created for fun as I was playing with Go. It's meant to be
used with tmux (or similar). You run ntree in a separate pane and it gets
refreshed while you work on the terminal in other panes.
For example, you can alias `cd` command in bash profile to automatically update
ntree with the following code:
```
cd() {
ddd="$(pwd)/$1"
if [ -d "$ddd" ]; then
ntree send WORKDIR "$ddd" > /dev/null 2>&1;
fi
builtin cd $1;
}
```
So, as you can see, working directory can be changed while the program is
running. This is done with `ntree send`, eg.
`ntree send WORKDIR /Users/miko/Repos/MikolajGasior/`.
On the screenshot next to filenames, you can spot numbers. Number on the left,
like `(3)...`, indicates that there are 3 items before which are not shown,
and number on the right like `...(5)` tells us that there are 5 items after
which are not shown. Items can be hidden because they do not fit on the
terminal. Also, the priority is to show contents of working directory. So if
necessary, any directories along the path are partly hidden.
## Configuration
Before you start ntree, copy `sampleconfig.json` to your home directory as
`.ntree.json`. You can change Unix socket path or refresh time (called
`loop_sleep`) in the file.
## Commands
In the above example, we mentioned that with `ntree send` you order the program
to change what's visible.
The available commands are:
* `ROOTDIR ` - change root directory;
* `WORKDIR ` - change working directory (the one that is expanded);
* `DIRS` - toggle directories visibility (you can hide directories and just show the files);
* `FILES` - toggle files visibility;
* `HIDDEN` - toggle hidden files visibility (by default they are hidden);
* `FILTER ` - only show files and directories that contain ``;
* `HIGHLIGHT ` - highlight (in a colour) `` in file names;
* `RESET-FILTER` - reset the filter;
* `RESET-HIGHLIGHT` - reset the highlight;
* `FREEZE` - toggle freeze (tree can be frozen so it doesn't change).