mirror of
https://github.com/Ascyii/typstar.git
synced 2026-01-01 05:24:24 -05:00
docs: markup snippets
This commit is contained in:
13
README.md
13
README.md
@@ -12,13 +12,20 @@ Neovim plugin for efficient note taking in Typst
|
||||
Use `:TypstarToggleSnippets` to toggle all snippets at any time.
|
||||
Available snippets can mostly be intuitively derived from [here](././lua/typstar/snippets), they include:
|
||||
|
||||
Markup snippets:
|
||||
- Begin inline math with `ll` and multiline math with `dm`
|
||||
- [Markup shorthands](./lua/typstar/snippets/markup.lua) (e.g. `HIG` → `#highlight[<cursor>]`, `IMP` → `$=>$ `)
|
||||
- [ctheorems shorthands](./lua/typstar/snippets/markup.lua) (e.g. `tem` → empty theorem, `exa` → empty example)
|
||||
- [Flashcards](#anki): `fla` and `flA`
|
||||
- All above snippets support visual mode via the [selection key](#installation)
|
||||
|
||||
Math snippets:
|
||||
- [Many shorthands](./lua/typstar/snippets/math.lua) for mathematical expressions
|
||||
- Alphanumeric characters: `:<char>` → `$<char>$ ` in markup (e.g. `:X` → `$X$ `, `:5` → `$5$ `)
|
||||
- Greek letters: `;<latin>` → `<greek>` in math and `$<greek>$ ` in markup (e.g. `;a` → `alpha`/`$alpha$ `)
|
||||
- Common indices (numbers and letters `i-n`): `<letter><index>` → `<letter>_<index>` in math and `$<letter>$<index> ` → `$<letter>_<index>$ ` in markup (e.g `A314` → `A_314`, `$alpha$n ` → `$alpha_n$ `)
|
||||
- Wrapping of any mathematical expression (see [operations](./lua/typstar/snippets/visual.lua), works nested, multiline and in visual mode via the [selection key](#installation)): `<expression><operation>` → `<operation>(<expression>)` (e.g. `(a^2+b^2)rt` → `sqrt(a^2+b^2)`, `lambdatd` → `tilde(lambda)`, `(1+1)sQ` → `[1+1]`, `(1+1)sq` → `[(1+1)]`)
|
||||
- Matrices: `<size>ma` and `<size>lma` (e.g. `23ma` → 2x3 matrix)
|
||||
- [ctheorems shorthands](./lua/typstar/snippets/document.lua) (e.g. `tem` → empty theorem, `exa` → empty example)
|
||||
- [Many shorthands](./lua/typstar/snippets/math.lua) for mathematical expressions
|
||||
|
||||
Note that you can enable and disable collections of snippets in the [config](#configuration).
|
||||
|
||||
@@ -74,7 +81,7 @@ require('typstar').setup({
|
||||
1. Install [LuaSnip](https://github.com/L3MON4D3/LuaSnip/), set `enable_autosnippets = true` and set a visual mode selection key (e.g. `store_selection_keys = '<Tab>'`) in the configuration
|
||||
2. Install [jsregexp](https://github.com/kmarius/jsregexp) as described [here](https://github.com/L3MON4D3/LuaSnip/blob/master/DOC.md#transformations) (running `:lua require('jsregexp')` in nvim should not result in an error)
|
||||
3. Install [nvim-treesitter](https://github.com/nvim-treesitter/nvim-treesitter) and run `:TSInstall typst`
|
||||
4. Optional: Setup [ctheorems](https://typst.app/universe/package/ctheorems/) with names like [here](./lua/typstar/snippets/document.lua)
|
||||
4. Optional: Setup [ctheorems](https://typst.app/universe/package/ctheorems/) with names like [here](./lua/typstar/snippets/markup.lua)
|
||||
|
||||
### Excalidraw
|
||||
1. Install [Obsidian](https://obsidian.md/) and create a vault in your typst note taking directory
|
||||
|
||||
Reference in New Issue
Block a user