Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8f12297d8c | ||
|
|
e68fd278cc | ||
|
|
c85b2870a7 | ||
|
|
9a30131d6c | ||
|
|
ca1eaee186 | ||
|
|
e00586dd10 | ||
|
|
5f57ab9009 | ||
|
|
74c901f261 | ||
|
|
e4b1da80e3 | ||
|
|
258b1c2c3c | ||
|
|
8931dc4589 | ||
|
|
5e3461c5f3 | ||
|
|
c1666fe7a3 | ||
|
|
2df7760de0 | ||
|
|
c298e5598e | ||
|
|
9a37a2db0f | ||
|
|
992cf65a50 | ||
|
|
4521c4ed12 | ||
|
|
e291d41585 | ||
|
|
209e405260 | ||
|
|
d54e2968b0 | ||
|
|
cea8ce8882 | ||
|
|
4a74f60fd7 | ||
|
|
f90c967872 | ||
|
|
9ef384af74 | ||
|
|
2eb6ca7c37 | ||
|
|
d047b4905f | ||
|
|
55f479eb86 | ||
|
|
09623f8590 | ||
|
|
ff89015b9c | ||
|
|
795137d2af | ||
|
|
f60bb4ab01 | ||
|
|
d86d1f7fcb | ||
|
|
918bd8ce0c | ||
|
|
1f798f0da1 | ||
|
|
d26830bf71 | ||
|
|
4524944dae | ||
|
|
49364f362d | ||
|
|
a1907c44c8 | ||
|
|
e4c3e21d9b | ||
|
|
74c28612ae | ||
|
|
9040e3a62f | ||
|
|
7b51fef715 | ||
|
|
e782476e93 | ||
|
|
77802f4692 | ||
|
|
fa2a5f66e5 | ||
|
|
98adcdc503 | ||
|
|
928a33a0de | ||
|
|
7caa4e9e01 | ||
|
|
96bf8dd300 | ||
|
|
4ca80e1cb3 | ||
|
|
cc18eff3f5 | ||
|
|
98afa7639a | ||
|
|
3b87993d60 | ||
|
|
2def250609 | ||
|
|
924a4c5888 | ||
|
|
a807da6f07 | ||
|
|
b46c53bc11 | ||
|
|
c455df4a90 | ||
|
|
192e2e9e9b | ||
|
|
032b6018a7 | ||
|
|
550f9eb89c | ||
|
|
5a27f3751b | ||
|
|
7140ddaf8b | ||
|
|
8379c929dc | ||
|
|
758c0eea5e | ||
|
|
f7954b0d38 | ||
|
|
d90d567af3 | ||
|
|
adbb9f1af3 | ||
|
|
3b3ebd4524 | ||
|
|
5cfb307909 | ||
|
|
3692eecdd7 | ||
|
|
9cadee2e32 | ||
|
|
0116171278 | ||
|
|
dfd0382852 | ||
|
|
4c524c0d00 | ||
|
|
81a691dce6 | ||
|
|
a3860b33da | ||
|
|
abbe69e9ee | ||
|
|
0fd2c7067a | ||
|
|
54444c9f33 | ||
|
|
b4b165fb96 | ||
|
|
393011a521 | ||
|
|
96f0f9791c | ||
|
|
f17686a991 | ||
|
|
265e728a9f | ||
|
|
e296ae8fa5 | ||
|
|
82a1c14a1e | ||
|
|
3832508b40 | ||
|
|
bdf8ad1bb0 | ||
|
|
06e0bab7dd | ||
|
|
4bd926e7ed | ||
|
|
f0851b44de | ||
|
|
be6d52c586 | ||
|
|
eb30446aeb | ||
|
|
1e7a713aaa | ||
|
|
0a0d094e3c | ||
|
|
c832c27c1e | ||
|
|
049334330d | ||
|
|
963c35e67f | ||
|
|
e5283a89ed | ||
|
|
2c1e70cfdc | ||
|
|
8c7f943e64 | ||
|
|
233cb7c4d8 | ||
|
|
2f18e2c031 | ||
|
|
858dbe14ea | ||
|
|
827cc0f118 | ||
|
|
2068e2afd4 | ||
|
|
65b4d2bbc7 | ||
|
|
e7da050111 | ||
|
|
9859b36075 | ||
|
|
3c02ba5c9d | ||
|
|
98605f84ab | ||
|
|
f0800ef8d7 | ||
|
|
1c70bbda10 | ||
|
|
7cbc0c9a7f | ||
|
|
56485842a4 | ||
|
|
0b9ee59ab7 | ||
|
|
c5e964ba16 | ||
|
|
f117ced1dd | ||
|
|
9c3613ce9c | ||
|
|
e34d8595a9 | ||
|
|
d0d2067980 | ||
|
|
4831cfc27c | ||
|
|
f711722233 | ||
|
|
16efb1c9e5 | ||
|
|
c5133f1a4d | ||
|
|
0b801006f1 | ||
|
|
60c1f88cfb | ||
|
|
6a6c49b78e | ||
|
|
a1f8d8c465 | ||
|
|
ec7bec004f | ||
|
|
288831e280 | ||
|
|
eb56100a73 | ||
|
|
553796304c | ||
|
|
a5e7e118b3 | ||
|
|
07f21fd441 | ||
|
|
dd0fc8a1d6 | ||
|
|
0773383ad4 | ||
|
|
584049ad51 | ||
|
|
192031b559 | ||
|
|
f00117de45 | ||
|
|
e16915f0e3 | ||
|
|
ec61cbe072 |
No files matched your search
@@ -0,0 +1,6 @@
|
||||
[scopes]
|
||||
config = [".github", ".neoconf.json", ".luarc.json", ".stylua.toml", "selene.toml", "lazy-lock.json", "neovim.yml"]
|
||||
docs = ["README.md"]
|
||||
core = ["init.lua", "lua/config", "lua/plugins", "lua/lazy_setup.lua", "lua/polish.lua", "lua/community.lua"]
|
||||
claude = ["claude/agents", "claude/commands", "claude/skills"]
|
||||
docker = ["Dockerfile"]
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
# Neovim
|
||||
.cache
|
||||
.local
|
||||
.session
|
||||
.swap
|
||||
*lock.json
|
||||
|
||||
# OS
|
||||
.DS_Store
|
||||
Thumbs.db
|
||||
node_modules
|
||||
|
||||
# Editor
|
||||
Session.vim
|
||||
Sessionx.vim
|
||||
tags
|
||||
tags.*
|
||||
*.swp
|
||||
*.swo
|
||||
|
||||
# Temporary
|
||||
tmp
|
||||
temp
|
||||
!lua/plugins
|
||||
lua/plugins/local.lua
|
||||
|
||||
# Claude Code
|
||||
.claude/
|
||||
claude
|
||||
!claude/agents
|
||||
!claude/commands
|
||||
!claude/skills
|
||||
!claude/settings.json
|
||||
|
||||
lazy-lock.json
|
||||
-53
@@ -1,53 +0,0 @@
|
||||
{
|
||||
"lockfile_version": "1",
|
||||
"packages": {
|
||||
"neovim@latest": {
|
||||
"last_modified": "2025-02-07T11:26:36Z",
|
||||
"resolved": "github:NixOS/nixpkgs/d98abf5cf5914e5e4e9d57205e3af55ca90ffc1d#neovim",
|
||||
"source": "devbox-search",
|
||||
"version": "0.10.4",
|
||||
"systems": {
|
||||
"aarch64-darwin": {
|
||||
"outputs": [
|
||||
{
|
||||
"name": "out",
|
||||
"path": "/nix/store/dsn4k9wp16xv1j4b7l0d4liwbk98ya44-neovim-0.10.4",
|
||||
"default": true
|
||||
}
|
||||
],
|
||||
"store_path": "/nix/store/dsn4k9wp16xv1j4b7l0d4liwbk98ya44-neovim-0.10.4"
|
||||
},
|
||||
"aarch64-linux": {
|
||||
"outputs": [
|
||||
{
|
||||
"name": "out",
|
||||
"path": "/nix/store/mpq2wyqkippwzj8m2lx4qzn01kqjbfa5-neovim-0.10.4",
|
||||
"default": true
|
||||
}
|
||||
],
|
||||
"store_path": "/nix/store/mpq2wyqkippwzj8m2lx4qzn01kqjbfa5-neovim-0.10.4"
|
||||
},
|
||||
"x86_64-darwin": {
|
||||
"outputs": [
|
||||
{
|
||||
"name": "out",
|
||||
"path": "/nix/store/izwv6gp1la8rcjax5xb8z0k8ws9j8al2-neovim-0.10.4",
|
||||
"default": true
|
||||
}
|
||||
],
|
||||
"store_path": "/nix/store/izwv6gp1la8rcjax5xb8z0k8ws9j8al2-neovim-0.10.4"
|
||||
},
|
||||
"x86_64-linux": {
|
||||
"outputs": [
|
||||
{
|
||||
"name": "out",
|
||||
"path": "/nix/store/fhzw8ah6s37q2p9pak7d2alzhx0m137h-neovim-0.10.4",
|
||||
"default": true
|
||||
}
|
||||
],
|
||||
"store_path": "/nix/store/fhzw8ah6s37q2p9pak7d2alzhx0m137h-neovim-0.10.4"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+63
-68
@@ -1,89 +1,84 @@
|
||||
{
|
||||
"AstroNvim": { "branch": "main", "commit": "7daf9cd3121172bcecb25c3d4a28c7c01cf0e812" },
|
||||
"LuaSnip": { "branch": "master", "commit": "03c8e67eb7293c404845b3982db895d59c0d1538" },
|
||||
"SchemaStore.nvim": { "branch": "main", "commit": "d307d291f38678d064cb987112926df6d9134de3" },
|
||||
"aerial.nvim": { "branch": "master", "commit": "3284a2cb858ba009c79da87d5e010ccee3c99c4d" },
|
||||
"astrocommunity": { "branch": "main", "commit": "07d473a0e1a345ea320812a4197f11a54e50ac80" },
|
||||
"astrocore": { "branch": "main", "commit": "5d6b00072ef226507d68ef88857aa522b126f7a8" },
|
||||
"astrolsp": { "branch": "main", "commit": "0ab285f47b9f667402f08eb471e3e98f9a50b5ee" },
|
||||
"astrotheme": { "branch": "main", "commit": "f12dcf64b1f9a05839c3ac2146f550f43bae9dab" },
|
||||
"astroui": { "branch": "main", "commit": "7a46b59fc51afb91bcb37f7a2ef3f8811b66bc93" },
|
||||
"avante.nvim": { "branch": "main", "commit": "b6000d5bbcb85e3b11177846220bfd438fc013dd" },
|
||||
"blink.cmp": { "branch": "main", "commit": "49f211fe5d729df53df4c042d7c3464cf47d199e" },
|
||||
"AstroNvim": { "branch": "main", "commit": "c5e610f614e74c9dd9bf11760c4d0ad2c98c0abe" },
|
||||
"Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" },
|
||||
"LuaSnip": { "branch": "master", "commit": "5a1e39223db9a0498024a77b8441169d260c8c25" },
|
||||
"aerial.nvim": { "branch": "master", "commit": "5c4e2da4486da5f9b798ea9a0f1fc5c6bcd3d9cf" },
|
||||
"alpha-nvim": { "branch": "main", "commit": "de72250e054e5e691b9736ee30db72c65d560771" },
|
||||
"astrocommunity": { "branch": "main", "commit": "94bc6b34df039e919b380c15ee6b5a3f79df8186" },
|
||||
"astrocore": { "branch": "main", "commit": "44a3dc0bf1591022b2a6bc89dccdfac1be17bec9" },
|
||||
"astrolsp": { "branch": "main", "commit": "909fbe64f3f87d089ff3777751261544557117cc" },
|
||||
"astrotheme": { "branch": "main", "commit": "cf0e65a7b3ce2f830b052f4da937729eee1e7a7d" },
|
||||
"astroui": { "branch": "main", "commit": "e923a84c488d879a260fc9cfb2dc27dd870fb6ac" },
|
||||
"auto-save.nvim": { "branch": "main", "commit": "61892d67acd5b7c845f5da4d780b26fcd7f63e34" },
|
||||
"better-escape.nvim": { "branch": "master", "commit": "199dcc2643dec5d8dbdab4ec672cf405224dcb3b" },
|
||||
"blink.cmp": { "branch": "main", "commit": "451168851e8e2466bc97ee3e026c3dcb9141ce07" },
|
||||
"bufferline.nvim": { "branch": "main", "commit": "655133c3b4c3e5e05ec549b9f8cc2894ac6f51b3" },
|
||||
"cmp-dap": { "branch": "master", "commit": "ea92773e84c0ad3288c3bc5e452ac91559669087" },
|
||||
"conform.nvim": { "branch": "master", "commit": "f9ef25a7ef00267b7d13bfc00b0dea22d78702d5" },
|
||||
"copilot.lua": { "branch": "master", "commit": "20723713aa5fbfd535fcf0cd28753a899ca3d526" },
|
||||
"cyberdream.nvim": { "branch": "main", "commit": "f36d7991b6373ebda9cfca20030aa1fca7328ea8" },
|
||||
"dressing.nvim": { "branch": "master", "commit": "2d7c2db2507fa3c4956142ee607431ddb2828639" },
|
||||
"flash.nvim": { "branch": "main", "commit": "3c942666f115e2811e959eabbdd361a025db8b63" },
|
||||
"chezmoi.nvim": { "branch": "main", "commit": "ad26a6c4f5be0c348612518fcb1b7116649e026f" },
|
||||
"chezmoi.vim": { "branch": "main", "commit": "73b30df35c6b645ebd2e6a440eea8463ef3c3f47" },
|
||||
"conform.nvim": { "branch": "master", "commit": "086a40dc7ed8242c03be9f47fbcee68699cc2395" },
|
||||
"crates.nvim": { "branch": "main", "commit": "ac9fa498a9edb96dc3056724ff69d5f40b898453" },
|
||||
"cyberdream.nvim": { "branch": "main", "commit": "a68ffa6af98bf1fc88f33a071c51a188ec85c725" },
|
||||
"dressing.nvim": { "branch": "master", "commit": "3a45525bb182730fe462325c99395529308f431e" },
|
||||
"editorconfig-vim": { "branch": "master", "commit": "13b86c5c691785ffbf2d6508c621dabb08e93df0" },
|
||||
"friendly-snippets": { "branch": "main", "commit": "efff286dd74c22f731cdec26a70b46e5b203c619" },
|
||||
"fzf-lua": { "branch": "main", "commit": "1dcef2467af609e0688f8136b8ea720645c9c41c" },
|
||||
"gitsigns.nvim": { "branch": "main", "commit": "7010000889bfb6c26065e0b0f7f1e6aa9163edd9" },
|
||||
"gopher.nvim": { "branch": "main", "commit": "ea28fc4e6fd9edd4556b3431199c6112cfdb9c65" },
|
||||
"guess-indent.nvim": { "branch": "main", "commit": "84a4987ff36798c2fc1169cbaff67960aed9776f" },
|
||||
"heirline.nvim": { "branch": "master", "commit": "cc359b628266cb9a84b2d71c883f2b99e16473a0" },
|
||||
"inc-rename.nvim": { "branch": "main", "commit": "87ebe7bee0b83d3b6e4f1494c74abed21b318175" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" },
|
||||
"lazydev.nvim": { "branch": "main", "commit": "f59bd14a852ca43db38e3662395354cb2a9b13e0" },
|
||||
"lazygit.nvim": { "branch": "main", "commit": "b9eae3badab982e71abab96d3ee1d258f0c07961" },
|
||||
"leap.nvim": { "branch": "main", "commit": "346a16ef942635a8ca5ff92e603d07e7e8be6cbe" },
|
||||
"live-preview.nvim": { "branch": "main", "commit": "4a11bece3fbe898569da72800f101e86f2241bcf" },
|
||||
"lsp_signature.nvim": { "branch": "master", "commit": "c909a01eb923101c76a57fd2187835e9013ab59a" },
|
||||
"markview.nvim": { "branch": "main", "commit": "556cac8bb8eeb461013ebe0d015e2c48d3527c36" },
|
||||
"gopher.nvim": { "branch": "main", "commit": "27ba078f14dd39fcd5e8a57d7009cdd77450ebbb" },
|
||||
"guess-indent.nvim": { "branch": "main", "commit": "6cd61f7a600bb756e558627cd2e740302c58e32d" },
|
||||
"heirline.nvim": { "branch": "master", "commit": "fae936abb5e0345b85c3a03ecf38525b0828b992" },
|
||||
"inc-rename.nvim": { "branch": "main", "commit": "0074b551a17338ccdcd299bd86687cc651bcb33d" },
|
||||
"indent-blankline.nvim": { "branch": "master", "commit": "d28a3f70721c79e3c5f6693057ae929f3d9c0a03" },
|
||||
"kitty-navigator.nvim": { "branch": "main", "commit": "abaaa37fe14cf762a8957a64ff50d2233aff7fe6" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "85c7ff3711b730b4030d03144f6db6375044ae82" },
|
||||
"lazydev.nvim": { "branch": "main", "commit": "01bc2aacd51cf9021eb19d048e70ce3dd09f7f93" },
|
||||
"lsp_lines.nvim": { "branch": "main", "commit": "a92c755f182b89ea91bd8a6a2227208026f27b4d" },
|
||||
"lspkind.nvim": { "branch": "master", "commit": "d79a1c3299ad0ef94e255d045bed9fa26025dab6" },
|
||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "1a31f824b9cd5bc6f342fc29e9a53b60d74af245" },
|
||||
"mason-null-ls.nvim": { "branch": "main", "commit": "2b8433f76598397fcc97318d410e0c4f7a4bea6a" },
|
||||
"mason-nvim-dap.nvim": { "branch": "main", "commit": "ea387e0819ab189d536bb4067e4d8ece3801a292" },
|
||||
"mason-tool-installer.nvim": { "branch": "main", "commit": "98767d37f8e5255a5111fc1e3163232d4dc07bda" },
|
||||
"mason-nvim-dap.nvim": { "branch": "main", "commit": "e51f9b259f066c4347f9a79ffde54c29a0619384" },
|
||||
"mason-tool-installer.nvim": { "branch": "main", "commit": "443f1ef8b5e6bf47045cb2217b6f748a223cf7dc" },
|
||||
"mason.nvim": { "branch": "main", "commit": "fc98833b6da5de5a9c5b1446ac541577059555be" },
|
||||
"mini.basics": { "branch": "main", "commit": "246fc266f3bc3f6ae88c51e011609540b582b196" },
|
||||
"mini.clue": { "branch": "main", "commit": "9bfd8ce71ae31460837fcec82a03946008929777" },
|
||||
"mini.icons": { "branch": "main", "commit": "86a633f0dffcfd80110bac86681dbf4b5c37ba5c" },
|
||||
"mini.pick": { "branch": "main", "commit": "4dfc0a21f16d34e9b2429b96d62788ed8a65e6cd" },
|
||||
"neo-tree.nvim": { "branch": "main", "commit": "9b5d67119c46e3262ffe1508fe6d8540b79ad75d" },
|
||||
"neoconf.nvim": { "branch": "main", "commit": "d4848c791496eab6989951d46586fabf7a22942c" },
|
||||
"noice.nvim": { "branch": "main", "commit": "0427460c2d7f673ad60eb02b35f5e9926cf67c59" },
|
||||
"mini.bufremove": { "branch": "main", "commit": "285bdac9596ee7375db50c0f76ed04336dcd2685" },
|
||||
"mini.icons": { "branch": "main", "commit": "5b9076dae1bfbe47ba4a14bc8b967cde0ab5d77e" },
|
||||
"neo-tree.nvim": { "branch": "main", "commit": "ba6871d15528e36657d19a3112cc1697c59da19a" },
|
||||
"neoconf.nvim": { "branch": "main", "commit": "f630568a4d04154803886f21ca60923f12709f0f" },
|
||||
"none-ls.nvim": { "branch": "main", "commit": "a117163db44c256d53c3be8717f3e1a2a28e6299" },
|
||||
"nui.nvim": { "branch": "main", "commit": "a0fd35fcbb4cb479366f1dc5f20145fd718a3733" },
|
||||
"nvim": { "branch": "main", "commit": "5b5e3aef9ad7af84f463d17b5479f06b87d5c429" },
|
||||
"nvim-aider": { "branch": "main", "commit": "7604b46dc02b5f74cddac13d3922ee89dda69ba1" },
|
||||
"nvim-autopairs": { "branch": "master", "commit": "6522027785b305269fa17088395dfc0f456cedd2" },
|
||||
"nvim-autopairs": { "branch": "master", "commit": "68f0e5c3dab23261a945272032ee6700af86227a" },
|
||||
"nvim-bqf": { "branch": "main", "commit": "f65fba733268ffcf9c5b8ac381287eca7c223422" },
|
||||
"nvim-colorizer.lua": { "branch": "master", "commit": "517df88cf2afb36652830df2c655df2da416a0ae" },
|
||||
"nvim-dap": { "branch": "master", "commit": "6a5bba0ddea5d419a783e170c20988046376090d" },
|
||||
"nvim-dap-go": { "branch": "main", "commit": "8763ced35b19c8dc526e04a70ab07c34e11ad064" },
|
||||
"nvim-dap-go": { "branch": "main", "commit": "b4421153ead5d726603b02743ea40cf26a51ed5f" },
|
||||
"nvim-dap-ui": { "branch": "master", "commit": "bc81f8d3440aede116f821114547a476b082b319" },
|
||||
"nvim-highlight-colors": { "branch": "main", "commit": "7eeaa05eab26fb840c4fe7bca91710bf37cb13ed" },
|
||||
"nvim-lint": { "branch": "master", "commit": "93b8040115c9114dac1047311763bef275e752dc" },
|
||||
"nvim-lsp-file-operations": { "branch": "master", "commit": "9744b738183a5adca0f916527922078a965515ed" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "85e0dd26b710e834a105d679200d01e326a3d2b0" },
|
||||
"nvim-dev-container": { "branch": "main", "commit": "87ea57f420b3460d0c45e239057ffc38fa32f886" },
|
||||
"nvim-lint": { "branch": "master", "commit": "606b823a57b027502a9ae00978ebf4f5d5158098" },
|
||||
"nvim-lsp-file-operations": { "branch": "master", "commit": "b9c795d3973e8eec22706af14959bc60c579e771" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "185b2af444b27d6541c02d662b5b68190e5cf0c4" },
|
||||
"nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" },
|
||||
"nvim-rip-substitute": { "branch": "main", "commit": "1b5d78f3d69fcdf8e734114c665994ffe1672fde" },
|
||||
"nvim-surround": { "branch": "main", "commit": "caf6f633d4d77a29b6e265b560c5a035d171a913" },
|
||||
"nvim-tree.lua": { "branch": "master", "commit": "44d9b58f11d5a426c297aafd0be1c9d45617a849" },
|
||||
"nvim-treesitter": { "branch": "master", "commit": "da5825bf70cc2ea7eacd1e60c32c07baf19adeba" },
|
||||
"nvim-treesitter-textobjects": { "branch": "master", "commit": "9937e5e356e5b227ec56d83d0a9d0a0f6bc9cad4" },
|
||||
"nvim-notify": { "branch": "master", "commit": "a3020c2cf4dfc4c4f390c4a21e84e35e46cf5d17" },
|
||||
"nvim-treesitter": { "branch": "main", "commit": "f8aaf5ce4e27cd20de917946b2ae5c968a2c2858" },
|
||||
"nvim-treesitter-context": { "branch": "master", "commit": "9a8e39993e3b895601bf8227124a48ea8268149e" },
|
||||
"nvim-treesitter-textobjects": { "branch": "main", "commit": "9937e5e356e5b227ec56d83d0a9d0a0f6bc9cad4" },
|
||||
"nvim-ts-autotag": { "branch": "main", "commit": "a1d526af391f6aebb25a8795cbc05351ed3620b5" },
|
||||
"nvim-vtsls": { "branch": "main", "commit": "45c6dfea9f83a126e9bfc5dd63430562b3f8af16" },
|
||||
"nvim-ts-context-commentstring": { "branch": "main", "commit": "1b212c2eee76d787bbea6aa5e92a2b534e7b4f8f" },
|
||||
"nvim-ufo": { "branch": "main", "commit": "61463090a4f55f5d080236ea62f09d1cd8976ff3" },
|
||||
"nvim-vtsls": { "branch": "main", "commit": "0b5f73c9e50ce95842ea07bb3f05c7d66d87d14a" },
|
||||
"nvim-window-picker": { "branch": "main", "commit": "6382540b2ae5de6c793d4aa2e3fe6dbb518505ec" },
|
||||
"overseer.nvim": { "branch": "master", "commit": "72c68aab0358c92f451168b704c411c4a3e3410e" },
|
||||
"package-info.nvim": { "branch": "master", "commit": "3de4f3569ce60e248707df042b72769b3ec343b8" },
|
||||
"peek.nvim": { "branch": "master", "commit": "5820d937d5414baea5f586dc2a3d912a74636e5b" },
|
||||
"persistent-breakpoints.nvim": { "branch": "main", "commit": "d1656221836207787b8a7969cc2dc72668c4742a" },
|
||||
"pkl-neovim": { "branch": "main", "commit": "e8e41d6b7e0a33cd6dddba74c8941ff1801d89de" },
|
||||
"overseer.nvim": { "branch": "master", "commit": "a2194447f4c5a1baf95139c5c7b539fa7b0d012f" },
|
||||
"package-info.nvim": { "branch": "master", "commit": "52e407af634cd5d3add0dc916c517865850113a4" },
|
||||
"plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" },
|
||||
"portal.nvim": { "branch": "main", "commit": "77d9d53fec945bfa407d5fd7120f1b4f117450ed" },
|
||||
"presence.nvim": { "branch": "main", "commit": "87c857a56b7703f976d3a5ef15967d80508df6e6" },
|
||||
"quicker.nvim": { "branch": "master", "commit": "1798be71cdcb15fb84fa8054148a56e17fd391dc" },
|
||||
"promise-async": { "branch": "main", "commit": "38a4575da9497326badd3995e768b4ccf0bb153e" },
|
||||
"resession.nvim": { "branch": "master", "commit": "cc819b0489938d03e4f3532a583354f0287c015b" },
|
||||
"smart-splits.nvim": { "branch": "master", "commit": "4a231987665d3c6e02ca88833d050e918afe3e1e" },
|
||||
"snacks.nvim": { "branch": "main", "commit": "5eac729fa290248acfe10916d92a5ed5e5c0f9ed" },
|
||||
"schemastore.nvim": { "branch": "main", "commit": "157fa3f37a3be55ceb375274e2f3ea2d7d2f9ef6" },
|
||||
"smart-splits.nvim": { "branch": "master", "commit": "ddb23c1a1cf1507bda487cda7f6e4690965ef9f5" },
|
||||
"snacks.nvim": { "branch": "main", "commit": "a049339328e2599ad6e85a69fa034ac501e921b2" },
|
||||
"supermaven-nvim": { "branch": "main", "commit": "07d20fce48a5629686aefb0a7cd4b25e33947d50" },
|
||||
"telescope-fzy-native.nvim": { "branch": "master", "commit": "282f069504515eec762ab6d6c89903377252bf5b" },
|
||||
"telescope-lazy.nvim": { "branch": "main", "commit": "810f7859c98e88b9c4e45de16cb5317207c9b3e8" },
|
||||
"telescope.nvim": { "branch": "master", "commit": "a4ed82509cecc56df1c7138920a1aeaf246c0ac5" },
|
||||
"todo-comments.nvim": { "branch": "main", "commit": "ae0a2afb47cf7395dc400e5dc4e05274bf4fb9e0" },
|
||||
"telescope-fzf-native.nvim": { "branch": "main", "commit": "1f08ed60cafc8f6168b72b80be2b2ea149813e55" },
|
||||
"telescope.nvim": { "branch": "master", "commit": "a17d611a0e111836a1db5295f04945df407c5135" },
|
||||
"todo-comments.nvim": { "branch": "main", "commit": "31e3c38ce9b29781e4422fc0322eb0a21f4e8668" },
|
||||
"toggleterm.nvim": { "branch": "main", "commit": "50ea089fc548917cc3cc16b46a8211833b9e3c7c" },
|
||||
"tsc.nvim": { "branch": "main", "commit": "5bd25bb5c399b6dc5c00392ade6ac6198534b53a" },
|
||||
"trouble.nvim": { "branch": "main", "commit": "bd67efe408d4816e25e8491cc5ad4088e708a69a" },
|
||||
"tsc.nvim": { "branch": "main", "commit": "e083bcf1e54bc3af7df92b33235efb334e8c782c" },
|
||||
"typescript-tools.nvim": { "branch": "master", "commit": "c2f5910074103705661e9651aa841e0d7eea9932" },
|
||||
"vim-illuminate": { "branch": "master", "commit": "19cb21f513fc2b02f0c66be70107741e837516a1" },
|
||||
"vim-repeat": { "branch": "master", "commit": "65846025c15494983dafe5e3b46c8f88ab2e9635" },
|
||||
"which-key.nvim": { "branch": "main", "commit": "fcbf4eea17cb299c02557d576f0d568878e354a4" }
|
||||
}
|
||||
+7
-11
@@ -6,26 +6,22 @@
|
||||
return {
|
||||
"AstroNvim/astrocommunity",
|
||||
version = false, -- Use latest astrocommunity
|
||||
{ import = "astrocommunity.pack.astro" },
|
||||
{ import = "astrocommunity.pack.bash" },
|
||||
{ import = "astrocommunity.pack.biome" },
|
||||
{ import = "astrocommunity.pack.chezmoi" },
|
||||
{ import = "astrocommunity.pack.lua" },
|
||||
{ import = "astrocommunity.pack.markdown" },
|
||||
{ import = "astrocommunity.pack.json" },
|
||||
{ import = "astrocommunity.pack.mdx" },
|
||||
{ import = "astrocommunity.pack.json" },
|
||||
{ import = "astrocommunity.pack.chezmoi" },
|
||||
{ import = "astrocommunity.pack.go" },
|
||||
{ import = "astrocommunity.pack.golangci-lint" },
|
||||
{ import = "astrocommunity.pack.html-css" },
|
||||
{ import = "astrocommunity.pack.templ" },
|
||||
{ import = "astrocommunity.pack.tailwindcss" },
|
||||
{ import = "astrocommunity.pack.typescript-all-in-one" },
|
||||
{ import = "astrocommunity.pack.toml" },
|
||||
{ import = "astrocommunity.pack.typescript" },
|
||||
{ import = "astrocommunity.pack.yaml" },
|
||||
{ import = "astrocommunity.git.octo-nvim" },
|
||||
{ import = "astrocommunity.icon.mini-icons" },
|
||||
{ import = "astrocommunity.bars-and-lines.bufferline-nvim" },
|
||||
{ import = "astrocommunity.code-runner.overseer-nvim" },
|
||||
{ import = "astrocommunity.colorscheme.cyberdream-nvim" },
|
||||
{ import = "astrocommunity.completion.supermaven-nvim" },
|
||||
{ import = "astrocommunity.completion.blink-cmp" },
|
||||
{ import = "astrocommunity.colorscheme.cyberdream-nvim" },
|
||||
{ import = "astrocommunity.editing-support.auto-save-nvim" },
|
||||
{ import = "astrocommunity.editing-support.conform-nvim" },
|
||||
{ import = "astrocommunity.lsp.inc-rename-nvim" },
|
||||
|
||||
@@ -0,0 +1,251 @@
|
||||
--- Shared ignore patterns for file explorers and pickers
|
||||
--- This module provides a centralized list of patterns to ignore across
|
||||
--- neotree, telescope, snacks.picker, and other file browsing tools.
|
||||
--- @module config.ignore_patterns
|
||||
|
||||
local M = {}
|
||||
|
||||
--- Core ignore patterns used across the configuration
|
||||
--- These patterns use glob syntax (* for wildcards)
|
||||
M.patterns = {
|
||||
-- Build artifacts and generated files
|
||||
"chain_*.json",
|
||||
".gitignore",
|
||||
"turbo.json",
|
||||
"vite.config.ts",
|
||||
"bunfig.toml",
|
||||
"*.pb.go",
|
||||
"*.pkl.go",
|
||||
"*.pulsar.go",
|
||||
"*.pb.gorm.go",
|
||||
"*.pb.gw.go",
|
||||
"*_templ.go",
|
||||
"*_mock.go",
|
||||
"*_integration.go",
|
||||
"*_test.go",
|
||||
|
||||
-- Configuration files
|
||||
".editorconfig",
|
||||
".gitpod.*",
|
||||
|
||||
|
||||
|
||||
-- Lock files and dependencies
|
||||
"*.lock",
|
||||
"*.lockb",
|
||||
"*.sum",
|
||||
"*.work.*",
|
||||
"package-lock.json",
|
||||
"pnpm-lock.yaml",
|
||||
".gitattributes",
|
||||
".oxlintrc.json",
|
||||
"tsconfig*",
|
||||
|
||||
-- Temporary and cache files
|
||||
"*.tmp",
|
||||
".typecopy",
|
||||
".python-version",
|
||||
".prettierrc",
|
||||
".trunk",
|
||||
".config",
|
||||
".pkl-lsp",
|
||||
".tsbuildinfo",
|
||||
".wrangler",
|
||||
".parcel-cache",
|
||||
".conform*",
|
||||
".null-ls_*",
|
||||
|
||||
-- Binary and media files
|
||||
"*.wasm",
|
||||
"*.png",
|
||||
"*.jpg",
|
||||
"*.icns",
|
||||
"*.ico",
|
||||
|
||||
-- Directories and special files
|
||||
"contrib",
|
||||
"interchaintest",
|
||||
"PULL_REQUEST_TEMPLATE.md",
|
||||
"Icon?",
|
||||
"iCloud~",
|
||||
"com~",
|
||||
}
|
||||
|
||||
--- Patterns that should never be shown in any file browser
|
||||
M.never_show = {
|
||||
-- Version control
|
||||
".git",
|
||||
".ai",
|
||||
|
||||
-- Dependencies
|
||||
"node_modules",
|
||||
".wrangler",
|
||||
"CODEOWNERS",
|
||||
".golangci.yml",
|
||||
|
||||
-- Build outputs
|
||||
".next",
|
||||
".parcel-cache",
|
||||
|
||||
-- Task runners and tools
|
||||
".task",
|
||||
".devbox",
|
||||
".turbo",
|
||||
".jj",
|
||||
".spawn",
|
||||
|
||||
-- IDE and editor
|
||||
".idea",
|
||||
".venv",
|
||||
".metadata",
|
||||
".dart_tool",
|
||||
".devcontainer",
|
||||
|
||||
-- Build tools
|
||||
".gradle",
|
||||
"gradle.bat",
|
||||
"heighliner",
|
||||
|
||||
-- Temporary
|
||||
".tmp",
|
||||
"tmp",
|
||||
|
||||
-- Logs
|
||||
"sonr.log",
|
||||
"junit.xml",
|
||||
|
||||
-- macOS
|
||||
".DS_Store",
|
||||
".DocumentRevisions-V100",
|
||||
".Spotlight-V100",
|
||||
".TemporaryItems",
|
||||
".Trashes",
|
||||
".fseventsd",
|
||||
".timemachine",
|
||||
|
||||
-- Templates
|
||||
"DISCUSSION_TEMPLATE",
|
||||
"ISSUE_TEMPLATE",
|
||||
|
||||
-- License
|
||||
"LICENSE",
|
||||
}
|
||||
|
||||
--- Patterns that should never be shown (pattern matching)
|
||||
M.never_show_patterns = {
|
||||
"*DS_Store",
|
||||
".obsidian",
|
||||
".pkl-lsp",
|
||||
".tsbuildinfo",
|
||||
"package-lock.json",
|
||||
".prettierrc",
|
||||
"node_modules",
|
||||
".DocumentRevisions-V100",
|
||||
".Spotlight-V100",
|
||||
".TemporaryItems",
|
||||
".Trashes",
|
||||
".fseventsd",
|
||||
".editorconfig",
|
||||
"*.min.js",
|
||||
"*.lock",
|
||||
"*lock*",
|
||||
"*.lockb",
|
||||
"*.pulsar.go",
|
||||
"*.pb.gorm.go",
|
||||
"*.pb.gw.go",
|
||||
"*_templ.go",
|
||||
"*.tmp",
|
||||
"*.work.*",
|
||||
"*.sum",
|
||||
".parcel-cache",
|
||||
"*.icns",
|
||||
"*.ico",
|
||||
"*.iml",
|
||||
"Icon?",
|
||||
"iCloud~",
|
||||
"com~",
|
||||
"*.icns",
|
||||
".conform*",
|
||||
".null-ls_*",
|
||||
}
|
||||
|
||||
--- Directories to ignore when filtering files
|
||||
M.ignored_directories = {
|
||||
"contracts",
|
||||
"crypto",
|
||||
"api",
|
||||
"chains",
|
||||
"test",
|
||||
"examples",
|
||||
"scripts",
|
||||
"bridge",
|
||||
"client",
|
||||
"translations",
|
||||
"env",
|
||||
".husky",
|
||||
}
|
||||
|
||||
--- Read additional ignore patterns from .rgignore file in git root
|
||||
--- @return table patterns List of patterns from .rgignore
|
||||
function M.read_rgignore()
|
||||
local patterns = {}
|
||||
local current_file = vim.fn.expand "%:p"
|
||||
local current_dir = vim.fn.fnamemodify(current_file, ":h")
|
||||
|
||||
if current_dir == "" then current_dir = vim.fn.getcwd() end
|
||||
|
||||
local git_root =
|
||||
vim.fn.systemlist("cd " .. vim.fn.shellescape(current_dir) .. " && git rev-parse --show-toplevel 2>/dev/null")[1]
|
||||
|
||||
if git_root and git_root ~= "" and not git_root:match "^fatal:" then
|
||||
local rgignore_path = git_root .. "/.rgignore"
|
||||
local file = io.open(rgignore_path, "r")
|
||||
|
||||
if file then
|
||||
for line in file:lines() do
|
||||
if line ~= "" and not line:match "^#" then
|
||||
line = line:gsub("^%./", "")
|
||||
table.insert(patterns, line)
|
||||
end
|
||||
end
|
||||
file:close()
|
||||
end
|
||||
end
|
||||
|
||||
return patterns
|
||||
end
|
||||
|
||||
--- Get all hide patterns including rgignore
|
||||
--- @return table patterns Combined list of all patterns to hide
|
||||
function M.get_all_patterns()
|
||||
local rgignore_patterns = M.read_rgignore()
|
||||
return vim.list_extend(vim.list_extend({}, M.patterns), rgignore_patterns)
|
||||
end
|
||||
|
||||
--- Create a file filter function for pickers
|
||||
--- @return function filter Function that filters files based on ignore patterns
|
||||
function M.create_picker_filter()
|
||||
return function(item)
|
||||
if not item or not item.file then return item end
|
||||
|
||||
local file = item.file
|
||||
local basename = vim.fn.fnamemodify(file, ":t")
|
||||
local dir = vim.fn.fnamemodify(file, ":h:t")
|
||||
|
||||
-- Check against all patterns
|
||||
local all_patterns = M.get_all_patterns()
|
||||
for _, pattern in ipairs(all_patterns) do
|
||||
local lua_pattern = pattern:gsub("%.", "%%."):gsub("%*", ".*"):gsub("%?", ".")
|
||||
if basename:match("^" .. lua_pattern .. "$") or file:match(lua_pattern) then return nil end
|
||||
end
|
||||
|
||||
-- Check ignored directories
|
||||
for _, ignored in ipairs(M.ignored_directories) do
|
||||
if dir == ignored or file:match("/" .. ignored .. "/") then return nil end
|
||||
end
|
||||
|
||||
return item
|
||||
end
|
||||
end
|
||||
|
||||
return M
|
||||
@@ -0,0 +1,176 @@
|
||||
--- Terminal configurations using toggleterm
|
||||
--- This module provides terminal toggle functions for various CLI tools
|
||||
--- @module config.terminals
|
||||
|
||||
local M = {}
|
||||
|
||||
--- Check if toggleterm is available
|
||||
--- @return boolean available Whether toggleterm is loaded
|
||||
local function is_toggleterm_available()
|
||||
local ok, _ = pcall(require, "toggleterm.terminal")
|
||||
return ok
|
||||
end
|
||||
|
||||
--- Initialize all terminal configurations
|
||||
--- Only runs if toggleterm is available
|
||||
function M.setup()
|
||||
if not is_toggleterm_available() then
|
||||
vim.notify("toggleterm not available, skipping terminal setup", vim.log.levels.WARN)
|
||||
return
|
||||
end
|
||||
|
||||
local Terminal = require("toggleterm.terminal").Terminal
|
||||
-- Scooter find and replace terminal
|
||||
local smartCommit = Terminal:new {
|
||||
cmd = "smartcommit",
|
||||
hidden = true,
|
||||
direction = "vertical",
|
||||
close_on_exit = true,
|
||||
on_open = function(term)
|
||||
vim.cmd "startinsert!"
|
||||
vim.api.nvim_buf_set_keymap(term.bufnr, "n", "q", "<cmd>close<CR>", { noremap = true, silent = true })
|
||||
end,
|
||||
}
|
||||
|
||||
-- Scooter find and replace terminal
|
||||
local scooter = Terminal:new {
|
||||
cmd = "scooter",
|
||||
hidden = true,
|
||||
direction = "vertical",
|
||||
close_on_exit = true,
|
||||
on_open = function(term)
|
||||
vim.cmd "startinsert!"
|
||||
vim.api.nvim_buf_set_keymap(term.bufnr, "n", "q", "<cmd>close<CR>", { noremap = true, silent = true })
|
||||
end,
|
||||
}
|
||||
|
||||
-- Mk (make) terminal
|
||||
local mk = Terminal:new {
|
||||
cmd = "task",
|
||||
hidden = true,
|
||||
direction = "horizontal",
|
||||
on_open = function(term)
|
||||
vim.cmd "startinsert!"
|
||||
vim.api.nvim_buf_set_keymap(term.bufnr, "n", "q", "<cmd>close<CR>", { noremap = true, silent = true })
|
||||
end,
|
||||
}
|
||||
|
||||
-- Mk (make) terminal
|
||||
local lazygit = Terminal:new {
|
||||
cmd = "lazygit",
|
||||
hidden = true,
|
||||
direction = "float",
|
||||
on_open = function(term)
|
||||
vim.cmd "startinsert!"
|
||||
vim.api.nvim_buf_set_keymap(term.bufnr, "n", "q", "<cmd>close<CR>", { noremap = true, silent = true })
|
||||
end,
|
||||
}
|
||||
-- Mk (make) terminal
|
||||
local lazydocker = Terminal:new {
|
||||
cmd = "lazydocker",
|
||||
hidden = true,
|
||||
direction = "float",
|
||||
on_open = function(term)
|
||||
vim.cmd "startinsert!"
|
||||
vim.api.nvim_buf_set_keymap(term.bufnr, "n", "q", "<cmd>close<CR>", { noremap = true, silent = true })
|
||||
end,
|
||||
}
|
||||
|
||||
-- Opencode Terminal Tab
|
||||
|
||||
-- Opencode Terminal Tab (persistent)
|
||||
local opencode = Terminal:new {
|
||||
cmd = "opencode",
|
||||
hidden = true,
|
||||
direction = "tab",
|
||||
close_on_exit = false,
|
||||
count = 99, -- fixed ID so toggleterm never creates a duplicate
|
||||
on_open = function(term)
|
||||
vim.cmd "startinsert!"
|
||||
vim.api.nvim_buf_set_keymap(term.bufnr, "n", "q", "<cmd>tabprevious<CR>", { noremap = true, silent = true })
|
||||
vim.api.nvim_buf_set_keymap(
|
||||
term.bufnr,
|
||||
"t",
|
||||
"<C-a><C-a>",
|
||||
"<cmd>tabprevious<CR>",
|
||||
{ noremap = true, silent = true }
|
||||
)
|
||||
vim.api.nvim_buf_set_keymap(term.bufnr, "t", "<C-p>", "", {
|
||||
noremap = true,
|
||||
silent = true,
|
||||
callback = function()
|
||||
vim.fn.chansend(term.job_id, "\x10") -- raw Ctrl-P
|
||||
end,
|
||||
})
|
||||
|
||||
vim.api.nvim_buf_set_keymap(term.bufnr, "t", "<C-j>", "", {
|
||||
noremap = true,
|
||||
silent = true,
|
||||
callback = function()
|
||||
vim.fn.chansend(term.job_id, "\x0a") -- Ctrl+J / LF — always works in opencode
|
||||
end,
|
||||
})
|
||||
vim.api.nvim_buf_set_keymap(
|
||||
term.bufnr,
|
||||
"n",
|
||||
"<C-a><C-a>",
|
||||
"<cmd>tabprevious<CR>",
|
||||
{ noremap = true, silent = true }
|
||||
)
|
||||
vim.api.nvim_buf_set_keymap(term.bufnr, "t", "<C-o>", "<cmd>tabprevious<CR>", { noremap = true, silent = true })
|
||||
vim.api.nvim_buf_set_keymap(term.bufnr, "n", "<C-o>", "<cmd>tabprevious<CR>", { noremap = true, silent = true })
|
||||
vim.api.nvim_buf_set_keymap(term.bufnr, "t", "<C-c>", "", {
|
||||
noremap = true,
|
||||
silent = true,
|
||||
callback = function()
|
||||
term:shutdown()
|
||||
vim.cmd "tabprevious"
|
||||
end,
|
||||
})
|
||||
vim.api.nvim_buf_set_keymap(term.bufnr, "n", "<C-c>", "", {
|
||||
noremap = true,
|
||||
silent = true,
|
||||
callback = function()
|
||||
term:shutdown()
|
||||
vim.cmd "tabprevious"
|
||||
end,
|
||||
})
|
||||
end,
|
||||
}
|
||||
-- Scratch terminal
|
||||
local scratch = Terminal:new {
|
||||
cmd = "zsh",
|
||||
hidden = true,
|
||||
direction = "horizontal",
|
||||
on_open = function(term)
|
||||
vim.cmd "startinsert!"
|
||||
vim.api.nvim_buf_set_keymap(term.bufnr, "n", "q", "<cmd>close<CR>", { noremap = true, silent = true })
|
||||
end,
|
||||
}
|
||||
-- Export toggle functions to module instead of global namespace
|
||||
M.scooter_toggle = function() scooter:toggle() end
|
||||
M.mk_toggle = function() mk:toggle() end
|
||||
M.lazygit_toggle = function() lazygit:toggle() end
|
||||
M.lazydocker_toggle = function() lazydocker:toggle() end
|
||||
M.smartCommit_toggle = function() smartCommit:toggle() end
|
||||
M.scratch_toggle = function() scratch:toggle() end
|
||||
M.opencode_toggle = function()
|
||||
if not opencode:is_open() then
|
||||
opencode:open()
|
||||
elseif opencode:is_focused() then
|
||||
vim.cmd "tabprevious"
|
||||
else
|
||||
-- Find and switch to the opencode tab
|
||||
local bufnr = opencode.bufnr
|
||||
for _, win in ipairs(vim.api.nvim_list_wins()) do
|
||||
if vim.api.nvim_win_get_buf(win) == bufnr then
|
||||
vim.api.nvim_set_current_win(win)
|
||||
vim.cmd "startinsert!"
|
||||
return
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return M
|
||||
+10
-1
@@ -11,9 +11,18 @@ require("lazy").setup({
|
||||
},
|
||||
},
|
||||
{ import = "community" },
|
||||
{
|
||||
"MunsMan/kitty-navigator.nvim",
|
||||
keys = {
|
||||
{ "<C-h>", function() require("kitty-navigator").navigateLeft() end, desc = "Move left a Split", mode = { "n" } },
|
||||
{ "<C-j>", function() require("kitty-navigator").navigateDown() end, desc = "Move down a Split", mode = { "n" } },
|
||||
{ "<C-k>", function() require("kitty-navigator").navigateUp() end, desc = "Move up a Split", mode = { "n" } },
|
||||
{ "<C-l>", function() require("kitty-navigator").navigateRight() end, desc = "Move right a Split", mode = { "n" } },
|
||||
},
|
||||
},
|
||||
{ import = "plugins" },
|
||||
} --[[@as LazySpec]], {
|
||||
install = { colorscheme = { "astrotheme" } },
|
||||
install = { colorscheme = { "cyberdream" } },
|
||||
ui = { backdrop = 100 },
|
||||
performance = {
|
||||
rtp = {
|
||||
|
||||
+324
-487
@@ -1,203 +1,76 @@
|
||||
local Terminal = require("toggleterm.terminal").Terminal
|
||||
--- AstroCore configuration
|
||||
--- Core settings, keymappings, and autocmds for AstroNvim
|
||||
--- @module plugins.astrocore
|
||||
|
||||
-- Track closed buffers
|
||||
local closed_buffers = {}
|
||||
-- Import shared modules
|
||||
local ignore_patterns = require "config.ignore_patterns"
|
||||
local terminals = require "config.terminals"
|
||||
|
||||
-- Shared ignore patterns from neotree configuration
|
||||
local ignore_patterns = {
|
||||
-- Hidden patterns
|
||||
"chain_*.json",
|
||||
".typecopy",
|
||||
".python-version",
|
||||
"*.pb.go",
|
||||
"*config.*.js",
|
||||
"*config.js",
|
||||
"deps.mjs",
|
||||
".parcelrc",
|
||||
"worker-configuration.d.ts",
|
||||
"wrangler.jsonc",
|
||||
"*.pkl.go",
|
||||
".trunk",
|
||||
".config",
|
||||
".cz.toml",
|
||||
"*_integration.go",
|
||||
"*_test.go",
|
||||
"*_query_docs.md",
|
||||
"*_tx_docs.md",
|
||||
"*_mock.go",
|
||||
"biome*",
|
||||
-- Never show patterns
|
||||
"CLAUDE*",
|
||||
".pkl-lsp",
|
||||
".tsbuildinfo",
|
||||
"contrib",
|
||||
"interchaintest",
|
||||
"package-lock.json",
|
||||
".prettierrc",
|
||||
"node_modules",
|
||||
"PULL_REQUEST_TEMPLATE.md",
|
||||
".DocumentRevisions-V100",
|
||||
".Spotlight-V100",
|
||||
".TemporaryItems",
|
||||
".Trashes",
|
||||
".fseventsd",
|
||||
".editorconfig",
|
||||
"*.min.js",
|
||||
".gitpod.*",
|
||||
"cspell.*",
|
||||
"*.lock",
|
||||
"*.lockb",
|
||||
"*.pulsar.go",
|
||||
"*.pb.gorm.go",
|
||||
"*.pb.gw.go",
|
||||
"*_templ.go",
|
||||
"*.tmp",
|
||||
"*.work.*",
|
||||
"*.sum",
|
||||
".wrangler",
|
||||
"*.wasm",
|
||||
"*.png",
|
||||
"*.jpg",
|
||||
".parcel-cache",
|
||||
"*.icns",
|
||||
"*.ico",
|
||||
".aider.tags.cache.v4",
|
||||
"*.iml",
|
||||
"Icon?",
|
||||
"iCloud~",
|
||||
"com~",
|
||||
"readme.md",
|
||||
".conform*",
|
||||
".null-ls_*",
|
||||
-- Additional never show items
|
||||
".git",
|
||||
"pnpm-lock.yaml",
|
||||
".next",
|
||||
".task",
|
||||
".devbox",
|
||||
".dart_tool",
|
||||
".idea",
|
||||
".metadata",
|
||||
".venv",
|
||||
".gradle",
|
||||
"gradle.bat",
|
||||
".aider.chat.history.md",
|
||||
".aider.input.history",
|
||||
".aider.tags.cache.v3",
|
||||
".devcontainer",
|
||||
"heighliner",
|
||||
".tmp",
|
||||
"go.work.sum",
|
||||
".DS_Store",
|
||||
"LICENSE",
|
||||
"tmp",
|
||||
"sonr.log",
|
||||
"DISCUSSION_TEMPLATE",
|
||||
"ISSUE_TEMPLATE",
|
||||
".timemachine",
|
||||
"junit.xml",
|
||||
".jj",
|
||||
".spawn",
|
||||
".turbo",
|
||||
}
|
||||
-- Initialize terminals
|
||||
terminals.setup()
|
||||
|
||||
-- Create a custom transform function to filter out ignored files
|
||||
local function create_file_filter()
|
||||
return function(item)
|
||||
if not item or not item.file then return item end
|
||||
|
||||
local file = item.file
|
||||
local basename = vim.fn.fnamemodify(file, ":t")
|
||||
local dir = vim.fn.fnamemodify(file, ":h:t")
|
||||
|
||||
-- Check each ignore pattern
|
||||
for _, pattern in ipairs(ignore_patterns) do
|
||||
-- Convert glob pattern to Lua pattern
|
||||
local lua_pattern = pattern:gsub("%.", "%%."):gsub("%*", ".*"):gsub("%?", ".")
|
||||
|
||||
-- Check if the pattern matches the basename or path
|
||||
if basename:match("^" .. lua_pattern .. "$") or file:match(lua_pattern) then
|
||||
return nil -- Filter out this item
|
||||
end
|
||||
end
|
||||
|
||||
-- Also filter out specific directory names
|
||||
local ignored_dirs = {
|
||||
"contracts",
|
||||
"crypto",
|
||||
"api",
|
||||
"chains",
|
||||
"test",
|
||||
"examples",
|
||||
"scripts",
|
||||
"bridge",
|
||||
"client",
|
||||
"translations",
|
||||
"env",
|
||||
".husky",
|
||||
}
|
||||
|
||||
for _, ignored in ipairs(ignored_dirs) do
|
||||
if dir == ignored or file:match("/" .. ignored .. "/") then return nil end
|
||||
end
|
||||
|
||||
return item
|
||||
end
|
||||
end
|
||||
|
||||
local file_filter = create_file_filter()
|
||||
|
||||
local yazi = Terminal:new {
|
||||
cmd = "yazi",
|
||||
hidden = true,
|
||||
direction = "tab",
|
||||
close_on_exit = true, -- function to run on opening the terminal
|
||||
on_open = function(term)
|
||||
vim.cmd "startinsert!"
|
||||
vim.api.nvim_buf_set_keymap(term.bufnr, "n", "q", "<cmd>close<CR>", { noremap = true, silent = true })
|
||||
end,
|
||||
}
|
||||
|
||||
local scooter = Terminal:new {
|
||||
cmd = "scooter",
|
||||
hidden = true,
|
||||
direction = "vertical", -- function to run on opening the terminal
|
||||
on_open = function(term)
|
||||
vim.cmd "startinsert!"
|
||||
vim.api.nvim_buf_set_keymap(term.bufnr, "n", "q", "<cmd>close<CR>", { noremap = true, silent = true })
|
||||
end,
|
||||
}
|
||||
|
||||
local lazyjournal = Terminal:new {
|
||||
cmd = "lazyjournal",
|
||||
hidden = true,
|
||||
direction = "float", -- function to run on opening the terminal
|
||||
on_open = function(term)
|
||||
vim.cmd "startinsert!"
|
||||
vim.api.nvim_buf_set_keymap(term.bufnr, "n", "q", "<cmd>close<CR>", { noremap = true, silent = true })
|
||||
end,
|
||||
}
|
||||
|
||||
local mk = Terminal:new {
|
||||
cmd = "mk",
|
||||
hidden = true,
|
||||
direction = "vertical", -- function to run on opening the terminal
|
||||
on_open = function(term)
|
||||
vim.cmd "startinsert!"
|
||||
vim.api.nvim_buf_set_keymap(term.bufnr, "n", "q", "<cmd>close<CR>", { noremap = true, silent = true })
|
||||
end,
|
||||
}
|
||||
|
||||
-- Toggle Functions (global so they can be used in other files)
|
||||
function _G.Lazyjournal_toggle() lazyjournal:toggle() end
|
||||
function _G.Mk_toggle() mk:toggle() end
|
||||
function _G.Scooter_toggle() scooter:toggle() end
|
||||
function _G.Yazi_toggle() yazi:toggle() end
|
||||
-- Get file filter for pickers
|
||||
local file_filter = ignore_patterns.create_picker_filter()
|
||||
|
||||
return {
|
||||
"AstroNvim/astrocore",
|
||||
---@type AstroCoreOpts
|
||||
opts = {
|
||||
|
||||
sessions = {
|
||||
-- Configure auto saving
|
||||
autosave = {
|
||||
last = true, -- auto save last session
|
||||
cwd = true, -- auto save session for each working directory
|
||||
},
|
||||
-- Patterns to ignore when saving sessions
|
||||
ignore = {
|
||||
dirs = {}, -- working directories to ignore sessions in
|
||||
filetypes = { "gitcommit", "gitrebase" }, -- filetypes to ignore sessions
|
||||
buftypes = {}, -- buffer types to ignore sessions
|
||||
},
|
||||
-- Store pinned buffers in session data
|
||||
before_save = function()
|
||||
local pinned = {}
|
||||
for _, buf in ipairs(vim.api.nvim_list_bufs()) do
|
||||
if vim.api.nvim_buf_is_valid(buf) and vim.api.nvim_buf_get_option(buf, "buflisted") then
|
||||
local bufname = vim.api.nvim_buf_get_name(buf)
|
||||
if bufname ~= "" then
|
||||
-- Check if buffer is pinned using BufferLine's API
|
||||
local ok, bufferline = pcall(require, "bufferline")
|
||||
if ok and bufferline.get_elements then
|
||||
local elements = bufferline.get_elements()
|
||||
for _, element in ipairs(elements) do
|
||||
if element.id == buf and element.pinned then
|
||||
table.insert(pinned, bufname)
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
vim.g.session_pinned_buffers = pinned
|
||||
end,
|
||||
-- Restore pinned buffers after session load
|
||||
after_load = function()
|
||||
if vim.g.session_pinned_buffers then
|
||||
vim.defer_fn(function()
|
||||
for _, bufname in ipairs(vim.g.session_pinned_buffers) do
|
||||
-- Find the buffer by name
|
||||
for _, buf in ipairs(vim.api.nvim_list_bufs()) do
|
||||
if vim.api.nvim_buf_is_valid(buf) and vim.api.nvim_buf_get_name(buf) == bufname then
|
||||
-- Pin the buffer using BufferLine command
|
||||
vim.cmd("BufferLineTogglePin " .. buf)
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
vim.g.session_pinned_buffers = nil
|
||||
end, 100)
|
||||
end
|
||||
end,
|
||||
},
|
||||
rooter = {
|
||||
-- list of detectors in order of prevalence, elements can be:
|
||||
-- "lsp" : lsp detection
|
||||
@@ -207,7 +80,6 @@ return {
|
||||
"lsp", -- highest priority is getting workspace from running language servers
|
||||
{ ".git", "_darcs", ".hg", ".bzr", ".svn" }, -- next check for a version controlled parent directory
|
||||
{
|
||||
"go.work",
|
||||
"package.json",
|
||||
"lua",
|
||||
"Cargo.toml",
|
||||
@@ -217,13 +89,15 @@ return {
|
||||
},
|
||||
-- ignore things from root detection
|
||||
ignore = {
|
||||
servers = {}, -- list of language server names to ignore (Ex. { "efm" })
|
||||
servers = {
|
||||
"golangci_lint_ls",
|
||||
}, -- list of language server names to ignore (Ex. { "efm" })
|
||||
dirs = {}, -- list of directory patterns (Ex. { "~/.cargo/*" })
|
||||
},
|
||||
-- automatically update working directory (update manually with `:AstroRoot`)
|
||||
autochdir = true,
|
||||
-- scope of working directory to change ("global"|"tab"|"win")
|
||||
scope = "win", -- Changed from "win" to "global" to make directory changes apply globally
|
||||
scope = "global", -- Changed from "win" to "global" to make directory changes apply globally
|
||||
-- show notification on every working directory change
|
||||
notify = false,
|
||||
},
|
||||
@@ -238,9 +112,66 @@ return {
|
||||
|
||||
-- Diagnostics configuration (for vim.diagnostics.config({...})) when diagnostics are on
|
||||
diagnostics = {
|
||||
virtual_text = false,
|
||||
virtual_text = true,
|
||||
underline = true,
|
||||
},
|
||||
|
||||
-- Autocmds can be configured here
|
||||
autocmds = {
|
||||
-- Custom title formatting for ghq repos
|
||||
custom_title = {
|
||||
{
|
||||
event = { "BufEnter", "DirChanged" },
|
||||
desc = "Update terminal title with org/repo format",
|
||||
callback = function()
|
||||
local filepath = vim.fn.expand "%:p"
|
||||
local filename = vim.fn.expand "%:t"
|
||||
|
||||
-- If no file is open, try to show just the repo name
|
||||
if filename == "" then
|
||||
local cwd = vim.fn.getcwd()
|
||||
local github_match = cwd:match "github%.com/([^/]+/[^/]+)"
|
||||
if github_match then
|
||||
vim.opt.titlestring = github_match
|
||||
else
|
||||
vim.opt.titlestring = "Nvim"
|
||||
end
|
||||
return
|
||||
end
|
||||
|
||||
-- Check if path contains github.com (ghq structure)
|
||||
local github_match = filepath:match "github%.com/([^/]+/[^/]+)"
|
||||
|
||||
if github_match then
|
||||
-- Format: filename | org/repo
|
||||
vim.opt.titlestring = string.format("%s | %s", filename, github_match)
|
||||
else
|
||||
-- Fallback: filename | Nvim
|
||||
vim.opt.titlestring = string.format("%s | Nvim", filename)
|
||||
end
|
||||
end,
|
||||
},
|
||||
},
|
||||
-- Show smart picker on startup
|
||||
startup_picker = {
|
||||
{
|
||||
event = "VimEnter",
|
||||
desc = "Show smart picker on startup",
|
||||
callback = function()
|
||||
-- Skip if opening with arguments
|
||||
if vim.fn.argc() > 0 then return end
|
||||
|
||||
-- Skip if current buffer has content
|
||||
local lines = vim.api.nvim_buf_get_lines(0, 0, -1, false)
|
||||
if #lines > 1 or (#lines == 1 and lines[1] ~= "") then return end
|
||||
|
||||
-- Delay to ensure everything is loaded
|
||||
vim.defer_fn(function() require("snacks").picker.smart() end, 50)
|
||||
end,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
-- vim options can be configured here
|
||||
options = {
|
||||
opt = { -- vim.opt.<key>
|
||||
@@ -249,6 +180,9 @@ return {
|
||||
spell = false, -- sets vim.opt.spell
|
||||
wrap = true, -- sets vim.opt.wrap
|
||||
clipboard = "unnamedplus", -- use system clipboard for all operations
|
||||
title = true, -- enable title string
|
||||
titlestring = "", -- will be set dynamically by autocommand
|
||||
laststatus = 0, -- disable statusline (0 = never show)
|
||||
},
|
||||
g = { -- vim.g.<key>
|
||||
-- configure global vim variables (vim.g)
|
||||
@@ -261,34 +195,22 @@ return {
|
||||
mappings = {
|
||||
-- first key is the mode
|
||||
n = {
|
||||
["<C-!>"] = { "<Cmd>suspend<CR>", desc = "Suspend nvim (return with 'fg')" },
|
||||
["<C-q>Q"] = { "<Cmd>wqa<CR>", desc = "Save all buffers and quit Neovim" },
|
||||
-- navigate buffer tabs
|
||||
["<C-c>"] = {
|
||||
function()
|
||||
-- Save the buffer path before closing
|
||||
local bufname = vim.api.nvim_buf_get_name(0)
|
||||
if bufname ~= "" then
|
||||
table.insert(closed_buffers, bufname)
|
||||
-- Keep only the last 10 closed buffers
|
||||
if #closed_buffers > 10 then table.remove(closed_buffers, 1) end
|
||||
end
|
||||
vim.cmd "wa"
|
||||
vim.cmd "bd"
|
||||
end,
|
||||
desc = "Save and close buffer",
|
||||
},
|
||||
["<C-c>"] = { "<Cmd>wa<CR><Cmd>bd<CR>", desc = "Save and close buffer" }, -- Added C-x to save and close buffer
|
||||
["F"] = { "za", desc = "Toggle fold under cursor" },
|
||||
["J"] = { function() vim.diagnostic.goto_next() end, desc = "Next diagnostic" },
|
||||
["K"] = { function() vim.diagnostic.goto_prev() end, desc = "Previous diagnostic" },
|
||||
["L"] = { "<Cmd>BufferLineCycleNext<CR>", desc = "Next buffer" },
|
||||
["H"] = { "<Cmd>BufferLineCyclePrev<CR>", desc = "Previous buffer" },
|
||||
["<C-e>"] = {
|
||||
function() require("snacks").explorer.reveal() end,
|
||||
desc = "Reveal file in Explorer",
|
||||
},
|
||||
-- Window navigation
|
||||
["<C-h>"] = { function() require("kitty-navigator").navigateLeft() end, desc = "Navigate to left window" },
|
||||
["<C-j>"] = { function() require("kitty-navigator").navigateDown() end, desc = "Navigate to bottom window" },
|
||||
["<C-k>"] = { function() require("kitty-navigator").navigateUp() end, desc = "Navigate to top window" },
|
||||
["<C-l>"] = { function() require("kitty-navigator").navigateRight() end, desc = "Navigate to right window" },
|
||||
["<C-e>"] = { "<Cmd>Neotree toggle<CR>", desc = "Open Explorer" },
|
||||
["<C-m>"] = { "<Cmd>OverseerRun<CR>", desc = "Run Overseer" },
|
||||
["<C-l>"] = { "<Cmd>b#<CR>", desc = "Return to last buffer" },
|
||||
["<leader>e"] = {
|
||||
function() require("snacks").explorer.reveal() end,
|
||||
desc = "Reveal file in Explorer",
|
||||
},
|
||||
["<leader><leader>"] = {
|
||||
function() require("snacks").picker.smart() end,
|
||||
desc = "Find files",
|
||||
@@ -298,7 +220,8 @@ return {
|
||||
function() require("snacks").picker.buffers() end,
|
||||
desc = "Find buffers",
|
||||
},
|
||||
["<C-b>c"] = {
|
||||
|
||||
["<C-b><C-c>"] = {
|
||||
function()
|
||||
local current_buffer = vim.api.nvim_get_current_buf()
|
||||
for _, buf in ipairs(vim.api.nvim_list_bufs()) do
|
||||
@@ -316,18 +239,6 @@ return {
|
||||
end,
|
||||
desc = "Toggle all buffer groups",
|
||||
},
|
||||
["<C-b>z"] = {
|
||||
function()
|
||||
if #closed_buffers > 0 then
|
||||
local last_closed = table.remove(closed_buffers)
|
||||
vim.cmd("e " .. vim.fn.fnameescape(last_closed))
|
||||
vim.notify("Reopened: " .. vim.fn.fnamemodify(last_closed, ":t"))
|
||||
else
|
||||
vim.notify("No recently closed buffer found", vim.log.levels.WARN)
|
||||
end
|
||||
end,
|
||||
desc = "Reopen last closed buffer",
|
||||
},
|
||||
-- Quick group toggles
|
||||
["<C-b>l"] = {
|
||||
function() require("snacks").picker.lines() end,
|
||||
@@ -340,7 +251,7 @@ return {
|
||||
["<C-b>t"] = { "<Cmd>BufferLineGroupToggle Tests<CR>", desc = "Toggle Tests group" },
|
||||
["<C-b>k"] = { "<Cmd>BufferLinePickClose<CR>", desc = "Pick buffer to close" },
|
||||
["<C-g>o"] = { "<cmd>!gh repo view --web<CR>", desc = "Open Repo on Web" },
|
||||
["<C-g>h"] = {
|
||||
["<C-g><C-d>"] = {
|
||||
function()
|
||||
require("snacks").terminal("gh dash", {
|
||||
hidden = true,
|
||||
@@ -348,77 +259,38 @@ return {
|
||||
interactive = true,
|
||||
})
|
||||
end,
|
||||
desc = "Dashboard",
|
||||
desc = "GH Dash",
|
||||
},
|
||||
["<C-g>g"] = {
|
||||
function()
|
||||
require("snacks").terminal("lazygit", {
|
||||
hidden = true,
|
||||
auto_close = true,
|
||||
interactive = true,
|
||||
})
|
||||
end,
|
||||
desc = "Lazygit",
|
||||
["<C-g><C-c>"] = {
|
||||
terminals.smartCommit_toggle,
|
||||
desc = "SmartCommit Toggle",
|
||||
},
|
||||
["<C-Tab>"] = { "<cmd>tabnext<CR>", desc = "Next Tab" },
|
||||
["<C-d><C-d>"] = {
|
||||
terminals.lazydocker_toggle,
|
||||
desc = "Lazydocker Toggle",
|
||||
},
|
||||
["<C-g><C-g>"] = {
|
||||
terminals.lazygit_toggle,
|
||||
desc = "Lazygit Toggle",
|
||||
},
|
||||
["<C-g><C-i>"] = { "<cmd>Octo issue list<CR>", desc = "List Issues" },
|
||||
["<C-g><C-l>"] = { "<cmd>Octo label<CR>", desc = "Manage Labels" },
|
||||
["<C-g><C-p>"] = { "<cmd>Octo pr list<CR>", desc = "List PRs" },
|
||||
["<C-g>s"] = { "<cmd>Octo search<CR>", desc = "Octo Search" },
|
||||
["<C-g><C-r>"] = { "<cmd>!gh release list<CR>", desc = "List Releases" },
|
||||
["<C-g>d"] = {
|
||||
function() require("snacks").picker.git_diff() end,
|
||||
desc = "Search git diffs",
|
||||
},
|
||||
["<C-g>b"] = {
|
||||
["<C-g><C-b>"] = {
|
||||
function() require("snacks").picker.git_branches() end,
|
||||
desc = "Search git branches",
|
||||
},
|
||||
["<C-t>d"] = {
|
||||
desc = "Devbox Services",
|
||||
},
|
||||
["<C-t>du"] = {
|
||||
function()
|
||||
require("snacks").terminal("devbox services up", {
|
||||
hidden = true,
|
||||
auto_close = true,
|
||||
start_in_insert = true,
|
||||
interactive = true,
|
||||
})
|
||||
end,
|
||||
desc = "Devbox Services Up",
|
||||
noremap = true,
|
||||
},
|
||||
["<C-t>dd"] = {
|
||||
function()
|
||||
require("snacks").terminal("devbox services down", {
|
||||
hidden = true,
|
||||
auto_close = true,
|
||||
start_in_insert = true,
|
||||
interactive = true,
|
||||
})
|
||||
end,
|
||||
desc = "Devbox Services Down",
|
||||
noremap = true,
|
||||
},
|
||||
["<C-t>da"] = {
|
||||
function()
|
||||
require("snacks").terminal("devbox services attach", {
|
||||
hidden = true,
|
||||
auto_close = false,
|
||||
start_in_insert = true,
|
||||
interactive = true,
|
||||
})
|
||||
end,
|
||||
desc = "Devbox Services Attach",
|
||||
noremap = true,
|
||||
},
|
||||
["<C-t>."] = { _G.Yazi_toggle, desc = "Yazi Toggle" },
|
||||
["<C-t>t"] = {
|
||||
function() require("snacks").terminal() end,
|
||||
desc = "Toggle Terminal",
|
||||
},
|
||||
["K"] = { function() vim.diagnostic.goto_prev() end, desc = "Previous Diagnostic" },
|
||||
["J"] = { function() vim.diagnostic.goto_next() end, desc = "Next Diagnostic" },
|
||||
["vv"] = { "gg0VG$", desc = "Select all contents in buffer" },
|
||||
["T"] = { "gg", desc = "Go to top of file" },
|
||||
|
||||
["<C-f>r"] = {
|
||||
_G.Scooter_toggle,
|
||||
terminals.scooter_toggle,
|
||||
desc = "Find and replace",
|
||||
},
|
||||
["<C-f>d"] = {
|
||||
@@ -427,7 +299,15 @@ return {
|
||||
},
|
||||
["<C-f>l"] = {
|
||||
function() require("snacks").picker.lines() end,
|
||||
desc = "Find diagnostics",
|
||||
desc = "Find in line",
|
||||
},
|
||||
["<C-f>t"] = {
|
||||
function() require("snacks").picker.lines() end,
|
||||
desc = "Find in line",
|
||||
},
|
||||
["<C-f>w"] = {
|
||||
function() require("snacks").picker.grep() end,
|
||||
desc = "Find word",
|
||||
},
|
||||
["<C-f>f"] = {
|
||||
function() require("snacks").picker.git_files { transform = file_filter } end,
|
||||
@@ -437,129 +317,24 @@ return {
|
||||
function() require("snacks").picker.recent() end,
|
||||
desc = "Find recent files",
|
||||
},
|
||||
["<C-o>"] = {
|
||||
function() require("snacks").picker.projects() end,
|
||||
desc = "Find projects",
|
||||
},
|
||||
["<C-f>gc"] = {
|
||||
function()
|
||||
local claude_dir = vim.fn.getcwd() .. "/.claude"
|
||||
local ai_dir = vim.fn.getcwd() .. "/.ai"
|
||||
-- Check if directory exists
|
||||
if vim.fn.isdirectory(claude_dir) == 0 then
|
||||
vim.notify("No .claude directory found in current project", vim.log.levels.WARN)
|
||||
if vim.fn.isdirectory(ai_dir) == 0 then
|
||||
vim.notify("No .ai directory found in current project", vim.log.levels.WARN)
|
||||
return
|
||||
end
|
||||
-- Use files picker to find Claude files
|
||||
-- Use files picker to find AI files
|
||||
require("snacks").picker.files {
|
||||
cwd = claude_dir,
|
||||
cwd = ai_dir,
|
||||
transform = file_filter,
|
||||
}
|
||||
end,
|
||||
desc = "Find Claude files",
|
||||
desc = "Find AI files",
|
||||
},
|
||||
["<C-f>go"] = { "<Cmd>ObsidianSearch<CR>", desc = "Find in Obsidian" },
|
||||
["<C-f>p"] = { desc = "Find Package files" },
|
||||
["<C-f>P"] = {
|
||||
function()
|
||||
require("snacks").picker.files {
|
||||
dirs = { "/home/prad/code/github.com/sonr-io/sonr/proto" },
|
||||
ft = { "proto" },
|
||||
}
|
||||
end,
|
||||
desc = "Find Proto files",
|
||||
},
|
||||
["<C-f>W"] = {
|
||||
function()
|
||||
require("snacks").picker.files {
|
||||
dirs = {
|
||||
"/home/prad/code/github.com/sonr-io/sonr/packages",
|
||||
"/home/prad/code/github.com/sonr-io/sonr/web",
|
||||
},
|
||||
exclude = { "packages/**/dist", "web/**/dist" },
|
||||
ft = { "ts", "tsx", "js", "html", "css", "json", "yaml" },
|
||||
}
|
||||
end,
|
||||
desc = "Find Web Dev files",
|
||||
},
|
||||
["<C-f>pp"] = {
|
||||
function()
|
||||
require("snacks").picker.files {
|
||||
dirs = { "/home/prad/code/github.com/sonr-io/sonr/packages/pkl" },
|
||||
exclude = { "packages/pkl/dist" },
|
||||
ft = { "ts", "tsx", "js" },
|
||||
}
|
||||
end,
|
||||
desc = "Find @sonr.io/es files",
|
||||
},
|
||||
["<C-f>ps"] = {
|
||||
function()
|
||||
require("snacks").picker.files {
|
||||
dirs = { "/home/prad/code/github.com/sonr-io/sonr/packages/sdk" },
|
||||
exclude = { "packages/sdk/dist" },
|
||||
ft = { "ts", "tsx", "js" },
|
||||
}
|
||||
end,
|
||||
desc = "Find @sonr.io/sdk files",
|
||||
},
|
||||
["<C-f>pu"] = {
|
||||
function()
|
||||
require("snacks").picker.files {
|
||||
dirs = { "/home/prad/code/github.com/sonr-io/sonr/packages/ui" },
|
||||
exclude = { "packages/ui/dist" },
|
||||
ft = { "ts", "tsx", "js" },
|
||||
}
|
||||
end,
|
||||
desc = "Find @sonr.io/ui files",
|
||||
},
|
||||
["<C-f>m"] = { desc = "Find Module files" },
|
||||
["<C-f>me"] = {
|
||||
function()
|
||||
require("snacks").picker.files {
|
||||
dirs = {
|
||||
"/home/prad/code/github.com/sonr-io/sonr/proto/dex",
|
||||
"/home/prad/code/github.com/sonr-io/sonr/x/dex",
|
||||
},
|
||||
ft = { "go", "md", "proto" },
|
||||
}
|
||||
end,
|
||||
desc = "Find x/dex files",
|
||||
},
|
||||
["<C-f>mi"] = {
|
||||
function()
|
||||
require("snacks").picker.files {
|
||||
dirs = {
|
||||
"/home/prad/code/github.com/sonr-io/sonr/proto/did",
|
||||
"/home/prad/code/github.com/sonr-io/sonr/x/did",
|
||||
},
|
||||
ft = { "go", "md", "proto" },
|
||||
}
|
||||
end,
|
||||
desc = "Find x/did files",
|
||||
},
|
||||
["<C-f>md"] = {
|
||||
function()
|
||||
require("snacks").picker.files {
|
||||
dirs = {
|
||||
"/home/prad/code/github.com/sonr-io/sonr/proto/dwn",
|
||||
"/home/prad/code/github.com/sonr-io/sonr/x/dwn",
|
||||
},
|
||||
ft = { "go", "md", "proto" },
|
||||
}
|
||||
end,
|
||||
desc = "Find x/dwn files",
|
||||
},
|
||||
["<C-f>ms"] = {
|
||||
function()
|
||||
require("snacks").picker.files {
|
||||
dirs = {
|
||||
"/home/prad/code/github.com/sonr-io/sonr/proto/svc",
|
||||
"/home/prad/code/github.com/sonr-io/sonr/x/svc",
|
||||
},
|
||||
ft = { "go", "md", "proto" },
|
||||
}
|
||||
end,
|
||||
desc = "Find x/svc files",
|
||||
},
|
||||
["<C-f>g"] = {
|
||||
desc = "Find by Group",
|
||||
},
|
||||
@@ -612,120 +387,182 @@ return {
|
||||
end,
|
||||
desc = "Find Package.json files",
|
||||
},
|
||||
["<C-f>."] = {
|
||||
["<C-p>"] = {
|
||||
function()
|
||||
require("snacks").picker.files {
|
||||
dirs = { "/home/prad/.local/share/chezmoi" },
|
||||
}
|
||||
-- Pass through to TUI if in opencode
|
||||
if vim.b.toggle_number == 99 then
|
||||
vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes("<C-p>", true, false, true), "t", false)
|
||||
return
|
||||
end
|
||||
-- Paste from clipboard in other terminals
|
||||
local content = vim.fn.getreg "+"
|
||||
vim.api.nvim_paste(content, true, -1)
|
||||
end,
|
||||
desc = "Find dotfiles",
|
||||
desc = "Paste from system clipboard",
|
||||
},
|
||||
["<C-,>c"] = {
|
||||
["<C-j><C-j>"] = { function() terminals.scratch_toggle() end, desc = "Open Scratch Terminal" },
|
||||
-- AI/Assistant mappings (Avante)
|
||||
["<C-a><C-a>"] = { terminals.opencode_toggle, desc = "Toggle OpenCode" },
|
||||
-- UI Toggles with Snacks
|
||||
["<leader>u"] = { desc = "UI Toggles" },
|
||||
["<leader>ud"] = {
|
||||
function() require("snacks").toggle.diagnostics():toggle() end,
|
||||
desc = "Toggle Diagnostics",
|
||||
},
|
||||
["<leader>un"] = {
|
||||
function() require("snacks").toggle.line_number():toggle() end,
|
||||
desc = "Toggle Line Numbers",
|
||||
},
|
||||
["<leader>ur"] = {
|
||||
function() require("snacks").toggle.option("relativenumber"):toggle() end,
|
||||
desc = "Toggle Relative Numbers",
|
||||
},
|
||||
["<leader>uw"] = {
|
||||
function() require("snacks").toggle.option("wrap"):toggle() end,
|
||||
desc = "Toggle Line Wrap",
|
||||
},
|
||||
["<leader>us"] = {
|
||||
function() require("snacks").toggle.option("spell"):toggle() end,
|
||||
desc = "Toggle Spelling",
|
||||
},
|
||||
["<leader>ui"] = {
|
||||
function() require("snacks").toggle.inlay_hints():toggle() end,
|
||||
desc = "Toggle Inlay Hints",
|
||||
},
|
||||
["<leader>ut"] = {
|
||||
function() require("snacks").toggle.treesitter():toggle() end,
|
||||
desc = "Toggle Treesitter",
|
||||
},
|
||||
["<leader>uc"] = {
|
||||
function() require("snacks").toggle.option("conceallevel", { off = 0, on = 2 }):toggle() end,
|
||||
desc = "Toggle Conceal",
|
||||
},
|
||||
["<leader>uI"] = {
|
||||
function() require("snacks").toggle.indent():toggle() end,
|
||||
desc = "Toggle Indent Guides",
|
||||
},
|
||||
["<leader>uz"] = {
|
||||
function() require("snacks").toggle.zen():toggle() end,
|
||||
desc = "Toggle Zen Mode",
|
||||
},
|
||||
["<leader>uZ"] = {
|
||||
function() require("snacks").toggle.zoom():toggle() end,
|
||||
desc = "Toggle Zoom",
|
||||
},
|
||||
["<leader>ua"] = {
|
||||
function() require("snacks").toggle.animate():toggle() end,
|
||||
desc = "Toggle Animations",
|
||||
},
|
||||
["<leader>uS"] = {
|
||||
function() require("snacks").toggle.scroll():toggle() end,
|
||||
desc = "Toggle Smooth Scroll",
|
||||
},
|
||||
["<leader>up"] = {
|
||||
function() require("snacks").toggle.profiler():toggle() end,
|
||||
desc = "Toggle Profiler",
|
||||
},
|
||||
["<leader>uh"] = {
|
||||
function() require("snacks").toggle.profiler_highlights():toggle() end,
|
||||
desc = "Toggle Profiler Highlights",
|
||||
},
|
||||
["<leader>ux"] = {
|
||||
function() require("snacks").toggle.dim():toggle() end,
|
||||
desc = "Toggle Dim Inactive",
|
||||
},
|
||||
["<leader>uf"] = {
|
||||
function()
|
||||
require("snacks").picker.files {
|
||||
dirs = { "/home/prad/.local/share/chezmoi/dot_config" },
|
||||
}
|
||||
vim.g.disable_autoformat = not vim.g.disable_autoformat
|
||||
local status = vim.g.disable_autoformat and "disabled" or "enabled"
|
||||
vim.notify("Format on save " .. status, vim.log.levels.INFO)
|
||||
end,
|
||||
desc = "Find chezmoi config files",
|
||||
desc = "Toggle Format on Save",
|
||||
},
|
||||
["<C-,>e"] = {
|
||||
["<leader>ul"] = {
|
||||
function()
|
||||
require("snacks").picker.files {
|
||||
dirs = { "/home/prad/.local/share/chezmoi/extensions" },
|
||||
}
|
||||
local new_value = not require("lsp_lines").toggle()
|
||||
vim.diagnostic.config { virtual_text = new_value }
|
||||
end,
|
||||
desc = "Find chezmoi extension files",
|
||||
desc = "Toggle LSP Lines",
|
||||
},
|
||||
["<C-,>l"] = {
|
||||
function()
|
||||
require("snacks").picker.files {
|
||||
dirs = { "/home/prad/.local/share/chezmoi/dot_local" },
|
||||
}
|
||||
end,
|
||||
desc = "Find chezmoi local files",
|
||||
},
|
||||
["<C-,>n"] = {
|
||||
function()
|
||||
require("snacks").picker.files {
|
||||
dirs = { "/home/prad/.local/share/chezmoi/dot_config/nvim" },
|
||||
}
|
||||
end,
|
||||
desc = "Find chezmoi neovim files",
|
||||
},
|
||||
["<C-a>a"] = { function() vim.lsp.buf.code_action() end, desc = "LSP Code Action" },
|
||||
["<C-a>h"] = { function() vim.lsp.buf.hover() end, desc = "LSP Hover" },
|
||||
["<C-a>d"] = {
|
||||
function() require("snacks").picker.lsp_definitions() end,
|
||||
desc = "Find LSP definitions",
|
||||
},
|
||||
["<C-a>r"] = {
|
||||
function() require("snacks").picker.lsp_references() end,
|
||||
desc = "Find LSP references",
|
||||
},
|
||||
["<C-a>s"] = {
|
||||
function() require("snacks").picker.lsp_symbols() end,
|
||||
desc = "Find LSP symbols",
|
||||
},
|
||||
-- Terminal launcher
|
||||
},
|
||||
i = {
|
||||
["<C-s>"] = { "<Cmd>wa<CR><Esc>", desc = "Save and return to normal mode" },
|
||||
["<C-c>"] = { "<Cmd>wa<CR><Cmd>bd<CR><Esc>", desc = "Save, close buffer, and return to normal mode" },
|
||||
["<C-x>"] = { "<Cmd>wa<CR><Cmd>bd<CR><Esc>", desc = "Save, close buffer, and return to normal mode" }, -- Added C-x for insert mode
|
||||
},
|
||||
v = {
|
||||
["<C-e>"] = {
|
||||
["<C-e>"] = { "<Cmd>Neotree toggle<CR>", desc = "Open Explorer" },
|
||||
["<C-c>"] = { "<Cmd>w<CR><Cmd>bd<CR>", desc = "Save and close buffer" },
|
||||
["<C-x>"] = { "<Cmd>w<CR><Cmd>bd<CR>", desc = "Save and close buffer" },
|
||||
-- Avante visual mode mappings
|
||||
["<C-a>"] = { "<cmd>AvanteAsk<cr>", desc = "Ask Avante with selection" },
|
||||
["<C-a>e"] = { "<cmd>AvanteEdit<cr>", desc = "Edit selection with Avante" },
|
||||
["<C-a>r"] = { "<cmd>AvanteReplace<cr>", desc = "Replace with Avante" },
|
||||
["D"] = {
|
||||
function()
|
||||
-- Toggle explorer using the proper Snacks.explorer API
|
||||
local snacks = require "snacks"
|
||||
-- Check if there's an active explorer picker
|
||||
local pickers = snacks.picker.get { source = "explorer" }
|
||||
if #pickers > 0 then
|
||||
-- Close the explorer
|
||||
for _, picker in ipairs(pickers) do
|
||||
picker:close()
|
||||
end
|
||||
else
|
||||
-- Open the explorer
|
||||
snacks.explorer()
|
||||
end
|
||||
-- Yank the visual selection to register v
|
||||
vim.cmd 'normal! "vy'
|
||||
local selection = vim.fn.getreg "v"
|
||||
|
||||
-- Escape special regex characters
|
||||
local escaped = vim.fn.escape(selection, [[/\.*$^~[]])
|
||||
|
||||
-- Delete all occurrences in the buffer (e flag suppresses errors if no match)
|
||||
vim.cmd(string.format([[%%s/%s//ge]], escaped))
|
||||
|
||||
-- Show notification of what was deleted
|
||||
vim.notify(string.format("Deleted all occurrences of: %s", selection), vim.log.levels.INFO)
|
||||
end,
|
||||
desc = "Toggle Explorer",
|
||||
desc = "Delete all occurrences of selected text",
|
||||
},
|
||||
["R"] = {
|
||||
function()
|
||||
-- Yank the visual selection to register v
|
||||
vim.cmd 'normal! "vy'
|
||||
local selection = vim.fn.getreg "v"
|
||||
|
||||
-- Escape special regex characters for search pattern
|
||||
local escaped = vim.fn.escape(selection, [[/\.*$^~[]])
|
||||
|
||||
-- Show input prompt using snacks.input
|
||||
require("snacks").input({
|
||||
prompt = string.format("Replace '%s' with:", selection),
|
||||
default = "",
|
||||
}, function(replacement)
|
||||
if replacement then
|
||||
-- Escape special characters for replacement string
|
||||
local escaped_replacement = vim.fn.escape(replacement, [[/\&~]])
|
||||
|
||||
-- Replace all occurrences in the buffer
|
||||
vim.cmd(string.format([[%%s/%s/%s/ge]], escaped, escaped_replacement))
|
||||
|
||||
-- Show notification
|
||||
vim.notify(string.format("Replaced '%s' with '%s'", selection, replacement), vim.log.levels.INFO)
|
||||
end
|
||||
end)
|
||||
end,
|
||||
desc = "Replace all occurrences of selected text",
|
||||
},
|
||||
["<C-c>"] = { "<Cmd>w<CR><Cmd>bd<CR>", desc = "Save and close buffer" }, -- Modified to save and close buffer
|
||||
["<C-x>"] = { "<Cmd>w<CR><Cmd>bd<CR>", desc = "Save and close buffer" }, -- Added C-x for visual mode
|
||||
},
|
||||
t = {
|
||||
["<C-e>"] = {
|
||||
function()
|
||||
-- Toggle explorer using the proper Snacks.explorer API
|
||||
local snacks = require "snacks"
|
||||
-- Check if there's an active explorer picker
|
||||
local pickers = snacks.picker.get { source = "explorer" }
|
||||
if #pickers > 0 then
|
||||
-- Close the explorer
|
||||
for _, picker in ipairs(pickers) do
|
||||
picker:close()
|
||||
end
|
||||
else
|
||||
-- Open the explorer
|
||||
snacks.explorer()
|
||||
end
|
||||
end,
|
||||
desc = "Toggle Explorer",
|
||||
},
|
||||
["<C-a><C-a>"] = { terminals.opencode_toggle, desc = "Toggle OpenCode" },
|
||||
["<C-t><C-t>"] = { terminals.mk_toggle, desc = "Taskfile Toggle" },
|
||||
["<C-e>"] = { "<Cmd>Neotree toggle<CR>", desc = "Open Explorer" },
|
||||
-- Paste from system clipboard
|
||||
["<C-p>"] = { function() vim.cmd 'normal! "+p' end, desc = "Paste from system clipboard" },
|
||||
["<C-b>f"] = {
|
||||
function() require("snacks").picker.buffers() end,
|
||||
desc = "Find buffers",
|
||||
},
|
||||
["<C-j><C-j>"] = { function() terminals.scratch_toggle() end, desc = "Open Scratch Terminal" },
|
||||
-- Exit terminal mode and close window
|
||||
["<C-c>"] = {
|
||||
["<C-q>"] = {
|
||||
function()
|
||||
vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes([[<C-\><C-n>]], true, false, true), "n", false)
|
||||
vim.cmd "close"
|
||||
end,
|
||||
desc = "Exit terminal and close window",
|
||||
},
|
||||
-- Exit terminal mode and close window
|
||||
["<C-h>"] = {
|
||||
function()
|
||||
vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes([[<C-\><C-n><C-w>h]], true, false, true), "n", false)
|
||||
|
||||
@@ -0,0 +1,709 @@
|
||||
--- Comprehensive LSP, formatting, and linting configuration
|
||||
--- Optimized for tech stack:
|
||||
--- - Cloudflare Workers/Pages
|
||||
--- - Golang (Cosmos SDK)
|
||||
--- - TypeScript/React/Vite
|
||||
--- - Protobufs
|
||||
--- - Bun/ES Modules/WASM
|
||||
--- @module plugins.astrolsp
|
||||
|
||||
return {
|
||||
-- ============================================================================
|
||||
-- AstroLSP - Core LSP Configuration
|
||||
-- ============================================================================
|
||||
{
|
||||
"AstroNvim/astrolsp",
|
||||
---@type AstroLSPOpts
|
||||
opts = {
|
||||
-- Enable LSP features
|
||||
features = {
|
||||
autoformat = true,
|
||||
codelens = true,
|
||||
inlay_hints = true, -- Enable inlay hints for TS/Go
|
||||
lsp_handlers = true,
|
||||
semantic_tokens = true,
|
||||
},
|
||||
|
||||
-- LSP UI defaults
|
||||
defaults = {
|
||||
hover = { border = "rounded", silent = true }, -- Rounded border for hover windows
|
||||
signature_help = { border = "rounded", silent = true }, -- Enable signature help
|
||||
},
|
||||
|
||||
-- LSP client flags
|
||||
flags = {
|
||||
exit_timeout = 5000, -- Time to wait for LSP server to exit before force kill
|
||||
debounce_text_changes = 150, -- Debounce didChange notifications
|
||||
},
|
||||
|
||||
-- LSP Formatting Configuration
|
||||
formatting = {
|
||||
format_on_save = {
|
||||
enabled = true,
|
||||
-- Allow specific filetypes (prefer conform.nvim for JS/TS)
|
||||
allow_filetypes = {
|
||||
"go",
|
||||
"proto",
|
||||
"toml",
|
||||
"lua",
|
||||
},
|
||||
},
|
||||
-- Disable LSP formatting for these (use conform.nvim/oxfmt instead)
|
||||
disabled = {
|
||||
"ts_ls", -- Use oxfmt via conform
|
||||
"tsserver", -- Old name, keeping for compatibility
|
||||
"vtsls", -- Use oxfmt via conform
|
||||
"html", -- Use conform
|
||||
"cssls", -- Use conform
|
||||
"tailwindcss", -- Doesn't format
|
||||
},
|
||||
timeout_ms = 5000, -- Increase timeout for large Go files
|
||||
filter = function(client)
|
||||
-- Prefer conform.nvim for JS/TS formatting
|
||||
if
|
||||
vim.bo.filetype == "typescript"
|
||||
or vim.bo.filetype == "javascript"
|
||||
or vim.bo.filetype == "typescriptreact"
|
||||
or vim.bo.filetype == "javascriptreact"
|
||||
then
|
||||
return false
|
||||
end
|
||||
-- Use gopls for Go formatting
|
||||
if vim.bo.filetype == "go" then return client.name == "gopls" end
|
||||
return true
|
||||
end,
|
||||
},
|
||||
|
||||
-- Enable file operations for better refactoring
|
||||
file_operations = {
|
||||
timeout = 10000,
|
||||
operations = {
|
||||
willCreate = true,
|
||||
didCreate = true,
|
||||
willRename = true,
|
||||
didRename = true,
|
||||
willDelete = true,
|
||||
didDelete = true,
|
||||
},
|
||||
},
|
||||
|
||||
-- Language server configurations
|
||||
config = {
|
||||
-- Golang configuration optimized for Cosmos SDK
|
||||
gopls = {
|
||||
settings = {
|
||||
gopls = {
|
||||
-- Code analysis
|
||||
analyses = {
|
||||
unusedparams = true,
|
||||
shadow = true,
|
||||
nilness = true,
|
||||
unusedwrite = true,
|
||||
useany = true,
|
||||
unusedvariable = true,
|
||||
},
|
||||
-- Staticcheck integration
|
||||
staticcheck = true,
|
||||
-- Inlay hints
|
||||
hints = {
|
||||
assignVariableTypes = true,
|
||||
compositeLiteralFields = true,
|
||||
compositeLiteralTypes = true,
|
||||
constantValues = true,
|
||||
functionTypeParameters = true,
|
||||
parameterNames = true,
|
||||
rangeVariableTypes = true,
|
||||
},
|
||||
-- Code completion
|
||||
usePlaceholders = true,
|
||||
completeUnimported = true,
|
||||
-- Build flags for Cosmos SDK
|
||||
buildFlags = { "-tags=ledger,test" },
|
||||
-- Workspace settings
|
||||
directoryFilters = {
|
||||
"-**/node_modules",
|
||||
"-**/.git",
|
||||
"-**/.vscode",
|
||||
"-**/.idea",
|
||||
"-**/.devbox",
|
||||
"-**/dist",
|
||||
"-**/build",
|
||||
},
|
||||
-- Semantic tokens
|
||||
semanticTokens = true,
|
||||
-- Code lenses
|
||||
codelenses = {
|
||||
gc_details = true,
|
||||
generate = true,
|
||||
regenerate_cgo = true,
|
||||
test = true,
|
||||
tidy = true,
|
||||
upgrade_dependency = true,
|
||||
vendor = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
-- TypeScript configuration for Vite/React/Cloudflare
|
||||
ts_ls = {
|
||||
settings = {
|
||||
typescript = {
|
||||
inlayHints = {
|
||||
includeInlayParameterNameHints = "all",
|
||||
includeInlayParameterNameHintsWhenArgumentMatchesName = true,
|
||||
includeInlayFunctionParameterTypeHints = true,
|
||||
includeInlayVariableTypeHints = true,
|
||||
includeInlayVariableTypeHintsWhenTypeMatchesName = true,
|
||||
includeInlayPropertyDeclarationTypeHints = true,
|
||||
includeInlayFunctionLikeReturnTypeHints = true,
|
||||
includeInlayEnumMemberValueHints = true,
|
||||
},
|
||||
suggest = {
|
||||
completeFunctionCalls = true,
|
||||
},
|
||||
-- Cloudflare Workers types
|
||||
preferences = {
|
||||
importModuleSpecifier = "relative",
|
||||
importModuleSpecifierEnding = "minimal",
|
||||
},
|
||||
},
|
||||
javascript = {
|
||||
inlayHints = {
|
||||
includeInlayParameterNameHints = "all",
|
||||
includeInlayParameterNameHintsWhenArgumentMatchesName = true,
|
||||
includeInlayFunctionParameterTypeHints = true,
|
||||
includeInlayVariableTypeHints = true,
|
||||
includeInlayPropertyDeclarationTypeHints = true,
|
||||
includeInlayFunctionLikeReturnTypeHints = true,
|
||||
includeInlayEnumMemberValueHints = true,
|
||||
},
|
||||
suggest = {
|
||||
completeFunctionCalls = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
-- Volar for Vue (also helpful for some React scenarios)
|
||||
volar = {
|
||||
filetypes = { "vue", "typescript", "javascript", "typescriptreact", "javascriptreact" },
|
||||
},
|
||||
|
||||
-- Tailwind CSS for React/shadcn components
|
||||
tailwindcss = {
|
||||
root_dir = function(fname)
|
||||
local util = require "lspconfig.util"
|
||||
return util.root_pattern("tailwind.config.js", "tailwind.config.ts", "postcss.config.js")(fname)
|
||||
end,
|
||||
settings = {
|
||||
tailwindCSS = {
|
||||
experimental = {
|
||||
classRegex = {
|
||||
-- Support for cn() and clsx() utilities
|
||||
{ "cn\\(([^)]*)\\)", "[\"'`]([^\"'`]*).*?[\"'`]" },
|
||||
{ "clsx\\(([^)]*)\\)", "[\"'`]([^\"'`]*).*?[\"'`]" },
|
||||
{ "cva\\(([^)]*)\\)", "[\"'`]([^\"'`]*).*?[\"'`]" },
|
||||
},
|
||||
},
|
||||
validate = true,
|
||||
lint = {
|
||||
cssConflict = "warning",
|
||||
invalidApply = "error",
|
||||
invalidScreen = "error",
|
||||
invalidVariant = "error",
|
||||
invalidConfigPath = "error",
|
||||
invalidTailwindDirective = "error",
|
||||
recommendedVariantOrder = "warning",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
-- CSS LSP
|
||||
cssls = {},
|
||||
|
||||
-- HTML for React/templates
|
||||
html = {
|
||||
filetypes = { "html", "typescriptreact", "javascriptreact" },
|
||||
settings = {
|
||||
html = {
|
||||
format = {
|
||||
templating = true,
|
||||
wrapLineLength = 100,
|
||||
wrapAttributes = "auto",
|
||||
},
|
||||
hover = {
|
||||
documentation = true,
|
||||
references = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
-- JSON/JSONC for config files
|
||||
jsonls = {
|
||||
settings = {
|
||||
json = {
|
||||
schemas = {
|
||||
-- Cloudflare wrangler.toml
|
||||
{
|
||||
fileMatch = { "wrangler.toml", "wrangler.json" },
|
||||
url = "https://raw.githubusercontent.com/cloudflare/wrangler/main/wrangler-schema.json",
|
||||
},
|
||||
-- Package.json
|
||||
{
|
||||
fileMatch = { "package.json" },
|
||||
url = "https://json.schemastore.org/package.json",
|
||||
},
|
||||
-- tsconfig.json
|
||||
{
|
||||
fileMatch = { "tsconfig.json", "tsconfig.*.json" },
|
||||
url = "https://json.schemastore.org/tsconfig.json",
|
||||
},
|
||||
},
|
||||
validate = { enable = true },
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
-- YAML for configs
|
||||
yamlls = {
|
||||
settings = {
|
||||
yaml = {
|
||||
schemaStore = {
|
||||
enable = true,
|
||||
url = "https://www.schemastore.org/api/json/catalog.json",
|
||||
},
|
||||
schemas = {
|
||||
["https://json.schemastore.org/github-workflow.json"] = ".github/workflows/*.yml",
|
||||
["https://raw.githubusercontent.com/compose-spec/compose-spec/master/schema/compose-spec.json"] =
|
||||
"docker-compose*.yml",
|
||||
},
|
||||
validate = true,
|
||||
hover = true,
|
||||
completion = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
-- Lua for Neovim config
|
||||
lua_ls = {
|
||||
settings = {
|
||||
Lua = {
|
||||
hint = {
|
||||
enable = true,
|
||||
arrayIndex = "Auto",
|
||||
setType = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
-- Capabilities configuration
|
||||
capabilities = {
|
||||
textDocument = {
|
||||
completion = {
|
||||
completionItem = {
|
||||
documentationFormat = { "markdown", "plaintext" },
|
||||
snippetSupport = true,
|
||||
preselectSupport = true,
|
||||
insertReplaceSupport = true,
|
||||
labelDetailsSupport = true,
|
||||
deprecatedSupport = true,
|
||||
commitCharactersSupport = true,
|
||||
tagSupport = { valueSet = { 1 } },
|
||||
resolveSupport = {
|
||||
properties = {
|
||||
"documentation",
|
||||
"detail",
|
||||
"additionalTextEdits",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
-- LSP-specific keymappings (keeping existing bindings)
|
||||
mappings = {
|
||||
n = {
|
||||
-- LSP Code Actions
|
||||
["<C-a>a"] = {
|
||||
function() vim.lsp.buf.code_action() end,
|
||||
desc = "LSP Code Action",
|
||||
},
|
||||
|
||||
-- LSP Hover
|
||||
["<C-a>h"] = {
|
||||
function() vim.lsp.buf.hover() end,
|
||||
desc = "LSP Hover",
|
||||
},
|
||||
|
||||
-- LSP Rename (using inc-rename plugin)
|
||||
["<C-a>r"] = {
|
||||
function() return ":IncRename " .. vim.fn.expand "<cword>" end,
|
||||
expr = true,
|
||||
desc = "Rename current symbol",
|
||||
cond = "textDocument/rename",
|
||||
},
|
||||
|
||||
-- LSP Diagnostics (using snacks.picker)
|
||||
["<C-a>d"] = {
|
||||
function() require("snacks").picker.diagnostics() end,
|
||||
desc = "Find LSP diagnostics",
|
||||
},
|
||||
|
||||
-- LSP Symbols (using snacks.picker)
|
||||
["<C-a>s"] = {
|
||||
function() require("snacks").picker.lsp_symbols() end,
|
||||
desc = "Find LSP symbols",
|
||||
},
|
||||
|
||||
-- Navigate diagnostics
|
||||
K = {
|
||||
function() vim.diagnostic.goto_prev() end,
|
||||
desc = "Previous Diagnostic",
|
||||
},
|
||||
J = {
|
||||
function() vim.diagnostic.goto_next() end,
|
||||
desc = "Next Diagnostic",
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
-- Autocmds for LSP-specific behavior
|
||||
autocmds = {
|
||||
-- Disable inlay hints in insert mode for cleaner editing
|
||||
no_insert_inlay_hints = {
|
||||
cond = vim.lsp.inlay_hint and "textDocument/inlayHint" or false,
|
||||
{
|
||||
event = "InsertEnter",
|
||||
desc = "Disable inlay hints on insert",
|
||||
callback = function(args)
|
||||
local filter = { bufnr = args.buf }
|
||||
if vim.lsp.inlay_hint.is_enabled(filter) then
|
||||
vim.lsp.inlay_hint.enable(false, filter)
|
||||
vim.api.nvim_create_autocmd("InsertLeave", {
|
||||
buffer = args.buf,
|
||||
once = true,
|
||||
callback = function() vim.lsp.inlay_hint.enable(true, filter) end,
|
||||
})
|
||||
end
|
||||
end,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
-- ============================================================================
|
||||
-- Formatting - Conform.nvim
|
||||
-- ============================================================================
|
||||
{
|
||||
"stevearc/conform.nvim",
|
||||
event = "BufWritePre",
|
||||
cmd = { "ConformInfo" },
|
||||
opts = {
|
||||
formatters_by_ft = {
|
||||
typescript = { "oxfmt" },
|
||||
typescriptreact = { "oxfmt" },
|
||||
javascript = { "oxfmt" },
|
||||
javascriptreact = { "oxfmt" },
|
||||
json = { "oxfmt" },
|
||||
jsonc = { "oxfmt" },
|
||||
css = { "oxfmt" },
|
||||
scss = { "oxfmt" },
|
||||
html = { "oxfmt" },
|
||||
markdown = { "oxfmt" },
|
||||
yaml = { "oxfmt" },
|
||||
lua = { "stylua" },
|
||||
rust = { "rustfmt" },
|
||||
toml = { "taplo" },
|
||||
},
|
||||
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 = 500,
|
||||
lsp_fallback = true,
|
||||
}
|
||||
end,
|
||||
formatters = {
|
||||
-- oxfmt uses default configuration
|
||||
},
|
||||
},
|
||||
config = function(_, opts)
|
||||
require("conform").setup(opts)
|
||||
|
||||
-- Command to toggle format on save
|
||||
vim.api.nvim_create_user_command("FormatToggle", function(args)
|
||||
if args.bang then
|
||||
-- Toggle buffer-local setting
|
||||
vim.b.disable_autoformat = not vim.b.disable_autoformat
|
||||
else
|
||||
-- Toggle global setting
|
||||
vim.g.disable_autoformat = not vim.g.disable_autoformat
|
||||
end
|
||||
local status = vim.g.disable_autoformat and "disabled" or "enabled"
|
||||
vim.notify("Format on save " .. status, vim.log.levels.INFO)
|
||||
end, {
|
||||
desc = "Toggle format on save",
|
||||
bang = true,
|
||||
})
|
||||
end,
|
||||
},
|
||||
|
||||
-- ============================================================================
|
||||
-- Linting - nvim-lint
|
||||
-- ============================================================================
|
||||
{
|
||||
"mfussenegger/nvim-lint",
|
||||
event = { "BufReadPre", "BufNewFile" },
|
||||
config = function()
|
||||
local lint = require "lint"
|
||||
|
||||
-- Configure linters per filetype
|
||||
lint.linters_by_ft = {
|
||||
typescript = { "oxlint" },
|
||||
typescriptreact = { "oxlint" },
|
||||
javascript = { "oxlint" },
|
||||
javascriptreact = { "oxlint" },
|
||||
css = { "stylelint" },
|
||||
scss = { "stylelint" },
|
||||
markdown = { "markdownlint" },
|
||||
}
|
||||
|
||||
-- Auto-lint on save and text changed
|
||||
local lint_augroup = vim.api.nvim_create_augroup("lint", { clear = true })
|
||||
vim.api.nvim_create_autocmd({ "BufEnter", "BufWritePost", "InsertLeave", "TextChanged" }, {
|
||||
group = lint_augroup,
|
||||
callback = function()
|
||||
-- Only lint if file exists on disk
|
||||
if vim.fn.filereadable(vim.api.nvim_buf_get_name(0)) == 1 then lint.try_lint() end
|
||||
end,
|
||||
})
|
||||
end,
|
||||
},
|
||||
|
||||
-- ============================================================================
|
||||
-- Treesitter Configuration
|
||||
-- ============================================================================
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
optional = true,
|
||||
opts = function(_, opts)
|
||||
if opts.ensure_installed ~= "all" then
|
||||
opts.ensure_installed = require("astrocore").list_insert_unique(opts.ensure_installed, {
|
||||
"typescript",
|
||||
"tsx",
|
||||
"javascript",
|
||||
"jsdoc",
|
||||
"json",
|
||||
"jsonc",
|
||||
"css",
|
||||
"scss",
|
||||
"html",
|
||||
"markdown",
|
||||
"markdown_inline",
|
||||
"regex",
|
||||
"bash",
|
||||
"vim",
|
||||
"lua",
|
||||
"proto", -- Protobuf syntax highlighting
|
||||
})
|
||||
end
|
||||
end,
|
||||
},
|
||||
|
||||
-- Treesitter context for React component awareness
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter-context",
|
||||
event = { "BufReadPost", "BufNewFile" },
|
||||
opts = {
|
||||
enable = true,
|
||||
max_lines = 3,
|
||||
patterns = {
|
||||
default = {
|
||||
"class",
|
||||
"function",
|
||||
"method",
|
||||
"for",
|
||||
"while",
|
||||
"if",
|
||||
"switch",
|
||||
"case",
|
||||
"interface",
|
||||
"struct",
|
||||
"enum",
|
||||
},
|
||||
typescript = {
|
||||
"class_declaration",
|
||||
"abstract_class_declaration",
|
||||
"function_declaration",
|
||||
"method_definition",
|
||||
"arrow_function",
|
||||
"function_expression",
|
||||
"lexical_declaration",
|
||||
"variable_declaration",
|
||||
},
|
||||
typescriptreact = {
|
||||
"class_declaration",
|
||||
"function_declaration",
|
||||
"method_definition",
|
||||
"arrow_function",
|
||||
"function_expression",
|
||||
"jsx_element",
|
||||
"jsx_self_closing_element",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
-- ============================================================================
|
||||
-- TypeScript Tooling
|
||||
-- ============================================================================
|
||||
{
|
||||
"pmizio/typescript-tools.nvim",
|
||||
ft = { "typescript", "typescriptreact", "javascript", "javascriptreact" },
|
||||
dependencies = { "nvim-lua/plenary.nvim", "neovim/nvim-lspconfig" },
|
||||
opts = {
|
||||
settings = {
|
||||
separate_diagnostic_server = true,
|
||||
publish_diagnostic_on = "insert_leave",
|
||||
expose_as_code_action = "all",
|
||||
tsserver_file_preferences = {
|
||||
includeInlayParameterNameHints = "all",
|
||||
includeInlayParameterNameHintsWhenArgumentMatchesName = true,
|
||||
includeInlayFunctionParameterTypeHints = true,
|
||||
includeInlayVariableTypeHints = true,
|
||||
includeInlayVariableTypeHintsWhenTypeMatchesName = true,
|
||||
includeInlayPropertyDeclarationTypeHints = true,
|
||||
includeInlayFunctionLikeReturnTypeHints = true,
|
||||
includeInlayEnumMemberValueHints = true,
|
||||
},
|
||||
tsserver_format_options = {
|
||||
allowIncompleteCompletions = false,
|
||||
allowRenameOfImportPath = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
-- Auto-close and auto-rename JSX tags
|
||||
{
|
||||
"windwp/nvim-ts-autotag",
|
||||
event = { "BufReadPost", "BufNewFile" },
|
||||
ft = {
|
||||
"html",
|
||||
"javascript",
|
||||
"typescript",
|
||||
"javascriptreact",
|
||||
"typescriptreact",
|
||||
"xml",
|
||||
"vue",
|
||||
"svelte",
|
||||
},
|
||||
opts = {
|
||||
autotag = {
|
||||
enable = true,
|
||||
enable_rename = true,
|
||||
enable_close = true,
|
||||
enable_close_on_slash = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
-- ============================================================================
|
||||
-- Mason Configuration
|
||||
-- ============================================================================
|
||||
{
|
||||
"williamboman/mason-lspconfig.nvim",
|
||||
optional = true,
|
||||
opts = function(_, opts)
|
||||
opts.ensure_installed = require("astrocore").list_insert_unique(opts.ensure_installed, {
|
||||
-- TypeScript/JavaScript
|
||||
"ts_ls", -- tsserver was renamed to ts_ls
|
||||
"tailwindcss",
|
||||
"html",
|
||||
|
||||
-- Styling
|
||||
"cssls",
|
||||
|
||||
-- Config files
|
||||
"jsonls",
|
||||
"yamlls",
|
||||
|
||||
-- Lua
|
||||
"lua_ls",
|
||||
|
||||
-- Go (Cosmos SDK)
|
||||
"gopls",
|
||||
})
|
||||
end,
|
||||
},
|
||||
|
||||
-- Note: mason-tool-installer is configured in lua/plugins/mason.lua
|
||||
|
||||
-- ============================================================================
|
||||
-- Package Management Tools
|
||||
-- ============================================================================
|
||||
{
|
||||
"vuki656/package-info.nvim",
|
||||
event = "BufRead package.json",
|
||||
dependencies = { "MunifTanjim/nui.nvim" },
|
||||
opts = {},
|
||||
},
|
||||
|
||||
-- Crates.io integration (useful for Rust tooling in Workers)
|
||||
{
|
||||
"saecki/crates.nvim",
|
||||
event = "BufRead Cargo.toml",
|
||||
dependencies = { "nvim-lua/plenary.nvim" },
|
||||
opts = {
|
||||
lsp = {
|
||||
enabled = true,
|
||||
actions = true,
|
||||
completion = true,
|
||||
hover = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
-- ============================================================================
|
||||
|
||||
-- Inline linting hints
|
||||
{
|
||||
"https://git.sr.ht/~whynothugo/lsp_lines.nvim",
|
||||
event = { "BufReadPost", "BufNewFile" },
|
||||
config = function()
|
||||
require("lsp_lines").setup()
|
||||
-- Disable virtual_text since lsp_lines will show diagnostics
|
||||
vim.diagnostic.config { virtual_text = false }
|
||||
|
||||
-- Toggle command
|
||||
vim.api.nvim_create_user_command("LspLinesToggle", function()
|
||||
local new_value = not require("lsp_lines").toggle()
|
||||
vim.diagnostic.config { virtual_text = new_value }
|
||||
end, { desc = "Toggle LSP lines" })
|
||||
end,
|
||||
},
|
||||
|
||||
-- Better quickfix for showing lint errors
|
||||
{
|
||||
"kevinhwang91/nvim-bqf",
|
||||
ft = "qf",
|
||||
opts = {
|
||||
auto_resize_height = true,
|
||||
func_map = {
|
||||
vsplit = "v",
|
||||
split = "s",
|
||||
tab = "t",
|
||||
tabb = "T",
|
||||
tabc = "<C-t>",
|
||||
ptogglemode = "z,",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
+2
-175
@@ -13,185 +13,12 @@ return {
|
||||
GitChange = "",
|
||||
GitDelete = "",
|
||||
},
|
||||
-- modify variables used by heirline but not defined in the setup call directly
|
||||
status = {
|
||||
-- define the separators between each section
|
||||
separators = {
|
||||
left = { "", "" }, -- separator for the left side of the statusline
|
||||
right = { "", "" }, -- separator for the right side of the statusline
|
||||
tab = { "", "" },
|
||||
},
|
||||
-- add new colors that can be used by heirline
|
||||
colors = function(hl)
|
||||
local get_hlgroup = require("astroui").get_hlgroup
|
||||
-- use helper function to get highlight group properties
|
||||
local comment_fg = get_hlgroup("Comment").fg
|
||||
hl.git_branch_fg = comment_fg
|
||||
hl.git_added = comment_fg
|
||||
hl.git_changed = comment_fg
|
||||
hl.git_removed = comment_fg
|
||||
hl.blank_bg = get_hlgroup("Folded").fg
|
||||
hl.file_info_bg = get_hlgroup("Visual").bg
|
||||
hl.nav_icon_bg = get_hlgroup("String").fg
|
||||
hl.nav_fg = hl.nav_icon_bg
|
||||
hl.folder_icon_bg = get_hlgroup("Error").fg
|
||||
return hl
|
||||
end,
|
||||
attributes = {
|
||||
mode = { bold = true },
|
||||
},
|
||||
icon_highlights = {
|
||||
file_icon = {
|
||||
statusline = false,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"rebelot/heirline.nvim",
|
||||
opts = function(_, opts)
|
||||
local status = require "astroui.status"
|
||||
-- Disable heirline's tabline since we're using bufferline
|
||||
opts.tabline = nil
|
||||
opts.statusline = {
|
||||
-- default highlight for the entire statusline
|
||||
hl = { fg = "fg", bg = "bg" },
|
||||
-- each element following is a component in astroui.status module
|
||||
|
||||
-- add the vim mode component
|
||||
status.component.mode {
|
||||
-- enable mode text with padding as well as an icon before it
|
||||
mode_text = {
|
||||
icon = { kind = "VimIcon", padding = { right = 1, left = 1 } },
|
||||
},
|
||||
-- surround the component with a separators
|
||||
surround = {
|
||||
-- it's a left element, so use the left separator
|
||||
separator = "left",
|
||||
-- set the color of the surrounding based on the current mode using astronvim.utils.status module
|
||||
color = function() return { main = status.hl.mode_bg(), right = "blank_bg" } end,
|
||||
},
|
||||
},
|
||||
-- we want an empty space here so we can use the component builder to make a new section with just an empty string
|
||||
status.component.builder {
|
||||
{ provider = "" },
|
||||
-- define the surrounding separator and colors to be used inside of the component
|
||||
-- and the color to the right of the separated out section
|
||||
surround = {
|
||||
separator = "left",
|
||||
color = { main = "blank_bg", right = "file_info_bg" },
|
||||
},
|
||||
},
|
||||
-- add a section for the currently opened file information
|
||||
status.component.file_info {
|
||||
-- enable the file_icon and disable the highlighting based on filetype
|
||||
filename = { fallback = "Empty" },
|
||||
-- disable some of the info
|
||||
filetype = false,
|
||||
file_read_only = false,
|
||||
-- add padding
|
||||
padding = { right = 1 },
|
||||
-- define the section separator
|
||||
surround = { separator = "left", condition = false },
|
||||
},
|
||||
-- add a component for the current git branch if it exists and use no separator for the sections
|
||||
status.component.git_branch {
|
||||
git_branch = { padding = { left = 1 } },
|
||||
surround = { separator = "none" },
|
||||
},
|
||||
-- add a component for the current git diff if it exists and use no separator for the sections
|
||||
status.component.git_diff {
|
||||
padding = { left = 1 },
|
||||
surround = { separator = "none" },
|
||||
},
|
||||
-- fill the rest of the statusline
|
||||
-- the elements after this will appear in the middle of the statusline
|
||||
status.component.fill(),
|
||||
-- add a component to display if the LSP is loading, disable showing running client names, and use no separator
|
||||
status.component.lsp {
|
||||
lsp_client_names = false,
|
||||
surround = { separator = "none", color = "bg" },
|
||||
},
|
||||
-- fill the rest of the statusline
|
||||
-- the elements after this will appear on the right of the statusline
|
||||
status.component.fill(),
|
||||
-- add a component for the current diagnostics if it exists and use the right separator for the section
|
||||
status.component.diagnostics { surround = { separator = "right" }, padding = { right = 1 } },
|
||||
-- add a component to display LSP clients, disable showing LSP progress, and use the right separator
|
||||
status.component.lsp {
|
||||
lsp_progress = false,
|
||||
padding = { right = 1 },
|
||||
surround = { separator = "right" },
|
||||
},
|
||||
-- NvChad has some nice icons to go along with information, so we can create a parent component to do this
|
||||
-- all of the children of this table will be treated together as a single component
|
||||
{
|
||||
flexible = 1,
|
||||
{
|
||||
-- define a simple component where the provider is just a folder icon
|
||||
status.component.builder {
|
||||
-- astronvim.get_icon gets the user interface icon for a closed folder with a space after it
|
||||
{ provider = require("astroui").get_icon "FolderClosed" },
|
||||
-- add padding after icon
|
||||
padding = { right = 1 },
|
||||
-- set the foreground color to be used for the icon
|
||||
hl = { fg = "bg" },
|
||||
-- use the right separator and define the background color
|
||||
surround = { separator = "right", color = "folder_icon_bg" },
|
||||
},
|
||||
-- add a file information component and only show the current working directory name
|
||||
status.component.file_info {
|
||||
-- we only want filename to be used and we can change the fname
|
||||
-- function to get the current working directory name
|
||||
filename = {
|
||||
fname = function(nr) return vim.fn.getcwd(nr) end,
|
||||
padding = { left = 1, right = 1 },
|
||||
},
|
||||
-- disable all other elements of the file_info component
|
||||
filetype = false,
|
||||
file_icon = false,
|
||||
file_modified = false,
|
||||
file_read_only = false,
|
||||
-- use no separator for this part but define a background color
|
||||
surround = {
|
||||
separator = "none",
|
||||
color = "file_info_bg",
|
||||
condition = false,
|
||||
},
|
||||
},
|
||||
},
|
||||
{},
|
||||
},
|
||||
-- the final component of the NvChad statusline is the navigation section
|
||||
-- this is very similar to the previous current working directory section with the icon
|
||||
{ -- make nav section with icon border
|
||||
-- define a custom component with just a file icon
|
||||
status.component.builder {
|
||||
{ provider = require("astroui").get_icon "ScrollText" },
|
||||
-- add padding after icon
|
||||
padding = { right = 1 },
|
||||
-- set the icon foreground
|
||||
hl = { fg = "bg" },
|
||||
-- use the right separator and define the background color
|
||||
-- as well as the color to the left of the separator
|
||||
surround = {
|
||||
separator = "right",
|
||||
color = { main = "nav_icon_bg", left = "file_info_bg" },
|
||||
},
|
||||
},
|
||||
-- add a navigation component and just display the percentage of progress in the file
|
||||
status.component.nav {
|
||||
-- add some padding for the percentage provider
|
||||
percentage = { padding = { right = 1 } },
|
||||
-- disable all other providers
|
||||
ruler = false,
|
||||
scrollbar = false,
|
||||
-- use no separator and define the background color
|
||||
surround = { separator = "none", color = "file_info_bg" },
|
||||
opts = {
|
||||
statusline = false,
|
||||
},
|
||||
},
|
||||
}
|
||||
end,
|
||||
},
|
||||
}
|
||||
+12
-108
@@ -1,21 +1,20 @@
|
||||
-- Bufferline configuration with AstroNvim integration
|
||||
--- Bufferline configuration with AstroNvim integration
|
||||
--- Overrides and customizations for bufferline.nvim
|
||||
--- Relies on astrocommunity.bars-and-lines.bufferline-nvim for base setup
|
||||
--- @module plugins.bufferline
|
||||
|
||||
---@type LazySpec
|
||||
return {
|
||||
"akinsho/bufferline.nvim",
|
||||
version = "*",
|
||||
dependencies = { "nvim-tree/nvim-web-devicons", "AstroNvim/astrocore" },
|
||||
event = "VeryLazy",
|
||||
config = function()
|
||||
local bufferline = require "bufferline"
|
||||
local groups = require "bufferline.groups"
|
||||
|
||||
bufferline.setup {
|
||||
opts = {
|
||||
options = {
|
||||
mode = "buffers",
|
||||
numbers = "none",
|
||||
-- Use AstroCore buffer close handler for proper cleanup
|
||||
close_command = function(n) require("astrocore.buffer").close(n) end,
|
||||
right_mouse_command = function(n) require("astrocore.buffer").close(n) end,
|
||||
separator_style = "thick",
|
||||
indicator = { style = "icon", icon = "▎" },
|
||||
indicator = { style = "none", icon = "" },
|
||||
diagnostics = "nvim_lsp",
|
||||
diagnostics_indicator = function(_, _, diagnostics_dict)
|
||||
local s = " "
|
||||
@@ -33,104 +32,10 @@ return {
|
||||
close_icon = "",
|
||||
left_trunc_marker = "",
|
||||
right_trunc_marker = "",
|
||||
-- Offset for snacks picker to prevent overlap
|
||||
offsets = {
|
||||
{ filetype = "snacks_picker", text = "", padding = 0 },
|
||||
},
|
||||
groups = {
|
||||
options = { toggle_hidden_on_enter = true },
|
||||
items = {
|
||||
groups.builtin.ungrouped,
|
||||
|
||||
-- Module groups
|
||||
{
|
||||
name = "",
|
||||
auto_close = true,
|
||||
highlight = { fg = "#5ef1ff" },
|
||||
matcher = function(buf)
|
||||
local bufname = vim.api.nvim_buf_get_name(buf.id)
|
||||
return bufname:match "x/dex/.*%.go$" or bufname:match "proto/dex/.*%.proto$"
|
||||
end,
|
||||
},
|
||||
{
|
||||
name = "DID",
|
||||
auto_close = true,
|
||||
highlight = { fg = "#5ef1ff" },
|
||||
matcher = function(buf)
|
||||
local bufname = vim.api.nvim_buf_get_name(buf.id)
|
||||
return bufname:match "x/did/.*%.go$" or bufname:match "proto/did/.*%.proto$"
|
||||
end,
|
||||
},
|
||||
{
|
||||
name = "DWN",
|
||||
auto_close = true,
|
||||
highlight = { fg = "#5ef1ff" },
|
||||
matcher = function(buf)
|
||||
local bufname = vim.api.nvim_buf_get_name(buf.id)
|
||||
return bufname:match "x/dwn/.*%.go$" or bufname:match "proto/dwn/.*%.proto$"
|
||||
end,
|
||||
},
|
||||
{
|
||||
name = "SVC",
|
||||
highlight = { fg = "#5ef1ff" },
|
||||
auto_close = true,
|
||||
matcher = function(buf)
|
||||
local bufname = vim.api.nvim_buf_get_name(buf.id)
|
||||
return bufname:match "x/svc/.*%.go$" or bufname:match "proto/svc/.*%.proto$"
|
||||
end,
|
||||
},
|
||||
|
||||
-- Tests
|
||||
{
|
||||
name = "Tests",
|
||||
auto_close = true,
|
||||
highlight = { fg = "#ff5ea0" },
|
||||
matcher = function(buf)
|
||||
local bufname = vim.api.nvim_buf_get_name(buf.id)
|
||||
return bufname:match "_test%.go$" or bufname:match "/test/"
|
||||
end,
|
||||
},
|
||||
|
||||
-- Auto-close groups
|
||||
{
|
||||
name = "Actions",
|
||||
highlight = { fg = "#ff5ef1" },
|
||||
auto_close = true,
|
||||
matcher = function(buf)
|
||||
local bufname = vim.api.nvim_buf_get_name(buf.id)
|
||||
return bufname:match "%.ya?ml$" and bufname:match "%.github/"
|
||||
end,
|
||||
},
|
||||
{
|
||||
name = "Claude",
|
||||
highlight = { fg = "#ffbd5e" },
|
||||
auto_close = true,
|
||||
matcher = function(buf)
|
||||
local bufname = vim.api.nvim_buf_get_name(buf.id)
|
||||
return bufname:match "%.claude/" or bufname:match "CLAUDE%.md$"
|
||||
end,
|
||||
},
|
||||
{
|
||||
name = "Docs",
|
||||
highlight = { fg = "#ffffff" },
|
||||
auto_close = true,
|
||||
matcher = function(buf)
|
||||
local bufname = vim.api.nvim_buf_get_name(buf.id)
|
||||
return bufname:match "%.mdx?$" or bufname:match "/docs/"
|
||||
end,
|
||||
},
|
||||
{
|
||||
name = "Config",
|
||||
highlight = { fg = "#3c4048" },
|
||||
auto_close = true,
|
||||
matcher = function(buf)
|
||||
local bufname = vim.api.nvim_buf_get_name(buf.id)
|
||||
return (bufname:match "%.ya?ml$" and not bufname:match "%.github/")
|
||||
or bufname:match "%.json$"
|
||||
or bufname:match "%.toml$"
|
||||
or bufname:match "%.sh$"
|
||||
end,
|
||||
},
|
||||
},
|
||||
{ filetype = "neo-tree", text = "", padding = 0 },
|
||||
},
|
||||
},
|
||||
highlights = {
|
||||
@@ -146,6 +51,5 @@ return {
|
||||
error = { fg = "#f38ba8" },
|
||||
error_selected = { fg = "#f38ba8", bold = true },
|
||||
},
|
||||
}
|
||||
end,
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,329 @@
|
||||
--- Build tools and development environment optimizations
|
||||
--- Includes support for bun, vite, and modern JS tooling
|
||||
--- @module plugins.buildtools
|
||||
|
||||
---@type LazySpec
|
||||
return {
|
||||
-- Vim support for various config files
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
optional = true,
|
||||
opts = function(_, opts)
|
||||
if opts.ensure_installed ~= "all" then
|
||||
opts.ensure_installed = require("astrocore").list_insert_unique(opts.ensure_installed, {
|
||||
"toml",
|
||||
"yaml",
|
||||
"json",
|
||||
"jsonc",
|
||||
})
|
||||
end
|
||||
end,
|
||||
},
|
||||
|
||||
-- Enhanced JSON support with schema validation
|
||||
{
|
||||
"b0o/schemastore.nvim",
|
||||
lazy = true,
|
||||
dependencies = {
|
||||
{
|
||||
"AstroNvim/astrolsp",
|
||||
optional = true,
|
||||
---@type AstroLSPOpts
|
||||
opts = {
|
||||
---@diagnostic disable: missing-fields
|
||||
config = {
|
||||
jsonls = {
|
||||
on_new_config = function(config)
|
||||
if not config.settings.json then config.settings.json = {} end
|
||||
if not config.settings.json.schemas then config.settings.json.schemas = {} end
|
||||
vim.list_extend(config.settings.json.schemas, require("schemastore").json.schemas())
|
||||
end,
|
||||
settings = {
|
||||
json = {
|
||||
format = { enable = true },
|
||||
validate = { enable = true },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
-- YAML schema support
|
||||
{
|
||||
"AstroNvim/astrolsp",
|
||||
optional = true,
|
||||
---@type AstroLSPOpts
|
||||
opts = {
|
||||
---@diagnostic disable: missing-fields
|
||||
config = {
|
||||
yamlls = {
|
||||
on_new_config = function(config)
|
||||
config.settings.yaml.schemas =
|
||||
vim.tbl_deep_extend("force", config.settings.yaml.schemas or {}, require("schemastore").yaml.schemas())
|
||||
end,
|
||||
settings = {
|
||||
yaml = {
|
||||
schemaStore = {
|
||||
enable = false,
|
||||
url = "",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
-- Task runner integration (for vite, bun scripts)
|
||||
{
|
||||
"stevearc/overseer.nvim",
|
||||
cmd = {
|
||||
"OverseerRun",
|
||||
"OverseerToggle",
|
||||
"OverseerOpen",
|
||||
"OverseerClose",
|
||||
"OverseerLoadBundle",
|
||||
"OverseerSaveBundle",
|
||||
"OverseerDeleteBundle",
|
||||
"OverseerRunCmd",
|
||||
"OverseerQuickAction",
|
||||
"OverseerTaskAction",
|
||||
},
|
||||
opts = {
|
||||
strategy = {
|
||||
"toggleterm",
|
||||
use_shell = false,
|
||||
auto_scroll = true,
|
||||
close_on_exit = false,
|
||||
direction = "tab",
|
||||
quit_on_exit = "success",
|
||||
open_on_start = true,
|
||||
hidden = true,
|
||||
},
|
||||
templates = {
|
||||
"builtin",
|
||||
"bun.run",
|
||||
"npm.run",
|
||||
"vite.dev",
|
||||
"vite.build",
|
||||
},
|
||||
task_list = {
|
||||
bindings = {
|
||||
["<C-l>"] = false,
|
||||
["<C-h>"] = false,
|
||||
["<C-k>"] = false,
|
||||
["<C-j>"] = false,
|
||||
},
|
||||
},
|
||||
},
|
||||
config = function(_, opts)
|
||||
local overseer = require "overseer"
|
||||
overseer.setup(opts)
|
||||
|
||||
-- Custom task templates for bun
|
||||
overseer.register_template {
|
||||
name = "bun.run",
|
||||
builder = function(params)
|
||||
return {
|
||||
cmd = { "bun" },
|
||||
args = { "run", params.script },
|
||||
name = "bun run " .. params.script,
|
||||
components = { "default" },
|
||||
}
|
||||
end,
|
||||
params = {
|
||||
script = {
|
||||
type = "string",
|
||||
default = "dev",
|
||||
description = "Script to run from package.json",
|
||||
},
|
||||
},
|
||||
condition = {
|
||||
filetype = { "typescript", "javascript", "typescriptreact", "javascriptreact" },
|
||||
},
|
||||
}
|
||||
|
||||
-- Custom task templates for vite
|
||||
overseer.register_template {
|
||||
name = "vite.dev",
|
||||
builder = function()
|
||||
return {
|
||||
cmd = { "bun" },
|
||||
args = { "run", "dev" },
|
||||
name = "vite dev server",
|
||||
components = {
|
||||
{ "on_output_quickfix", open = false },
|
||||
"default",
|
||||
},
|
||||
}
|
||||
end,
|
||||
condition = {
|
||||
callback = function()
|
||||
return vim.fn.filereadable "vite.config.ts" == 1 or vim.fn.filereadable "vite.config.js" == 1
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
||||
overseer.register_template {
|
||||
name = "vite.build",
|
||||
builder = function()
|
||||
return {
|
||||
cmd = { "bun" },
|
||||
args = { "run", "build" },
|
||||
name = "vite build",
|
||||
components = {
|
||||
{ "on_output_quickfix", open = true },
|
||||
"default",
|
||||
},
|
||||
}
|
||||
end,
|
||||
condition = {
|
||||
callback = function()
|
||||
return vim.fn.filereadable "vite.config.ts" == 1 or vim.fn.filereadable "vite.config.js" == 1
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
||||
-- Register Devbox template for Overseer
|
||||
overseer.register_template {
|
||||
name = "devbox",
|
||||
params = {
|
||||
script = {
|
||||
type = "string",
|
||||
optional = false,
|
||||
desc = "The devbox script to run",
|
||||
},
|
||||
},
|
||||
strategy = {
|
||||
"toggleterm",
|
||||
use_shell = true,
|
||||
auto_scroll = true,
|
||||
close_on_exit = true,
|
||||
direction = "tab",
|
||||
quit_on_exit = "success",
|
||||
open_on_start = true,
|
||||
hidden = true,
|
||||
},
|
||||
condition = {
|
||||
callback = function()
|
||||
if vim.fn.executable "git" == 0 then return false, "git not found" end
|
||||
local git_root = vim.fn.systemlist("git rev-parse --show-toplevel")[1]
|
||||
if vim.v.shell_error ~= 0 or not git_root or git_root == "" then return false, "Not in a git repository" end
|
||||
local devbox_file = git_root .. "/devbox.json"
|
||||
if vim.fn.filereadable(devbox_file) == 0 then return false, "No devbox.json found in git root" end
|
||||
if vim.fn.executable "devbox" == 0 then return false, "devbox command not found" end
|
||||
return true
|
||||
end,
|
||||
},
|
||||
generator = function(_, cb)
|
||||
local git_root = vim.fn.systemlist("git rev-parse --show-toplevel")[1]
|
||||
if vim.v.shell_error ~= 0 or not git_root or git_root == "" then
|
||||
cb {}
|
||||
return
|
||||
end
|
||||
local devbox_file = git_root .. "/devbox.json"
|
||||
|
||||
local file = io.open(devbox_file, "r")
|
||||
if not file then
|
||||
cb {}
|
||||
return
|
||||
end
|
||||
local content = file:read "*all"
|
||||
file:close()
|
||||
local ok, data = pcall(vim.json.decode, content)
|
||||
if not ok or not data then
|
||||
cb {}
|
||||
return
|
||||
end
|
||||
|
||||
local tasks = {}
|
||||
if data.shell and data.shell.scripts then
|
||||
for script_name, _ in pairs(data.shell.scripts) do
|
||||
table.insert(tasks, {
|
||||
name = "devbox run " .. script_name,
|
||||
builder = function() return { cmd = { "devbox" }, args = { "run", script_name }, cwd = git_root } end,
|
||||
})
|
||||
end
|
||||
end
|
||||
table.insert(tasks, {
|
||||
name = "devbox shell",
|
||||
builder = function() return { cmd = { "devbox" }, args = { "shell" }, cwd = git_root } end,
|
||||
})
|
||||
cb(tasks)
|
||||
end,
|
||||
}
|
||||
end,
|
||||
},
|
||||
-- Seamless navigation between build errors
|
||||
{
|
||||
"folke/trouble.nvim",
|
||||
cmd = { "Trouble", "TroubleToggle" },
|
||||
opts = {
|
||||
use_diagnostic_signs = true,
|
||||
action_keys = {
|
||||
close = "q",
|
||||
cancel = "<esc>",
|
||||
refresh = "r",
|
||||
jump = { "<cr>", "<tab>" },
|
||||
open_split = { "<c-x>" },
|
||||
open_vsplit = { "<c-v>" },
|
||||
open_tab = { "<c-t>" },
|
||||
jump_close = { "o" },
|
||||
toggle_mode = "m",
|
||||
toggle_preview = "P",
|
||||
hover = "K",
|
||||
preview = "p",
|
||||
close_folds = { "zM", "zm" },
|
||||
open_folds = { "zR", "zr" },
|
||||
toggle_fold = { "zA", "za" },
|
||||
previous = "k",
|
||||
next = "j",
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
-- Git integration for collaborative development
|
||||
{
|
||||
"lewis6991/gitsigns.nvim",
|
||||
event = "User AstroGitFile",
|
||||
opts = {
|
||||
signs = {
|
||||
add = { text = "▎" },
|
||||
change = { text = "▎" },
|
||||
delete = { text = "" },
|
||||
topdelete = { text = "" },
|
||||
changedelete = { text = "▎" },
|
||||
untracked = { text = "▎" },
|
||||
},
|
||||
current_line_blame = false,
|
||||
current_line_blame_opts = {
|
||||
virt_text = true,
|
||||
virt_text_pos = "eol",
|
||||
delay = 300,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
-- EditorConfig support
|
||||
{
|
||||
"editorconfig/editorconfig-vim",
|
||||
event = { "BufReadPre", "BufNewFile" },
|
||||
},
|
||||
|
||||
-- Development container support
|
||||
{
|
||||
"esensar/nvim-dev-container",
|
||||
dependencies = { "nvim-treesitter/nvim-treesitter" },
|
||||
cmd = {
|
||||
"DevcontainerStart",
|
||||
"DevcontainerAttach",
|
||||
"DevcontainerExec",
|
||||
"DevcontainerStop",
|
||||
"DevcontainerLogs",
|
||||
},
|
||||
opts = {},
|
||||
},
|
||||
}
|
||||
@@ -1,439 +0,0 @@
|
||||
-- Function to read patterns from .rgignore file
|
||||
local function read_rgignore_patterns()
|
||||
local patterns = {}
|
||||
local git_root = vim.fn.systemlist("git rev-parse --show-toplevel")[1]
|
||||
|
||||
if git_root and git_root ~= "" then
|
||||
local rgignore_path = git_root .. "/.rgignore"
|
||||
local file = io.open(rgignore_path, "r")
|
||||
|
||||
if file then
|
||||
for line in file:lines() do
|
||||
-- Skip comments and empty lines
|
||||
if line ~= "" and not line:match "^#" then
|
||||
-- Remove leading ./ if present
|
||||
line = line:gsub("^%./", "")
|
||||
-- Add the pattern
|
||||
table.insert(patterns, line)
|
||||
end
|
||||
end
|
||||
file:close()
|
||||
end
|
||||
end
|
||||
|
||||
return patterns
|
||||
end
|
||||
|
||||
-- Build exclude patterns for snacks.explorer
|
||||
local function build_exclude_patterns()
|
||||
-- Get patterns from .rgignore
|
||||
local rgignore_patterns = read_rgignore_patterns()
|
||||
|
||||
-- Default hide patterns (from original neotree config)
|
||||
local hide_patterns = {
|
||||
"chain_*.json",
|
||||
"Library",
|
||||
".typecopy",
|
||||
".python-version",
|
||||
"*.pb.go",
|
||||
"*config.*.js",
|
||||
"*config.js",
|
||||
"deps.mjs",
|
||||
".parcelrc",
|
||||
"worker-configuration.d.ts",
|
||||
"wrangler.jsonc",
|
||||
"*.pkl.go",
|
||||
".trunk",
|
||||
".config",
|
||||
".cz.toml",
|
||||
"*_mock.go",
|
||||
}
|
||||
|
||||
-- Never show by pattern (from original neotree config)
|
||||
local never_show_by_pattern = {
|
||||
"*DS_Store",
|
||||
".obsidian",
|
||||
".pkl-lsp",
|
||||
".tsbuildinfo",
|
||||
"package-lock.json",
|
||||
".prettierrc",
|
||||
"node_modules",
|
||||
".DocumentRevisions-V100",
|
||||
".Spotlight-V100",
|
||||
".TemporaryItems",
|
||||
".Trashes",
|
||||
".fseventsd",
|
||||
".editorconfig",
|
||||
"*.min.js",
|
||||
"*.lock",
|
||||
"*lock*",
|
||||
"*.lockb",
|
||||
"*.pulsar.go",
|
||||
"*.pb.gorm.go",
|
||||
"*.pb.gw.go",
|
||||
"*_templ.go",
|
||||
"*.tmp",
|
||||
"*.work.*",
|
||||
"*.sum",
|
||||
".parcel-cache",
|
||||
"*.icns",
|
||||
"*.ico",
|
||||
".aider.tags.cache.v4",
|
||||
"*.iml",
|
||||
"Icon?",
|
||||
"iCloud~",
|
||||
"com~",
|
||||
"*.icns",
|
||||
".conform*",
|
||||
".null-ls_*",
|
||||
}
|
||||
|
||||
-- Never show directories (from original neotree config)
|
||||
local never_show = {
|
||||
".git",
|
||||
"pnpm-lock.yaml",
|
||||
".next",
|
||||
".task",
|
||||
".devbox",
|
||||
".dart_tool",
|
||||
".idea",
|
||||
".metadata",
|
||||
".venv",
|
||||
".gradle",
|
||||
"gradle.bat",
|
||||
".aider.chat.history.md",
|
||||
".aider.input.history",
|
||||
".aider.tags.cache.v3",
|
||||
".devcontainer",
|
||||
"heighliner",
|
||||
".tmp",
|
||||
"go.work.sum",
|
||||
".DS_Store",
|
||||
".git",
|
||||
"LICENSE",
|
||||
"tmp",
|
||||
"sonr.log",
|
||||
"DISCUSSION_TEMPLATE",
|
||||
"ISSUE_TEMPLATE",
|
||||
".devbox",
|
||||
".timemachine",
|
||||
"junit.xml",
|
||||
".jj",
|
||||
".spawn",
|
||||
".turbo",
|
||||
}
|
||||
|
||||
-- Merge all patterns
|
||||
local all_patterns = {}
|
||||
|
||||
-- Add default hide patterns
|
||||
for _, pattern in ipairs(hide_patterns) do
|
||||
table.insert(all_patterns, pattern)
|
||||
end
|
||||
|
||||
-- Add rgignore patterns
|
||||
for _, pattern in ipairs(rgignore_patterns) do
|
||||
table.insert(all_patterns, pattern)
|
||||
end
|
||||
|
||||
-- Add never show by pattern
|
||||
for _, pattern in ipairs(never_show_by_pattern) do
|
||||
table.insert(all_patterns, pattern)
|
||||
end
|
||||
|
||||
-- Add never show directories
|
||||
for _, pattern in ipairs(never_show) do
|
||||
table.insert(all_patterns, pattern)
|
||||
end
|
||||
|
||||
return all_patterns
|
||||
end
|
||||
|
||||
-- Custom transform function to filter items
|
||||
local function create_transform_filter()
|
||||
local exclude_patterns = build_exclude_patterns()
|
||||
|
||||
return function(item, ctx)
|
||||
if not item then return false end
|
||||
|
||||
local name = item.name or (item.file and vim.fn.fnamemodify(item.file, ":t")) or ""
|
||||
local path = item.file or ""
|
||||
|
||||
-- Check each pattern
|
||||
for _, pattern in ipairs(exclude_patterns) do
|
||||
-- Convert glob pattern to Lua pattern
|
||||
local lua_pattern = pattern
|
||||
:gsub("([%.%+%-%[%]%(%)%$%^%%%?])", "%%%1") -- Escape special chars except *
|
||||
:gsub("%*%*", ".*") -- ** matches any characters including /
|
||||
:gsub("%*", "[^/]*") -- * matches any characters except /
|
||||
:gsub("%?", ".") -- ? matches single character
|
||||
|
||||
-- Check against filename
|
||||
if name:match("^" .. lua_pattern .. "$") then
|
||||
return false -- Filter out this item
|
||||
end
|
||||
|
||||
-- Check against full path
|
||||
if path:match("/" .. lua_pattern .. "$") or path:match("/" .. lua_pattern .. "/") then
|
||||
return false -- Filter out this item
|
||||
end
|
||||
end
|
||||
|
||||
return item -- Keep the item
|
||||
end
|
||||
end
|
||||
|
||||
return {
|
||||
{
|
||||
"folke/snacks.nvim",
|
||||
priority = 1000,
|
||||
lazy = false,
|
||||
---@type snacks.Config
|
||||
opts = function()
|
||||
return {
|
||||
-- Enable explorer and replace netrw
|
||||
explorer = {
|
||||
replace_netrw = true,
|
||||
},
|
||||
-- Dashboard configuration
|
||||
dashboard = {
|
||||
preset = {
|
||||
header = table.concat({
|
||||
"",
|
||||
"",
|
||||
" ████████ ",
|
||||
" ██████████████ ",
|
||||
" ████████████████ ",
|
||||
" ██████████ █████ ",
|
||||
" ██████████ █ ",
|
||||
" ██████████ █████ ",
|
||||
" █████████ █████████ ",
|
||||
" █████████ ████ █████████ ",
|
||||
" ████████ ████████ ████████ ",
|
||||
"███████ ████████████ ███████",
|
||||
"███████ ██████████████ ██████",
|
||||
"███████ ████████████ ███████",
|
||||
" ████████ ████████ ████████ ",
|
||||
" █████████ ████ █████████ ",
|
||||
" ████████ ██████████ ",
|
||||
" ██████ ██████████ ",
|
||||
" ██ █████████ ",
|
||||
" ████ ██████████ ",
|
||||
" ████████████████ ",
|
||||
" ██████████████ ",
|
||||
" ████████ ",
|
||||
"",
|
||||
"",
|
||||
}, "\n"),
|
||||
},
|
||||
sections = {
|
||||
{ section = "header" },
|
||||
{
|
||||
pane = 2,
|
||||
section = "terminal",
|
||||
cmd = "colorscript -e square",
|
||||
height = 5,
|
||||
padding = 1,
|
||||
},
|
||||
{ section = "keys", gap = 1, padding = 1 },
|
||||
{
|
||||
pane = 2,
|
||||
icon = " ",
|
||||
desc = "Browse Repo",
|
||||
padding = 1,
|
||||
key = "b",
|
||||
action = function() require("snacks").gitbrowse() end,
|
||||
},
|
||||
function()
|
||||
local in_git = require("snacks").git.get_root() ~= nil
|
||||
local cmds = {
|
||||
{
|
||||
title = "Notifications",
|
||||
cmd = "gh notify -s -a -n5",
|
||||
action = function() vim.ui.open "https://github.com/notifications" end,
|
||||
key = "n",
|
||||
icon = " ",
|
||||
height = 5,
|
||||
enabled = true,
|
||||
},
|
||||
{
|
||||
title = "Open Issues",
|
||||
cmd = "gh issue list -L 3",
|
||||
key = "i",
|
||||
action = function() vim.fn.jobstart("gh issue list --web", { detach = true }) end,
|
||||
icon = " ",
|
||||
height = 7,
|
||||
},
|
||||
{
|
||||
icon = " ",
|
||||
title = "Open PRs",
|
||||
cmd = "gh pr list -L 3",
|
||||
key = "P",
|
||||
action = function() vim.fn.jobstart("gh pr list --web", { detach = true }) end,
|
||||
height = 7,
|
||||
},
|
||||
{
|
||||
icon = " ",
|
||||
title = "Git Status",
|
||||
cmd = "git --no-pager diff --stat -B -M -C",
|
||||
height = 10,
|
||||
},
|
||||
}
|
||||
return vim.tbl_map(
|
||||
function(cmd)
|
||||
return vim.tbl_extend("force", {
|
||||
pane = 2,
|
||||
section = "terminal",
|
||||
enabled = in_git,
|
||||
padding = 1,
|
||||
ttl = 5 * 60,
|
||||
indent = 3,
|
||||
}, cmd)
|
||||
end,
|
||||
cmds
|
||||
)
|
||||
end,
|
||||
{ section = "startup" },
|
||||
},
|
||||
},
|
||||
-- Configure the explorer picker source
|
||||
picker = {
|
||||
sources = {
|
||||
explorer = {
|
||||
-- Explorer configuration matching neotree
|
||||
tree = true,
|
||||
hidden = true, -- Show hidden files by default (. files)
|
||||
ignored = false, -- Don't show gitignored files
|
||||
follow_file = true,
|
||||
git_status = true,
|
||||
git_untracked = true,
|
||||
diagnostics = true,
|
||||
watch = true,
|
||||
-- Use transform to filter out unwanted files/directories
|
||||
transform = create_transform_filter(),
|
||||
focus = "list",
|
||||
auto_close = false,
|
||||
jump = { close = true }, -- Close explorer when jumping to a file
|
||||
layout = {
|
||||
preset = "sidebar",
|
||||
preview = false,
|
||||
layout = {
|
||||
width = 34,
|
||||
},
|
||||
},
|
||||
formatters = {
|
||||
file = { filename_only = true },
|
||||
},
|
||||
matcher = { sort_empty = false, fuzzy = false },
|
||||
win = {
|
||||
list = {
|
||||
keys = {
|
||||
-- Navigation (matching neotree)
|
||||
["H"] = "explorer_up", -- Navigate to parent directory
|
||||
["L"] = "explorer_focus", -- Open file/expand directory (with auto-close for files)
|
||||
["<CR>"] = "confirm", -- Open file/expand directory (with auto-close for files)
|
||||
["<S-CR>"] = "confirm", -- Open without closing
|
||||
["<BS>"] = "explorer_close_all", -- Collapse all folders
|
||||
["!"] = "toggle_ignored", -- Toggle ignored files
|
||||
["."] = "toggle_hidden", -- Toggle hidden files
|
||||
["/"] = function(self)
|
||||
-- Focus search input
|
||||
self:focus "input"
|
||||
end,
|
||||
["f"] = function(self)
|
||||
-- Focus search input (filter)
|
||||
self:focus "input"
|
||||
end,
|
||||
["<c-x>"] = function(self)
|
||||
-- Clear filter
|
||||
self.input:set ""
|
||||
end,
|
||||
["s"] = "edit_vsplit", -- Open in vertical split
|
||||
["S"] = "edit_split", -- Open in horizontal split
|
||||
["t"] = "tab", -- Open in new tab
|
||||
|
||||
-- File operations
|
||||
["a"] = "explorer_add", -- Add file
|
||||
["d"] = "explorer_del", -- Delete
|
||||
["r"] = "explorer_rename", -- Rename
|
||||
["y"] = "explorer_yank", -- Copy
|
||||
["x"] = "explorer_move", -- Cut/Move
|
||||
["p"] = "explorer_paste", -- Paste
|
||||
["c"] = "explorer_yank", -- Copy to clipboard
|
||||
["R"] = "explorer_update", -- Refresh
|
||||
-- Git keybindings from neotree
|
||||
["<C-g>o"] = function() vim.cmd "!gh repo view --web" end,
|
||||
["<C-g>h"] = function()
|
||||
require("snacks").terminal("gh dash", {
|
||||
hidden = true,
|
||||
auto_close = false,
|
||||
interactive = true,
|
||||
})
|
||||
end,
|
||||
["<C-g>g"] = function()
|
||||
require("snacks").terminal("lazygit", {
|
||||
hidden = true,
|
||||
auto_close = true,
|
||||
interactive = true,
|
||||
})
|
||||
end,
|
||||
["<C-g>d"] = function() require("snacks").picker.git_diff() end,
|
||||
["<C-g>b"] = function() require("snacks").picker.git_branches() end,
|
||||
-- Terminal keybindings from neotree
|
||||
["<C-t>m"] = function() _G.Mk_toggle() end,
|
||||
["<C-t>j"] = function() _G.Lazyjournal_toggle() end,
|
||||
["<C-t>l"] = function()
|
||||
require("snacks").terminal("lazydocker", {
|
||||
hidden = true,
|
||||
auto_close = true,
|
||||
start_in_insert = true,
|
||||
interactive = true,
|
||||
})
|
||||
end,
|
||||
["<C-t>du"] = function()
|
||||
require("snacks").terminal("devbox services up", {
|
||||
hidden = true,
|
||||
auto_close = false,
|
||||
start_in_insert = true,
|
||||
interactive = true,
|
||||
})
|
||||
end,
|
||||
["<C-t>dd"] = function()
|
||||
require("snacks").terminal("devbox services down", {
|
||||
hidden = true,
|
||||
auto_close = false,
|
||||
start_in_insert = true,
|
||||
interactive = true,
|
||||
})
|
||||
end,
|
||||
["<C-t>da"] = function()
|
||||
require("snacks").terminal("devbox services attach", {
|
||||
hidden = true,
|
||||
auto_close = false,
|
||||
start_in_insert = true,
|
||||
interactive = true,
|
||||
})
|
||||
end,
|
||||
["<C-t>."] = function() _G.Yazi_toggle() end,
|
||||
["<C-t>t"] = function() require("snacks").terminal() end,
|
||||
-- Additional navigation
|
||||
["h"] = "explorer_close", -- Close directory
|
||||
["l"] = "confirm", -- Open/expand
|
||||
["o"] = "explorer_open", -- Open with system application
|
||||
["P"] = "toggle_preview",
|
||||
["I"] = "toggle_ignored",
|
||||
["Z"] = "explorer_close_all",
|
||||
["]g"] = "explorer_git_next",
|
||||
["[g"] = "explorer_git_prev",
|
||||
["]d"] = "explorer_diagnostic_next",
|
||||
["[d"] = "explorer_diagnostic_prev",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
end,
|
||||
},
|
||||
}
|
||||
+14
-12
@@ -1,4 +1,6 @@
|
||||
-- Customize Mason
|
||||
-- This file configures non-LSP tools (formatters, linters, debuggers, etc.)
|
||||
-- LSP servers are configured in astrolsp.lua via mason-lspconfig
|
||||
|
||||
---@type LazySpec
|
||||
return {
|
||||
@@ -9,23 +11,23 @@ return {
|
||||
opts = {
|
||||
-- Make sure to use the names found in `:Mason`
|
||||
ensure_installed = {
|
||||
-- install language servers
|
||||
"lua-language-server",
|
||||
"golangci-lint-langserver",
|
||||
"pkl-lsp",
|
||||
|
||||
-- install formatters
|
||||
-- Formatters (non-LSP)
|
||||
"stylua",
|
||||
"rustfmt",
|
||||
"taplo",
|
||||
|
||||
-- install debuggers
|
||||
-- Linters
|
||||
"stylelint",
|
||||
"markdownlint",
|
||||
|
||||
-- Debuggers
|
||||
"debugpy",
|
||||
|
||||
-- install any other package
|
||||
-- Other tools
|
||||
"tree-sitter-cli",
|
||||
"protols",
|
||||
"protolint",
|
||||
"templ",
|
||||
"yamlfmt",
|
||||
|
||||
-- Note: oxlint and oxfmt should be installed separately via cargo/npm
|
||||
-- Note: LSP servers are configured in astrolsp.lua
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
@@ -0,0 +1,367 @@
|
||||
--- Neo-tree configuration with dynamic pattern filtering
|
||||
--- @module plugins.neotree
|
||||
|
||||
-- Import shared modules
|
||||
local ignore_patterns = require "config.ignore_patterns"
|
||||
local terminals = require "config.terminals"
|
||||
|
||||
---@type LazySpec
|
||||
return {
|
||||
{
|
||||
"neo-tree.nvim",
|
||||
init = function()
|
||||
-- Autocmd to refresh neo-tree patterns when switching between repos
|
||||
vim.api.nvim_create_autocmd({ "BufEnter", "DirChanged" }, {
|
||||
callback = function()
|
||||
-- Defer to let buffer settle
|
||||
vim.defer_fn(function()
|
||||
local ok, manager = pcall(require, "neo-tree.sources.manager")
|
||||
if ok then
|
||||
-- Silently refresh if neo-tree is loaded
|
||||
pcall(manager.refresh, "filesystem")
|
||||
end
|
||||
end, 100)
|
||||
end,
|
||||
})
|
||||
end,
|
||||
opts = function()
|
||||
-- Get all hide patterns from shared module
|
||||
local hide_patterns = ignore_patterns.get_all_patterns()
|
||||
|
||||
return {
|
||||
|
||||
popup_border_style = "rounded",
|
||||
enable_git_status = true,
|
||||
enable_diagnostics = true,
|
||||
sort_case_insensitive = false,
|
||||
auto_expand_width = true,
|
||||
git_status_async = true, -- Asynchronous git status. Improves performance.
|
||||
hide_root_node = true, -- Hide the root node.
|
||||
retain_hidden_root_indent = true, -- IF the root node is hidden, keep the indentation anyhow.
|
||||
use_libuv_file_watcher = false,
|
||||
sort = {
|
||||
sorter = "name",
|
||||
},
|
||||
window = {
|
||||
position = "left",
|
||||
width = 34,
|
||||
mappings = {
|
||||
["H"] = "navigate_up",
|
||||
["L"] = function(state)
|
||||
require("neo-tree.sources.filesystem.commands").set_root(state)
|
||||
-- Refresh patterns when changing root
|
||||
vim.defer_fn(function()
|
||||
local new_patterns = ignore_patterns.get_all_patterns()
|
||||
require("neo-tree").config.filesystem.filtered_items.hide_by_pattern = new_patterns
|
||||
require("neo-tree.sources.manager").refresh "filesystem"
|
||||
end, 50)
|
||||
end,
|
||||
["<bs>"] = "toggle_hidden",
|
||||
["."] = "toggle_hidden",
|
||||
["/"] = "fuzzy_finder",
|
||||
["f"] = "filter_on_submit",
|
||||
["<c-x>"] = "clear_filter",
|
||||
["<CR>"] = "open_and_close_neotree",
|
||||
["<S-CR>"] = "open",
|
||||
-- Avante integration
|
||||
["<C-a>"] = "avante_add_files",
|
||||
-- Git keybindings from astrocore
|
||||
["<C-g>o"] = function() vim.cmd "!gh repo view --web" end,
|
||||
["<C-g>h"] = function()
|
||||
require("snacks").terminal("gh dash", {
|
||||
hidden = true,
|
||||
auto_close = false,
|
||||
interactive = true,
|
||||
})
|
||||
end,
|
||||
["<C-g>g"] = function()
|
||||
require("snacks").terminal("lazygit", {
|
||||
hidden = true,
|
||||
auto_close = true,
|
||||
interactive = true,
|
||||
})
|
||||
end,
|
||||
["<C-g>d"] = function() require("snacks").picker.git_diff() end,
|
||||
["<C-g>b"] = function() require("snacks").picker.git_branches() end,
|
||||
-- Terminal keybindings from astrocore
|
||||
["<C-t>m"] = terminals.mk_toggle,
|
||||
["<C-t>l"] = function()
|
||||
require("snacks").terminal("lazydocker", {
|
||||
hidden = true,
|
||||
auto_close = true,
|
||||
start_in_insert = true,
|
||||
interactive = true,
|
||||
})
|
||||
end,
|
||||
["<C-t>du"] = function()
|
||||
require("snacks").terminal("devbox services up", {
|
||||
hidden = true,
|
||||
auto_close = false,
|
||||
start_in_insert = true,
|
||||
interactive = true,
|
||||
})
|
||||
end,
|
||||
["<C-t>dd"] = function()
|
||||
require("snacks").terminal("devbox services down", {
|
||||
hidden = true,
|
||||
auto_close = false,
|
||||
start_in_insert = true,
|
||||
interactive = true,
|
||||
})
|
||||
end,
|
||||
["<C-t>da"] = function()
|
||||
require("snacks").terminal("devbox services attach", {
|
||||
hidden = true,
|
||||
auto_close = false,
|
||||
start_in_insert = true,
|
||||
interactive = true,
|
||||
})
|
||||
end,
|
||||
["<C-t>."] = terminals.yazi_toggle,
|
||||
["<C-t>t"] = function() require("snacks").terminal() end,
|
||||
-- Find keybindings from astrocore
|
||||
-- These Find keybindings are defined in astrocore.lua
|
||||
-- NeoTree only needs the basic navigation and terminal bindings
|
||||
-- Mappings for Mason and formatting
|
||||
["N"] = function(state)
|
||||
local node = state.tree:get_node()
|
||||
local path = node.type == "directory" and node.path or vim.fn.fnamemodify(node.path, ":h")
|
||||
|
||||
-- Check if running on Arch Linux
|
||||
local is_arch = vim.fn.filereadable "/etc/arch-release" == 1
|
||||
|
||||
if is_arch then
|
||||
-- Use uwsm to launch alacritty with yazi on Arch Linux
|
||||
vim.fn.jobstart(
|
||||
string.format("uwsm app -- alacritty --working-directory %s -e yazi", vim.fn.shellescape(path)),
|
||||
{
|
||||
detach = true,
|
||||
}
|
||||
)
|
||||
else
|
||||
-- Fallback to direct alacritty launch with yazi on other systems
|
||||
vim.fn.jobstart(string.format("alacritty --working-directory %s -e yazi", vim.fn.shellescape(path)), {
|
||||
detach = true,
|
||||
})
|
||||
end
|
||||
end,
|
||||
},
|
||||
header = {
|
||||
highlight = "NeoTreeHeader",
|
||||
},
|
||||
},
|
||||
default_component_configs = {
|
||||
container = {
|
||||
enable_character_fade = true,
|
||||
},
|
||||
indent = {
|
||||
indent_size = 2,
|
||||
padding = 1, -- extra padding on left hand side
|
||||
-- indent guides
|
||||
with_markers = true,
|
||||
indent_marker = "│",
|
||||
last_indent_marker = "└",
|
||||
highlight = "NeoTreeIndentMarker",
|
||||
-- expander config, needed for nesting files
|
||||
expander_collapsed = "",
|
||||
expander_expanded = "",
|
||||
expander_highlight = "NeoTreeExpander",
|
||||
},
|
||||
name = {
|
||||
trailing_slash = false, -- append a trailing slash to folder names
|
||||
use_git_status_colors = true, -- use git status colors instead of the default colors
|
||||
highlight = "NeoTreeFileName",
|
||||
},
|
||||
git_status = {
|
||||
symbols = {
|
||||
-- Change type
|
||||
added = "", -- or "✚", but this is redundant info if you use git_status_colors on the name
|
||||
modified = "", -- or "", but this is redundant info if you use git_status_colors on the name
|
||||
deleted = "✖", -- this can only be used in the git_status source
|
||||
renamed = "", -- this can only be used in the git_status source
|
||||
-- Status type
|
||||
untracked = "",
|
||||
ignored = "",
|
||||
unstaged = "",
|
||||
staged = "",
|
||||
conflict = "",
|
||||
},
|
||||
},
|
||||
-- If you don't want to use these columns, you can set `enabled = false` for each of them individually
|
||||
file_size = {
|
||||
enabled = true,
|
||||
width = 12, -- width of the column
|
||||
required_width = 48, -- min width of window required to show this column
|
||||
},
|
||||
type = {
|
||||
enabled = true,
|
||||
width = 10, -- width of the column
|
||||
required_width = 122, -- min width of window required to show this column
|
||||
},
|
||||
last_modified = {
|
||||
enabled = true,
|
||||
width = 20, -- width of the column
|
||||
required_width = 88, -- min width of window required to show this column
|
||||
},
|
||||
created = {
|
||||
enabled = true,
|
||||
width = 20, -- width of the column
|
||||
required_width = 110, -- min width of window required to show this column
|
||||
},
|
||||
symlink_target = {
|
||||
enabled = false,
|
||||
},
|
||||
},
|
||||
|
||||
buffers = {
|
||||
follow_current_file = {
|
||||
enabled = true,
|
||||
},
|
||||
},
|
||||
|
||||
-- Filesystem specific settings
|
||||
filesystem = {
|
||||
commands = {
|
||||
-- Avante integration: Add files to avante selected files
|
||||
avante_add_files = function(state)
|
||||
local node = state.tree:get_node()
|
||||
local filepath = node:get_id()
|
||||
local relative_path = require("avante.utils").relative_path(filepath)
|
||||
|
||||
local sidebar = require("avante").get()
|
||||
|
||||
local open = sidebar:is_open()
|
||||
-- ensure avante sidebar is open
|
||||
if not open then
|
||||
require("avante.api").ask()
|
||||
sidebar = require("avante").get()
|
||||
end
|
||||
|
||||
sidebar.file_selector:add_selected_file(relative_path)
|
||||
|
||||
-- remove neo tree buffer
|
||||
if not open then sidebar.file_selector:remove_selected_file "neo-tree filesystem [1]" end
|
||||
end,
|
||||
-- Refresh patterns when changing directories
|
||||
refresh_patterns = function(state)
|
||||
-- Re-read patterns when navigating
|
||||
local new_patterns = ignore_patterns.get_all_patterns()
|
||||
state.filtered_items.hide_by_pattern = new_patterns
|
||||
require("neo-tree.sources.manager").refresh "filesystem"
|
||||
end,
|
||||
-- If item is a file it will close neotree after opening it.
|
||||
open_and_close_neotree = function(state)
|
||||
require("neo-tree.sources.filesystem.commands").open(state)
|
||||
local tree = state.tree
|
||||
local success, node = pcall(tree.get_node, tree)
|
||||
if not success then return end
|
||||
if node.type == "file" then require("neo-tree.command").execute { action = "close" } end
|
||||
end,
|
||||
|
||||
-- Custom command to open Mason
|
||||
mason_open = function() vim.cmd "Mason" end,
|
||||
|
||||
-- Custom command to format a file using the LSP
|
||||
format_file = function(state)
|
||||
local node = state.tree:get_node()
|
||||
if node and node.type == "file" then
|
||||
-- Format the file in a temporary buffer without opening it in a window
|
||||
local bufnr = vim.api.nvim_create_buf(false, true)
|
||||
vim.api.nvim_buf_set_name(bufnr, node.path)
|
||||
vim.api.nvim_buf_load(bufnr)
|
||||
vim.lsp.buf.format { bufnr = bufnr, async = false, timeout_ms = 5000 }
|
||||
vim.api.nvim_buf_call(bufnr, function() vim.cmd "write" end)
|
||||
vim.notify("Formatted " .. vim.fs.basename(node.path), vim.log.levels.INFO, { title = "Neo-tree" })
|
||||
else
|
||||
vim.notify("Not a file", vim.log.levels.WARN, { title = "Neo-tree" })
|
||||
end
|
||||
end,
|
||||
},
|
||||
bind_to_cwd = true,
|
||||
follow_current_file = {
|
||||
enabled = true,
|
||||
leave_dirs_open = false,
|
||||
},
|
||||
filtered_items = {
|
||||
force_visible_in_empty_folder = false,
|
||||
group_empty = false,
|
||||
show_hidden_count = false,
|
||||
hide_dotfiles = false,
|
||||
hide_gitignored = true,
|
||||
hide_by_pattern = hide_patterns,
|
||||
always_show = {},
|
||||
always_show_by_pattern = {},
|
||||
visible = function(item)
|
||||
-- Hide all symlinks
|
||||
if item.type == "link" then return false end
|
||||
return true
|
||||
end,
|
||||
hide_by_name = {
|
||||
-- "contracts",
|
||||
-- "crypto",
|
||||
-- "CONSTITUTION.md",
|
||||
-- "CONTRIBUTING.md",
|
||||
-- "api",
|
||||
-- "turbo.json",
|
||||
-- "OpenCode.md",
|
||||
-- "AGENT.md",
|
||||
-- "AGENTS.md",
|
||||
-- "svgo.config.mjs",
|
||||
-- ".prettierrc.cjs",
|
||||
-- ".eslintrc.cjs",
|
||||
-- "tsconfig.json",
|
||||
-- "tsconfig.prod.json",
|
||||
-- ".prettierignore",
|
||||
-- "CONVENTIONS.md",
|
||||
-- ".gitkeep",
|
||||
-- ".source",
|
||||
-- "settings.json",
|
||||
-- ".gitignore",
|
||||
-- "analysis_options.yaml",
|
||||
-- "slumber.yml",
|
||||
-- ".eslintignore",
|
||||
-- "CONTRIBUTING.md",
|
||||
-- "CHANGELOG.md",
|
||||
-- "devbox.d",
|
||||
-- "env",
|
||||
-- ".husky",
|
||||
-- "translations",
|
||||
-- "LICENSE.md",
|
||||
-- ".envrc",
|
||||
-- "CLAUDE.md",
|
||||
-- "chains",
|
||||
-- "test",
|
||||
-- ".golangci.yml",
|
||||
-- "go.mod",
|
||||
-- "pnpm-workspace.yaml",
|
||||
-- "examples",
|
||||
-- "bridge",
|
||||
-- "client",
|
||||
},
|
||||
never_show_by_pattern = ignore_patterns.never_show_patterns,
|
||||
never_show = ignore_patterns.never_show,
|
||||
},
|
||||
},
|
||||
diagnostics = {
|
||||
enable = false,
|
||||
icons = {
|
||||
hint = "",
|
||||
info = "",
|
||||
warning = "",
|
||||
error = "",
|
||||
},
|
||||
},
|
||||
|
||||
source_selector = {
|
||||
winbar = false,
|
||||
statusline = false,
|
||||
},
|
||||
|
||||
-- Main sources
|
||||
sources = {
|
||||
"filesystem",
|
||||
},
|
||||
}
|
||||
end,
|
||||
},
|
||||
}
|
||||
@@ -1,76 +0,0 @@
|
||||
return {
|
||||
"obsidian-nvim/obsidian.nvim",
|
||||
-- the obsidian vault in this default config ~/obsidian-vault
|
||||
-- If you want to use the home shortcut '~' here you need to call 'vim.fn.expand':
|
||||
event = { "bufreadpre " .. vim.fn.expand "~" .. "/Notes/**.md" },
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
{ "hrsh7th/nvim-cmp", optional = true },
|
||||
{
|
||||
"AstroNvim/astrocore",
|
||||
opts = {
|
||||
mappings = {
|
||||
n = {
|
||||
["gf"] = {
|
||||
function()
|
||||
if require("obsidian").util.cursor_on_markdown_link() then
|
||||
return "<Cmd>Obsidian follow_link<CR>"
|
||||
else
|
||||
return "gf"
|
||||
end
|
||||
end,
|
||||
desc = "Obsidian Follow Link",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
opts = function(_, opts)
|
||||
local astrocore = require "astrocore"
|
||||
return astrocore.extend_tbl(opts, {
|
||||
workspaces = {
|
||||
{
|
||||
path = vim.env.HOME .. "/Notes", -- specify the vault location. no need to call 'vim.fn.expand' here
|
||||
},
|
||||
},
|
||||
open = {
|
||||
use_advanced_uri = true,
|
||||
},
|
||||
finder = (astrocore.is_available "snacks.pick" and "snacks.pick")
|
||||
or (astrocore.is_available "telescope.nvim" and "telescope.nvim")
|
||||
or (astrocore.is_available "fzf-lua" and "fzf-lua")
|
||||
or (astrocore.is_available "mini.pick" and "mini.pick"),
|
||||
|
||||
templates = {
|
||||
subdir = "2 - Areas/Templates",
|
||||
date_format = "%Y-%m-%d-%a",
|
||||
time_format = "%H:%M",
|
||||
},
|
||||
daily_notes = {
|
||||
folder = "3 - Journals",
|
||||
},
|
||||
completion = {
|
||||
nvim_cmp = astrocore.is_available "nvim-cmp",
|
||||
blink = astrocore.is_available "blink",
|
||||
},
|
||||
|
||||
note_frontmatter_func = function(note)
|
||||
-- This is equivalent to the default frontmatter function.
|
||||
local out = { id = note.id, aliases = note.aliases, tags = note.tags }
|
||||
-- `note.metadata` contains any manually added fields in the frontmatter.
|
||||
-- So here we just make sure those fields are kept in the frontmatter.
|
||||
if note.metadata ~= nil and not vim.tbl_isempty(note.metadata) then
|
||||
for k, v in pairs(note.metadata) do
|
||||
out[k] = v
|
||||
end
|
||||
end
|
||||
return out
|
||||
end,
|
||||
|
||||
-- Optional, by default when you use `:ObsidianFollowLink` on a link to an external
|
||||
-- URL it will be ignored but you can customize this behavior here.
|
||||
follow_url_func = vim.ui.open,
|
||||
})
|
||||
end,
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
--- Snacks.nvim configuration
|
||||
--- Overrides and customizations for snacks.nvim features
|
||||
--- Relies on astrocommunity.recipes.telescope-nvim-snacks for base setup
|
||||
--- @module plugins.snacks
|
||||
|
||||
return {
|
||||
"folke/snacks.nvim",
|
||||
opts = {
|
||||
-- Disable dashboard - we use custom startup picker in astrocore.lua
|
||||
dashboard = { enabled = false },
|
||||
|
||||
-- Enable snacks features we use throughout config
|
||||
bigfile = { enabled = true },
|
||||
input = { enabled = true },
|
||||
notifier = { enabled = true },
|
||||
picker = { enabled = true },
|
||||
quickfile = { enabled = true },
|
||||
rename = { enabled = true },
|
||||
scope = { enabled = true },
|
||||
scroll = { enabled = true },
|
||||
statuscolumn = { enabled = true },
|
||||
terminal = { enabled = true },
|
||||
words = { enabled = true },
|
||||
indent = { enabled = true },
|
||||
|
||||
-- Terminal styles
|
||||
styles = {
|
||||
terminal = {
|
||||
bo = { filetype = "snacks_terminal" },
|
||||
wo = {},
|
||||
keys = {
|
||||
q = "hide",
|
||||
term_normal = {
|
||||
"<esc>",
|
||||
function(self)
|
||||
self.esc_timer = self.esc_timer or (vim.uv or vim.loop).new_timer()
|
||||
if self.esc_timer:is_active() then
|
||||
self.esc_timer:stop()
|
||||
vim.cmd "stopinsert"
|
||||
else
|
||||
self.esc_timer:start(200, 0, function() end)
|
||||
return "<esc>"
|
||||
end
|
||||
end,
|
||||
mode = "t",
|
||||
expr = true,
|
||||
desc = "Double escape to normal mode",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
--- Supermaven - Fast AI code completion
|
||||
--- @module plugins.supermaven
|
||||
return {
|
||||
"supermaven-inc/supermaven-nvim",
|
||||
config = function()
|
||||
require("supermaven-nvim").setup({
|
||||
keymaps = {
|
||||
accept_suggestion = "<C-l>",
|
||||
clear_suggestion = "<C-]>",
|
||||
accept_word = "<C-j>",
|
||||
},
|
||||
ignore_filetypes = { "cpp" },
|
||||
color = {
|
||||
suggestion_color = "#ffffff",
|
||||
cterm = 244,
|
||||
},
|
||||
log_level = "info", -- set to "off" to disable logging completely
|
||||
disable_inline_completion = false, -- disables inline completion for use with cmp
|
||||
disable_keymaps = false, -- disables built in keymaps for more manual control
|
||||
})
|
||||
end,
|
||||
}
|
||||
+25
-89
@@ -4,98 +4,34 @@
|
||||
-- Remove <leader>h mapping (conflicts with Telescope)
|
||||
vim.api.nvim_del_keymap("n", "<leader>h")
|
||||
|
||||
-- Overseer setup and template (optional)
|
||||
local ok_overseer, overseer = pcall(require, "overseer")
|
||||
if ok_overseer then
|
||||
overseer.setup {
|
||||
strategy = {
|
||||
"toggleterm",
|
||||
use_shell = false,
|
||||
auto_scroll = true,
|
||||
close_on_exit = false,
|
||||
direction = "vertical",
|
||||
quit_on_exit = "success",
|
||||
open_on_start = true,
|
||||
hidden = true,
|
||||
},
|
||||
}
|
||||
end
|
||||
-- Screen session integration: Handle suspend/resume gracefully
|
||||
local screen_augroup = vim.api.nvim_create_augroup("ScreenIntegration", { clear = true })
|
||||
|
||||
-- ToggleTerm setup (optional)
|
||||
local ok_toggleterm, toggleterm = pcall(require, "toggleterm")
|
||||
if ok_toggleterm then
|
||||
toggleterm.setup {
|
||||
size = function(term)
|
||||
if term.direction == "horizontal" then
|
||||
return 15
|
||||
elseif term.direction == "vertical" then
|
||||
return math.floor(vim.o.columns * 0.35)
|
||||
else
|
||||
return 20
|
||||
end
|
||||
end,
|
||||
shade_terminals = false,
|
||||
start_in_insert = true,
|
||||
}
|
||||
end
|
||||
|
||||
-- Register Devbox template for Overseer (if available)
|
||||
if ok_overseer then
|
||||
overseer.register_template {
|
||||
name = "devbox",
|
||||
params = {
|
||||
script = {
|
||||
type = "string",
|
||||
optional = false,
|
||||
desc = "The devbox script to run",
|
||||
},
|
||||
},
|
||||
condition = {
|
||||
-- Before suspension (Screen detach), save all buffers
|
||||
vim.api.nvim_create_autocmd("VimSuspend", {
|
||||
group = screen_augroup,
|
||||
callback = function()
|
||||
if vim.fn.executable "git" == 0 then return false, "git not found" end
|
||||
local git_root = vim.fn.systemlist("git rev-parse --show-toplevel")[1]
|
||||
if vim.v.shell_error ~= 0 or not git_root or git_root == "" then return false, "Not in a git repository" end
|
||||
local devbox_file = git_root .. "/devbox.json"
|
||||
if vim.fn.filereadable(devbox_file) == 0 then return false, "No devbox.json found in git root" end
|
||||
if vim.fn.executable "devbox" == 0 then return false, "devbox command not found" end
|
||||
return true
|
||||
-- Save all modified buffers before suspension
|
||||
vim.cmd "silent! wa"
|
||||
-- Save session if in a Screen session
|
||||
if vim.env.STY ~= nil and vim.env.STY ~= "" then
|
||||
local session_name = vim.env.STY:match "[^%.]+%.(.+)"
|
||||
vim.notify("Suspending from Screen session: " .. (session_name or vim.env.STY), vim.log.levels.INFO)
|
||||
end
|
||||
end,
|
||||
},
|
||||
generator = function(_, cb)
|
||||
local git_root = vim.fn.systemlist("git rev-parse --show-toplevel")[1]
|
||||
if vim.v.shell_error ~= 0 or not git_root or git_root == "" then
|
||||
cb {}
|
||||
return
|
||||
end
|
||||
local devbox_file = git_root .. "/devbox.json"
|
||||
|
||||
local file = io.open(devbox_file, "r")
|
||||
if not file then
|
||||
cb {}
|
||||
return
|
||||
end
|
||||
local content = file:read "*all"
|
||||
file:close()
|
||||
local ok, data = pcall(vim.json.decode, content)
|
||||
if not ok or not data then
|
||||
cb {}
|
||||
return
|
||||
end
|
||||
|
||||
local tasks = {}
|
||||
if data.shell and data.shell.scripts then
|
||||
for script_name, _ in pairs(data.shell.scripts) do
|
||||
table.insert(tasks, {
|
||||
name = "devbox run " .. script_name,
|
||||
builder = function() return { cmd = { "devbox" }, args = { "run", script_name }, cwd = git_root } end,
|
||||
desc = "Save all buffers before Screen detach/suspension",
|
||||
})
|
||||
|
||||
-- After resume from suspension (Screen reattach)
|
||||
vim.api.nvim_create_autocmd("VimResume", {
|
||||
group = screen_augroup,
|
||||
callback = function()
|
||||
-- Check for external file changes after resuming
|
||||
vim.cmd "checktime"
|
||||
if vim.env.STY ~= nil and vim.env.STY ~= "" then
|
||||
local session_name = vim.env.STY:match "[^%.]+%.(.+)"
|
||||
vim.notify("Resumed in Screen session: " .. (session_name or vim.env.STY), vim.log.levels.INFO)
|
||||
end
|
||||
end
|
||||
table.insert(tasks, {
|
||||
name = "devbox shell",
|
||||
builder = function() return { cmd = { "devbox" }, args = { "shell" }, cwd = git_root } end,
|
||||
})
|
||||
cb(tasks)
|
||||
end,
|
||||
}
|
||||
end
|
||||
desc = "Check for file changes after Screen reattach/resume",
|
||||
})
|
||||
Reference in new issue
Block a user