How to automatically enter brackets on autocomplete?

后端 未结 1 1081
被撕碎了的回忆
被撕碎了的回忆 2021-01-26 07:35

Whenever I use the autocomplete for atom it doesn\'t include the brackets. For example if i start typing \"print\" I hit enter and it enters print but doesn\'t include the brack

相关标签:
1条回答
  • 2021-01-26 08:08

    The default Python snippets only supports the print keyword, not the print() function. Since I haven't found another package that does, you're problably best off adding a snippet (Atom > Open Your Snippets) such as:

    '.source.python':
      'print()':
        'prefix': 'print-function'
        'body': 'print($1)'
    

    The prefix will trigger the snippet defined in the body, in case prefer to call it differently.

    0 讨论(0)
提交回复
热议问题