Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Your snippets
- #
- # Atom snippets allow you to enter a simple prefix in the editor and hit tab to
- # expand the prefix into a larger code block with templated values.
- #
- # You can create a new snippet in this file by typing "snip" and then hitting
- # tab.
- #
- # An example CoffeeScript snippet to expand log to console.log:
- #
- # '.source.coffee':
- # 'Console log':
- # 'prefix': 'log'
- # 'body': 'console.log $1'
- #
- # Each scope (e.g. '.source.coffee' above) can only be declared once.
- #
- # This file uses CoffeeScript Object Notation (CSON).
- # If you are unfamiliar with CSON, you can read more about it in the
- # Atom Flight Manual:
- # https://atom.io/docs/latest/using-atom-basic-customization#cson
- '.source.cpp':
- 'max_element':
- 'prefix': 'maxe'
- 'body': '*std::max_element(${1:vec}.begin(), ${1:vec}.end());\n'# ${2:/* code */}'
- 'min_element':
- 'prefix': 'mine'
- 'body': '*std::min_element(${1:vec}.begin(), ${1:vec}.end());\n'# ${2:/* code */}'
- 'sort':
- 'prefix': 'sort'
- 'body': 'std::sort(${1:vec}.begin(), ${1:vec}.end());\n'# ${2:/* code */}'
- 'rand':
- 'prefix': 'rand'
- 'body': 'static std::mt19937 generator;\nstd::uniform_int_distribution<> uid(${1:0}, ${2:n});\n'# ${3:/* code */}'
- 'std::uniform_int_distribution<>':
- 'prefix': 'uid'
- 'body': 'std::uniform_int_distribution<> uid(${1:0}, ${2:n});\n'# ${3:/* code */}'
- 'template <typename>':
- 'prefix': 'tp'
- 'body': 'template <typename ${1:_InputIter}>\n'# ${2:/* code */}'
- 'vector':
- 'prefix': 'vec'
- 'body': 'std::vector<${1:int}> vec$2;'# ${3:/* code */}'
- 'map':
- 'prefix': 'map'
- 'body': 'std::map<${1:string}, ${2:int}> m$3;'# ${4:/* code */}'
- 'unordered_map':
- 'prefix': 'umap'
- 'body': 'std::unordered_map<${1:string}, ${2:int}> um$3;'# ${4:/* code */}'
- 'set':
- 'prefix': 'set'
- 'body': 'std::set<${1:int}> s$2;'# ${3:/* code */}'
- 'unordered_set':
- 'prefix': 'uset'
- 'body': 'std::unordered_set<${1:int}> us$2;'# ${3:/* code */}'
- 'return':
- 'prefix': 'ret'
- 'body': 'return $1;'
- 'cin':
- 'prefix': 'cin'
- 'body': 'std::cin >> ${1:/* variable */};'# ${2:/* code */}'
- 'cout':
- 'prefix': 'cout'
- 'body': 'std::cout << ${1:} << "${2:\\\\n}";'# ${3:/* code */}'
- 'for':
- 'prefix': 'for'
- 'body': 'for (size_t ${1:i} = 0; ${1:i} < ${2:n}; ${3:++}${1:i}) {\n\t${4:/* code */}\n}'
- 'range-based for':
- 'prefix': 'forr'
- 'body': 'for (const auto& ${1:element}: ${2:vec}) {\n\t${4:/* code */}\n}'
- 'func':
- 'prefix': 'func'
- 'body': '${1:int} ${2:name}(${3:/* arguments */}) {\n\t${4:/* code */}\n\treturn ${5:0};\n}'
- '#include<>':
- 'prefix': 'inc'
- 'body': '#include <${1:}>\n${2:/* code */}'
- '#include<>':
- 'prefix': '#inc'
- 'body': '#include <${1:}>\n${2:/* code */}'
- 'str':
- 'prefix': 'str'
- 'body': 'std::string ${1:text};'# ${2:/* code */}'
- 'printf':
- 'prefix': 'printf'
- 'body': 'printf("${1:%d}\\\\n", $2);'# ${3:/* code */}'
- 'scanf':
- 'prefix': 'scanf'
- 'body': 'scanf("${1:%d}", &$2);'# ${3:/* code */}'
- 'Typedef':
- 'prefix': 'td'
- 'body': 'using ${1:MyCustomType} = ${2:int};\n'# ${3:/* code */}'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement