Go to file
Fabjan Sukalia 00ba9dd3df
vhdl: add snippets for conditional assignments, signals, variables, functions, procedures, etc. (#492)
* vhdl.json: more descriptive prefixes for generate snippets

* vhdl.json: add signal declaration snippets

* vhdl.json: add variable and constant snippets

* vhdl.json: add function snippet

* vhdl.json: fix missing comma in function snippet

* vhdl.json: add procedure snippet

* vhdl.json: remove variable section from function and procedure

* vhdl.json: add with select assignment snippet

* vhdl.json: add when-else assignment snippet

* vhdl.json: add missing semicolon to when-else snippet

* vhdl.json: remove semicolon from type snippets without initialiser

Semicolon is not needed in these snippets because they are already contained in the signal, variable and constant snippets. 
Type snippets with initialiser are also not needed any more because initialiser is also contained in the other snippets. They can be deprecated in the future.

* vhdl.json: remove duplicated zeroes snippets

* vhdl.json: add snippet for when alternatives in case statements
2024-09-22 23:25:33 -04:00
.github/workflows ci: remove ci from pull request's 2023-06-14 19:41:32 -03:00
debug debug: Add files to help debug 2023-05-01 00:58:44 -03:00
snippets vhdl: add snippets for conditional assignments, signals, variables, functions, procedures, etc. (#492) 2024-09-22 23:25:33 -04:00
LICENSE modified LICENSE 2021-03-27 17:00:41 -03:00
README.md docs(readme): update github admonition syntax (#422) 2024-03-31 12:49:02 -04:00
package.json Add snippets for cmake (#482) 2024-09-22 23:03:04 -04:00

README.md

Friendly Snippets

Snippets collection for a set of different programming languages.

The only goal is to have one community driven repository for all kinds of snippets in all programming languages, this way you can have it all in one place.

Install

Use your plugin manager of choice, e.g.

With Lazy.nvim

{ "rafamadriz/friendly-snippets" }

[!WARNING] If you're using LuaSnip make sure to use require("luasnip.loaders.from_vscode").lazy_load(), and add friendly-snippets as a dependency for LuaSnip, otherwise snippets might not be detected. If you don't use lazy_load() you might notice a slower startup-time

{
  "L3MON4D3/LuaSnip",
  dependencies = { "rafamadriz/friendly-snippets" },
}

With Packer

use "rafamadriz/friendly-snippets"

With vim-plug

Plug "rafamadriz/friendly-snippets"

With coc.nvim

:CocInstall https://github.com/rafamadriz/friendly-snippets@main

Usage

This collection of snippets should work with any snippet engine that supports loading vscode snippets. Like for example:

Add snippets from a framework to a filetype.

[!NOTE] This is handled by your snippet engine and has nothing to do with this snippets collection

There's extra snippets included in this repo but they are not added by default, since it would be irrelevant for people not using those frameworks. See snippets/frameworks

For example: if you want to add rails snippets to ruby.

With LuaSnip:

require'luasnip'.filetype_extend("ruby", {"rails"})

With vim-vsnip:

let g:vsnip_filetypes.ruby = ['rails']

Excluding snippets

[!NOTE] This is handled by your snippet engine and has nothing to do with this snippets collection

With LuaSnip, see help luasnip-loaders

-- will exclude all javascript snippets
require("luasnip.loaders.from_vscode").load {
    exclude = { "javascript" },
}

Showcase

HTML

HTML gif

JS

JS gif

TODO

  • Add all included snippets to the Wiki.

Thanks to all contributors

Credits

A good portion of the snippets have been forked from the following repositories: