Skip to content

Commit

Permalink
motivation
Browse files Browse the repository at this point in the history
  • Loading branch information
LeperGnome committed Sep 1, 2024
1 parent 2b49548 commit 0533440
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 5 deletions.
26 changes: 22 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@ mv ./bt ~/.local/bin/bt
## Usage

```bash
> bt -h
Usage of bt:
bt [flags] [directory]

Flags:
-i In-place render (without alternate screen)
-pad uint
Edge padding for top and bottom (default 5)
Expand All @@ -43,6 +44,18 @@ Key bindings:
| if / id | Create file (if) / directory (id) in current directory |
| r | Rename selected child |


## Motivation

I find myself disliking a majority of column-based terminal file managers.
The reason for that is - when I need to copy/move some files across nested subdirecotries,
I constantly loose context of where I am currently, because columns always go left and right.
Even tough those file managers are really mature loaded with features (e.g. [ranger](https://github.com/ranger/ranger), [lf](https://github.com/gokcehan/lf), [xplr](https://github.com/sayanarijit/xplr), [nnn](https://github.com/jarun/nnn)), it's uneasy for me to perform simple tasks.

I like how [broot](https://github.com/Canop/broot) renders the ui, but I guess that it's mainly usable for exploring a file tree, but not manipulating it (at least I found it this way, when I had to type target directory for `move`).

That's why I'm writing my own simple tool for simple use cases. It's currently lacking a bunch of features (see todo list below), but fundamentals are here.

---

```
Expand All @@ -66,9 +79,14 @@ todo:
- [ ] Unsubscribe from directories when leaving
- [ ] Subscribe on 'enter'
- [x] Don't manually update children
- [ ] Error handling
- [ ] Better style
- [ ] Error handling (permissions denied, etc)
- [ ] Edit selected file in editor of choice
- [ ] Jump to current directory
- [ ] Selecting multiple files
- [ ] Go higher then local root
- [ ] Make current directory a local root
- [ ] Search
- [ ] Better style
- [ ] Sorting function as a flag?
- [ ] Inline file permissions and size?
Expand Down
1 change: 0 additions & 1 deletion internal/ui/render.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,6 @@ func (r *Renderer) renderTree(tree *t.Tree, widthLim int) ([]string, int) {
indent := strings.Repeat(" ", depth)
indentRuneCount := utf8.RuneCountInString(indent)

// TODO: probably bug here
if nameRuneCountNoStyle+indentRuneCount > widthLim-6 { // 6 = len([]rune{"... <-"})
name = string([]rune(name)[:max(0, widthLim-indentRuneCount-6)]) + "..."
}
Expand Down

0 comments on commit 0533440

Please sign in to comment.