Jump to content

Alfred Editor Workflow


Recommended Posts

Alfred Editor

This is a simple editor that makes use of NW.js Toolbox to run. Therefore, you need to install that workflow first. It can be found on my GitHub account below since it is too large for Packal. After installing this workflow, you need to execute ae:install to install the data files and the help files into their proper location. You will have a command line program called ae you can use to open files from the command line.

The following commands are then useable:

ae:openeditor
This simply opens Alfred Editor without a file.

ae:edit
The currently selected file in Path Finder or Finder is opened in Alfred Editor. You also have an Alfred Browser command for opening files as well. An external command for opening files is available as well.

ae:open
This script filter gives several important directory locations that can be opened in the Alfred browser or Finder.

ae:theme
This script filter lists all the available themes. If you select one, that will be the new theme for windows opened in Alfred Editor. If you hold the **command key** while selecting, that theme will be opened in Alfred Editor to edit.

ae:createtheme
This allows you to create a new theme to use in Alfred Editor. It will request a new name, create the new theme from lesser-dark them, and open in Alfred Editor to edit. You will still have to select the theme for it to be used.

ae:windowlist
This will list each available Alfred Editor window name. The one selected will be brought to the front using the Hammerspoon Workflow. The Hammerspoon workflow has to be installed for this command to work.

ae:keyboard
This command allows you to choose either the Sublime keyboard layout or the Vim keyboard layout to use in Alfred Editor. If the Sublime layout is chosen, then the status line will always show it to be in insert mode.

This workflow is a work in progress. I am using it to teach myself how to use the Node Webkit program for developing desktop applications using web technologies. I am currently working on a command prompt similar to Sublime with expandability using plugins. I also currently have only three themes. If you want to help me create themes, just send me the json file for your theme and I will include it.

 

License:   MIT

 

Version:   1.2

 

Packal:  http://www.packal.org/workflow/alfred-editor

GitHub: https://github.com/raguay/MyAlfred

Custom Computer Tools:  http://customct.com/alfred-2-workflows

Edited by raguay.customct
Link to comment

Editor Features:

- syntac highlighting for:

HTML
CSS
Markdown
FoldingText
Markdown
PHP
go
FoldingText
SASS
SCSS
Scheme
Python
C, C++
PList
XML
Shell
Lua
SQL
Haml
Jade
CoffeeScript
Lisp
Ruby
Erlang
Scala
 

- Full Vim and Sublime keyboard support

- Regular expression search/replace

- Multiple cursors

- code folding

- Emmet expansions!!!!

- Themes (currently just three - help me make more!)

- more coming (ex: plugins, commands, external control, etc).

 

There are still several bugs I am working on. But, I was wanting some user feedback and help making themes.

Link to comment
  • 2 weeks later...
  • 4 months later...

Thanks for this workflow! I have used it now and then and find it quite handy for quick edits etc. However, recently it stopped working, the editor window is not shown anymore even though the posted notifications tells me that the selected file is opened. Any ideas (Alfred 2.7.1, OS X 10.10.3)?

Link to comment

Thanks for this workflow! I have used it now and then and find it quite handy for quick edits etc. However, recently it stopped working, the editor window is not shown anymore even though the posted notifications tells me that the selected file is opened. Any ideas (Alfred 2.7.1, OS X 10.10.3)?

 

If the following file has text in it, it is assuming that the editor is already open:

 

~/Library/Application Support/Alfred 2/Workflow Data/com.customct.AlfredEditor/windows.txt

 

where '~' is your home directory. Delete that file and the editor should open again. I have a bug in the logic for determining if an editor is open. The problem being, NW.js doesn't allow more than one instance open at a time. Therefore, I am trying to use a secondary loader to spawn a new window instead of a new instance. But, it keeps getting off here and there.

 

I am currently migrating to the Ace editor instead of CodeMirror editor. More robust in functionality. Keep watching for updates.

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...