Skip to content

Conversation

@benneti
Copy link

@benneti benneti commented Jun 6, 2020

Removing phi and pi as it can cause conflicts and problems in julia and latex modes (also in org-mode) and other programming modes, see #39.
Also add snippets for julia-mode, some snippets where taken from https://github.com/AndreaCrotti/yasnippet-snippets, I left the contributors name in these snippet files.

@hlissner hlissner added mode:julia is:snippet Requests that a snippet be added or removed labels Jun 6, 2020
@benneti
Copy link
Author

benneti commented Jun 7, 2020

implemented the requested changes. Before you merge could you tell me what this implicit selection does? I did not find it https://joaotavora.github.io/yasnippet/snippet-development.html nor by a quick search in doom emacs.
Also I am not completely sure how YASnippet works so would it be better to insert blocks such that $0 is after the block or like how I did it right now?

@benneti benneti requested a review from hlissner June 7, 2020 16:39
@hlissner
Copy link
Member

Quoting the relevant section of yasnippet's docs

From version 0.6, snippets expansions are run with some special Emacs-lisp variables bound. One of this is yas-selected-text. You can therefore define a snippet like:

for ($1;$2;$3) {
yas-selected-text$0
}

to "wrap" the selected region inside your recently inserted snippet. Alternatively, you can also customize the variable yas-wrap-around-region to t which will do this automatically.

This snippets library aliases yas-selected-text to % here for convenience.

Hope that helps!

@hlissner
Copy link
Member

Also: there are two unresolved comments in the last review. See above.

@benneti
Copy link
Author

benneti commented Jun 12, 2020

Ups, forgot to push this change and thanks for the reference.

@hlissner hlissner merged commit 21b7c8d into doomemacs:master Jun 12, 2020
@hlissner
Copy link
Member

No problem! Thanks for the help!

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 7, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

is:snippet Requests that a snippet be added or removed mode:julia

2 participants