twf icon indicating copy to clipboard operation
twf copied to clipboard

Run program on current file/directory?

Open snippins opened this issue 5 years ago • 5 comments

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.

snippins avatar Jun 05 '20 16:06 snippins

@snippins just clarifying. You mean to

  • Run twf, and then
  • when the right file (or directory) is selected, hit some key (like : or ! to be vimish)
  • and twf would give you a prompt with the selected filepath populated
  • then you type a command around the selected filepath
  • then when that command completes, you are back in twf?

wwalker avatar Jun 15 '20 02:06 wwalker

@wwalker

That's great, though I would prefer the fzf approach, where you can bind a shortcut to run a command/program, for example: "find . | fzf --bind "ctrl-f:execute:some_command {}"

snippins avatar Jun 17 '20 11:06 snippins

Thanks! I just started using fzf a couple of weeks ago,hadn't thought of doing it that way yet, but that's slick.

wwalker avatar Jun 18 '20 22:06 wwalker

Are you able to run a command on a file in general with twf (even without keeping twf running)?

nezartarbin avatar Jul 15 '21 17:07 nezartarbin

@nezartarbin twf is meant to be composable following the Unix philosophy, you can always run a command on the selected file like this for example: git add $(twf). This ticket is mainly to run commands with twf open.

wvanlint avatar Jul 17 '21 18:07 wvanlint