Compare commits

...

9 commits

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

• Updated input 'dart':
    'github:iofq/dart.nvim/5fac43b0f7b5500c69a51a3717aef8ccceacd178?narHash=sha256-qGWNl%2BUQLvdFl8AAgywOHthizfKovk8az1xhRhQeVn8%3D' (2025-10-13)
  → 'github:iofq/dart.nvim/71421e7ef5aee8267e24dc562fdd07a83bda192e?narHash=sha256-ULrZW4b8SKRvPpJPt8/jkqqc/blQiIWUriNWVXA33so%3D' (2025-10-23)
• Updated input 'neovim-nightly-overlay':
    'github:nix-community/neovim-nightly-overlay/7ff73a295b0065bde2f8b43b31558136ca77bd98?narHash=sha256-39JFRb006AOsIcOq%2B03H3y6YcGyaphk1CW5DRi14cOE%3D' (2025-10-13)
  → 'github:nix-community/neovim-nightly-overlay/c58076a0d9b24bf77fef4fa2e7c43950914edf71?narHash=sha256-hQomzSbBiFsDXDMCjHmWXrAMgFlQlCiy7T37Eq7RvT4%3D' (2025-11-01)
• Removed input 'neovim-nightly-overlay/flake-compat'
• Updated input 'neovim-nightly-overlay/flake-parts':
    'github:hercules-ci/flake-parts/758cf7296bee11f1706a574c77d072b8a7baa881?narHash=sha256-wfG0S7pltlYyZTM%2BqqlhJ7GMw2fTF4mLKCIVhLii/4M%3D' (2025-10-01)
  → 'github:hercules-ci/flake-parts/864599284fc7c0ba6357ed89ed5e2cd5040f0c04?narHash=sha256-TmWcdiUUaWk8J4lpjzu4gCGxWY6/Ok7mOK4fIFfBuU4%3D' (2025-10-20)
• Removed input 'neovim-nightly-overlay/git-hooks'
• Removed input 'neovim-nightly-overlay/git-hooks/flake-compat'
• Removed input 'neovim-nightly-overlay/git-hooks/gitignore'
• Removed input 'neovim-nightly-overlay/git-hooks/gitignore/nixpkgs'
• Removed input 'neovim-nightly-overlay/git-hooks/nixpkgs'
• Removed input 'neovim-nightly-overlay/hercules-ci-effects'
• Removed input 'neovim-nightly-overlay/hercules-ci-effects/flake-parts'
• Removed input 'neovim-nightly-overlay/hercules-ci-effects/nixpkgs'
• Updated input 'neovim-nightly-overlay/neovim-src':
    'github:neovim/neovim/72b0bfa1fb7e897e5126aabae718a5480f466b9e?narHash=sha256-RnB%2BoJcP37YT9pjr1osUQtJc%2B1qcVyaaeSbiSyXwm1Y%3D' (2025-10-12)
  → 'github:neovim/neovim/1fddd74da7428e38b79ccb817dbd6952ff1d8ac6?narHash=sha256-YgMQaFD4L9%2BPEYSkUlBkqaKt%2BALPHiVgzgRbjOSW4tE%3D' (2025-10-31)
• Removed input 'neovim-nightly-overlay/treefmt-nix'
• Removed input 'neovim-nightly-overlay/treefmt-nix/nixpkgs'
• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/cfe6b045750c3aa5127817bc3f44f2909b1ee175?narHash=sha256-z%2BC6KRPRjwqEsTEAwUavapBWcbR7YOlQP91O%2BW5L1ek%3D' (2025-10-13)
  → 'github:NixOS/nixpkgs/0e65d6bc462e57fe6a76a49d4eea909ba08b1dc1?narHash=sha256-rccG7eGGelDsu4eXPi2vdBR1pddZFZAd/JlB3NLjgy4%3D' (2025-11-01)
• Updated input 'nvim-treesitter-main':
    'github:iofq/nvim-treesitter-main/da2262419eb66cfa426aa62ccf1fc8fdea33b4a0?narHash=sha256-ZlVGaUbxHf4DNR4GWhF1mvlMhP8IBbwF0g8WO1SL%2BYw%3D' (2025-10-13)
  → 'github:iofq/nvim-treesitter-main/834d66648bb7a96a2ad11d53a33f2d9b13766447?narHash=sha256-xTQUiJu0jJNSEHEv4La1HbaFokup0eWr67Kqf/wDENA%3D' (2025-10-26)
• Updated input 'nvim-treesitter-main/nixpkgs':
    'github:nixos/nixpkgs/0b4defa2584313f3b781240b29d61f6f9f7e0df3?narHash=sha256-Oncbh0UmHjSlxO7ErQDM3KM0A5/Znfofj2BSzlHLeVw%3D' (2025-10-09)
  → 'github:nixos/nixpkgs/01f116e4df6a15f4ccdffb1bcd41096869fb385c?narHash=sha256-f/QCJM/YhrV/lavyCVz8iU3rlZun6d%2BdAiC3H%2BCDle4%3D' (2025-10-22)
• Updated input 'nvim-treesitter-main/nvim-treesitter':
    'github:nvim-treesitter/nvim-treesitter/0606c7a9dcaa5c5beee0b0f09043e9fdd1ba0a68?narHash=sha256-To/syCZPs7vKA0WkuBz7ZxCGT/wzj705QfxZng6Nsjo%3D' (2025-10-12)
  → 'github:nvim-treesitter/nvim-treesitter/98fe644cb3b5ba390d1bc3f89299f93c70020803?narHash=sha256-/SGikTPEMxI7rcfGvuJlNZs73/wZiQx14QX9xlfsTv0%3D' (2025-10-25)
2025-11-01 10:17:18 +00:00
ce017fd37c fix os.execute return
Some checks failed
build / build (nvim-min) (push) Has been cancelled
2025-10-15 19:53:57 -05:00
35b0e05965 fix local flake path 2025-10-15 19:41:31 -05:00
49e373fe9a remove unused nix code
Some checks are pending
build / build (nvim-min) (push) Waiting to run
flake.lock: Update

Flake lock file updates:

• Updated input 'neovim-nightly-overlay':
    'github:nix-community/neovim-nightly-overlay/b7b3632fab34541543373254c265da03c1d0f240?narHash=sha256-SDLZMha2miaChOBGBkQJlTtk2kvcB7WIVVZ2l0/9byc%3D' (2025-10-01)
  → 'github:nix-community/neovim-nightly-overlay/7ff73a295b0065bde2f8b43b31558136ca77bd98?narHash=sha256-39JFRb006AOsIcOq%2B03H3y6YcGyaphk1CW5DRi14cOE%3D' (2025-10-13)
• Updated input 'neovim-nightly-overlay/flake-parts':
    'github:hercules-ci/flake-parts/4524271976b625a4a605beefd893f270620fd751?narHash=sha256-%2BuWLQZccFHwqpGqr2Yt5VsW/PbeJVTn9Dk6SHWhNRPw%3D' (2025-09-01)
  → 'github:hercules-ci/flake-parts/758cf7296bee11f1706a574c77d072b8a7baa881?narHash=sha256-wfG0S7pltlYyZTM%2BqqlhJ7GMw2fTF4mLKCIVhLii/4M%3D' (2025-10-01)
• Updated input 'neovim-nightly-overlay/git-hooks':
    'github:cachix/git-hooks.nix/54df955a695a84cd47d4a43e08e1feaf90b1fd9b?narHash=sha256-ytw7ROXaWZ7OfwHrQ9xvjpUWeGVm86pwnEd1QhzawIo%3D' (2025-09-17)
  → 'github:cachix/git-hooks.nix/cfc9f7bb163ad8542029d303e599c0f7eee09835?narHash=sha256-PTod9NG%2Bi3XbbnBKMl/e5uHDBYpwIWivQ3gOWSEuIEM%3D' (2025-10-03)
• Updated input 'neovim-nightly-overlay/neovim-src':
    'github:neovim/neovim/198c9e9bca7549cf7110be8c6f1df1c38d4e747f?narHash=sha256-oc1pPeoe8458X0r/Wum8CucVcJLlIp4mg%2B1HiOSVRgA%3D' (2025-09-30)
  → 'github:neovim/neovim/72b0bfa1fb7e897e5126aabae718a5480f466b9e?narHash=sha256-RnB%2BoJcP37YT9pjr1osUQtJc%2B1qcVyaaeSbiSyXwm1Y%3D' (2025-10-12)
• Updated input 'neovim-nightly-overlay/nixpkgs':
    'github:NixOS/nixpkgs/647e5c14cbd5067f44ac86b74f014962df460840?narHash=sha256-JVZl8NaVRYb0%2B381nl7LvPE%2BA774/dRpif01FKLrYFQ%3D' (2025-09-28)
  → 'github:NixOS/nixpkgs/362791944032cb532aabbeed7887a441496d5e6e?narHash=sha256-gKl2Gtro/LNf8P%2B4L3S2RsZ0G390ccd5MyXYrTdMCFE%3D' (2025-10-11)
• Updated input 'neovim-nightly-overlay/treefmt-nix':
    'github:numtide/treefmt-nix/5eda4ee8121f97b218f7cc73f5172098d458f1d1?narHash=sha256-ySNJ008muQAds2JemiyrWYbwbG%2BV7S5wg3ZVKGHSFu8%3D' (2025-09-24)
  → 'github:numtide/treefmt-nix/761ae7aff00907b607125b2f57338b74177697ed?narHash=sha256-gq9rdocpmRZCwLS5vsHozwB6b5nrOBDNc2kkEaTXHfg%3D' (2025-10-10)
• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/d48b56f4899ee1d5377291576284969c9e37acc2?narHash=sha256-7G5fSMPNVwWNlFpZLwvKB8PUOaqPzFQbrtZ7RAzg2nw%3D' (2025-10-01)
  → 'github:NixOS/nixpkgs/09c05674757a82f32b67f70f702e56c4901a3cdd?narHash=sha256-IzUhHp/jU06jBW6S%2Bd12AO3sgq5yehYVTCBH7J6re5c%3D' (2025-10-13)

flake.lock: Update

Flake lock file updates:

• Updated input 'neovim-nightly-overlay/nixpkgs':
    'github:NixOS/nixpkgs/362791944032cb532aabbeed7887a441496d5e6e?narHash=sha256-gKl2Gtro/LNf8P%2B4L3S2RsZ0G390ccd5MyXYrTdMCFE%3D' (2025-10-11)
  → follows 'nixpkgs'
2025-10-15 02:49:58 -05:00
8922491578 migrate from lazy in anticipation of vim.pack 2025-10-06 22:52:13 -05:00
31f7ee21e8 remove mini.sessions/jj 2025-10-05 14:01:20 -05:00
27ce531531 random cleanups 2025-10-05 13:08:16 -05:00
095e78128b nvim-ts-main 2025-10-04 17:05:13 -05:00
ac26b74e43 ensure plugins are exported in overlay 2025-08-19 23:01:58 -05:00
27 changed files with 706 additions and 1681 deletions

263
flake.lock generated
View file

@ -1,12 +1,16 @@
{ {
"nodes": { "nodes": {
"dart": { "dart": {
"flake": false, "inputs": {
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs"
},
"locked": { "locked": {
"lastModified": 1754291267, "lastModified": 1761202123,
"narHash": "sha256-ULrZW4b8SKRvPpJPt8/jkqqc/blQiIWUriNWVXA33so=",
"owner": "iofq", "owner": "iofq",
"repo": "dart.nvim", "repo": "dart.nvim",
"rev": "617587d40fd2f2727c18758c4e6decac78459529", "rev": "71421e7ef5aee8267e24dc562fdd07a83bda192e",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -31,38 +35,6 @@
"type": "github" "type": "github"
} }
}, },
"flake-compat_2": {
"flake": false,
"locked": {
"lastModified": 1747046372,
"narHash": "sha256-CIVLLkVgvHYbgI2UpXvIIBJ12HWgX+fjA8Xf8PUmqCY=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "9100a0f413b0c601e0533d1d94ffd501ce2e7885",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-compat_3": {
"flake": false,
"locked": {
"lastModified": 1747046372,
"narHash": "sha256-CIVLLkVgvHYbgI2UpXvIIBJ12HWgX+fjA8Xf8PUmqCY=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "9100a0f413b0c601e0533d1d94ffd501ce2e7885",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-parts": { "flake-parts": {
"inputs": { "inputs": {
"nixpkgs-lib": "nixpkgs-lib" "nixpkgs-lib": "nixpkgs-lib"
@ -89,11 +61,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1754487366, "lastModified": 1760948891,
"narHash": "sha256-pHYj8gUBapuUzKV/kN/tR3Zvqc7o6gdFB9XKXIp1SQ8=", "narHash": "sha256-TmWcdiUUaWk8J4lpjzu4gCGxWY6/Ok7mOK4fIFfBuU4=",
"owner": "hercules-ci", "owner": "hercules-ci",
"repo": "flake-parts", "repo": "flake-parts",
"rev": "af66ad14b28a127c5c0f3bbb298218fc63528a18", "rev": "864599284fc7c0ba6357ed89ed5e2cd5040f0c04",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -102,27 +74,6 @@
"type": "github" "type": "github"
} }
}, },
"flake-parts_3": {
"inputs": {
"nixpkgs-lib": [
"neovim-nightly-overlay",
"hercules-ci-effects",
"nixpkgs"
]
},
"locked": {
"lastModified": 1751413152,
"narHash": "sha256-Tyw1RjYEsp5scoigs1384gIg6e0GoBVjms4aXFfRssQ=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "77826244401ea9de6e3bac47c2db46005e1f30b5",
"type": "github"
},
"original": {
"id": "flake-parts",
"type": "indirect"
}
},
"flake-utils": { "flake-utils": {
"inputs": { "inputs": {
"systems": "systems" "systems": "systems"
@ -140,6 +91,24 @@
"type": "github" "type": "github"
} }
}, },
"flake-utils_2": {
"inputs": {
"systems": "systems_2"
},
"locked": {
"lastModified": 1731533236,
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"gen-luarc": { "gen-luarc": {
"inputs": { "inputs": {
"flake-parts": "flake-parts", "flake-parts": "flake-parts",
@ -150,10 +119,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1754586557, "lastModified": 1755304025,
"narHash": "sha256-xVKfjFwc0zMbLMjLTiHz+0llggkjs93SmHkhaa9S3M4=",
"owner": "mrcjkb", "owner": "mrcjkb",
"repo": "nix-gen-luarc-json", "repo": "nix-gen-luarc-json",
"rev": "4b8d4da04808062e2b1ef0e7bcd0a03bcb93e043", "rev": "1865b0ebb753ae5324d7381b1fa8c98c04ec7509",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -186,29 +156,6 @@
"type": "github" "type": "github"
} }
}, },
"git-hooks_2": {
"inputs": {
"flake-compat": "flake-compat_3",
"gitignore": "gitignore_2",
"nixpkgs": [
"neovim-nightly-overlay",
"nixpkgs"
]
},
"locked": {
"lastModified": 1754416808,
"narHash": "sha256-c6yg0EQ9xVESx6HGDOCMcyRSjaTpNJP10ef+6fRcofA=",
"owner": "cachix",
"repo": "git-hooks.nix",
"rev": "9c52372878df6911f9afc1e2a1391f55e4dfc864",
"type": "github"
},
"original": {
"owner": "cachix",
"repo": "git-hooks.nix",
"type": "github"
}
},
"gitignore": { "gitignore": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@ -231,50 +178,6 @@
"type": "github" "type": "github"
} }
}, },
"gitignore_2": {
"inputs": {
"nixpkgs": [
"neovim-nightly-overlay",
"git-hooks",
"nixpkgs"
]
},
"locked": {
"lastModified": 1709087332,
"narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=",
"owner": "hercules-ci",
"repo": "gitignore.nix",
"rev": "637db329424fd7e46cf4185293b9cc8c88c95394",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "gitignore.nix",
"type": "github"
}
},
"hercules-ci-effects": {
"inputs": {
"flake-parts": "flake-parts_3",
"nixpkgs": [
"neovim-nightly-overlay",
"nixpkgs"
]
},
"locked": {
"lastModified": 1752595130,
"narHash": "sha256-CNBgr4OZSuklGtNOa9CnTNo9+Xceqn/EDAC1Tc43fH8=",
"owner": "hercules-ci",
"repo": "hercules-ci-effects",
"rev": "5f2e09654b2e70ba643e41609d9f9b6640f22113",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "hercules-ci-effects",
"type": "github"
}
},
"luvit-meta": { "luvit-meta": {
"flake": false, "flake": false,
"locked": { "locked": {
@ -293,19 +196,18 @@
}, },
"neovim-nightly-overlay": { "neovim-nightly-overlay": {
"inputs": { "inputs": {
"flake-compat": "flake-compat_2",
"flake-parts": "flake-parts_2", "flake-parts": "flake-parts_2",
"git-hooks": "git-hooks_2",
"hercules-ci-effects": "hercules-ci-effects",
"neovim-src": "neovim-src", "neovim-src": "neovim-src",
"nixpkgs": "nixpkgs", "nixpkgs": [
"treefmt-nix": "treefmt-nix" "nixpkgs"
]
}, },
"locked": { "locked": {
"lastModified": 1754641381, "lastModified": 1761955453,
"narHash": "sha256-hQomzSbBiFsDXDMCjHmWXrAMgFlQlCiy7T37Eq7RvT4=",
"owner": "nix-community", "owner": "nix-community",
"repo": "neovim-nightly-overlay", "repo": "neovim-nightly-overlay",
"rev": "83aaf3085f808dec9ea1b5d16b216875a8081b37", "rev": "c58076a0d9b24bf77fef4fa2e7c43950914edf71",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -317,11 +219,11 @@
"neovim-src": { "neovim-src": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1754610154, "lastModified": 1761949631,
"narHash": "sha256-ORfF40X4BGiFxnLNQbdsQbUTW4TkUHfPqyZWHaYL5NE=", "narHash": "sha256-YgMQaFD4L9+PEYSkUlBkqaKt+ALPHiVgzgRbjOSW4tE=",
"owner": "neovim", "owner": "neovim",
"repo": "neovim", "repo": "neovim",
"rev": "038eb01b41b66379f75164507571497929f8847c", "rev": "1fddd74da7428e38b79ccb817dbd6952ff1d8ac6",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -332,16 +234,15 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1754393734, "lastModified": 1755660401,
"narHash": "sha256-fbnmAwTQkuXHKBlcL5Nq1sMAzd3GFqCOQgEQw6Hy0Ak=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "a683adc19ff5228af548c6539dbc3440509bfed3", "rev": "5788de501b965d7413f2beaac10aeeb56f9a19a8",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "NixOS", "owner": "NixOS",
"ref": "nixpkgs-unstable", "ref": "master",
"repo": "nixpkgs", "repo": "nixpkgs",
"type": "github" "type": "github"
} }
@ -376,10 +277,11 @@
}, },
"nixpkgs_2": { "nixpkgs_2": {
"locked": { "locked": {
"lastModified": 1754893210, "lastModified": 1761991861,
"narHash": "sha256-rccG7eGGelDsu4eXPi2vdBR1pddZFZAd/JlB3NLjgy4=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "defc725219d1fb9b56662370e014012929e557af", "rev": "0e65d6bc462e57fe6a76a49d4eea909ba08b1dc1",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -389,13 +291,30 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs_3": {
"locked": {
"lastModified": 1761114652,
"narHash": "sha256-f/QCJM/YhrV/lavyCVz8iU3rlZun6d+dAiC3H+CDle4=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "01f116e4df6a15f4ccdffb1bcd41096869fb385c",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nvim-treesitter": { "nvim-treesitter": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1754640844, "lastModified": 1761385693,
"narHash": "sha256-/SGikTPEMxI7rcfGvuJlNZs73/wZiQx14QX9xlfsTv0=",
"owner": "nvim-treesitter", "owner": "nvim-treesitter",
"repo": "nvim-treesitter", "repo": "nvim-treesitter",
"rev": "9866036ec3c5db40700a9178494e0cfdcfe6ecfd", "rev": "98fe644cb3b5ba390d1bc3f89299f93c70020803",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -405,13 +324,34 @@
"type": "github" "type": "github"
} }
}, },
"nvim-treesitter-main": {
"inputs": {
"nixpkgs": "nixpkgs_3",
"nvim-treesitter": "nvim-treesitter",
"nvim-treesitter-textobjects": "nvim-treesitter-textobjects"
},
"locked": {
"lastModified": 1761496664,
"narHash": "sha256-xTQUiJu0jJNSEHEv4La1HbaFokup0eWr67Kqf/wDENA=",
"owner": "iofq",
"repo": "nvim-treesitter-main",
"rev": "834d66648bb7a96a2ad11d53a33f2d9b13766447",
"type": "github"
},
"original": {
"owner": "iofq",
"repo": "nvim-treesitter-main",
"type": "github"
}
},
"nvim-treesitter-textobjects": { "nvim-treesitter-textobjects": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1751128959, "lastModified": 1756368113,
"narHash": "sha256-+KmOpRi4JAqm6UqYdtk80jwFrJhLCs0lZM/Liofq0R4=",
"owner": "nvim-treesitter", "owner": "nvim-treesitter",
"repo": "nvim-treesitter-textobjects", "repo": "nvim-treesitter-textobjects",
"rev": "b54cec389e98c5b0babbe618773acec927437cab", "rev": "1b2d85d3de6114c4bcea89ffb2cd1ce9e3a19931",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -424,12 +364,11 @@
"root": { "root": {
"inputs": { "inputs": {
"dart": "dart", "dart": "dart",
"flake-utils": "flake-utils", "flake-utils": "flake-utils_2",
"gen-luarc": "gen-luarc", "gen-luarc": "gen-luarc",
"neovim-nightly-overlay": "neovim-nightly-overlay", "neovim-nightly-overlay": "neovim-nightly-overlay",
"nixpkgs": "nixpkgs_2", "nixpkgs": "nixpkgs_2",
"nvim-treesitter": "nvim-treesitter", "nvim-treesitter-main": "nvim-treesitter-main"
"nvim-treesitter-textobjects": "nvim-treesitter-textobjects"
} }
}, },
"systems": { "systems": {
@ -447,24 +386,18 @@
"type": "github" "type": "github"
} }
}, },
"treefmt-nix": { "systems_2": {
"inputs": {
"nixpkgs": [
"neovim-nightly-overlay",
"nixpkgs"
]
},
"locked": { "locked": {
"lastModified": 1754492133, "lastModified": 1681028828,
"narHash": "sha256-B+3g9+76KlGe34Yk9za8AF3RL+lnbHXkLiVHLjYVOAc=", "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "numtide", "owner": "nix-systems",
"repo": "treefmt-nix", "repo": "default",
"rev": "1298185c05a56bff66383a20be0b41a307f52228", "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "numtide", "owner": "nix-systems",
"repo": "treefmt-nix", "repo": "default",
"type": "github" "type": "github"
} }
} }

View file

@ -4,33 +4,23 @@
inputs = { inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/master"; nixpkgs.url = "github:NixOS/nixpkgs/master";
flake-utils.url = "github:numtide/flake-utils"; flake-utils.url = "github:numtide/flake-utils";
neovim-nightly-overlay.url = "github:nix-community/neovim-nightly-overlay"; neovim-nightly-overlay = {
url = "github:nix-community/neovim-nightly-overlay";
inputs.nixpkgs.follows = "nixpkgs";
};
gen-luarc = { gen-luarc = {
url = "github:mrcjkb/nix-gen-luarc-json"; url = "github:mrcjkb/nix-gen-luarc-json";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
dart = { dart = {
url = "github:iofq/dart.nvim"; url = "github:iofq/dart.nvim";
flake = false;
}; };
nvim-treesitter = { nvim-treesitter-main = {
url = "github:nvim-treesitter/nvim-treesitter/main"; url = "github:iofq/nvim-treesitter-main";
flake = false;
}; };
nvim-treesitter-textobjects = {
url = "github:nvim-treesitter/nvim-treesitter-textobjects/main";
flake = false;
};
# Add bleeding-edge plugins here.
# They can be updated with `nix flake update` (make sure to commit the generated flake.lock)
# wf-nvim = {
# url = "github:Cassin01/wf.nvim";
# flake = false;
# };
}; };
outputs = outputs =
inputs@{ inputs@{
self,
nixpkgs, nixpkgs,
flake-utils, flake-utils,
... ...
@ -39,22 +29,29 @@
systems = builtins.attrNames nixpkgs.legacyPackages; systems = builtins.attrNames nixpkgs.legacyPackages;
# This is where the Neovim derivation is built. # This is where the Neovim derivation is built.
plugin-overlay = import ./nix/plugin-overlay.nix { inherit inputs; };
neovim-overlay = import ./nix/neovim-overlay.nix { inherit inputs; }; 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 in
flake-utils.lib.eachSystem systems ( flake-utils.lib.eachSystem systems (
system: system:
let let
pkgs = import nixpkgs { pkgs = import nixpkgs {
inherit system; inherit system;
config.allowUnfree = true; overlays = finalOverlays ++ [
overlays = [
inputs.neovim-nightly-overlay.overlays.default
plugin-overlay
neovim-overlay
# This adds a function can be used to generate a .luarc.json
# containing the Neovim API all plugins in the workspace directory.
# The generated file can be symlinked in the devShell's shellHook.
inputs.gen-luarc.overlays.default inputs.gen-luarc.overlays.default
]; ];
}; };
@ -62,16 +59,13 @@
name = "nvim-devShell"; name = "nvim-devShell";
buildInputs = with pkgs; [ buildInputs = with pkgs; [
lua-language-server lua-language-server
nil nixd
stylua stylua
luajitPackages.luacheck luajitPackages.luacheck
nvim-dev
]; ];
shellHook = '' shellHook = ''
# symlink the .luarc.json generated in the overlay # symlink the .luarc.json generated in the overlay
ln -fs ${pkgs.nvim-luarc-json} .luarc.json ln -fs ${pkgs.nvim-luarc-json} .luarc.json
# allow quick iteration of lua configs
ln -Tfns $PWD/nvim ~/.config/nvim-dev
''; '';
}; };
in in
@ -80,7 +74,6 @@
default = nvim; default = nvim;
nvim = pkgs.nvim-pkg; nvim = pkgs.nvim-pkg;
nvim-min = pkgs.nvim-min-pkg; nvim-min = pkgs.nvim-min-pkg;
nvim-dev = pkgs.nvim-dev;
}; };
devShells = { devShells = {
default = shell; default = shell;
@ -88,6 +81,6 @@
} }
) )
// { // {
overlays.default = neovim-overlay; overlays.default = nixpkgs.lib.composeManyExtensions finalOverlays;
}; };
} }

View file

@ -1,197 +1,23 @@
# Function for creating a Neovim derivation { pkgs, lib }:
{ {
pkgs, plugins ? [ ],
lib, packages ? [ ],
stdenv,
# Set by the overlay to ensure we use a compatible version of `wrapNeovimUnstable`
pkgs-wrapNeovim ? pkgs,
}:
with lib;
{
# NVIM_APPNAME - Defaults to 'nvim' if not set.
# If set to something else, this will also rename the binary.
appName ? "nvim",
# The Neovim package to wrap
neovim-unwrapped ? pkgs-wrapNeovim.neovim-unwrapped,
plugins ? [ ], # List of plugins
# List of dev plugins (will be bootstrapped) - useful for plugin developers
# { name = <plugin-name>; url = <git-url>; }
devPlugins ? [ ],
# Regexes for config files to ignore, relative to the nvim directory.
# e.g. [ "^plugin/neogit.lua" "^ftplugin/.*.lua" ]
ignoreConfigRegexes ? [ ],
extraPackages ? [ ], # Extra runtime dependencies (e.g. ripgrep, ...)
# The below arguments can typically be left as their defaults
# Additional lua packages (not plugins), e.g. from luarocks.org.
# e.g. p: [p.jsregexp]
extraLuaPackages ? p: [ ],
extraPython3Packages ? p: [ ], # Additional python 3 packages
withPython3 ? false, # Build Neovim with Python 3 support?
withRuby ? false, # Build Neovim with Ruby support?
withNodeJs ? false, # Build Neovim with NodeJS support?
withSqlite ? true, # Add sqlite? This is a dependency for some plugins
# You probably don't want to create vi or vim aliases
# if the appName is something different than "nvim"
viAlias ? appName == "nvim", # Add a "vi" binary to the build output as an alias?
vimAlias ? appName == "nvim", # Add a "vim" binary to the build output as an alias?
wrapRc ? true,
}: }:
let let
# This is the structure of a plugin definition. finalPlugins = plugins ++ [
# Each plugin in the `plugins` argument list can also be defined as this attrset (pkgs.vimUtils.buildVimPlugin {
defaultPlugin = { pname = "iofq-nvim";
plugin = null; # e.g. nvim-lspconfig src = lib.cleanSource ../nvim;
config = null; # plugin config version = "0.1";
# If `optional` is set to `false`, the plugin is installed in the 'start' packpath doCheck = false;
# set to `true`, it is installed in the 'opt' packpath, and can be lazy loaded with })
# ':packadd! {plugin-name} ];
optional = false; wrapperArgs = ''--prefix PATH : "${lib.makeBinPath packages}"'';
runtime = { };
};
externalPackages = extraPackages ++ (optionals withSqlite [ pkgs.sqlite ]);
# Map all plugins to an attrset { plugin = <plugin>; config = <config>; optional = <tf>; ... }
normalizedPlugins = map (x: defaultPlugin // (if x ? plugin then x else { plugin = x; })) plugins;
# This nixpkgs util function creates an attrset
# that pkgs.wrapNeovimUnstable uses to configure the Neovim build.
neovimConfig = pkgs-wrapNeovim.neovimUtils.makeNeovimConfig {
inherit
extraPython3Packages
withPython3
withRuby
withNodeJs
viAlias
vimAlias
;
plugins = normalizedPlugins;
};
packDir = pkgs.neovimUtils.packDir {
myNeovimPackages = pkgs.neovimUtils.normalizedPluginsToVimPackage normalizedPlugins;
};
# This uses the ignoreConfigRegexes list to filter
# the nvim directory
nvimRtpSrc =
let
src = ../nvim;
in
lib.cleanSourceWith {
inherit src;
name = "nvim-rtp-src";
filter =
path: tyoe:
let
srcPrefix = toString src + "/";
relPath = lib.removePrefix srcPrefix (toString path);
in
lib.all (regex: builtins.match regex relPath == null) ignoreConfigRegexes;
};
# Split runtimepath into 3 directories:
# - lua, to be prepended to the rtp at the beginning of init.lua
# - nvim, containing plugin, ftplugin, ... subdirectories
# - after, to be sourced last in the startup initialization
# See also: https://neovim.io/doc/user/starting.html
nvimRtp = stdenv.mkDerivation {
name = "nvim-rtp";
src = nvimRtpSrc;
buildPhase = ''
mkdir -p $out/
'';
installPhase = ''
cp -r . $out/
'';
};
# The final init.lua content that we pass to the Neovim wrapper.
# It wraps the user init.lua, prepends the lua lib directory to the RTP
# and prepends the nvim and after directory to the RTP
initLua = ''
LAZY_OPTS = {
performance = {
reset_packpath = false,
rtp = {
reset = false,
disabled_plugins = {
"netrwPlugin",
"tutor",
},
},
},
dev = {
path = "${packDir}/pack/myNeovimPackages/start",
patterns = {""},
},
checker = {
enabled = false,
},
install = { missing = false, },
spec = {{ import = "plugins" }},
}
vim.opt.rtp:prepend('${nvimRtp}')
''
+ (builtins.readFile ../nvim/init.lua);
# Add arguments to the Neovim wrapper script
extraMakeWrapperArgs = builtins.concatStringsSep " " (
# Set the NVIM_APPNAME environment variable
(optional (
appName != "nvim" && appName != null && appName != ""
) ''--set NVIM_APPNAME "${appName}"'')
# Add external packages to the PATH
++ (optional (externalPackages != [ ]) ''--prefix PATH : "${makeBinPath externalPackages}"'')
# Set the LIBSQLITE_CLIB_PATH if sqlite is enabled
++ (optional withSqlite ''--set LIBSQLITE_CLIB_PATH "${pkgs.sqlite.out}/lib/libsqlite3.so"'')
# Set the LIBSQLITE environment variable if sqlite is enabled
++ (optional withSqlite ''--set LIBSQLITE "${pkgs.sqlite.out}/lib/libsqlite3.so"'')
);
luaPackages = neovim-unwrapped.lua.pkgs;
resolvedExtraLuaPackages = extraLuaPackages luaPackages;
# Native Lua libraries
extraMakeWrapperLuaCArgs =
optionalString (resolvedExtraLuaPackages != [ ])
''--suffix LUA_CPATH ";" "${
concatMapStringsSep ";" luaPackages.getLuaCPath resolvedExtraLuaPackages
}"'';
# Lua libraries
extraMakeWrapperLuaArgs =
optionalString (resolvedExtraLuaPackages != [ ])
''--suffix LUA_PATH ";" "${
concatMapStringsSep ";" luaPackages.getLuaPath resolvedExtraLuaPackages
}"'';
# wrapNeovimUnstable is the nixpkgs utility function for building a Neovim derivation.
neovim-wrapped = pkgs-wrapNeovim.wrapNeovimUnstable neovim-unwrapped (
neovimConfig
// {
luaRcContent = initLua;
wrapperArgs =
escapeShellArgs neovimConfig.wrapperArgs
+ " "
+ extraMakeWrapperArgs
+ " "
+ extraMakeWrapperLuaCArgs
+ " "
+ extraMakeWrapperLuaArgs;
wrapRc = wrapRc;
}
);
isCustomAppName = appName != null && appName != "nvim";
in in
neovim-wrapped.overrideAttrs (oa: { pkgs.wrapNeovimUnstable pkgs.neovim-unwrapped {
buildPhase = inherit wrapperArgs;
oa.buildPhase plugins = finalPlugins;
# If a custom NVIM_APPNAME has been set, rename the `nvim` binary withPython3 = false;
+ lib.optionalString isCustomAppName '' withRuby = false;
mv $out/bin/nvim $out/bin/${lib.escapeShellArg appName} vimAlias = true;
''; }
})

View file

@ -1,25 +1,20 @@
# This overlay, when applied to nixpkgs, adds the final neovim derivation to nixpkgs. # This overlay, when applied to nixpkgs, adds the final neovim derivation to nixpkgs.
{ inputs }: { inputs }:
final: prev: final: prev:
with final.pkgs.lib;
let let
mkNeovim = prev.callPackage ./mkNeovim.nix { pkgs-wrapNeovim = prev; }; mkNeovim = prev.callPackage ./mkNeovim.nix { pkgs = final; };
dart-nvim = inputs.dart.packages.x86_64-linux.default;
plugins = with final.vimPlugins; [ plugins = with prev.vimPlugins; [
blink-cmp blink-cmp
blink-ripgrep-nvim blink-ripgrep-nvim
conform-nvim conform-nvim
dart-nvim dart-nvim
diffview-nvim
eyeliner-nvim
friendly-snippets
lazy-nvim
mini-nvim mini-nvim
nvim-autopairs nvim-autopairs
nvim-lint nvim-lint
nvim-lspconfig nvim-lspconfig
nvim-treesitter.withAllGrammars nvim-treesitter
nvim-treesitter-context
nvim-treesitter-textobjects nvim-treesitter-textobjects
quicker-nvim quicker-nvim
refactoring-nvim refactoring-nvim
@ -27,12 +22,12 @@ let
snacks-nvim snacks-nvim
]; ];
basePackages = with final; [ basePackages = with prev; [
ripgrep ripgrep
fd fd
]; ];
# Extra packages that should be included on nixos but don't need to be bundled # Extra packages that should be included on nixos but don't need to be bundled
extraPackages = with final; [ extraPackages = with prev; [
# linters # linters
yamllint yamllint
jq jq
@ -44,35 +39,21 @@ let
# LSPs # LSPs
gopls gopls
lua-language-server lua-language-server
nil nixd
basedpyright basedpyright
#other
jujutsu
]; ];
in in
{ {
nvim-pkg = mkNeovim { nvim-pkg = mkNeovim {
inherit plugins; inherit plugins;
extraPackages = basePackages ++ extraPackages; packages = basePackages ++ extraPackages;
}; };
nvim-min-pkg = mkNeovim { nvim-min-pkg = mkNeovim {
inherit plugins; inherit plugins;
extraPackages = basePackages; packages = basePackages;
}; };
# This is meant to be used within a devshell.
# Instead of loading the lua Neovim configuration from
# the Nix store, it is loaded from $XDG_CONFIG_HOME/nvim-dev
nvim-dev = mkNeovim {
inherit plugins;
extraPackages = basePackages ++ extraPackages;
appName = "nvim-dev";
wrapRc = false;
};
# This can be symlinked in the devShell's shellHook
nvim-luarc-json = final.mk-luarc-json { nvim-luarc-json = final.mk-luarc-json {
inherit plugins; inherit plugins;
}; };

View file

@ -1,29 +0,0 @@
{ inputs, ... }:
final: prev:
let
mkNvimPlugin =
src: pname:
prev.vimUtils.buildVimPlugin {
inherit pname src;
version = src.lastModifiedDate;
};
in
{
vimPlugins = prev.vimPlugins.extend (
final': prev': {
dart-nvim = mkNvimPlugin inputs.dart "dart.nvim";
nvim-treesitter-textobjects = mkNvimPlugin inputs.nvim-treesitter-textobjects "nvim-treesitter-textobjects";
nvim-treesitter = prev'.nvim-treesitter.overrideAttrs (old: rec {
src = inputs.nvim-treesitter;
name = "${old.pname}-${src.rev}";
postPatch = "";
# ensure runtime queries get linked to RTP (:TSInstall does this too)
buildPhase = "
mkdir -p $out/queries
cp -a $src/runtime/queries/* $out/queries
";
nvimSkipModules = [ "nvim-treesitter._meta.parsers" ];
});
}
);
}

View file

@ -626,7 +626,7 @@ hi(0, 'SpellLocal', { sp = '#5a93aa', undercurl = true })
hi(0, 'SpellRare', { sp = '#5a93aa', undercurl = true }) hi(0, 'SpellRare', { sp = '#5a93aa', undercurl = true })
hi(0, 'Statement', { fg = '#ad5c7c' }) hi(0, 'Statement', { fg = '#ad5c7c' })
hi(0, 'StatusLine', { bg = 'none' }) hi(0, 'StatusLine', { bg = 'none' })
hi(0, 'StatusLineNC', { bg = 'none' }) hi(0, 'StatusLineNC', { bg = 'none', fg = "grey" })
hi(0, 'String', { fg = '#7aa4a1' }) hi(0, 'String', { fg = '#7aa4a1' })
hi(0, 'Substitute', { bg = '#e85c51', fg = '#152528' }) hi(0, 'Substitute', { bg = '#e85c51', fg = '#152528' })
hi(0, 'SymbolOutlineConnector', { link = 'Conceal' }) hi(0, 'SymbolOutlineConnector', { link = 'Conceal' })

View file

@ -19,9 +19,6 @@ return {
end, end,
settings = { settings = {
Lua = { Lua = {
codeLens = {
enable = true,
},
hint = { hint = {
enable = true, enable = true,
arrayIndex = 'Enable', arrayIndex = 'Enable',

View file

@ -0,0 +1,103 @@
local diff = require('mini.diff')
local M = {
cache = {},
}
M.get_buf_realpath = function(buf_id)
local path = vim.loop.fs_realpath(vim.api.nvim_buf_get_name(buf_id)) or ''
local cwd, basename = vim.fn.fnamemodify(path, ':h'), vim.fn.fnamemodify(path, ':t')
return path, cwd, basename
end
M.jj_start_watching_tree_state = function(buf_id, path)
local on_not_in_jj = vim.schedule_wrap(function()
if not vim.api.nvim_buf_is_valid(buf_id) then
M.cache[buf_id] = nil
return false
end
diff.fail_attach(buf_id)
M.cache[buf_id] = {}
end)
vim.system(
{ 'jj', 'workspace', 'root', '--ignore-working-copy' },
{cwd = vim.fn.fnamemodify(path, ':h')},
function(obj)
if obj.code ~= 0 then
return on_not_in_jj()
end
-- Set up index watching
local root = obj.stdout:gsub('\n+$', '') .. '/.jj/working_copy/tree_state'
local buf_fs_event = vim.loop.new_fs_event()
buf_fs_event:start(root, { stat = true }, function()
M.jj_set_ref_text(buf_id)
end)
M.cache[buf_id] = { fs_event = buf_fs_event }
-- Set reference text immediately
M.jj_set_ref_text(buf_id)
end
)
end
M.jj_set_ref_text = vim.schedule_wrap(function(buf_id)
if not vim.api.nvim_buf_is_valid(buf_id) then
return
end
local buf_set_ref_text = function(text)
pcall(diff.set_ref_text, buf_id, text)
end
-- react to possible rename
local path, cwd, basename = M.get_buf_realpath(buf_id)
if path == '' then
return buf_set_ref_text {}
end
vim.system(
{ 'jj', 'file', 'show', '--no-pager', '--ignore-working-copy', '-r', '@-', './' .. basename },
{ cwd = cwd },
vim.schedule_wrap(function(obj)
if obj.code ~= 0 then return buf_set_ref_text {} end
buf_set_ref_text(obj.stdout:gsub('\r\n', '\n'))
end)
)
end)
M.jj_invalidate_cache = function(buf_id)
pcall(vim.loop.fs_event_stop, M.cache[buf_id].fs_event)
M.cache[buf_id] = nil
end
M.gen_source = function()
local attach = function(buf_id)
-- Try attaching to a buffer only once
if M.cache[buf_id] ~= nil then
return false
end
-- - Possibly resolve symlinks to get data from the original repo
local path = M.get_buf_realpath(buf_id)
if path == '' then
return false
end
M.cache[buf_id] = {}
M.jj_start_watching_tree_state(buf_id, path)
end
local detach = function(buf_id)
M.jj_invalidate_cache(buf_id)
end
return {
name = 'jj',
attach = attach,
detach = detach,
apply_hunks = function(_, _) end -- staging does not apply for jj
}
end
return M

View file

@ -0,0 +1,52 @@
local M = {}
function M.status()
local function get_files()
local status_raw = vim.fn.system('jj diff --no-pager --quiet --summary')
local files = {}
for status in status_raw:gmatch('[^\r\n]+') do
local state, file = string.match(status, '^(%a)%s(.+)$')
if state and file then
local hl = ''
if state == 'A' then
hl = 'SnacksPickerGitStatusAdded'
elseif state == 'M' then
hl = 'SnacksPickerGitStatusModified'
elseif state == 'D' then
hl = 'SnacksPickerGitStatusDeleted'
elseif state == 'R' then
hl = 'SnacksPickerGitStatusRenamed'
file = string.match(file, '{.-=>%s*(.-)}')
end
local diff = vim.fn.system('jj diff ' .. file .. ' --no-pager --stat --git')
table.insert(files, {
file = file,
filename_hl = hl,
diff = diff,
})
end
end
return files
end
Snacks.picker.pick {
source = 'jj_status',
items = get_files(),
format = 'file',
title = 'jj status',
preview = function(ctx)
if ctx.item.file then
Snacks.picker.preview.diff(ctx)
else
ctx.preview:reset()
ctx.preview:set_title('No preview')
end
end,
}
end
return M

View file

@ -0,0 +1,139 @@
local cmd = vim.api.nvim_create_autocmd
-- open :h in buffers
cmd('FileType', {
group = vim.api.nvim_create_augroup('help', { clear = true }),
pattern = 'help',
callback = function(_)
vim.cmd.only()
vim.keymap.set('n', 'q', vim.cmd.bdelete, { noremap = true })
vim.bo.buflisted = false
end,
})
-- resize splits if window got resized
cmd({ 'VimResized' }, {
group = vim.api.nvim_create_augroup('resize_splits', { clear = true }),
callback = function()
vim.cmd('tabdo wincmd =')
vim.cmd('tabnext ' .. vim.fn.tabpagenr())
end,
})
-- Check if we need to reload the file when it changed
cmd({ 'FocusGained', 'TermClose', 'TermLeave' }, {
group = vim.api.nvim_create_augroup('check_reload', { clear = true }),
callback = function()
if vim.o.buftype ~= 'nofile' then
vim.cmd('checktime')
end
end,
})
-- Configure difftool buffers
vim.api.nvim_create_autocmd('FileType', {
pattern = 'qf',
group = vim.api.nvim_create_augroup('difftool', { clear = true }),
callback = function(event)
local function exec(fmt, str)
return os.execute(string.format(fmt, str))
end
local function refresh()
local qf = vim.fn.getqflist()
local entry = qf[1]
if not entry or not entry.user_data.diff then
return nil
end
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 hl = 'Added'
if
exec('git diff --quiet -- %s', path) ~= 0
or exec('git ls-files --error-unmatch -- %s > /dev/null 2>&1', path) ~= 0
then
hl = 'Removed'
end
vim.hl.range(event.buf, ns, hl, { i - 1, 0 }, { i - 1, -1 })
end
end
vim.keymap.set('n', 'gh', function()
local idx = vim.api.nvim_win_get_cursor(0)[1]
local qf = vim.fn.getqflist()
local filename = qf[idx].user_data.rel
if exec('git diff --quiet --cached -- %s', filename) ~= 0 then
exec('git restore --quiet --staged -- %s', filename)
else
exec('git add -- %s', filename)
end
refresh()
end)
vim.schedule(refresh)
end,
})
-- Init treesitter
cmd('FileType', {
group = vim.api.nvim_create_augroup('treesitter', { clear = true }),
callback = function(event)
local bufnr = event.buf
vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()"
pcall(vim.treesitter.start, bufnr)
vim.keymap.set({ 'v', 'n' }, ']]', function()
require('nvim-treesitter-textobjects.move').goto_next_start('@function.outer', 'textobjects')
end, { buffer = bufnr })
vim.keymap.set({ 'v', 'n' }, '[[', function()
require('nvim-treesitter-textobjects.move').goto_previous_start('@function.outer', 'textobjects')
end, { buffer = bufnr })
vim.keymap.set({ 'v', 'n' }, ']a', function()
require('nvim-treesitter-textobjects.move').goto_next_start('@parameter.inner', 'textobjects')
end, { buffer = bufnr })
vim.keymap.set({ 'v', 'n' }, '[a', function()
require('nvim-treesitter-textobjects.move').goto_previous_start('@parameter.inner', 'textobjects')
end, { buffer = bufnr })
vim.keymap.set({ 'v', 'n' }, ']A', function()
require('nvim-treesitter-textobjects.swap').swap_next('@parameter.inner')
end, { buffer = bufnr })
vim.keymap.set({ 'v', 'n' }, '[A', function()
require('nvim-treesitter-textobjects.swap').swap_previous('@parameter.inner')
end, { buffer = bufnr })
end,
})
-- Init LSP
cmd('LspAttach', {
group = vim.api.nvim_create_augroup('UserLspConfig', {}),
callback = function(ev)
local client = vim.lsp.get_client_by_id(ev.data.client_id)
if not client then
return
end
vim.keymap.set('n', 'gO', function()
Snacks.picker.lsp_symbols { focus = 'list' }
end, { buffer = ev.buf })
vim.keymap.set('n', 'grh', function()
vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled())
end, { buffer = ev.buf })
vim.keymap.set('n', 'grl', vim.lsp.codelens.run, { buffer = ev.buf })
vim.keymap.set('n', 'gre', vim.diagnostic.setloclist, { buffer = ev.buf })
vim.keymap.set('n', 'grE', vim.diagnostic.setqflist, { buffer = ev.buf })
-- Auto-refresh code lenses
if client:supports_method('textDocument/codeLens') or client.server_capabilities.codeLensProvider then
vim.lsp.codelens.refresh { bufnr = ev.buf }
cmd({ 'InsertLeave', 'TextChanged' }, {
callback = function()
vim.lsp.codelens.refresh { bufnr = ev.buf }
end,
buffer = ev.buf,
})
end
end,
})

View file

@ -1,6 +1,10 @@
vim.cmd('colorscheme iofq')
vim.g.mapleader = ' '
vim.opt.autowrite = true vim.opt.autowrite = true
vim.opt.backspace = 'indent,eol,start' vim.opt.backspace = 'indent,eol,start'
vim.opt.confirm = true vim.opt.confirm = true
vim.opt.completeopt = 'menuone,popup,noselect,fuzzy'
vim.opt.diffopt = 'internal,filler,closeoff,inline:char' vim.opt.diffopt = 'internal,filler,closeoff,inline:char'
vim.opt.expandtab = true -- insert tabs as spaces vim.opt.expandtab = true -- insert tabs as spaces
vim.opt.inccommand = 'split' -- incremental live completion vim.opt.inccommand = 'split' -- incremental live completion
@ -31,7 +35,30 @@ vim.diagnostic.config {
source = 'if_many', source = 'if_many',
}, },
} }
vim.schedule(function()
require('config.autocmd') vim.lsp.enable {
require('config.keymaps') 'nixd',
'phpactor',
'gopls',
'lua_ls',
'basedpyright',
}
local map = vim.keymap.set
map('n', '\\t', function() -- Switch tab length on the fly
vim.o.tabstop = vim.o.tabstop == 8 and 2 or 2 * vim.o.tabstop
vim.notify('tabstop: ' .. vim.o.tabstop)
end) end)
map({ 'v', 'i' }, 'wq', '<esc>l')
map('v', '<', '<gv')
map('v', '>', '>gv')
map('n', 'n', 'nzz', { noremap = true })
map('n', 'N', 'Nzz', { noremap = true })
map('n', '<C-u>', '<C-u>zz', { noremap = true })
map('n', '<C-d>', '<C-d>zz', { noremap = true })
map('n', 'gq', vim.cmd.bdelete, { noremap = true })
map('n', 'gQ', function()
vim.cmd('bufdo bdelete')
end, { noremap = true })
vim.cmd.packadd('nvim.difftool')

View file

@ -0,0 +1,78 @@
local map = vim.keymap.set
vim.schedule(function()
require('mini.align').setup()
require('mini.surround').setup()
require('mini.splitjoin').setup { detect = { separator = '[,;\n]' } }
local ai = require('mini.ai')
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' },
},
}
require('mini.git').setup()
map('n', '<leader>gb', '<Cmd>Git blame -- %<CR>')
map('n', '<leader>go', function()
return MiniGit.show_at_cursor()
end)
local jump = require('mini.jump2d')
jump.setup {
mappings = {
start_jumping = '<leader>s',
},
view = { n_steps_ahead = 1, dim = true },
spotter = jump.gen_spotter.vimpattern(),
}
local diff = require('mini.diff')
diff.setup {
source = {
require('iofq.minidiff_jj').gen_source(),
diff.gen_source.git(),
},
}
map('n', '<leader>gp', MiniDiff.toggle_overlay)
require('mini.files').setup {
mappings = { go_in_plus = '<CR>' },
windows = {
preview = true,
width_preview = 50,
},
}
map('n', '<leader>nc', function()
MiniFiles.open(vim.api.nvim_buf_get_name(0), false) -- open current buffer's dir
end)
vim.api.nvim_create_autocmd('User', {
pattern = 'MiniFilesBufferCreate',
callback = function(args)
map('n', '<leader>nc', function()
MiniFiles.synchronize()
MiniFiles.close()
end, { buffer = args.data.buf_id })
map('n', '`', function()
local _, cur_entry_path = pcall(MiniFiles.get_fs_entry().path)
local cur_directory = vim.fs.dirname(cur_entry_path)
if cur_directory ~= '' then
vim.fn.chdir(cur_directory)
end
end, { buffer = args.data.buf_id })
end,
})
-- pass file rename events to LSP
vim.api.nvim_create_autocmd('User', {
group = vim.api.nvim_create_augroup('snacks_rename', { clear = true }),
pattern = 'MiniFilesActionRename',
callback = function(event)
Snacks.rename.on_rename_file(event.data.from, event.data.to)
end,
})
end)

View file

@ -0,0 +1,153 @@
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('snacks').setup {
bigfile = { enabled = true },
terminal = { enabled = true },
indent = { enabled = true },
input = { enabled = true },
notifier = { enabled = true },
styles = { notification = { wo = { wrap = true } } },
picker = {
enabled = true,
matcher = {
frecency = true,
cwd_bonus = true,
},
layout = 'ivy_split',
sources = {
grep = { hidden = true },
lsp_symbols = {
filter = { default = true },
layout = {
preset = 'left',
layout = { width = 90, min_width = 90 },
},
},
smart = {
multi = {
'buffers',
{ source = 'files', hidden = true },
{ source = 'git_files', untracked = true },
},
},
},
},
}
map({ 'n', 't' }, '<C-\\>', Snacks.terminal.toggle)
map('n', '<leader>ff', Snacks.picker.smart)
map('n', '<leader><leader>', Snacks.picker.smart)
map('n', '<leader>fa', Snacks.picker.grep)
map('n', '<leader>f8', Snacks.picker.grep_word)
map('n', '<leader>f?', Snacks.picker.pickers)
map('n', '<leader>fu', Snacks.picker.undo)
map('n', '<leader>fj', Snacks.picker.jumps)
map('n', '<leader>f.', Snacks.picker.resume)
map('n', '<leader>fb', Snacks.picker.buffers)
map('n', '<leader>fq', Snacks.picker.qflist)
map('n', '<leader>jf', require('iofq.snacks_jj').status)
vim.schedule(function()
require('nvim-treesitter').setup()
require('nvim-treesitter-textobjects').setup()
require('render-markdown').setup()
require('nvim-autopairs').setup()
require('refactoring').setup()
map('n', '<leader>rr', require('refactoring').select_refactor)
map('n', '<leader>rv', function()
require('refactoring').refactor('Inline Variable')
end)
require('quicker').setup()
map('n', '<leader>qf', function()
require('quicker').toggle { max_height = 20 }
end)
require('conform').setup {
notify_no_formatters = false,
formatters_by_ft = {
json = { 'jq' },
lua = { 'stylua' },
python = { 'ruff' },
nix = { 'nixfmt' },
fish = { 'fish_indent' },
['*'] = { 'trim_whitespace' },
},
format_on_save = function(bufnr)
-- Disable with a global or buffer-local variable
if vim.g.disable_autoformat or vim.b[bufnr].disable_autoformat then
return
end
return { timeout_ms = 1500, lsp_format = 'fallback' }
end,
}
map('n', '\\f', function()
vim.b.disable_autoformat = not vim.b.disable_autoformat
vim.notify(string.format('Buffer formatting disabled: %s', vim.b.disable_autoformat))
end)
map('n', '\\F', function()
vim.g.disable_autoformat = not vim.g.disable_autoformat
vim.notify(string.format('Global formatting disabled: %s', vim.g.disable_autoformat))
end)
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()
require('lint').try_lint(nil, { ignore_errors = true })
end,
})
vim.treesitter.language.register('markdown', 'blink-cmp-documentation')
require('blink.cmp').setup {
enabled = function()
return not vim.tbl_contains({ 'snacks_picker_input' }, vim.bo.filetype)
end,
sources = {
default = { 'lsp', 'path', 'snippets', 'ripgrep', 'buffer' },
providers = {
lsp = { fallbacks = {} }, -- 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',
name = 'rg',
score_offset = -10,
async = true,
},
},
},
cmdline = { completion = { menu = { auto_show = true } } },
completion = {
documentation = { auto_show = true },
menu = {
draw = {
columns = {
{ 'label', 'label_description', gap = 1 },
{ 'source_name', 'kind', gap = 1 },
},
},
},
},
signature = { enabled = true, trigger = { show_on_insert = true } },
}
end)

View file

@ -1,34 +0,0 @@
vim.g.mapleader = ' '
-- If lazy_opts is set, we're running in wrapped neovim via nix
if not LAZY_OPTS then
-- Bootstrapping lazy.nvim
local lazypath = vim.fn.stdpath('data') .. '/lazy/lazy.nvim'
if not vim.loop.fs_stat(lazypath) then
vim.fn.system {
'git',
'clone',
'--filter=blob:none',
'https://github.com/folke/lazy.nvim.git',
'--branch=stable', -- latest stable release
lazypath,
}
end
vim.opt.rtp:prepend(lazypath)
LAZY_OPTS = {
spec = { { import = 'plugins' } },
performance = {
reset_packpath = false,
rtp = {
reset = false,
disabled_plugins = {
'netrwPlugin',
'tutor',
},
},
},
}
end
vim.cmd('packadd cfilter')
vim.cmd('colorscheme iofq')
require('lazy').setup(LAZY_OPTS)
require('config')

View file

@ -1,105 +0,0 @@
-- open :h in buffers
vim.api.nvim_create_autocmd('BufWinEnter', {
pattern = '*',
callback = function(event)
if vim.bo[event.buf].filetype == 'help' then
vim.cmd.only()
vim.keymap.set('n', 'q', vim.cmd.bdelete, { noremap = true, silent = true })
vim.bo.buflisted = false
end
end,
})
-- Allow basic deletion in qflist
vim.api.nvim_create_autocmd({ 'FileType' }, {
pattern = 'qf',
callback = function()
vim.keymap.set({ 'n', 'i' }, 'dd', function()
local ln = vim.fn.line('.')
local qf = vim.fn.getqflist()
if #qf == 0 then
return
end
table.remove(qf, ln)
vim.fn.setqflist(qf, 'r')
vim.cmd('copen')
-- move cursor to stay at same index (or up one if at EOF)
vim.api.nvim_win_set_cursor(vim.fn.win_getid(), { ln < #qf and ln or math.max(ln - 1, 1), 0 })
require('quicker').refresh()
end, { buffer = true })
end,
})
-- resize splits if window got resized
vim.api.nvim_create_autocmd({ 'VimResized' }, {
group = vim.api.nvim_create_augroup('resize_splits', { clear = true }),
callback = function()
local current_tab = vim.fn.tabpagenr()
vim.cmd('tabdo wincmd =')
vim.cmd('tabnext ' .. current_tab)
end,
})
-- Check if we need to reload the file when it changed
vim.api.nvim_create_autocmd({ 'FocusGained', 'TermClose', 'TermLeave' }, {
group = vim.api.nvim_create_augroup('check_reload', { clear = true }),
callback = function()
if vim.o.buftype ~= 'nofile' then
vim.cmd('checktime')
end
end,
})
-- Init treesitter
vim.api.nvim_create_autocmd('FileType', {
callback = function(event)
local bufnr = event.buf
local filetype = vim.api.nvim_get_option_value('filetype', { buf = bufnr })
if filetype == '' then
return
end
local parser_name = vim.treesitter.language.get_lang(filetype)
if not parser_name then
return
end
local parser_installed = pcall(vim.treesitter.get_parser, bufnr, parser_name)
if not parser_installed then
return
end
local function map(lhs, rhs, opts)
if lhs == '' then
return
end
opts = vim.tbl_deep_extend('force', { silent = true }, opts or {})
vim.keymap.set({ 'v', 'n' }, lhs, rhs, opts)
end
vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()"
vim.treesitter.start()
map('[c', function()
require('treesitter-context').go_to_context(vim.v.count1)
end, { buffer = bufnr, desc = 'jump to TS context' })
map(']f', function()
require('nvim-treesitter-textobjects.move').goto_next_start('@function.outer', 'textobjects')
end, { buffer = bufnr, desc = 'next function def' })
map('[f', function()
require('nvim-treesitter-textobjects.move').goto_previous_start('@function.outer', 'textobjects')
end, { buffer = bufnr, desc = 'prev function def' })
map(']a', function()
require('nvim-treesitter-textobjects.move').goto_next_start('@parameter.inner', 'textobjects')
end, { buffer = bufnr, desc = 'next param def' })
map('[a', function()
require('nvim-treesitter-textobjects.move').goto_previous_start('@parameter.inner', 'textobjects')
end, { buffer = bufnr, desc = 'prev param def' })
map('a]', function()
require('nvim-treesitter-textobjects.swap').swap_next('@parameter.inner')
end, { buffer = bufnr, desc = 'swap next arg' })
map('a[', function()
require('nvim-treesitter-textobjects.swap').swap_previous('@parameter.inner')
end, { buffer = bufnr, desc = 'swap prev arg' })
end,
})

View file

@ -1,18 +0,0 @@
-- Switch tab length on the fly
vim.keymap.set('n', '\\t', function()
vim.o.tabstop = vim.o.tabstop == 8 and 2 or 2 * vim.o.tabstop
vim.notify('tabstop: ' .. vim.o.tabstop)
end, { silent = true, desc = 'toggle tabstop' })
vim.keymap.set({ 'v', 'i' }, 'wq', '<esc>l', { noremap = true, silent = true })
vim.keymap.set('v', '<', '<gv')
vim.keymap.set('v', '>', '>gv')
vim.keymap.set('n', 'n', 'nzz', { noremap = true })
vim.keymap.set('n', 'N', 'Nzz', { noremap = true })
vim.keymap.set('n', '<C-u>', '<C-u>zz', { noremap = true })
vim.keymap.set('n', '<C-d>', '<C-d>zz', { noremap = true })
vim.keymap.set('v', '<A-j>', ":m '>+1<CR>gv=gv", { desc = 'move selection down' })
vim.keymap.set('v', '<A-k>', ":m '<-2<CR>gv=gv", { desc = 'move selection up' })
vim.keymap.set('n', 'gq', vim.cmd.bdelete, { noremap = true, silent = true, desc = 'close buffer' })
vim.keymap.set('n', 'gQ', function()
vim.cmd('bufdo bdelete')
end, { noremap = true, silent = true, desc = 'close all buffers' })

View file

@ -1,87 +0,0 @@
return {
{
'saghen/blink.cmp',
event = 'VeryLazy',
dependencies = {
'mikavilpas/blink-ripgrep.nvim',
},
opts = {
enabled = function()
return not vim.tbl_contains({ 'snacks_picker_input' }, vim.bo.filetype)
end,
fuzzy = {
sorts = {
'exact',
'score',
'sort_text',
},
},
sources = {
default = {
'lsp',
'path',
'snippets',
'ripgrep',
'buffer',
},
providers = {
lsp = {
fallbacks = {}, -- include buffer even when LSP is active
score_offset = 10,
},
snippets = {
score_offset = -10,
},
path = {
opts = {
get_cwd = function(_)
return vim.fn.getcwd() -- use nvim pwd instead of current file pwd
end,
},
},
ripgrep = {
module = 'blink-ripgrep',
name = 'rg',
score_offset = -10,
async = true,
},
},
},
cmdline = {
completion = {
menu = {
auto_show = true,
},
},
},
completion = {
documentation = {
auto_show = true,
auto_show_delay_ms = 500,
},
menu = {
draw = {
treesitter = { 'lsp' },
columns = {
{ 'label', 'label_description', gap = 1 },
{ 'source_name', 'kind', gap = 1 },
},
},
},
trigger = {
show_on_keyword = true,
},
},
signature = {
enabled = true,
trigger = {
show_on_insert = true,
},
},
},
config = function(_, opts)
require('blink.cmp').setup(opts)
vim.treesitter.language.register('markdown', 'blink-cmp-documentation')
end,
},
}

View file

@ -1,162 +0,0 @@
local diff = require('mini.diff')
local M = {
cache = {},
}
M.get_buf_realpath = function(buf_id)
return vim.loop.fs_realpath(vim.api.nvim_buf_get_name(buf_id)) or ''
end
M.jj_start_watching_tree_state = function(buf_id, path)
local stdout = vim.loop.new_pipe()
local args = { 'workspace', 'root', '--ignore-working-copy' }
local spawn_opts = {
args = args,
cwd = vim.fn.fnamemodify(path, ':h'),
stdio = { nil, stdout, nil },
}
local on_not_in_jj = vim.schedule_wrap(function()
if not vim.api.nvim_buf_is_valid(buf_id) then
M.cache[buf_id] = nil
return false
end
diff.fail_attach(buf_id)
M.cache[buf_id] = {}
end)
local process, stdout_feed = nil, {}
local on_exit = function(exit_code)
process:close()
-- Watch index only if there was no error retrieving path to it
if exit_code ~= 0 or stdout_feed[1] == nil then
return on_not_in_jj()
end
-- Set up index watching
local jj_dir_path = table.concat(stdout_feed, ''):gsub('\n+$', '') .. '/.jj/working_copy'
M.jj_setup_tree_state_watch(buf_id, jj_dir_path)
-- Set reference text immediately
M.jj_set_ref_text(buf_id)
end
process = vim.loop.spawn('jj', spawn_opts, on_exit)
M.jj_read_stream(stdout, stdout_feed)
end
M.jj_setup_tree_state_watch = function(buf_id, jj_dir_path)
local buf_fs_event, timer = vim.loop.new_fs_event(), vim.loop.new_timer()
local buf_jj_set_ref_text = function()
M.jj_set_ref_text(buf_id)
end
local watch_tree_state = function(_, filename, _)
if filename ~= 'tree_state' then
return
end
-- Debounce to not overload during incremental staging (like in script)
timer:stop()
timer:start(50, 0, buf_jj_set_ref_text)
end
buf_fs_event:start(jj_dir_path, { stat = true }, watch_tree_state)
M.jj_invalidate_cache(M.cache[buf_id])
M.cache[buf_id] = { fs_event = buf_fs_event, timer = timer }
end
M.jj_set_ref_text = vim.schedule_wrap(function(buf_id)
if not vim.api.nvim_buf_is_valid(buf_id) then
return
end
local buf_set_ref_text = vim.schedule_wrap(function(text)
pcall(diff.set_ref_text, buf_id, text)
end)
-- NOTE: Do not cache buffer's name to react to its possible rename
local path = M.get_buf_realpath(buf_id)
if path == '' then
return buf_set_ref_text {}
end
local cwd, basename = vim.fn.fnamemodify(path, ':h'), vim.fn.fnamemodify(path, ':t')
-- Set
local stdout = vim.loop.new_pipe()
local spawn_opts = {
args = { 'file', 'show', '--no-pager', '--ignore-working-copy', '-r', '@-', './' .. basename },
cwd = cwd,
stdio = { nil, stdout, nil },
}
local process, stdout_feed = nil, {}
process = vim.loop.spawn('jj', spawn_opts, function(exit_code)
process:close()
if exit_code ~= 0 or stdout_feed[1] == nil then
return buf_set_ref_text {}
end
-- Set reference text accounting for possible 'crlf' end of line in index
local text = table.concat(stdout_feed, ''):gsub('\r\n', '\n')
buf_set_ref_text(text)
end)
M.jj_read_stream(stdout, stdout_feed)
end)
M.jj_read_stream = function(stream, feed)
local callback = function(err, data)
if data ~= nil then
return table.insert(feed, data)
end
if err then
feed[1] = nil
end
stream:close()
end
stream:read_start(callback)
end
M.jj_invalidate_cache = function(cache)
if cache == nil then
return
end
pcall(vim.loop.fs_event_stop, cache.fs_event)
pcall(vim.loop.timer_stop, cache.timer)
end
M.gen_source = function()
local attach = function(buf_id)
-- Try attaching to a buffer only once
if M.cache[buf_id] ~= nil then
return false
end
-- - Possibly resolve symlinks to get data from the original repo
local path = M.get_buf_realpath(buf_id)
if path == '' then
return false
end
M.cache[buf_id] = {}
M.jj_start_watching_tree_state(buf_id, path)
end
local detach = function(buf_id)
local cache = M.cache[buf_id]
M.cache[buf_id] = nil
M.jj_invalidate_cache(cache)
end
local apply_hunks = function(_, _)
-- staging does not apply for jj
end
return {
name = 'jj',
attach = attach,
detach = detach,
apply_hunks = apply_hunks,
}
end
return M

View file

@ -1,71 +0,0 @@
local M = {}
M.setup = function()
local id = M.get_id()
if M.check_exists(id) then
vim.notify('Existing session for ' .. id)
end
vim.keymap.set('n', '<leader>fs', function()
require('plugins.lib.session_jj').load()
end, { noremap = true, desc = 'mini session select' })
end
M.get_id = function()
local jj_root = vim.system({ 'jj', 'workspace', 'root' }):wait()
if jj_root.code ~= 0 then
return
end
local result = vim
.system({
'jj',
'log',
'-r',
'latest(heads(::@ & bookmarks()))',
'--template',
'bookmarks',
'--no-pager',
'--no-graph',
})
:wait()
local branch = vim.trim(string.gsub(result.stdout, '[\n*]', '')) -- trim newlines and unpushed indicator
local root = vim.trim(string.gsub(jj_root.stdout, '\n', ''))
local id = string.gsub(string.format('jj:%s:%s', root, branch), '[./]', '-') -- slugify
return id
end
M.check_exists = function(id)
for name, _ in pairs(MiniSessions.detected) do
if name == id then
return true
end
end
return false
end
M.load = function()
local id = M.get_id()
if id == '' then
return
end
vim.opt.shadafile = vim.fn.stdpath('data') .. '/myshada/' .. id .. '.shada'
if M.check_exists(id) then
vim.ui.select({
'Yes',
'No',
}, { prompt = 'Session found at ' .. id .. ', load it?' }, function(c)
if c == 'Yes' then
-- load session (buffers, etc) as well as shada (marks)
MiniSessions.read(id)
vim.notify('loaded jj session: ' .. id)
end
end)
else
MiniSessions.write(id)
end
end
_G.M = M
return M

View file

@ -1,121 +0,0 @@
local M = {}
function M.status()
local function get_files()
local status_raw = vim.fn.system('jj diff --no-pager --quiet --summary')
local files = {}
for status in status_raw:gmatch('[^\r\n]+') do
local state, text = string.match(status, '^(%a)%s(.+)$')
if state and text then
local file = text
local hl = ''
if state == 'A' then
hl = 'SnacksPickerGitStatusAdded'
elseif state == 'M' then
hl = 'SnacksPickerGitStatusModified'
elseif state == 'D' then
hl = 'SnacksPickerGitStatusDeleted'
elseif state == 'R' then
hl = 'SnacksPickerGitStatusRenamed'
file = string.match(text, '{.-=>%s*(.-)}')
end
local diff = vim.fn.system('jj diff ' .. file .. ' --ignore-working-copy --no-pager --stat --git')
table.insert(files, {
text = text,
file = file,
filename_hl = hl,
state = state,
diff = diff,
})
end
end
return files
end
local files = get_files()
Snacks.picker.pick {
source = 'jj_status',
items = files,
format = 'file',
title = 'jj status',
preview = function(ctx)
if ctx.item.file then
Snacks.picker.preview.diff(ctx)
else
ctx.preview:reset()
ctx.preview:set_title('No preview')
end
end,
}
end
function M.revs()
local function jj_new(picker, item)
picker:close()
if item then
if not item.rev then
vim.notify.warn('No branch or commit found', { title = 'Snacks Picker' })
return
end
local cmd = { 'jj', 'new', '-r', item.rev }
Snacks.picker.util.cmd(cmd, function()
vim.notify('Checking out revision: ' .. item.rev, { title = 'Snacks Picker' })
vim.cmd.checktime()
require('plugins.lib.session_jj').load()
end, { cwd = item.cwd })
end
end
local function jj_rev_cmd(ctx)
if ctx.item.rev then
Snacks.picker.preview.cmd({ 'jj', 'show', '--ignore-working-copy', '--git', '-r', ctx.item.rev }, ctx)
else
ctx.preview:reset()
return 'No preview available.'
end
end
local function jj_log(revset)
if revset == nil then
revset = '-r "ancestors(@,25)"'
else
revset = '-r ' .. revset
end
local status_raw = vim.fn.system(
'jj log --ignore-working-copy '
.. revset
..
' --template \'if(root, format_root_commit(self), label(if(current_working_copy, "working_copy"), concat(separate(" ", self.change_id().shortest(8), self.bookmarks()), " | ", if(empty, label("empty", "(empty)")), if(description, description.first_line(), label(if(empty, "empty"), description_placeholder),),) ++ "\n",),)\''
)
local lines = {}
for line in status_raw:gmatch('[^\r\n]+') do
local sign, rev = string.match(line, '(.)%s(%a+)%s.*')
table.insert(lines, {
text = line,
sign = sign,
rev = rev,
})
end
return lines
end
Snacks.picker.pick {
source = 'jj_revs',
layout = 'ivy',
format = 'text',
title = 'jj log',
items = jj_log(),
confirm = jj_new,
preview = jj_rev_cmd,
}
end
return M

View file

@ -1,133 +0,0 @@
return {
{
'neovim/nvim-lspconfig',
event = 'VeryLazy',
config = function()
vim.lsp.enable {
'nil_ls',
'phpactor',
'gopls',
'lua_ls',
'basedpyright',
}
vim.api.nvim_create_autocmd('LspAttach', {
group = vim.api.nvim_create_augroup('UserLspConfig', {}),
callback = function(ev)
local client = vim.lsp.get_client_by_id(ev.data.client_id)
if not client then
return
end
vim.keymap.set('n', 'gO', function()
Snacks.picker.lsp_symbols { focus = 'list' }
end, { buffer = ev.buf, desc = 'LSP symbols' })
vim.keymap.set('n', 'grh', function()
vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled())
end, { buffer = ev.buf, desc = 'LSP hints toggle' })
vim.keymap.set('n', 'grl', vim.lsp.codelens.run, { buffer = ev.buf, desc = 'vim.lsp.codelens.run()' })
vim.keymap.set('n', 'gre', function()
vim.diagnostic.setloclist()
end, { buffer = ev.buf, desc = 'LSP buffer diagnostics' })
vim.keymap.set('n', 'grE', function()
vim.diagnostic.setqflist()
end, { buffer = ev.buf, desc = 'LSP diagnostics' })
vim.keymap.set('n', 'grc', function()
vim.lsp.buf.incoming_calls()
end, { buffer = ev.buf, desc = 'LSP incoming_calls' })
vim.keymap.set('n', 'gro', function()
vim.lsp.buf.outgoing_calls()
end, { buffer = ev.buf, desc = 'LSP outgoing_calls' })
-- Auto-refresh code lenses
if client:supports_method('textDocument/codeLens') or client.server_capabilities.codeLensProvider then
vim.api.nvim_create_autocmd({ 'InsertLeave', 'TextChanged' }, {
group = vim.api.nvim_create_augroup(string.format('lsp-%s-%s', ev.buf, client.id), {}),
callback = function()
vim.lsp.codelens.refresh { bufnr = ev.buf }
end,
buffer = ev.buf,
})
vim.lsp.codelens.refresh()
end
end,
})
vim.api.nvim_exec_autocmds('FileType', {})
end,
},
{
'stevearc/conform.nvim',
event = 'VeryLazy',
keys = {
{
'\\f',
function()
vim.b.disable_autoformat = not vim.b.disable_autoformat
Snacks.notify(string.format('Buffer formatting disabled: %s', vim.b.disable_autoformat))
end,
mode = { 'n', 'x' },
desc = 'toggle buffer formatting',
},
{
'\\F',
function()
vim.g.disable_autoformat = not vim.g.disable_autoformat
Snacks.notify(string.format('Global formatting disabled: %s', vim.g.disable_autoformat))
end,
mode = { 'n', 'x' },
desc = 'toggle global formatting',
},
},
opts = {
notify_no_formatters = false,
formatters_by_ft = {
json = { 'jq' },
puppet = { 'puppet-lint' },
lua = { 'stylua' },
python = { 'ruff' },
nix = { 'nixfmt' },
fish = { 'fish_indent' },
['*'] = { 'trim_whitespace' },
},
format_on_save = function(bufnr)
-- Disable with a global or buffer-local variable
if vim.g.disable_autoformat or vim.b[bufnr].disable_autoformat then
return
end
return { timeout_ms = 1500, lsp_format = 'fallback' }
end,
default_format_opts = {
timeout_ms = 1500,
lsp_format = 'fallback',
},
},
},
{
'mfussenegger/nvim-lint',
event = 'VeryLazy',
config = function()
require('lint').linters_by_ft = {
docker = { 'hadolint' },
yaml = { 'yamllint' },
puppet = { 'puppet-lint' },
sh = { 'shellcheck' },
go = { 'golangcilint' },
ruby = { 'rubocop' },
fish = { 'fish' },
bash = { 'bash' },
nix = { 'nix' },
php = { 'php' },
}
vim.api.nvim_create_autocmd({ 'BufEnter', 'BufWritePost', 'InsertLeave' }, {
group = vim.api.nvim_create_augroup('lint', { clear = true }),
callback = function()
if vim.bo.modifiable then
require('lint').try_lint()
end
end,
})
end,
},
}

View file

@ -1,163 +0,0 @@
return {
{
'echasnovski/mini.nvim',
lazy = false,
keys = {
{
'<leader>gp',
function()
MiniDiff.toggle_overlay(0)
end,
noremap = true,
desc = 'git diff overlay',
},
{
'<leader>go',
function()
return MiniGit.show_at_cursor()
end,
noremap = true,
desc = 'git show at cursor',
},
{
'<leader>gb',
'<Cmd>Git blame -- %<CR>',
desc = 'git blame',
},
{
'<leader>gg',
':Git ',
desc = 'git command',
},
},
config = function()
require('mini.basics').setup { mappings = { windows = true } }
vim.schedule(function()
local ai = require('mini.ai')
local extra_ai = require('mini.extra').gen_ai_spec
ai.setup {
n_lines = 300,
custom_textobjects = {
i = extra_ai.indent(),
g = extra_ai.buffer(),
e = extra_ai.line(),
u = ai.gen_spec.function_call(),
a = ai.gen_spec.treesitter { a = '@parameter.outer', i = '@parameter.inner' },
k = ai.gen_spec.treesitter { a = '@assignment.lhs', i = '@assignment.lhs' },
v = ai.gen_spec.treesitter { a = '@assignment.rhs', i = '@assignment.rhs' },
f = ai.gen_spec.treesitter { a = '@function.outer', i = '@function.inner' },
o = ai.gen_spec.treesitter {
a = { '@block.outer', '@conditional.outer', '@loop.outer' },
i = { '@block.inner', '@conditional.inner', '@loop.inner' },
},
},
}
require('mini.align').setup()
require('mini.bracketed').setup { file = { suffix = 'm' } }
require('mini.icons').setup()
require('mini.git').setup()
require('mini.surround').setup()
require('mini.splitjoin').setup { detect = { separator = '[,;\n]' } }
require('mini.sessions').setup {
file = '',
autowrite = true,
hooks = {
pre = {
read = function(session) -- load Dart state *before* buffers are loaded
vim.cmd('rshada')
Dart.read_session(session['name'])
end,
write = function(session)
vim.cmd('wshada')
Dart.write_session(session['name'])
end,
},
},
}
require('plugins.lib.session_jj').setup()
local jump = require('mini.jump2d')
jump.setup {
view = { n_steps_ahead = 1, dim = true },
spotter = jump.gen_spotter.vimpattern(),
}
local diff = require('mini.diff')
diff.setup {
options = { wrap_goto = true },
source = {
require('plugins.lib.minidiff_jj').gen_source(),
diff.gen_source.git(),
},
}
local miniclue = require('mini.clue')
miniclue.setup {
triggers = {
{ mode = 'n', keys = '<Leader>' },
{ mode = 'n', keys = 'g' },
{ mode = 'n', keys = "'" },
{ mode = 'n', keys = '`' },
{ mode = 'n', keys = '"' },
{ mode = 'n', keys = '<C-w>' },
{ mode = 'n', keys = 'z' },
{ mode = 'n', keys = ']' },
{ mode = 'n', keys = '[' },
{ mode = 'n', keys = '\\' },
},
window = {
config = { width = 'auto' },
},
clues = {
miniclue.gen_clues.g(),
miniclue.gen_clues.marks(),
miniclue.gen_clues.registers(),
miniclue.gen_clues.windows(),
miniclue.gen_clues.z(),
},
}
local files = require('mini.files')
files.setup {
mappings = {
go_in_plus = '<CR>',
},
windows = {
preview = true,
width_focus = 30,
width_preview = 50,
},
}
vim.keymap.set('n', '<leader>nc', function()
files.open(vim.api.nvim_buf_get_name(0), false) -- open current buffer's dir
files.reveal_cwd()
end, { desc = 'minifiles open' })
vim.api.nvim_create_autocmd('User', {
pattern = 'MiniFilesBufferCreate',
callback = function(args)
vim.keymap.set('n', '<leader>nc', function()
files.synchronize()
files.close()
end, { buffer = args.data.buf_id })
vim.keymap.set('n', '`', function()
local cur_entry_path = MiniFiles.get_fs_entry().path
local cur_directory = vim.fs.dirname(cur_entry_path)
if cur_directory ~= '' then
vim.fn.chdir(cur_directory)
end
end, { buffer = args.data.buf_id })
end,
})
vim.api.nvim_create_autocmd('User', {
pattern = 'MiniFilesActionRename',
callback = function(event)
Snacks.rename.on_rename_file(event.data.from, event.data.to)
end,
})
local multi = require('mini.keymap').map_multistep
multi({ 'i', 's' }, '<Tab>', { 'blink_accept', 'vimsnippet_next', 'increase_indent' })
multi({ 'i', 's' }, '<S-Tab>', { 'vimsnippet_prev', 'decrease_indent' })
end)
end,
},
}

View file

@ -1,143 +0,0 @@
return {
{
'iofq/dart.nvim',
lazy = false,
priority = 1001,
config = true,
},
{
'windwp/nvim-autopairs',
event = 'VeryLazy',
config = true,
},
{
'nvim-treesitter/nvim-treesitter',
event = 'VeryLazy',
branch = 'main',
dependencies = {
{
'nvim-treesitter/nvim-treesitter-textobjects',
branch = 'main',
config = true,
},
{
'nvim-treesitter/nvim-treesitter-context',
opts = {
max_lines = 5,
min_window_height = 50,
},
},
},
},
{
'jinh0/eyeliner.nvim',
event = 'VeryLazy',
config = true,
},
{
'MeanderingProgrammer/render-markdown.nvim',
event = 'VeryLazy',
opts = {
completions = {
blink = { enabled = true },
},
},
},
{
'sindrets/diffview.nvim',
event = 'VeryLazy',
opts = {
use_icons = false,
enhanced_diff_hl = true,
default_args = {
DiffviewOpen = { '--imply-local' },
},
view = {
merge_tool = {
layout = 'diff4_mixed',
disable_diagnostics = true,
},
},
keymaps = {
view = {
{ { 'n' }, 'q', vim.cmd.DiffviewClose, { desc = 'Close Diffview' } },
},
file_panel = {
{ { 'n' }, 'q', vim.cmd.DiffviewClose, { desc = 'Close Diffview' } },
},
file_history_panel = {
{ { 'n' }, 'q', vim.cmd.DiffviewClose, { desc = 'Close Diffview' } },
},
},
},
keys = {
{ '<leader>nb', vim.cmd.DiffviewOpen, desc = 'diffview open' },
{
'<leader>nh',
'<cmd>DiffviewFileHistory %<cr>',
mode = { 'n', 'v' },
desc = 'diffview history',
},
{
'<leader>nH',
'<cmd>DiffviewFileHistory<cr>',
mode = { 'n', 'v' },
desc = 'diffview history',
},
},
},
{
'ThePrimeagen/refactoring.nvim',
event = 'VeryLazy',
config = true,
keys = {
{ '<leader>rv', '<cmd>Refactor inline_var<cr>dd', mode = { 'n', 'x' } },
{
'<leader>rr',
function()
require('refactoring').select_refactor { prefer_ex_cmd = true }
end,
mode = { 'n', 'x' },
},
},
},
{
'stevearc/quicker.nvim',
event = 'VeryLazy',
opts = {
follow = {
enabled = true,
},
},
keys = {
{
'<leader>qf',
function()
require('quicker').toggle { max_height = 20 }
end,
desc = 'Toggle qflist',
},
{
'<leader>qr',
function()
require('quicker').refresh()
end,
desc = 'Refresh qflist',
},
{
'<leader>q>',
function()
require('quicker').expand { before = 2, after = 2, add_to_existing = true }
end,
desc = 'Expand quickfix context',
},
{
'<leader>q<',
function()
require('quicker').collapse()
end,
desc = 'Collapse quickfix context',
},
},
},
}

View file

@ -1,191 +0,0 @@
return {
{
'folke/snacks.nvim',
lazy = false,
priority = 1000,
opts = {
bigfile = { enabled = true },
notifier = {
enabled = true,
timeout = 4000,
},
styles = {
notification = {
wo = { wrap = true },
},
terminal = {
border = 'rounded',
},
},
terminal = { enabled = true },
indent = { enabled = true },
input = { enabled = true },
picker = {
enabled = true,
jump = { reuse_win = true },
matcher = {
frecency = true,
history_bonus = true,
cwd_bonus = true,
},
layout = 'ivy_split',
sources = {
grep = { hidden = true },
explorer = { hidden = true },
lsp_symbols = {
filter = { default = true },
layout = 'left',
},
smart = {
sort = {
fields = {
'score:desc',
'idx',
'#text',
},
},
multi = {
'marks',
{ source = 'buffers', current = false },
{ source = 'files', hidden = true },
{ source = 'git_files', untracked = true },
},
},
},
win = {
input = {
keys = { ['wq'] = { 'close', mode = 'i' } },
},
list = {
keys = { ['wq'] = { 'close', mode = 'i' } },
},
},
},
},
keys = {
{
'<C-\\>',
function()
Snacks.terminal.toggle()
end,
mode = { 'n', 't' },
desc = 'terminal open',
},
{
'<C-/>',
function()
Snacks.terminal.toggle('command -v fish >/dev/null && exec fish || exec bash')
end,
mode = { 'n', 't' },
desc = 'terminal open',
},
{
'<leader><leader>',
function()
vim.cmd.delmarks { args = { '0-9' } }
vim.cmd.delmarks { args = { '"' } }
Snacks.picker.smart()
end,
desc = 'Fuzzy find smart',
},
{
'<leader>fe',
function()
Snacks.explorer()
end,
desc = 'snacks explorer',
},
{
'<leader>ff',
function()
Snacks.picker.files()
end,
desc = 'Fuzzy find files',
},
{
'<leader>fa',
function()
Snacks.picker.grep()
end,
desc = 'Fuzzy find grep',
},
{
'<leader>f8',
function()
Snacks.picker.grep_word()
end,
desc = 'Fuzzy find grep word',
},
{
'<leader>f?',
function()
Snacks.picker.pickers()
end,
desc = 'See all pickers',
},
{
'<leader>fu',
function()
Snacks.picker.undo()
end,
desc = 'Pick undotree',
},
{
'<leader>fj',
function()
Snacks.picker.jumps()
end,
desc = 'Pick jumps',
},
{
'<leader>f.',
function()
Snacks.picker.resume()
end,
desc = 'Fuzzy find resume',
},
{
'<leader>fb',
function()
Snacks.picker.buffers()
end,
desc = 'Fuzzy find buffers',
},
{
'<leader>fn',
function()
Snacks.picker.notifications()
end,
desc = 'pick notifications',
},
{
'gO',
function()
Snacks.picker.treesitter()
end,
desc = 'pick treesitter nodes',
},
{
'<leader>fq',
function()
Snacks.picker.qflist()
end,
desc = 'pick quickfix list',
},
{
'<leader>jf',
function()
require('plugins.lib.snacks_jj').status()
end,
desc = 'pick notifications',
},
{
'<leader>jj',
function()
require('plugins.lib.snacks_jj').revs()
end,
desc = 'pick notifications',
},
},
},
}