![]()
Dedicated to @Daisy for our friendship and her kindly support.
An Alfred Workflow to open file/folder in editor with one hotkey.
Defaults comes with VSCode, IDEA, Vim(in Terminal), Emacs, you can change it easily.
- Download Open in Editor.alfredworkflow.
- Double click
Open in Editor.alfredworkflowto install. - Click
ImportButton. - Double click
Hotkeyand set your shortcut.(I'm using fn + e for Emacs)
how to use fn + e as hotkey trigger.
- Open Alfred Preferences -> Workflows -> Open in Editor.
- Double click
Run Script, replaceVisual Studio CodewithYOUR APPLICATION NAME. - Make sure the app name surrounds with double quote
"".
alt + c, default with Visual Studio Code.
- Launch Editor if Editor isn't active.
- Bring Editor to the front window if Editor is active.
- Open 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 -> Historyand browse file with it, you should use tab or ← or → to avoid Alfred's default selection. - Press fn + c or your own shortcut.
- Enable Quick Search Mode in
fn + i, default with IntelliJ IDEA
- If there is
*.xcodeprojin the folder(first level), it opens the folder with Xcode. - Other features work same as General Text Editor.
alfred-open-in-idea.mp4
alfred-open-in-emacs.mp4
- Add the code below to your
init.elor.emacs
;; Enable server for opening file/folder from emacsclient
(server-start)- Set the shortcut to launch Emacs.
- Try it!
alfred-open-in-vim.mp4
- It default with
vim, if you're usingnvim, open theRun Scriptand changevimtonvim. - It default with
Terminal, if you're usingiTerm2or something else, open theRun Scriptand changeTerminaltoYOUR APPLICATION NAME. - Set the shortcut to launch vim.
- Try it!
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/freepik
