Code snippets (Live templates) usage not user friendly?
I've just started using Pycharm after spending several months on VSCode and I'm still learning Pycharm and its shortcuts.
I'm suprised by the different approaches these tools have for code snippets:
- In VSCode, a code snippet can be accessed through IntelliSense (CTRL + SPACE). This means you don't have know precisely what you're looking for and can search in IntelliSense.
VSCode has 30 default code snippets, including basic but quite frequent stuff like Class definition, if/then/else and try/catch/else statements
- In Pycharm, code snippets are basically just abreviations that you need to know by heart, Pycharm then replaces these when you press TAB.
Pycharm only has 15 code snippets and seem to focus more on less frequent snippets (granted, it has iterations)
Of course, it's not a matter of which has more, the number just support the fact that VSCode also has pretty basic daily snippets when Pycharm doesn't.
To me, this Pycharm behavior feels pretty old-school and not user friendly when VSCode is quite the opposite.
Note that I am biased since I have way more experience with VSCode than Pycharm and I have not yet digged in everything Pycharm has to offer.
Did I misunderstand this functionnality of Pycharm? I'd love to be able to use it the right way.
Thanks!
请先登录再写评论。
Hey Guillaume
You can use the keyboard shortcut CTLR+J to open the 'insert live template' popup.
Kind regards,
Michael
Hello Guillaume,
I would add to the Michael Anckaert comment, that you always have a "Find action.." option, where you can type and find any desired action. Please see https://www.jetbrains.com/help/pycharm/working-with-source-code.html#97d0ee52
So if you type there "template" you will get a list of related actions and can choose a required one.