Jump to content

Send Snippet Directly to Terminal


Recommended Posts

Hi,

 

The new Alfred 3 Snippets are great - they replaced a lot of other text managers on my Mac.

 

One question: is it possible to create Snippets so that they will run directly as terminal commands (rather than having to create a Workflow element for each Terminal command I want to run).

 

Example:

 

"> killall PrinterProcessor"

 

If I create this as a Snippet, I can't find a way to get it into the Alfred window without copy n paste.

 

What I'd like to be able to do is invoke my snippet list, type (for example) 'killall', choose the snippet "> killall PrinterProcessor" and hit return to send it like any other Alfred command prefixed with > to the Terminal.

 

I there a simple way to do this?

 

Thanks,

Pat

 

 

Link to comment

I was using Dash mainly - it has a snippet function that allows cursor placement (multiple with tab) - but I can live with Alfred way of doing things. Most of the complex cursor placementstuff I only need when I'm in my text editor (Atom) and it handles that well.

Link to comment
Yeah, I use UltiSnips (vim) for hardcore snippeting. Waaaay more powerful than any non-integrated snippet engine can be.
 
Couldn't live without cursor placement, though.
 

 

Have you tried Visual Studio Code? It's very much like Atom but massively less bloated and slow.
Link to comment

As per my response in your other thread:

 

If all you're looking to do is expand your snippets in Alfred, go to the Snippets preferences, click the cog and remove Alfred from the default ignore list. :)

 
Keep in mind that this could have adverse effects, e.g. expanding when you're searching in the Snippets Viewer using the snippet's keyword.
 
Cheers,
Vero
Link to comment

Thanks Vero.

 

The solution you suggest isn't too bad at all, but it requires more human memory I am capable of! It requires me remembering the expansion shortcuts for each of my commands.

 

What would be ideal:

 

- Invoke Snippets
- Filter and select Snippet
- Shift (or other modifier key) + Return to move this Snippet to the main Alfred execute window instead of pasting it.

 

Possible?

 

Thanks,

 

Pat

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...