Compare commits
49 Commits
Author | SHA1 | Date | |
---|---|---|---|
6ac331b588 | |||
e229988a98 | |||
11a8a6bea7 | |||
4ebda08d49 | |||
6853b785d9 | |||
68ff818a5b | |||
4312e5e283 | |||
db31b4073b | |||
3986169823 | |||
e5babf289c | |||
b32b4fd581 | |||
4b758c40c0 | |||
e01ad513aa | |||
7831fc94ca | |||
4558407574 | |||
09eafc60ef | |||
9a6b0f8928 | |||
f589154268 | |||
60e5707013 | |||
028f69c03c | |||
58ddf405e0 | |||
9e1f835223 | |||
37953585bb | |||
61fae7d23f | |||
6dfeeb8322 | |||
b651560ad0 | |||
1e1b68d633 | |||
eab464d52d | |||
c400cf0014 | |||
a5c9708736 | |||
99598ef7c7 | |||
ef5ec9a3bf | |||
e7130c8250 | |||
e55ab411b4 | |||
fa3170d422 | |||
786a061eaa | |||
0bb628053b | |||
e996eed750 | |||
8df44b3bb5 | |||
82da2440e4 | |||
fad3777296 | |||
ea3155aef6 | |||
98b51a608c | |||
0ac8f6fb3b | |||
b8c7e70c80 | |||
d73aee4a93 | |||
ae77bfda89 | |||
5c8cefaf40 | |||
7d8b3e8ef9 |
105
CHANGELOG.md
105
CHANGELOG.md
@ -1,5 +1,110 @@
|
||||
# Changelog
|
||||
|
||||
## [10.8.1](https://github.com/LazyVim/LazyVim/compare/v10.8.0...v10.8.1) (2023-11-30)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **lsp:** detect if using nvim-0.10 and use new inlay_hint.enable method ([#2007](https://github.com/LazyVim/LazyVim/issues/2007)) ([6853b78](https://github.com/LazyVim/LazyVim/commit/6853b785d9916be6ffe4965aefd8554ed276f802))
|
||||
* **lsp:** inlay hints on stable. See [#2007](https://github.com/LazyVim/LazyVim/issues/2007) ([e229988](https://github.com/LazyVim/LazyVim/commit/e229988a98a81b000fda3aadbb4fc404aeaa599e))
|
||||
* **ui:** signcolumn signs on nightly. Fixes [#2039](https://github.com/LazyVim/LazyVim/issues/2039) ([11a8a6b](https://github.com/LazyVim/LazyVim/commit/11a8a6bea7a26ca5257fa4cbef90e0abdb22c349))
|
||||
|
||||
## [10.8.0](https://github.com/LazyVim/LazyVim/compare/v10.7.1...v10.8.0) (2023-11-04)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **catppuccin:** enable more integrations ([#1922](https://github.com/LazyVim/LazyVim/issues/1922)) ([4312e5e](https://github.com/LazyVim/LazyVim/commit/4312e5e28348560e018da4535de27dfcc675c32b))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **extras:** dont show extras that give errors (user's extras). Fixes [#1895](https://github.com/LazyVim/LazyVim/issues/1895) ([b32b4fd](https://github.com/LazyVim/LazyVim/commit/b32b4fd581018cf14bf30ae4cd8d94cd43552813))
|
||||
* **mini.indentscope:** remove duplicated filetype ([#1871](https://github.com/LazyVim/LazyVim/issues/1871)) ([09eafc6](https://github.com/LazyVim/LazyVim/commit/09eafc60eff2ba7d7b78c1717d07ce26b762a8a8))
|
||||
* **plugin:** LazyFile now properly deals with deleted buffers. Fixes [#1877](https://github.com/LazyVim/LazyVim/issues/1877) ([4558407](https://github.com/LazyVim/LazyVim/commit/4558407574d0cdbe55720ab349df201bd4d5f5de))
|
||||
* **sessions:** added folds to sessions ([e01ad51](https://github.com/LazyVim/LazyVim/commit/e01ad513aa4f50bdb385a7454c9e1ec3a0d5dc94))
|
||||
* **spectre:** don't build nvim-spectre ([3986169](https://github.com/LazyVim/LazyVim/commit/39861698235c03d30096b3fb315ce38eeaef95e2))
|
||||
|
||||
## [10.7.1](https://github.com/LazyVim/LazyVim/compare/v10.7.0...v10.7.1) (2023-10-25)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **catppuccin:** trouble integration. Fixes [#1872](https://github.com/LazyVim/LazyVim/issues/1872) ([f589154](https://github.com/LazyVim/LazyVim/commit/f589154268dfcb3e8f91075791a0a618c97fe59d))
|
||||
* **util:** pcall deletion of lazy_file augroup. See [#1863](https://github.com/LazyVim/LazyVim/issues/1863) ([60e5707](https://github.com/LazyVim/LazyVim/commit/60e57070131f4c544e17541610415d4d51769d62))
|
||||
|
||||
## [10.7.0](https://github.com/LazyVim/LazyVim/compare/v10.6.0...v10.7.0) (2023-10-25)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **nvim:** extend j/k enhancements to up/down arrows ([#1833](https://github.com/LazyVim/LazyVim/issues/1833)) ([9e1f835](https://github.com/LazyVim/LazyVim/commit/9e1f83522396d141455de8f2d5e0b3e8beca8d0a))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **extras.python-semshi:** improve highlights ([#1845](https://github.com/LazyVim/LazyVim/issues/1845)) ([3795358](https://github.com/LazyVim/LazyVim/commit/37953585bb06b3ffbdb37b40bb586590fde2b2a9))
|
||||
* fix jdtls not spwaning in windows ([#1864](https://github.com/LazyVim/LazyVim/issues/1864)) ([61fae7d](https://github.com/LazyVim/LazyVim/commit/61fae7d23f5689a9112b265f4bfb8468a131ae66))
|
||||
* **lang:** add cmakelint to ensure installed list ([#1826](https://github.com/LazyVim/LazyVim/issues/1826)) ([58ddf40](https://github.com/LazyVim/LazyVim/commit/58ddf405e09da967eca29169571114b01172fff3))
|
||||
|
||||
## [10.6.0](https://github.com/LazyVim/LazyVim/compare/v10.5.0...v10.6.0) (2023-10-25)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **telescope:** sort buffers with lastused and mru ([99598ef](https://github.com/LazyVim/LazyVim/commit/99598ef7c7c15c980b6d5c36f8e9cefd745fcf34))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **markdown:** create default numbered Headline groups for colorschemes that dont support them. Fixes [#1822](https://github.com/LazyVim/LazyVim/issues/1822) ([eab464d](https://github.com/LazyVim/LazyVim/commit/eab464d52d28d4e24e5d189ee627c96e720e057c))
|
||||
* **mini.hipatterns:** use `extmark_opts` instead of soft deprecated `priority` ([#1841](https://github.com/LazyVim/LazyVim/issues/1841)) ([e55ab41](https://github.com/LazyVim/LazyVim/commit/e55ab411b42c75919b33b87e19714b5c595316d4))
|
||||
* **treesitter:** make treesitter queries available at startup. See [#1816](https://github.com/LazyVim/LazyVim/issues/1816) Fixes [#1858](https://github.com/LazyVim/LazyVim/issues/1858) ([1e1b68d](https://github.com/LazyVim/LazyVim/commit/1e1b68d633d4bd4faa912ba5f49ab6b8601dc0c9))
|
||||
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* **markdown:** prevent headlines.nvim slowing down initial rendering with `nvim README.md` ([b651560](https://github.com/LazyVim/LazyVim/commit/b651560ad0ee750c96bca6866cfdc008e75d397c))
|
||||
* **ui:** wrap treesitter.foldexpr and cache get_parser during a event loop tick. Fixes [#1846](https://github.com/LazyVim/LazyVim/issues/1846) ([a5c9708](https://github.com/LazyVim/LazyVim/commit/a5c9708736f6ecd3e3413ad0ca34b7b1fa3d4862))
|
||||
|
||||
## [10.5.0](https://github.com/LazyVim/LazyVim/compare/v10.4.4...v10.5.0) (2023-10-19)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **dashboard:** remove unnecessary brackets from keys ([#1791](https://github.com/LazyVim/LazyVim/issues/1791)) ([d73aee4](https://github.com/LazyVim/LazyVim/commit/d73aee4a934b0aa12e07039da9e2df0215ba2cba))
|
||||
* **typescript:** added remove unused imports ([#1794](https://github.com/LazyVim/LazyVim/issues/1794)) ([8df44b3](https://github.com/LazyVim/LazyVim/commit/8df44b3bb54483e42a27dc30a8b343acc5d5d242))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **conform:** allow overriding all conform format options. Fixes [#1790](https://github.com/LazyVim/LazyVim/issues/1790) ([ea3155a](https://github.com/LazyVim/LazyVim/commit/ea3155aef6d47e744cb2b4a7a3b567288d780f8d))
|
||||
* **nvim-ts-autotag:** make it actually work :) ([82da244](https://github.com/LazyVim/LazyVim/commit/82da2440e4c9d7e604cf998aee0655f78ddfdd5c))
|
||||
* **tabnine:** run `:CmpTabnineHub` automatically on build ([#1788](https://github.com/LazyVim/LazyVim/issues/1788)) ([fad3777](https://github.com/LazyVim/LazyVim/commit/fad37772967f06c65d6f0b52c2ea6f190b3218ee))
|
||||
* **treesitter-context:** set default max_lines=3 ([0ac8f6f](https://github.com/LazyVim/LazyVim/commit/0ac8f6fb3b1705c2b675a0e3cbee4968370f047a))
|
||||
|
||||
## [10.5.0](https://github.com/LazyVim/LazyVim/compare/v10.4.4...v10.5.0) (2023-10-19)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **dashboard:** remove unnecessary brackets from keys ([#1791](https://github.com/LazyVim/LazyVim/issues/1791)) ([d73aee4](https://github.com/LazyVim/LazyVim/commit/d73aee4a934b0aa12e07039da9e2df0215ba2cba))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **conform:** allow overriding all conform format options. Fixes [#1790](https://github.com/LazyVim/LazyVim/issues/1790) ([ea3155a](https://github.com/LazyVim/LazyVim/commit/ea3155aef6d47e744cb2b4a7a3b567288d780f8d))
|
||||
* **nvim-ts-autotag:** make it actually work :) ([82da244](https://github.com/LazyVim/LazyVim/commit/82da2440e4c9d7e604cf998aee0655f78ddfdd5c))
|
||||
* **tabnine:** run `:CmpTabnineHub` automatically on build ([#1788](https://github.com/LazyVim/LazyVim/issues/1788)) ([fad3777](https://github.com/LazyVim/LazyVim/commit/fad37772967f06c65d6f0b52c2ea6f190b3218ee))
|
||||
* **treesitter-context:** set default max_lines=3 ([0ac8f6f](https://github.com/LazyVim/LazyVim/commit/0ac8f6fb3b1705c2b675a0e3cbee4968370f047a))
|
||||
|
||||
## [10.4.4](https://github.com/LazyVim/LazyVim/compare/v10.4.3...v10.4.4) (2023-10-18)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **project:** don't let `project.nvim` change the cwd. Leads to too much confusion ([7d8b3e8](https://github.com/LazyVim/LazyVim/commit/7d8b3e8ef96f91f96c8e3a0ba62dfab270debf9f))
|
||||
|
||||
## [10.4.3](https://github.com/LazyVim/LazyVim/compare/v10.4.2...v10.4.3) (2023-10-17)
|
||||
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2023 October 17
|
||||
*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2023 November 30
|
||||
|
||||
==============================================================================
|
||||
Table of Contents *LazyVim-table-of-contents*
|
||||
|
@ -3,7 +3,7 @@ local Util = require("lazyvim.util")
|
||||
---@class LazyVimConfig: LazyVimOptions
|
||||
local M = {}
|
||||
|
||||
M.version = "10.4.3" -- x-release-please-version
|
||||
M.version = "10.8.1" -- x-release-please-version
|
||||
|
||||
---@class LazyVimOptions
|
||||
local defaults = {
|
||||
|
@ -7,7 +7,9 @@ local map = Util.safe_keymap_set
|
||||
|
||||
-- better up/down
|
||||
map({ "n", "x" }, "j", "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true })
|
||||
map({ "n", "x" }, "<Down>", "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true })
|
||||
map({ "n", "x" }, "k", "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true })
|
||||
map({ "n", "x" }, "<Up>", "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true })
|
||||
|
||||
-- Move to window using the <ctrl> hjkl keys
|
||||
map("n", "<C-h>", "<C-w>h", { desc = "Go to left window", remap = true })
|
||||
@ -117,8 +119,8 @@ map("n", "<leader>ul", function() Util.toggle.number() end, { desc = "Toggle Lin
|
||||
map("n", "<leader>ud", function() Util.toggle.diagnostics() end, { desc = "Toggle Diagnostics" })
|
||||
local conceallevel = vim.o.conceallevel > 0 and vim.o.conceallevel or 3
|
||||
map("n", "<leader>uc", function() Util.toggle("conceallevel", false, {0, conceallevel}) end, { desc = "Toggle Conceal" })
|
||||
if vim.lsp.inlay_hint then
|
||||
map("n", "<leader>uh", function() vim.lsp.inlay_hint(0, nil) end, { desc = "Toggle Inlay Hints" })
|
||||
if vim.lsp.buf.inlay_hint or vim.lsp.inlay_hint then
|
||||
map( "n", "<leader>uh", function() Util.toggle.inlay_hints() end, { desc = "Toggle Inlay Hints" })
|
||||
end
|
||||
map("n", "<leader>uT", function() if vim.b.ts_highlight then vim.treesitter.stop() else vim.treesitter.start() end end, { desc = "Toggle Treesitter Highlight" })
|
||||
|
||||
|
@ -34,7 +34,7 @@ opt.pumblend = 10 -- Popup blend
|
||||
opt.pumheight = 10 -- Maximum number of entries in a popup
|
||||
opt.relativenumber = true -- Relative line numbers
|
||||
opt.scrolloff = 4 -- Lines of context
|
||||
opt.sessionoptions = { "buffers", "curdir", "tabpages", "winsize", "help", "globals", "skiprtp" }
|
||||
opt.sessionoptions = { "buffers", "curdir", "tabpages", "winsize", "help", "globals", "skiprtp", "folds" }
|
||||
opt.shiftround = true -- Round indent
|
||||
opt.shiftwidth = 2 -- Size of an indent
|
||||
opt.shortmess:append({ W = true, I = true, c = true, C = true })
|
||||
@ -82,7 +82,7 @@ end
|
||||
-- HACK: causes freezes on <= 0.9, so only enable on >= 0.10 for now
|
||||
if vim.fn.has("nvim-0.10") == 1 then
|
||||
vim.opt.foldmethod = "expr"
|
||||
vim.opt.foldexpr = "v:lua.vim.treesitter.foldexpr()"
|
||||
vim.opt.foldexpr = "v:lua.require'lazyvim.util'.ui.foldexpr()"
|
||||
else
|
||||
vim.opt.foldmethod = "indent"
|
||||
end
|
||||
|
@ -14,14 +14,19 @@ return {
|
||||
name = "catppuccin",
|
||||
opts = {
|
||||
integrations = {
|
||||
aerial = true,
|
||||
alpha = true,
|
||||
cmp = true,
|
||||
dashboard = true,
|
||||
flash = true,
|
||||
gitsigns = true,
|
||||
headlines = true,
|
||||
illuminate = true,
|
||||
indent_blankline = { enabled = true },
|
||||
leap = true,
|
||||
lsp_trouble = true,
|
||||
mason = true,
|
||||
markdown = true,
|
||||
mini = true,
|
||||
native_lsp = {
|
||||
enabled = true,
|
||||
@ -34,12 +39,13 @@ return {
|
||||
},
|
||||
navic = { enabled = true, custom_bg = "lualine" },
|
||||
neotest = true,
|
||||
neotree = true,
|
||||
noice = true,
|
||||
notify = true,
|
||||
neotree = true,
|
||||
semantic_tokens = true,
|
||||
telescope = true,
|
||||
treesitter = true,
|
||||
treesitter_context = true,
|
||||
which_key = true,
|
||||
},
|
||||
},
|
||||
|
@ -52,7 +52,7 @@ return {
|
||||
end,
|
||||
opts = {
|
||||
sources = { "filesystem", "buffers", "git_status", "document_symbols" },
|
||||
open_files_do_not_replace_types = { "terminal", "Trouble", "qf", "Outline" },
|
||||
open_files_do_not_replace_types = { "terminal", "Trouble", "trouble", "qf", "Outline" },
|
||||
filesystem = {
|
||||
bind_to_cwd = false,
|
||||
follow_current_file = { enabled = true },
|
||||
@ -98,6 +98,7 @@ return {
|
||||
-- search/replace in multiple files
|
||||
{
|
||||
"nvim-pack/nvim-spectre",
|
||||
build = false,
|
||||
cmd = "Spectre",
|
||||
opts = { open_cmd = "noswapfile vnew" },
|
||||
-- stylua: ignore
|
||||
@ -127,12 +128,16 @@ return {
|
||||
},
|
||||
},
|
||||
keys = {
|
||||
{ "<leader>,", "<cmd>Telescope buffers show_all_buffers=true<cr>", desc = "Switch Buffer" },
|
||||
{
|
||||
"<leader>,",
|
||||
"<cmd>Telescope buffers sort_mru=true sort_lastused=true<cr>",
|
||||
desc = "Switch Buffer",
|
||||
},
|
||||
{ "<leader>/", Util.telescope("live_grep"), desc = "Grep (root dir)" },
|
||||
{ "<leader>:", "<cmd>Telescope command_history<cr>", desc = "Command History" },
|
||||
{ "<leader><space>", Util.telescope("files"), desc = "Find Files (root dir)" },
|
||||
-- find
|
||||
{ "<leader>fb", "<cmd>Telescope buffers<cr>", desc = "Buffers" },
|
||||
{ "<leader>fb", "<cmd>Telescope buffers sort_mru=true sort_lastused=true<cr>", desc = "Buffers" },
|
||||
{ "<leader>fc", Util.telescope.config_files(), desc = "Find Config File" },
|
||||
{ "<leader>ff", Util.telescope("files"), desc = "Find Files (root dir)" },
|
||||
{ "<leader>fF", Util.telescope("files", { cwd = false }), desc = "Find Files (cwd)" },
|
||||
|
@ -5,10 +5,12 @@ return {
|
||||
{
|
||||
"nvim-cmp",
|
||||
dependencies = {
|
||||
-- Add TabNine support, make sure you run :CmpTabnineHub after installation.
|
||||
{
|
||||
"tzachar/cmp-tabnine",
|
||||
build = Util.is_win() and "pwsh -noni .\\install.ps1" or "./install.sh",
|
||||
build = {
|
||||
Util.is_win() and "pwsh -noni .\\install.ps1" or "./install.sh",
|
||||
":CmpTabnineHub",
|
||||
},
|
||||
dependencies = "hrsh7th/nvim-cmp",
|
||||
opts = {
|
||||
max_lines = 1000,
|
||||
|
@ -30,7 +30,7 @@ return {
|
||||
"mason.nvim",
|
||||
opts = function(_, opts)
|
||||
opts.ensure_installed = opts.ensure_installed or {}
|
||||
vim.list_extend(opts.ensure_installed, { "cmakelang" })
|
||||
vim.list_extend(opts.ensure_installed, { "cmakelang", "cmakelint" })
|
||||
end,
|
||||
},
|
||||
{
|
||||
|
@ -85,7 +85,7 @@ return {
|
||||
|
||||
-- How to run jdtls. This can be overridden to a full java command-line
|
||||
-- if the Python wrapper script doesn't suffice.
|
||||
cmd = { "jdtls" },
|
||||
cmd = { vim.fn.exepath("jdtls") },
|
||||
full_cmd = function(opts)
|
||||
local fname = vim.api.nvim_buf_get_name(0)
|
||||
local root_dir = opts.root_dir(fname)
|
||||
|
@ -67,13 +67,24 @@ return {
|
||||
opts = function()
|
||||
local opts = {}
|
||||
for _, ft in ipairs({ "markdown", "norg", "rmd", "org" }) do
|
||||
opts[ft] = { headline_highlights = {} }
|
||||
opts[ft] = {
|
||||
headline_highlights = {},
|
||||
}
|
||||
for i = 1, 6 do
|
||||
table.insert(opts[ft].headline_highlights, "Headline" .. i)
|
||||
local hl = "Headline" .. i
|
||||
vim.api.nvim_set_hl(0, hl, { link = "Headline", default = true })
|
||||
table.insert(opts[ft].headline_highlights, hl)
|
||||
end
|
||||
end
|
||||
return opts
|
||||
end,
|
||||
ft = { "markdown", "norg", "rmd", "org" },
|
||||
config = function(_, opts)
|
||||
-- PERF: schedule to prevent headlines slowing down opening a file
|
||||
vim.schedule(function()
|
||||
require("headlines").setup(opts)
|
||||
require("headlines").refresh()
|
||||
end)
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
@ -17,13 +17,14 @@ return {
|
||||
-- Only add style, inherit or link to the LSP's colors
|
||||
vim.cmd([[
|
||||
highlight! semshiGlobal gui=italic
|
||||
highlight! semshiImported gui=bold
|
||||
highlight! link semshiImported @none
|
||||
highlight! link semshiParameter @lsp.type.parameter
|
||||
highlight! link semshiParameterUnused DiagnosticUnnecessary
|
||||
highlight! link semshiBuiltin @function.builtin
|
||||
highlight! link semshiAttribute @attribute
|
||||
highlight! link semshiAttribute @field
|
||||
highlight! link semshiSelf @lsp.type.selfKeyword
|
||||
highlight! link semshiUnresolved @lsp.type.unresolvedReference
|
||||
highlight! link semshiFree @none
|
||||
]])
|
||||
end,
|
||||
})
|
||||
|
@ -32,6 +32,19 @@ return {
|
||||
end,
|
||||
desc = "Organize Imports",
|
||||
},
|
||||
{
|
||||
"<leader>cR",
|
||||
function()
|
||||
vim.lsp.buf.code_action({
|
||||
apply = true,
|
||||
context = {
|
||||
only = { "source.removeUnused.ts" },
|
||||
diagnostics = {},
|
||||
},
|
||||
})
|
||||
end,
|
||||
desc = "Remove Unused Imports",
|
||||
},
|
||||
},
|
||||
settings = {
|
||||
typescript = {
|
||||
|
@ -40,6 +40,12 @@ return {
|
||||
end,
|
||||
},
|
||||
"Trouble",
|
||||
{
|
||||
ft = "trouble",
|
||||
filter = function(buf, win)
|
||||
return vim.api.nvim_win_get_config(win).relative == ""
|
||||
end,
|
||||
},
|
||||
{ ft = "qf", title = "QuickFix" },
|
||||
{
|
||||
ft = "help",
|
||||
@ -129,7 +135,7 @@ return {
|
||||
optional = true,
|
||||
opts = function(_, opts)
|
||||
opts.open_files_do_not_replace_types = opts.open_files_do_not_replace_types
|
||||
or { "terminal", "Trouble", "qf", "Outline" }
|
||||
or { "terminal", "Trouble", "qf", "Outline", "trouble" }
|
||||
table.insert(opts.open_files_do_not_replace_types, "edgy")
|
||||
end,
|
||||
},
|
||||
|
@ -67,7 +67,7 @@ M.plugin = {
|
||||
return hl
|
||||
end
|
||||
end,
|
||||
priority = 2000,
|
||||
extmark_opts = { priority = 2000 },
|
||||
}
|
||||
end
|
||||
require("mini.hipatterns").setup(opts)
|
||||
|
@ -5,7 +5,9 @@ return {
|
||||
-- project management
|
||||
{
|
||||
"ahmedkhalf/project.nvim",
|
||||
opts = {},
|
||||
opts = {
|
||||
manual_mode = true,
|
||||
},
|
||||
event = "VeryLazy",
|
||||
config = function(_, opts)
|
||||
require("project_nvim").setup(opts)
|
||||
@ -54,6 +56,10 @@ return {
|
||||
icon = " ",
|
||||
key = "p",
|
||||
}
|
||||
|
||||
projects.desc = projects.desc .. string.rep(" ", 43 - #projects.desc)
|
||||
projects.key_format = " %s"
|
||||
|
||||
table.insert(opts.config.center, 3, projects)
|
||||
end,
|
||||
},
|
||||
|
@ -2,9 +2,6 @@ local Util = require("lazyvim.util")
|
||||
|
||||
local M = {}
|
||||
|
||||
---@type ConformOpts
|
||||
local conform_opts = {}
|
||||
|
||||
---@param opts ConformOpts
|
||||
function M.setup(_, opts)
|
||||
for name, formatter in pairs(opts.formatters or {}) do
|
||||
@ -29,7 +26,6 @@ function M.setup(_, opts)
|
||||
opts[key] = nil
|
||||
end
|
||||
end
|
||||
conform_opts = opts
|
||||
require("conform").setup(opts)
|
||||
end
|
||||
|
||||
@ -57,11 +53,10 @@ return {
|
||||
priority = 100,
|
||||
primary = true,
|
||||
format = function(buf)
|
||||
require("conform").format(Util.merge({
|
||||
timeout_ms = conform_opts.format.timeout_ms,
|
||||
async = conform_opts.format.async,
|
||||
quiet = conform_opts.format.quiet,
|
||||
}, { bufnr = buf }))
|
||||
local plugin = require("lazy.core.config").plugins["conform.nvim"]
|
||||
local Plugin = require("lazy.core.plugin")
|
||||
local opts = Plugin.values(plugin, "opts", false)
|
||||
require("conform").format(Util.merge(opts.format, { bufnr = buf }))
|
||||
end,
|
||||
sources = function(buf)
|
||||
local ret = require("conform").list_formatters(buf)
|
||||
|
@ -115,7 +115,7 @@ return {
|
||||
vim.fn.sign_define(name, { text = icon, texthl = name, numhl = "" })
|
||||
end
|
||||
|
||||
local inlay_hint = vim.lsp.buf.inlay_hint or vim.lsp.inlay_hint
|
||||
local inlay_hint = vim.lsp.buf.inlay_hint or (vim.lsp.inlay_hint and vim.lsp.inlay_hint.enable)
|
||||
|
||||
if opts.inlay_hints.enabled and inlay_hint then
|
||||
Util.lsp.on_attach(function(client, buffer)
|
||||
|
@ -7,6 +7,15 @@ return {
|
||||
version = false, -- last release is way too old and doesn't work on Windows
|
||||
build = ":TSUpdate",
|
||||
event = { "LazyFile", "VeryLazy" },
|
||||
init = function(plugin)
|
||||
-- PERF: add nvim-treesitter queries to the rtp and it's custom query predicates early
|
||||
-- This is needed because a bunch of plugins no longer `require("nvim-treesitter")`, which
|
||||
-- no longer trigger the **nvim-treeitter** module to be loaded in time.
|
||||
-- Luckily, the only thins that those plugins need are the custom queries, which we make available
|
||||
-- during startup.
|
||||
require("lazy.core.loader").add_to_rtp(plugin)
|
||||
require("nvim-treesitter.query_predicates")
|
||||
end,
|
||||
dependencies = {
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter-textobjects",
|
||||
@ -109,7 +118,7 @@ return {
|
||||
"nvim-treesitter/nvim-treesitter-context",
|
||||
event = "LazyFile",
|
||||
enabled = true,
|
||||
opts = { mode = "cursor" },
|
||||
opts = { mode = "cursor", max_lines = 3 },
|
||||
keys = {
|
||||
{
|
||||
"<leader>ut",
|
||||
@ -131,7 +140,7 @@ return {
|
||||
-- Automatically add closing tags for HTML and JSX
|
||||
{
|
||||
"windwp/nvim-ts-autotag",
|
||||
event = "InsertEnter",
|
||||
event = "LazyFile",
|
||||
opts = {},
|
||||
},
|
||||
}
|
||||
|
@ -228,6 +228,7 @@ return {
|
||||
"dashboard",
|
||||
"neo-tree",
|
||||
"Trouble",
|
||||
"trouble",
|
||||
"lazy",
|
||||
"mason",
|
||||
"notify",
|
||||
@ -259,6 +260,7 @@ return {
|
||||
"dashboard",
|
||||
"neo-tree",
|
||||
"Trouble",
|
||||
"trouble",
|
||||
"lazy",
|
||||
"mason",
|
||||
"notify",
|
||||
@ -391,6 +393,7 @@ return {
|
||||
|
||||
for _, button in ipairs(opts.config.center) do
|
||||
button.desc = button.desc .. string.rep(" ", 43 - #button.desc)
|
||||
button.key_format = " %s"
|
||||
end
|
||||
|
||||
-- close Lazy and re-open when the dashboard is ready
|
||||
|
@ -15,7 +15,7 @@ return {
|
||||
{
|
||||
"folke/persistence.nvim",
|
||||
event = "BufReadPre",
|
||||
opts = { options = { "buffers", "curdir", "tabpages", "winsize", "help", "globals", "skiprtp" } },
|
||||
opts = { options = vim.opt.sessionoptions:get() },
|
||||
-- stylua: ignore
|
||||
keys = {
|
||||
{ "<leader>qs", function() require("persistence").load() end, desc = "Restore Session" },
|
||||
|
@ -44,7 +44,10 @@ function M.get()
|
||||
Util.walk(root, function(path, name, type)
|
||||
if type == "file" and name:match("%.lua$") then
|
||||
name = path:sub(#root + 2, -5):gsub("/", ".")
|
||||
extras[#extras + 1] = M.get_extra(source, source.module .. "." .. name)
|
||||
local ok, extra = pcall(M.get_extra, source, source.module .. "." .. name)
|
||||
if ok then
|
||||
extras[#extras + 1] = extra
|
||||
end
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
@ -76,10 +76,12 @@ function M.lazy_file()
|
||||
|
||||
local events = {} ---@type {event: string, buf: number, data?: any}[]
|
||||
|
||||
local done = false
|
||||
local function load()
|
||||
if #events == 0 then
|
||||
if #events == 0 or done then
|
||||
return
|
||||
end
|
||||
done = true
|
||||
vim.api.nvim_del_augroup_by_name("lazy_file")
|
||||
|
||||
---@type table<string,string[]>
|
||||
@ -90,17 +92,19 @@ function M.lazy_file()
|
||||
|
||||
vim.api.nvim_exec_autocmds("User", { pattern = "LazyFile", modeline = false })
|
||||
for _, event in ipairs(events) do
|
||||
Event.trigger({
|
||||
event = event.event,
|
||||
exclude = skips[event.event],
|
||||
data = event.data,
|
||||
buf = event.buf,
|
||||
})
|
||||
if vim.bo[event.buf].filetype then
|
||||
if vim.api.nvim_buf_is_valid(event.buf) then
|
||||
Event.trigger({
|
||||
event = "FileType",
|
||||
event = event.event,
|
||||
exclude = skips[event.event],
|
||||
data = event.data,
|
||||
buf = event.buf,
|
||||
})
|
||||
if vim.bo[event.buf].filetype then
|
||||
Event.trigger({
|
||||
event = "FileType",
|
||||
buf = event.buf,
|
||||
})
|
||||
end
|
||||
end
|
||||
end
|
||||
vim.api.nvim_exec_autocmds("CursorMoved", { modeline = false })
|
||||
|
@ -53,6 +53,17 @@ function M.diagnostics()
|
||||
end
|
||||
end
|
||||
|
||||
---@param bufnr? number
|
||||
function M.inlay_hints(bufnr)
|
||||
bufnr = bufnr or 0
|
||||
local inlay_hint = vim.lsp.buf.inlay_hint or vim.lsp.inlay_hint
|
||||
if inlay_hint.enable then
|
||||
vim.lsp.inlay_hint.enable(bufnr, not inlay_hint.is_enabled())
|
||||
else
|
||||
vim.lsp.inlay_hint(bufnr, nil)
|
||||
end
|
||||
end
|
||||
|
||||
setmetatable(M, {
|
||||
__call = function(m, ...)
|
||||
return m.option(...)
|
||||
|
@ -10,12 +10,19 @@ local M = {}
|
||||
function M.get_signs(buf, lnum)
|
||||
-- Get regular signs
|
||||
---@type Sign[]
|
||||
local signs = vim.tbl_map(function(sign)
|
||||
---@type Sign
|
||||
local ret = vim.fn.sign_getdefined(sign.name)[1]
|
||||
ret.priority = sign.priority
|
||||
return ret
|
||||
end, vim.fn.sign_getplaced(buf, { group = "*", lnum = lnum })[1].signs)
|
||||
local signs = {}
|
||||
|
||||
if vim.fn.has("nvim-0.10") == 0 then
|
||||
-- Only needed for Neovim <0.10
|
||||
-- Newer versions include legacy signs in nvim_buf_get_extmarks
|
||||
for _, sign in ipairs(vim.fn.sign_getplaced(buf, { group = "*", lnum = lnum })[1].signs) do
|
||||
local ret = vim.fn.sign_getdefined(sign.name)[1] --[[@as Sign]]
|
||||
if ret then
|
||||
ret.priority = sign.priority
|
||||
signs[#signs + 1] = ret
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- Get extmark signs
|
||||
local extmarks = vim.api.nvim_buf_get_extmarks(
|
||||
@ -141,4 +148,42 @@ function M.fg(name)
|
||||
return fg and { fg = string.format("#%06x", fg) } or nil
|
||||
end
|
||||
|
||||
M.skip_foldexpr = {} ---@type table<number,boolean>
|
||||
local skip_check = assert(vim.loop.new_check())
|
||||
|
||||
function M.foldexpr()
|
||||
local buf = vim.api.nvim_get_current_buf()
|
||||
|
||||
-- still in the same tick and no parser
|
||||
if M.skip_foldexpr[buf] then
|
||||
return "0"
|
||||
end
|
||||
|
||||
-- don't use treesitter folds for non-file buffers
|
||||
if vim.bo[buf].buftype ~= "" then
|
||||
return "0"
|
||||
end
|
||||
|
||||
-- as long as we don't have a filetype, don't bother
|
||||
-- checking if treesitter is available (it won't)
|
||||
if vim.bo[buf].filetype == "" then
|
||||
return "0"
|
||||
end
|
||||
|
||||
local ok = pcall(vim.treesitter.get_parser, buf)
|
||||
|
||||
if ok then
|
||||
return vim.treesitter.foldexpr()
|
||||
end
|
||||
|
||||
-- no parser available, so mark it as skip
|
||||
-- in the next tick, all skip marks will be reset
|
||||
M.skip_foldexpr[buf] = true
|
||||
skip_check:start(function()
|
||||
M.skip_foldexpr = {}
|
||||
skip_check:stop()
|
||||
end)
|
||||
return "0"
|
||||
end
|
||||
|
||||
return M
|
||||
|
Reference in New Issue
Block a user