MIT License

项目介绍

rafamadriz/friendly-snippets 是一个托管在 GitHub 上的开源项目,主要使用 Lua 编写,采用 MIT License 许可证,目前获得 2.8k 个 Star、567 次 Fork。

仓库全名
rafamadriz/friendly-snippets
开源许可证
MIT License
Star 数
2.8k
Fork 数
567
未关闭 Issue
56

README 摘要

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 [!WARNING] If you're using LuaSnip make sure to use require("luasnip.loaders.fromvscode").lazyload(), and add…

完整内容见 GitHub 原始 README 或本页 。

常见问题

friendly-snippets 用什么语言开发?

主要使用 Lua 编写,采用 MIT License 许可证,目前有 2.8k 个 Star。

friendly-snippets 可以免费商用吗?

仓库采用 MIT License 许可证,可免费使用与修改,商业使用请遵守许可证条款(例如保留版权声明与许可声明)。

如何获取 friendly-snippets 的源码?

可以直接克隆仓库:git clone https://github.com/rafamadriz/friendly-snippets.git,默认分支为 main;安装与运行步骤见仓库 README。

friendly-snippets 最近还在维护吗?

仓库最近一次更新为 1 周前,当前有 56 个未关闭 Issue;Star 数为 2.8k,可作为社区活跃度的参考。

简要分析

热度分
3935
价值分
1841
活跃状态
活跃

语言占比

JavaScript
Lua
Makefile

README

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:

评论

暂无评论