Closed dundalek closed 6 years ago
Will it work like init.el in Emacs?
@4mitch Currently we load ~/.closhrc
on startup so users will be able to put these kinds of definitions there. So you could say it is similar to Emacs init (from my limited understanding of Emacs).
@dundalek Have you started on this yet? If not, I can tackle it
I do work on it, I have an work in progress branch here: https://github.com/dundalek/closh/tree/feature/custom-commands-aliases
This is now ready in master branch.
For user defined helpers I am thinking of supporting following:
Aliases
Aliases for defining / overriding functionality. When alias is used it does not get expanded and is saved into history as is.
Example:
Abbreviations
Abbreviations are similar to aliases but expand to underlying definition. Therefore autocomplete can work seamlessly and also full command is saved to history. Inspired by abbr in fish. See also discussion.
Functions
Classic Clojure functions, already works.
Run in command line like:
(hello "World")
.Commands
Similar to functions, but can be executed like commands without parens. Related to builtin commands. Defining similar to defn:
Run in command line like:
hello World
. There should probably also be a way to promote existing function to a command.