How to automatically enter brackets on autocomplet

2020-05-04 22:52发布

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 brackets.

标签: atom-editor
1条回答
爷的心禁止访问
2楼-- · 2020-05-04 23:23

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.

查看更多
登录 后发表回答