Last active
October 5, 2025 13:09
-
-
Save bluss/6fa4bd1fefa4afffcb4d0200075ef1f8 to your computer and use it in GitHub Desktop.
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
| -- A supposedly minimal neovim config for typst: blink.cmp + typst-preview + tinymist | |
| -- | |
| -- 1. Update config below with location where you have tinymist installed. | |
| -- 2. Test this configuration using NVIM_APPNAME=typstminimal nvim -u minimalconfig.lua | |
| -- 3. Run this on first run: | |
| -- :TSInstall markdown typst | |
| -- | |
| -- Since it's a minimal config, it will have default keybindings like | |
| -- K for documentation hover | |
| -- ^X ^O for omnicomplete and ^y for completion insert | |
| -- | |
| -- Use :lua vim.diagnostic.open_float() to open diagnostics float | |
| -- lazy.nvim setup | |
| local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" | |
| if not vim.uv.fs_stat(lazypath) then | |
| vim.fn.system({ | |
| "git", | |
| "clone", | |
| "--filter=blob:none", | |
| "https://github.com/folke/lazy.nvim.git", | |
| "--branch=stable", -- latest stable release | |
| lazypath, | |
| }) | |
| end | |
| vim.opt.rtp:prepend(lazypath) | |
| -- Use a protected call so we don't error out on first use | |
| local ok, lazy = pcall(require, "lazy") | |
| if not ok then | |
| return | |
| end | |
| -- We have to set the leader key here for lazy.nvim to work | |
| vim.g.mapleader = " " | |
| vim.g.maplocalleader = " " | |
| local tinymist_bin = vim.fn.expand("~/.local/share/nvim/mason/bin/tinymist") | |
| -- Load plugins from specifications | |
| lazy.setup({ | |
| {"nvim-treesitter/nvim-treesitter", branch = 'master', lazy = false, build = ":TSUpdate"}, | |
| { | |
| 'saghen/blink.cmp', | |
| version = "1.*", | |
| opts = { | |
| completion = { | |
| accept = { | |
| auto_brackets = { enabled = false }, | |
| }, | |
| }, | |
| }, | |
| }, | |
| { | |
| "chomosuke/typst-preview.nvim", | |
| ft = "typst", | |
| opts = { | |
| dependencies_bin = { tinymist = tinymist_bin }, | |
| }, | |
| } | |
| }) | |
| -- LSP config | |
| vim.lsp.config["tinymist"] = { | |
| cmd = { tinymist_bin }, | |
| filetypes = { "typst" }, | |
| settings = { | |
| formatterMode = "typstyle", | |
| }, | |
| } | |
| vim.lsp.enable "tinymist" | |
| -- show diagnostics in a crude way | |
| vim.diagnostic.config({virtual_lines = true }) | |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Tested with neovim 0.11.4