Skip to content

rajasegar/helix-snippets-ls

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

helix-snippets-ls

npm version

Language server for snippets in Helix

This package allows you to add snippets to the Helix editor using a LSP server for autocompleting snippets.

You can define your snippets in a TOML file and use it in Helix.

helix snippets demo

Install

npm i -g helix-snippets-ls

Usage

Create an snippets.toml file inside your Helix config dir ~/.config/helix/snippets.toml

The snippets follow the VSCode snippets standard. Add snippets inside it like:

li = "<li>$0</li>"
img = "<img src=\"$1\" alt=\"$2\" />"
inbx = "<AppInbox abc=\"$1\" xyz=\"$2\">$0</AppInbox>"

# Multiline snippets
for = """for await (const ${1:iterator} of ${2:object}) {
      \t$0
      }"""
sim = "setImmediate(() => {\n\t${0}\n})"

Config

Config your languages.toml to use this Language server

[[language]]
name = "handlebars"
roots = ["package.json"]
file-types = ["hbs"]
scope = "source.hbs"
language-server = { command = "helix-snippets-ls" } 

Known limitations

  • The language server can be only used for one language at a time

Releases

No releases published

Packages

No packages published