Git Product home page Git Product logo

twf's People

Contributors

b0o avatar wvanlint avatar wwalker avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

twf's Issues

Panic when previewing nvim

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?

twf does not highlight the file path passed in

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.

twf should error

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.

left and right actions - feature request

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):

  • on a collapsed directory (oj):
    • expand the directory AND
    • move to the first item in the newly expanded directory
  • on a expanded directory (j):
    • move to the first item in the directory
  • on a file in an expanded directory (j):
    • move to the next item in the directory

h LeftArrow (GoLeft):

  • Always go to the parent directory of the current item ('p')
    • This may jump "up" a hundred rows

Unable to bind ctrl-down

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.

Some files and directories missing

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

twf should error on bad argument to -locateDir

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:~ ✓ $ 

Ability to open sub-directory and make it root

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!

feature request

Enable pageUp and pageDown in /internal/terminal/events.go so that these key events can then be defined and used mapped to twf commands.

Panic when previewing .zprofile

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

Support for spaces in file names

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.

Run program on current file/directory?

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.

Twf crashes, if the passed path is not a child of the current working directory.

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.
  • Reproduction steps without vim:
cd /tmp
twf /home
  • Error:
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

Error installing via Brew (on Apple Silicon?)

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

twf starts showing an open directory that is not open

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

feature request: support for mouse click event

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.

Binding shift-down causes hard lock

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!

I'm unclear on what -locateCmd does

-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 .

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.