Compare commits

..

77 Commits

Author SHA1 Message Date
821672a0db chore(main): release 4.5.1 (#885)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-06-05 13:34:02 +02:00
8ce862e12e chore(build): auto-generate vimdoc 2023-06-05 10:11:35 +00:00
952a0cfb96 fix(keymaps): remove c-w mapping 2023-06-05 12:10:55 +02:00
d69d55afd4 chore(main): release 4.5.0 (#871)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-06-03 11:01:39 +02:00
7a36e2989c feat(keymaps): added <c-/> in normal/terminal mode to toggle main terminal 2023-06-03 10:54:29 +02:00
049fe77c3c chore(build): auto-generate vimdoc 2023-06-03 08:50:38 +00:00
5a47492535 feat(util): LazyVim terminals are now persistent by default (toggleterm) 2023-06-03 10:49:58 +02:00
15f5a229d9 fix(indentscope): dont use indentscope/blankline for lazyterm/toggleterm/notify 2023-06-03 10:49:58 +02:00
bb4a7fe410 fix(spectre): make spectre behave with regards to swap files 2023-06-03 10:49:58 +02:00
419086e8a3 feat(neo-tree): enabled document_symbols for neo-tree 2023-06-03 10:49:58 +02:00
49ae2344a1 feat(keymaps): added some useful keymaps for terminals 2023-06-03 10:49:58 +02:00
1efe3a96b2 chore(build): auto-generate vimdoc 2023-06-02 05:40:07 +00:00
5ed3250f24 fix(lualine): dont load copilot when not available. Fixes #872 2023-06-02 07:39:22 +02:00
9c1a5620ed chore(build): auto-generate vimdoc 2023-06-01 22:11:28 +00:00
08422bf559 perf(illuminate): on large files >2000 lines, enable lsp references only 2023-06-02 00:10:02 +02:00
fc236b3a2a feat(noice): route some undo messages to the mini view 2023-06-01 22:57:06 +02:00
01fbeb139b chore(build): auto-generate vimdoc 2023-05-30 21:21:43 +00:00
99ce1002d7 chore(main): release 4.4.0 (#854)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-05-30 23:21:07 +02:00
3b4c27e6a6 chore(build): auto-generate vimdoc 2023-05-29 20:29:14 +00:00
a94ef5953a fix(indent-blankline): don't load indent-blankline for nvim-notify 2023-05-29 22:28:28 +02:00
0c05f8a185 feat(catppuccin): enabled integration for plugins included with LazyVim 2023-05-29 22:28:28 +02:00
6b68378c2c chore(main): release 4.3.1 (#841)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-05-28 12:54:13 +02:00
0e671ad7fa fix(neotest): properly detect __call. Fixes #847 2023-05-28 12:52:22 +02:00
b68311eb6d chore: removed util.build. This is now part of the lazyvim website code 2023-05-28 12:39:51 +02:00
a866c6801d fix(neotest): removed <leader>tR in favor of <leader>tt 2023-05-28 11:07:02 +02:00
5c97e0c1d0 chore(build): auto-generate vimdoc 2023-05-28 07:42:37 +00:00
72b81553f3 fix(dashboard): center the LazyVim logo (#845)
* Center the LazyVim logo

This visually centers the LazyVim login on the starter page.

* fix(alpha): center logo

---------

Co-authored-by: Folke Lemaitre <folke.lemaitre@gmail.com>
2023-05-28 09:41:58 +02:00
88238e2109 fix(luasnip): use echo instead of echo -e for build warning 2023-05-27 23:03:44 +02:00
c272bba013 chore(main): release 4.3.0 (#839)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-05-27 09:58:08 +02:00
b16012b106 chore(build): auto-generate vimdoc 2023-05-27 07:38:41 +00:00
efc72b0649 feat(neotest): added <leader>tt and <leader>tT to run tests in file or all test files 2023-05-27 09:37:55 +02:00
2a3bac7690 fix(neotest): support neotest adapaters that use setup() for custom setup 2023-05-27 09:37:17 +02:00
98e2ffcf14 feat(neotest): allow adapter names as a list 2023-05-27 09:36:52 +02:00
2c89770504 feat(noetest): open trouble instead of quickfix on errors when available 2023-05-27 09:36:29 +02:00
30824369c2 fix(hipatterns): default options 2023-05-27 09:36:05 +02:00
1288f0d5a5 fix(neotest): added some additional filetypes to close with q 2023-05-27 09:35:49 +02:00
a3ec4c21f7 chore(main): release 4.2.0 (#831)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-05-26 17:01:21 +02:00
f7a63042f9 feat(hipatterns): made tailwind ft and style configurable 2023-05-26 16:42:07 +02:00
b7a925904e fix(hipatterns): reset hl groups when colorscheme changes 2023-05-26 16:32:34 +02:00
5eccaeb992 feat(lsp): added nvim-lspconfig.opts.format_notify. Enable this to debug formatter issues. 2023-05-26 10:51:07 +02:00
962fc6bab4 feat(lsp): added support for upcoming dynamic registration of formatters 2023-05-26 10:50:16 +02:00
e990d23cfe chore(main): release 4.1.1 (#829)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-05-26 08:20:25 +02:00
b027bebeab fix(hipatterns): make sure priority is higher than the one for references 2023-05-26 08:14:29 +02:00
19f4250888 chore(build): auto-generate vimdoc 2023-05-26 06:11:52 +00:00
33f61b58de fix(hipatterns): make it work on stable 2023-05-26 08:11:07 +02:00
5373af76f8 chore(main): release 4.1.0 (#828)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-05-25 23:34:31 +02:00
c526ea338b feat(hipatterns): better tailwind fg colors 2023-05-25 23:32:55 +02:00
ba0cfbccf3 chore(main): release 4.0.0 (#827)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-05-25 22:40:52 +02:00
47ee48faba build: fixed docs build 2023-05-25 22:37:45 +02:00
7bc979a7c1 feat: added extra for mini.hipatterns with tailwind support 2023-05-25 22:33:58 +02:00
9c7821e681 fix!: remove nvim-colorizer.lua It actually wasn't even enabled and I'll add hipatterns with optional tailwind support soon 2023-05-25 21:55:05 +02:00
95e2a07f16 chore(main): release 3.7.2 (#825)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-05-25 20:29:48 +02:00
d35d982984 chore: remove unused upvalue function (#823) 2023-05-25 20:05:02 +02:00
877e63ca8e fix(telescope): use last-known telescope commit to work on Neovim 0.8.0 when running in Neovim 0.8.0 2023-05-25 18:33:59 +02:00
bc24b68260 chore(main): release 3.7.1 (#820)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-05-25 14:27:09 +02:00
b75ed594a9 fix(mini.comment): removed dirty upvalues hack for mini.comments. no longer needed 2023-05-25 14:24:29 +02:00
4f2bb725be refactor(mason): use new handlers opt 2023-05-25 14:24:29 +02:00
2f0bfbbad8 chore(build): auto-generate vimdoc 2023-05-25 07:08:32 +00:00
01a6085b2b chore(main): release 3.7.0 (#818)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-05-25 09:07:44 +02:00
2b5ae7b63c feat(go): add workaround to get semantic token highlighting (#815) 2023-05-24 23:22:40 +02:00
dc40f02f35 chore(main): release 3.6.2 (#817)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-05-24 22:14:12 +02:00
4b367952f6 fix(tailwind): nil check on filetypes_exclude. See #816 2023-05-24 22:02:30 +02:00
7c9abd7463 fix(vscode): only remap keybinds when running in vscode 2023-05-24 21:59:37 +02:00
868ccedff2 chore(main): release 3.6.1 (#812)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-05-24 14:28:48 +02:00
29632c6b29 fix(go): actually set semantic tokens (#811) 2023-05-24 14:07:23 +02:00
5b7ae96c5d chore(main): release 3.6.0 (#801)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-05-24 11:30:49 +02:00
e9fb81e94d feat(typescript): added dap config for typescript. Will only be enabled when dap is also enabled 2023-05-24 10:47:54 +02:00
b172f47f27 fix(go): extend mason ensure_installed 2023-05-24 10:35:05 +02:00
9cfe88c7ba fix: remove debug notify (#808) 2023-05-24 10:34:27 +02:00
163a4f9275 feat(go): add go lang extras (#795)
* feat(go): add go lang extras

* fix(go): update plugin

* fix(go): add neotest adapter to adapters

* fix(go): pr changes
2023-05-24 08:55:03 +02:00
076b2e432e chore(build): auto-generate vimdoc 2023-05-24 06:46:02 +00:00
5bf45e3139 feat(vscode): better vscode support 2023-05-24 08:45:20 +02:00
eba510ec69 fix(vscode): properly cleanup disabled deps 2023-05-23 14:33:13 +02:00
39fa63646d feat(vscode): add vscode=true to any plugin spec you want to activate in vscode 2023-05-23 14:33:00 +02:00
e975f021ea fix(vscode): added ts-context-commentstring 2023-05-23 14:32:32 +02:00
bf66e71adc fix(neotest): pass opts to neotest 2023-05-23 14:07:11 +02:00
cd96e3d9e5 refactor(neotest): better way to pass custom options for adapters 2023-05-23 13:00:15 +02:00
21 changed files with 1022 additions and 501 deletions

View File

@ -1,5 +1,173 @@
# Changelog
## [4.5.1](https://github.com/LazyVim/LazyVim/compare/v4.5.0...v4.5.1) (2023-06-05)
### Bug Fixes
* **keymaps:** remove `c-w` mapping ([952a0cf](https://github.com/LazyVim/LazyVim/commit/952a0cfb96e7258dcbe8c9f4d8bdfd978888f17c))
## [4.5.0](https://github.com/LazyVim/LazyVim/compare/v4.4.0...v4.5.0) (2023-06-03)
### Features
* **keymaps:** added `&lt;c-/&gt;` in normal/terminal mode to toggle main terminal ([7a36e29](https://github.com/LazyVim/LazyVim/commit/7a36e2989c3d62e8dbaf4036f5c4551929c565a5))
* **keymaps:** added some useful keymaps for terminals ([49ae234](https://github.com/LazyVim/LazyVim/commit/49ae2344a18f93c5b4209357e265a2732365ab19))
* **neo-tree:** enabled document_symbols for neo-tree ([419086e](https://github.com/LazyVim/LazyVim/commit/419086e8a393df05ae1311e7580e034051df85eb))
* **noice:** route some undo messages to the mini view ([fc236b3](https://github.com/LazyVim/LazyVim/commit/fc236b3a2a90001df11ed4a6bad7bce87f459cf9))
* **util:** LazyVim terminals are now persistent by default (toggleterm) ([5a47492](https://github.com/LazyVim/LazyVim/commit/5a4749253501569ec0ae2c644ed778e45ad637c0))
### Bug Fixes
* **indentscope:** dont use indentscope/blankline for lazyterm/toggleterm/notify ([15f5a22](https://github.com/LazyVim/LazyVim/commit/15f5a229d9b9fcdfd980050e7fe8dff74313d9fd))
* **lualine:** dont load copilot when not available. Fixes [#872](https://github.com/LazyVim/LazyVim/issues/872) ([5ed3250](https://github.com/LazyVim/LazyVim/commit/5ed3250f2475f498cd14643f4788ee95108f2ada))
* **spectre:** make spectre behave with regards to swap files ([bb4a7fe](https://github.com/LazyVim/LazyVim/commit/bb4a7fe410d8aaf9507cd2a8ed7c7680852cf297))
### Performance Improvements
* **illuminate:** on large files &gt;2000 lines, enable lsp references only ([08422bf](https://github.com/LazyVim/LazyVim/commit/08422bf559cb74a2e673e60d551269cbcb2e18df))
## [4.4.0](https://github.com/LazyVim/LazyVim/compare/v4.3.1...v4.4.0) (2023-05-29)
### Features
* **catppuccin:** enabled integration for plugins included with LazyVim ([0c05f8a](https://github.com/LazyVim/LazyVim/commit/0c05f8a185e61cc67199bf4b0b3b61933d292b0f))
### Bug Fixes
* **indent-blankline:** don't load indent-blankline for nvim-notify ([a94ef59](https://github.com/LazyVim/LazyVim/commit/a94ef5953a6f14731d9aea447e769c280db140ab))
## [4.3.1](https://github.com/LazyVim/LazyVim/compare/v4.3.0...v4.3.1) (2023-05-28)
### Bug Fixes
* **dashboard:** center the LazyVim logo ([#845](https://github.com/LazyVim/LazyVim/issues/845)) ([72b8155](https://github.com/LazyVim/LazyVim/commit/72b81553f378669b2cbad16662faed2a6b524df6))
* **luasnip:** use `echo` instead of `echo -e` for build warning ([88238e2](https://github.com/LazyVim/LazyVim/commit/88238e2109e8340fae1424f693149ff2c334ae1c))
* **neotest:** properly detect __call. Fixes [#847](https://github.com/LazyVim/LazyVim/issues/847) ([0e671ad](https://github.com/LazyVim/LazyVim/commit/0e671ad7fabdb3af181feda18951596a83167bc9))
* **neotest:** removed `&lt;leader&gt;tR` in favor of `<leader>tt` ([a866c68](https://github.com/LazyVim/LazyVim/commit/a866c6801df058c6bef613acfb2eeea9cedb41b1))
## [4.3.0](https://github.com/LazyVim/LazyVim/compare/v4.2.0...v4.3.0) (2023-05-27)
### Features
* **neotest:** added `&lt;leader&gt;tt` and `<leader>tT` to run tests in file or all test files ([efc72b0](https://github.com/LazyVim/LazyVim/commit/efc72b06496f7540085928094808e9a0f45222b9))
* **neotest:** allow adapter names as a list ([98e2ffc](https://github.com/LazyVim/LazyVim/commit/98e2ffcf14bb5f336ee2e4679d2b7d5699486bcc))
* **noetest:** open trouble instead of quickfix on errors when available ([2c89770](https://github.com/LazyVim/LazyVim/commit/2c897705049cb89d6cd28b59be4bd7db872ffe6b))
### Bug Fixes
* **hipatterns:** default options ([3082436](https://github.com/LazyVim/LazyVim/commit/30824369c2c58647df170566766ea1dbda2730cc))
* **neotest:** added some additional filetypes to close with q ([1288f0d](https://github.com/LazyVim/LazyVim/commit/1288f0d5a5cc5f5279678cc3c3d99abe20a1e052))
* **neotest:** support neotest adapaters that use `setup()` for custom setup ([2a3bac7](https://github.com/LazyVim/LazyVim/commit/2a3bac769045abac76395fcabb36b17b68bc42fc))
## [4.2.0](https://github.com/LazyVim/LazyVim/compare/v4.1.1...v4.2.0) (2023-05-26)
### Features
* **hipatterns:** made tailwind ft and style configurable ([f7a6304](https://github.com/LazyVim/LazyVim/commit/f7a63042f9b6f2353d861ba4cec23789d0254b5b))
* **lsp:** added `nvim-lspconfig.opts.format_notify`. Enable this to debug formatter issues. ([5eccaeb](https://github.com/LazyVim/LazyVim/commit/5eccaeb992217d47f111c78a3d519aae3d9a5edc))
* **lsp:** added support for upcoming dynamic registration of formatters ([962fc6b](https://github.com/LazyVim/LazyVim/commit/962fc6bab43cdf68e5602fe06a54c7a5fac053b6))
### Bug Fixes
* **hipatterns:** reset hl groups when colorscheme changes ([b7a9259](https://github.com/LazyVim/LazyVim/commit/b7a925904ea30d85a96683df9980960ef349eacf))
## [4.1.1](https://github.com/LazyVim/LazyVim/compare/v4.1.0...v4.1.1) (2023-05-26)
### Bug Fixes
* **hipatterns:** make it work on stable ([33f61b5](https://github.com/LazyVim/LazyVim/commit/33f61b58de3519ef568bc9591fb877a71a203a6d))
* **hipatterns:** make sure priority is higher than the one for references ([b027beb](https://github.com/LazyVim/LazyVim/commit/b027bebeab30308f26f5cafe1642f3aa0e541ca3))
## [4.1.0](https://github.com/LazyVim/LazyVim/compare/v4.0.0...v4.1.0) (2023-05-25)
### Features
* **hipatterns:** better tailwind fg colors ([c526ea3](https://github.com/LazyVim/LazyVim/commit/c526ea338b415a51fa78936b7044ec67d78528b2))
## [4.0.0](https://github.com/LazyVim/LazyVim/compare/v3.7.2...v4.0.0) (2023-05-25)
### ⚠ BREAKING CHANGES
* remove nvim-colorizer.lua It actually wasn't even enabled and I'll add hipatterns with optional tailwind support soon
### Features
* added extra for mini.hipatterns with tailwind support ([7bc979a](https://github.com/LazyVim/LazyVim/commit/7bc979a7c1eacba16b60c324ae7bfab57b73a702))
### Bug Fixes
* remove nvim-colorizer.lua It actually wasn't even enabled and I'll add hipatterns with optional tailwind support soon ([9c7821e](https://github.com/LazyVim/LazyVim/commit/9c7821e681e264905d7f764aeddda78162a9d867))
## [3.7.2](https://github.com/LazyVim/LazyVim/compare/v3.7.1...v3.7.2) (2023-05-25)
### Bug Fixes
* **telescope:** use last-known telescope commit to work on Neovim 0.8.0 when running in Neovim 0.8.0 ([877e63c](https://github.com/LazyVim/LazyVim/commit/877e63ca8ee5efe1420744f7a843dd4fd0215764))
## [3.7.1](https://github.com/LazyVim/LazyVim/compare/v3.7.0...v3.7.1) (2023-05-25)
### Bug Fixes
* **mini.comment:** removed dirty upvalues hack for mini.comments. no longer needed ([b75ed59](https://github.com/LazyVim/LazyVim/commit/b75ed594a932e6e01d8c1ee5b23215221164d494))
## [3.7.0](https://github.com/LazyVim/LazyVim/compare/v3.6.2...v3.7.0) (2023-05-24)
### Features
* **go:** add workaround to get semantic token highlighting ([#815](https://github.com/LazyVim/LazyVim/issues/815)) ([2b5ae7b](https://github.com/LazyVim/LazyVim/commit/2b5ae7b63c8233bbb11a922c852b8adeacd94b86))
## [3.6.2](https://github.com/LazyVim/LazyVim/compare/v3.6.1...v3.6.2) (2023-05-24)
### Bug Fixes
* **tailwind:** nil check on filetypes_exclude. See [#816](https://github.com/LazyVim/LazyVim/issues/816) ([4b36795](https://github.com/LazyVim/LazyVim/commit/4b367952f6214e1ae213eba2ae706df691ff57fa))
* **vscode:** only remap keybinds when running in vscode ([7c9abd7](https://github.com/LazyVim/LazyVim/commit/7c9abd7463a27b7a7fd8a0c7e59653a7602613b6))
## [3.6.1](https://github.com/LazyVim/LazyVim/compare/v3.6.0...v3.6.1) (2023-05-24)
### Bug Fixes
* **go:** actually set semantic tokens ([#811](https://github.com/LazyVim/LazyVim/issues/811)) ([29632c6](https://github.com/LazyVim/LazyVim/commit/29632c6b294465e5abc6472fffc866ec1841e37a))
## [3.6.0](https://github.com/LazyVim/LazyVim/compare/v3.5.0...v3.6.0) (2023-05-24)
### Features
* **go:** add go lang extras ([#795](https://github.com/LazyVim/LazyVim/issues/795)) ([163a4f9](https://github.com/LazyVim/LazyVim/commit/163a4f927514ad6ea1aa06db2ad754fb954d87f5))
* **typescript:** added dap config for typescript. Will only be enabled when dap is also enabled ([e9fb81e](https://github.com/LazyVim/LazyVim/commit/e9fb81e94d7f461b63994e3111d5c17fc84dec80))
* **vscode:** add `vscode=true` to any plugin spec you want to activate in vscode ([39fa636](https://github.com/LazyVim/LazyVim/commit/39fa63646d14665861558c4ee7704ef51eb1b7f6))
* **vscode:** better vscode support ([5bf45e3](https://github.com/LazyVim/LazyVim/commit/5bf45e3139aa3a8cf8e1bf9fd2a2d422fe1c6cf7))
### Bug Fixes
* **go:** extend mason ensure_installed ([b172f47](https://github.com/LazyVim/LazyVim/commit/b172f47f278df105bbbf60b5c0e411fda01c1819))
* **neotest:** pass opts to neotest ([bf66e71](https://github.com/LazyVim/LazyVim/commit/bf66e71adcf0346a3d6edd92a14e0fcd350f5b26))
* remove debug notify ([#808](https://github.com/LazyVim/LazyVim/issues/808)) ([9cfe88c](https://github.com/LazyVim/LazyVim/commit/9cfe88c7ba1ff2b36a0cc32e96d5be1d6e5ee833))
* **vscode:** added ts-context-commentstring ([e975f02](https://github.com/LazyVim/LazyVim/commit/e975f021eaf1eb33fb8793c8e922ab11a8b682f2))
* **vscode:** properly cleanup disabled deps ([eba510e](https://github.com/LazyVim/LazyVim/commit/eba510ec6934a22f3654a83ed89216bb96e7374c))
## [3.5.0](https://github.com/LazyVim/LazyVim/compare/v3.4.0...v3.5.0) (2023-05-23)

View File

@ -1,4 +1,4 @@
*LazyVim.txt* For Neovim >= 0.8.0 Last change: 2023 May 23
*LazyVim.txt* For Neovim >= 0.8.0 Last change: 2023 June 05
==============================================================================
Table of Contents *LazyVim-table-of-contents*

View File

@ -51,8 +51,10 @@ vim.api.nvim_create_autocmd("FileType", {
"spectre_panel",
"startuptime",
"tsplayground",
"checkhealth",
"neotest-output",
"checkhealth",
"neotest-summary",
"neotest-output-panel",
},
callback = function(event)
vim.bo[event.buf].buflisted = false

View File

@ -161,6 +161,8 @@ function M.load(name)
-- HACK: LazyVim may have overwritten options of the Lazy ui, so reset this here
vim.cmd([[do VimResized]])
end
local pattern = "LazyVim" .. name:sub(1, 1):upper() .. name:sub(2)
vim.api.nvim_exec_autocmds("User", { pattern = pattern, modeline = false })
end
M.did_init = false

View File

@ -1,5 +1,4 @@
-- This file is automatically loaded by lazyvim.config.init
local Util = require("lazyvim.util")
local function map(mode, lhs, rhs, opts)
@ -9,6 +8,9 @@ local function map(mode, lhs, rhs, opts)
if not keys.active[keys.parse({ lhs, mode = mode }).id] then
opts = opts or {}
opts.silent = opts.silent ~= false
if opts.remap and not vim.g.vscode then
opts.remap = nil
end
vim.keymap.set(mode, lhs, rhs, opts)
end
end
@ -18,10 +20,10 @@ map("n", "j", "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true })
map("n", "k", "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true })
-- Move to window using the <ctrl> hjkl keys
map("n", "<C-h>", "<C-w>h", { desc = "Go to left window" })
map("n", "<C-j>", "<C-w>j", { desc = "Go to lower window" })
map("n", "<C-k>", "<C-w>k", { desc = "Go to upper window" })
map("n", "<C-l>", "<C-w>l", { desc = "Go to right window" })
map("n", "<C-h>", "<C-w>h", { desc = "Go to left window", remap = true })
map("n", "<C-j>", "<C-w>j", { desc = "Go to lower window", remap = true })
map("n", "<C-k>", "<C-w>k", { desc = "Go to upper window", remap = true })
map("n", "<C-l>", "<C-w>l", { desc = "Go to right window", remap = true })
-- Resize window using <ctrl> arrow keys
map("n", "<C-Up>", "<cmd>resize +2<cr>", { desc = "Increase window height" })
@ -124,17 +126,26 @@ if vim.fn.has("nvim-0.9.0") == 1 then
end
-- floating terminal
map("n", "<leader>ft", function() Util.float_term(nil, { cwd = Util.get_root() }) end, { desc = "Terminal (root dir)" })
local lazyterm = function() Util.float_term(nil, { cwd = Util.get_root() }) end
map("n", "<leader>ft", lazyterm, { desc = "Terminal (root dir)" })
map("n", "<leader>fT", function() Util.float_term() end, { desc = "Terminal (cwd)" })
map("n", "<c-/>", lazyterm, { desc = "Terminal (root dir)" })
-- Terminal Mappings
map("t", "<esc><esc>", "<c-\\><c-n>", { desc = "Enter Normal Mode" })
map("t", "<C-h>", "<cmd>wincmd h<cr>", { desc = "Go to left window"})
map("t", "<C-j>", "<cmd>wincmd j<cr>", { desc = "Go to lower window"})
map("t", "<C-k>", "<cmd>wincmd k<cr>", { desc = "Go to upper window"})
map("t", "<C-l>", "<cmd>wincmd l<cr>", { desc = "Go to right window"})
map("t", '<C-/>', "<cmd>close<cr>", {desc = "Hide Terminal"})
-- windows
map("n", "<leader>ww", "<C-W>p", { desc = "Other window" })
map("n", "<leader>wd", "<C-W>c", { desc = "Delete window" })
map("n", "<leader>w-", "<C-W>s", { desc = "Split window below" })
map("n", "<leader>w|", "<C-W>v", { desc = "Split window right" })
map("n", "<leader>-", "<C-W>s", { desc = "Split window below" })
map("n", "<leader>|", "<C-W>v", { desc = "Split window right" })
map("n", "<leader>ww", "<C-W>p", { desc = "Other window", remap = true })
map("n", "<leader>wd", "<C-W>c", { desc = "Delete window", remap = true })
map("n", "<leader>w-", "<C-W>s", { desc = "Split window below", remap = true })
map("n", "<leader>w|", "<C-W>v", { desc = "Split window right", remap = true })
map("n", "<leader>-", "<C-W>s", { desc = "Split window below", remap = true })
map("n", "<leader>|", "<C-W>v", { desc = "Split window right", remap = true })
-- tabs
map("n", "<leader><tab>l", "<cmd>tablast<cr>", { desc = "Last Tab" })

View File

@ -4,7 +4,7 @@ return {
{
"L3MON4D3/LuaSnip",
build = (not jit.os:find("Windows"))
and "echo -e 'NOTE: jsregexp is optional, so not a big deal if it fails to build\n'; make install_jsregexp"
and "echo 'NOTE: jsregexp is optional, so not a big deal if it fails to build'; make install_jsregexp"
or nil,
dependencies = {
"rafamadriz/friendly-snippets",
@ -135,15 +135,13 @@ return {
{
"echasnovski/mini.comment",
event = "VeryLazy",
config = function(_, opts)
local c = require("mini.comment")
c.setup(opts)
local H = require("lazyvim.util").get_upvalue(c.setup, "H")
H.get_commentstring = function()
return require("ts_context_commentstring.internal").calculate_commentstring() or vim.bo.commentstring
end
end,
opts = {},
opts = {
options = {
custom_commentstring = function()
return require("ts_context_commentstring.internal").calculate_commentstring() or vim.bo.commentstring
end,
},
},
},
-- better text-objects

View File

@ -12,5 +12,34 @@ return {
"catppuccin/nvim",
lazy = true,
name = "catppuccin",
opts = {
integrations = {
alpha = true,
cmp = true,
gitsigns = true,
illuminate = true,
indent_blankline = { enabled = true },
lsp_trouble = true,
mini = true,
native_lsp = {
enabled = true,
underlines = {
errors = { "undercurl" },
hints = { "undercurl" },
warnings = { "undercurl" },
information = { "undercurl" },
},
},
navic = { enabled = true },
neotest = true,
noice = true,
notify = true,
nvimtree = true,
semantic_tokens = true,
telescope = true,
treesitter = true,
which_key = true,
},
},
},
}

View File

@ -37,6 +37,7 @@ return {
end
end,
opts = {
sources = { "filesystem", "buffers", "git_status", "document_symbols" },
filesystem = {
bind_to_cwd = false,
follow_current_file = true,
@ -72,6 +73,8 @@ return {
-- search/replace in multiple files
{
"nvim-pack/nvim-spectre",
cmd = "Spectre",
opts = { open_cmd = "noswapfile vnew" },
-- stylua: ignore
keys = {
{ "<leader>sr", function() require("spectre").open() end, desc = "Replace in files (Spectre)" },
@ -81,6 +84,7 @@ return {
-- fuzzy finder
{
"nvim-telescope/telescope.nvim",
commit = vim.fn.has("nvim-0.9.0") == 0 and "057ee0f8783" or nil,
cmd = "Telescope",
version = false, -- telescope did only one release, so use HEAD for now
keys = {
@ -302,7 +306,13 @@ return {
{
"RRethy/vim-illuminate",
event = { "BufReadPost", "BufNewFile" },
opts = { delay = 200 },
opts = {
delay = 200,
large_file_cutoff = 2000,
large_file_overrides = {
providers = { "lsp" },
},
},
config = function(_, opts)
require("illuminate").configure(opts)

View File

@ -33,6 +33,9 @@ return {
return ok and #clients > 0
end,
color = function()
if not package.loaded["copilot"] then
return
end
local status = require("copilot.api").status.data
return colors[status.status] or colors[""]
end,

View File

@ -0,0 +1,77 @@
return {
{
"nvim-treesitter/nvim-treesitter",
opts = function(_, opts)
vim.list_extend(opts.ensure_installed, {
"go",
"gomod",
"gowork",
"gosum",
})
end,
},
{
"neovim/nvim-lspconfig",
opts = {
servers = {
gopls = {
settings = {
gopls = {
semanticTokens = true,
},
},
},
},
setup = {
gopls = function()
-- workaround for gopls not supporting semantictokensprovider
-- https://github.com/golang/go/issues/54531#issuecomment-1464982242
require("lazyvim.util").on_attach(function(client, _)
if client.name == "gopls" then
if not client.server_capabilities.semanticTokensProvider then
local semantic = client.config.capabilities.textDocument.semanticTokens
client.server_capabilities.semanticTokensProvider = {
full = true,
legend = {
tokenTypes = semantic.tokenTypes,
tokenModifiers = semantic.tokenModifiers,
},
range = true,
}
end
end
end)
-- end workaround
end,
},
},
},
{
"mfussenegger/nvim-dap",
optional = true,
dependencies = {
{
"mason.nvim",
opts = function(_, opts)
opts.ensure_installed = opts.ensure_installed or {}
table.insert(opts.ensure_installed, "delve")
end,
},
},
},
{
"nvim-neotest/neotest",
optional = true,
dependencies = {
"nvim-neotest/neotest-go",
},
opts = {
adapters = {
["neotest-go"] = {
-- Here we can set options for neotest-go, e.g.
-- args = { "-tags=integration" }
},
},
},
},
}

View File

@ -12,20 +12,12 @@ return {
local tw = require("lspconfig.server_configurations.tailwindcss")
--- @param ft string
opts.filetypes = vim.tbl_filter(function(ft)
return not vim.tbl_contains(opts.filetypes_exclude, ft)
return not vim.tbl_contains(opts.filetypes_exclude or {}, ft)
end, tw.default_config.filetypes)
end,
},
},
},
{
"NvChad/nvim-colorizer.lua",
opts = {
user_default_options = {
tailwind = true,
},
},
},
{
"hrsh7th/nvim-cmp",
dependencies = {

View File

@ -62,4 +62,56 @@ return {
table.insert(opts.sources, require("typescript.extensions.null-ls.code-actions"))
end,
},
{
"mfussenegger/nvim-dap",
optional = true,
dependencies = {
{
"williamboman/mason.nvim",
opts = function(_, opts)
opts.ensure_installed = opts.ensure_installed or {}
table.insert(opts.ensure_installed, "js-debug-adapter")
end,
},
},
opts = function()
local dap = require("dap")
if not dap.adapters["pwa-node"] then
require("dap").adapters["pwa-node"] = {
type = "server",
host = "localhost",
port = "${port}",
executable = {
command = "node",
-- 💀 Make sure to update this path to point to your installation
args = {
require("mason-registry").get_package("js-debug-adapter"):get_install_path()
.. "/js-debug/src/dapDebugServer.js",
"${port}",
},
},
}
end
for _, language in ipairs({ "typescript", "javascript" }) do
if not dap.configurations[language] then
dap.configurations[language] = {
{
type = "pwa-node",
request = "launch",
name = "Launch file",
program = "${file}",
cwd = "${workspaceFolder}",
},
{
type = "pwa-node",
request = "attach",
name = "Attach",
processId = require("dap.utils").pick_process,
cwd = "${workspaceFolder}",
},
}
end
end
end,
},
}

View File

@ -11,10 +11,28 @@ return {
{
"nvim-neotest/neotest",
opts = {
adapter_config = {
-- ["adapter_name"] = {} -- set adapter config here
},
-- Can be a list of adapters like what neotest expects,
-- or a list of adapter names,
-- or a table of adapter names, mapped to adapter configs.
-- The adapter will then be automatically loaded with the config.
adapters = {},
-- Example for loading neotest-go with a custom config
-- adapters = {
-- ["neotest-go"] = {
-- args = { "-tags=integration" },
-- },
-- },
status = { virtual_text = true },
output = { open_on_run = true },
quickfix = {
open = function()
if require("lazyvim.util").has("trouble.nvim") then
vim.cmd("Trouble quickfix")
else
vim.cmd("copen")
end
end,
},
},
config = function(_, opts)
local neotest_ns = vim.api.nvim_create_namespace("neotest")
@ -28,21 +46,39 @@ return {
},
}, neotest_ns)
if opts.adapter_config then
for a, adapter in ipairs(opts.adapters or {}) do
local name = adapter.name
if opts.adapter_config[name] then
opts.adapters[a] = adapter(opts.adapter_config[name])
if opts.adapters then
local adapters = {}
for name, config in pairs(opts.adapters or {}) do
if type(name) == "number" then
if type(config) == "string" then
config = require(config)
end
adapters[#adapters + 1] = config
elseif config ~= false then
local adapter = require(name)
if type(config) == "table" and not vim.tbl_isempty(config) then
local meta = getmetatable(adapter)
if adapter.setup then
adapter.setup(config)
elseif meta and meta.__call then
adapter(config)
else
error("Adapter " .. name .. " does not support setup")
end
end
adapters[#adapters + 1] = adapter
end
end
opts.adapters = adapters
end
require("neotest").setup(opts)
end,
-- stylua: ignore
keys = {
{ "<leader>tt", function() require("neotest").run.run(vim.fn.expand("%")) end, desc = "Run File" },
{ "<leader>tT", function() require("neotest").run.run(vim.loop.cwd()) end, desc = "Run All Test Files" },
{ "<leader>tr", function() require("neotest").run.run() end, desc = "Run Nearest" },
{ "<leader>tR", function() require("neotest").run.run(vim.fn.expand("%")) end, desc = "Run File" },
{ "<leader>ts", function() require("neotest").summary.toggle() end, desc = "Toggle Summary" },
{ "<leader>to", function() require("neotest").output.open({ enter = true, auto_close = true }) end, desc = "Show Output" },
{ "<leader>tO", function() require("neotest").output_panel.toggle() end, desc = "Toggle Output Panel" },

View File

@ -10,12 +10,12 @@ return {
event = "VimEnter",
opts = function()
local logo = table.concat({
"██╗ █████╗ ███████╗██╗ ██╗██╗ ██╗██╗███╗ ███╗ Z",
"██║ ██╔══██╗╚══███╔╝╚██╗ ██╔╝██║ ██║██║████╗ ████║ Z",
"██║ ███████║ ███╔╝ ╚████╔╝ ██║ ██║██║██╔████╔██║ z",
"██║ ██╔══██║ ███╔╝ ╚██╔╝ ╚██╗ ██╔╝██║██║╚██╔╝██║ z",
"███████╗██║ ██║███████╗ ██║ ╚████╔╝ ██║██║ ╚═╝ ██║",
"╚══════╝╚═╝ ╚═╝╚══════╝ ╚═╝ ╚═══╝ ╚═╝╚═╝ ╚═╝",
" ██╗ █████╗ ███████╗██╗ ██╗██╗ ██╗██╗███╗ ███╗ Z",
" ██║ ██╔══██╗╚══███╔╝╚██╗ ██╔╝██║ ██║██║████╗ ████║ Z ",
" ██║ ███████║ ███╔╝ ╚████╔╝ ██║ ██║██║██╔████╔██║ z ",
" ██║ ██╔══██║ ███╔╝ ╚██╔╝ ╚██╗ ██╔╝██║██║╚██╔╝██║ z ",
" ███████╗██║ ██║███████╗ ██║ ╚████╔╝ ██║██║ ╚═╝ ██║ ",
" ╚══════╝╚═╝ ╚═╝╚══════╝ ╚═╝ ╚═══╝ ╚═╝╚═╝ ╚═╝ ",
}, "\n")
local pad = string.rep(" ", 22)
local new_section = function(name, action, section)

File diff suppressed because it is too large Load Diff

View File

@ -12,7 +12,9 @@ local enabled = {
"mini.surround",
"nvim-treesitter",
"nvim-treesitter-textobjects",
"nvim-ts-context-commentstring",
"vim-repeat",
"LazyVim",
}
local Config = require("lazy.core.config")
@ -20,35 +22,44 @@ local Plugin = require("lazy.core.plugin")
Config.options.checker.enabled = false
Config.options.change_detection.enabled = false
local update_state = Plugin.update_state
---@diagnostic disable-next-line: duplicate-set-field
Plugin.update_state = function()
-- Config.spec.disabled = {}
for name, plugin in pairs(Config.plugins) do
if not vim.tbl_contains(enabled, plugin.name) then
Config.plugins[name] = nil
-- HACK: disable all plugins except the ones we want
local fix_disabled = Plugin.Spec.fix_disabled
function Plugin.Spec.fix_disabled(self)
for _, plugin in pairs(self.plugins) do
if not (vim.tbl_contains(enabled, plugin.name) or plugin.vscode) then
plugin.enabled = false
end
end
fix_disabled(self)
end
-- HACK: don't clean plugins in vscode
local update_state = Plugin.update_state
function Plugin.update_state()
update_state()
Config.to_clean = {}
end
local map = vim.keymap.set
map("n", "<leader><space>", "<cmd>Find<cr>")
map("n", "<leader>/", [[<cmd>call VSCodeNotify('workbench.action.findInFiles')<cr>]])
map("n", "<leader>ss", [[<cmd>call VSCodeNotify('workbench.action.gotoSymbol')<cr>]])
map("n", "<C-h>", "<C-w>h", { desc = "Go to left window", remap = true })
map("n", "<C-j>", "<C-w>j", { desc = "Go to lower window", remap = true })
map("n", "<C-k>", "<C-w>k", { desc = "Go to upper window", remap = true })
map("n", "<C-l>", "<C-w>l", { desc = "Go to right window", remap = true })
map("n", "<leader>wd", "<C-W>c", { desc = "Delete window", remap = true })
map("n", "<leader>-", "<C-W>s", { desc = "Split window below", remap = true })
map("n", "<leader>|", "<C-W>v", { desc = "Split window right", remap = true })
-- Add some vscode specific keymaps
vim.api.nvim_create_autocmd("User", {
pattern = "LazyVimKeymaps",
callback = function()
vim.keymap.set("n", "<leader><space>", "<cmd>Find<cr>")
vim.keymap.set("n", "<leader>/", [[<cmd>call VSCodeNotify('workbench.action.findInFiles')<cr>]])
vim.keymap.set("n", "<leader>ss", [[<cmd>call VSCodeNotify('workbench.action.gotoSymbol')<cr>]])
end,
})
return {
{
"LazyVim/LazyVim",
config = function(_, opts)
opts = opts or {}
-- disable the colorscheme
opts.colorscheme = function() end
require("lazyvim").setup(opts)
end,
},
{
"nvim-treesitter/nvim-treesitter",
opts = { highlight = { enable = false } },

View File

@ -2,16 +2,17 @@ local Util = require("lazy.core.util")
local M = {}
M.autoformat = true
---@type PluginLspOpts
M.opts = nil
function M.toggle()
if vim.b.autoformat == false then
vim.b.autoformat = nil
M.autoformat = true
M.opts.autoformat = true
else
M.autoformat = not M.autoformat
M.opts.autoformat = not M.opts.autoformat
end
if M.autoformat then
if M.opts.autoformat then
Util.info("Enabled format on save", { title = "Format" })
else
Util.warn("Disabled format on save", { title = "Format" })
@ -24,42 +25,124 @@ function M.format(opts)
if vim.b.autoformat == false and not (opts and opts.force) then
return
end
local ft = vim.bo[buf].filetype
local have_nls = package.loaded["null-ls"]
and (#require("null-ls.sources").get_available(ft, "NULL_LS_FORMATTING") > 0)
local formatters = M.get_formatters(buf)
local client_ids = vim.tbl_map(function(client)
return client.id
end, formatters.active)
if #client_ids == 0 then
return
end
if M.opts.format_notify then
M.notify(formatters)
end
vim.lsp.buf.format(vim.tbl_deep_extend("force", {
bufnr = buf,
filter = function(client)
if have_nls then
return client.name == "null-ls"
end
return client.name ~= "null-ls"
return vim.tbl_contains(client_ids, client.id)
end,
}, require("lazyvim.util").opts("nvim-lspconfig").format or {}))
end
function M.on_attach(client, buf)
-- dont format if client disabled it
---@param formatters LazyVimFormatters
function M.notify(formatters)
local lines = { "# Active:" }
for _, client in ipairs(formatters.active) do
local line = "- **" .. client.name .. "**"
if client.name == "null-ls" then
line = line
.. " ("
.. table.concat(
vim.tbl_map(function(f)
return "`" .. f.name .. "`"
end, formatters.null_ls),
", "
)
.. ")"
end
table.insert(lines, line)
end
if #formatters.available > 0 then
table.insert(lines, "")
table.insert(lines, "# Disabled:")
for _, client in ipairs(formatters.available) do
table.insert(lines, "- **" .. client.name .. "**")
end
end
vim.notify(table.concat(lines, "\n"), vim.log.levels.INFO, {
title = "Formatting",
on_open = function(win)
vim.api.nvim_win_set_option(win, "conceallevel", 3)
vim.api.nvim_win_set_option(win, "spell", false)
local buf = vim.api.nvim_win_get_buf(win)
vim.treesitter.start(buf, "markdown")
end,
})
end
-- Gets all lsp clients that support formatting.
-- When a null-ls formatter is available for the current filetype,
-- only null-ls formatters are returned.
function M.get_formatters(bufnr)
local ft = vim.bo[bufnr].filetype
-- check if we have any null-ls formatters for the current filetype
local null_ls = package.loaded["null-ls"] and require("null-ls.sources").get_available(ft, "NULL_LS_FORMATTING") or {}
---@class LazyVimFormatters
local ret = {
---@type lsp.Client[]
active = {},
---@type lsp.Client[]
available = {},
null_ls = null_ls,
}
---@type lsp.Client[]
local clients = vim.lsp.get_active_clients({ bufnr = bufnr })
for _, client in ipairs(clients) do
if M.supports_format(client) then
if (#null_ls > 0 and client.name == "null-ls") or #null_ls == 0 then
table.insert(ret.active, client)
else
table.insert(ret.available, client)
end
end
end
return ret
end
-- Gets all lsp clients that support formatting
-- and have not disabled it in their client config
---@param client lsp.Client
function M.supports_format(client)
if
client.config
and client.config.capabilities
and client.config.capabilities.documentFormattingProvider == false
then
return
return false
end
return client.supports_method("textDocument/formatting") or client.supports_method("textDocument/rangeFormatting")
end
if client.supports_method("textDocument/formatting") then
vim.api.nvim_create_autocmd("BufWritePre", {
group = vim.api.nvim_create_augroup("LspFormat." .. buf, {}),
buffer = buf,
callback = function()
if M.autoformat then
M.format()
end
end,
})
end
---@param opts PluginLspOpts
function M.setup(opts)
M.opts = opts
vim.api.nvim_create_autocmd("BufWritePre", {
group = vim.api.nvim_create_augroup("LazyVimFormat", {}),
callback = function()
if M.opts.autoformat then
M.format()
end
end,
})
end
return M

View File

@ -35,6 +35,9 @@ return {
capabilities = {},
-- Automatically format on save
autoformat = true,
-- Enable this to show formatters used in a notification
-- Useful for debugging formatter issues
format_notify = false,
-- options for vim.lsp.buf.format
-- `bufnr` and `filter` is handled by the LazyVim formatter,
-- but can be also overridden when specified
@ -77,10 +80,9 @@ return {
config = function(_, opts)
local Util = require("lazyvim.util")
-- setup autoformat
require("lazyvim.plugins.lsp.format").autoformat = opts.autoformat
require("lazyvim.plugins.lsp.format").setup(opts)
-- setup formatting and keymaps
Util.on_attach(function(client, buffer)
require("lazyvim.plugins.lsp.format").on_attach(client, buffer)
require("lazyvim.plugins.lsp.keymaps").on_attach(client, buffer)
end)
@ -151,8 +153,7 @@ return {
end
if have_mason then
mlsp.setup({ ensure_installed = ensure_installed })
mlsp.setup_handlers({ setup })
mlsp.setup({ ensure_installed = ensure_installed, handlers = { setup } })
end
if Util.lsp_get_config("denols") and Util.lsp_get_config("tsserver") then

View File

@ -169,7 +169,18 @@ return {
opts = {
-- char = "▏",
char = "",
filetype_exclude = { "help", "alpha", "dashboard", "neo-tree", "Trouble", "lazy", "mason" },
filetype_exclude = {
"help",
"alpha",
"dashboard",
"neo-tree",
"Trouble",
"lazy",
"mason",
"notify",
"toggleterm",
"lazyterm",
},
show_trailing_blankline_indent = false,
show_current_context = false,
},
@ -187,7 +198,18 @@ return {
},
init = function()
vim.api.nvim_create_autocmd("FileType", {
pattern = { "help", "alpha", "dashboard", "neo-tree", "Trouble", "lazy", "mason" },
pattern = {
"help",
"alpha",
"dashboard",
"neo-tree",
"Trouble",
"lazy",
"mason",
"notify",
"toggleterm",
"lazyterm",
},
callback = function()
vim.b.miniindentscope_disable = true
end,
@ -222,7 +244,11 @@ return {
{
filter = {
event = "msg_show",
find = "%d+L, %d+B",
any = {
{ find = "%d+L, %d+B" },
{ find = "; after #%d+" },
{ find = "; before #%d+" },
},
},
view = "mini",
},
@ -253,12 +279,12 @@ return {
opts = function()
local dashboard = require("alpha.themes.dashboard")
local logo = [[
██╗ █████╗ ███████╗██╗ ██╗██╗ ██╗██╗███╗ ███╗ Z
██║ ██╔══██╗╚══███╔╝╚██╗ ██╔╝██║ ██║██║████╗ ████║ Z
██║ ███████║ ███╔╝ ╚████╔╝ ██║ ██║██║██╔████╔██║ z
██║ ██╔══██║ ███╔╝ ╚██╔╝ ╚██╗ ██╔╝██║██║╚██╔╝██║ z
███████╗██║ ██║███████╗ ██║ ╚████╔╝ ██║██║ ╚═╝ ██║
╚══════╝╚═╝ ╚═╝╚══════╝ ╚═╝ ╚═══╝ ╚═╝╚═╝ ╚═╝
██╗ █████╗ ███████╗██╗ ██╗██╗ ██╗██╗███╗ ███╗ Z
██║ ██╔══██╗╚══███╔╝╚██╗ ██╔╝██║ ██║██║████╗ ████║ Z
██║ ███████║ ███╔╝ ╚████╔╝ ██║ ██║██║██╔████╔██║ z
██║ ██╔══██║ ███╔╝ ╚██╔╝ ╚██╗ ██╔╝██║██║╚██╔╝██║ z
███████╗██║ ██║███████╗ ██║ ╚████╔╝ ██║██║ ╚═╝ ██║
╚══════╝╚═╝ ╚═╝╚══════╝ ╚═╝ ╚═══╝ ╚═╝╚═╝ ╚═╝
]]
dashboard.section.header.val = vim.split(logo, "\n")

File diff suppressed because it is too large Load Diff

View File

@ -27,20 +27,6 @@ function M.fg(name)
return fg and { fg = string.format("#%06x", fg) }
end
function M.get_upvalue(func, name)
local i = 1
while true do
local n, v = debug.getupvalue(func, i)
if not n then
break
end
if n == name then
return v
end
i = i + 1
end
end
---@param fn fun()
function M.on_very_lazy(fn)
vim.api.nvim_create_autocmd("User", {
@ -137,17 +123,39 @@ function M.telescope(builtin, opts)
end
end
---@type table<string,LazyFloat>
local terminals = {}
-- Opens a floating terminal (interactive by default)
---@param cmd? string[]|string
---@param opts? LazyCmdOptions|{interactive?:boolean, esc_esc?:false}
function M.float_term(cmd, opts)
opts = vim.tbl_deep_extend("force", {
ft = "lazyterm",
size = { width = 0.9, height = 0.9 },
}, opts or {})
local float = require("lazy.util").float_term(cmd, opts)
if opts.esc_esc == false then
vim.keymap.set("t", "<esc>", "<esc>", { buffer = float.buf, nowait = true })
}, opts or {}, { persistent = true })
---@cast opts LazyCmdOptions|{interactive?:boolean, esc_esc?:false}
local termkey = vim.inspect({ cmd = cmd or "shell", cwd = opts.cwd, env = opts.env })
if terminals[termkey] and terminals[termkey]:buf_valid() then
terminals[termkey]:toggle()
else
terminals[termkey] = require("lazy.util").float_term(cmd, opts)
local buf = terminals[termkey].buf
vim.b[buf].lazyterm_cmd = cmd
if opts.esc_esc == false then
vim.keymap.set("t", "<esc>", "<esc>", { buffer = buf, nowait = true })
end
vim.api.nvim_create_autocmd("BufEnter", {
buffer = buf,
callback = function()
vim.cmd.startinsert()
end,
})
end
return terminals[termkey]
end
---@param silent boolean?