From acbb580bd7d7c1b5913fbe2aa5fcdc4675c51de3 Mon Sep 17 00:00:00 2001
From: arne314 <73391160+arne314@users.noreply.github.com>
Date: Sun, 20 Jul 2025 22:58:18 +0200
Subject: [PATCH] docs: lazy.nvim example config
---
README.md | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 61 insertions(+)
diff --git a/README.md b/README.md
index 5a4aafd..5488179 100644
--- a/README.md
+++ b/README.md
@@ -84,6 +84,67 @@ require('typstar').setup({ -- depending on your neovim plugin system
})
```
+
+Example lazy.nvim config
+
+```lua
+{
+ "arne314/typstar",
+ dependencies = {
+ "L3MON4D3/LuaSnip",
+ },
+ ft = { "typst" },
+ keys = {
+ {
+ "",
+ "TypstarToggleSnippets",
+ mode = { "n", "i" },
+ },
+ {
+ "",
+ "TypstarSmartJump",
+ mode = { "s", "i" },
+ },
+ {
+ "",
+ "TypstarSmartJumpBack",
+ mode = { "s", "i" },
+ },
+ },
+ config = function()
+ local typstar = require("typstar")
+ typstar.setup({
+ -- your typstar configuration
+ add_undo_breakpoints = true,
+ })
+ end,
+},
+{
+ "L3MON4D3/LuaSnip",
+ version = "v2.*",
+ build = "make install_jsregexp",
+ config = function()
+ local luasnip = require("luasnip")
+ luasnip.config.setup({
+ enable_autosnippets = true,
+ store_selection_keys = "",
+ })
+ end,
+},
+{
+ "nvim-treesitter/nvim-treesitter",
+ build = ":TSUpdate",
+ lazy = false,
+ config = function()
+ local configs = require("nvim-treesitter.configs")
+ configs.setup({
+ ensure_installed = { "typst" },
+ })
+ end,
+},
+```
+
+
### Snippets
1. Install [LuaSnip](https://github.com/L3MON4D3/LuaSnip/), set `enable_autosnippets = true` and set a visual mode selection key (e.g. `store_selection_keys = ''`) in the configuration
2. Install [jsregexp](https://github.com/kmarius/jsregexp) as described [here](https://github.com/L3MON4D3/LuaSnip/blob/master/DOC.md#transformations) (You will see a warning on startup if jsregexp isn't installed properly)