Compare commits

..

49 Commits

Author SHA1 Message Date
6ac331b588 chore(main): release 10.8.1 (#2095)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-11-30 20:20:39 +01:00
e229988a98 fix(lsp): inlay hints on stable. See #2007 2023-11-30 20:17:07 +01:00
11a8a6bea7 fix(ui): signcolumn signs on nightly. Fixes #2039 2023-11-30 20:17:07 +01:00
4ebda08d49 chore(build): auto-generate vimdoc 2023-11-30 18:54:19 +00:00
6853b785d9 fix(lsp): detect if using nvim-0.10 and use new inlay_hint.enable method (#2007)
* Detect if using nvim 0.10 and use new inlay_hint.enable method

* Add lsp util for inlay-hints and update keymap

* Remove the need to check vim version

* Support older nightly builds

* Move inlay_hint toggle in Util.toggle

---------

Co-authored-by: Gary Murray <gamurray@fanatics.com>
2023-11-30 19:53:40 +01:00
68ff818a5b chore(main): release 10.8.0 (#1874)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-11-04 11:12:37 +01:00
4312e5e283 feat(catppuccin): enable more integrations (#1922) 2023-11-04 11:09:01 +01:00
db31b4073b chore(build): auto-generate vimdoc 2023-11-04 09:15:11 +00:00
3986169823 fix(spectre): don't build nvim-spectre 2023-11-04 10:14:36 +01:00
e5babf289c chore(build): auto-generate vimdoc 2023-10-28 14:39:26 +00:00
b32b4fd581 fix(extras): dont show extras that give errors (user's extras). Fixes #1895 2023-10-28 16:38:43 +02:00
4b758c40c0 chore(build): auto-generate vimdoc 2023-10-27 16:35:14 +00:00
e01ad513aa fix(sessions): added folds to sessions 2023-10-27 18:34:33 +02:00
7831fc94ca chore(build): auto-generate vimdoc 2023-10-26 05:39:38 +00:00
4558407574 fix(plugin): LazyFile now properly deals with deleted buffers. Fixes #1877 2023-10-26 07:38:53 +02:00
09eafc60ef fix(mini.indentscope): remove duplicated filetype (#1871) 2023-10-25 20:00:01 +02:00
9a6b0f8928 chore(main): release 10.7.1 (#1870)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-10-25 17:52:35 +02:00
f589154268 fix(catppuccin): trouble integration. Fixes #1872 2023-10-25 17:23:37 +02:00
60e5707013 fix(util): pcall deletion of lazy_file augroup. See #1863 2023-10-25 15:54:35 +02:00
028f69c03c chore(main): release 10.7.0 (#1869)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-10-25 15:51:56 +02:00
58ddf405e0 fix(lang): add cmakelint to ensure installed list (#1826)
1. mason/cmakelang install bin/cmake-lint
2. nvim-lint only recognize bin/cmakelint
3. mason/cmakelint install bin/cmakelint
so we need mason/cmakelint installed to using nvim-lint to perform formatting
2023-10-25 15:50:02 +02:00
9e1f835223 feat(nvim): extend j/k enhancements to up/down arrows (#1833) 2023-10-25 15:48:45 +02:00
37953585bb fix(extras.python-semshi): improve highlights (#1845) 2023-10-25 15:47:07 +02:00
61fae7d23f fix: fix jdtls not spwaning in windows (#1864) 2023-10-25 15:46:39 +02:00
6dfeeb8322 chore(main): release 10.6.0 (#1842)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-10-25 15:44:48 +02:00
b651560ad0 perf(markdown): prevent headlines.nvim slowing down initial rendering with nvim README.md 2023-10-25 15:40:57 +02:00
1e1b68d633 fix(treesitter): make treesitter queries available at startup. See #1816 Fixes #1858 2023-10-25 15:40:25 +02:00
eab464d52d fix(markdown): create default numbered Headline groups for colorschemes that dont support them. Fixes #1822 2023-10-25 14:23:44 +02:00
c400cf0014 chore(build): auto-generate vimdoc 2023-10-25 12:06:15 +00:00
a5c9708736 perf(ui): wrap treesitter.foldexpr and cache get_parser during a event loop tick. Fixes #1846 2023-10-25 14:05:32 +02:00
99598ef7c7 feat(telescope): sort buffers with lastused and mru 2023-10-25 14:05:32 +02:00
ef5ec9a3bf style: added trouble ft for the next gen trouble 2023-10-25 14:05:32 +02:00
e7130c8250 chore(build): auto-generate vimdoc 2023-10-22 12:44:41 +00:00
e55ab411b4 fix(mini.hipatterns): use extmark_opts instead of soft deprecated priority (#1841) 2023-10-22 14:44:08 +02:00
fa3170d422 chore(build): auto-generate vimdoc 2023-10-20 11:27:50 +00:00
786a061eaa style(dashboard): remove unnecessary brackets from keys, including extras (#1809)
* style(dashboard): remove unnecessary brackets from keys, including the p key from the project extras

* review Folke

---------

Co-authored-by: abeldekat <abel@nomail.com>
2023-10-20 13:27:10 +02:00
0bb628053b chore(main): release 10.5.0 (#1808)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-10-19 20:16:16 +02:00
e996eed750 chore(main): release 10.5.0 (#1800)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-10-19 20:14:17 +02:00
8df44b3bb5 feat(typescript): added remove unused imports (#1794) 2023-10-19 20:12:48 +02:00
82da2440e4 fix(nvim-ts-autotag): make it actually work :) 2023-10-19 19:54:36 +02:00
fad3777296 fix(tabnine): run :CmpTabnineHub automatically on build (#1788) 2023-10-19 07:54:19 +02:00
ea3155aef6 fix(conform): allow overriding all conform format options. Fixes #1790 2023-10-19 07:52:47 +02:00
98b51a608c style(dashboard): make layout exactly the same as before 2023-10-19 07:52:47 +02:00
0ac8f6fb3b fix(treesitter-context): set default max_lines=3 2023-10-19 07:52:47 +02:00
b8c7e70c80 chore(build): auto-generate vimdoc 2023-10-19 05:45:44 +00:00
d73aee4a93 feat(dashboard): remove unnecessary brackets from keys (#1791) 2023-10-19 07:45:03 +02:00
ae77bfda89 chore(main): release 10.4.4 (#1786)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-10-18 13:11:54 +02:00
5c8cefaf40 chore(build): auto-generate vimdoc 2023-10-18 09:39:39 +00:00
7d8b3e8ef9 fix(project): don't let project.nvim change the cwd. Leads to too much confusion 2023-10-18 11:38:57 +02:00
25 changed files with 277 additions and 50 deletions

View File

@ -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)

View File

@ -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*

View File

@ -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 = {

View File

@ -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" })

View File

@ -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

View File

@ -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,
},
},

View File

@ -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)" },

View File

@ -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,

View File

@ -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,
},
{

View File

@ -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)

View File

@ -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,
},
}

View File

@ -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,
})

View File

@ -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 = {

View File

@ -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,
},

View File

@ -67,7 +67,7 @@ M.plugin = {
return hl
end
end,
priority = 2000,
extmark_opts = { priority = 2000 },
}
end
require("mini.hipatterns").setup(opts)

View File

@ -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,
},

View File

@ -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)

View File

@ -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)

View File

@ -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 = {},
},
}

View File

@ -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

View File

@ -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" },

View File

@ -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

View File

@ -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 })

View File

@ -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(...)

View File

@ -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