Compare commits

..

1 commit

Author SHA1 Message Date
github-actions[bot]
428007d765 chore: update flake.lock
Flake lock file updates:

• Updated input 'neovim-nightly-overlay':
    'github:nix-community/neovim-nightly-overlay/f7fbc4e3d4ccea45eaa5b187884592eb42dfdbbd?narHash=sha256-YMf/PUyY4z7RlIe/Dzn1NnxZGS0Vp2eHxcMNWJM9q%2BA%3D' (2025-12-18)
  → 'github:nix-community/neovim-nightly-overlay/dfbb35b3cf396ead65028b7023f07f51927f86e3?narHash=sha256-gmoKSWO4DM/VnlskS9UmQnXyZTm0xcl4cDx3e/CJZeY%3D' (2026-01-01)
• Updated input 'neovim-nightly-overlay/neovim-src':
    'github:neovim/neovim/c172fd9f464d5766eab9071e8f4770504c920c05?narHash=sha256-KE/ufBGH8XFXTw3Vt1DrK1rQmAEp1Q%2BoyLQibX5UKO0%3D' (2025-12-17)
  → 'github:neovim/neovim/170992c8d218f28dcffd967ecc2bae3fb3c46545?narHash=sha256-SewYGH53QWyiHBNCxJuyESu/D7v0tXi2oq3NREI/AeA%3D' (2025-12-31)
• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/1306659b587dc277866c7b69eb97e5f07864d8c4?narHash=sha256-KJ2wa/BLSrTqDjbfyNx70ov/HdgNBCBBSQP3BIzKnv4%3D' (2025-12-15)
  → 'github:NixOS/nixpkgs/cad22e7d996aea55ecab064e84834289143e44a0?narHash=sha256-5vKw92l1GyTnjoLzEagJy5V5mDFck72LiQWZSOnSicw%3D' (2025-12-30)
• Updated input 'nvim-treesitter-main':
    'github:iofq/nvim-treesitter-main/2e8b5c686fc346c34b1d2a269584b32f480e7b7f?narHash=sha256-%2BUw%2B965kDJTriyUGiYF/eYAuQBowoBZpLzJswInqLCY%3D' (2025-12-14)
  → 'github:iofq/nvim-treesitter-main/85ae6d99e035e1d1e025bbba8df467e9db709a0b?narHash=sha256-Robm9U2blKNPCqQAMzrNyr2VL/PGSOsyvg%2BNbQL2N0E%3D' (2025-12-28)
• Updated input 'nvim-treesitter-main/nixpkgs':
    'github:nixos/nixpkgs/2fbfb1d73d239d2402a8fe03963e37aab15abe8b?narHash=sha256-9VvC20PJPsleGMewwcWYKGzDIyjckEz8uWmT0vCDYK0%3D' (2025-12-11)
  → 'github:nixos/nixpkgs/3e2499d5539c16d0d173ba53552a4ff8547f4539?narHash=sha256-QEhk0eXgyIqTpJ/ehZKg9IKS7EtlWxF3N7DXy42zPfU%3D' (2025-12-25)
• Updated input 'nvim-treesitter-main/nvim-treesitter':
    'github:nvim-treesitter/nvim-treesitter/74b119812e9f82bccc2f0eca156faff0354362ae?narHash=sha256-HT%2BUzX1m4hm2QAqDa0dltArr3gMyYhXHnHoYkkQBWZA%3D' (2025-12-13)
  → 'github:nvim-treesitter/nvim-treesitter/36fcb4a4238928f0b627e1ab84ade0acc1facc2c?narHash=sha256-E3nJCBGKBUQWYAL9h9ygdtCCndi0%2Brwkq0hhAAq1W94%3D' (2025-12-27)
• Updated input 'nvim-treesitter-main/nvim-treesitter-textobjects':
    'github:nvim-treesitter/nvim-treesitter-textobjects/0d7c800fadcfe2d33089f5726cb8907fc846eece?narHash=sha256-w2dzc5oWyEoPUgbqaAuNKCeFeh81rYJPOCPVRnFC724%3D' (2025-12-14)
  → 'github:nvim-treesitter/nvim-treesitter-textobjects/ecd03f5811eb5c66d2fa420b79121b866feecd82?narHash=sha256-mMxCAkrGqTstEgaf/vwQMEF7D8swH3oyUJtaxuXzpcs%3D' (2025-12-27)
2026-01-01 10:21:29 +00:00
9 changed files with 169 additions and 55 deletions

View file

@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
package_name: ["nvim-min"]
package_name: ["nvim"]
steps:
- uses: actions/checkout@v3
- uses: DeterminateSystems/nix-installer-action@main

View file

@ -5,7 +5,7 @@
## Usage
Try it out!
```bash
nix run "github:iofq/nvim.nix" #nvim-min
nix run "github:iofq/nvim.nix" #nvim
```
Or use in a flake:

99
flake.lock generated
View file

@ -61,11 +61,11 @@
]
},
"locked": {
"lastModified": 1768135262,
"narHash": "sha256-PVvu7OqHBGWN16zSi6tEmPwwHQ4rLPU9Plvs8/1TUBY=",
"lastModified": 1765835352,
"narHash": "sha256-XswHlK/Qtjasvhd1nOa1e8MgZ8GS//jBoTqWtrS1Giw=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "80daad04eddbbf5a4d883996a73f3f542fa437ac",
"rev": "a34fae9c08a15ad73f295041fec82323541400a9",
"type": "github"
},
"original": {
@ -203,11 +203,11 @@
]
},
"locked": {
"lastModified": 1768349111,
"narHash": "sha256-Ufn7eONdsaB6wso01KOyC8fWXDPbCsf6q/120JrSRBg=",
"lastModified": 1767225850,
"narHash": "sha256-gmoKSWO4DM/VnlskS9UmQnXyZTm0xcl4cDx3e/CJZeY=",
"owner": "nix-community",
"repo": "neovim-nightly-overlay",
"rev": "c18fb3367dbaa0830dd46443cc1cb006444e1f0e",
"rev": "dfbb35b3cf396ead65028b7023f07f51927f86e3",
"type": "github"
},
"original": {
@ -219,11 +219,11 @@
"neovim-src": {
"flake": false,
"locked": {
"lastModified": 1768347573,
"narHash": "sha256-s3CvS2gr1y+DabfpNHjPy4Al2KVcWbS4F5TsfwR12Cs=",
"lastModified": 1767222005,
"narHash": "sha256-SewYGH53QWyiHBNCxJuyESu/D7v0tXi2oq3NREI/AeA=",
"owner": "neovim",
"repo": "neovim",
"rev": "bb0f28f20be3b5dd64881d0528f43a8e2eea63c0",
"rev": "170992c8d218f28dcffd967ecc2bae3fb3c46545",
"type": "github"
},
"original": {
@ -277,27 +277,98 @@
},
"nixpkgs_2": {
"locked": {
"lastModified": 1768384274,
"narHash": "sha256-Iy0CREn8AVYpQCXffCGnP1/PemrWDr2ST+vlFji/UQA=",
"lastModified": 1767116409,
"narHash": "sha256-5vKw92l1GyTnjoLzEagJy5V5mDFck72LiQWZSOnSicw=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "6a758e1182472360ea18946eb064fef36041d744",
"rev": "cad22e7d996aea55ecab064e84834289143e44a0",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "master",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_3": {
"locked": {
"lastModified": 1766651565,
"narHash": "sha256-QEhk0eXgyIqTpJ/ehZKg9IKS7EtlWxF3N7DXy42zPfU=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "3e2499d5539c16d0d173ba53552a4ff8547f4539",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nvim-treesitter": {
"flake": false,
"locked": {
"lastModified": 1766818605,
"narHash": "sha256-E3nJCBGKBUQWYAL9h9ygdtCCndi0+rwkq0hhAAq1W94=",
"owner": "nvim-treesitter",
"repo": "nvim-treesitter",
"rev": "36fcb4a4238928f0b627e1ab84ade0acc1facc2c",
"type": "github"
},
"original": {
"owner": "nvim-treesitter",
"ref": "main",
"repo": "nvim-treesitter",
"type": "github"
}
},
"nvim-treesitter-main": {
"inputs": {
"nixpkgs": "nixpkgs_3",
"nvim-treesitter": "nvim-treesitter",
"nvim-treesitter-textobjects": "nvim-treesitter-textobjects"
},
"locked": {
"lastModified": 1766957367,
"narHash": "sha256-Robm9U2blKNPCqQAMzrNyr2VL/PGSOsyvg+NbQL2N0E=",
"owner": "iofq",
"repo": "nvim-treesitter-main",
"rev": "85ae6d99e035e1d1e025bbba8df467e9db709a0b",
"type": "github"
},
"original": {
"owner": "iofq",
"repo": "nvim-treesitter-main",
"type": "github"
}
},
"nvim-treesitter-textobjects": {
"flake": false,
"locked": {
"lastModified": 1766794712,
"narHash": "sha256-mMxCAkrGqTstEgaf/vwQMEF7D8swH3oyUJtaxuXzpcs=",
"owner": "nvim-treesitter",
"repo": "nvim-treesitter-textobjects",
"rev": "ecd03f5811eb5c66d2fa420b79121b866feecd82",
"type": "github"
},
"original": {
"owner": "nvim-treesitter",
"ref": "main",
"repo": "nvim-treesitter-textobjects",
"type": "github"
}
},
"root": {
"inputs": {
"dart": "dart",
"flake-utils": "flake-utils_2",
"gen-luarc": "gen-luarc",
"neovim-nightly-overlay": "neovim-nightly-overlay",
"nixpkgs": "nixpkgs_2"
"nixpkgs": "nixpkgs_2",
"nvim-treesitter-main": "nvim-treesitter-main"
}
},
"systems": {

View file

@ -2,7 +2,7 @@
description = "Neovim derivation";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/master";
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
neovim-nightly-overlay = {
url = "github:nix-community/neovim-nightly-overlay";
@ -15,6 +15,9 @@
dart = {
url = "github:iofq/dart.nvim";
};
nvim-treesitter-main = {
url = "github:iofq/nvim-treesitter-main";
};
};
outputs =
inputs@{
@ -29,6 +32,17 @@
neovim-overlay = import ./nix/neovim-overlay.nix { inherit inputs; };
finalOverlays = [
inputs.neovim-nightly-overlay.overlays.default
inputs.nvim-treesitter-main.overlays.default
(final: prev: {
vimPlugins = prev.vimPlugins.extend (
f: p: {
nvim-treesitter = p.nvim-treesitter.withAllGrammars;
nvim-treesitter-textobjects = p.nvim-treesitter-textobjects.overrideAttrs {
dependencies = [ f.nvim-treesitter ];
};
}
);
})
neovim-overlay
];
in
@ -59,7 +73,6 @@
packages = rec {
default = nvim;
nvim = pkgs.nvim-pkg;
nvim-min = pkgs.nvim-min-pkg;
};
devShells = {
default = shell;

View file

@ -14,43 +14,21 @@ let
nvim-autopairs
nvim-lint
nvim-lspconfig
nvim-treesitter.withAllGrammars
nvim-treesitter
nvim-treesitter-textobjects
quicker-nvim
render-markdown-nvim
snacks-nvim
];
basePackages = with prev; [
packages = with prev; [
ripgrep
fd
];
# Extra packages that should be included on nixos but don't need to be bundled
extraPackages = with prev; [
# linters
yamllint
jq
hadolint
nixfmt
shellcheck
golangci-lint
# LSPs
gopls
lua-language-server
nixd
basedpyright
];
in
{
nvim-pkg = mkNeovim {
inherit plugins;
packages = basePackages ++ extraPackages;
};
nvim-min-pkg = mkNeovim {
inherit plugins;
packages = basePackages;
inherit plugins packages;
};
nvim-luarc-json = final.mk-luarc-json {

View file

@ -62,6 +62,21 @@ function M.file_history(filename)
end
end
local function confirm(picker, item)
picker:close()
local cmd = string.format('jj show --git -r %s', item.rev)
local out = vim.fn.systemlist(cmd)
local bufnr = vim.api.nvim_create_buf(false, true)
vim.api.nvim_buf_set_lines(bufnr, 0, -1, false, out)
vim.bo[bufnr].bufhidden = 'wipe'
vim.bo[bufnr].buftype = 'nofile'
vim.bo[bufnr].filetype = 'diff'
vim.keymap.set('n', 'q', vim.cmd.bdelete, { buffer = bufnr, noremap = true })
vim.api.nvim_set_current_buf(bufnr)
end
local function get_history(f)
local status_raw = vim.fn.system(
'jj log --ignore-working-copy --no-graph'
@ -85,6 +100,7 @@ function M.file_history(filename)
title = 'jj file history for ' .. filename,
items = get_history(filename),
preview = preview,
confirm = confirm,
}
end
return M

View file

@ -48,7 +48,7 @@ cmd('FileType', {
local ns = vim.api.nvim_create_namespace('nvim.difftool.hl')
vim.api.nvim_buf_clear_namespace(event.buf, ns, 0, -1)
for i, item in ipairs(qf) do
local path = vim.fn.fnamemodify(item.user_data.right, ':t')
local path = vim.fn.fnamemodify(item.user_data.right, ':.')
local hl = 'Added'
if
exec('git diff --quiet -- %s', path) ~= 0
@ -98,6 +98,45 @@ cmd('BufWinEnter', {
vim.cmd(string.format('%dcopen', math.min(10, #items)))
end)
end
local function get_hunks(bufnr)
local conf_start = vim.fn.search('^<<<<<<<', 'bc')
local base_start = vim.fn.search('^|||||||', 'W')
local base_end = vim.fn.search('^=======', 'W')
local conf_end = vim.fn.search('^>>>>>>>', 'W')
local left = vim.api.nvim_buf_get_lines(bufnr, conf_start, base_start - 1, false)
local right = vim.api.nvim_buf_get_lines(bufnr, base_end, conf_end - 1, false)
return {
start = conf_start,
stop = conf_end,
left = left,
right = right,
}
end
local function apply_hunk(hunks, first)
local result = {}
if first == -1 then -- left first
vim.list_extend(result, hunks.left)
vim.list_extend(result, hunks.right)
else
vim.list_extend(result, hunks.right)
vim.list_extend(result, hunks.left)
end
-- apply hunk in place
vim.api.nvim_buf_set_lines(0, hunks.start - 1, hunks.stop, false, result)
end
-- "combine" mappings ala vscode's merge editor
vim.keymap.set('n', '<leader>dl', function()
apply_hunk(get_hunks(event.buf), -1)
end, { buffer = event.buf })
vim.keymap.set('n', '<leader>dr', function()
apply_hunk(get_hunks(event.buf), 1)
end, { buffer = event.buf })
end,
})

View file

@ -9,6 +9,8 @@ vim.schedule(function()
ai.setup {
n_lines = 300,
custom_textobjects = {
i = require('mini.extra').gen_ai_spec.indent(),
b = require('mini.extra').gen_ai_spec.buffer(),
a = ai.gen_spec.treesitter { a = '@parameter.outer', i = '@parameter.inner' },
f = ai.gen_spec.treesitter { a = '@function.outer', i = '@function.inner' },
},
@ -16,9 +18,7 @@ vim.schedule(function()
require('mini.git').setup()
map('n', '<leader>gb', '<Cmd>Git blame -- %<CR>')
map('n', '<leader>go', function()
return MiniGit.show_at_cursor()
end)
map('n', '<leader>go', MiniGit.show_at_cursor)
local jump = require('mini.jump2d')
jump.setup {

View file

@ -3,12 +3,7 @@ local map = vim.keymap.set
require('mini.basics').setup { mappings = { windows = true } }
require('mini.icons').setup()
require('dart').setup {
tabline = {
icons = false,
label_marked_fg = 'cyan',
},
}
require('dart').setup {}
require('snacks').setup {
bigfile = { enabled = true },
@ -76,7 +71,6 @@ vim.schedule(function()
json = { 'jq' },
lua = { 'stylua' },
python = { 'ruff' },
nix = { 'nixfmt' },
fish = { 'fish_indent' },
['*'] = { 'trim_whitespace' },
},
@ -99,11 +93,14 @@ vim.schedule(function()
require('lint').linters_by_ft = {
docker = { 'hadolint' },
yaml = { 'yamllint' },
sh = { 'shellcheck' },
go = { 'golangcilint' },
ruby = { 'rubocop' },
fish = { 'fish' },
bash = { 'bash' },
nix = { 'nix' },
php = { 'php' },
}
vim.api.nvim_create_autocmd({ 'BufWritePost' }, {
callback = function()
@ -119,7 +116,7 @@ vim.schedule(function()
sources = {
default = { 'lsp', 'path', 'snippets', 'ripgrep', 'buffer' },
providers = {
lsp = { fallbacks = {} }, -- include buffer even when LSP is active
lsp = { fallbacks = {}, async = true }, -- include buffer even when LSP is active
path = { opts = { get_cwd = vim.fn.getcwd } }, -- use nvim pwd instead of current file pwd
ripgrep = {
module = 'blink-ripgrep',