vicoapp / vico

Mac Programmers Text Editor
http://www.vicoapp.com/
658 stars 89 forks source link

Ex bang commands? #30

Closed joefiorini closed 11 years ago

joefiorini commented 12 years ago

I'm trying to use :! to execute a shell command but I'm getting a message:

Non-filtering version of ! not implemented

Looking into it it looks like there is no shell mapping defined in [ExMap defaultMap]. How can I set that up so I can run shell commands?

Thanks!

Shadowfiend commented 12 years ago

Since it looks like you're diving into nu, at the moment the most expedient way to make that work would probably be to map a command to execute its parameters using an NSTask or somesuch. If I get a chance sometime soon I may look into trying to get :! working.

The trouble is at the moment there isn't really a way to display output from such a command run. I've written pointy-haired-boss, a Nu library for executing a task and piping its output to a Vico buffer, but that's still a tad hackish, particularly for something that you want to glance at to make sure the output looks reasonable and then trash.

That said, you can always try :.!<command> on a blank line. But note that the current line will be sent to the command's stdin.

joefiorini commented 12 years ago

Is it possible to show the output in a window similar to what the Nu console & ack output loads in?

Shadowfiend commented 12 years ago

Possible, yes. But you'd have to write a plugin that actually does it :) The ack code is available at https://github.com/vicoapp/ack.vico-bundle if you're curious to try it out.

Shadowfiend commented 11 years ago

Going to close this issue and its PR, will comment on the PR on why.