0

When I run this command from the command line:

taskopen -A c6cb317e

It opens an interactive menu for choosing a file. After making a selection, it then opens a file in vim for editing, or, if the selection isn't a text fie, it will open it with an appropriate app.

I'd like to be able to run this command from within the vim command line and then be able to interact with it. So something new | 0read ! taskopen -A c6cb317e will not do the job. I'm not sure if this can be done or if I need to launch it in a tmux pane or something.

StevieD
  • 1,492
  • 1
  • 16
  • 24
  • 1
    That sounds similar to this recent question: Can a vim filter be interactive? – B Layer Dec 03 '21 at 12:48
  • 1
    Does :term taskopen -A... work? – Christian Brabandt Dec 03 '21 at 12:52
  • I just tried with: :term /usr/local/bin/taskopen -c ~/.taskopenrc 7f6b76ab. I get a 60+ lines of vim script gibberish errors beginning with E1187: Failed to source defaults.vim – StevieD Dec 03 '21 at 17:10
  • Ok, looks like I had a typo in the id bit. Providing a good id still opens the output in a regular vim file. I see the menu options but I'm in vim. No way to interact with the output. – StevieD Dec 03 '21 at 17:17
  • Ooh, wait. It seems I can actually enter in input. The cursor was not next to the prompt and that confused me. So I input something, then I got a ton of vimscript errors but then it spilled me out into the file so I could edit it. So it's partially working, just very ugly. When I close out the vim file, it also close out the original file, though, too. I'll see if I can iron out these kinks. Thanks! – StevieD Dec 03 '21 at 17:24
  • Hmm, now I'm most getting errors again. Behavior is very flaky. I'm in nvim. – StevieD Dec 03 '21 at 17:37
  • OK, found the issue. The config for the taskopen command was using vim for the editor instead of nvim. Changing it to nvim fixed things up nicely. I'm in business! – StevieD Dec 03 '21 at 17:49

0 Answers0