Advertisement
Guest User

Untitled

a guest
Aug 24th, 2016
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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.cpp':
  23.   'max_element':
  24.     'prefix': 'maxe'
  25.     'body': '*std::max_element(${1:vec}.begin(), ${1:vec}.end());\n'# ${2:/* code */}'
  26.  
  27.   'min_element':
  28.     'prefix': 'mine'
  29.     'body': '*std::min_element(${1:vec}.begin(), ${1:vec}.end());\n'# ${2:/* code */}'
  30.  
  31.   'sort':
  32.     'prefix': 'sort'
  33.     'body': 'std::sort(${1:vec}.begin(), ${1:vec}.end());\n'# ${2:/* code */}'
  34.  
  35.   'rand':
  36.     'prefix': 'rand'
  37.     'body': 'static std::mt19937 generator;\nstd::uniform_int_distribution<> uid(${1:0}, ${2:n});\n'# ${3:/* code */}'
  38.  
  39.   'std::uniform_int_distribution<>':
  40.     'prefix': 'uid'
  41.     'body': 'std::uniform_int_distribution<> uid(${1:0}, ${2:n});\n'# ${3:/* code */}'
  42.  
  43.   'template <typename>':
  44.     'prefix': 'tp'
  45.     'body': 'template <typename ${1:_InputIter}>\n'# ${2:/* code */}'
  46.  
  47.   'vector':
  48.     'prefix': 'vec'
  49.     'body': 'std::vector<${1:int}> vec$2;'# ${3:/* code */}'
  50.  
  51.   'map':
  52.     'prefix': 'map'
  53.     'body': 'std::map<${1:string}, ${2:int}> m$3;'# ${4:/* code */}'
  54.  
  55.   'unordered_map':
  56.     'prefix': 'umap'
  57.     'body': 'std::unordered_map<${1:string}, ${2:int}> um$3;'# ${4:/* code */}'
  58.  
  59.   'set':
  60.     'prefix': 'set'
  61.     'body': 'std::set<${1:int}> s$2;'# ${3:/* code */}'
  62.  
  63.   'unordered_set':
  64.     'prefix': 'uset'
  65.     'body': 'std::unordered_set<${1:int}> us$2;'# ${3:/* code */}'
  66.  
  67.   'return':
  68.     'prefix': 'ret'
  69.     'body': 'return $1;'
  70.  
  71.   'cin':
  72.     'prefix': 'cin'
  73.     'body': 'std::cin >> ${1:/* variable */};'# ${2:/* code */}'
  74.  
  75.   'cout':
  76.     'prefix': 'cout'
  77.     'body': 'std::cout << ${1:} << "${2:\\\\n}";'# ${3:/* code */}'
  78.  
  79.   'for':
  80.     'prefix': 'for'
  81.     'body': 'for (size_t ${1:i} = 0; ${1:i} < ${2:n}; ${3:++}${1:i}) {\n\t${4:/* code */}\n}'
  82.  
  83.   'range-based for':
  84.     'prefix': 'forr'
  85.     'body': 'for (const auto& ${1:element}: ${2:vec}) {\n\t${4:/* code */}\n}'
  86.  
  87.   'func':
  88.     'prefix': 'func'
  89.     'body': '${1:int} ${2:name}(${3:/* arguments */}) {\n\t${4:/* code */}\n\treturn ${5:0};\n}'
  90.  
  91.   '#include<>':
  92.     'prefix': 'inc'
  93.     'body': '#include <${1:}>\n${2:/* code */}'
  94.  
  95.   '#include<>':
  96.     'prefix': '#inc'
  97.     'body': '#include <${1:}>\n${2:/* code */}'
  98.  
  99.   'str':
  100.     'prefix': 'str'
  101.     'body': 'std::string ${1:text};'# ${2:/* code */}'
  102.  
  103.   'printf':
  104.     'prefix': 'printf'
  105.     'body': 'printf("${1:%d}\\\\n", $2);'# ${3:/* code */}'
  106.  
  107.   'scanf':
  108.     'prefix': 'scanf'
  109.     'body': 'scanf("${1:%d}", &$2);'# ${3:/* code */}'
  110.  
  111.   'Typedef':
  112.     'prefix': 'td'
  113.     'body': 'using ${1:MyCustomType} = ${2:int};\n'# ${3:/* code */}'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement