Tip of the day - typing less stupid code

Tip of the day - typing less stupid code
http://delphisorcery.blogspot.com/2015/02/type-less-how-to-use-gexperts-macro.html

Comments

  1. Thanks for the post. I have not personally setup any new templates myself, but used an existing one by accident the other day and saw how useful it could be. Now I know how to actually set one up.

    ReplyDelete
  2. "I tried using live templates also but man that sucked and invoking the macro always killed the selection in the code editor."

    Did you try surrounding the selected code by the template?

    ReplyDelete
  3. Miroslav Ondříšek Yes, as you see in the article

    ReplyDelete
  4. Stefan Glienke I see only mention about invoking the template, nothing about surrounding (by the template) in the article. That's why I am asking if you tried surrounding instead of invoking the template. Because I am using surrounding against selected code and everything works correctly.

    ReplyDelete
  5. Miroslav Ondříšek D'oh. I was using Ctrl+J and then the selection disappears. But there is a surround entry in the context menu -.- Is there a shortcut for that one?
    Just tried with the built-in templates but they result in some wrong formatting or indenting.
    Also writing a live template is a pita compared to the GExpert ones.

    Anyway invoking should not be different from surround. The editor should be smart enough to figure that out.

    ReplyDelete
  6. Stefan Glienke I did not find shortcut for surrounding :( Context menu is a king :)
    Writing live template is not easy, you're right. Some kind of wizard would be helpful...

    ReplyDelete
  7. is there anyway to share the template more easier ?

    ReplyDelete

Post a Comment