Open dzklaim opened 5 years ago
Currently code blocks are specified by the mode. E.g. see https://github.com/howl-editor/howl/blob/master/bundles/lua/lua_mode.moon#L42
It's not very advanced at the moment, e.g. there are no placeholders. This would be nice to have though. What features specifically are you looking for?
I have been writing latex lately. I would like to write something like "bgit" and the editor would expand it to
\begin{itemize}
\item [cursor]
\end{itemize}
and other simpler stuff like entering "hw" and howl should expand it to "Hello World!"
As @shalabhc said the code blocks are rather simple and tied to modes. I'd like to see snippets functionality as well, but I think that needs to be something new, more advanced. For instance, things such as the [cursor]
macro you give as an example should work (and other placeholders as well). I've been thinking that expansion could both be available as a specific command, but also tied into completions. For instance with autocompletion enabled for the example above you'd get something like bgit [macro]
as a completion option and pressing enter then would expand it.
sounds great, thanks :)
expansion could both be available as a specific command, but also tied into completions.
Worth noting that GNOME Builder does this. Snippets appear in the autocomplete drop-down, and when you select it, it inserts the text with the cursor automatically jumping to the first placeholder within, then to the next when you Tab and so forth until all are filled.
According to the documentation: "Code blocks are code snippets that are automatically inserted as you type."
It seems that we should be able to use this feature to create abbreviations/snippets like in emacs/vim. How to do that?
Thank you for all in the work in Howl :)