Dedicated to my girlfriend 😘 @YangYang
An Alfred Workflow to execute selected file, cd to selected folder, and run selected text in Terminal with one hotkey.
- Download Run in Termianl.alfredworkflow.
- Double click
Run in Terminal.alfredworkflow
to install. - Click
Import
Button. - Double click
Hotkey
and set your shortcut.(I'm using alt + t).
- Launch Terminal if Terminal isn't active.
- Bring Terminal to the front window if Terminal is active.
- Run selected text in Terminal, it avoids
$
in the beginning of the first line.$ echo select me and press hotkey! $ echo Hello $(whoami) $ echo Alfred Loves You!
cd
selected file/folder from Finder or Alfred File Browser.- Enable Quick Search Mode in
Features -> File Action
. - Launch Alfred and press spacebar or input a single quote.
- Move the highlight block to the destination folder.
- Notice: if you enabled
Advanced -> History
and browse file with it, you should use tab or ← or → to avoid Alfred's default selection. - Press alt + t or your own shortcut.
- Enable Quick Search Mode in
- Open Alfred Preferences -> Workflows -> Open in Terminal.
- Double click
Run Script
, replaceTerminal
withYOUR TERMINAL APP
. - Make sure the app name surrounds with double quote
""
.
- Open Alfred Preferences -> Workflows -> Open in Terminal.
- Right click
Run in Terminal
workflow -> Open in Finder - Open
script.rb
, press Command + F to findruntimes
.runtimes = { rb: 'ruby', sh: 'sh', py: 'python', go: 'go', php: 'php', js: 'node', ts: 'deno', rs: 'rust' }
- Add new
FILETYPE: RUNTIME
, you can also set other command for specific file type.
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Icon made by https://www.flaticon.com/authors/kirill-kazachek
It was built with 💖 in NeoVim & RubyMine.