[关闭]
@SiberiaBear 2016-03-29T11:06:57.000000Z 字数 1308 阅读 2725

atom snippets.cson

软件配置


关于ATOM编辑器中插件:snippets的配置文档。snippets是一个自动补全插件,在ATOM中默认是不安装的,需要安装该插件,并找到snippets.cson这个文件来配置如下。

固定连接:https://www.zybuluo.com/SiberiaBear/note/328978

  1. # Your snippets
  2. #
  3. # Atom snippets allow you to enter a simple prefix in the editor and hit tab to
  4. # expand the prefix into a larger code block with templated values.
  5. #
  6. # You can create a new snippet in this file by typing "snip" and then hitting
  7. # tab.
  8. #
  9. # An example CoffeeScript snippet to expand log to console.log:
  10. #
  11. # '.source.coffee':
  12. # 'Console log':
  13. # 'prefix': 'log'
  14. # 'body': 'console.log $1'
  15. #
  16. # Each scope (e.g. '.source.coffee' above) can only be declared once.
  17. #
  18. # This file uses CoffeeScript Object Notation (CSON).
  19. # If you are unfamiliar with CSON, you can read more about it in the
  20. # Atom Flight Manual:
  21. # https://atom.io/docs/latest/using-atom-basic-customization#cson
  22. '.source.c':
  23. 'Console if':
  24. 'prefix': 'if'
  25. 'body': """
  26. if ( ${1:<condition>} ) {
  27. ${2:<body>}
  28. }
  29. """
  30. 'Console while':
  31. 'prefix': 'while'
  32. 'body': """
  33. while ( ${1:<condition>} ) {
  34. ${2:<body>}
  35. }
  36. """
  37. 'Console for':
  38. 'prefix': 'for'
  39. 'body': """
  40. for ( ${1:<condition1>}; ${2:<condition2>}; ${3:<condition3>}) {
  41. ${4:<body>}
  42. }
  43. """
  44. 'Console switch':
  45. 'prefix': 'switch'
  46. 'body': """
  47. switch ( ${1:<condition>} ) {
  48. case ${2:<case1>} : ${3:<body1>}
  49. break;
  50. case ${4:<case2>} : ${5:<body2>}
  51. break;
  52. default : ${6:<body3>}
  53. break;
  54. }
  55. """
  56. 'Console include':
  57. 'prefix': '#include'
  58. 'body': '#include ${1:<include>}'
  59. 'Console define':
  60. 'prefix': '#define'
  61. 'body': '#define ${1:<define>}'
添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注