ex-mode
ex-mode copied to clipboard
Recipes
I made a custom command :sort
and when I got it working I thought two thing:
- I wonder what other
ex-mode
users have defined as custom commands - I want to share my custom command
So, my question is: is it a good idea to create an entry in the README.md to gists of user defined custom commands? Or maybe a /recipes dir or a RECIPES.md file?
This could have the added benefit for the maintainers to see popular custom commands which could find it's way into the main package.
PS. My custom sort command (I use this all the time!):
atom.packages.onDidActivatePackage (pack) ->
if pack.name == 'ex-mode'
Ex = pack.mainModule.provideEx()
Ex.registerCommand 'sort', ->
textEditor = atom.views.getView(atom.workspace.getActiveTextEditor())
atom.commands.dispatch(textEditor, 'sort-lines:sort')
I do like this idea. Let's work it out to see if we can make the "recipes" more useful.
I wonder.... what if we added a custom :recipes
or :dispatch
command, which could auto-complete available commands? that are available from a /recipes
folder in the plugin?
Or perhaps... this should be another plugin entirely, that relies on ex-mode
? this is a great idea, but might be out of scope of ex-mode
, where the idea is to implement vim-mode
functionality via commands, to reproduce the native command features used in vim.
I'm open to the idea of having user contributed scripts/commands directly in the repo. As with git and other linux applications, they use a folder named "contrib", and I'm also liking that name for such a folder.
@Gijsjan You are welcome to open a MR for this, and I'll add it to the repo.