Last active
November 8, 2021 17:47
-
-
Save AlixShahid/54d728ade6d40741eea7df3d6adbb59e to your computer and use it in GitHub Desktop.
Medium-Setting Up Neovim for Web Development - 9
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| local ls = require("luasnip") | |
| -- some shorthands... | |
| local s = ls.snippet | |
| local sn = ls.snippet_node | |
| local t = ls.text_node | |
| local i = ls.insert_node | |
| local f = ls.function_node | |
| local c = ls.choice_node | |
| local d = ls.dynamic_node | |
| -- Every unspecified option will be set to the default. | |
| ls.config.set_config({ | |
| history = true, | |
| -- Update more often, :h events for more info. | |
| updateevents = "TextChanged,TextChangedI", | |
| }) | |
| ls.snippets = { | |
| all = { | |
| }, | |
| html = { | |
| }, | |
| } | |
| -- enable html snippets in javascript/javascript(REACT) | |
| ls.snippets.javascript = ls.snippets.html | |
| ls.snippets.javascriptreact = ls.snippets.html | |
| ls.snippets.typescriptreact = ls.snippets.html | |
| require("luasnip/loaders/from_vscode").load({include = {"html"}}) | |
| -- You can also use lazy loading so you only get in memory snippets of languages you use | |
| require'luasnip/loaders/from_vscode'.lazy_load() |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Setting Up Neovim for Web Development
https://xlwe.medium.com/setting-up-neovim-for-web-development-70c57c3d7d61