Compare commits

...

26 Commits

Author SHA1 Message Date
Damjan 9000
2ea6bf6fea Merge upstream: Fix mini.ai example 2026-05-10 20:02:41 +02:00
orip
4b065ad2f7 Fix mini.ai example 2026-04-22 17:59:57 +03:00
Damjan 9000
b30e683e1e Merge upstream: Fix conflicts between built-in incremental selection and mini.ai keymaps 2026-04-19 00:59:20 +02:00
Damjan 9000
9cf1323fe7 Merge upstream: Merge pull request #1991 from nvim-lua/refactor/conform 2026-04-19 00:58:45 +02:00
Damjan 9000
3fadba5ff1 Merge upstream: Fix descriptions of gitsigns keymappings (#1997) 2026-04-19 00:57:39 +02:00
Damjan 9000
bd8189ad2c Merge upstream: Fix treesitter indents 2026-04-19 00:54:07 +02:00
orip
9b4fbc5021 Fix conflicts between built-in incremental selection and mini.ai keymaps
closes #1996
closes #1992
2026-04-18 13:30:10 +03:00
Ori Perry
f5b0e497c6
Merge pull request #1991 from nvim-lua/refactor/conform
Refactor/conform
2026-04-18 13:11:40 +03:00
orip
ce353a9b0e Change format_on_save to a whitelist instead of a blacklist 2026-04-16 22:02:25 +03:00
orip
459b86865e Use stylua as an lsp formatter instead of an external formatter 2026-04-16 22:02:24 +03:00
Stattek
648471c9eb
Fix descriptions of gitsigns keymappings (#1997)
* Fix descriptions of keymappings

* Fix capitalization
2026-04-15 11:49:09 +03:00
orip
f27810d1bd Fix treesitter indents
Thanks @jackHerby for the report
fixes #1995
2026-04-15 03:44:17 +03:00
Damjan 9000
3174e0539c Merge upstream: Merge pull request #1988 from sebastianstudniczek/fix/treesitter-indent-fallback 2026-04-12 23:54:54 +02:00
Ori Perry
c0cc054155
Merge pull request #1988 from sebastianstudniczek/fix/treesitter-indent-fallback
fix(treesitter): Add indentation fallback
2026-04-12 16:32:28 +03:00
Sebastian Studniczek
c7f05a0f47 Add indentation fallback 2026-04-10 20:06:22 +02:00
Damjan 9000
f0b4c3d469 Merge upstream: Add a comment to the line plugin about installing markdownlint 2026-04-03 19:28:17 +02:00
Damjan 9000
d1e0989e0a Merge upstream: Update the recommanded gitsigns keybinds 2026-04-03 19:27:57 +02:00
Damjan 9000
450a5c6ab6 Merge upstream: Auto install treesitter parsers when opening a file 2026-04-03 19:27:45 +02:00
Damjan 9000
403ea803ba Merge upstream: Refactor treesitter attach code 2026-04-03 19:27:11 +02:00
Ori Perry
16dd8f5007 Add a comment to the line plugin about installing markdownlint 2026-03-31 23:49:19 +03:00
Ori Perry
d3168308d4 Update the recommanded gitsigns keybinds
closes #1459
2026-03-31 23:41:40 +03:00
Damjan 9000
7005d8d24a Merge branch 'upstream' Revise comment for lazy-lock.json in .gitignore 2026-03-22 10:32:44 +01:00
Ori Perry
e01e1eb8f8 Auto install treesitter parsers when opening a file
closes #1951
2026-03-20 22:03:32 +02:00
Ori Perry
8ac4b12632 Refactor treesitter attach code 2026-03-20 21:59:19 +02:00
Ori Perry
0619d89884
Merge pull request #1914 from rmacklin/futher-clarify-gitignore-comment
Revise comment for lazy-lock.json in .gitignore
2026-03-20 12:59:54 +02:00
Richard Macklin
164cedf212 Revise comment for lazy-lock.json in .gitignore
This is a follow-up to df9436c0e57425a43b527c3ee1d63c98af3b6768 to
hopefully make things even clearer.

Co-authored-by: Ori Perry <oriori1703@gmail.com>
2026-03-10 11:33:34 -07:00
7 changed files with 77 additions and 33 deletions

7
.gitignore vendored
View File

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

View File

@ -8,7 +8,7 @@ return {
keys = {
{
'<leader>f',
function() require('conform').format { async = true, lsp_format = 'fallback' } end,
function() require('conform').format { async = true } end,
mode = '',
desc = '[F]ormat buffer',
},
@ -18,21 +18,23 @@ return {
opts = {
notify_on_error = false,
format_on_save = function(bufnr)
-- Disable "format_on_save lsp_fallback" for languages that don't
-- have a well standardized coding style. You can add additional
-- languages here or re-enable it for the disabled ones.
local disable_filetypes = { c = true, cpp = true }
if disable_filetypes[vim.bo[bufnr].filetype] then
return nil
-- You can specify filetypes to autoformat on save here:
local enabled_filetypes = {
-- lua = true,
-- python = true,
}
if enabled_filetypes[vim.bo[bufnr].filetype] then
return { timeout_ms = 500 }
else
return {
timeout_ms = 500,
lsp_format = 'fallback',
}
return nil
end
end,
default_format_opts = {
lsp_format = 'fallback', -- Use external formatters if configured below, otherwise use LSP formatting. Set to `false` to disable LSP formatting entirely.
},
-- You can also specify external formatters in here.
formatters_by_ft = {
lua = { 'stylua' },
-- rust = { 'rustfmt' },
-- Conform can also run multiple formatters sequentially
-- python = { "isort", "black" },
--

View File

@ -63,15 +63,20 @@ return {
map('n', '<leader>hs', gitsigns.stage_hunk, { desc = 'git [s]tage hunk' })
map('n', '<leader>hr', gitsigns.reset_hunk, { desc = 'git [r]eset hunk' })
map('n', '<leader>hS', gitsigns.stage_buffer, { desc = 'git [S]tage buffer' })
map('n', '<leader>hu', gitsigns.stage_hunk, { desc = 'git [u]ndo stage hunk' })
map('n', '<leader>hR', gitsigns.reset_buffer, { desc = 'git [R]eset buffer' })
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>hi', gitsigns.preview_hunk_inline, { desc = 'git preview hunk [i]nline' })
map('n', '<leader>hb', function() gitsigns.blame_line { full = true } end, { 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' })
map('n', '<leader>hQ', function() gitsigns.setqflist 'all' end, { desc = 'git hunk [Q]uickfix list (all files in repo)' })
map('n', '<leader>hq', gitsigns.setqflist, { desc = 'git hunk [q]uickfix list (all changes in this file)' })
-- 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' })
map('n', '<leader>tw', gitsigns.toggle_word_diff, { desc = '[T]oggle git intra-line [w]ord diff' })
-- Text object
map({ 'o', 'x' }, 'ih', gitsigns.select_hunk)
end,
},
}

View File

@ -8,7 +8,7 @@ return {
config = function()
local lint = require 'lint'
lint.linters_by_ft = {
markdown = { 'markdownlint' },
markdown = { 'markdownlint' }, -- Make sure to install `markdownlint` via mason / npm
}
-- To allow other plugins to add linters to require('lint').linters_by_ft,

View File

@ -138,6 +138,8 @@ return {
-- Special Lua Config, as recommended by neovim help docs
lua_ls = {
on_init = function(client)
client.server_capabilities.documentFormattingProvider = false -- Disable formatting (formatting is done by stylua)
if client.workspace_folders then
local path = client.workspace_folders[1].name
if path ~= vim.fn.stdpath 'config' and (vim.uv.fs_stat(path .. '/.luarc.json') or vim.uv.fs_stat(path .. '/.luarc.jsonc')) then return end
@ -159,8 +161,11 @@ return {
},
})
end,
---@type lspconfig.settings.lua_ls
settings = {
Lua = {},
Lua = {
format = { enable = false }, -- Disable formatting (formatting is done by stylua)
},
},
},
}

View File

@ -8,9 +8,16 @@ return {
--
-- Examples:
-- - va) - [V]isually select [A]round [)]paren
-- - yinq - [Y]ank [I]nside [N]ext [Q]uote
-- - yiiq - [Y]ank [I]nside [I]+1 [Q]uote
-- - ci' - [C]hange [I]nside [']quote
require('mini.ai').setup { n_lines = 500 }
require('mini.ai').setup {
-- NOTE: Avoid conflicts with the built-in incremental selection mappings on Neovim>=0.12 (see `:help treesitter-incremental-selection`)
mappings = {
around_next = 'aa',
inside_next = 'ii',
},
n_lines = 500,
}
-- Add/delete/replace surroundings (brackets, quotes, etc.)
--

View File

@ -8,8 +8,32 @@ return {
branch = 'main',
-- [[ Configure Treesitter ]] See `:help nvim-treesitter-intro`
config = function()
-- ensure basic parser are installed
local parsers = { 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'vim', 'vimdoc' }
require('nvim-treesitter').install(parsers)
---@param buf integer
---@param language string
local function treesitter_try_attach(buf, language)
-- check if parser exists and load it
if not vim.treesitter.language.add(language) then return end
-- enables syntax highlighting and other treesitter features
vim.treesitter.start(buf, language)
-- enables treesitter based folds
-- for more info on folds see `:help folds`
-- vim.wo.foldexpr = 'v:lua.vim.treesitter.foldexpr()'
-- vim.wo.foldmethod = 'expr'
-- check if treesitter indentation is available for this language, and if so enable it
-- in case there is no indent query, the indentexpr will fallback to the vim's built in one
local has_indent_query = vim.treesitter.query.get(language, 'indents') ~= nil
-- enables treesitter based indentation
if has_indent_query then vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()" end
end
local available_parsers = require('nvim-treesitter').get_available()
vim.api.nvim_create_autocmd('FileType', {
callback = function(args)
local buf, filetype = args.buf, args.match
@ -17,18 +41,18 @@ return {
local language = vim.treesitter.language.get_lang(filetype)
if not language then return end
-- check if parser exists and load it
if not vim.treesitter.language.add(language) then return end
-- enables syntax highlighting and other treesitter features
vim.treesitter.start(buf, language)
local installed_parsers = require('nvim-treesitter').get_installed 'parsers'
-- enables treesitter based folds
-- for more info on folds see `:help folds`
-- vim.wo.foldexpr = 'v:lua.vim.treesitter.foldexpr()'
-- vim.wo.foldmethod = 'expr'
-- enables treesitter based indentation
vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()"
if vim.tbl_contains(installed_parsers, language) then
-- enable the parser if it is installed
treesitter_try_attach(buf, language)
elseif vim.tbl_contains(available_parsers, language) then
-- if a parser is available in `nvim-treesitter` auto install it, and enable it after the installation is done
require('nvim-treesitter').install(language):await(function() treesitter_try_attach(buf, language) end)
else
-- try to enable treesitter features in case the parser exists but is not available from `nvim-treesitter`
treesitter_try_attach(buf, language)
end
end,
})
end,