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.o.clipboard = "unnamedplus"
vim.filetype.add({ vim.filetype.add({
pattern = { [".*/hypr/.*%.conf"] = "hyprlang" }, pattern = {
[".*/hypr/.*%.conf"] = "hyprlang",
[".*%.typ"] = "typst",
},
}) })
require("plugins") require("plugins")
--vim.o.cmdheight = 0
vim.cmd([[ vim.cmd([[
highlight Normal guibg=none ctermbg=none highlight Normal guibg=none ctermbg=none

View file

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

View file

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

View file

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

View file

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