mirror of
https://github.com/LazyVim/LazyVim.git
synced 2026-07-25 14:01:06 +00:00
Merge branch 'main' into fix/extra-lang-angular-treesitter
This commit is contained in:
commit
5585e4975c
12 changed files with 57 additions and 75 deletions
|
|
@ -33,6 +33,9 @@ local defaults = {
|
||||||
misc = {
|
misc = {
|
||||||
dots = "",
|
dots = "",
|
||||||
},
|
},
|
||||||
|
ft = {
|
||||||
|
octo = "",
|
||||||
|
},
|
||||||
dap = {
|
dap = {
|
||||||
Stopped = { " ", "DiagnosticWarn", "DapStoppedLine" },
|
Stopped = { " ", "DiagnosticWarn", "DapStoppedLine" },
|
||||||
Breakpoint = " ",
|
Breakpoint = " ",
|
||||||
|
|
|
||||||
|
|
@ -134,6 +134,7 @@ map("n", "<leader>ub", function() LazyVim.toggle("background", false, {"light",
|
||||||
map("n", "<leader>gg", function() LazyVim.lazygit( { cwd = LazyVim.root.git() }) end, { desc = "Lazygit (Root Dir)" })
|
map("n", "<leader>gg", function() LazyVim.lazygit( { cwd = LazyVim.root.git() }) end, { desc = "Lazygit (Root Dir)" })
|
||||||
map("n", "<leader>gG", function() LazyVim.lazygit() end, { desc = "Lazygit (cwd)" })
|
map("n", "<leader>gG", function() LazyVim.lazygit() end, { desc = "Lazygit (cwd)" })
|
||||||
map("n", "<leader>gb", LazyVim.lazygit.blame_line, { desc = "Git Blame Line" })
|
map("n", "<leader>gb", LazyVim.lazygit.blame_line, { desc = "Git Blame Line" })
|
||||||
|
map("n", "<leader>gB", LazyVim.lazygit.browse, { desc = "Git Browse" })
|
||||||
|
|
||||||
map("n", "<leader>gf", function()
|
map("n", "<leader>gf", function()
|
||||||
local git_path = vim.api.nvim_buf_get_name(0)
|
local git_path = vim.api.nvim_buf_get_name(0)
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,7 @@ return {
|
||||||
}
|
}
|
||||||
end,
|
end,
|
||||||
keys = {
|
keys = {
|
||||||
|
{ "<leader>a", "", desc = "+ai" },
|
||||||
{
|
{
|
||||||
"<leader>aa",
|
"<leader>aa",
|
||||||
function()
|
function()
|
||||||
|
|
@ -66,16 +67,6 @@ return {
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
|
||||||
"folke/which-key.nvim",
|
|
||||||
optional = true,
|
|
||||||
opts = {
|
|
||||||
defaults = {
|
|
||||||
["<leader>a"] = { name = "+ai" },
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
-- Telescope integration
|
-- Telescope integration
|
||||||
{
|
{
|
||||||
"nvim-telescope/telescope.nvim",
|
"nvim-telescope/telescope.nvim",
|
||||||
|
|
|
||||||
|
|
@ -49,17 +49,6 @@ return {
|
||||||
opts = {},
|
opts = {},
|
||||||
},
|
},
|
||||||
|
|
||||||
-- which key integration
|
|
||||||
{
|
|
||||||
"folke/which-key.nvim",
|
|
||||||
optional = true,
|
|
||||||
opts = {
|
|
||||||
defaults = {
|
|
||||||
["<leader>d"] = { name = "+debug" },
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
-- mason.nvim integration
|
-- mason.nvim integration
|
||||||
{
|
{
|
||||||
"jay-babu/mason-nvim-dap.nvim",
|
"jay-babu/mason-nvim-dap.nvim",
|
||||||
|
|
@ -85,6 +74,7 @@ return {
|
||||||
|
|
||||||
-- stylua: ignore
|
-- stylua: ignore
|
||||||
keys = {
|
keys = {
|
||||||
|
{ "<leader>d", "", desc = "+debug" },
|
||||||
{ "<leader>dB", function() require("dap").set_breakpoint(vim.fn.input('Breakpoint condition: ')) end, desc = "Breakpoint Condition" },
|
{ "<leader>dB", function() require("dap").set_breakpoint(vim.fn.input('Breakpoint condition: ')) end, desc = "Breakpoint Condition" },
|
||||||
{ "<leader>db", function() require("dap").toggle_breakpoint() end, desc = "Toggle Breakpoint" },
|
{ "<leader>db", function() require("dap").toggle_breakpoint() end, desc = "Toggle Breakpoint" },
|
||||||
{ "<leader>dc", function() require("dap").continue() end, desc = "Continue" },
|
{ "<leader>dc", function() require("dap").continue() end, desc = "Continue" },
|
||||||
|
|
|
||||||
|
|
@ -50,14 +50,8 @@ return {
|
||||||
update_n_lines = "gzn", -- Update `n_lines`
|
update_n_lines = "gzn", -- Update `n_lines`
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
keys = {
|
||||||
{
|
{ "gz", "", desc = "+surround" },
|
||||||
"folke/which-key.nvim",
|
|
||||||
optional = true,
|
|
||||||
opts = {
|
|
||||||
defaults = {
|
|
||||||
["gz"] = { name = "+surround" },
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ return {
|
||||||
"nvim-treesitter/nvim-treesitter",
|
"nvim-treesitter/nvim-treesitter",
|
||||||
},
|
},
|
||||||
keys = {
|
keys = {
|
||||||
|
{ "<leader>r", "", desc = "+refactor" },
|
||||||
{
|
{
|
||||||
"<leader>rs",
|
"<leader>rs",
|
||||||
function()
|
function()
|
||||||
|
|
@ -124,15 +125,4 @@ return {
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
||||||
-- which key integration
|
|
||||||
{
|
|
||||||
"folke/which-key.nvim",
|
|
||||||
optional = true,
|
|
||||||
opts = {
|
|
||||||
defaults = {
|
|
||||||
["<leader>r"] = { name = "+refactor" },
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ return {
|
||||||
{
|
{
|
||||||
"williamboman/mason.nvim",
|
"williamboman/mason.nvim",
|
||||||
opts = function(_, opts)
|
opts = function(_, opts)
|
||||||
vim.list_extend(opts.ensure_installed or {}, { "ktlint", "kotlin-debug-adapter" })
|
vim.list_extend(opts.ensure_installed or {}, { "ktlint" })
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
-- Add syntax highlighting
|
-- Add syntax highlighting
|
||||||
|
|
@ -35,7 +35,7 @@ return {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
-- Add linting as optional
|
-- Add linting
|
||||||
{
|
{
|
||||||
"mfussenegger/nvim-lint",
|
"mfussenegger/nvim-lint",
|
||||||
optional = true,
|
optional = true,
|
||||||
|
|
@ -44,7 +44,7 @@ return {
|
||||||
linters_by_ft = { kotlin = { "ktlint" } },
|
linters_by_ft = { kotlin = { "ktlint" } },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
-- Add formatting as optional
|
-- Add formatting
|
||||||
{
|
{
|
||||||
"stevearc/conform.nvim",
|
"stevearc/conform.nvim",
|
||||||
optional = true,
|
optional = true,
|
||||||
|
|
@ -52,7 +52,7 @@ return {
|
||||||
formatters_by_ft = { kotlin = { "ktlint" } },
|
formatters_by_ft = { kotlin = { "ktlint" } },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
-- Add formatting and linting as optional
|
-- Add formatting and linting
|
||||||
{
|
{
|
||||||
"nvimtools/none-ls.nvim",
|
"nvimtools/none-ls.nvim",
|
||||||
optional = true,
|
optional = true,
|
||||||
|
|
@ -72,7 +72,7 @@ return {
|
||||||
opts = function()
|
opts = function()
|
||||||
local dap = require("dap")
|
local dap = require("dap")
|
||||||
if not dap.adapters.kotlin then
|
if not dap.adapters.kotlin then
|
||||||
require("dap").adapters.kotlin = {
|
dap.adapters.kotlin = {
|
||||||
type = "executable",
|
type = "executable",
|
||||||
command = "kotlin-debug-adapter",
|
command = "kotlin-debug-adapter",
|
||||||
options = { auto_continue_if_many_stopped = false },
|
options = { auto_continue_if_many_stopped = false },
|
||||||
|
|
|
||||||
|
|
@ -5,15 +5,6 @@ return {
|
||||||
root = { ".latexmkrc", ".texlabroot", "texlabroot", "Tectonic.toml" },
|
root = { ".latexmkrc", ".texlabroot", "texlabroot", "Tectonic.toml" },
|
||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
{
|
|
||||||
"folke/which-key.nvim",
|
|
||||||
optional = true,
|
|
||||||
opts = {
|
|
||||||
defaults = {
|
|
||||||
["<localLeader>l"] = { name = "+vimtex" },
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
-- Add BibTeX/LaTeX to treesitter
|
-- Add BibTeX/LaTeX to treesitter
|
||||||
{
|
{
|
||||||
|
|
@ -38,6 +29,9 @@ return {
|
||||||
vim.g.vimtex_mappings_disable = { ["n"] = { "K" } } -- disable `K` as it conflicts with LSP hover
|
vim.g.vimtex_mappings_disable = { ["n"] = { "K" } } -- disable `K` as it conflicts with LSP hover
|
||||||
vim.g.vimtex_quickfix_method = vim.fn.executable("pplatex") == 1 and "pplatex" or "latexlog"
|
vim.g.vimtex_quickfix_method = vim.fn.executable("pplatex") == 1 and "pplatex" or "latexlog"
|
||||||
end,
|
end,
|
||||||
|
keys = {
|
||||||
|
{ "<localLeader>l", "", desc = "+vimtext" },
|
||||||
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
-- Correctly setup lspconfig for LaTeX 🚀
|
-- Correctly setup lspconfig for LaTeX 🚀
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,6 @@
|
||||||
return {
|
return {
|
||||||
recommended = true,
|
recommended = true,
|
||||||
desc = "Neotest support. Requires language specific adapters to be configured. (see lang extras)",
|
desc = "Neotest support. Requires language specific adapters to be configured. (see lang extras)",
|
||||||
{
|
|
||||||
"folke/which-key.nvim",
|
|
||||||
optional = true,
|
|
||||||
opts = {
|
|
||||||
defaults = {
|
|
||||||
["<leader>t"] = { name = "+test" },
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"nvim-neotest/neotest",
|
"nvim-neotest/neotest",
|
||||||
dependencies = { "nvim-neotest/nvim-nio" },
|
dependencies = { "nvim-neotest/nvim-nio" },
|
||||||
|
|
@ -110,6 +101,7 @@ return {
|
||||||
end,
|
end,
|
||||||
-- stylua: ignore
|
-- stylua: ignore
|
||||||
keys = {
|
keys = {
|
||||||
|
{"<leader>t", "", desc = "+test"},
|
||||||
{ "<leader>tt", function() require("neotest").run.run(vim.fn.expand("%")) end, desc = "Run File" },
|
{ "<leader>tt", function() require("neotest").run.run(vim.fn.expand("%")) end, desc = "Run File" },
|
||||||
{ "<leader>tT", function() require("neotest").run.run(vim.uv.cwd()) end, desc = "Run All Test Files" },
|
{ "<leader>tT", function() require("neotest").run.run(vim.uv.cwd()) end, desc = "Run All Test Files" },
|
||||||
{ "<leader>tr", function() require("neotest").run.run() end, desc = "Run Nearest" },
|
{ "<leader>tr", function() require("neotest").run.run() end, desc = "Run Nearest" },
|
||||||
|
|
|
||||||
|
|
@ -92,6 +92,10 @@ return {
|
||||||
text_align = "left",
|
text_align = "left",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
---@param opts bufferline.IconFetcherOpts
|
||||||
|
get_element_icon = function(opts)
|
||||||
|
return LazyVim.config.icons.ft[opts.filetype]
|
||||||
|
end,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
config = function(_, opts)
|
config = function(_, opts)
|
||||||
|
|
@ -133,7 +137,7 @@ return {
|
||||||
local opts = {
|
local opts = {
|
||||||
options = {
|
options = {
|
||||||
theme = "auto",
|
theme = "auto",
|
||||||
globalstatus = true,
|
globalstatus = vim.o.laststatus == 3,
|
||||||
disabled_filetypes = { statusline = { "dashboard", "alpha", "starter" } },
|
disabled_filetypes = { statusline = { "dashboard", "alpha", "starter" } },
|
||||||
},
|
},
|
||||||
sections = {
|
sections = {
|
||||||
|
|
@ -262,16 +266,6 @@ return {
|
||||||
main = "ibl",
|
main = "ibl",
|
||||||
},
|
},
|
||||||
|
|
||||||
-- Displays a popup with possible key bindings of the command you started typing
|
|
||||||
{
|
|
||||||
"folke/which-key.nvim",
|
|
||||||
opts = function(_, opts)
|
|
||||||
if LazyVim.has("noice.nvim") then
|
|
||||||
opts.defaults["<leader>sn"] = { name = "+noice" }
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
|
|
||||||
-- Highly experimental plugin that completely replaces the UI for messages, cmdline and the popupmenu.
|
-- Highly experimental plugin that completely replaces the UI for messages, cmdline and the popupmenu.
|
||||||
{
|
{
|
||||||
"folke/noice.nvim",
|
"folke/noice.nvim",
|
||||||
|
|
@ -305,6 +299,7 @@ return {
|
||||||
},
|
},
|
||||||
-- stylua: ignore
|
-- stylua: ignore
|
||||||
keys = {
|
keys = {
|
||||||
|
{ "<leader>sn", "", desc = "+noice"},
|
||||||
{ "<S-Enter>", function() require("noice").redirect(vim.fn.getcmdline()) end, mode = "c", desc = "Redirect Cmdline" },
|
{ "<S-Enter>", function() require("noice").redirect(vim.fn.getcmdline()) end, mode = "c", desc = "Redirect Cmdline" },
|
||||||
{ "<leader>snl", function() require("noice").cmd("last") end, desc = "Noice Last Message" },
|
{ "<leader>snl", function() require("noice").cmd("last") end, desc = "Noice Last Message" },
|
||||||
{ "<leader>snh", function() require("noice").cmd("history") end, desc = "Noice History" },
|
{ "<leader>snh", function() require("noice").cmd("history") end, desc = "Noice History" },
|
||||||
|
|
|
||||||
|
|
@ -159,4 +159,36 @@ function M.blame_line(opts)
|
||||||
return require("lazy.util").float_cmd(cmd, opts)
|
return require("lazy.util").float_cmd(cmd, opts)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function M.browse()
|
||||||
|
local config = require("lazy.manage.git").get_config(LazyVim.root.detectors.pattern(0, { ".git" })[1])
|
||||||
|
local remotes = {} ---@type {name:string, url:string}[]
|
||||||
|
for name, url in pairs(config) do
|
||||||
|
name = name:match("^remote%.(.-)%.url$")
|
||||||
|
if name then
|
||||||
|
url = url:gsub("git@github.com:", "https://github.com/"):gsub("%.git$", "") --[[@as string]]
|
||||||
|
table.insert(remotes, { name = name, url = url })
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local function open(remote)
|
||||||
|
if remote then
|
||||||
|
LazyVim.info(("Opening [%s](%s)"):format(remote.name, remote.url))
|
||||||
|
vim.ui.open(remote.url)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
if #remotes == 0 then
|
||||||
|
return LazyVim.error("No git remotes found")
|
||||||
|
elseif #remotes == 1 then
|
||||||
|
return open(remotes[1])
|
||||||
|
end
|
||||||
|
|
||||||
|
vim.ui.select(remotes, {
|
||||||
|
prompt = "Select remote to browse",
|
||||||
|
format_item = function(item)
|
||||||
|
return item.name .. (" "):rep(8 - #item.name) .. " 🔗 " .. item.url
|
||||||
|
end,
|
||||||
|
}, open)
|
||||||
|
end
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue