├── .editorconfig ├── .github └── workflows │ └── format.yml ├── LICENSE ├── README.md ├── debug ├── lazy-nvim.lua └── packer-nvim.lua ├── package.json └── snippets ├── PowerShell.json ├── asciidoc.json ├── beancount.json ├── c ├── c.json └── cdoc.json ├── cmake.json ├── cobol ├── vscode_cobol-compound.json ├── vscode_cobol.json ├── vscode_cobol_dir.json └── vscode_cobol_jcl.json ├── cpp ├── cpp.json └── cppdoc.json ├── csharp ├── csharp.json └── csharpdoc.json ├── css.json ├── dart.json ├── docker ├── docker-compose.json └── docker_file.json ├── editorconfig.json ├── eelixir.json ├── elixir.json ├── erb.json ├── erlang.json ├── fennel.json ├── fortran.json ├── frameworks ├── angular │ ├── html.json │ ├── jsonc.json │ └── typescript.json ├── blade │ ├── blade.json │ ├── helpers.json │ ├── livewire.json │ └── snippets.json ├── django │ ├── admin.json │ ├── django_rest │ │ ├── serializers.json │ │ └── views.json │ ├── forms.json │ ├── models.json │ ├── tags.json │ ├── urls.json │ └── views.json ├── djangohtml.json ├── edge.json ├── ejs.json ├── flutter.json ├── jekyll.json ├── rails.json ├── relm4 │ ├── components.json │ ├── factories.json │ ├── templates.json │ └── workers.json ├── remix-ts.json ├── twig.json ├── unity.json ├── unreal.json └── vue │ ├── html.json │ ├── nuxt-html.json │ ├── nuxt-script.json │ ├── script.json │ ├── style.json │ └── vue.json ├── fsh.json ├── gdscript.json ├── gitcommit.json ├── gleam.json ├── global.json ├── glsl.json ├── go.json ├── haskell.json ├── html.json ├── java ├── java-tests.json ├── java.json └── javadoc.json ├── javascript ├── javascript.json ├── jsdoc.json ├── next-ts.json ├── next.json ├── react-es7.json ├── react-native-ts.json ├── react-native.json ├── react-ts.json ├── react.json ├── tsdoc.json └── typescript.json ├── julia.json ├── kivy.json ├── kotlin ├── kdoc.json └── kotlin.json ├── kubernetes.json ├── latex.json ├── latex ├── bibtex.json ├── latex-snippets.json └── vscode-latex-snippets.json ├── license.json ├── liquid.json ├── loremipsum.json ├── lua ├── lua.json └── luadoc.json ├── make.json ├── markdown.json ├── mint.json ├── nix.json ├── norg.json ├── nushell.json ├── objc.json ├── ocaml ├── dune-project.json ├── dune.json ├── ocaml.json └── ocamllex.json ├── org.json ├── perl.json ├── php ├── php.json └── phpdoc.json ├── plantuml.json ├── purescript.json ├── python ├── comprehension.json ├── debug.json ├── pydoc.json ├── python.json └── unittest.json ├── quarto.json ├── r.json ├── reason.json ├── rescript.json ├── rmarkdown.json ├── rst.json ├── ruby ├── rdoc.json ├── rspec.json └── ruby.json ├── rust ├── rust.json └── rustdoc.json ├── scala.json ├── shell ├── shell.json └── shelldoc.json ├── solidity.json ├── sql.json ├── svelte.json ├── swift.json ├── systemverilog.json ├── tcl.json ├── terraform.json ├── verilog.json ├── vhdl.json └── zig.json /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | end_of_line = lf 5 | insert_final_newline = true 6 | 7 | [*.json] 8 | indent_style = space 9 | indent_size = 4 10 | 11 | [*.lua] 12 | indent_style = tab 13 | indent_size = 4 14 | 15 | [*.md] 16 | indent_style = space 17 | indent_size = 2 18 | 19 | [*.yml] 20 | indent_style = space 21 | indent_size = 2 22 | -------------------------------------------------------------------------------- /.github/workflows/format.yml: -------------------------------------------------------------------------------- 1 | name: Format JSON files 2 | 3 | # Controls when the workflow will run 4 | on: 5 | # Triggers the workflow on push or pull request events but only for the "main" branch 6 | push: 7 | branches: [ "main" ] 8 | 9 | # Allows you to run this workflow manually from the Actions tab 10 | workflow_dispatch: 11 | 12 | # A workflow run is made up of one or more jobs that can run sequentially or in parallel 13 | jobs: 14 | prettier: 15 | runs-on: ubuntu-latest 16 | 17 | steps: 18 | - name: Checkout 19 | uses: actions/checkout@v3 20 | with: 21 | # Make sure the actual branch is checked out when running on pull requests 22 | ref: ${{ github.head_ref }} 23 | 24 | - name: Format JSON 25 | uses: creyD/prettier_action@v4.3 26 | with: 27 | commit_message: "CI: format JSON files" 28 | only_changed: true 29 | # This part is also where you can pass other options, for example: 30 | prettier_options: --tab-width 4 --parser json --write **/*.json 31 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Rafael Madriz 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Friendly Snippets 2 | 3 | Snippets collection for a set of different programming languages. 4 | 5 | The only goal is to have one community driven repository for all kinds of 6 | snippets in all programming languages, this way you can have it all in one 7 | place. 8 | 9 | ## Install 10 | 11 | Use your plugin manager of choice, e.g. 12 | 13 | ### With Lazy.nvim 14 | 15 | ```lua 16 | { "rafamadriz/friendly-snippets" } 17 | ``` 18 | 19 | > [!WARNING] 20 | > If you're using LuaSnip make sure to use 21 | > `require("luasnip.loaders.from_vscode").lazy_load()`, and add 22 | > `friendly-snippets` as a dependency for LuaSnip, otherwise snippets might not 23 | > be detected. If you don't use `lazy_load()` you might notice a slower 24 | > startup-time 25 | > 26 | > ```lua 27 | > { 28 | > "L3MON4D3/LuaSnip", 29 | > dependencies = { "rafamadriz/friendly-snippets" }, 30 | > } 31 | > ``` 32 | 33 | ### With Packer 34 | 35 | ```lua 36 | use "rafamadriz/friendly-snippets" 37 | ``` 38 | 39 | ### With vim-plug 40 | 41 | ```vim 42 | Plug "rafamadriz/friendly-snippets" 43 | ``` 44 | 45 | ### With coc.nvim 46 | 47 | ```vim 48 | :CocInstall https://github.com/rafamadriz/friendly-snippets@main 49 | ``` 50 | 51 | ## Usage 52 | 53 | This collection of snippets should work with any snippet engine that supports 54 | loading vscode snippets. Like for example: 55 | 56 | - [vim-vsnip](https://github.com/hrsh7th/vim-vsnip) 57 | - [LuaSnip](https://github.com/L3MON4D3/LuaSnip) 58 | - [coc-snippets](https://github.com/neoclide/coc-snippets) 59 | 60 | ## Add snippets from a framework to a filetype. 61 | 62 | > [!NOTE] 63 | > This is handled by your snippet engine and has nothing to do with this snippets collection 64 | 65 | There's extra snippets included in this repo but they are not added by default, 66 | since it would be irrelevant for people not using those frameworks. See 67 | [`snippets/frameworks`](https://github.com/rafamadriz/friendly-snippets/tree/main/snippets/frameworks) 68 | 69 | For example: if you want to add rails snippets to ruby. 70 | 71 | With LuaSnip: 72 | 73 | ```lua 74 | require'luasnip'.filetype_extend("ruby", {"rails"}) 75 | ``` 76 | 77 | With vim-vsnip: 78 | 79 | ```viml 80 | let g:vsnip_filetypes.ruby = ['rails'] 81 | ``` 82 | 83 | ## Excluding snippets 84 | 85 | > [!NOTE] 86 | > This is handled by your snippet engine and has nothing to do with this snippets collection 87 | 88 | With LuaSnip, see `help luasnip-loaders` 89 | 90 | ```lua 91 | -- will exclude all javascript snippets 92 | require("luasnip.loaders.from_vscode").load { 93 | exclude = { "javascript" }, 94 | } 95 | ``` 96 | 97 | ## Showcase 98 | 99 | ### HTML 100 | 101 | ![HTML gif](https://user-images.githubusercontent.com/67771985/131255337-d53f3408-b60d-44a2-93ba-9a3240a7436e.gif) 102 | 103 | ### JS 104 | 105 | ![JS gif](https://user-images.githubusercontent.com/67771985/131255342-e393165a-e4b1-401e-9084-a782b9dd3fef.gif) 106 | 107 | ## TODO 108 | 109 | - Add all included snippets to the 110 | [Wiki](https://github.com/rafamadriz/friendly-snippets/wiki). 111 | 112 | ## Thanks to all contributors 113 | 114 | 115 | 116 | 117 | 118 | ## Credits 119 | 120 | A good portion of the snippets have been forked from the following repositories: 121 | 122 | - [vscode-standardjs-snippets](https://github.com/capaj/vscode-standardjs-snippets) 123 | - [python-snippets](https://github.com/cstrap/python-snippets) 124 | - [vs-snippets](https://github.com/kitagry/vs-snippets) 125 | - [Wscats/html-snippets](https://github.com/Wscats/html-snippets) 126 | - [Harry-Ross/vscode-c-snippets](https://github.com/Harry-Ross/vscode-c-snippets) 127 | - [vscode-jekyll-snippets](https://github.com/edheltzel/vscode-jekyll-snippets) 128 | - [vscode-fortran-support](https://github.com/krvajal/vscode-fortran-support) 129 | - [vscode_cobol](https://github.com/spgennard/vscode_cobol) 130 | - [VSCode-LaTeX-Snippets](https://github.com/JeffersonQin/VSCode-LaTeX-Snippets) 131 | - [vscode-react-javascript-snippets](https://github.com/dsznajder/vscode-react-javascript-snippets) 132 | - [honza/vim-snippets - Verilog](https://github.com/honza/vim-snippets/blob/master/snippets/verilog.snippets) 133 | - [vscode-relm4-snippets](https://github.com/Relm4/vscode-relm4-snippets) 134 | - And more... 135 | -------------------------------------------------------------------------------- /debug/lazy-nvim.lua: -------------------------------------------------------------------------------- 1 | local temp_dir = vim.loop.os_getenv("TEMP") or "/tmp" 2 | local install_dir = temp_dir .. "/lazy-nvim" 3 | 4 | -- set stdpaths to use "/tmp/lazy-nvim" 5 | for _, name in ipairs({ "config", "data", "state", "cache" }) do 6 | vim.env[("XDG_%s_HOME"):format(name:upper())] = install_dir .. "/" .. name 7 | end 8 | 9 | -- bootstrap lazy 10 | local lazypath = install_dir .. "/plugins/lazy.nvim" 11 | if not vim.loop.fs_stat(lazypath) then 12 | vim.fn.system({ 13 | "git", 14 | "clone", 15 | "--filter=blob:none", 16 | "--single-branch", 17 | "https://github.com/folke/lazy.nvim.git", 18 | lazypath, 19 | }) 20 | end 21 | vim.opt.runtimepath:prepend(lazypath) 22 | 23 | -- install plugins 24 | -- modify according to which snippet engine,etc you're using 25 | local plugins = { 26 | "rafamadriz/friendly-snippets", 27 | { 28 | -- snippet engine is necessary to load snippets 29 | "L3MON4D3/LuaSnip", 30 | config = function() 31 | require("luasnip.loaders.from_vscode").load({}) 32 | end, 33 | }, 34 | { 35 | -- completion engine is not needed but makes debuggin much easir 36 | -- since you type and instantly see if snippets are being loaded 37 | "hrsh7th/nvim-cmp", 38 | config = function() 39 | local cmp = require("cmp") 40 | cmp.setup({ 41 | snippet = { 42 | expand = function(args) 43 | require("luasnip").lsp_expand(args.body) 44 | end, 45 | }, 46 | mapping = cmp.mapping.preset.insert({ 47 | [""] = cmp.mapping.scroll_docs(-4), 48 | [""] = cmp.mapping.scroll_docs(4), 49 | [""] = cmp.mapping.complete(), 50 | [""] = cmp.mapping.abort(), 51 | [""] = cmp.mapping.confirm({ select = true }), 52 | }), 53 | sources = cmp.config.sources({ 54 | { name = "luasnip" }, 55 | }), 56 | }) 57 | end, 58 | }, 59 | -- cmp completion source for snippets 60 | "saadparwaiz1/cmp_luasnip", 61 | } 62 | require("lazy").setup(plugins, { 63 | root = install_dir .. "/plugins", 64 | }) 65 | 66 | vim.opt.termguicolors = true 67 | -------------------------------------------------------------------------------- /debug/packer-nvim.lua: -------------------------------------------------------------------------------- 1 | local on_windows = vim.loop.os_uname().version:match("Windows") 2 | 3 | local function join_paths(...) 4 | local path_sep = on_windows and "\\" or "/" 5 | local result = table.concat({ ... }, path_sep) 6 | return result 7 | end 8 | 9 | vim.cmd([[set runtimepath=$VIMRUNTIME]]) 10 | 11 | local temp_dir = vim.loop.os_getenv("TEMP") or "/tmp" 12 | 13 | vim.cmd("set packpath=" .. join_paths(temp_dir, "packer-nvim", "site")) 14 | 15 | local package_root = join_paths(temp_dir, "packer-nvim", "site", "pack") 16 | local install_path = join_paths(package_root, "packer", "start", "packer.nvim") 17 | local compile_path = join_paths(install_path, "plugin", "packer_compiled.lua") 18 | 19 | -- install plugins 20 | -- modify according to which snippet engine,etc you're using 21 | local function load_plugins() 22 | require("packer").startup({ 23 | { 24 | "wbthomason/packer.nvim", 25 | "rafamadriz/friendly-snippets", 26 | "L3MON4D3/LuaSnip", -- snippet engine is necessary to load snippets 27 | -- completion engine is not needed but makes debuggin much easir 28 | -- since you type and instantly see if snippets are being loaded 29 | "hrsh7th/nvim-cmp", 30 | "saadparwaiz1/cmp_luasnip", -- cmp completion source for snippets 31 | }, 32 | config = { 33 | package_root = package_root, 34 | compile_path = compile_path, 35 | }, 36 | }) 37 | end 38 | 39 | _G.load_config = function() 40 | local cmp = require("cmp") 41 | 42 | cmp.setup({ 43 | snippet = { 44 | expand = function(args) 45 | require("luasnip").lsp_expand(args.body) 46 | end, 47 | }, 48 | mapping = cmp.mapping.preset.insert({ 49 | [""] = cmp.mapping.scroll_docs(-4), 50 | [""] = cmp.mapping.scroll_docs(4), 51 | [""] = cmp.mapping.complete(), 52 | [""] = cmp.mapping.abort(), 53 | [""] = cmp.mapping.confirm({ select = true }), 54 | }), 55 | sources = cmp.config.sources({ 56 | { name = "luasnip" }, 57 | }), 58 | }) 59 | 60 | require("luasnip.loaders.from_vscode").load({}) 61 | end 62 | 63 | if vim.fn.isdirectory(install_path) == 0 then 64 | vim.fn.system({ "git", "clone", "https://github.com/wbthomason/packer.nvim", install_path }) 65 | load_plugins() 66 | require("packer").sync() 67 | vim.cmd([[autocmd User PackerComplete ++once lua load_config()]]) 68 | else 69 | load_plugins() 70 | require("packer").sync() 71 | _G.load_config() 72 | end 73 | -------------------------------------------------------------------------------- /snippets/beancount.json: -------------------------------------------------------------------------------- 1 | { 2 | "option": { 3 | "prefix": "option", 4 | "body": [ 5 | "option \"${1:name}\" \"${2:value}\"", 6 | "$0" 7 | ], 8 | "description": "Add option." 9 | }, 10 | 11 | "open directive": { 12 | "prefix": "open", 13 | "body": [ 14 | "${1:$CURRENT_YEAR}-${2:$CURRENT_MONTH}-${3:$CURRENT_DATE} open ${4|Assets:,Liabilities:,Equity:,Income:,Expenses:|} ${5:[ConstraintCurrency] [BookingMethod]}", 15 | "$0" 16 | ], 17 | "description": "Open an account." 18 | }, 19 | 20 | "close directive": { 21 | "prefix": "close", 22 | "body": [ 23 | "${1:$CURRENT_YEAR}-${2:$CURRENT_MONTH}-${3:$CURRENT_DATE} close ${4|Assets:,Liabilities:,Equity:,Income:,Expenses:|}", 24 | "$0" 25 | ], 26 | "description": "Close an account." 27 | }, 28 | 29 | "commoditiy directive": { 30 | "prefix": "commodity", 31 | "body": [ 32 | "${1:$CURRENT_YEAR}-${2:$CURRENT_MONTH}-${3:$CURRENT_DATE} commodity ${4:ISO/Ticker}", 33 | " name: \"${5:FullName}\"", 34 | " asset-class: \"${6|cash,stock|}\"", 35 | "$0" 36 | ], 37 | "description": "Add a commodity metadata (optional)." 38 | }, 39 | 40 | "completed transaction directive": { 41 | "prefix": "txn*", 42 | "body": [ 43 | "${1:$CURRENT_YEAR}-${2:$CURRENT_MONTH}-${3:$CURRENT_DATE} * \"${4:Payee}\" \"${5:Narration}\"", 44 | " $0" 45 | ], 46 | "description": "Add a completed transaction." 47 | }, 48 | 49 | "incomplete transaction directive": { 50 | "prefix": "txn!", 51 | "body": [ 52 | "${1:$CURRENT_YEAR}-${2:$CURRENT_MONTH}-${3:$CURRENT_DATE} ! \"${4:Payee}\" \"${5:Narration}\"", 53 | " $0" 54 | ], 55 | "description": "Add an incomplete transaction." 56 | }, 57 | 58 | "balance assertion": { 59 | "prefix": "balance", 60 | "body": [ 61 | "${1:$CURRENT_YEAR}-${2:$CURRENT_MONTH}-${3:$CURRENT_DATE} balance ${4|Assets:,Liabilities:,Equity:,Income:,Expenses:|} ${5:Amount}", 62 | "$0" 63 | ], 64 | "description": "Assert balance on given day." 65 | }, 66 | 67 | "pad": { 68 | "prefix": "pad", 69 | "body": [ 70 | "${1:$CURRENT_YEAR}-${2:$CURRENT_MONTH}-${3:$CURRENT_DATE} pad ${4:AccountTo} ${5:AccountFrom}", 71 | "$0" 72 | ], 73 | "description": "Pad balance between two accounts." 74 | }, 75 | 76 | "note": { 77 | "prefix": "note", 78 | "body": [ 79 | "${1:$CURRENT_YEAR}-${2:$CURRENT_MONTH}-${3:$CURRENT_DATE} note ${4|Assets:,Liabilities:,Equity:,Income:,Expenses:|} ${5:Description}", 80 | "$0" 81 | ], 82 | "description": "Insert a dated comment." 83 | }, 84 | 85 | "document": { 86 | "prefix": "document", 87 | "body": [ 88 | "${1:$CURRENT_YEAR}-${2:$CURRENT_MONTH}-${3:$CURRENT_DATE} document ${4|Assets:,Liabilities:,Equity:,Income:,Expenses:|} \"${5:PathToDocument}\"", 89 | "$0" 90 | ], 91 | "description": "Insert a dated document relating to a account." 92 | }, 93 | 94 | "price": { 95 | "prefix": "price", 96 | "body": [ 97 | "${1:$CURRENT_YEAR}-${2:$CURRENT_MONTH}-${3:$CURRENT_DATE} price ${4:Commodity} ${5:Price}", 98 | "$0" 99 | ], 100 | "description": "Add a dated price between commodities (for unrealized gains)." 101 | }, 102 | 103 | "event": { 104 | "prefix": "event", 105 | "body": [ 106 | "${1:$CURRENT_YEAR}-${2:$CURRENT_MONTH}-${3:$CURRENT_DATE} event \"${4:Key}\" \"${5:Value}\"", 107 | "$0" 108 | ], 109 | "description": "Add a dated event/variable to track." 110 | }, 111 | 112 | "plugin": { 113 | "prefix": "plugin", 114 | "body": [ 115 | "plugin \"${4:PluginName}\" \"${5:ConfigString}\"", 116 | "$0" 117 | ], 118 | "description": "Load a plugin." 119 | }, 120 | 121 | "include": { 122 | "prefix": "include", 123 | "body": [ 124 | "include \"${4:Filename}\"", 125 | "$0" 126 | ], 127 | "description": "Include a beancount file." 128 | }, 129 | 130 | "query": { 131 | "prefix": "query", 132 | "body": [ 133 | "${1:$CURRENT_YEAR}-${2:$CURRENT_MONTH}-${3:$CURRENT_DATE} query \"${4:Name}\" \"${5:SQLContents}\"", 134 | "$0" 135 | ], 136 | "description": "Insert query into the stream of transactions." 137 | }, 138 | 139 | "custom": { 140 | "prefix": "custom", 141 | "body": [ 142 | "${1:$CURRENT_YEAR}-${2:$CURRENT_MONTH}-${3:$CURRENT_DATE} custom \"${4:TypeName}\" ${5:Value...}", 143 | "$0" 144 | ], 145 | "description": "Add a custom directive." 146 | }, 147 | 148 | "pushtag": { 149 | "prefix": "pushtag", 150 | "body": [ 151 | "pushtag #${1:TagName}", 152 | "$0" 153 | ], 154 | "description": "Push a tag onto the stack." 155 | }, 156 | 157 | "poptag": { 158 | "prefix": "poptag", 159 | "body": [ 160 | "poptag #${1:TagName}", 161 | "$0" 162 | ], 163 | "description": "Pop a tag from the stack." 164 | }, 165 | 166 | "budget": { 167 | "prefix": "budget", 168 | "body": [ 169 | "${1:$CURRENT_YEAR}-${2:$CURRENT_MONTH}-${3:$CURRENT_DATE} custom \"budget\" ${5:Expenses:} \"${6|daily,weekly,monthly,quaterly,yearly|}\" ${7:Amount}", 170 | "$0" 171 | ], 172 | "description": "Add a Fava compatible budget directive." 173 | } 174 | } 175 | -------------------------------------------------------------------------------- /snippets/c/cdoc.json: -------------------------------------------------------------------------------- 1 | { 2 | "comment": { 3 | "prefix": "/**", 4 | "body": [ 5 | "/**", 6 | " * ${1:A one-line summary.}", 7 | " *", 8 | " * ${2:Description.}$0", 9 | " *", 10 | " * @param ${4:name} ${5:Type and description of the parameter.}", 11 | " * @return ${3:Type and description of the returned value.}", 12 | " *", 13 | " * @example", 14 | " * // ${6:Description of my example.}", 15 | " * ${7:Write me later}", 16 | " */" 17 | ], 18 | "description": "A C comment block for functions, including short summary, details, param, return, and example." 19 | }, 20 | "comment_simple": { 21 | "prefix": "/*", 22 | "body": [ 23 | "/**", 24 | " * ${1:A one-line summary.}", 25 | " *", 26 | " * ${2:Description.}$0", 27 | " */" 28 | ], 29 | "description": "A simple C comment block for functions, including short summary, and details. Useful when you prefer to add the other documentation tags manually." 30 | }, 31 | "@param": { 32 | "prefix": "@param", 33 | "body": [ 34 | "@param ${1:name} ${2:Type and description of the parameter.}$0" 35 | ], 36 | "description": "Type and description of a function parameter." 37 | }, 38 | "@return": { 39 | "prefix": "@return", 40 | "body": [ 41 | "@return ${1:Type and description of the returned value.}$0" 42 | ], 43 | "description": "Type and description of the returned value." 44 | }, 45 | "@example": { 46 | "prefix": "@example", 47 | "body": [ 48 | "* @example", 49 | "* // ${1:Description of my example.}$0", 50 | "* ${2:Write me later}" 51 | ], 52 | "description": "Example that demostrates how to use a function. It can be used several times." 53 | }, 54 | "@note": { 55 | "prefix": "@note", 56 | "body": [ 57 | "@note ${1:Text.}$0" 58 | ], 59 | "description": "Anything worth mentioning that wouldn't fit in the description, or other documentation tags." 60 | }, 61 | "@warning": { 62 | "prefix": "@warning", 63 | "body": [ 64 | "@warning ${1:Text.}$0" 65 | ], 66 | "description": "Indicates special considerations when using the function." 67 | }, 68 | "@see": { 69 | "prefix": "@see", 70 | "body": [ 71 | "@see ${1:Text.}$0" 72 | ], 73 | "description": "References another function, or piece of documentation." 74 | }, 75 | "@deprecated": { 76 | "prefix": "@deprecated", 77 | "body": [ 78 | "@deprecated ${1:Text.}$0" 79 | ], 80 | "description": "Marks the function as deprecated, and no longer recommended for use." 81 | }, 82 | "@todo": { 83 | "prefix": "@todo", 84 | "body": [ 85 | "@todo ${1:Text.}$0" 86 | ], 87 | "description": "Used to mark areas of the code that require improvement." 88 | }, 89 | "@fixme": { 90 | "prefix": "@fixme", 91 | "body": [ 92 | "@fixme ${1:Text.}$0" 93 | ], 94 | "description": "Used to mark areas of the code that require fixing." 95 | } 96 | } 97 | -------------------------------------------------------------------------------- /snippets/cobol/vscode_cobol-compound.json: -------------------------------------------------------------------------------- 1 | { 2 | "ep0": { 3 | "prefix": "ep0", 4 | "body": ["exit program returning ${1:0}"], 5 | "description": "exit program returning [0]", 6 | "scope": "cobol,acucobol" 7 | }, 8 | "sr0": { 9 | "prefix": "sr0", 10 | "body": ["stop run returning ${1:0}"], 11 | "description": "stop run returing [0]", 12 | "scope": "cobol,acucobol" 13 | }, 14 | "gr0": { 15 | "prefix": "gr0", 16 | "body": ["goback returning ${1:0}"], 17 | "description": "goback returning [0]", 18 | "scope": "cobol,acucobol" 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /snippets/cobol/vscode_cobol_dir.json: -------------------------------------------------------------------------------- 1 | { 2 | "dialect": { 3 | "prefix": "dialect", 4 | "body": [ 5 | "dialect\"${2|ans85,bs2000,bs2000-offload,cob370,cob371,cob372,entcobol,mf,mvs,os390,osvs,vsc21,vsc22,vsc23,vsc24|}\"", 6 | "$0" 7 | ] 8 | }, 9 | "sourceformat": { 10 | "prefix": "sourceformat", 11 | "body": ["sourceformat\"${2|free,variable,fixed|}\"", "$0"] 12 | }, 13 | "jvmgen": { 14 | "prefix": "jvmgen", 15 | "body": ["jvmgen\"${2|sub|}\"", "$0"] 16 | }, 17 | "ilgen": { 18 | "prefix": "ilgen", 19 | "body": ["ilgen\"${2|sub|}\"", "$0"] 20 | }, 21 | "copypath": { 22 | "prefix": "copypath", 23 | "body": ["copypath\"\\$COBCPY;$1\"", "$0"] 24 | }, 25 | "speed - native": { 26 | "prefix": "speed", 27 | "body": [ 28 | "nocheck", 29 | "fastcall", 30 | "fastinit", 31 | "nolinkcheck", 32 | "lnkalign", 33 | "noparamcountcheck", 34 | "$0" 35 | ] 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /snippets/cobol/vscode_cobol_jcl.json: -------------------------------------------------------------------------------- 1 | { 2 | "Job/ADDRSPC": { 3 | "scope": "JCL", 4 | "prefix": "ADDRSPC", 5 | "body": ["ADDRSPC=${2|VIRT,REAL|}${3|\\,|}"], 6 | "description": "ADDRSPC Parameter" 7 | }, 8 | "JOB/BYTES": { 9 | "scope": "JCL", 10 | "prefix": "BYTES", 11 | "body": ["BYTES=${2:500},${3|CANCEL,DUMP,WARNING|}${4|\\,|}"], 12 | "description": "BYTES Parameter" 13 | }, 14 | "Job/CARDS": { 15 | "scope": "JCL", 16 | "prefix": "CARDS", 17 | "body": ["CARDS=${2:500},${3|CANCEL,DUMP,WARNING|}${4|\\,|}"], 18 | "description": "CARDS Parameter" 19 | }, 20 | "Job/COND": { 21 | "scope": "JCL", 22 | "prefix": "COND", 23 | "body": [ 24 | "COND=(${2:0},${3|GT,GE,EQ,LT,LE,NE|},${4:STEPNAME})${5|\\,|}" 25 | ], 26 | "description": "COND Parameter" 27 | }, 28 | "Job/DISP": { 29 | "scope": "JCL", 30 | "prefix": "DISP", 31 | "body": ["DISP=${2|NEW,CATLG,DELETE|}"], 32 | "description": "DISP Parameter, NEW = New data set, CATLG = Create a new catalog entry, DELETE = delete data set on abnormal termination" 33 | }, 34 | "Job/LRECL": { 35 | "scope": "JCL", 36 | "prefix": "LRECL", 37 | "body": ["LRECL=${2|80,132|}"], 38 | "description": "LRECL Parameter" 39 | }, 40 | "Job/IEFBR14": { 41 | "scope": "JCL", 42 | "prefix": "IEFBR14", 43 | "body": ["//${2:STEPID01} EXEC PGM=IEFBR14", "$0"], 44 | "description": "IEFBR14 Data set utility" 45 | }, 46 | "Job/IEBGENER ": { 47 | "scope": "JCL", 48 | "prefix": "IEBGENER ", 49 | "body": [ 50 | "//${2:STEPID01} EXEC PGM=IEBGENER ", 51 | "//SYSUT1 DD *", 52 | "${3}", 53 | "/*", 54 | "//SYSUT2 DD DISP=NEW,DSN=${4:A.B.C}", 55 | "//SYSPRINT DD SYSOUT=*", 56 | "$0" 57 | ], 58 | "description": "IEBGENER create/load a dataset" 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /snippets/cpp/cppdoc.json: -------------------------------------------------------------------------------- 1 | { 2 | "comment": { 3 | "prefix": "/**", 4 | "body": [ 5 | "/**", 6 | " * ${1:A one-line summary.}", 7 | " *", 8 | " * ${2:Description.}$0", 9 | " *", 10 | " * @param ${4:name} ${5:Type and description of the parameter.}", 11 | " * @return ${3:Type and description of the returned value.}", 12 | " *", 13 | " * @example", 14 | " * // ${6:Description of my example.}", 15 | " * ${7:Write me later}", 16 | " */" 17 | ], 18 | "description": "A C++ comment block for functions, including description, param, return, and example." 19 | }, 20 | "comment_simple": { 21 | "prefix": "/*", 22 | "body": [ 23 | "/**", 24 | " * ${1:A one-line summary.}", 25 | " *", 26 | " * ${2:Description.}$0", 27 | " */" 28 | ], 29 | "description": "A simple C++ comment block for classes, including short summary, and details. Useful when you prefer to add the other documentation tags manually." 30 | }, 31 | "@param": { 32 | "prefix": "@param", 33 | "body": [ 34 | "@param ${1:name} ${2:Type and description of the parameter.}$0" 35 | ], 36 | "description": "Type and description of a function parameter." 37 | }, 38 | "@return": { 39 | "prefix": "@return", 40 | "body": [ 41 | "@return ${1:Type and description of the returned value.}$0" 42 | ], 43 | "description": "Type and description of the returned value." 44 | }, 45 | "@example": { 46 | "prefix": "@example", 47 | "body": [ 48 | "@example", 49 | "* // ${1:Description of my example.}$0", 50 | "* ${2:Write me later}" 51 | ], 52 | "description": "Example that demostrates how to use a function. It can be used several times." 53 | }, 54 | "@throws": { 55 | "prefix": "@throws", 56 | "body": [ 57 | "@throws ${1:ExceptionName} ${2:Description.}$0" 58 | ], 59 | "description": "Indicates the exceptions that can be thrown by a function. This tag is a synonym of @exception." 60 | }, 61 | "@exception": { 62 | "prefix": "@exception", 63 | "body": [ 64 | "@exception ${1:ExceptionName} ${2:Description.}$0" 65 | ], 66 | "description": "Indicates the exceptions that can be thrown by a function. This tag is a synonym of @throws." 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /snippets/dart.json: -------------------------------------------------------------------------------- 1 | { 2 | "main": { 3 | "prefix": "main", 4 | "description": "Insert a main function, used as an entry point.", 5 | "body": ["void main(List args) {", " $0", "}"] 6 | }, 7 | "try": { 8 | "prefix": "try", 9 | "description": "Insert a try/catch block.", 10 | "body": ["try {", " $0", "} catch (${1:e}) {", "}"] 11 | }, 12 | "if": { 13 | "prefix": "if", 14 | "description": "Insert an if statement.", 15 | "body": ["if ($1) {", " $0", "}"] 16 | }, 17 | "if else": { 18 | "prefix": "ife", 19 | "description": "Insert an if statement with an else block.", 20 | "body": ["if ($1) {", " $0", "} else {", "}"] 21 | }, 22 | "switch case": { 23 | "prefix": "switch", 24 | "description": "Insert a switch statement.", 25 | "body": [ 26 | "switch ($1) {", 27 | " case $2:", 28 | " $0", 29 | " break;", 30 | " default:", 31 | "}" 32 | ] 33 | }, 34 | "for": { 35 | "prefix": "for", 36 | "description": "Insert a for loop.", 37 | "body": ["for (var i = 0; i < ${1:count}; i++) {", " $0", "}"] 38 | }, 39 | "for in": { 40 | "prefix": "fori", 41 | "description": "Insert a for-in loop.", 42 | "body": ["for (var ${1:item} in ${2:items}) {", " $0", "}"] 43 | }, 44 | "while": { 45 | "prefix": "while", 46 | "description": "Insert a while loop.", 47 | "body": ["while ($1) {", " $0", "}"] 48 | }, 49 | "do while": { 50 | "prefix": "do", 51 | "description": "Insert a do-while loop.", 52 | "body": ["do {", " $0", "} while ($1);"] 53 | }, 54 | "fun": { 55 | "prefix": "fun", 56 | "description": "Insert a function definition.", 57 | "body": ["${3:void} ${1:name}(${2:args}) {", " $0", "}"] 58 | }, 59 | "class": { 60 | "prefix": "class", 61 | "description": "Insert a class definition.", 62 | "body": ["class ${1:Name} {", " $0", "}"] 63 | }, 64 | "typedef": { 65 | "prefix": "typedef", 66 | "description": "Insert a typedef.", 67 | "body": "typedef ${1:Type} ${2:Name}(${3:params});" 68 | }, 69 | "test": { 70 | "prefix": "test", 71 | "description": "Insert a test block.", 72 | "body": ["test('$1', () {", " $0", "});"] 73 | }, 74 | "group": { 75 | "prefix": "group", 76 | "description": "Insert a test group block.", 77 | "body": ["group('$1', () {", " $0", "});"] 78 | }, 79 | "enum": { 80 | "prefix": "enum", 81 | "description": "Insert a enum.", 82 | "body": ["enum ${1:Name} {", " $0", "}"] 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /snippets/docker/docker_file.json: -------------------------------------------------------------------------------- 1 | { 2 | "FROM": { 3 | "prefix": "F", 4 | "body": "FROM ${1:ubuntu}" 5 | }, 6 | "Label maintainer": { 7 | "prefix": "m", 8 | "body": "LABEL maintainer=\"${1:name}\"" 9 | }, 10 | "RUN": { 11 | "prefix": "R", 12 | "body": ["RUN ${1:command}"] 13 | }, 14 | 15 | "CMD": { 16 | "prefix": "C", 17 | "body": ["CMD ${1:command}"] 18 | }, 19 | 20 | "COPY": { 21 | "prefix": "cp", 22 | "body": ["COPY ${1:src} ${2:dest}"] 23 | }, 24 | 25 | "EXPOSE": { 26 | "prefix": "exp", 27 | "body": ["EXPOSE ${1:port}"] 28 | }, 29 | "ENV": { 30 | "prefix": "env", 31 | "body": ["ENV ${1:key} ${2: value}"] 32 | }, 33 | "ADD": { 34 | "prefix": "a", 35 | "body": ["ADD ${1:src} ${2:dst}"] 36 | }, 37 | "ENTRYPOINT": { 38 | "prefix": "ent", 39 | "body": "ENTRYPOINT ${1:command}" 40 | }, 41 | "VOLUME": { 42 | "prefix": "v", 43 | "body": "VOLUME [\"${1:path}\"]" 44 | }, 45 | "USER": { 46 | "prefix": "u", 47 | "body": "USER ${1:name}" 48 | }, 49 | "WORKDIR": { 50 | "prefix": "w", 51 | "body": "WORKDIR ${1:name}" 52 | }, 53 | "Update Packages": { 54 | "prefix": "upd", 55 | "body": [ 56 | "RUN echo \"deb http://archive.ubuntu.com/ubuntu ${1:precise} main universe\" > /etc/apt/sources.list; \\", 57 | "apt-get update && apt-get -y upgrade; \\ ", 58 | "${2}; \\", 59 | "rm -rf /var/lib/apt/lists/*" 60 | ] 61 | }, 62 | "HEAD": { 63 | "prefix": "head", 64 | "body": ["# ${1:description}", "# ", "# VERSION ${2:0.1.0}", "${3}"] 65 | }, 66 | "ONBUILD": { 67 | "prefix": "o", 68 | "body": "ONBUILD ${1}" 69 | }, 70 | "LABEL": { 71 | "prefix": "L", 72 | "body": "LABEL ${1:label}=\"${2:value}\"" 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /snippets/editorconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "root": { 3 | "prefix": "root", 4 | "body": "# EditorConfig is awesome: https://EditorConfig.org\n\n# top-most EditorConfig file\nroot = true\n\n# Unix-style newlines with a newline ending every file\n[*]\nend_of_line = lf\ninsert_final_newline = true\n\n# Matches multiple files with brace expansion notation\n# Set default charset\n[*.{js,py}]\ncharset = utf-8\n\n# 4 space indentation\n[*.py]\nindent_style = space\nindent_size = 4\n\n# Tab indentation (no size specified)\n[Makefile]\nindent_style = tab\n\n# Indentation override for all JS under lib directory\n[lib/**.js]\nindent_style = space\nindent_size = 2\n\n# Matches the exact files either package.json or .travis.yml\n[{package.json,.travis.yml}]\nindent_style = space\nindent_size = 2", 5 | "description": "Editorconfig root configuration" 6 | }, 7 | "indent_style": { 8 | "prefix": "istyle", 9 | "body": "indent_style = space", 10 | "description": "Indentation Style (tab or space)" 11 | }, 12 | "indent_size": { 13 | "prefix": "isize", 14 | "body": "indent_size = 2", 15 | "description": "Indentation Size (integer or 'tab')" 16 | }, 17 | "tab_width": { 18 | "prefix": "tw", 19 | "body": "tab_width = 4", 20 | "description": "Width of a single tabstop character" 21 | }, 22 | "end_of_line": { 23 | "prefix": "eol", 24 | "body": "end_of_line = lf", 25 | "description": "Line ending file format (lf, crlf, or cr)" 26 | }, 27 | "charset": { 28 | "prefix": "char", 29 | "body": "charset = utf-8", 30 | "description": "File character encoding (latin1, utf-8, utf-16be, utf-16le, utf-8-bom)" 31 | }, 32 | "trim_trailing_space": { 33 | "prefix": "tts", 34 | "body": "trim_trailing_whitespace = true", 35 | "description": "Denotes whether whitespace is removed from the end of lines" 36 | }, 37 | "insert_final_newline": { 38 | "prefix": "ifn", 39 | "body": "insert_final_newline = true", 40 | "description": "Denotes whether file should end with a newline" 41 | }, 42 | "max_line_length": { 43 | "prefix": "mll", 44 | "body": "max_line_length = 80", 45 | "description": "Forces hard line wrapping after the amount of characters specified. 'off' to turn off this feature." 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /snippets/eelixir.json: -------------------------------------------------------------------------------- 1 | { 2 | "%": { 3 | "prefix": "%", 4 | "body": "<% $0 %>" 5 | }, 6 | "=": { 7 | "prefix": "=", 8 | "body": "<%= $0 %>" 9 | }, 10 | "gettext": { 11 | "prefix": "gt", 12 | "body": "<%= gettext(\"$0\") %>" 13 | }, 14 | "for": { 15 | "prefix": "for", 16 | "body": ["<%= for ${1:item} <- ${2:items} do %>", " $0", "<% end %>"] 17 | }, 18 | "if": { 19 | "prefix": "if", 20 | "body": ["<%= if ${1} do %>", " $0", "<% end %>"] 21 | }, 22 | "ife": { 23 | "prefix": "ife", 24 | "body": ["<%= if ${1} do %>", " $2", "<% else %>", " $0", "<% end %>"] 25 | }, 26 | "lin": { 27 | "prefix": "lin", 28 | "body": "<%= link \"${1:Submit}\", to: ${2:\"/users\"}, method: ${3::delete} %>" 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /snippets/elixir.json: -------------------------------------------------------------------------------- 1 | { 2 | "defmodule": { 3 | "prefix": "defmo", 4 | "body": ["defmodule ${1:module} do", " $0", "end"], 5 | "description": "Define a module" 6 | }, 7 | "def": { 8 | "prefix": "def", 9 | "body": ["def ${1:name}() do", " $0", "end"], 10 | "description": "Define a function" 11 | }, 12 | "defp": { 13 | "prefix": "defp", 14 | "body": ["defp ${1:name}() do", " $0", "end"], 15 | "description": "Define a private function" 16 | }, 17 | "df": { 18 | "prefix": "df", 19 | "body": "def ${1:name}(), do: $0", 20 | "description": "Define a one-liner function" 21 | }, 22 | "dfw": { 23 | "prefix": "dfw", 24 | "body": "def ${1:name}(${2:args}) when ${3:guard}, do: $0", 25 | "description": "Define a one-liner function with when guard" 26 | }, 27 | "IO.puts": { 28 | "prefix": "put", 29 | "body": "IO.puts($0)" 30 | }, 31 | "IO.inspect": { 32 | "prefix": "ins", 33 | "body": "IO.inspect($0)" 34 | }, 35 | "IO.inspect with label": { 36 | "prefix": "insl", 37 | "body": "IO.inspect($1, label: \"$0\")" 38 | }, 39 | "if .. do .. end": { 40 | "prefix": "if", 41 | "body": ["if ${1:condition} do", " $0", "end"] 42 | }, 43 | "if .. do:": { 44 | "prefix": "if:", 45 | "body": "if ${1:condition}, do: $0" 46 | }, 47 | "if .. do .. else .. end": { 48 | "prefix": "ife", 49 | "body": ["if ${1:condition} do", " $2", "else", " $0", "end"] 50 | }, 51 | "if .. do: .. else:": { 52 | "prefix": "ife:", 53 | "body": "if ${1:condition}, do: $2, else: $0" 54 | }, 55 | "cond": { 56 | "prefix": "cond", 57 | "body": ["cond do", " $1 -> ", " $0", "end"] 58 | }, 59 | "case": { 60 | "prefix": "case", 61 | "body": ["case $1 do", " $2 -> ", " $0", "end"] 62 | }, 63 | "for": { 64 | "prefix": "for", 65 | "body": ["for ${1:item} <- ${2:items} do", " $0", "end"] 66 | }, 67 | "def + doc": { 68 | "prefix": "defd", 69 | "body": [ 70 | "@doc \"\"\"", 71 | "${1:doc}", 72 | "\"\"\"", 73 | "def ${2:name} do", 74 | " $0", 75 | "end" 76 | ] 77 | }, 78 | "def + spec": { 79 | "prefix": "defs", 80 | "body": [ 81 | "@spec ${1:name}(${2:args}) :: ${3:no_return}", 82 | "def $1{4:args} do", 83 | " $0", 84 | "end" 85 | ] 86 | }, 87 | "def + doc + spec": { 88 | "prefix": "defsd", 89 | "body": [ 90 | "@doc \"\"\"", 91 | "${1:doc}", 92 | "\"\"\"", 93 | "@spec ${2:name}(${3:args}) :: ${4:no_return}", 94 | "def $2{5:args} do", 95 | " $0", 96 | "end" 97 | ] 98 | }, 99 | "do": { 100 | "prefix": "do", 101 | "body": ["do", " $0", "end"] 102 | }, 103 | "doc": { 104 | "prefix": "doc", 105 | "body": ["@doc \"\"\"", "$0", "\"\"\""] 106 | }, 107 | "doc s": { 108 | "prefix": "docs", 109 | "body": ["@doc ~S\"\"\"", "$0", "\"\"\""] 110 | }, 111 | "doc false": { 112 | "prefix": "docf", 113 | "body": "@doc false" 114 | }, 115 | "moduledoc": { 116 | "prefix": "mdoc", 117 | "body": ["@moduledoc \"\"\"", "$0", "\"\"\""] 118 | }, 119 | "moduledoc s": { 120 | "prefix": "mdocs", 121 | "body": ["@moduledoc ~S\"\"\"", "$0", "\"\"\""] 122 | }, 123 | "moduledoc false": { 124 | "prefix": "mdocf", 125 | "body": "@moduledoc false" 126 | }, 127 | "require": { 128 | "prefix": "req", 129 | "body": "require ${0:Logger}" 130 | }, 131 | "test": { 132 | "prefix": "test", 133 | "body": ["test \"${1:name}\" do", " $0", "end"] 134 | }, 135 | "des": { 136 | "prefix": "desc", 137 | "body": ["describe \"${1:test group subject}\" do", " $0", "end"] 138 | }, 139 | "IEx.pry": { 140 | "prefix": "pry", 141 | "body": ["require IEx; IEx.pry", "$0"] 142 | }, 143 | "pipe char": { 144 | "prefix": "p", 145 | "body": "|> $0" 146 | }, 147 | "pipe into each": { 148 | "prefix": ">e", 149 | "body": "|> Enum.each($0)" 150 | }, 151 | "pipe into map": { 152 | "prefix": ">m", 153 | "body": "|> Enum.map($0)" 154 | }, 155 | "pipe into filter": { 156 | "prefix": ">f", 157 | "body": "|> Enum.filter($0)" 158 | }, 159 | "pipe into reduce": { 160 | "prefix": ">r", 161 | "body": "|> Enum.reduce(${1:acc}, fn ${2}, ${3:acc} -> $0 end)" 162 | }, 163 | "word list": { 164 | "prefix": "wl", 165 | "body": "~w($0)" 166 | }, 167 | "atom list": { 168 | "prefix": "al", 169 | "body": "~w($0)a" 170 | } 171 | } 172 | -------------------------------------------------------------------------------- /snippets/erb.json: -------------------------------------------------------------------------------- 1 | { 2 | "if": { 3 | "prefix": "if", 4 | "body": ["<% if ${1:truevalue} %>", " $2", "<% end %>"], 5 | "description": "if .. end" 6 | }, 7 | "else": { 8 | "prefix": "else", 9 | "body": ["<% else %>"], 10 | "description": "else" 11 | }, 12 | "elsif": { 13 | "prefix": "elsif", 14 | "body": ["<% elsif ${1:truevalue} %>"], 15 | "description": "elsif" 16 | }, 17 | "end": { 18 | "prefix": "end", 19 | "body": ["<% end %>"], 20 | "description": "end" 21 | }, 22 | "ife": { 23 | "prefix": "ife", 24 | "body": [ 25 | "<% if ${1:truevalue} %>", 26 | " $2", 27 | "<% else %>", 28 | " $3", 29 | "<% end %>" 30 | ], 31 | "description": "if .. else .. end" 32 | }, 33 | "unless": { 34 | "prefix": "unless", 35 | "body": ["<% unless ${1:falsevalue} %>", " $2", "<% end %>"], 36 | "description": "unless .. end" 37 | }, 38 | "unlesse": { 39 | "prefix": "unlesse", 40 | "body": [ 41 | "<% unless ${1:falsevalue} %>", 42 | " $2", 43 | "<% else %>", 44 | " $3", 45 | "<% end %>" 46 | ], 47 | "description": "unless .. end" 48 | }, 49 | "each": { 50 | "prefix": "each", 51 | "body": ["<% ${1:items}.each do |${2:item}| %>", " $3", "<% end %>"], 52 | "description": "each do" 53 | }, 54 | "render": { 55 | "prefix": ["pe", "="], 56 | "body": ["<%= $1 %>"], 57 | "description": "render block pe" 58 | }, 59 | "comment": { 60 | "prefix": ["pc"], 61 | "body": ["<%# $1 %>"], 62 | "description": "erb print comment" 63 | }, 64 | "exec": { 65 | "prefix": ["er", "%"], 66 | "body": ["<% $1 %>"], 67 | "description": "erb exec block" 68 | }, 69 | "link_to": { 70 | "prefix": ["lt"], 71 | "body": ["<%= link_to $1, $2 %>"], 72 | "description": "link_to helper" 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /snippets/erlang.json: -------------------------------------------------------------------------------- 1 | { 2 | "module": { 3 | "prefix": "mod", 4 | "body": "-module(${1:module}).", 5 | "description": "module" 6 | }, 7 | "include": { 8 | "prefix": "inc", 9 | "body": "-include(\"${1:hrl_name}.hrl\").", 10 | "description": "module" 11 | }, 12 | "define": { 13 | "prefix": "def", 14 | "body": "-define(${1:def_name}, ${2:def_value}).", 15 | "description": "define" 16 | }, 17 | "export": { 18 | "prefix": "exp", 19 | "body": ["-export([", " ${1}", " ])."], 20 | "description": "export" 21 | }, 22 | "if": { 23 | "prefix": "if", 24 | "body": [ 25 | "if ${1:Cond} ->", 26 | " ${2:todo};", 27 | " true ->", 28 | " ${3:todo}", 29 | "end$4" 30 | ], 31 | "description": "if block" 32 | }, 33 | "case": { 34 | "prefix": "case", 35 | "body": [ 36 | "case ${1:Expr} of", 37 | " ${2:Cond} ->", 38 | " ${3:todo};", 39 | " _ ->", 40 | " ${4:todo}", 41 | "end$5" 42 | ], 43 | "description": "case block" 44 | }, 45 | "receive": { 46 | "prefix": "rec", 47 | "body": [ 48 | "receive", 49 | " ${1:pattern} ->", 50 | " ${2:todo}", 51 | "end$3" 52 | ], 53 | "description": "receive block" 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /snippets/fennel.json: -------------------------------------------------------------------------------- 1 | { 2 | "fn": { 3 | "prefix": "fn", 4 | "body": "(fn ${1:name} [${2:params}]\n )", 5 | "description": "Create a function" 6 | }, 7 | "let": { 8 | "prefix": "let", 9 | "body": "(let [${1:name} ${2:value}])", 10 | "description": "Create a variable" 11 | }, 12 | "while": { 13 | "prefix": "while", 14 | "body": "(while (${1:condition})\n($0))", 15 | "description": "Create a while loop" 16 | }, 17 | "var": { 18 | "prefix": "var", 19 | "body": "(var ${1:name} ${2:value})", 20 | "description": "Create a variable with var" 21 | }, 22 | "local": { 23 | "prefix": "local", 24 | "body": "(local ${1:name} ${2:value})", 25 | "description": "Create a variable with local" 26 | }, 27 | "for": { 28 | "prefix": "for", 29 | "body": "(for [i 1 10]\n($0))", 30 | "description": "Create a for loop" 31 | }, 32 | "global": { 33 | "prefix": "global", 34 | "body": "(global $0)", 35 | "description": "Create a global" 36 | }, 37 | "require": { 38 | "prefix": "require", 39 | "body": "(require :${1:module})", 40 | "description": "Require a module" 41 | }, 42 | "create a table": { 43 | "prefix": "tbl", 44 | "body": "(let [${1:tbl} {}\n\t${2:key1} ${3:key1_value}])", 45 | "description": "Declaring a table" 46 | }, 47 | "set table value": { 48 | "prefix": "tset", 49 | "body": "(tset ${1:tbl} ${2:value})", 50 | "description": "Set a value in a table" 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /snippets/frameworks/angular/html.json: -------------------------------------------------------------------------------- 1 | { 2 | "class": { 3 | "prefix": "a-class", 4 | "body": ["[class]=\"${1:expression}\""], 5 | "description": "Angular [class] binding" 6 | }, 7 | "style": { 8 | "prefix": "a-style", 9 | "body": ["[style.${1:property}]=\"${2:expression}\""], 10 | "description": "Angular [style] binding" 11 | }, 12 | "ngClass": { 13 | "prefix": "a-ngClass", 14 | "body": ["[ngClass]=\"{${1:cssClass}: ${2:expression}}\""], 15 | "description": "Angular ngClass" 16 | }, 17 | "ngFor": { 18 | "prefix": "a-ngFor", 19 | "body": ["*ngFor=\"let ${1:item} of ${2:list}\"${0}"], 20 | "description": "Angular *ngFor" 21 | }, 22 | "ngFor with trackBy": { 23 | "prefix": "a-ngFor-trackBy", 24 | "body": ["*ngFor=\"let ${1:item} of ${2:list}; trackBy:${1:item}.id\"${0}"], 25 | "description": "Angular *ngFor with trackBy" 26 | }, 27 | "ngForAsync": { 28 | "prefix": "a-ngForAsync", 29 | "body": ["*ngFor=\"let ${1:item} of ${2:stream} | async as ${3:list}\"${0}"], 30 | "description": "Angular *ngForAsync" 31 | }, 32 | "ngForm": { 33 | "prefix": "a-form", 34 | "body": ["
", "
"], 35 | "description": "Form with ngSubmit and form attributes" 36 | }, 37 | "ngFormArrayName": { 38 | "prefix": "a-formArrayName", 39 | "body": ["formArrayName=\"${1:control}\""], 40 | "description": "Angular formArrayName" 41 | }, 42 | "ngFormControlName": { 43 | "prefix": "a-formControlName", 44 | "body": ["formControlName=\"${1:control}\""], 45 | "description": "Angular formControlName" 46 | }, 47 | "ngFormGroup": { 48 | "prefix": "a-formGroup", 49 | "body": ["[formGroup]=\"${1:form}\""], 50 | "description": "Angular formGroup" 51 | }, 52 | "ngFormGroupName": { 53 | "prefix": "a-formGroupName", 54 | "body": ["[formGroupName]=\"${1:name}\""], 55 | "description": "Angular formGroupName" 56 | }, 57 | "ngFormSubmit": { 58 | "prefix": "a-form-submit", 59 | "body": [""], 60 | "description": "Angular form submit" 61 | }, 62 | "ngIf": { 63 | "prefix": "a-ngIf", 64 | "body": ["*ngIf=\"${1:expression}\""], 65 | "description": "Angular *ngIf" 66 | }, 67 | "ngIfElse": { 68 | "prefix": "a-ngIfElse", 69 | "body": ["*ngIf=\"${1:expression};else ${2:templateName}\""], 70 | "description": "Angular *ngIfElse" 71 | }, 72 | "ngModel": { 73 | "prefix": "a-ngModel", 74 | "body": ["[(ngModel)]=\"${1:binding}\""], 75 | "description": "Angular ngModel" 76 | }, 77 | "ngRouterLink": { 78 | "prefix": "a-routerLink", 79 | "body": ["[routerLink]=\"['/${1:routePath}']\" routerLinkActive=\"${2:router-link-active}\" $0"], 80 | "description": "Angular routerLink" 81 | }, 82 | "ngRouterLinkWithParameter": { 83 | "prefix": "a-routerLink-param", 84 | "body": [ 85 | "[routerLink]=\"['${1:routePath}', ${2:routeParameterValue}]\"", 86 | "routerLinkActive=\"${3:router-link-active}\"$0" 87 | ], 88 | "description": "Angular routerLink with a route parameter" 89 | }, 90 | "ngSelect": { 91 | "prefix": "a-select", 92 | "body": [ 93 | "" 96 | ], 97 | "description": "