mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-08-19 08:48:21 +02:00
Merge branch 'main' into lang/typst
This commit is contained in:
commit
c352553069
74 changed files with 886 additions and 1242 deletions
|
@ -57,4 +57,15 @@ return {
|
|||
})
|
||||
end,
|
||||
},
|
||||
|
||||
-- formatting
|
||||
{
|
||||
"conform.nvim",
|
||||
opts = function(_, opts)
|
||||
if LazyVim.has_extra("formatting.prettier") then
|
||||
opts.formatters_by_ft = opts.formatters_by_ft or {}
|
||||
opts.formatters_by_ft.htmlangular = { "prettier" }
|
||||
end
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
|
|
@ -17,7 +17,7 @@ return {
|
|||
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = { ensure_installed = { "astro" } },
|
||||
opts = { ensure_installed = { "astro", "css" } },
|
||||
},
|
||||
|
||||
-- LSP Servers
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
return {
|
||||
recommended = function()
|
||||
return LazyVim.extras.wants({
|
||||
ft = { "elixir", "eelixir", "heex", "surface" },
|
||||
ft = { "elixir", "eelixir", "heex", "surface", "livebook" },
|
||||
root = "mix.exs",
|
||||
})
|
||||
end,
|
||||
|
@ -40,7 +40,11 @@ return {
|
|||
},
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = { ensure_installed = { "elixir", "heex", "eex" } },
|
||||
opts = function(_, opts)
|
||||
opts.ensure_installed = opts.ensure_installed or {}
|
||||
vim.list_extend(opts.ensure_installed, { "elixir", "heex", "eex" })
|
||||
vim.treesitter.language.register("markdown", "livebook")
|
||||
end,
|
||||
},
|
||||
{
|
||||
"nvim-neotest/neotest",
|
||||
|
@ -85,4 +89,11 @@ return {
|
|||
}
|
||||
end,
|
||||
},
|
||||
{
|
||||
"MeanderingProgrammer/render-markdown.nvim",
|
||||
optional = true,
|
||||
ft = function(_, ft)
|
||||
vim.list_extend(ft, { "livebook" })
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
-- This is the same as in lspconfig.server_configurations.jdtls, but avoids
|
||||
-- This is the same as in lspconfig.configs.jdtls, but avoids
|
||||
-- needing to require that when this module loads.
|
||||
local java_filetypes = { "java" }
|
||||
|
||||
|
@ -76,7 +76,7 @@ return {
|
|||
return {
|
||||
-- How to find the root dir for a given filename. The default comes from
|
||||
-- lspconfig which provides a function specifically for java projects.
|
||||
root_dir = require("lspconfig.server_configurations.jdtls").default_config.root_dir,
|
||||
root_dir = LazyVim.lsp.get_raw_config("jdtls").default_config.root_dir,
|
||||
|
||||
-- How to find the project name for a given root dir.
|
||||
project_name = function(root_dir)
|
||||
|
|
|
@ -17,7 +17,7 @@ return {
|
|||
--
|
||||
-- false to disable, otherwise should be a table of options to pass to `leanls`
|
||||
--
|
||||
-- See https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#leanls for details.
|
||||
-- See https://github.com/neovim/nvim-lspconfig/blob/master/doc/configs.md#leanls for details.
|
||||
-- In particular ensure you have followed instructions setting up a callback
|
||||
-- for `LspAttach` which sets your key bindings!
|
||||
lsp = {
|
||||
|
|
|
@ -95,7 +95,6 @@ return {
|
|||
{
|
||||
"MeanderingProgrammer/render-markdown.nvim",
|
||||
opts = {
|
||||
file_types = { "markdown", "norg", "rmd", "org" },
|
||||
code = {
|
||||
sign = false,
|
||||
width = "block",
|
||||
|
@ -109,7 +108,7 @@ return {
|
|||
ft = { "markdown", "norg", "rmd", "org" },
|
||||
config = function(_, opts)
|
||||
require("render-markdown").setup(opts)
|
||||
LazyVim.toggle.map("<leader>um", {
|
||||
Snacks.toggle({
|
||||
name = "Render Markdown",
|
||||
get = function()
|
||||
return require("render-markdown.state").enabled
|
||||
|
@ -122,7 +121,7 @@ return {
|
|||
m.disable()
|
||||
end
|
||||
end,
|
||||
})
|
||||
}):map("<leader>um")
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
|
|
@ -12,23 +12,6 @@ return {
|
|||
},
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
dependencies = {
|
||||
{ "nushell/tree-sitter-nu" },
|
||||
},
|
||||
opts = function(_, opts)
|
||||
---@diagnostic disable-next-line: inject-field
|
||||
require("nvim-treesitter.parsers").get_parser_configs().nu = {
|
||||
install_info = {
|
||||
url = "https://github.com/nushell/tree-sitter-nu",
|
||||
files = { "src/parser.c" },
|
||||
branch = "main",
|
||||
},
|
||||
filetype = "nu",
|
||||
}
|
||||
|
||||
if type(opts.ensure_installed) == "table" then
|
||||
vim.list_extend(opts.ensure_installed, { "nu" })
|
||||
end
|
||||
end,
|
||||
opts = { ensure_installed = { "nu" } },
|
||||
},
|
||||
}
|
||||
|
|
|
@ -18,9 +18,14 @@ return {
|
|||
opts = {
|
||||
servers = {
|
||||
ocamllsp = {
|
||||
get_language_id = function(_, ftype)
|
||||
return language_id_of[ftype]
|
||||
end,
|
||||
filetypes = {
|
||||
"ocaml",
|
||||
"ocaml.menhir",
|
||||
"ocaml.interface",
|
||||
"ocaml.ocamllex",
|
||||
"reason",
|
||||
"dune",
|
||||
},
|
||||
root_dir = function(fname)
|
||||
return require("lspconfig.util").root_pattern(
|
||||
"*.opam",
|
||||
|
|
|
@ -52,8 +52,10 @@ return {
|
|||
keys = {
|
||||
{
|
||||
"gd",
|
||||
function()
|
||||
LazyVim.has("telescope.nvim") and function()
|
||||
require("omnisharp_extended").telescope_lsp_definitions()
|
||||
end or function()
|
||||
require("omnisharp_extended").lsp_definitions()
|
||||
end,
|
||||
desc = "Goto Definition",
|
||||
},
|
||||
|
|
|
@ -133,6 +133,7 @@ return {
|
|||
|
||||
{
|
||||
"hrsh7th/nvim-cmp",
|
||||
optional = true,
|
||||
opts = function(_, opts)
|
||||
opts.auto_brackets = opts.auto_brackets or {}
|
||||
table.insert(opts.auto_brackets, "python")
|
||||
|
|
|
@ -22,6 +22,7 @@ return {
|
|||
local wk = require("which-key")
|
||||
wk.add({
|
||||
buffer = true,
|
||||
mode = { "n", "v" },
|
||||
{ "<localleader>a", group = "all" },
|
||||
{ "<localleader>b", group = "between marks" },
|
||||
{ "<localleader>c", group = "chunks" },
|
||||
|
|
20
lua/lazyvim/plugins/extras/lang/rego.lua
Normal file
20
lua/lazyvim/plugins/extras/lang/rego.lua
Normal file
|
@ -0,0 +1,20 @@
|
|||
return {
|
||||
recommended = {
|
||||
ft = "rego",
|
||||
},
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
opts = {
|
||||
servers = {
|
||||
regols = {},
|
||||
regal = {},
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = {
|
||||
ensure_installed = { "rego" },
|
||||
},
|
||||
},
|
||||
}
|
|
@ -36,7 +36,10 @@ return {
|
|||
enabled = lsp == "solargraph",
|
||||
},
|
||||
rubocop = {
|
||||
enabled = formatter == "rubocop",
|
||||
-- If Solargraph and Rubocop are both enabled as an LSP,
|
||||
-- diagnostics will be duplicated because Solargraph
|
||||
-- already calls Rubocop if it is installed
|
||||
enabled = formatter == "rubocop" and lsp ~= "solargraph",
|
||||
},
|
||||
standardrb = {
|
||||
enabled = formatter == "standardrb",
|
||||
|
@ -64,7 +67,7 @@ return {
|
|||
opts = {
|
||||
formatters_by_ft = {
|
||||
ruby = { formatter },
|
||||
eruby = { "erb-format" },
|
||||
eruby = { "erb_format" },
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
|
@ -6,25 +6,23 @@ return {
|
|||
})
|
||||
end,
|
||||
|
||||
-- Extend auto completion
|
||||
-- LSP for Cargo.toml
|
||||
{
|
||||
"hrsh7th/nvim-cmp",
|
||||
dependencies = {
|
||||
{
|
||||
"Saecki/crates.nvim",
|
||||
event = { "BufRead Cargo.toml" },
|
||||
opts = {
|
||||
completion = {
|
||||
cmp = { enabled = true },
|
||||
},
|
||||
"Saecki/crates.nvim",
|
||||
event = { "BufRead Cargo.toml" },
|
||||
opts = {
|
||||
completion = {
|
||||
crates = {
|
||||
enabled = true,
|
||||
},
|
||||
},
|
||||
lsp = {
|
||||
enabled = true,
|
||||
actions = true,
|
||||
completion = true,
|
||||
hover = true,
|
||||
},
|
||||
},
|
||||
---@param opts cmp.ConfigSchema
|
||||
opts = function(_, opts)
|
||||
opts.sources = opts.sources or {}
|
||||
table.insert(opts.sources, { name = "crates" })
|
||||
end,
|
||||
},
|
||||
|
||||
-- Add Rust & related to treesitter
|
||||
|
@ -42,7 +40,7 @@ return {
|
|||
|
||||
{
|
||||
"mrcjkb/rustaceanvim",
|
||||
version = "^4", -- Recommended
|
||||
version = vim.fn.has("nvim-0.10.0") == 0 and "^4" or false,
|
||||
ft = { "rust" },
|
||||
opts = {
|
||||
server = {
|
||||
|
@ -94,21 +92,7 @@ return {
|
|||
"neovim/nvim-lspconfig",
|
||||
opts = {
|
||||
servers = {
|
||||
taplo = {
|
||||
keys = {
|
||||
{
|
||||
"K",
|
||||
function()
|
||||
if vim.fn.expand("%:t") == "Cargo.toml" and require("crates").popup_available() then
|
||||
require("crates").show_popup()
|
||||
else
|
||||
vim.lsp.buf.hover()
|
||||
end
|
||||
end,
|
||||
desc = "Show Crate Documentation",
|
||||
},
|
||||
},
|
||||
},
|
||||
rust_analyzer = { enabled = false },
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
|
@ -34,6 +34,13 @@ return {
|
|||
end,
|
||||
desc = "Metals compile cascade",
|
||||
},
|
||||
{
|
||||
"<leader>mh",
|
||||
function()
|
||||
require("metals").hover_worksheet()
|
||||
end,
|
||||
desc = "Metals hover worksheet",
|
||||
},
|
||||
},
|
||||
init_options = {
|
||||
statusBarProvider = "off",
|
||||
|
|
|
@ -28,7 +28,7 @@ return {
|
|||
},
|
||||
setup = {
|
||||
tailwindcss = function(_, opts)
|
||||
local tw = require("lspconfig.server_configurations.tailwindcss")
|
||||
local tw = LazyVim.lsp.get_raw_config("tailwindcss")
|
||||
opts.filetypes = opts.filetypes or {}
|
||||
|
||||
-- Add default filetypes
|
||||
|
@ -59,6 +59,7 @@ return {
|
|||
},
|
||||
{
|
||||
"hrsh7th/nvim-cmp",
|
||||
optional = true,
|
||||
dependencies = {
|
||||
{ "roobert/tailwindcss-colorizer-cmp.nvim", opts = {} },
|
||||
},
|
||||
|
|
|
@ -29,6 +29,7 @@ return {
|
|||
opts = function(_, opts)
|
||||
local null_ls = require("null-ls")
|
||||
opts.sources = vim.list_extend(opts.sources or {}, {
|
||||
null_ls.builtins.formatting.packer,
|
||||
null_ls.builtins.formatting.terraform_fmt,
|
||||
null_ls.builtins.diagnostics.terraform_validate,
|
||||
})
|
||||
|
@ -49,6 +50,7 @@ return {
|
|||
optional = true,
|
||||
opts = {
|
||||
formatters_by_ft = {
|
||||
hcl = { "packer_fmt" },
|
||||
terraform = { "terraform_fmt" },
|
||||
tf = { "terraform_fmt" },
|
||||
["terraform-vars"] = { "terraform_fmt" },
|
||||
|
@ -58,9 +60,10 @@ return {
|
|||
{
|
||||
"nvim-telescope/telescope.nvim",
|
||||
optional = true,
|
||||
dependencies = {
|
||||
specs = {
|
||||
{
|
||||
"ANGkeith/telescope-terraform-doc.nvim",
|
||||
ft = { "terraform", "hcl" },
|
||||
config = function()
|
||||
LazyVim.on_load("telescope.nvim", function()
|
||||
require("telescope").load_extension("terraform_doc")
|
||||
|
@ -69,6 +72,7 @@ return {
|
|||
},
|
||||
{
|
||||
"cappyzawa/telescope-terraform.nvim",
|
||||
ft = { "terraform", "hcl" },
|
||||
config = function()
|
||||
LazyVim.on_load("telescope.nvim", function()
|
||||
require("telescope").load_extension("terraform")
|
||||
|
|
|
@ -30,7 +30,7 @@ return {
|
|||
vim.g.vimtex_quickfix_method = vim.fn.executable("pplatex") == 1 and "pplatex" or "latexlog"
|
||||
end,
|
||||
keys = {
|
||||
{ "<localLeader>l", "", desc = "+vimtext" },
|
||||
{ "<localLeader>l", "", desc = "+vimtex" },
|
||||
},
|
||||
},
|
||||
|
||||
|
|
|
@ -19,9 +19,14 @@ return {
|
|||
opts = {
|
||||
-- make sure mason installs the server
|
||||
servers = {
|
||||
--- @deprecated -- tsserver renamed to ts_ls but not yet released, so keep this for now
|
||||
--- the proper approach is to check the nvim-lspconfig release version when it's released to determine the server name dynamically
|
||||
tsserver = {
|
||||
enabled = false,
|
||||
},
|
||||
ts_ls = {
|
||||
enabled = false,
|
||||
},
|
||||
vtsls = {
|
||||
-- explicitly add default filetypes, so that we can extend
|
||||
-- them in related extras
|
||||
|
@ -114,10 +119,16 @@ return {
|
|||
},
|
||||
},
|
||||
setup = {
|
||||
--- @deprecated -- tsserver renamed to ts_ls but not yet released, so keep this for now
|
||||
--- the proper approach is to check the nvim-lspconfig release version when it's released to determine the server name dynamically
|
||||
tsserver = function()
|
||||
-- disable tsserver
|
||||
return true
|
||||
end,
|
||||
ts_ls = function()
|
||||
-- disable tsserver
|
||||
return true
|
||||
end,
|
||||
vtsls = function(_, opts)
|
||||
LazyVim.lsp.on_attach(function(client, buffer)
|
||||
client.commands["_typescript.moveToFileRefactoring"] = function(command, ctx)
|
||||
|
|
|
@ -11,7 +11,7 @@ return {
|
|||
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = { ensure_installed = { "vue" } },
|
||||
opts = { ensure_installed = { "vue", "css" } },
|
||||
},
|
||||
|
||||
-- Add LSP servers
|
||||
|
|
32
lua/lazyvim/plugins/extras/lang/zig.lua
Normal file
32
lua/lazyvim/plugins/extras/lang/zig.lua
Normal file
|
@ -0,0 +1,32 @@
|
|||
return {
|
||||
recommended = function()
|
||||
return LazyVim.extras.wants({
|
||||
ft = { "zig", "zir" },
|
||||
root = { "zls.json", "build.zig" },
|
||||
})
|
||||
end,
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = { ensure_installed = { "zig" } },
|
||||
},
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
opts = {
|
||||
servers = {
|
||||
zls = {},
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"nvim-neotest/neotest",
|
||||
optional = true,
|
||||
dependencies = {
|
||||
"lawrence-laz/neotest-zig",
|
||||
},
|
||||
opts = {
|
||||
adapters = {
|
||||
["neotest-zig"] = {},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue