Compare commits

..

49 Commits

Author SHA1 Message Date
fe72424e77 chore(main): release 10.10.0 (#2400)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-02-21 08:48:55 +01:00
a50f92f755 chore(build): auto-generate vimdoc 2024-01-23 06:52:05 +00:00
591f850f8a fix(autocmds): apply conceal level change to local buffer options (#2409) 2024-01-23 07:51:34 +01:00
Yi
54ae77e164 feat(telescope): add <leader>fg for finding files using git-files (#2353)
I found this to be more useful than the current <leader>ff and <leader>fF
2024-01-22 11:58:51 +01:00
7f9219162b feat(snippets): added extra to use native snippets instead of LuaSnip. 2024-01-22 08:39:07 +01:00
d9287391b7 feat: added LazyHealth that loads all plugins and runs :checkhealth 2024-01-22 08:03:15 +01:00
f799b39eaf fix(rust): avoid resetting cmp group_index to 1 (#2332)
For example, 'buffer' source by default has group_index = 2 [1], however
if we take all the sources plus crates and run them through
cmp.config.sources() again, since it's a one-dimensional list, all
group_indexes will be reset to 1.

[1] 879e29504d/lua/lazyvim/plugins/coding.lua (L74-L80)
2024-01-22 07:51:19 +01:00
eb2674ce37 chore(build): auto-generate vimdoc 2024-01-22 06:50:15 +00:00
1dffb1d853 fix(hyprlang): use lazyvim way to install (#2404) 2024-01-22 07:49:45 +01:00
eccf3b5e68 fix(neo-tree): better copy file name with Y 2024-01-21 21:32:09 +01:00
93342f15ba feat(toggle): use vim.diagnostic.is_disabled when available (#2217)
* feat(toggle-diagnostics): change logic based on `vim.diagnostic.is_disabled`

After discussion in #2215, I thought maybe it would be beneficial if we
could change the logic of the `toggle-diagnostics` function based on if
the user has disabled diagnostics in his own configuration.

* feat(toggle-diagnostics): revert to `enable` instead of `status`

* fix(toggle): use vim.diagnostics enabled state when possible

---------

Co-authored-by: Folke Lemaitre <folke.lemaitre@gmail.com>
2024-01-21 20:41:11 +01:00
a43d8cf358 fix(options): change default conceal level to 2 (#2053)
3 hides all concealed text, even if there are replacement chars defined

e.g. : for Markdown, 3 hides list item markers, dots for asterisk lists
and em-dashes for dash lists

If replacements are defined as defaults in a plugin, the "Laziest™"
config would seem to be displaying them.

Level 1 only seems useful when alignment really matters.
2024-01-21 20:34:07 +01:00
cbd9d700dc fix(typescript): don't hardcode values in lua table (#2254)
* fix(typescript): don't hardcode values in lua table

When a user changes `vim.opt.shiftwidth` with some auto-command, it's
not taken into account. Make `opts` a function, so that values get
evaluated when `lspconfig` loads instead.

* fix(typescript): remove format settings entirely

* fix(typescript): add back comment and Lua annotations

* fix(typescript): bring back function call completion snippets
2024-01-21 20:28:16 +01:00
8e2046f3d0 fix(autocmds): avoid checktime when buftype=nofile (#2270)
It triggered an 'E11: Invalid in command-line window; <CR> executes,
CTRL-C quits' error when Neovim was in Command Line window and
FocusGained.
2024-01-21 20:20:54 +01:00
c72db4938c docs(README-DE): remove .txt extension (#2321)
Probably some windows editor that added this automatically + known extensions hidden.
2024-01-21 20:18:03 +01:00
37107cf2fc docs: typo in init.lua (#2365) 2024-01-21 20:10:18 +01:00
c433ea7aa8 chore(main): release 10.9.1 (#2399)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-01-21 20:03:51 +01:00
fbe478ae3f fix: fixup for #2137 2024-01-21 20:02:11 +01:00
adc0b36069 chore(main): release 10.9.0 (#2391)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-01-21 20:00:03 +01:00
5296d42e6a feat(neo-tree): Adds copy file name command to Neo-Tree with 'Y' binding (#2137)
Co-authored-by: Ricardo Rebelo <ricardo.rebelo@siemens.com>
2024-01-21 19:53:57 +01:00
71a73e8334 fix(eslint): correct working directories name (#2071) 2024-01-21 19:53:09 +01:00
fa6158a595 feat(keymaps): add function to toggle between light/dark backgrounds (#2088) 2024-01-21 19:52:36 +01:00
f4ddb16b26 feat(gitsigns): update gitsigns.nvim preview command (#2178)
* chores(format.lua): Fix typo

* Change gitsigns.nvim hunk preview shortcut

Change `preview_hunk` to recently added `preview_hunk_inline` command
2024-01-21 19:49:41 +01:00
b71feb7e45 feat(test): Add <leader>tl to neotest.run_last() (#1968) 2024-01-21 19:37:38 +01:00
33830f1e7d feat(lsp): add diagnostic signs to lsp options (#2192)
Co-authored-by: Gary Murray <gamurray@fanatics.com>
2024-01-21 19:35:24 +01:00
d0120ccdd1 chore(build): auto-generate vimdoc 2024-01-21 10:25:29 +00:00
23fe52acd7 feat(autocmds): dont use conceal for json files 2024-01-21 11:24:59 +01:00
979bb952a6 fix(dot): treesitter for hypr was renamed to hyprlang 2024-01-20 12:50:34 +01:00
879e29504d chore(main): release 10.8.2 (#2097)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-11-30 21:27:02 +01:00
8baf9b5459 fix(lsp): fix inlay hints for older nightlies. See #2007 2023-11-30 21:24:07 +01:00
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
23 changed files with 317 additions and 105 deletions

View File

@ -1,5 +1,91 @@
# Changelog
## [10.10.0](https://github.com/LazyVim/LazyVim/compare/v10.9.1...v10.10.0) (2024-01-23)
### Features
* added `LazyHealth` that loads all plugins and runs `:checkhealth` ([d928739](https://github.com/LazyVim/LazyVim/commit/d9287391b7ca7153320d4654e148c33463eba3a6))
* **snippets:** added extra to use native snippets instead of LuaSnip. ([7f92191](https://github.com/LazyVim/LazyVim/commit/7f9219162b54a717b7da5cb543ab1e778c9a124b))
* **telescope:** add &lt;leader&gt;fg for finding files using git-files ([#2353](https://github.com/LazyVim/LazyVim/issues/2353)) ([54ae77e](https://github.com/LazyVim/LazyVim/commit/54ae77e164e62ae9f45e864dfd727bfe1809a419))
* **toggle:** use `vim.diagnostic.is_disabled` when available ([#2217](https://github.com/LazyVim/LazyVim/issues/2217)) ([93342f1](https://github.com/LazyVim/LazyVim/commit/93342f15badc6e7a3c213e27979b2ff31e0b393e))
### Bug Fixes
* **autocmds:** apply conceal level change to local buffer options ([#2409](https://github.com/LazyVim/LazyVim/issues/2409)) ([591f850](https://github.com/LazyVim/LazyVim/commit/591f850f8a30a08066022392fe3b23eb217dbb81))
* **autocmds:** avoid checktime when buftype=nofile ([#2270](https://github.com/LazyVim/LazyVim/issues/2270)) ([8e2046f](https://github.com/LazyVim/LazyVim/commit/8e2046f3d02a80558802b6cbcd4c8f7d44f7b6b4))
* **hyprlang:** use lazyvim way to install ([#2404](https://github.com/LazyVim/LazyVim/issues/2404)) ([1dffb1d](https://github.com/LazyVim/LazyVim/commit/1dffb1d853df39e2232fd39d3cf47ba3da2e8b6c))
* **neo-tree:** better copy file name with `Y` ([eccf3b5](https://github.com/LazyVim/LazyVim/commit/eccf3b5e68035516c879b3e2b4d6bf8512c87976))
* **options:** change default conceal level to 2 ([#2053](https://github.com/LazyVim/LazyVim/issues/2053)) ([a43d8cf](https://github.com/LazyVim/LazyVim/commit/a43d8cf35857fae4aaf1ebbd3c280cdf5b5f9d10))
* **rust:** avoid resetting cmp group_index to 1 ([#2332](https://github.com/LazyVim/LazyVim/issues/2332)) ([f799b39](https://github.com/LazyVim/LazyVim/commit/f799b39eafedf58cdd7b123870a2c87d96eddb68))
* **typescript:** don't hardcode values in lua table ([#2254](https://github.com/LazyVim/LazyVim/issues/2254)) ([cbd9d70](https://github.com/LazyVim/LazyVim/commit/cbd9d700dc964cf8c90759f8482911d03c72edc4))
## [10.9.1](https://github.com/LazyVim/LazyVim/compare/v10.9.0...v10.9.1) (2024-01-21)
### Bug Fixes
* fixup for [#2137](https://github.com/LazyVim/LazyVim/issues/2137) ([fbe478a](https://github.com/LazyVim/LazyVim/commit/fbe478ae3f84ff842d18ff880af5842a50ee8e50))
## [10.9.0](https://github.com/LazyVim/LazyVim/compare/v10.8.2...v10.9.0) (2024-01-21)
### Features
* **autocmds:** dont use conceal for json files ([23fe52a](https://github.com/LazyVim/LazyVim/commit/23fe52acd78c8e8f7c35c3ce4c1bae830adfa357))
* **gitsigns:** update gitsigns.nvim preview command ([#2178](https://github.com/LazyVim/LazyVim/issues/2178)) ([f4ddb16](https://github.com/LazyVim/LazyVim/commit/f4ddb16b262e5ba14b417dc53bfd09d5b21f8a73))
* **keymaps:** add function to toggle between light/dark backgrounds ([#2088](https://github.com/LazyVim/LazyVim/issues/2088)) ([fa6158a](https://github.com/LazyVim/LazyVim/commit/fa6158a59500c816b652e0fcb4c343270be54b6c))
* **lsp:** add diagnostic signs to lsp options ([#2192](https://github.com/LazyVim/LazyVim/issues/2192)) ([33830f1](https://github.com/LazyVim/LazyVim/commit/33830f1e7d2e5a54fec676ce6e43a4a61882aaa9))
* **neo-tree:** Adds copy file name command to Neo-Tree with 'Y' binding ([#2137](https://github.com/LazyVim/LazyVim/issues/2137)) ([5296d42](https://github.com/LazyVim/LazyVim/commit/5296d42e6ab4f6df80e801542382a3d774298364))
* **test:** Add &lt;leader&gt;tl to neotest.run_last() ([#1968](https://github.com/LazyVim/LazyVim/issues/1968)) ([b71feb7](https://github.com/LazyVim/LazyVim/commit/b71feb7e45420a6e6dcac2f4491b73b70c32e5c7))
### Bug Fixes
* **dot:** treesitter for hypr was renamed to hyprlang ([979bb95](https://github.com/LazyVim/LazyVim/commit/979bb952a69d7dafac125da69cb27b70d5403f52))
* **eslint:** correct working directories name ([#2071](https://github.com/LazyVim/LazyVim/issues/2071)) ([71a73e8](https://github.com/LazyVim/LazyVim/commit/71a73e8334a3692c549a09169e0f7a33923520f1))
## [10.8.2](https://github.com/LazyVim/LazyVim/compare/v10.8.1...v10.8.2) (2023-11-30)
### Bug Fixes
* **lsp:** fix inlay hints for older nightlies. See [#2007](https://github.com/LazyVim/LazyVim/issues/2007) ([8baf9b5](https://github.com/LazyVim/LazyVim/commit/8baf9b5459a903c783a1d34ad438e64036a8e15e))
## [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)

View File

@ -1,4 +1,4 @@
*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2023 October 25
*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 January 23
==============================================================================
Table of Contents *LazyVim-table-of-contents*

View File

@ -7,7 +7,11 @@ end
-- Check if we need to reload the file when it changed
vim.api.nvim_create_autocmd({ "FocusGained", "TermClose", "TermLeave" }, {
group = augroup("checktime"),
command = "checktime",
callback = function()
if vim.o.buftype ~= 'nofile' then
vim.cmd('checktime')
end
end
})
-- Highlight on yank
@ -81,6 +85,15 @@ vim.api.nvim_create_autocmd("FileType", {
end,
})
-- Fix conceallevel for json files
vim.api.nvim_create_autocmd({ "FileType" }, {
group = augroup("json_conceal"),
pattern = { "json", "jsonc", "json5" },
callback = function()
vim.opt_local.conceallevel = 0
end,
})
-- Auto create dir when saving a file, in case some intermediate directory does not exist
vim.api.nvim_create_autocmd({ "BufWritePre" }, {
group = augroup("auto_create_dir"),

View File

@ -3,7 +3,7 @@ local Util = require("lazyvim.util")
---@class LazyVimConfig: LazyVimOptions
local M = {}
M.version = "10.7.0" -- x-release-please-version
M.version = "10.10.0" -- x-release-please-version
---@class LazyVimOptions
local defaults = {
@ -185,6 +185,11 @@ function M.setup(opts)
vim.api.nvim_create_user_command("LazyExtras", function()
Util.extras.show()
end, { desc = "Manage LazyVim extras" })
vim.api.nvim_create_user_command("LazyHealth", function()
vim.cmd([[Lazy! load all]])
vim.cmd([[checkhealth]])
end, { desc = "Load all plugins and run :checkhealth" })
end,
})

View File

@ -119,10 +119,11 @@ 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" })
map("n", "<leader>ub", function() Util.toggle("background", false, {"light", "dark"}) end, { desc = "Toggle Background" })
-- lazygit
map("n", "<leader>gg", function() Util.terminal({ "lazygit" }, { cwd = Util.root(), esc_esc = false, ctrl_hjkl = false }) end, { desc = "Lazygit (root dir)" })

View File

@ -17,7 +17,7 @@ local opt = vim.opt
opt.autowrite = true -- Enable auto write
opt.clipboard = "unnamedplus" -- Sync with system clipboard
opt.completeopt = "menu,menuone,noselect"
opt.conceallevel = 3 -- Hide * markup for bold and italic
opt.conceallevel = 2 -- Hide * markup for bold and italic, but not markers with substitutions
opt.confirm = true -- Confirm to save changes before exiting modified buffer
opt.cursorline = true -- Enable highlighting of the current line
opt.expandtab = true -- Use spaces instead of tabs
@ -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 })

View File

@ -1,35 +1,5 @@
return {
-- snippets
{
"L3MON4D3/LuaSnip",
build = (not jit.os:find("Windows"))
and "echo 'NOTE: jsregexp is optional, so not a big deal if it fails to build'; make install_jsregexp"
or nil,
dependencies = {
"rafamadriz/friendly-snippets",
config = function()
require("luasnip.loaders.from_vscode").lazy_load()
end,
},
opts = {
history = true,
delete_check_events = "TextChanged",
},
-- stylua: ignore
keys = {
{
"<tab>",
function()
return require("luasnip").jumpable(1) and "<Plug>luasnip-jump-next" or "<tab>"
end,
expr = true, silent = true, mode = "i",
},
{ "<tab>", function() require("luasnip").jump(1) end, mode = "s" },
{ "<s-tab>", function() require("luasnip").jump(-1) end, mode = { "i", "s" } },
},
},
-- auto completion
{
"hrsh7th/nvim-cmp",
@ -39,7 +9,6 @@ return {
"hrsh7th/cmp-nvim-lsp",
"hrsh7th/cmp-buffer",
"hrsh7th/cmp-path",
"saadparwaiz1/cmp_luasnip",
},
opts = function()
vim.api.nvim_set_hl(0, "CmpGhostText", { link = "Comment", default = true })
@ -49,11 +18,6 @@ return {
completion = {
completeopt = "menu,menuone,noinsert",
},
snippet = {
expand = function(args)
require("luasnip").lsp_expand(args.body)
end,
},
mapping = cmp.mapping.preset.insert({
["<C-n>"] = cmp.mapping.select_next_item({ behavior = cmp.SelectBehavior.Insert }),
["<C-p>"] = cmp.mapping.select_prev_item({ behavior = cmp.SelectBehavior.Insert }),
@ -73,7 +37,6 @@ return {
}),
sources = cmp.config.sources({
{ name = "nvim_lsp" },
{ name = "luasnip" },
{ name = "path" },
}, {
{ name = "buffer" },
@ -104,6 +67,52 @@ return {
end,
},
-- snippets
{
"L3MON4D3/LuaSnip",
build = (not jit.os:find("Windows"))
and "echo 'NOTE: jsregexp is optional, so not a big deal if it fails to build'; make install_jsregexp"
or nil,
dependencies = {
{
"rafamadriz/friendly-snippets",
config = function()
require("luasnip.loaders.from_vscode").lazy_load()
end,
},
{
"nvim-cmp",
dependencies = {
"saadparwaiz1/cmp_luasnip",
},
opts = function(_, opts)
opts.snippet = {
expand = function(args)
require("luasnip").lsp_expand(args.body)
end,
}
table.insert(opts.sources, { name = "luasnip" })
end,
},
},
opts = {
history = true,
delete_check_events = "TextChanged",
},
-- stylua: ignore
keys = {
{
"<tab>",
function()
return require("luasnip").jumpable(1) and "<Plug>luasnip-jump-next" or "<tab>"
end,
expr = true, silent = true, mode = "i",
},
{ "<tab>", function() require("luasnip").jump(1) end, mode = "s" },
{ "<s-tab>", function() require("luasnip").jump(-1) end, mode = { "i", "s" } },
},
},
-- auto pairs
{
"echasnovski/mini.pairs",

View File

@ -14,15 +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,
trouble = true,
mason = true,
markdown = true,
mini = true,
native_lsp = {
enabled = true,
@ -35,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

@ -61,6 +61,11 @@ return {
window = {
mappings = {
["<space>"] = "none",
["Y"] = function(state)
local node = state.tree:get_node()
local path = node:get_id()
vim.fn.setreg("+", path, "c")
end,
},
},
default_component_configs = {
@ -98,6 +103,7 @@ return {
-- search/replace in multiple files
{
"nvim-pack/nvim-spectre",
build = false,
cmd = "Spectre",
opts = { open_cmd = "noswapfile vnew" },
-- stylua: ignore
@ -140,6 +146,7 @@ return {
{ "<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)" },
{ "<leader>fg", "<cmd>Telescope git_files<cr>", desc = "Find Files (git-files)" },
{ "<leader>fr", "<cmd>Telescope oldfiles<cr>", desc = "Recent" },
{ "<leader>fR", Util.telescope("oldfiles", { cwd = vim.loop.cwd() }), desc = "Recent (cwd)" },
-- git
@ -357,7 +364,7 @@ return {
map("n", "<leader>ghS", gs.stage_buffer, "Stage Buffer")
map("n", "<leader>ghu", gs.undo_stage_hunk, "Undo Stage Hunk")
map("n", "<leader>ghR", gs.reset_buffer, "Reset Buffer")
map("n", "<leader>ghp", gs.preview_hunk, "Preview Hunk")
map("n", "<leader>ghp", gs.preview_hunk_inline, "Preview Hunk Inline")
map("n", "<leader>ghb", function() gs.blame_line({ full = true }) end, "Blame Line")
map("n", "<leader>ghd", gs.diffthis, "Diff This")
map("n", "<leader>ghD", function() gs.diffthis("~") end, "Diff This ~")

View File

@ -0,0 +1,59 @@
return {
desc = "Use native snippets instead of LuaSnip. Only works on Neovim >= 0.10!",
{
"L3MON4D3/LuaSnip",
enabled = false,
},
{
"nvim-cmp",
opts = {
snippet = {
expand = function(args)
vim.snippet.expand(args.body)
end,
},
},
keys = {
{
"<Tab>",
function()
if vim.snippet.jumpable(1) then
vim.schedule(function()
vim.snippet.jump(1)
end)
return
end
return "<Tab>"
end,
expr = true,
silent = true,
mode = "i",
},
{
"<Tab>",
function()
vim.schedule(function()
vim.snippet.jump(1)
end)
end,
silent = true,
mode = "s",
},
{
"<S-Tab>",
function()
if vim.snippet.jumpable(-1) then
vim.schedule(function()
vim.snippet.jump(-1)
end)
return
end
return "<S-Tab>"
end,
expr = true,
silent = true,
mode = { "i", "s" },
},
},
},
}

View File

@ -16,10 +16,8 @@ return {
},
---@param opts cmp.ConfigSchema
opts = function(_, opts)
local cmp = require("cmp")
opts.sources = cmp.config.sources(vim.list_extend(opts.sources, {
{ name = "crates" },
}))
opts.sources = opts.sources or {}
table.insert(opts.sources, { name = "crates" })
end,
},

View File

@ -46,21 +46,8 @@ return {
desc = "Remove Unused Imports",
},
},
---@diagnostic disable-next-line: missing-fields
settings = {
typescript = {
format = {
indentSize = vim.o.shiftwidth,
convertTabsToSpaces = vim.o.expandtab,
tabSize = vim.o.tabstop,
},
},
javascript = {
format = {
indentSize = vim.o.shiftwidth,
convertTabsToSpaces = vim.o.expandtab,
tabSize = vim.o.tabstop,
},
},
completions = {
completeFunctionCalls = true,
},
@ -69,6 +56,7 @@ return {
},
},
},
{
"mfussenegger/nvim-dap",
optional = true,

View File

@ -8,7 +8,7 @@ return {
eslint = {
settings = {
-- helps eslint find the eslintrc when it's placed in a subfolder instead of the cwd root
workingDirectory = { mode = "auto" },
workingDirectories = { mode = "auto" },
},
},
},

View File

@ -110,6 +110,7 @@ return {
{ "<leader>tt", function() require("neotest").run.run(vim.fn.expand("%")) end, desc = "Run File" },
{ "<leader>tT", function() require("neotest").run.run(vim.loop.cwd()) end, desc = "Run All Test Files" },
{ "<leader>tr", function() require("neotest").run.run() end, desc = "Run Nearest" },
{ "<leader>tl", function() require("neotest").run.run_last() end, desc = "Run Last" },
{ "<leader>ts", function() require("neotest").summary.toggle() end, desc = "Toggle Summary" },
{ "<leader>to", function() require("neotest").output.open({ enter = true, auto_close = true }) end, desc = "Show Output" },
{ "<leader>tO", function() require("neotest").output_panel.toggle() end, desc = "Toggle Output Panel" },

View File

@ -10,26 +10,27 @@ return {
-- Add Hyprland Parser
{
"luckasRanarison/tree-sitter-hypr",
"luckasRanarison/tree-sitter-hyprlang",
dependencies = {
"nvim-treesitter/nvim-treesitter",
opts = function(_, opts)
require("nvim-treesitter.parsers").get_parser_configs().hyprlang = {
install_info = {
url = "https://github.com/luckasRanarison/tree-sitter-hyprlang",
files = { "src/parser.c" },
branch = "master",
},
filetype = "hyprlang",
}
opts.ensure_installed = opts.ensure_installed or {}
vim.list_extend(opts.ensure_installed, { "hyprlang" })
end,
},
enabled = function()
return have("hypr")
end,
event = "BufRead */hypr/*.conf",
build = ":TSUpdate hypr",
config = function()
-- Fix ft detection for hyprland
vim.filetype.add({
pattern = { [".*/hypr/.*%.conf"] = "hypr" },
})
require("nvim-treesitter.parsers").get_parser_configs().hypr = {
install_info = {
url = "https://github.com/luckasRanarison/tree-sitter-hypr",
files = { "src/parser.c" },
branch = "master",
},
filetype = "hypr",
}
end,
},
-- add some stuff to treesitter

View File

@ -26,6 +26,14 @@ return {
-- prefix = "icons",
},
severity_sort = true,
signs = {
text = {
[vim.diagnostic.severity.ERROR] = require("lazyvim.config").icons.diagnostics.Error,
[vim.diagnostic.severity.WARN] = require("lazyvim.config").icons.diagnostics.Warn,
[vim.diagnostic.severity.HINT] = require("lazyvim.config").icons.diagnostics.Hint,
[vim.diagnostic.severity.INFO] = require("lazyvim.config").icons.diagnostics.Info,
},
},
},
-- Enable this to enable the builtin LSP inlay hints on Neovim >= 0.10.0
-- Be aware that you also will need to properly configure your LSP server to
@ -86,7 +94,7 @@ return {
-- setup autoformat
Util.format.register(Util.lsp.formatter())
-- deprectaed options
-- deprecated options
if opts.autoformat ~= nil then
vim.g.autoformat = opts.autoformat
Util.deprecate("nvim-lspconfig.opts.autoformat", "vim.g.autoformat")
@ -115,12 +123,10 @@ 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
if opts.inlay_hints.enabled and inlay_hint then
if opts.inlay_hints.enabled then
Util.lsp.on_attach(function(client, buffer)
if client.supports_method("textDocument/inlayHint") then
inlay_hint(buffer, true)
Util.toggle.inlay_hints(buffer, true)
end
end)
end

View File

@ -266,7 +266,6 @@ return {
"notify",
"toggleterm",
"lazyterm",
"trouble",
},
callback = function()
vim.b.miniindentscope_disable = true

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

@ -43,7 +43,13 @@ end
local enabled = true
function M.diagnostics()
-- if this Neovim version supports checking if diagnostics are enabled
-- then use that for the current state
if vim.diagnostic.is_disabled then
enabled = not vim.diagnostic.is_disabled()
end
enabled = not enabled
if enabled then
vim.diagnostic.enable()
Util.info("Enabled diagnostics", { title = "Diagnostics" })
@ -53,6 +59,20 @@ function M.diagnostics()
end
end
---@param buf? number
---@param value? boolean
function M.inlay_hints(buf, value)
local ih = vim.lsp.buf.inlay_hint or vim.lsp.inlay_hint
if type(ih) == "function" then
ih(buf, value)
elseif type(ih) == "table" and ih.enable then
if value == nil then
value = not ih.is_enabled(buf)
end
ih.enable(buf, value)
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(