wvanlint / twf Goto Github PK
View Code? Open in Web Editor NEWStandalone tree view file explorer, inspired by fzf.
Standalone tree view file explorer, inspired by fzf.
Hello,
I ran with NeoVim it raises a panic.
:!twf
panic: device not configured
goroutine 1 [running]:
main.main()
/Users/alesshh/.asdf/installs/golang/1.14.2/packages/pkg/mod/github.com/wvanlint/[email protected]/cmd/twf/main.go:67 +0x935
shell returned 2
This issue didn't occur when I ran the inside vim 8.
Any tips to fix or contribute?
in the twf src dir, running:
$ twf internal/state/state.go
Shows the current directory as open, but not the internal directory.
It Does, however, show the preview of the correct file.
Running:
twf internal/state/does-not-exist
Opens the current directory, but should error because it could not find the path that it was passed.
twf is pretty nice. Thanks for a nice tool !
I think it would improve the user experience if these actions existed.
Of course that is my personal cognitive bias :-)
I think that "GoLeft" is just a keymapping, but, GoRight is more complex
l
RightArrow
(GoRight):
oj
):
j
):
j
):
h
LeftArrow
(GoLeft):
Really cool work! Thanks for sharing!
I seem unable to bind "ctrl-down"
.
❯ twf --bind="ctrl-down::preview:down"
invalid value "ctrl-down::preview:down" for flag -bind: Can't parse event: ctrl-down
Seems "down"
and "ctrl-a"
work, but "ctrl-down"
(and "up"
) don't seem to be parsed.
There are 5 .[A-Z]*
directories, and 7 .a*
directories:
drwxr-xr-x. 4 wwalker wwalker 4096 2016-08-13T14:58:26.000000000 .DataGrip2016.2
drwx------. 2 wwalker wwalker 4096 2017-03-19T19:56:54.000000000 .HipChat
drwx------. 2 wwalker wwalker 4096 2017-03-19T19:56:54.000000000 .QtWebEngineProcess
drwx------. 6 wwalker wwalker 4096 2018-07-31T11:21:23.000000000 .Skype
drwx------. 2 wwalker wwalker 4096 2017-12-03T15:57:11.000000000 .TeamSpeak 3
2020-06-07 21:04:54 - wwalker@plutonium:~ ✓ $ ls -lad .a*
drwx------. 3 wwalker wwalker 4096 2017-01-10T11:36:40.000000000 .adobe
drwx------. 3 wwalker wwalker 4096 2018-07-15T19:27:38.000000000 .ansible
drwxr-xr-x. 2 wwalker wwalker 4096 2019-04-20T15:35:14.634771604 .arduino15
drwxr-xr-x. 3 wwalker wwalker 4096 2018-09-12T11:10:37.000000000 .aspera
drwxr-xr-x. 4 wwalker wwalker 4096 2017-07-18T22:40:49.000000000 .audacity-data
drwxr-xr-x 10 wwalker wwalker 4096 2019-09-15T15:57:03.506460076 .autorandr
drwxr-xr-x. 2 wwalker wwalker 4096 2020-05-31T17:06:37.526831847 .aws
But, twf doesn't show the first 3 directories. There are also 7 directories that start with .a
and only 5 are shown.
▼ wwalker
▶ ....
▶ .....
▶ .Skype
▶ .TeamSpeak 3
▶ .ansible
▶ .arduino15
▶ .aspera
▶ .audacity-data
▶ .aws
▶ .bashrc.d
▶ .bzf
▶ .cache
▶ .ccache
▶ .config
▶ .dbus
▶ .elm
▶ .emacs.d
▶ .fltk
▶ .frozen-bubble
▶ .gem
▶ .gimp-2.8
▶ .gnome
▶ .gnome2
▶ .gnupg
▶ .gphoto
Passing -locateCmd
a command that doesn't exist should fail with an error.
2020-06-07 21:36:00 - wwalker@plutonium:~ ✓ $ twf -locateCmd juhytgtr
2020-06-07 21:37:35 - wwalker@plutonium:~ ✓ $
Hi! First of all, thank you so much for this app. I looked so hard for something like this and I finally found yours. Great work! I do have a few recommendations and/or issues I found, but this is still a great app that I plan to use a lot! :)
Currently, I am able to make a parent directory root by pressing p
. I would appreciate a similar functionality, but instead it opens a highlighted sub-directory and makes it the new root, if it is within scope of this app. Thanks!
I wish I can ignore node_modules when I search, it scan all files in root folder now. Thank for you help.
Enable pageUp
and pageDown
in /internal/terminal/events.go
so that these key events can then be defined and used mapped to twf commands.
Hi!
How would you show/hide hidden file with a keystroke?
add a license text
Hey, wanted to try this out as it looked nice. Ran into an issue looking through my home directory.
Looks like it panicked when I scrolled over my .zprofile
Heres the stacktrace:
panic: Terminal: exit status 1, stacktrace: goroutine 1 [running]:
runtime/debug.Stack(0xc00014f5c0, 0x1332e60, 0xc00000fa00)
/usr/local/Cellar/go/1.14.3/libexec/src/runtime/debug/stack.go:24 +0x9d
github.com/wvanlint/twf/internal/terminal.(*Terminal).StartLoop.func1(0xc00014fcc8)
/Users/kylepollina/go/src/github.com/wvanlint/twf/internal/terminal/terminal.go:187 +0x57
panic(0x1332e60, 0xc00000fa00)
/usr/local/Cellar/go/1.14.3/libexec/src/runtime/panic.go:969 +0x166
github.com/wvanlint/twf/internal/views.(*previewView).Render(0xc000072230, 0x2, 0x34, 0x1b, 0x30, 0xc000358501, 0x51e, 0xa0)
/Users/kylepollina/go/src/github.com/wvanlint/twf/internal/views/preview_view.go:55 +0x43e
github.com/wvanlint/twf/internal/terminal.(*Terminal).render(0xc000122090, 0xc00014fe40, 0x3, 0x3)
/Users/kylepollina/go/src/github.com/wvanlint/twf/internal/terminal/terminal.go:147 +0x267
github.com/wvanlint/twf/internal/terminal.(*Terminal).StartLoop(0xc000122090, 0xc00007ef90, 0xc00014fe40, 0x3, 0x3, 0x0, 0x0)
/Users/kylepollina/go/src/github.com/wvanlint/twf/internal/terminal/terminal.go:239 +0x38b
main.main()
/Users/kylepollina/go/src/github.com/wvanlint/twf/cmd/twf/main.go:69 +0x599
goroutine 1 [running]:
main.main()
/Users/kylepollina/go/src/github.com/wvanlint/twf/cmd/twf/main.go:72 +0x925
Currently files with spaces in them will fail to be previewed.
Some support of escaping spaces when passing file names to other programs should help here.
As the title suggested, it would be nice if we can run commands/ open current file/directory in certain program and keep twf running, similar to fzf.
Hello,
thanks for this nice tool. I'm currently trying to use it to replace NERDtree etc. in vim. Unfortunately, twf
crashes, when the path passed to it is not a child of the current working directory. This also happens with plain twf
without vim:
twf
build from master on Arch Linux.cd /tmp
twf /home
panic: Path not found: /home
goroutine 1 [running]:
main.main()
github.com/wvanlint/twf/cmd/twf/main.go:69 +0x7d0
I find this especially important for the vim use case:
cd /tmp
vim /home/foo
# in vim, trying to navigate the directory of the opened buffer
! twf /tmp
# Results in an error:
panic: Path not found: /home
goroutine 1 [running]:
main.main()
github.com/wvanlint/twf/cmd/twf/main.go:69 +0x7d0
shell returned 2
Press ENTER or type command to continue
Absolutely love the idea here and I'd be grateful for any help debugging this install.
Thanks,
Kastan
==> Pouring go--1.18.1.arm64_monterey.bottle.tar.gz
🍺 /opt/homebrew/Cellar/go/1.18.1: 11,964 files, 595.3MB
==> Installing wvanlint/twf/twf --HEAD
==> go build -o /opt/homebrew/Cellar/twf/HEAD-8eddca9/bin/twf github.com/wvanlint/twf/cmd/twf
Last 15 lines from /Users/kastanday/Library/Logs/Homebrew/twf/01.go:
go: downloading golang.org/x/text v0.3.0
go: downloading go.uber.org/atomic v1.6.0
go: downloading go.uber.org/multierr v1.5.0
# golang.org/x/sys/unix
/Users/kastanday/Library/Caches/Homebrew/go_mod_cache/pkg/mod/golang.org/x/[email protected]/unix/syscall_darwin.1_13.go:25:3: //go:linkname must refer to declared function or variable
/Users/kastanday/Library/Caches/Homebrew/go_mod_cache/pkg/mod/golang.org/x/[email protected]/unix/zsyscall_darwin_arm64.1_13.go:27:3: //go:linkname must refer to declared function or variable
/Users/kastanday/Library/Caches/Homebrew/go_mod_cache/pkg/mod/golang.org/x/[email protected]/unix/zsyscall_darwin_arm64.1_13.go:40:3: //go:linkname must refer to declared function or variable
/Users/kastanday/Library/Caches/Homebrew/go_mod_cache/pkg/mod/golang.org/x/[email protected]/unix/zsyscall_darwin_arm64.go:28:3: //go:linkname must refer to declared function or variable
/Users/kastanday/Library/Caches/Homebrew/go_mod_cache/pkg/mod/golang.org/x/[email protected]/unix/zsyscall_darwin_arm64.go:43:3: //go:linkname must refer to declared function or variable
/Users/kastanday/Library/Caches/Homebrew/go_mod_cache/pkg/mod/golang.org/x/[email protected]/unix/zsyscall_darwin_arm64.go:59:3: //go:linkname must refer to declared function or variable
/Users/kastanday/Library/Caches/Homebrew/go_mod_cache/pkg/mod/golang.org/x/[email protected]/unix/zsyscall_darwin_arm64.go:75:3: //go:linkname must refer to declared function or variable
/Users/kastanday/Library/Caches/Homebrew/go_mod_cache/pkg/mod/golang.org/x/[email protected]/unix/zsyscall_darwin_arm64.go:90:3: //go:linkname must refer to declared function or variable
/Users/kastanday/Library/Caches/Homebrew/go_mod_cache/pkg/mod/golang.org/x/[email protected]/unix/zsyscall_darwin_arm64.go:105:3: //go:linkname must refer to declared function or variable
/Users/kastanday/Library/Caches/Homebrew/go_mod_cache/pkg/mod/golang.org/x/[email protected]/unix/zsyscall_darwin_arm64.go:121:3: //go:linkname must refer to declared function or variable
/Users/kastanday/Library/Caches/Homebrew/go_mod_cache/pkg/mod/golang.org/x/[email protected]/unix/zsyscall_darwin_arm64.go:121:3: too many errors
If reporting this issue please do so at (not Homebrew/brew or Homebrew/core):
https://github.com/wvanlint/homebrew-twf/issues
Please create pull requests instead of asking for help on Homebrew's GitHub,
Twitter or any other official channels.
❯ twf
zsh: command not found: twf
wvanlint , again, thanks for a very cool ap !
Running
twf
shows only one line:
▼ wwalker
The arrow indicates the directory is "open"; but, it isn't "open" nothing is below.
Hitting o
twice works
or
Hitting j
works too.
Also, it works right when I start twf with an unused argument comes up correctly:
twf asdfzxcv
shows correctly:
▼ wwalker
▶ ....
▶ .....
▶ .Skype
▶ .TeamSpeak 3
▶ .ansible
▶ .arduino15
▶ .aspera
▶ .audacity-data
▶ .aws
▶ .bashrc.d
Hello,
Let's be honest, the mouse it useful sometime ;)
It would be awesome to have mouse even support when clicking on directories and files.
Even more awesome if right click, left click can be configured as normal keybinding.
This allow true IDE experience.
Running
❯ twf --bind="shift-down::preview:down"
will work and launch the UI, but if you try to invoke the assigned binding ("shift-down"
), the terminal will lock up and no longer respond to commands.
Again, great work!
-locateCmd <str>: The command whose output will be interpreted as a path to locate in the file tree.
An example would be helpful.
I created a script aaa
ran:
twf -locateCmd aaa
3 times. once each outputting:
/home/wwalker/bin/aaa
/bin/aaa
bin/aaa
in no case did it show the file in the tree.
However, this may be a side effect of #9 .
When I use fzf (/) to select a file, the preview window is properly populated, but the tree view doesn't move such that where I am in the tree is visible.
It does jump to that area when I hit j or k.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.