mirror of
https://github.com/LazyVim/LazyVim.git
synced 2026-07-25 14:01:06 +00:00
Merge branch 'LazyVim:main' into main
This commit is contained in:
commit
a5461f38da
54 changed files with 662 additions and 362 deletions
93
CHANGELOG.md
93
CHANGELOG.md
|
|
@ -1,5 +1,98 @@
|
|||
# Changelog
|
||||
|
||||
## [11.3.1](https://github.com/LazyVim/LazyVim/compare/v11.3.0...v11.3.1) (2024-05-18)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **util:** fixup ([3a4672d](https://github.com/LazyVim/LazyVim/commit/3a4672de3f8b6410de9fbd5b7134d5108d86f46c))
|
||||
|
||||
## [11.3.0](https://github.com/LazyVim/LazyVim/compare/v11.2.0...v11.3.0) (2024-05-18)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **cmp:** create undo point right before confirming a completion ([673975e](https://github.com/LazyVim/LazyVim/commit/673975ebbe9870ded302bf3621e249bb4cd5f4f8))
|
||||
* **mini.ai:** `mini.ai` is back in core with some improved features. Removing it was a mistake. ([d8644c4](https://github.com/LazyVim/LazyVim/commit/d8644c47158fd28b88f5e3a90af6e5e6a0df2eba))
|
||||
* **util:** added Util.is_loaded ([4105c0a](https://github.com/LazyVim/LazyVim/commit/4105c0ad3a441da3a31cc7d8e53305a6117f6ee5))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **ibl:** remove ibl fix since it's been fixed upstream ([4614666](https://github.com/LazyVim/LazyVim/commit/4614666d1ee5864e95a08eb5b85808d7834ce85f))
|
||||
* **keymaps:** delete lazygit keymap when using gitui ([#2986](https://github.com/LazyVim/LazyVim/issues/2986)) ([649fa9d](https://github.com/LazyVim/LazyVim/commit/649fa9d52188e0c28733402f2f65014fa73308bc))
|
||||
* **lsp:** move next/prev reference keymaps to lsp keymaps. See [#3220](https://github.com/LazyVim/LazyVim/issues/3220) ([a4d8352](https://github.com/LazyVim/LazyVim/commit/a4d83524a7179274c17414ebeb0a4e4b8d9a8706))
|
||||
* **mini.starter:** changes based on echasnovski's recommendation ([#3223](https://github.com/LazyVim/LazyVim/issues/3223)) ([eb6c9fb](https://github.com/LazyVim/LazyVim/commit/eb6c9fb5784a8001c876203de174cd79e96bb637))
|
||||
* **plugin:** typo ([#3225](https://github.com/LazyVim/LazyVim/issues/3225)) ([96aa4b8](https://github.com/LazyVim/LazyVim/commit/96aa4b8877faa2fea30d2d4e2d3d117d9d3851f8))
|
||||
* **treesitter:** refactored treesitter code and fixed nvim-treesitter-textobjects ([fe55285](https://github.com/LazyVim/LazyVim/commit/fe552853f5c065df2d79092c0cbac6745f8ea8fc))
|
||||
|
||||
## [11.2.0](https://github.com/LazyVim/LazyVim/compare/v11.1.2...v11.2.0) (2024-05-18)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **extras:** added a recommended plugin/language section to `:LazyExtras` ([16eb3d9](https://github.com/LazyVim/LazyVim/commit/16eb3d947321992ebcddff6b997d403b41bd7411))
|
||||
* **extras:** added recommended detectors for all languages ([c292134](https://github.com/LazyVim/LazyVim/commit/c29213416b5e29fc56c465234dfd717f78a9e09f))
|
||||
* **extras:** added trouble-v3 and mini-hipatterns to recommended ([d514e2f](https://github.com/LazyVim/LazyVim/commit/d514e2fa93a449329c2de64d569846102f24de0e))
|
||||
* **extras:** tags some extras as recommended ([ef3bd3b](https://github.com/LazyVim/LazyVim/commit/ef3bd3bd027209812c41b1d772e766c0ef18c503))
|
||||
* **root:** added support for `*.xxx` root patterns ([03ea7f6](https://github.com/LazyVim/LazyVim/commit/03ea7f6f98a874e26d258dbfe5b196c2d7c6971f))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **bufferline:** force update bufferline after `BufDelete`. Closes [#3197](https://github.com/LazyVim/LazyVim/issues/3197) ([72abb89](https://github.com/LazyVim/LazyVim/commit/72abb893acc866ce574c66af7d9de861440a3a1f))
|
||||
* **comments:** better way of using ts-context-commentstring with native comments ([1d23c98](https://github.com/LazyVim/LazyVim/commit/1d23c98da138494fafdad6735d70c3d3375bb7b2))
|
||||
* **extras:** remove treesitter-rewrite extra for now ([180d951](https://github.com/LazyVim/LazyVim/commit/180d9516fd68ca8b881cf1028eeb65aa9c2e25b7))
|
||||
* **indent-blankline:** temp fix for `tbl_flatten` on `0.9.x` ([3a193d3](https://github.com/LazyVim/LazyVim/commit/3a193d3aa89c8ff0327abb3e60600eab154af93a))
|
||||
* **leap:** add label to renamed surround mappings key group ([#3211](https://github.com/LazyVim/LazyVim/issues/3211)) ([9c212d6](https://github.com/LazyVim/LazyVim/commit/9c212d655a05c42331443f5d0d6dcc982108ed0e))
|
||||
* **mini.starter:** buf_id in refresh() is not an identifier of valid … ([#3209](https://github.com/LazyVim/LazyVim/issues/3209)) ([dc66887](https://github.com/LazyVim/LazyVim/commit/dc66887b57ecdee8d33b5e07ca031288260e2971))
|
||||
* **refactoring:** add label to refactoring key group ([#3201](https://github.com/LazyVim/LazyVim/issues/3201)) ([39bec71](https://github.com/LazyVim/LazyVim/commit/39bec71ce9489eee288544dca22015147636ae4d))
|
||||
* **treesitter:** disable treesitter-rewrite extra for now. not ready yet ([87bb766](https://github.com/LazyVim/LazyVim/commit/87bb76612318f0c0b4fca675500e3afd0a9c6771))
|
||||
* **trouble-v3:** add neovim version check ([0892542](https://github.com/LazyVim/LazyVim/commit/08925421e840ac21f3feac28ee8b57319f0a4e59))
|
||||
* **util.toggle:** correctly toggle `inlay_hints` ([#3202](https://github.com/LazyVim/LazyVim/issues/3202)) ([23374f1](https://github.com/LazyVim/LazyVim/commit/23374f160a5b1b947681d55add56ab6ab15e219e))
|
||||
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* **comments:** `vim.schedule` ts-context-commentstring integration ([c653c4a](https://github.com/LazyVim/LazyVim/commit/c653c4a9a5c0a3cd5101ce86a3640ee12067ffcd))
|
||||
* **yanky:** switch to shada backend. It seems much faster than sqlite ([4348836](https://github.com/LazyVim/LazyVim/commit/434883632cd6bc884f36da0282073307d585d6a1))
|
||||
|
||||
## [11.1.2](https://github.com/LazyVim/LazyVim/compare/v11.1.1...v11.1.2) (2024-05-17)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **util:** use `bdelete` for buf remove ([19674e8](https://github.com/LazyVim/LazyVim/commit/19674e804787e205c587d153e8e9c4a3988e7f6c))
|
||||
|
||||
## [11.1.1](https://github.com/LazyVim/LazyVim/compare/v11.1.0...v11.1.1) (2024-05-17)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **bufferline:** correctly configure bufferline to use the new bufremove util ([2e1c945](https://github.com/LazyVim/LazyVim/commit/2e1c945f61821eec818a1512bc05b45366c0dfeb))
|
||||
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* **coding:** dont load `vim.snippet` early ([289c2f8](https://github.com/LazyVim/LazyVim/commit/289c2f81c43d39b31a8b46a4a84ab9feb61bb235))
|
||||
|
||||
## [11.1.0](https://github.com/LazyVim/LazyVim/compare/v11.0.1...v11.1.0) (2024-05-17)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **lsp:** document highlights now use native lsp. `vim-illuminate` is available as an extra ([cc99b21](https://github.com/LazyVim/LazyVim/commit/cc99b219ded16ec60120698d6e8f453c2f37132c))
|
||||
* **options:** new option to disable deprecation warnings. warnings will be hidden bydefault ([f8de965](https://github.com/LazyVim/LazyVim/commit/f8de965d3ec5712444a643b507bc9ddc7cb19d01))
|
||||
* **util:** `mini.bufremove` is no longer needed ([779de26](https://github.com/LazyVim/LazyVim/commit/779de263f173f7e6f181d1e8faa475be8b05167d))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* deprecation warning on diagnostic.is_disabled ([960ec80](https://github.com/LazyVim/LazyVim/commit/960ec8079bb5960a510595dff21725ff403b2753))
|
||||
* **lsp:** dont try to highlight refs for deleted buffers ([87493af](https://github.com/LazyVim/LazyVim/commit/87493af2378fac7b518fd2c4db903cd3a2c27095))
|
||||
* **treesitter-rewrite:** add missed local Config ([#3188](https://github.com/LazyVim/LazyVim/issues/3188)) ([ec673a8](https://github.com/LazyVim/LazyVim/commit/ec673a83ff387e29ca42367b3aab3c311950a024))
|
||||
* **util.lsp:** add `desc` for keymaps reference ([#3193](https://github.com/LazyVim/LazyVim/issues/3193)) ([b1ea356](https://github.com/LazyVim/LazyVim/commit/b1ea356e6c676571907ce654ec3878c530c636ad))
|
||||
|
||||
## [11.0.1](https://github.com/LazyVim/LazyVim/compare/v11.0.0...v11.0.1) (2024-05-16)
|
||||
|
||||
|
||||
|
|
|
|||
19
NEWS.md
19
NEWS.md
|
|
@ -2,8 +2,19 @@
|
|||
|
||||
## 11.x
|
||||
|
||||
- `mini.ai` is back as a default plugin! Removing it was a mistake.
|
||||
It's a great plugin that enhances the native text objects.
|
||||
|
||||
- `:LazyExtras` now has multiple new sections:
|
||||
|
||||
- **Enabled**: extras that are currently enabled
|
||||
- **Recommended Languages**: language extras recommended for the current buffer / directory
|
||||
- **Recommended Plugins**: extras that are recommended for most users
|
||||
- **Plugins**: other plugin extras
|
||||
- **Languages**: other language extras
|
||||
|
||||
- new option `vim.g.deprecation_warnings` to disable deprecation warnings
|
||||
Defaults to `false`. To disable, set it to `true` in your `options.lua`
|
||||
Defaults to `false`. To enable deprecation warnings, set it to `true` in your `options.lua`
|
||||
|
||||
- `vim-illuminate` move to extras
|
||||
Document highlights now use native lsp functionality by default
|
||||
|
|
@ -34,16 +45,10 @@ Additionally, some core plugins have been moved to extras.
|
|||
|
||||
- plugins moved to extras:
|
||||
|
||||
- `mini.ai` which I couldn't live without, but not everyone needs it
|
||||
- `mini.surround`
|
||||
- `mini.indentscope` scopes are now also highlighted with `indent-blankline`
|
||||
- `nvim-treesitter-context`
|
||||
|
||||
- There's a new extra for the `nvim-treesitter` **rewrite**.
|
||||
Since the rewrite is not backward compatible, some plugins will be disabled
|
||||
when you enable this extra: `vim-illuminate`, `nvim-ts-autotag`, and `nvim-ts-autotag`.
|
||||
I would **NOT** recommend enabling this extra for now.
|
||||
|
||||
## 10.x
|
||||
|
||||
- added new extra for [mini.diff](https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-diff.md)
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 May 17
|
||||
*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 May 19
|
||||
|
||||
==============================================================================
|
||||
Table of Contents *LazyVim-table-of-contents*
|
||||
|
|
|
|||
|
|
@ -132,7 +132,7 @@ local defaults = {
|
|||
}
|
||||
|
||||
M.json = {
|
||||
version = 3,
|
||||
version = 4,
|
||||
data = {
|
||||
version = nil, ---@type string?
|
||||
news = {}, ---@type table<string, string>
|
||||
|
|
|
|||
|
|
@ -36,7 +36,15 @@ return {
|
|||
["<C-f>"] = cmp.mapping.scroll_docs(4),
|
||||
["<C-Space>"] = cmp.mapping.complete(),
|
||||
["<C-e>"] = cmp.mapping.abort(),
|
||||
["<CR>"] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
|
||||
["<CR>"] = function(fallback)
|
||||
if cmp.core.view:visible() or vim.fn.pumvisible() == 1 then
|
||||
LazyVim.create_undo()
|
||||
if cmp.confirm({ select = true }) then
|
||||
return
|
||||
end
|
||||
end
|
||||
return fallback()
|
||||
end,
|
||||
["<S-CR>"] = cmp.mapping.confirm({
|
||||
behavior = cmp.ConfirmBehavior.Replace,
|
||||
select = true,
|
||||
|
|
@ -96,7 +104,7 @@ return {
|
|||
},
|
||||
|
||||
-- snippets
|
||||
vim.snippet
|
||||
vim.fn.has("nvim-0.10") == 1
|
||||
and {
|
||||
"nvim-cmp",
|
||||
dependencies = {
|
||||
|
|
@ -115,38 +123,16 @@ return {
|
|||
{
|
||||
"<Tab>",
|
||||
function()
|
||||
if vim.snippet.active({ direction = 1 }) then
|
||||
vim.schedule(function()
|
||||
vim.snippet.jump(1)
|
||||
end)
|
||||
return
|
||||
end
|
||||
return "<Tab>"
|
||||
return vim.snippet.active({ direction = 1 }) and "<cmd>lua vim.snippet.jump(1)<cr>" or "<Tab>"
|
||||
end,
|
||||
expr = true,
|
||||
silent = true,
|
||||
mode = "i",
|
||||
},
|
||||
{
|
||||
"<Tab>",
|
||||
function()
|
||||
vim.schedule(function()
|
||||
vim.snippet.jump(1)
|
||||
end)
|
||||
end,
|
||||
silent = true,
|
||||
mode = "s",
|
||||
mode = { "i", "s" },
|
||||
},
|
||||
{
|
||||
"<S-Tab>",
|
||||
function()
|
||||
if vim.snippet.active({ direction = -1 }) then
|
||||
vim.schedule(function()
|
||||
vim.snippet.jump(-1)
|
||||
end)
|
||||
return
|
||||
end
|
||||
return "<S-Tab>"
|
||||
return vim.snippet.active({ direction = -1 }) and "<cmd>lua vim.snippet.jump(-1)<cr>" or "<Tab>"
|
||||
end,
|
||||
expr = true,
|
||||
silent = true,
|
||||
|
|
@ -188,24 +174,53 @@ return {
|
|||
opts = {
|
||||
enable_autocmd = false,
|
||||
},
|
||||
},
|
||||
{
|
||||
import = "lazyvim.plugins.extras.coding.mini-comment",
|
||||
enabled = function()
|
||||
init = function()
|
||||
if vim.fn.has("nvim-0.10") == 1 then
|
||||
-- Majestically override the native `get_commentstring` function.
|
||||
vim.schedule(function()
|
||||
LazyVim.inject.set_upvalue(
|
||||
LazyVim.inject.get_upvalue(require("vim._comment").textobject, "get_comment_parts"),
|
||||
"get_commentstring",
|
||||
function()
|
||||
return require("ts_context_commentstring.internal").calculate_commentstring() or vim.bo.commentstring
|
||||
end
|
||||
)
|
||||
local get_option = vim.filetype.get_option
|
||||
vim.filetype.get_option = function(filetype, option)
|
||||
return option == "commentstring" and require("ts_context_commentstring.internal").calculate_commentstring()
|
||||
or get_option(filetype, option)
|
||||
end
|
||||
end)
|
||||
else
|
||||
return true
|
||||
end
|
||||
end,
|
||||
},
|
||||
{
|
||||
import = "lazyvim.plugins.extras.coding.mini-comment",
|
||||
enabled = vim.fn.has("nvim-0.10") == 0,
|
||||
},
|
||||
|
||||
-- Better text-objects
|
||||
{
|
||||
"echasnovski/mini.ai",
|
||||
event = "VeryLazy",
|
||||
opts = function()
|
||||
LazyVim.on_load("which-key.nvim", function()
|
||||
vim.schedule(LazyVim.mini.ai_whichkey)
|
||||
end)
|
||||
local ai = require("mini.ai")
|
||||
return {
|
||||
n_lines = 500,
|
||||
custom_textobjects = {
|
||||
o = ai.gen_spec.treesitter({ -- code block
|
||||
a = { "@block.outer", "@conditional.outer", "@loop.outer" },
|
||||
i = { "@block.inner", "@conditional.inner", "@loop.inner" },
|
||||
}),
|
||||
f = ai.gen_spec.treesitter({ a = "@function.outer", i = "@function.inner" }), -- function
|
||||
c = ai.gen_spec.treesitter({ a = "@class.outer", i = "@class.inner" }), -- class
|
||||
t = { "<([%p%w]-)%f[^<%w][^<>]->.-</%1>", "^<.->().*()</[^/]->$" }, -- tags
|
||||
d = { "%f[%d]%d+" }, -- digits
|
||||
e = { -- Word with case
|
||||
{ "%u[%l%d]+%f[^%l%d]", "%f[%S][%l%d]+%f[^%l%d]", "%f[%P][%l%d]+%f[^%l%d]", "^[%l%d]+%f[^%l%d]" },
|
||||
"^().*()$",
|
||||
},
|
||||
i = LazyVim.mini.ai_indent, -- indent
|
||||
g = LazyVim.mini.ai_buffer, -- buffer
|
||||
u = ai.gen_spec.function_call(), -- u for "Usage"
|
||||
U = ai.gen_spec.function_call({ name_pattern = "[%w_]" }), -- without dot in function name
|
||||
},
|
||||
}
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
return {
|
||||
|
||||
recommended = true,
|
||||
-- copilot
|
||||
{
|
||||
"zbirenbaum/copilot.lua",
|
||||
|
|
|
|||
|
|
@ -1,95 +0,0 @@
|
|||
-- Better text-objects
|
||||
return {
|
||||
"echasnovski/mini.ai",
|
||||
-- keys = {
|
||||
-- { "a", mode = { "x", "o" } },
|
||||
-- { "i", mode = { "x", "o" } },
|
||||
-- },
|
||||
event = "VeryLazy",
|
||||
opts = function()
|
||||
local ai = require("mini.ai")
|
||||
return {
|
||||
n_lines = 500,
|
||||
custom_textobjects = {
|
||||
o = ai.gen_spec.treesitter({
|
||||
a = { "@block.outer", "@conditional.outer", "@loop.outer" },
|
||||
i = { "@block.inner", "@conditional.inner", "@loop.inner" },
|
||||
}, {}),
|
||||
f = ai.gen_spec.treesitter({ a = "@function.outer", i = "@function.inner" }, {}),
|
||||
c = ai.gen_spec.treesitter({ a = "@class.outer", i = "@class.inner" }, {}),
|
||||
t = { "<([%p%w]-)%f[^<%w][^<>]->.-</%1>", "^<.->().*()</[^/]->$" },
|
||||
d = { "%f[%d]%d+" }, -- digits
|
||||
e = { -- Word with case
|
||||
{
|
||||
"%u[%l%d]+%f[^%l%d]",
|
||||
"%f[%S][%l%d]+%f[^%l%d]",
|
||||
"%f[%P][%l%d]+%f[^%l%d]",
|
||||
"^[%l%d]+%f[^%l%d]",
|
||||
},
|
||||
"^().*()$",
|
||||
},
|
||||
g = function() -- Whole buffer, similar to `gg` and 'G' motion
|
||||
local from = { line = 1, col = 1 }
|
||||
local to = {
|
||||
line = vim.fn.line("$"),
|
||||
col = math.max(vim.fn.getline("$"):len(), 1),
|
||||
}
|
||||
return { from = from, to = to }
|
||||
end,
|
||||
u = ai.gen_spec.function_call(), -- u for "Usage"
|
||||
U = ai.gen_spec.function_call({ name_pattern = "[%w_]" }), -- without dot in function name
|
||||
},
|
||||
}
|
||||
end,
|
||||
config = function(_, opts)
|
||||
require("mini.ai").setup(opts)
|
||||
-- register all text objects with which-key
|
||||
LazyVim.on_load("which-key.nvim", function()
|
||||
---@type table<string, string|table>
|
||||
local i = {
|
||||
[" "] = "Whitespace",
|
||||
['"'] = 'Balanced "',
|
||||
["'"] = "Balanced '",
|
||||
["`"] = "Balanced `",
|
||||
["("] = "Balanced (",
|
||||
[")"] = "Balanced ) including white-space",
|
||||
[">"] = "Balanced > including white-space",
|
||||
["<lt>"] = "Balanced <",
|
||||
["]"] = "Balanced ] including white-space",
|
||||
["["] = "Balanced [",
|
||||
["}"] = "Balanced } including white-space",
|
||||
["{"] = "Balanced {",
|
||||
["?"] = "User Prompt",
|
||||
_ = "Underscore",
|
||||
a = "Argument",
|
||||
b = "Balanced ), ], }",
|
||||
c = "Class",
|
||||
d = "Digit(s)",
|
||||
e = "Word in CamelCase & snake_case",
|
||||
f = "Function",
|
||||
g = "Entire file",
|
||||
o = "Block, conditional, loop",
|
||||
q = "Quote `, \", '",
|
||||
t = "Tag",
|
||||
u = "Use/call function & method",
|
||||
U = "Use/call without dot in name",
|
||||
}
|
||||
local a = vim.deepcopy(i)
|
||||
for k, v in pairs(a) do
|
||||
a[k] = v:gsub(" including.*", "")
|
||||
end
|
||||
|
||||
local ic = vim.deepcopy(i)
|
||||
local ac = vim.deepcopy(a)
|
||||
for key, name in pairs({ n = "Next", l = "Last" }) do
|
||||
i[key] = vim.tbl_extend("force", { name = "Inside " .. name .. " textobject" }, ic)
|
||||
a[key] = vim.tbl_extend("force", { name = "Around " .. name .. " textobject" }, ac)
|
||||
end
|
||||
require("which-key").register({
|
||||
mode = { "o", "x" },
|
||||
i = i,
|
||||
a = a,
|
||||
})
|
||||
end)
|
||||
end,
|
||||
}
|
||||
|
|
@ -4,6 +4,7 @@
|
|||
-- and more.
|
||||
return {
|
||||
"echasnovski/mini.surround",
|
||||
recommended = true,
|
||||
keys = function(_, keys)
|
||||
-- Populate the keys based on the user's options
|
||||
local opts = LazyVim.opts("mini.surround")
|
||||
|
|
|
|||
|
|
@ -1,32 +1,30 @@
|
|||
-- better yank/paste
|
||||
return {
|
||||
-- better yank/paste
|
||||
{
|
||||
"gbprod/yanky.nvim",
|
||||
dependencies = not LazyVim.is_win() and { "kkharji/sqlite.lua" } or {},
|
||||
opts = {
|
||||
highlight = { timer = 150 },
|
||||
ring = { storage = LazyVim.is_win() and "shada" or "sqlite" },
|
||||
},
|
||||
keys = {
|
||||
"gbprod/yanky.nvim",
|
||||
recommended = true,
|
||||
desc = "Better Yank/Paste",
|
||||
opts = {
|
||||
highlight = { timer = 150 },
|
||||
},
|
||||
keys = {
|
||||
-- stylua: ignore
|
||||
{ "<leader>p", function() require("telescope").extensions.yank_history.yank_history({ }) end, desc = "Open Yank History" },
|
||||
{ "y", "<Plug>(YankyYank)", mode = { "n", "x" }, desc = "Yank Text" },
|
||||
{ "p", "<Plug>(YankyPutAfter)", mode = { "n", "x" }, desc = "Put Yanked Text After Cursor" },
|
||||
{ "P", "<Plug>(YankyPutBefore)", mode = { "n", "x" }, desc = "Put Yanked Text Before Cursor" },
|
||||
{ "gp", "<Plug>(YankyGPutAfter)", mode = { "n", "x" }, desc = "Put Yanked Text After Selection" },
|
||||
{ "gP", "<Plug>(YankyGPutBefore)", mode = { "n", "x" }, desc = "Put Yanked Text Before Selection" },
|
||||
{ "[y", "<Plug>(YankyCycleForward)", desc = "Cycle Forward Through Yank History" },
|
||||
{ "]y", "<Plug>(YankyCycleBackward)", desc = "Cycle Backward Through Yank History" },
|
||||
{ "]p", "<Plug>(YankyPutIndentAfterLinewise)", desc = "Put Indented After Cursor (Linewise)" },
|
||||
{ "[p", "<Plug>(YankyPutIndentBeforeLinewise)", desc = "Put Indented Before Cursor (Linewise)" },
|
||||
{ "]P", "<Plug>(YankyPutIndentAfterLinewise)", desc = "Put Indented After Cursor (Linewise)" },
|
||||
{ "[P", "<Plug>(YankyPutIndentBeforeLinewise)", desc = "Put Indented Before Cursor (Linewise)" },
|
||||
{ ">p", "<Plug>(YankyPutIndentAfterShiftRight)", desc = "Put and Indent Right" },
|
||||
{ "<p", "<Plug>(YankyPutIndentAfterShiftLeft)", desc = "Put and Indent Left" },
|
||||
{ ">P", "<Plug>(YankyPutIndentBeforeShiftRight)", desc = "Put Before and Indent Right" },
|
||||
{ "<P", "<Plug>(YankyPutIndentBeforeShiftLeft)", desc = "Put Before and Indent Left" },
|
||||
{ "=p", "<Plug>(YankyPutAfterFilter)", desc = "Put After Applying a Filter" },
|
||||
{ "=P", "<Plug>(YankyPutBeforeFilter)", desc = "Put Before Applying a Filter" },
|
||||
},
|
||||
{ "y", "<Plug>(YankyYank)", mode = { "n", "x" }, desc = "Yank Text" },
|
||||
{ "p", "<Plug>(YankyPutAfter)", mode = { "n", "x" }, desc = "Put Yanked Text After Cursor" },
|
||||
{ "P", "<Plug>(YankyPutBefore)", mode = { "n", "x" }, desc = "Put Yanked Text Before Cursor" },
|
||||
{ "gp", "<Plug>(YankyGPutAfter)", mode = { "n", "x" }, desc = "Put Yanked Text After Selection" },
|
||||
{ "gP", "<Plug>(YankyGPutBefore)", mode = { "n", "x" }, desc = "Put Yanked Text Before Selection" },
|
||||
{ "[y", "<Plug>(YankyCycleForward)", desc = "Cycle Forward Through Yank History" },
|
||||
{ "]y", "<Plug>(YankyCycleBackward)", desc = "Cycle Backward Through Yank History" },
|
||||
{ "]p", "<Plug>(YankyPutIndentAfterLinewise)", desc = "Put Indented After Cursor (Linewise)" },
|
||||
{ "[p", "<Plug>(YankyPutIndentBeforeLinewise)", desc = "Put Indented Before Cursor (Linewise)" },
|
||||
{ "]P", "<Plug>(YankyPutIndentAfterLinewise)", desc = "Put Indented After Cursor (Linewise)" },
|
||||
{ "[P", "<Plug>(YankyPutIndentBeforeLinewise)", desc = "Put Indented Before Cursor (Linewise)" },
|
||||
{ ">p", "<Plug>(YankyPutIndentAfterShiftRight)", desc = "Put and Indent Right" },
|
||||
{ "<p", "<Plug>(YankyPutIndentAfterShiftLeft)", desc = "Put and Indent Left" },
|
||||
{ ">P", "<Plug>(YankyPutIndentBeforeShiftRight)", desc = "Put Before and Indent Right" },
|
||||
{ "<P", "<Plug>(YankyPutIndentBeforeShiftLeft)", desc = "Put Before and Indent Left" },
|
||||
{ "=p", "<Plug>(YankyPutAfterFilter)", desc = "Put After Applying a Filter" },
|
||||
{ "=P", "<Plug>(YankyPutBeforeFilter)", desc = "Put Before Applying a Filter" },
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,6 +12,8 @@ end
|
|||
|
||||
return {
|
||||
"mfussenegger/nvim-dap",
|
||||
recommended = true,
|
||||
desc = "Debugging support. Requires language specific adapters to be configured. (see lang extras)",
|
||||
|
||||
dependencies = {
|
||||
|
||||
|
|
|
|||
|
|
@ -15,6 +15,8 @@ end
|
|||
|
||||
return {
|
||||
"monaqa/dial.nvim",
|
||||
recommended = true,
|
||||
desc = "Increment and decrement numbers, dates, and more",
|
||||
-- stylua: ignore
|
||||
keys = {
|
||||
{ "<C-a>", function() return M.dial(true) end, expr = true, desc = "Increment", mode = {"n", "v"} },
|
||||
|
|
|
|||
|
|
@ -51,6 +51,15 @@ return {
|
|||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"folke/which-key.nvim",
|
||||
optional = true,
|
||||
opts = {
|
||||
defaults = {
|
||||
["gz"] = { name = "+surround" },
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
-- makes some plugins dot-repeatable like leap
|
||||
{ "tpope/vim-repeat", event = "VeryLazy" },
|
||||
|
|
|
|||
|
|
@ -122,4 +122,15 @@ return {
|
|||
end
|
||||
end,
|
||||
},
|
||||
|
||||
-- which key integration
|
||||
{
|
||||
"folke/which-key.nvim",
|
||||
optional = true,
|
||||
opts = {
|
||||
defaults = {
|
||||
["<leader>r"] = { name = "+refactor" },
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,9 +12,18 @@ if vim.tbl_contains(Config.json.data.extras, "lazyvim.plugins.extras.editor.trou
|
|||
})
|
||||
end
|
||||
end
|
||||
if vim.fn.has("nvim-0.9.2") == 0 then
|
||||
LazyVim.error({
|
||||
"Trouble v3 requires Neovim >= 0.9.2",
|
||||
"Please update your Neovim version.",
|
||||
})
|
||||
return {}
|
||||
end
|
||||
end
|
||||
|
||||
return {
|
||||
desc = "Trouble rewrite including document symbols and a lualine component",
|
||||
recommended = true,
|
||||
{
|
||||
"folke/trouble.nvim",
|
||||
branch = "dev",
|
||||
|
|
|
|||
|
|
@ -1,4 +1,10 @@
|
|||
return {
|
||||
recommended = function()
|
||||
return LazyVim.extras.wants({
|
||||
ft = "yaml.ansible",
|
||||
root = { "ansible.cfg", ".ansible-lint" },
|
||||
})
|
||||
end,
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = function(_, opts)
|
||||
|
|
|
|||
|
|
@ -1,4 +1,17 @@
|
|||
return {
|
||||
recommended = function()
|
||||
return LazyVim.extras.wants({
|
||||
ft = { "c", "cpp", "objc", "objcpp", "cuda", "proto" },
|
||||
root = {
|
||||
".clangd",
|
||||
".clang-tidy",
|
||||
".clang-format",
|
||||
"compile_commands.json",
|
||||
"compile_flags.txt",
|
||||
"configure.ac", -- AutoTools
|
||||
},
|
||||
})
|
||||
end,
|
||||
|
||||
-- Add C/C++ to treesitter
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,4 +1,10 @@
|
|||
return {
|
||||
recommended = function()
|
||||
return LazyVim.extras.wants({
|
||||
ft = "cmake",
|
||||
root = { "CMakePresets.json", "CTestConfig.cmake", "cmake" },
|
||||
})
|
||||
end,
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = function(_, opts)
|
||||
|
|
|
|||
|
|
@ -1,4 +1,10 @@
|
|||
return {
|
||||
recommended = function()
|
||||
return LazyVim.extras.wants({
|
||||
ft = "dockerfile",
|
||||
root = { "Dockerfile", "docker-compose.yml", "compose.yml", "docker-compose.yaml", "compose.yaml" },
|
||||
})
|
||||
end,
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = function(_, opts)
|
||||
|
|
|
|||
|
|
@ -1,4 +1,10 @@
|
|||
return {
|
||||
recommended = function()
|
||||
return LazyVim.extras.wants({
|
||||
ft = { "elixir", "eelixir", "heex", "surface" },
|
||||
root = "mix.exs",
|
||||
})
|
||||
end,
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = function(_, opts)
|
||||
|
|
|
|||
|
|
@ -1,4 +1,10 @@
|
|||
return {
|
||||
recommended = function()
|
||||
return LazyVim.extras.wants({
|
||||
ft = { "go", "gomod", "gowork", "gotmpl" },
|
||||
root = { "go.work", "go.mod" },
|
||||
})
|
||||
end,
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = function(_, opts)
|
||||
|
|
|
|||
|
|
@ -16,6 +16,20 @@ local function extend_or_override(config, custom, ...)
|
|||
end
|
||||
|
||||
return {
|
||||
recommended = function()
|
||||
return LazyVim.extras.wants({
|
||||
ft = "java",
|
||||
root = {
|
||||
"build.gradle",
|
||||
"build.gradle.kts",
|
||||
"build.xml", -- Ant
|
||||
"pom.xml", -- Maven
|
||||
"settings.gradle", -- Gradle
|
||||
"settings.gradle.kts", -- Gradle
|
||||
},
|
||||
})
|
||||
end,
|
||||
|
||||
-- Add java to treesitter.
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
|
|
|
|||
|
|
@ -1,4 +1,9 @@
|
|||
return {
|
||||
recommended = function()
|
||||
return LazyVim.extras.wants({
|
||||
ft = { "json", "jsonc", "json5" },
|
||||
})
|
||||
end,
|
||||
|
||||
-- add json to treesitter
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,4 +1,10 @@
|
|||
return {
|
||||
recommended = function()
|
||||
return LazyVim.extras.wants({
|
||||
ft = "markdown",
|
||||
root = "README.md",
|
||||
})
|
||||
end,
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = function(_, opts)
|
||||
|
|
|
|||
|
|
@ -1,4 +1,11 @@
|
|||
return {
|
||||
recommended = function()
|
||||
return LazyVim.extras.wants({
|
||||
ft = { "cs", "vb" },
|
||||
root = { "*.sln", "*.csproj", "omnisharp.json", "function.json" },
|
||||
})
|
||||
end,
|
||||
|
||||
{ "Hoffs/omnisharp-extended-lsp.nvim", lazy = true },
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
|
|
|
|||
|
|
@ -9,6 +9,19 @@ local lsp = vim.g.lazyvim_python_lsp or "pyright"
|
|||
local ruff = vim.g.lazyvim_python_ruff or "ruff_lsp"
|
||||
|
||||
return {
|
||||
recommended = function()
|
||||
return LazyVim.extras.wants({
|
||||
ft = "python",
|
||||
root = {
|
||||
"pyproject.toml",
|
||||
"setup.py",
|
||||
"setup.cfg",
|
||||
"requirements.txt",
|
||||
"Pipfile",
|
||||
"pyrightconfig.json",
|
||||
},
|
||||
})
|
||||
end,
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = function(_, opts)
|
||||
|
|
|
|||
|
|
@ -1,4 +1,10 @@
|
|||
return {
|
||||
recommended = function()
|
||||
return LazyVim.extras.wants({
|
||||
ft = "ruby",
|
||||
root = "Gemfile",
|
||||
})
|
||||
end,
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = function(_, opts)
|
||||
|
|
|
|||
|
|
@ -1,4 +1,10 @@
|
|||
return {
|
||||
recommended = function()
|
||||
return LazyVim.extras.wants({
|
||||
ft = "rust",
|
||||
root = { "Cargo.toml", "rust-project.json" },
|
||||
})
|
||||
end,
|
||||
|
||||
-- Extend auto completion
|
||||
{
|
||||
|
|
|
|||
|
|
@ -3,6 +3,12 @@
|
|||
-- If you like you can setup your own key bindings.
|
||||
-- For minimalistic setup have a look at https://github.com/scalameta/nvim-metals/discussions/39
|
||||
return {
|
||||
recommended = function()
|
||||
return LazyVim.extras.wants({
|
||||
ft = "scala",
|
||||
root = { "build.sbt", "build.sc", "build.gradle", "pom.xml" },
|
||||
})
|
||||
end,
|
||||
{
|
||||
"hrsh7th/nvim-cmp",
|
||||
requires = {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,18 @@
|
|||
return {
|
||||
recommended = function()
|
||||
return LazyVim.extras.wants({
|
||||
root = {
|
||||
"tailwind.config.js",
|
||||
"tailwind.config.cjs",
|
||||
"tailwind.config.mjs",
|
||||
"tailwind.config.ts",
|
||||
"postcss.config.js",
|
||||
"postcss.config.cjs",
|
||||
"postcss.config.mjs",
|
||||
"postcss.config.ts",
|
||||
},
|
||||
})
|
||||
end,
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
opts = {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,11 @@
|
|||
return {
|
||||
recommended = function()
|
||||
return LazyVim.extras.wants({
|
||||
ft = { "terraform", "hcl" },
|
||||
root = ".terraform",
|
||||
})
|
||||
end,
|
||||
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = function(_, opts)
|
||||
|
|
|
|||
|
|
@ -1,4 +1,10 @@
|
|||
return {
|
||||
recommended = function()
|
||||
return LazyVim.extras.wants({
|
||||
ft = { "tex", "plaintex", "bib" },
|
||||
root = { ".latexmkrc", ".texlabroot", "texlabroot", "Tectonic.toml" },
|
||||
})
|
||||
end,
|
||||
{
|
||||
"folke/which-key.nvim",
|
||||
optional = true,
|
||||
|
|
|
|||
|
|
@ -10,6 +10,19 @@ local inlay_hints_settings = {
|
|||
}
|
||||
|
||||
return {
|
||||
recommended = function()
|
||||
return LazyVim.extras.wants({
|
||||
ft = {
|
||||
"javascript",
|
||||
"javascriptreact",
|
||||
"javascript.jsx",
|
||||
"typescript",
|
||||
"typescriptreact",
|
||||
"typescript.tsx",
|
||||
},
|
||||
root = { "tsconfig.json", "package.json", "jsconfig.json" },
|
||||
})
|
||||
end,
|
||||
|
||||
-- add typescript to treesitter
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,4 +1,11 @@
|
|||
return {
|
||||
recommended = function()
|
||||
return LazyVim.extras.wants({
|
||||
ft = "vue",
|
||||
root = { "vue.config.js" },
|
||||
})
|
||||
end,
|
||||
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = function(_, opts)
|
||||
|
|
|
|||
|
|
@ -1,4 +1,9 @@
|
|||
return {
|
||||
recommended = function()
|
||||
return LazyVim.extras.wants({
|
||||
ft = "yaml",
|
||||
})
|
||||
end,
|
||||
|
||||
-- add yaml specific modules to treesitter
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,4 +1,6 @@
|
|||
return {
|
||||
recommended = true,
|
||||
desc = "Neotest support. Requires language specific adapters to be configured. (see lang extras)",
|
||||
{
|
||||
"folke/which-key.nvim",
|
||||
optional = true,
|
||||
|
|
|
|||
|
|
@ -1,37 +1,36 @@
|
|||
-- animations
|
||||
return {
|
||||
-- animations
|
||||
{
|
||||
"echasnovski/mini.animate",
|
||||
event = "VeryLazy",
|
||||
opts = function()
|
||||
-- don't use animate when scrolling with the mouse
|
||||
local mouse_scrolled = false
|
||||
for _, scroll in ipairs({ "Up", "Down" }) do
|
||||
local key = "<ScrollWheel" .. scroll .. ">"
|
||||
vim.keymap.set({ "", "i" }, key, function()
|
||||
mouse_scrolled = true
|
||||
return key
|
||||
end, { expr = true })
|
||||
end
|
||||
"echasnovski/mini.animate",
|
||||
recommended = true,
|
||||
event = "VeryLazy",
|
||||
opts = function()
|
||||
-- don't use animate when scrolling with the mouse
|
||||
local mouse_scrolled = false
|
||||
for _, scroll in ipairs({ "Up", "Down" }) do
|
||||
local key = "<ScrollWheel" .. scroll .. ">"
|
||||
vim.keymap.set({ "", "i" }, key, function()
|
||||
mouse_scrolled = true
|
||||
return key
|
||||
end, { expr = true })
|
||||
end
|
||||
|
||||
local animate = require("mini.animate")
|
||||
return {
|
||||
resize = {
|
||||
timing = animate.gen_timing.linear({ duration = 100, unit = "total" }),
|
||||
},
|
||||
scroll = {
|
||||
timing = animate.gen_timing.linear({ duration = 150, unit = "total" }),
|
||||
subscroll = animate.gen_subscroll.equal({
|
||||
predicate = function(total_scroll)
|
||||
if mouse_scrolled then
|
||||
mouse_scrolled = false
|
||||
return false
|
||||
end
|
||||
return total_scroll > 1
|
||||
end,
|
||||
}),
|
||||
},
|
||||
}
|
||||
end,
|
||||
},
|
||||
local animate = require("mini.animate")
|
||||
return {
|
||||
resize = {
|
||||
timing = animate.gen_timing.linear({ duration = 100, unit = "total" }),
|
||||
},
|
||||
scroll = {
|
||||
timing = animate.gen_timing.linear({ duration = 150, unit = "total" }),
|
||||
subscroll = animate.gen_subscroll.equal({
|
||||
predicate = function(total_scroll)
|
||||
if mouse_scrolled then
|
||||
mouse_scrolled = false
|
||||
return false
|
||||
end
|
||||
return total_scroll > 1
|
||||
end,
|
||||
}),
|
||||
},
|
||||
}
|
||||
end,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -63,12 +63,15 @@ return {
|
|||
|
||||
vim.api.nvim_create_autocmd("User", {
|
||||
pattern = "LazyVimStarted",
|
||||
callback = function()
|
||||
callback = function(ev)
|
||||
local stats = require("lazy").stats()
|
||||
local ms = (math.floor(stats.startuptime * 100 + 0.5) / 100)
|
||||
local pad_footer = string.rep(" ", 8)
|
||||
starter.config.footer = pad_footer .. "⚡ Neovim loaded " .. stats.count .. " plugins in " .. ms .. "ms"
|
||||
pcall(starter.refresh)
|
||||
-- INFO: based on @echasnovski's recommendation (thanks a lot!!!)
|
||||
if vim.bo[ev.buf].filetype == "starter" then
|
||||
pcall(starter.refresh)
|
||||
end
|
||||
end,
|
||||
})
|
||||
end,
|
||||
|
|
|
|||
|
|
@ -1,106 +0,0 @@
|
|||
local Config = require("lazyvim.config")
|
||||
|
||||
-- backwards compatibility with the old treesitter config for adding custom parsers
|
||||
local function patch()
|
||||
local parsers = require("nvim-treesitter.parsers")
|
||||
parsers.get_parser_configs = setmetatable({}, {
|
||||
__call = function()
|
||||
return parsers
|
||||
end,
|
||||
})
|
||||
end
|
||||
|
||||
if vim.tbl_contains(Config.json.data.extras, "lazyvim.plugins.extras.ui.treesitter-rewrite") then
|
||||
if vim.fn.executable("tree-sitter") == 0 then
|
||||
LazyVim.error("**treesitter-rewrite** requires the `tree-sitter` executable to be installed")
|
||||
return {}
|
||||
end
|
||||
|
||||
if vim.fn.has("nvim-0.10") == 0 then
|
||||
LazyVim.error("**treesitter-rewrite** requires Neovim >= 0.10")
|
||||
return {}
|
||||
end
|
||||
end
|
||||
|
||||
return {
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
version = false, -- last release is way too old and doesn't work on Windows
|
||||
branch = "main",
|
||||
build = ":TSUpdate",
|
||||
lazy = false,
|
||||
cmd = {},
|
||||
opts = function()
|
||||
patch()
|
||||
return {
|
||||
highlight = { enable = true },
|
||||
indent = { enable = true },
|
||||
ensure_install = {
|
||||
"bash",
|
||||
"c",
|
||||
"diff",
|
||||
"html",
|
||||
"javascript",
|
||||
"jsdoc",
|
||||
"json",
|
||||
"jsonc",
|
||||
"lua",
|
||||
"luadoc",
|
||||
"luap",
|
||||
"markdown",
|
||||
"markdown_inline",
|
||||
"python",
|
||||
"query",
|
||||
"regex",
|
||||
"toml",
|
||||
"tsx",
|
||||
"typescript",
|
||||
"vim",
|
||||
"vimdoc",
|
||||
"xml",
|
||||
"yaml",
|
||||
},
|
||||
}
|
||||
end,
|
||||
init = function() end,
|
||||
---@param opts TSConfig
|
||||
config = function(_, opts)
|
||||
---@return string[]
|
||||
local function norm(ensure)
|
||||
return ensure == nil and {} or type(ensure) == "string" and { ensure } or ensure
|
||||
end
|
||||
|
||||
-- ensure_installed is deprecated, but still supported
|
||||
opts.ensure_install = LazyVim.dedup(vim.list_extend(norm(opts.ensure_install), norm(opts.ensure_installed)))
|
||||
|
||||
require("nvim-treesitter").setup(opts)
|
||||
patch()
|
||||
|
||||
-- backwards compatibility with the old treesitter config for indent
|
||||
if vim.tbl_get(opts, "indent", "enable") then
|
||||
vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()"
|
||||
end
|
||||
|
||||
-- backwards compatibility with the old treesitter config for highlight
|
||||
if vim.tbl_get(opts, "highlight", "enable") then
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
callback = function()
|
||||
pcall(vim.treesitter.start)
|
||||
end,
|
||||
})
|
||||
end
|
||||
end,
|
||||
},
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter-textobjects",
|
||||
enabled = false,
|
||||
},
|
||||
{
|
||||
"windwp/nvim-ts-autotag",
|
||||
enabled = false,
|
||||
},
|
||||
{
|
||||
"RRethy/vim-illuminate",
|
||||
enabled = false,
|
||||
},
|
||||
}
|
||||
|
|
@ -4,17 +4,31 @@ return {
|
|||
{
|
||||
"williamboman/mason.nvim",
|
||||
keys = {
|
||||
{ "<leader>gG",
|
||||
{
|
||||
"<leader>gG",
|
||||
function()
|
||||
LazyVim.terminal.open({ "gitui" }, { esc_esc = false, ctrl_hjkl = false })
|
||||
end,
|
||||
desc = "GitUi (cwd)" },
|
||||
{ "<leader>gg",
|
||||
desc = "GitUi (cwd)",
|
||||
},
|
||||
{
|
||||
"<leader>gg",
|
||||
function()
|
||||
LazyVim.terminal.open({ "gitui" }, { cwd = LazyVim.root.get(), esc_esc = false, ctrl_hjkl = false })
|
||||
end,
|
||||
desc = "GitUi (Root Dir)" }
|
||||
desc = "GitUi (Root Dir)",
|
||||
},
|
||||
},
|
||||
init = function()
|
||||
-- delete lazygit keymap for file history
|
||||
vim.api.nvim_create_autocmd("User", {
|
||||
pattern = "LazyVimKeymaps",
|
||||
once = true,
|
||||
callback = function()
|
||||
pcall(vim.keymap.del, "n", "<leader>gf")
|
||||
end,
|
||||
})
|
||||
end,
|
||||
opts = function(_, opts)
|
||||
opts.ensure_installed = opts.ensure_installed or {}
|
||||
vim.list_extend(opts.ensure_installed, { "gitui" })
|
||||
|
|
|
|||
|
|
@ -5,6 +5,8 @@ M.hl = {}
|
|||
|
||||
M.plugin = {
|
||||
"echasnovski/mini.hipatterns",
|
||||
recommended = true,
|
||||
desc = "Highlight colors in your code. Also includes Tailwind CSS support.",
|
||||
event = "LazyFile",
|
||||
opts = function()
|
||||
local hi = require("mini.hipatterns")
|
||||
|
|
|
|||
|
|
@ -39,7 +39,9 @@ function M.get()
|
|||
end,
|
||||
desc = "Source Action",
|
||||
has = "codeAction",
|
||||
}
|
||||
},
|
||||
{ "]]", function() LazyVim.lsp.words.jump(vim.v.count1) end, has = "documentHighlight", desc = "Next Reference" },
|
||||
{ "[[", function() LazyVim.lsp.words.jump(-vim.v.count1) end, has = "documentHighlight", desc = "Next Reference" },
|
||||
}
|
||||
if LazyVim.has("inc-rename.nvim") then
|
||||
M._keys[#M._keys + 1] = {
|
||||
|
|
|
|||
|
|
@ -74,27 +74,23 @@ return {
|
|||
---@param opts TSConfig
|
||||
config = function(_, opts)
|
||||
if type(opts.ensure_installed) == "table" then
|
||||
---@type table<string, boolean>
|
||||
local added = {}
|
||||
opts.ensure_installed = vim.tbl_filter(function(lang)
|
||||
if added[lang] then
|
||||
return false
|
||||
end
|
||||
added[lang] = true
|
||||
return true
|
||||
end, opts.ensure_installed)
|
||||
opts.ensure_installed = LazyVim.dedup(opts.ensure_installed)
|
||||
end
|
||||
require("nvim-treesitter.configs").setup(opts)
|
||||
vim.schedule(function()
|
||||
require("lazy").load({ plugins = { "nvim-treesitter-textobjects" } })
|
||||
end)
|
||||
end,
|
||||
},
|
||||
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter-textobjects",
|
||||
lazy = true,
|
||||
event = "VeryLazy",
|
||||
enabled = true,
|
||||
config = function()
|
||||
-- If treesitter is already loaded, we need to run config again for textobjects
|
||||
if LazyVim.is_loaded("nvim-treesitter") then
|
||||
local opts = LazyVim.opts("nvim-treesitter")
|
||||
require("nvim-treesitter.configs").setup({ textobjects = opts.textobjects })
|
||||
end
|
||||
|
||||
-- When in diff mode, we want to use the default
|
||||
-- vim text objects c & C instead of the treesitter ones.
|
||||
local move = require("nvim-treesitter.textobjects.move") ---@type table<string,fun(...)>
|
||||
|
|
|
|||
|
|
@ -71,9 +71,9 @@ return {
|
|||
opts = {
|
||||
options = {
|
||||
-- stylua: ignore
|
||||
close_command = function(n) require("mini.bufremove").delete(n, false) end,
|
||||
close_command = function(n) LazyVim.ui.bufremove(n) end,
|
||||
-- stylua: ignore
|
||||
right_mouse_command = function(n) require("mini.bufremove").delete(n, false) end,
|
||||
right_mouse_command = function(n) LazyVim.ui.bufremove(n) end,
|
||||
diagnostics = "nvim_lsp",
|
||||
always_show_bufferline = false,
|
||||
diagnostics_indicator = function(_, _, diag)
|
||||
|
|
@ -95,7 +95,7 @@ return {
|
|||
config = function(_, opts)
|
||||
require("bufferline").setup(opts)
|
||||
-- Fix bufferline when restoring a session
|
||||
vim.api.nvim_create_autocmd("BufAdd", {
|
||||
vim.api.nvim_create_autocmd({ "BufAdd", "BufDelete" }, {
|
||||
callback = function()
|
||||
vim.schedule(function()
|
||||
pcall(nvim_bufferline)
|
||||
|
|
|
|||
|
|
@ -9,16 +9,8 @@ local prios = {
|
|||
["lazyvim.plugins.extras.dap.core"] = 1,
|
||||
}
|
||||
|
||||
local used = {} ---@type table<string, boolean>
|
||||
|
||||
---@type string[]
|
||||
Config.json.data.extras = vim.tbl_filter(function(extra)
|
||||
if used[extra] then
|
||||
return false
|
||||
end
|
||||
used[extra] = true
|
||||
return true
|
||||
end, Config.json.data.extras)
|
||||
Config.json.data.extras = LazyVim.dedup(Config.json.data.extras)
|
||||
|
||||
table.sort(Config.json.data.extras, function(a, b)
|
||||
local pa = prios[a] or 10
|
||||
|
|
|
|||
|
|
@ -16,12 +16,15 @@ local Text = require("lazy.view.text")
|
|||
---@field desc? string
|
||||
---@field enabled boolean
|
||||
---@field managed boolean
|
||||
---@field recommended? boolean
|
||||
---@field row? number
|
||||
---@field section? string
|
||||
---@field plugins string[]
|
||||
---@field optional string[]
|
||||
|
||||
---@class lazyvim.util.extras
|
||||
local M = {}
|
||||
M.buf = 0
|
||||
|
||||
---@type LazyExtraSource[]
|
||||
M.sources = {
|
||||
|
|
@ -33,6 +36,24 @@ M.ns = vim.api.nvim_create_namespace("lazyvim.extras")
|
|||
---@type string[]
|
||||
M.state = nil
|
||||
|
||||
---@param opts {ft?: string|string[], root?: string|string[]}
|
||||
---@return boolean
|
||||
function M.wants(opts)
|
||||
if opts.ft then
|
||||
opts.ft = type(opts.ft) == "string" and { opts.ft } or opts.ft
|
||||
for _, f in ipairs(opts.ft) do
|
||||
if vim.bo[M.buf].filetype == f then
|
||||
return true
|
||||
end
|
||||
end
|
||||
end
|
||||
if opts.root then
|
||||
opts.root = type(opts.root) == "string" and { opts.root } or opts.root
|
||||
return #LazyVim.root.detectors.pattern(M.buf, opts.root) > 0
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
---@return LazyExtra[]
|
||||
function M.get()
|
||||
M.state = M.state or LazyConfig.spec.modules
|
||||
|
|
@ -74,6 +95,12 @@ function M.get_extra(source, modname)
|
|||
table.sort(plugins)
|
||||
table.sort(optional)
|
||||
|
||||
---@type boolean|(fun():boolean?)|nil
|
||||
local recommended = require(modname).recommended or false
|
||||
if type(recommended) == "function" then
|
||||
recommended = recommended() or false
|
||||
end
|
||||
|
||||
---@type LazyExtra
|
||||
return {
|
||||
source = source,
|
||||
|
|
@ -81,6 +108,7 @@ function M.get_extra(source, modname)
|
|||
module = modname,
|
||||
enabled = enabled,
|
||||
desc = require(modname).desc,
|
||||
recommended = recommended,
|
||||
managed = vim.tbl_contains(Config.json.data.extras, modname) or not enabled,
|
||||
plugins = plugins,
|
||||
optional = optional,
|
||||
|
|
@ -97,6 +125,7 @@ local X = {}
|
|||
---@return LazyExtraView
|
||||
function X.new()
|
||||
local self = setmetatable({}, { __index = X })
|
||||
M.buf = vim.api.nvim_get_current_buf()
|
||||
self.float = Float.new({ title = "LazyVim Extras" })
|
||||
self.float:on_key("x", function()
|
||||
self:toggle()
|
||||
|
|
@ -186,8 +215,14 @@ function X:render()
|
|||
:append("<x>", "LazySpecial")
|
||||
:append(" key", "LazyComment")
|
||||
:nl()
|
||||
for _, extra in ipairs(self.extras) do
|
||||
extra.section = nil
|
||||
end
|
||||
self:section({ enabled = true, title = "Enabled" })
|
||||
self:section({ enabled = false, title = "Disabled" })
|
||||
self:section({ recommended = true, include = "^lang%.", title = "Recommended Languages", empty = false })
|
||||
self:section({ recommended = true, title = "Recommended Plugins", empty = false })
|
||||
self:section({ title = "Plugins", exclude = "^lang%." })
|
||||
self:section({ title = "Languages" })
|
||||
end
|
||||
|
||||
---@param extra LazyExtra
|
||||
|
|
@ -206,6 +241,9 @@ function X:extra(extra)
|
|||
self.text:append(" " .. LazyConfig.options.ui.icons.not_loaded .. " ", hl)
|
||||
end
|
||||
self.text:append(extra.name)
|
||||
if extra.recommended then
|
||||
self.text:append(" "):append(LazyConfig.options.ui.icons.favorite or " ", "LazyCommit")
|
||||
end
|
||||
if extra.source.name ~= "LazyVim" then
|
||||
self.text:append(" "):append(LazyConfig.options.ui.icons.event .. " " .. extra.source.name, "LazyReasonEvent")
|
||||
end
|
||||
|
|
@ -221,16 +259,25 @@ function X:extra(extra)
|
|||
self.text:nl()
|
||||
end
|
||||
|
||||
---@param opts {enabled?:boolean, title?:string}
|
||||
---@param opts {enabled?:boolean, title:string, recommended?:boolean, include?:string, exclude?:string, empty?:boolean}
|
||||
function X:section(opts)
|
||||
opts = opts or {}
|
||||
---@type LazyExtra[]
|
||||
local extras = vim.tbl_filter(function(extra)
|
||||
return opts.enabled == nil or extra.enabled == opts.enabled
|
||||
return extra.section == nil
|
||||
and (opts.enabled == nil or extra.enabled == opts.enabled)
|
||||
and (opts.recommended == nil or extra.recommended == opts.recommended)
|
||||
and (opts.include == nil or extra.name:find(opts.include))
|
||||
and (opts.exclude == nil or not extra.name:find(opts.exclude))
|
||||
end, self.extras)
|
||||
|
||||
if opts.empty == false and #extras == 0 then
|
||||
return
|
||||
end
|
||||
|
||||
self.text:nl():append(opts.title .. ":", "LazyH2"):append(" (" .. #extras .. ")", "LazyComment"):nl()
|
||||
for _, extra in ipairs(extras) do
|
||||
extra.section = opts.title
|
||||
self:extra(extra)
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ local LazyUtil = require("lazy.core.util")
|
|||
---@field news lazyvim.util.news
|
||||
---@field json lazyvim.util.json
|
||||
---@field lualine lazyvim.util.lualine
|
||||
---@field mini lazyvim.util.mini
|
||||
local M = {}
|
||||
|
||||
---@type table<string, string|string[]>
|
||||
|
|
@ -126,11 +127,15 @@ function M.lazy_notify()
|
|||
timer:start(500, 0, replay)
|
||||
end
|
||||
|
||||
function M.is_loaded(name)
|
||||
local Config = require("lazy.core.config")
|
||||
return Config.plugins[name] and Config.plugins[name]._.loaded
|
||||
end
|
||||
|
||||
---@param name string
|
||||
---@param fn fun(name:string)
|
||||
function M.on_load(name, fn)
|
||||
local Config = require("lazy.core.config")
|
||||
if Config.plugins[name] and Config.plugins[name]._.loaded then
|
||||
if M.is_loaded(name) then
|
||||
fn(name)
|
||||
else
|
||||
vim.api.nvim_create_autocmd("User", {
|
||||
|
|
@ -185,4 +190,11 @@ function M.dedup(list)
|
|||
return ret
|
||||
end
|
||||
|
||||
M.CREATE_UNDO = vim.api.nvim_replace_termcodes("<c-G>u", true, true, true)
|
||||
function M.create_undo()
|
||||
if vim.api.nvim_get_mode().mode == "i" then
|
||||
vim.api.nvim_feedkeys(M.CREATE_UNDO, "n", false)
|
||||
end
|
||||
end
|
||||
|
||||
return M
|
||||
|
|
|
|||
|
|
@ -78,6 +78,13 @@ function M.migrate()
|
|||
return extra == "lazyvim.plugins.extras.editor.symbols-outline" and "lazyvim.plugins.extras.editor.outline"
|
||||
or extra
|
||||
end, json.data.extras or {})
|
||||
elseif json.data.version == 3 then
|
||||
json.data.extras = vim.tbl_filter(function(extra)
|
||||
return not (
|
||||
extra == "lazyvim.plugins.extras.coding.mini-ai"
|
||||
or extra == "lazyvim.plugins.extras.ui.treesitter-rewrite"
|
||||
)
|
||||
end, json.data.extras or {})
|
||||
end
|
||||
|
||||
M.save()
|
||||
|
|
|
|||
|
|
@ -152,7 +152,7 @@ function M.blame_line(opts)
|
|||
border = "rounded",
|
||||
}, opts or {})
|
||||
local cursor = vim.api.nvim_win_get_cursor(0)
|
||||
local line = cursor[1] - 1
|
||||
local line = cursor[1]
|
||||
local file = vim.api.nvim_buf_get_name(0)
|
||||
local cmd = { "git", "log", "-n", opts.count, "-u", "-L", line .. ",+1:" .. file }
|
||||
return require("lazy.util").float_cmd(cmd, opts)
|
||||
|
|
|
|||
|
|
@ -158,12 +158,6 @@ function M.words.setup(opts)
|
|||
end
|
||||
end,
|
||||
})
|
||||
vim.keymap.set("n", "]]", function()
|
||||
M.words.jump(vim.v.count1)
|
||||
end, { buffer = buf, desc = "Next reference" })
|
||||
vim.keymap.set("n", "[[", function()
|
||||
M.words.jump(-vim.v.count1)
|
||||
end, { buffer = buf, desc = "Previous reference" })
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
|
|
|||
112
lua/lazyvim/util/mini.lua
Normal file
112
lua/lazyvim/util/mini.lua
Normal file
|
|
@ -0,0 +1,112 @@
|
|||
---@class lazyvim.util.mini
|
||||
local M = {}
|
||||
|
||||
---@alias Mini.ai.loc {line:number, col:number}
|
||||
---@alias Mini.ai.region {from:Mini.ai.loc, to:Mini.ai.loc}
|
||||
|
||||
-- Mini.ai indent text object
|
||||
-- For "a", it will include the non-whitespace line surrounding the indent block.
|
||||
-- "a" is line-wise, "i" is character-wise.
|
||||
function M.ai_indent(ai_type)
|
||||
local spaces = (" "):rep(vim.o.tabstop)
|
||||
local lines = vim.api.nvim_buf_get_lines(0, 0, -1, false)
|
||||
local indents = {} ---@type {line: number, indent: number, text: string}[]
|
||||
|
||||
for l, line in ipairs(lines) do
|
||||
if not line:find("^%s*$") then
|
||||
indents[#indents + 1] = { line = l, indent = #line:gsub("\t", spaces):match("^%s*"), text = line }
|
||||
end
|
||||
end
|
||||
|
||||
local ret = {} ---@type (Mini.ai.region | {indent: number})[]
|
||||
|
||||
for i = 1, #indents do
|
||||
if i == 1 or indents[i - 1].indent < indents[i].indent then
|
||||
local from, to = i, i
|
||||
for j = i + 1, #indents do
|
||||
if indents[j].indent < indents[i].indent then
|
||||
break
|
||||
end
|
||||
to = j
|
||||
end
|
||||
from = ai_type == "a" and from > 1 and from - 1 or from
|
||||
to = ai_type == "a" and to < #indents and to + 1 or to
|
||||
ret[#ret + 1] = {
|
||||
indent = indents[i].indent,
|
||||
from = { line = indents[from].line, col = ai_type == "a" and 1 or indents[from].indent + 1 },
|
||||
to = { line = indents[to].line, col = #indents[to].text },
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
return ret
|
||||
end
|
||||
|
||||
-- taken from MiniExtra.gen_ai_spec.buffer
|
||||
function M.ai_buffer(ai_type)
|
||||
local start_line, end_line = 1, vim.fn.line("$")
|
||||
if ai_type == "i" then
|
||||
-- Skip first and last blank lines for `i` textobject
|
||||
local first_nonblank, last_nonblank = vim.fn.nextnonblank(start_line), vim.fn.prevnonblank(end_line)
|
||||
-- Do nothing for buffer with all blanks
|
||||
if first_nonblank == 0 or last_nonblank == 0 then
|
||||
return { from = { line = start_line, col = 1 } }
|
||||
end
|
||||
start_line, end_line = first_nonblank, last_nonblank
|
||||
end
|
||||
|
||||
local to_col = math.max(vim.fn.getline(end_line):len(), 1)
|
||||
return { from = { line = start_line, col = 1 }, to = { line = end_line, col = to_col } }
|
||||
end
|
||||
|
||||
-- register all text objects with which-key
|
||||
function M.ai_whichkey()
|
||||
---@type table<string, string|table>
|
||||
local i = {
|
||||
[" "] = "Whitespace",
|
||||
['"'] = 'Balanced "',
|
||||
["'"] = "Balanced '",
|
||||
["`"] = "Balanced `",
|
||||
["("] = "Balanced (",
|
||||
[")"] = "Balanced ) including white-space",
|
||||
[">"] = "Balanced > including white-space",
|
||||
["<lt>"] = "Balanced <",
|
||||
["]"] = "Balanced ] including white-space",
|
||||
["["] = "Balanced [",
|
||||
["}"] = "Balanced } including white-space",
|
||||
["{"] = "Balanced {",
|
||||
["?"] = "User Prompt",
|
||||
_ = "Underscore",
|
||||
a = "Argument",
|
||||
b = "Balanced ), ], }",
|
||||
c = "Class",
|
||||
d = "Digit(s)",
|
||||
e = "Word in CamelCase & snake_case",
|
||||
f = "Function",
|
||||
g = "Entire file",
|
||||
i = "Indent",
|
||||
o = "Block, conditional, loop",
|
||||
q = "Quote `, \", '",
|
||||
t = "Tag",
|
||||
u = "Use/call function & method",
|
||||
U = "Use/call without dot in name",
|
||||
}
|
||||
local a = vim.deepcopy(i)
|
||||
for k, v in pairs(a) do
|
||||
a[k] = v:gsub(" including.*", "")
|
||||
end
|
||||
|
||||
local ic = vim.deepcopy(i)
|
||||
local ac = vim.deepcopy(a)
|
||||
for key, name in pairs({ n = "Next", l = "Last" }) do
|
||||
i[key] = vim.tbl_extend("force", { name = "Inside " .. name .. " textobject" }, ic)
|
||||
a[key] = vim.tbl_extend("force", { name = "Around " .. name .. " textobject" }, ac)
|
||||
end
|
||||
require("which-key").register({
|
||||
mode = { "o", "x" },
|
||||
i = i,
|
||||
a = a,
|
||||
})
|
||||
end
|
||||
|
||||
return M
|
||||
|
|
@ -11,6 +11,8 @@ M.deprecated_extras = {
|
|||
["lazyvim.plugins.extras.linting.nvim-lint"] = "`nvim-lint` is now the default **LazyVim** linter.",
|
||||
["lazyvim.plugins.extras.ui.dashboard"] = "`dashboard.nvim` is now the default **LazyVim** starter.",
|
||||
["lazyvim.plugins.extras.coding.native_snippets"] = "Native snippets are now the default for **Neovim >= 0.10**",
|
||||
["lazyvim.plugins.extras.ui.treesitter-rewrite"] = "Disabled `treesitter-rewrite` extra for now. Not ready yet.",
|
||||
["lazyvim.plugins.extras.coding.mini-ai"] = "`mini.ai` is now a core LazyVim plugin (again)",
|
||||
}
|
||||
|
||||
M.deprecated_modules = {
|
||||
|
|
|
|||
|
|
@ -47,7 +47,17 @@ end
|
|||
function M.detectors.pattern(buf, patterns)
|
||||
patterns = type(patterns) == "string" and { patterns } or patterns
|
||||
local path = M.bufpath(buf) or vim.uv.cwd()
|
||||
local pattern = vim.fs.find(patterns, { path = path, upward = true })[1]
|
||||
local pattern = vim.fs.find(function(name)
|
||||
for _, p in ipairs(patterns) do
|
||||
if name == p then
|
||||
return true
|
||||
end
|
||||
if p:sub(1, 1) == "*" and name:find(p:sub(2) .. "$") then
|
||||
return true
|
||||
end
|
||||
end
|
||||
return false
|
||||
end, { path = path, upward = true })[1]
|
||||
return pattern and { vim.fs.dirname(pattern) } or {}
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ function M.inlay_hints(buf, value)
|
|||
ih(buf, value)
|
||||
elseif type(ih) == "table" and ih.enable then
|
||||
if value == nil then
|
||||
value = not ih.is_enabled(buf)
|
||||
value = not ih.is_enabled({ bufnr = buf or 0 })
|
||||
end
|
||||
ih.enable(value, { bufnr = buf })
|
||||
end
|
||||
|
|
|
|||
|
|
@ -208,8 +208,10 @@ function M.foldexpr()
|
|||
return "0"
|
||||
end
|
||||
|
||||
function M.bufremove()
|
||||
local buf = vim.api.nvim_get_current_buf()
|
||||
---@param buf number?
|
||||
function M.bufremove(buf)
|
||||
buf = buf or 0
|
||||
buf = buf == 0 and vim.api.nvim_get_current_buf() or buf
|
||||
|
||||
if vim.bo.modified then
|
||||
local choice = vim.fn.confirm(("Save changes to %q?"):format(vim.fn.bufname()), "&Yes\n&No\n&Cancel")
|
||||
|
|
@ -244,7 +246,9 @@ function M.bufremove()
|
|||
vim.api.nvim_win_set_buf(win, new_buf)
|
||||
end)
|
||||
end
|
||||
vim.api.nvim_buf_delete(buf, { force = true })
|
||||
if vim.api.nvim_buf_is_valid(buf) then
|
||||
pcall(vim.cmd, "bdelete! " .. buf)
|
||||
end
|
||||
end
|
||||
|
||||
return M
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue