Merge branch 'nvim-lua:master' into master

This commit is contained in:
Szymon 2026-03-27 19:21:05 +01:00 committed by GitHub
commit 9800531526
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 114 additions and 119 deletions

7
.gitignore vendored
View File

@ -5,9 +5,10 @@ nvim
spell/ spell/
# You likely want to comment this, since it's recommended to track lazy-lock.json in version # In your personal fork, you likely want to comment this, since it's recommended to track
# control, see https://lazy.folke.io/usage/lockfile # lazy-lock.json in version control - see https://lazy.folke.io/usage/lockfile
# For kickstart, it makes sense to leave it ignored. # For the official `nvim-lua/kickstart.nvim` git repository, we leave it ignored to avoid unneeded
# merge conflicts.
lazy-lock.json lazy-lock.json
.DS_Store .DS_Store

View File

@ -262,7 +262,7 @@ available methods being discussed
<details><summary>Bob</summary> <details><summary>Bob</summary>
[Bob](https://github.com/MordechaiHadad/bob) is a Neovim version manager for [Bob](https://github.com/MordechaiHadad/bob) is a Neovim version manager for
all plattforms. Simply install all platforms. Simply install
[rustup](https://rust-lang.github.io/rustup/installation/other.html), [rustup](https://rust-lang.github.io/rustup/installation/other.html),
and run the following commands: and run the following commands:

View File

@ -356,7 +356,7 @@ require('lazy').setup({
spec = { spec = {
{ '<leader>s', group = '[S]earch', mode = { 'n', 'v' } }, { '<leader>s', group = '[S]earch', mode = { 'n', 'v' } },
{ '<leader>t', group = '[T]oggle' }, { '<leader>t', group = '[T]oggle' },
{ '<leader>h', group = 'Git [H]unk', mode = { 'n', 'v' } }, { '<leader>h', group = 'Git [H]unk', mode = { 'n', 'v' } }, -- Enable gitsigns recommended keymaps first
{ 'gr', group = 'LSP Actions', mode = { 'n' } }, { 'gr', group = 'LSP Actions', mode = { 'n' } },
}, },
}, },
@ -538,9 +538,6 @@ require('lazy').setup({
-- Useful status updates for LSP. -- Useful status updates for LSP.
{ 'j-hui/fidget.nvim', opts = {} }, { 'j-hui/fidget.nvim', opts = {} },
-- Allows extra capabilities provided by blink.cmp
'saghen/blink.cmp',
}, },
config = function() config = function()
-- Brief aside: **What is LSP?** -- Brief aside: **What is LSP?**
@ -974,7 +971,7 @@ require('lazy').setup({
-- require 'kickstart.plugins.lint', -- require 'kickstart.plugins.lint',
-- require 'kickstart.plugins.autopairs', -- require 'kickstart.plugins.autopairs',
-- require 'kickstart.plugins.neo-tree', -- require 'kickstart.plugins.neo-tree',
-- require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps -- require 'kickstart.plugins.gitsigns', -- adds gitsigns recommended keymaps
-- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua` -- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua`
-- This is the easiest way to modularize your config. -- This is the easiest way to modularize your config.

View File

@ -5,56 +5,54 @@
---@module 'lazy' ---@module 'lazy'
---@type LazySpec ---@type LazySpec
return { return {
{ 'lewis6991/gitsigns.nvim',
'lewis6991/gitsigns.nvim', ---@module 'gitsigns'
---@module 'gitsigns' ---@type Gitsigns.Config
---@type Gitsigns.Config ---@diagnostic disable-next-line: missing-fields
---@diagnostic disable-next-line: missing-fields opts = {
opts = { on_attach = function(bufnr)
on_attach = function(bufnr) local gitsigns = require 'gitsigns'
local gitsigns = require 'gitsigns'
local function map(mode, l, r, opts) local function map(mode, l, r, opts)
opts = opts or {} opts = opts or {}
opts.buffer = bufnr opts.buffer = bufnr
vim.keymap.set(mode, l, r, opts) vim.keymap.set(mode, l, r, opts)
end
-- Navigation
map('n', ']c', function()
if vim.wo.diff then
vim.cmd.normal { ']c', bang = true }
else
gitsigns.nav_hunk 'next'
end end
end, { desc = 'Jump to next git [c]hange' })
-- Navigation map('n', '[c', function()
map('n', ']c', function() if vim.wo.diff then
if vim.wo.diff then vim.cmd.normal { '[c', bang = true }
vim.cmd.normal { ']c', bang = true } else
else gitsigns.nav_hunk 'prev'
gitsigns.nav_hunk 'next' end
end end, { desc = 'Jump to previous git [c]hange' })
end, { desc = 'Jump to next git [c]hange' })
map('n', '[c', function() -- Actions
if vim.wo.diff then -- visual mode
vim.cmd.normal { '[c', bang = true } map('v', '<leader>hs', function() gitsigns.stage_hunk { vim.fn.line '.', vim.fn.line 'v' } end, { desc = 'git [s]tage hunk' })
else map('v', '<leader>hr', function() gitsigns.reset_hunk { vim.fn.line '.', vim.fn.line 'v' } end, { desc = 'git [r]eset hunk' })
gitsigns.nav_hunk 'prev' -- normal mode
end map('n', '<leader>hs', gitsigns.stage_hunk, { desc = 'git [s]tage hunk' })
end, { desc = 'Jump to previous git [c]hange' }) map('n', '<leader>hr', gitsigns.reset_hunk, { desc = 'git [r]eset hunk' })
map('n', '<leader>hS', gitsigns.stage_buffer, { desc = 'git [S]tage buffer' })
-- Actions map('n', '<leader>hu', gitsigns.stage_hunk, { desc = 'git [u]ndo stage hunk' })
-- visual mode map('n', '<leader>hR', gitsigns.reset_buffer, { desc = 'git [R]eset buffer' })
map('v', '<leader>hs', function() gitsigns.stage_hunk { vim.fn.line '.', vim.fn.line 'v' } end, { desc = 'git [s]tage hunk' }) map('n', '<leader>hp', gitsigns.preview_hunk, { desc = 'git [p]review hunk' })
map('v', '<leader>hr', function() gitsigns.reset_hunk { vim.fn.line '.', vim.fn.line 'v' } end, { desc = 'git [r]eset hunk' }) map('n', '<leader>hb', gitsigns.blame_line, { desc = 'git [b]lame line' })
-- normal mode map('n', '<leader>hd', gitsigns.diffthis, { desc = 'git [d]iff against index' })
map('n', '<leader>hs', gitsigns.stage_hunk, { desc = 'git [s]tage hunk' }) map('n', '<leader>hD', function() gitsigns.diffthis '@' end, { desc = 'git [D]iff against last commit' })
map('n', '<leader>hr', gitsigns.reset_hunk, { desc = 'git [r]eset hunk' }) -- Toggles
map('n', '<leader>hS', gitsigns.stage_buffer, { desc = 'git [S]tage buffer' }) map('n', '<leader>tb', gitsigns.toggle_current_line_blame, { desc = '[T]oggle git show [b]lame line' })
map('n', '<leader>hu', gitsigns.stage_hunk, { desc = 'git [u]ndo stage hunk' }) map('n', '<leader>tD', gitsigns.preview_hunk_inline, { desc = '[T]oggle git show [D]eleted' })
map('n', '<leader>hR', gitsigns.reset_buffer, { desc = 'git [R]eset buffer' }) end,
map('n', '<leader>hp', gitsigns.preview_hunk, { desc = 'git [p]review hunk' })
map('n', '<leader>hb', gitsigns.blame_line, { desc = 'git [b]lame line' })
map('n', '<leader>hd', gitsigns.diffthis, { desc = 'git [d]iff against index' })
map('n', '<leader>hD', function() gitsigns.diffthis '@' end, { desc = 'git [D]iff against last commit' })
-- Toggles
map('n', '<leader>tb', gitsigns.toggle_current_line_blame, { desc = '[T]oggle git show [b]lame line' })
map('n', '<leader>tD', gitsigns.preview_hunk_inline, { desc = '[T]oggle git show [D]eleted' })
end,
},
}, },
} }

View File

@ -1,13 +1,13 @@
-- Add indentation guides even on blank lines
---@module 'lazy' ---@module 'lazy'
---@type LazySpec ---@type LazySpec
return { return {
{ -- Add indentation guides even on blank lines 'lukas-reineke/indent-blankline.nvim',
'lukas-reineke/indent-blankline.nvim', -- Enable `lukas-reineke/indent-blankline.nvim`
-- Enable `lukas-reineke/indent-blankline.nvim` -- See `:help ibl`
-- See `:help ibl` main = 'ibl',
main = 'ibl', ---@module 'ibl'
---@module 'ibl' ---@type ibl.config
---@type ibl.config opts = {},
opts = {},
},
} }

View File

@ -1,60 +1,59 @@
-- Linting
---@module 'lazy' ---@module 'lazy'
---@type LazySpec ---@type LazySpec
return { return {
'mfussenegger/nvim-lint',
event = { 'BufReadPre', 'BufNewFile' },
config = function()
local lint = require 'lint'
lint.linters_by_ft = {
markdown = { 'markdownlint' },
}
{ -- Linting -- To allow other plugins to add linters to require('lint').linters_by_ft,
'mfussenegger/nvim-lint', -- instead set linters_by_ft like this:
event = { 'BufReadPre', 'BufNewFile' }, -- lint.linters_by_ft = lint.linters_by_ft or {}
config = function() -- lint.linters_by_ft['markdown'] = { 'markdownlint' }
local lint = require 'lint' --
lint.linters_by_ft = { -- However, note that this will enable a set of default linters,
markdown = { 'markdownlint' }, -- which will cause errors unless these tools are available:
} -- {
-- clojure = { "clj-kondo" },
-- dockerfile = { "hadolint" },
-- inko = { "inko" },
-- janet = { "janet" },
-- json = { "jsonlint" },
-- markdown = { "vale" },
-- rst = { "vale" },
-- ruby = { "ruby" },
-- terraform = { "tflint" },
-- text = { "vale" }
-- }
--
-- You can disable the default linters by setting their filetypes to nil:
-- lint.linters_by_ft['clojure'] = nil
-- lint.linters_by_ft['dockerfile'] = nil
-- lint.linters_by_ft['inko'] = nil
-- lint.linters_by_ft['janet'] = nil
-- lint.linters_by_ft['json'] = nil
-- lint.linters_by_ft['markdown'] = nil
-- lint.linters_by_ft['rst'] = nil
-- lint.linters_by_ft['ruby'] = nil
-- lint.linters_by_ft['terraform'] = nil
-- lint.linters_by_ft['text'] = nil
-- To allow other plugins to add linters to require('lint').linters_by_ft, -- Create autocommand which carries out the actual linting
-- instead set linters_by_ft like this: -- on the specified events.
-- lint.linters_by_ft = lint.linters_by_ft or {} local lint_augroup = vim.api.nvim_create_augroup('lint', { clear = true })
-- lint.linters_by_ft['markdown'] = { 'markdownlint' } vim.api.nvim_create_autocmd({ 'BufEnter', 'BufWritePost', 'InsertLeave' }, {
-- group = lint_augroup,
-- However, note that this will enable a set of default linters, callback = function()
-- which will cause errors unless these tools are available: -- Only run the linter in buffers that you can modify in order to
-- { -- avoid superfluous noise, notably within the handy LSP pop-ups that
-- clojure = { "clj-kondo" }, -- describe the hovered symbol using Markdown.
-- dockerfile = { "hadolint" }, if vim.bo.modifiable then lint.try_lint() end
-- inko = { "inko" }, end,
-- janet = { "janet" }, })
-- json = { "jsonlint" }, end,
-- markdown = { "vale" },
-- rst = { "vale" },
-- ruby = { "ruby" },
-- terraform = { "tflint" },
-- text = { "vale" }
-- }
--
-- You can disable the default linters by setting their filetypes to nil:
-- lint.linters_by_ft['clojure'] = nil
-- lint.linters_by_ft['dockerfile'] = nil
-- lint.linters_by_ft['inko'] = nil
-- lint.linters_by_ft['janet'] = nil
-- lint.linters_by_ft['json'] = nil
-- lint.linters_by_ft['markdown'] = nil
-- lint.linters_by_ft['rst'] = nil
-- lint.linters_by_ft['ruby'] = nil
-- lint.linters_by_ft['terraform'] = nil
-- lint.linters_by_ft['text'] = nil
-- Create autocommand which carries out the actual linting
-- on the specified events.
local lint_augroup = vim.api.nvim_create_augroup('lint', { clear = true })
vim.api.nvim_create_autocmd({ 'BufEnter', 'BufWritePost', 'InsertLeave' }, {
group = lint_augroup,
callback = function()
-- Only run the linter in buffers that you can modify in order to
-- avoid superfluous noise, notably within the handy LSP pop-ups that
-- describe the hovered symbol using Markdown.
if vim.bo.modifiable then lint.try_lint() end
end,
})
end,
},
} }