feat: add typst lsp

This commit is contained in:
Nydragon 2024-10-20 20:41:04 +00:00
parent d7b1584fdd
commit d62a59904a
Signed by: nydragon
SSH key fingerprint: SHA256:WcjW5NJPQ8Dx4uQDmoIlVPLWE27Od3fxoe0IUvuoPHE
5 changed files with 20 additions and 6 deletions

View file

@ -61,11 +61,13 @@ vim.g.mapleader = " "
vim.o.clipboard = "unnamedplus"
vim.filetype.add({
pattern = { [".*/hypr/.*%.conf"] = "hyprlang" },
pattern = {
[".*/hypr/.*%.conf"] = "hyprlang",
[".*%.typ"] = "typst",
},
})
require("plugins")
--vim.o.cmdheight = 0
vim.cmd([[
highlight Normal guibg=none ctermbg=none

View file

@ -88,6 +88,14 @@ local function build()
sh = {
require("formatter.filetypes.sh").shfmt,
},
typst = {
function()
return {
exe = "typstyle",
args = { "--inplace" },
}
end,
},
["*"] = {
require("formatter.filetypes.any").remove_trailing_whitespace,
},

View file

@ -13,8 +13,8 @@ cmp.setup({
},
mapping = {
-- Add tab support
["<Up>"] = cmp.mapping.select_prev_item(),
["<Down>"] = cmp.mapping.select_next_item(),
["<S-Tab>"] = cmp.mapping.select_prev_item(),
["<Tab>"] = cmp.mapping.select_next_item(),
["<C-S-f>"] = cmp.mapping.scroll_docs(-4),
["<C-f>"] = cmp.mapping.scroll_docs(4),
["<C-Space>"] = cmp.mapping.complete(),

View file

@ -34,3 +34,7 @@ lspconfig.bashls.setup({})
lspconfig.zls.setup({})
lspconfig.ts_ls.setup({})
lspconfig.tinymist.setup({
single_file_support = true,
})

View file

@ -1,4 +1,4 @@
{ pkgs, lib, ... }:
{ pkgs, lib ... }:
let
deps = with pkgs; [
lua
@ -46,7 +46,7 @@ pkgs.writeTextFile {
#!${pkgs.bash}/bin/bash
export PATH=${lib.makeBinPath deps}:$PATH
export LUA_PATH=${../.}/lua/?.lua
${pkgs.neovim}/bin/nvim -u ${../.}/init.lua $@
${pkgs.neovim-unwrapped}/bin/nvim -u ${../.}/init.lua $@
'';
checkPhase = ''
${pkgs.stdenv.shellDryRun} "$target"