Skip to content

Commit

Permalink
config(nvim): support typst
Browse files Browse the repository at this point in the history
  • Loading branch information
haunt98 committed Oct 21, 2024
1 parent ca47de3 commit cc9eabd
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 24 deletions.
37 changes: 15 additions & 22 deletions data/nvim/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,7 @@ require("lazy").setup({
"sh",
"sql",
"toml",
"typst",
"yaml",
"zsh",
},
Expand All @@ -474,6 +475,7 @@ require("lazy").setup({
sh = { "shfmt" },
sql = { "sqlfluff" },
toml = { "trim_whitespace", "taplo" },
typst = { "typstyle" },
yaml = { "prettier" },
zsh = { "shfmt" },
},
Expand Down Expand Up @@ -521,6 +523,7 @@ require("lazy").setup({
"python",
"query",
"toml",
"typst",
"vim",
"vimdoc",
},
Expand Down Expand Up @@ -556,6 +559,7 @@ require("lazy").setup({
"go",
"markdown",
"python",
"typst",
},
dependencies = {
"hrsh7th/nvim-cmp",
Expand All @@ -571,26 +575,16 @@ require("lazy").setup({
-- Go
-- https://github.com/golang/tools/blob/master/gopls/doc/vim.md
-- https://github.com/golang/tools/blob/master/gopls/doc/settings.md
-- https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#gopls
-- https://github.com/neovim/nvim-lspconfig/blob/master/doc/configs.md#gopls
-- https://github.com/neovim/nvim-lspconfig/issues/2542
lspconfig.gopls.setup({
capabilities = capabilities,
on_init = function(client, initialization_result)
if client.server_capabilities then
client.server_capabilities.semanticTokensProvider = nil
end
end,
})

-- Python
-- https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#pyright
-- https://github.com/neovim/nvim-lspconfig/blob/master/doc/configs.md#pyright
lspconfig.pyright.setup({
capabilities = capabilities,
on_init = function(client, initialization_result)
if client.server_capabilities then
client.server_capabilities.semanticTokensProvider = nil
end
end,
settings = {
pyright = {
-- Conflicts with Ruff
Expand All @@ -606,11 +600,10 @@ require("lazy").setup({
})

-- https://docs.astral.sh/ruff/editors/setup/#neovim
-- https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#ruff
-- https://github.com/neovim/nvim-lspconfig/blob/master/doc/configs.md#ruff
lspconfig.ruff.setup({
on_init = function(client, initialization_result)
if client.server_capabilities then
client.server_capabilities.semanticTokensProvider = nil
-- Conflicts with pyright
client.server_capabilities.hoverProvider = false
end
Expand All @@ -619,14 +612,13 @@ require("lazy").setup({

-- Markdown
-- https://github.com/artempyanykh/marksman
-- https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#marksman
lspconfig.marksman.setup({
on_init = function(client, initialization_result)
if client.server_capabilities then
client.server_capabilities.semanticTokensProvider = nil
end
end,
})
-- https://github.com/neovim/nvim-lspconfig/blob/master/doc/configs.md#marksman
lspconfig.marksman.setup({})

-- Typst
-- https://github.com/Myriad-Dreamin/tinymist
-- https://github.com/neovim/nvim-lspconfig/blob/master/doc/configs.md#tinymist
lspconfig.tinymist.setup({})

-- General
vim.keymap.set("n", "<Space>e", vim.diagnostic.open_float)
Expand Down Expand Up @@ -685,6 +677,7 @@ require("lazy").setup({
"proto",
"python",
"toml",
"typst",
"yaml",
"zsh",
},
Expand Down
5 changes: 3 additions & 2 deletions scripts/brew_init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ brew install \
fdupes rsync rclone restic wcurl ncdu \
tlrc vivid zellij totp-cli \
yt-dlp newsboat vips btop \
fnm oven-sh/bun/bun deno uv just \
stylua taplo typos-cli clang-format marksman asciidoctor ollama gitleaks gh glab \
fnm oven-sh/bun/bun deno uv \
just typst asciidoctor clang-format stylua taplo typos-cli typstyle marksman tinymist \
ollama gitleaks gh glab \
qmk/qmk/qmk daktilo \
redis mysql-client

0 comments on commit cc9eabd

Please sign in to comment.