Compare commits

..

69 Commits

Author SHA1 Message Date
9a6b0f8928 chore(main): release 10.7.1 (#1870)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-10-25 17:52:35 +02:00
f589154268 fix(catppuccin): trouble integration. Fixes #1872 2023-10-25 17:23:37 +02:00
60e5707013 fix(util): pcall deletion of lazy_file augroup. See #1863 2023-10-25 15:54:35 +02:00
028f69c03c chore(main): release 10.7.0 (#1869)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-10-25 15:51:56 +02:00
58ddf405e0 fix(lang): add cmakelint to ensure installed list (#1826)
1. mason/cmakelang install bin/cmake-lint
2. nvim-lint only recognize bin/cmakelint
3. mason/cmakelint install bin/cmakelint
so we need mason/cmakelint installed to using nvim-lint to perform formatting
2023-10-25 15:50:02 +02:00
9e1f835223 feat(nvim): extend j/k enhancements to up/down arrows (#1833) 2023-10-25 15:48:45 +02:00
37953585bb fix(extras.python-semshi): improve highlights (#1845) 2023-10-25 15:47:07 +02:00
61fae7d23f fix: fix jdtls not spwaning in windows (#1864) 2023-10-25 15:46:39 +02:00
6dfeeb8322 chore(main): release 10.6.0 (#1842)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-10-25 15:44:48 +02:00
b651560ad0 perf(markdown): prevent headlines.nvim slowing down initial rendering with nvim README.md 2023-10-25 15:40:57 +02:00
1e1b68d633 fix(treesitter): make treesitter queries available at startup. See #1816 Fixes #1858 2023-10-25 15:40:25 +02:00
eab464d52d fix(markdown): create default numbered Headline groups for colorschemes that dont support them. Fixes #1822 2023-10-25 14:23:44 +02:00
c400cf0014 chore(build): auto-generate vimdoc 2023-10-25 12:06:15 +00:00
a5c9708736 perf(ui): wrap treesitter.foldexpr and cache get_parser during a event loop tick. Fixes #1846 2023-10-25 14:05:32 +02:00
99598ef7c7 feat(telescope): sort buffers with lastused and mru 2023-10-25 14:05:32 +02:00
ef5ec9a3bf style: added trouble ft for the next gen trouble 2023-10-25 14:05:32 +02:00
e7130c8250 chore(build): auto-generate vimdoc 2023-10-22 12:44:41 +00:00
e55ab411b4 fix(mini.hipatterns): use extmark_opts instead of soft deprecated priority (#1841) 2023-10-22 14:44:08 +02:00
fa3170d422 chore(build): auto-generate vimdoc 2023-10-20 11:27:50 +00:00
786a061eaa style(dashboard): remove unnecessary brackets from keys, including extras (#1809)
* style(dashboard): remove unnecessary brackets from keys, including the p key from the project extras

* review Folke

---------

Co-authored-by: abeldekat <abel@nomail.com>
2023-10-20 13:27:10 +02:00
0bb628053b chore(main): release 10.5.0 (#1808)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-10-19 20:16:16 +02:00
e996eed750 chore(main): release 10.5.0 (#1800)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-10-19 20:14:17 +02:00
8df44b3bb5 feat(typescript): added remove unused imports (#1794) 2023-10-19 20:12:48 +02:00
82da2440e4 fix(nvim-ts-autotag): make it actually work :) 2023-10-19 19:54:36 +02:00
fad3777296 fix(tabnine): run :CmpTabnineHub automatically on build (#1788) 2023-10-19 07:54:19 +02:00
ea3155aef6 fix(conform): allow overriding all conform format options. Fixes #1790 2023-10-19 07:52:47 +02:00
98b51a608c style(dashboard): make layout exactly the same as before 2023-10-19 07:52:47 +02:00
0ac8f6fb3b fix(treesitter-context): set default max_lines=3 2023-10-19 07:52:47 +02:00
b8c7e70c80 chore(build): auto-generate vimdoc 2023-10-19 05:45:44 +00:00
d73aee4a93 feat(dashboard): remove unnecessary brackets from keys (#1791) 2023-10-19 07:45:03 +02:00
ae77bfda89 chore(main): release 10.4.4 (#1786)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-10-18 13:11:54 +02:00
5c8cefaf40 chore(build): auto-generate vimdoc 2023-10-18 09:39:39 +00:00
7d8b3e8ef9 fix(project): don't let project.nvim change the cwd. Leads to too much confusion 2023-10-18 11:38:57 +02:00
0e12b00743 chore(main): release 10.4.3 (#1771)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-10-18 00:06:46 +02:00
2e308d5440 fix(neotest): better integration with trouble: no longer steals focus and hides when all ok 2023-10-18 00:04:28 +02:00
5c1656729a fix(dashboard): config shortcut when opening dashboard again. Fixes #1768 2023-10-17 18:28:06 +02:00
ian
1d4fbd3b2e fix(keymaps): let keymap n and N opens folds (#1298)
It's strange that mappings to n and N do not open folds like its original behavior, so I append `zv` to manually open folds.
2023-10-17 18:03:34 +02:00
b0ded5c015 fix(dot): treesitter langs in dot extra were not added 2023-10-17 16:33:55 +02:00
c711309a67 chore(main): release 10.4.2 (#1765)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-10-17 10:04:24 +02:00
af3ca06472 docs: fixed conform examples 2023-10-17 08:42:20 +02:00
4da4583b4a chore(build): auto-generate vimdoc 2023-10-17 06:29:04 +00:00
315df373f2 fix(statuscolumn): correct line numbers & respect more options 2023-10-17 08:28:23 +02:00
42ba1af40f chore(main): release 10.4.1 (#1757)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-10-16 23:09:17 +02:00
ff64cc5399 fix(format): set formatexpr in options so users can override it. Fixes #1759 2023-10-16 23:01:18 +02:00
fef0b3f756 fix(ui): fix BufferLineClose commands (#1756)
BufferLine has capital letter l
2023-10-16 17:19:52 +02:00
5926cda069 chore(main): release 10.4.0 (#1747)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-10-16 15:37:38 +02:00
3dbeda9d96 fix(markdown): add marksman to mason install 2023-10-16 12:44:41 +02:00
98db7ec0d2 perf(root): cache root detection. Fixes #1753 2023-10-16 12:42:54 +02:00
db175ef3f6 chore(build): auto-generate vimdoc 2023-10-16 08:42:32 +00:00
f513e1cede ci: LazyVim now requires Neovim >= 0.9.0 (#1751) 2023-10-16 10:41:54 +02:00
9517e64009 fix(root): root dir for windows. Fixes #1749 2023-10-16 08:35:35 +02:00
152e1c6692 feat(markdown): added headlines.nvim to markdown extra 2023-10-16 08:36:27 +02:00
982c8e301b fix(conform): remove LazyVim's conform config changes since that's now merged in conform 2023-10-16 08:11:15 +02:00
5c4f881158 style(keymaps): no need to check for trouble to set [q, ]q 2023-10-16 07:44:20 +02:00
8c726cd166 feat(lualine): use gitsigns for diff source (#1744)
Co-authored-by: edshamis <pc>
2023-10-16 07:44:10 +02:00
c3daced11c feat(ui): add keymap to close other buffers (#1743)
* feat(ui): add keymap to close other buffers

* refactor

---------

Co-authored-by: Folke Lemaitre <folke.lemaitre@gmail.com>
2023-10-16 07:35:57 +02:00
66482927cb chore(build): auto-generate vimdoc 2023-10-16 05:30:47 +00:00
be5eea476c feat(keymaps): added toggle for treesitter highlights 2023-10-16 07:30:06 +02:00
e26a127185 chore(main): release 10.3.0 (#1733)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-10-15 22:51:01 +02:00
c8e5501ee5 feat(tabnine): add build cmd for Windows (#1737)
* feat(tabnine): add build cmd for Windows

* fix(prettier): use prettier instead of prettierd. Too many people get truncated files. Fixes #712. See #1735

* feat: disable kind_filter for markdown and help

* feat(lualine): pretty_path now highlights file basename when modified

* fix(root): dont use single-file lsps for root detection. use workspaces only

* feat(lualine): new root dir component that only shows when cwd != root_dir

* refactor

---------

Co-authored-by: edshamis <pc>
Co-authored-by: Folke Lemaitre <folke.lemaitre@gmail.com>
2023-10-15 22:42:38 +02:00
dfdfcad1aa feat(lualine): new root dir component that only shows when cwd != root_dir 2023-10-15 22:38:44 +02:00
6f88b8b36f fix(root): dont use single-file lsps for root detection. use workspaces only 2023-10-15 22:38:15 +02:00
8af7309c7e feat(lualine): pretty_path now highlights file basename when modified 2023-10-15 22:37:49 +02:00
782fe0bef0 feat: disable kind_filter for markdown and help 2023-10-15 22:34:42 +02:00
57b504b9e8 fix(prettier): use prettier instead of prettierd. Too many people get truncated files. Fixes #712. See #1735 2023-10-15 22:28:56 +02:00
53e1637a86 feat(dashboard): c on dahboard now opens telescope for config dir instead of useless init.lua 2023-10-15 09:16:52 +02:00
7c60431c58 fix(python): add ft to Python keymaps, and fix "Markdown Preview" toggle description (#1729)
* feat(python): add `ft` to keymaps

* fix(markdown): fix toggle keymap description
2023-10-15 07:21:17 +02:00
5ea0dd716a chore(build): auto-generate vimdoc 2023-10-15 05:18:51 +00:00
6e0e352fea feat(linting): ability to configure global and fallback linters (#1727)
* feat(linting): ability to configure global and fallback linters

* fix: use nvim-lint's logic to get linters

---------

Co-authored-by: Folke Lemaitre <folke.lemaitre@gmail.com>
2023-10-15 07:18:00 +02:00
34 changed files with 643 additions and 193 deletions

View File

@ -36,7 +36,7 @@ jobs:
uses: kdheepak/panvimdoc@main
with:
vimdoc: LazyVim
version: "Neovim >= 0.8.0"
version: "Neovim >= 0.9.0"
demojify: true
treesitter: true
- name: Push changes

View File

@ -1,5 +1,151 @@
# Changelog
## [10.7.1](https://github.com/LazyVim/LazyVim/compare/v10.7.0...v10.7.1) (2023-10-25)
### Bug Fixes
* **catppuccin:** trouble integration. Fixes [#1872](https://github.com/LazyVim/LazyVim/issues/1872) ([f589154](https://github.com/LazyVim/LazyVim/commit/f589154268dfcb3e8f91075791a0a618c97fe59d))
* **util:** pcall deletion of lazy_file augroup. See [#1863](https://github.com/LazyVim/LazyVim/issues/1863) ([60e5707](https://github.com/LazyVim/LazyVim/commit/60e57070131f4c544e17541610415d4d51769d62))
## [10.7.0](https://github.com/LazyVim/LazyVim/compare/v10.6.0...v10.7.0) (2023-10-25)
### Features
* **nvim:** extend j/k enhancements to up/down arrows ([#1833](https://github.com/LazyVim/LazyVim/issues/1833)) ([9e1f835](https://github.com/LazyVim/LazyVim/commit/9e1f83522396d141455de8f2d5e0b3e8beca8d0a))
### Bug Fixes
* **extras.python-semshi:** improve highlights ([#1845](https://github.com/LazyVim/LazyVim/issues/1845)) ([3795358](https://github.com/LazyVim/LazyVim/commit/37953585bb06b3ffbdb37b40bb586590fde2b2a9))
* fix jdtls not spwaning in windows ([#1864](https://github.com/LazyVim/LazyVim/issues/1864)) ([61fae7d](https://github.com/LazyVim/LazyVim/commit/61fae7d23f5689a9112b265f4bfb8468a131ae66))
* **lang:** add cmakelint to ensure installed list ([#1826](https://github.com/LazyVim/LazyVim/issues/1826)) ([58ddf40](https://github.com/LazyVim/LazyVim/commit/58ddf405e09da967eca29169571114b01172fff3))
## [10.6.0](https://github.com/LazyVim/LazyVim/compare/v10.5.0...v10.6.0) (2023-10-25)
### Features
* **telescope:** sort buffers with lastused and mru ([99598ef](https://github.com/LazyVim/LazyVim/commit/99598ef7c7c15c980b6d5c36f8e9cefd745fcf34))
### Bug Fixes
* **markdown:** create default numbered Headline groups for colorschemes that dont support them. Fixes [#1822](https://github.com/LazyVim/LazyVim/issues/1822) ([eab464d](https://github.com/LazyVim/LazyVim/commit/eab464d52d28d4e24e5d189ee627c96e720e057c))
* **mini.hipatterns:** use `extmark_opts` instead of soft deprecated `priority` ([#1841](https://github.com/LazyVim/LazyVim/issues/1841)) ([e55ab41](https://github.com/LazyVim/LazyVim/commit/e55ab411b42c75919b33b87e19714b5c595316d4))
* **treesitter:** make treesitter queries available at startup. See [#1816](https://github.com/LazyVim/LazyVim/issues/1816) Fixes [#1858](https://github.com/LazyVim/LazyVim/issues/1858) ([1e1b68d](https://github.com/LazyVim/LazyVim/commit/1e1b68d633d4bd4faa912ba5f49ab6b8601dc0c9))
### Performance Improvements
* **markdown:** prevent headlines.nvim slowing down initial rendering with `nvim README.md` ([b651560](https://github.com/LazyVim/LazyVim/commit/b651560ad0ee750c96bca6866cfdc008e75d397c))
* **ui:** wrap treesitter.foldexpr and cache get_parser during a event loop tick. Fixes [#1846](https://github.com/LazyVim/LazyVim/issues/1846) ([a5c9708](https://github.com/LazyVim/LazyVim/commit/a5c9708736f6ecd3e3413ad0ca34b7b1fa3d4862))
## [10.5.0](https://github.com/LazyVim/LazyVim/compare/v10.4.4...v10.5.0) (2023-10-19)
### Features
* **dashboard:** remove unnecessary brackets from keys ([#1791](https://github.com/LazyVim/LazyVim/issues/1791)) ([d73aee4](https://github.com/LazyVim/LazyVim/commit/d73aee4a934b0aa12e07039da9e2df0215ba2cba))
* **typescript:** added remove unused imports ([#1794](https://github.com/LazyVim/LazyVim/issues/1794)) ([8df44b3](https://github.com/LazyVim/LazyVim/commit/8df44b3bb54483e42a27dc30a8b343acc5d5d242))
### Bug Fixes
* **conform:** allow overriding all conform format options. Fixes [#1790](https://github.com/LazyVim/LazyVim/issues/1790) ([ea3155a](https://github.com/LazyVim/LazyVim/commit/ea3155aef6d47e744cb2b4a7a3b567288d780f8d))
* **nvim-ts-autotag:** make it actually work :) ([82da244](https://github.com/LazyVim/LazyVim/commit/82da2440e4c9d7e604cf998aee0655f78ddfdd5c))
* **tabnine:** run `:CmpTabnineHub` automatically on build ([#1788](https://github.com/LazyVim/LazyVim/issues/1788)) ([fad3777](https://github.com/LazyVim/LazyVim/commit/fad37772967f06c65d6f0b52c2ea6f190b3218ee))
* **treesitter-context:** set default max_lines=3 ([0ac8f6f](https://github.com/LazyVim/LazyVim/commit/0ac8f6fb3b1705c2b675a0e3cbee4968370f047a))
## [10.5.0](https://github.com/LazyVim/LazyVim/compare/v10.4.4...v10.5.0) (2023-10-19)
### Features
* **dashboard:** remove unnecessary brackets from keys ([#1791](https://github.com/LazyVim/LazyVim/issues/1791)) ([d73aee4](https://github.com/LazyVim/LazyVim/commit/d73aee4a934b0aa12e07039da9e2df0215ba2cba))
### Bug Fixes
* **conform:** allow overriding all conform format options. Fixes [#1790](https://github.com/LazyVim/LazyVim/issues/1790) ([ea3155a](https://github.com/LazyVim/LazyVim/commit/ea3155aef6d47e744cb2b4a7a3b567288d780f8d))
* **nvim-ts-autotag:** make it actually work :) ([82da244](https://github.com/LazyVim/LazyVim/commit/82da2440e4c9d7e604cf998aee0655f78ddfdd5c))
* **tabnine:** run `:CmpTabnineHub` automatically on build ([#1788](https://github.com/LazyVim/LazyVim/issues/1788)) ([fad3777](https://github.com/LazyVim/LazyVim/commit/fad37772967f06c65d6f0b52c2ea6f190b3218ee))
* **treesitter-context:** set default max_lines=3 ([0ac8f6f](https://github.com/LazyVim/LazyVim/commit/0ac8f6fb3b1705c2b675a0e3cbee4968370f047a))
## [10.4.4](https://github.com/LazyVim/LazyVim/compare/v10.4.3...v10.4.4) (2023-10-18)
### Bug Fixes
* **project:** don't let `project.nvim` change the cwd. Leads to too much confusion ([7d8b3e8](https://github.com/LazyVim/LazyVim/commit/7d8b3e8ef96f91f96c8e3a0ba62dfab270debf9f))
## [10.4.3](https://github.com/LazyVim/LazyVim/compare/v10.4.2...v10.4.3) (2023-10-17)
### Bug Fixes
* **dashboard:** config shortcut when opening dashboard again. Fixes [#1768](https://github.com/LazyVim/LazyVim/issues/1768) ([5c16567](https://github.com/LazyVim/LazyVim/commit/5c1656729aeb39fbb8dc29d4f3d6d86d0836f8b4))
* **dot:** treesitter langs in dot extra were not added ([b0ded5c](https://github.com/LazyVim/LazyVim/commit/b0ded5c015a68f07a32fab64a2cd0f27f4d69870))
* **keymaps:** let keymap n and N opens folds ([#1298](https://github.com/LazyVim/LazyVim/issues/1298)) ([1d4fbd3](https://github.com/LazyVim/LazyVim/commit/1d4fbd3b2e48eaae448073af020ca2617ab7bd5c))
* **neotest:** better integration with trouble: no longer steals focus and hides when all ok ([2e308d5](https://github.com/LazyVim/LazyVim/commit/2e308d5440c830bb37531d03a0313af3a5c94bb5))
## [10.4.2](https://github.com/LazyVim/LazyVim/compare/v10.4.1...v10.4.2) (2023-10-17)
### Bug Fixes
* **statuscolumn:** correct line numbers & respect more options ([315df37](https://github.com/LazyVim/LazyVim/commit/315df373f2d0c354b08acd607f6227b07436ce03))
## [10.4.1](https://github.com/LazyVim/LazyVim/compare/v10.4.0...v10.4.1) (2023-10-16)
### Bug Fixes
* **format:** set formatexpr in options so users can override it. Fixes [#1759](https://github.com/LazyVim/LazyVim/issues/1759) ([ff64cc5](https://github.com/LazyVim/LazyVim/commit/ff64cc53992b966a2558e95afc449e1da29dd44d))
* **ui:** fix BufferLineClose commands ([#1756](https://github.com/LazyVim/LazyVim/issues/1756)) ([fef0b3f](https://github.com/LazyVim/LazyVim/commit/fef0b3f7564e64f92df129cd86bc904afc19b976))
## [10.4.0](https://github.com/LazyVim/LazyVim/compare/v10.3.0...v10.4.0) (2023-10-16)
### Features
* **keymaps:** added toggle for treesitter highlights ([be5eea4](https://github.com/LazyVim/LazyVim/commit/be5eea476c98d46aefbbaee04b7f2bc82bb51c27))
* **lualine:** use gitsigns for diff source ([#1744](https://github.com/LazyVim/LazyVim/issues/1744)) ([8c726cd](https://github.com/LazyVim/LazyVim/commit/8c726cd16638f51308f479f26143d94a6c3013ea))
* **markdown:** added headlines.nvim to markdown extra ([152e1c6](https://github.com/LazyVim/LazyVim/commit/152e1c6692566a2e2a3968fbfc6eca69d33ba02c))
* **ui:** add keymap to close other buffers ([#1743](https://github.com/LazyVim/LazyVim/issues/1743)) ([c3daced](https://github.com/LazyVim/LazyVim/commit/c3daced11ce33875059ad5dd74832bf4a232f195))
### Bug Fixes
* **conform:** remove LazyVim's conform config changes since that's now merged in conform ([982c8e3](https://github.com/LazyVim/LazyVim/commit/982c8e301bb432f44a85d915a8268442c7db05fa))
* **markdown:** add marksman to mason install ([3dbeda9](https://github.com/LazyVim/LazyVim/commit/3dbeda9d96a2225875c4991116cb834f20588ddb))
* **root:** root dir for windows. Fixes [#1749](https://github.com/LazyVim/LazyVim/issues/1749) ([9517e64](https://github.com/LazyVim/LazyVim/commit/9517e64009a1a547f5e5b96a8fc78bf5ea0bbb6e))
### Performance Improvements
* **root:** cache root detection. Fixes [#1753](https://github.com/LazyVim/LazyVim/issues/1753) ([98db7ec](https://github.com/LazyVim/LazyVim/commit/98db7ec0d287adcd8eaf6a93c4a392f588b5615a))
## [10.3.0](https://github.com/LazyVim/LazyVim/compare/v10.2.0...v10.3.0) (2023-10-15)
### Features
* **dashboard:** `c` on dahboard now opens telescope for config dir instead of useless `init.lua` ([53e1637](https://github.com/LazyVim/LazyVim/commit/53e1637a864cb7e8f21af107b8073bc8b24acd11))
* disable kind_filter for markdown and help ([782fe0b](https://github.com/LazyVim/LazyVim/commit/782fe0bef0789c8f090284df80c00799471bc16f))
* **linting:** ability to configure global and fallback linters ([#1727](https://github.com/LazyVim/LazyVim/issues/1727)) ([6e0e352](https://github.com/LazyVim/LazyVim/commit/6e0e352fea4cd930ea7fc42a0252c2c70b279bee))
* **lualine:** new root dir component that only shows when cwd != root_dir ([dfdfcad](https://github.com/LazyVim/LazyVim/commit/dfdfcad1aab0ee39ac3876e47cbeb727eb4f1e95))
* **lualine:** pretty_path now highlights file basename when modified ([8af7309](https://github.com/LazyVim/LazyVim/commit/8af7309c7e31f55125eaade5fe86d04d63133999))
* **tabnine:** add build cmd for Windows ([#1737](https://github.com/LazyVim/LazyVim/issues/1737)) ([c8e5501](https://github.com/LazyVim/LazyVim/commit/c8e5501ee5ecd1a7b27ff3aa5f41e54c2e98ff0b))
### Bug Fixes
* **prettier:** use prettier instead of prettierd. Too many people get truncated files. Fixes [#712](https://github.com/LazyVim/LazyVim/issues/712). See [#1735](https://github.com/LazyVim/LazyVim/issues/1735) ([57b504b](https://github.com/LazyVim/LazyVim/commit/57b504b9e8ae95c294c17e97e7f017f6f802ebbc))
* **python:** add `ft` to Python keymaps, and fix "Markdown Preview" toggle description ([#1729](https://github.com/LazyVim/LazyVim/issues/1729)) ([7c60431](https://github.com/LazyVim/LazyVim/commit/7c60431c58a050cf4badced0609f3179bd284137))
* **root:** dont use single-file lsps for root detection. use workspaces only ([6f88b8b](https://github.com/LazyVim/LazyVim/commit/6f88b8b36f8d4fd0e958e59b4e37e1a9ed2acb78))
## [10.2.0](https://github.com/LazyVim/LazyVim/compare/v10.1.1...v10.2.0) (2023-10-14)

View File

@ -1,4 +1,4 @@
*LazyVim.txt* For Neovim >= 0.8.0 Last change: 2023 October 14
*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2023 October 25
==============================================================================
Table of Contents *LazyVim-table-of-contents*

View File

@ -3,7 +3,7 @@ local Util = require("lazyvim.util")
---@class LazyVimConfig: LazyVimOptions
local M = {}
M.version = "10.2.0" -- x-release-please-version
M.version = "10.7.1" -- x-release-please-version
---@class LazyVimOptions
local defaults = {
@ -92,7 +92,7 @@ local defaults = {
Variable = "󰀫 ",
},
},
---@type table<string, string[]>?
---@type table<string, string[]|boolean>?
kind_filter = {
default = {
"Class",
@ -109,6 +109,8 @@ local defaults = {
"Struct",
"Trait",
},
markdown = false,
help = false,
-- you can specify a different filter for each filetype
lua = {
"Class",
@ -178,10 +180,7 @@ function M.setup(opts)
Util.format.setup()
Util.news.setup()
vim.api.nvim_create_user_command("LazyRoot", function()
Util.root.info()
end, { desc = "LazyVim roots for the current buffer" })
Util.root.setup()
vim.api.nvim_create_user_command("LazyExtras", function()
Util.extras.show()
@ -214,7 +213,11 @@ function M.get_kind_filter(buf)
if M.kind_filter == false then
return
end
return M.kind_filter[ft] or M.kind_filter.default
if M.kind_filter[ft] == false then
return
end
---@diagnostic disable-next-line: return-type-mismatch
return type(M.kind_filter) == "table" and type(M.kind_filter.default) == "table" and M.kind_filter.default or nil
end
---@param name "autocmds" | "options" | "keymaps"

View File

@ -7,7 +7,9 @@ local map = Util.safe_keymap_set
-- better up/down
map({ "n", "x" }, "j", "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true })
map({ "n", "x" }, "<Down>", "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true })
map({ "n", "x" }, "k", "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true })
map({ "n", "x" }, "<Up>", "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", remap = true })
@ -30,17 +32,10 @@ map("v", "<A-j>", ":m '>+1<cr>gv=gv", { desc = "Move down" })
map("v", "<A-k>", ":m '<-2<cr>gv=gv", { desc = "Move up" })
-- buffers
if Util.has("bufferline.nvim") then
map("n", "<S-h>", "<cmd>BufferLineCyclePrev<cr>", { desc = "Prev buffer" })
map("n", "<S-l>", "<cmd>BufferLineCycleNext<cr>", { desc = "Next buffer" })
map("n", "[b", "<cmd>BufferLineCyclePrev<cr>", { desc = "Prev buffer" })
map("n", "]b", "<cmd>BufferLineCycleNext<cr>", { desc = "Next buffer" })
else
map("n", "<S-h>", "<cmd>bprevious<cr>", { desc = "Prev buffer" })
map("n", "<S-l>", "<cmd>bnext<cr>", { desc = "Next buffer" })
map("n", "[b", "<cmd>bprevious<cr>", { desc = "Prev buffer" })
map("n", "]b", "<cmd>bnext<cr>", { desc = "Next buffer" })
end
map("n", "<S-h>", "<cmd>bprevious<cr>", { desc = "Prev buffer" })
map("n", "<S-l>", "<cmd>bnext<cr>", { desc = "Next buffer" })
map("n", "[b", "<cmd>bprevious<cr>", { desc = "Prev buffer" })
map("n", "]b", "<cmd>bnext<cr>", { desc = "Next buffer" })
map("n", "<leader>bb", "<cmd>e #<cr>", { desc = "Switch to Other Buffer" })
map("n", "<leader>`", "<cmd>e #<cr>", { desc = "Switch to Other Buffer" })
@ -57,10 +52,10 @@ map(
)
-- https://github.com/mhinz/vim-galore#saner-behavior-of-n-and-n
map("n", "n", "'Nn'[v:searchforward]", { expr = true, desc = "Next search result" })
map("n", "n", "'Nn'[v:searchforward].'zv'", { expr = true, desc = "Next search result" })
map("x", "n", "'Nn'[v:searchforward]", { expr = true, desc = "Next search result" })
map("o", "n", "'Nn'[v:searchforward]", { expr = true, desc = "Next search result" })
map("n", "N", "'nN'[v:searchforward]", { expr = true, desc = "Prev search result" })
map("n", "N", "'nN'[v:searchforward].'zv'", { expr = true, desc = "Prev search result" })
map("x", "N", "'nN'[v:searchforward]", { expr = true, desc = "Prev search result" })
map("o", "N", "'nN'[v:searchforward]", { expr = true, desc = "Prev search result" })
@ -88,10 +83,8 @@ map("n", "<leader>fn", "<cmd>enew<cr>", { desc = "New File" })
map("n", "<leader>xl", "<cmd>lopen<cr>", { desc = "Location List" })
map("n", "<leader>xq", "<cmd>copen<cr>", { desc = "Quickfix List" })
if not Util.has("trouble.nvim") then
map("n", "[q", vim.cmd.cprev, { desc = "Previous quickfix" })
map("n", "]q", vim.cmd.cnext, { desc = "Next quickfix" })
end
map("n", "[q", vim.cmd.cprev, { desc = "Previous quickfix" })
map("n", "]q", vim.cmd.cnext, { desc = "Next quickfix" })
-- formatting
map({ "n", "v" }, "<leader>cf", function()
@ -129,6 +122,7 @@ map("n", "<leader>uc", function() Util.toggle("conceallevel", false, {0, conceal
if vim.lsp.inlay_hint then
map("n", "<leader>uh", function() vim.lsp.inlay_hint(0, nil) end, { desc = "Toggle Inlay Hints" })
end
map("n", "<leader>uT", function() if vim.b.ts_highlight then vim.treesitter.stop() else vim.treesitter.start() end end, { desc = "Toggle Treesitter Highlight" })
-- lazygit
map("n", "<leader>gg", function() Util.terminal({ "lazygit" }, { cwd = Util.root(), esc_esc = false, ctrl_hjkl = false }) end, { desc = "Lazygit (root dir)" })

View File

@ -82,10 +82,12 @@ end
-- HACK: causes freezes on <= 0.9, so only enable on >= 0.10 for now
if vim.fn.has("nvim-0.10") == 1 then
vim.opt.foldmethod = "expr"
vim.opt.foldexpr = "v:lua.vim.treesitter.foldexpr()"
vim.opt.foldexpr = "v:lua.require'lazyvim.util'.ui.foldexpr()"
else
vim.opt.foldmethod = "indent"
end
vim.o.formatexpr = "v:lua.require'lazyvim.util'.format.formatexpr()"
-- Fix markdown indentation settings
vim.g.markdown_recommended_style = 0

View File

@ -52,7 +52,7 @@ return {
end,
opts = {
sources = { "filesystem", "buffers", "git_status", "document_symbols" },
open_files_do_not_replace_types = { "terminal", "Trouble", "qf", "Outline" },
open_files_do_not_replace_types = { "terminal", "Trouble", "trouble", "qf", "Outline" },
filesystem = {
bind_to_cwd = false,
follow_current_file = { enabled = true },
@ -127,12 +127,17 @@ return {
},
},
keys = {
{ "<leader>,", "<cmd>Telescope buffers show_all_buffers=true<cr>", desc = "Switch Buffer" },
{
"<leader>,",
"<cmd>Telescope buffers sort_mru=true sort_lastused=true<cr>",
desc = "Switch Buffer",
},
{ "<leader>/", Util.telescope("live_grep"), desc = "Grep (root dir)" },
{ "<leader>:", "<cmd>Telescope command_history<cr>", desc = "Command History" },
{ "<leader><space>", Util.telescope("files"), desc = "Find Files (root dir)" },
-- find
{ "<leader>fb", "<cmd>Telescope buffers<cr>", desc = "Buffers" },
{ "<leader>fb", "<cmd>Telescope buffers sort_mru=true sort_lastused=true<cr>", desc = "Buffers" },
{ "<leader>fc", Util.telescope.config_files(), desc = "Find Config File" },
{ "<leader>ff", Util.telescope("files"), desc = "Find Files (root dir)" },
{ "<leader>fF", Util.telescope("files", { cwd = false }), desc = "Find Files (cwd)" },
{ "<leader>fr", "<cmd>Telescope oldfiles<cr>", desc = "Recent" },

View File

@ -5,10 +5,12 @@ return {
{
"nvim-cmp",
dependencies = {
-- Add TabNine support, make sure you run :CmpTabnineHub after installation.
{
"tzachar/cmp-tabnine",
build = "./install.sh",
build = {
Util.is_win() and "pwsh -noni .\\install.ps1" or "./install.sh",
":CmpTabnineHub",
},
dependencies = "hrsh7th/nvim-cmp",
opts = {
max_lines = 1000,
@ -16,8 +18,7 @@ return {
sort = true,
},
config = function(_, opts)
local tabnine = require("cmp_tabnine.config")
tabnine:setup(opts)
require("cmp_tabnine.config"):setup(opts)
end,
},
},

View File

@ -12,14 +12,20 @@ return {
symbols = {},
symbol_blacklist = {},
}
local filter = Config.kind_filter
for kind, symbol in pairs(defaults.symbols) do
opts.symbols[kind] = {
icon = Config.icons.kinds[kind] or symbol.icon,
hl = symbol.hl,
}
if not vim.tbl_contains(Config.kind_filter.default, kind) then
table.insert(opts.symbol_blacklist, kind)
if type(filter) == "table" then
filter = filter.default
if type(filter) == "table" then
for kind, symbol in pairs(defaults.symbols) do
opts.symbols[kind] = {
icon = Config.icons.kinds[kind] or symbol.icon,
hl = symbol.hl,
}
if not vim.tbl_contains(filter, kind) then
table.insert(opts.symbol_blacklist, kind)
end
end
end
end
return opts

View File

@ -2,7 +2,7 @@ return {
{
"williamboman/mason.nvim",
opts = function(_, opts)
table.insert(opts.ensure_installed, "prettierd")
table.insert(opts.ensure_installed, "prettier")
end,
},
{
@ -11,7 +11,7 @@ return {
opts = function(_, opts)
local nls = require("null-ls")
opts.sources = opts.sources or {}
table.insert(opts.sources, nls.builtins.formatting.prettierd)
table.insert(opts.sources, nls.builtins.formatting.prettier)
end,
},
{
@ -19,22 +19,22 @@ return {
optional = true,
opts = {
formatters_by_ft = {
["javascript"] = { { "prettierd", "prettier" } },
["javascriptreact"] = { { "prettierd", "prettier" } },
["typescript"] = { { "prettierd", "prettier" } },
["typescriptreact"] = { { "prettierd", "prettier" } },
["vue"] = { { "prettierd", "prettier" } },
["css"] = { { "prettierd", "prettier" } },
["scss"] = { { "prettierd", "prettier" } },
["less"] = { { "prettierd", "prettier" } },
["html"] = { { "prettierd", "prettier" } },
["json"] = { { "prettierd", "prettier" } },
["jsonc"] = { { "prettierd", "prettier" } },
["yaml"] = { { "prettierd", "prettier" } },
["markdown"] = { { "prettierd", "prettier" } },
["markdown.mdx"] = { { "prettierd", "prettier" } },
["graphql"] = { { "prettierd", "prettier" } },
["handlebars"] = { { "prettierd", "prettier" } },
["javascript"] = { "prettier" },
["javascriptreact"] = { "prettier" },
["typescript"] = { "prettier" },
["typescriptreact"] = { "prettier" },
["vue"] = { "prettier" },
["css"] = { "prettier" },
["scss"] = { "prettier" },
["less"] = { "prettier" },
["html"] = { "prettier" },
["json"] = { "prettier" },
["jsonc"] = { "prettier" },
["yaml"] = { "prettier" },
["markdown"] = { "prettier" },
["markdown.mdx"] = { "prettier" },
["graphql"] = { "prettier" },
["handlebars"] = { "prettier" },
},
},
},

View File

@ -30,7 +30,7 @@ return {
"mason.nvim",
opts = function(_, opts)
opts.ensure_installed = opts.ensure_installed or {}
vim.list_extend(opts.ensure_installed, { "cmakelang" })
vim.list_extend(opts.ensure_installed, { "cmakelang", "cmakelint" })
end,
},
{

View File

@ -85,7 +85,7 @@ return {
-- How to run jdtls. This can be overridden to a full java command-line
-- if the Python wrapper script doesn't suffice.
cmd = { "jdtls" },
cmd = { vim.fn.exepath("jdtls") },
full_cmd = function(opts)
local fname = vim.api.nvim_buf_get_name(0)
local root_dir = opts.root_dir(fname)

View File

@ -11,7 +11,7 @@ return {
"williamboman/mason.nvim",
opts = function(_, opts)
opts.ensure_installed = opts.ensure_installed or {}
vim.list_extend(opts.ensure_installed, { "markdownlint" })
vim.list_extend(opts.ensure_installed, { "markdownlint", "marksman" })
end,
},
{
@ -54,11 +54,37 @@ return {
"<leader>cp",
ft = "markdown",
"<cmd>MarkdownPreviewToggle<cr>",
desc = "Peek (Markdown Preview)",
desc = "Markdown Preview",
},
},
config = function()
vim.cmd([[do FileType]])
end,
},
{
"lukas-reineke/headlines.nvim",
opts = function()
local opts = {}
for _, ft in ipairs({ "markdown", "norg", "rmd", "org" }) do
opts[ft] = {
headline_highlights = {},
}
for i = 1, 6 do
local hl = "Headline" .. i
vim.api.nvim_set_hl(0, hl, { link = "Headline", default = true })
table.insert(opts[ft].headline_highlights, hl)
end
end
return opts
end,
ft = { "markdown", "norg", "rmd", "org" },
config = function(_, opts)
-- PERF: schedule to prevent headlines slowing down opening a file
vim.schedule(function()
require("headlines").setup(opts)
require("headlines").refresh()
end)
end,
},
}

View File

@ -17,13 +17,14 @@ return {
-- Only add style, inherit or link to the LSP's colors
vim.cmd([[
highlight! semshiGlobal gui=italic
highlight! semshiImported gui=bold
highlight! link semshiImported @none
highlight! link semshiParameter @lsp.type.parameter
highlight! link semshiParameterUnused DiagnosticUnnecessary
highlight! link semshiBuiltin @function.builtin
highlight! link semshiAttribute @attribute
highlight! link semshiAttribute @field
highlight! link semshiSelf @lsp.type.selfKeyword
highlight! link semshiUnresolved @lsp.type.unresolvedReference
highlight! link semshiFree @none
]])
end,
})

View File

@ -65,8 +65,8 @@ return {
"mfussenegger/nvim-dap-python",
-- stylua: ignore
keys = {
{ "<leader>dPt", function() require('dap-python').test_method() end, desc = "Debug Method" },
{ "<leader>dPc", function() require('dap-python').test_class() end, desc = "Debug Class" },
{ "<leader>dPt", function() require('dap-python').test_method() end, desc = "Debug Method", ft = "python" },
{ "<leader>dPc", function() require('dap-python').test_class() end, desc = "Debug Class", ft = "python" },
},
config = function()
local path = require("mason-registry").get_package("debugpy"):get_install_path()

View File

@ -32,6 +32,19 @@ return {
end,
desc = "Organize Imports",
},
{
"<leader>cR",
function()
vim.lsp.buf.code_action({
apply = true,
context = {
only = { "source.removeUnused.ts" },
diagnostics = {},
},
})
end,
desc = "Remove Unused Imports",
},
},
settings = {
typescript = {

View File

@ -27,7 +27,7 @@ return {
quickfix = {
open = function()
if require("lazyvim.util").has("trouble.nvim") then
vim.cmd("Trouble quickfix")
require("trouble").open({ mode = "quickfix", focus = false })
else
vim.cmd("copen")
end
@ -46,6 +46,37 @@ return {
},
}, neotest_ns)
if require("lazyvim.util").has("trouble.nvim") then
opts.consumers = opts.consumers or {}
-- Refresh and auto close trouble after running tests
---@type neotest.Consumer
opts.consumers.trouble = function(client)
client.listeners.results = function(adapter_id, results, partial)
if partial then
return
end
local tree = assert(client:get_position(nil, { adapter = adapter_id }))
local failed = 0
for pos_id, result in pairs(results) do
if result.status == "failed" and tree:get_key(pos_id) then
failed = failed + 1
end
end
vim.schedule(function()
local trouble = require("trouble")
if trouble.is_open() then
trouble.refresh()
if failed == 0 then
trouble.close()
end
end
end)
return {}
end
end
end
if opts.adapters then
local adapters = {}
for name, config in pairs(opts.adapters or {}) do

View File

@ -27,9 +27,9 @@ return {
dashboard.button("n", "" .. " New file", "<cmd> ene <BAR> startinsert <cr>"),
dashboard.button("r", "" .. " Recent files", "<cmd> Telescope oldfiles <cr>"),
dashboard.button("g", "" .. " Find text", "<cmd> Telescope live_grep <cr>"),
dashboard.button("c", "" .. " Config", "<cmd> e $MYVIMRC <cr>"),
dashboard.button("c", "" .. " Config", "<cmd> lua require('lazyvim.util').telescope.config_files()() <cr>"),
dashboard.button("s", "" .. " Restore Session", [[<cmd> lua require("persistence").load() <cr>]]),
dashboard.button("e", "" .. " Lazy Extras", "<cmd> LazyExtras <cr>"),
dashboard.button("x", "" .. " Lazy Extras", "<cmd> LazyExtras <cr>"),
dashboard.button("l", "󰒲 " .. " Lazy", "<cmd> Lazy <cr>"),
dashboard.button("q", "" .. " Quit", "<cmd> qa <cr>"),
}

View File

@ -40,6 +40,12 @@ return {
end,
},
"Trouble",
{
ft = "trouble",
filter = function(buf, win)
return vim.api.nvim_win_get_config(win).relative == ""
end,
},
{ ft = "qf", title = "QuickFix" },
{
ft = "help",
@ -129,7 +135,7 @@ return {
optional = true,
opts = function(_, opts)
opts.open_files_do_not_replace_types = opts.open_files_do_not_replace_types
or { "terminal", "Trouble", "qf", "Outline" }
or { "terminal", "Trouble", "qf", "Outline", "trouble" }
table.insert(opts.open_files_do_not_replace_types, "edgy")
end,
},

View File

@ -29,15 +29,15 @@ return {
evaluate_single = true,
header = logo,
items = {
new_section("Find file", "Telescope find_files", "Telescope"),
new_section("Recent files", "Telescope oldfiles", "Telescope"),
new_section("Grep text", "Telescope live_grep", "Telescope"),
new_section("init.lua", "e $MYVIMRC", "Config"),
new_section("Extras", "LazyExtras", "Config"),
new_section("Lazy", "Lazy", "Config"),
new_section("New file", "ene | startinsert", "Built-in"),
new_section("Quit", "qa", "Built-in"),
new_section("Session restore", [[lua require("persistence").load()]], "Session"),
new_section("Find file", "Telescope find_files", "Telescope"),
new_section("Recent files", "Telescope oldfiles", "Telescope"),
new_section("Grep text", "Telescope live_grep", "Telescope"),
new_section("Config", "lua require('lazyvim.util').telescope.config_files()()", "Config"),
new_section("Extras", "LazyExtras", "Config"),
new_section("Lazy", "Lazy", "Config"),
new_section("New file", "ene | startinsert", "Built-in"),
new_section("Quit", "qa", "Built-in"),
new_section("Session restore", [[lua require("persistence").load()]], "Session"),
},
content_hooks = {
starter.gen_hook.adding_bullet(pad .. "", false),

View File

@ -37,7 +37,7 @@ return {
"nvim-treesitter/nvim-treesitter",
opts = function(_, opts)
local function add(lang)
if type(opts.ensure_installed) ~= "table" then
if type(opts.ensure_installed) == "table" then
table.insert(opts.ensure_installed, lang)
end
end

View File

@ -67,7 +67,7 @@ M.plugin = {
return hl
end
end,
priority = 2000,
extmark_opts = { priority = 2000 },
}
end
require("mini.hipatterns").setup(opts)

View File

@ -5,7 +5,9 @@ return {
-- project management
{
"ahmedkhalf/project.nvim",
opts = {},
opts = {
manual_mode = true,
},
event = "VeryLazy",
config = function(_, opts)
require("project_nvim").setup(opts)
@ -54,6 +56,10 @@ return {
icon = "",
key = "p",
}
projects.desc = projects.desc .. string.rep(" ", 43 - #projects.desc)
projects.key_format = " %s"
table.insert(opts.config.center, 3, projects)
end,
},

View File

@ -2,22 +2,15 @@ local Util = require("lazyvim.util")
local M = {}
---@type ConformOpts
local format_opts = {}
---@param opts ConformOpts
function M.setup(_, opts)
local util = require("conform.util")
opts.formatters = opts.formatters or {}
for name, formatter in pairs(opts.formatters) do
for name, formatter in pairs(opts.formatters or {}) do
if type(formatter) == "table" then
local ok, defaults = pcall(require, "conform.formatters." .. name)
if ok and type(defaults) == "table" then
opts.formatters[name] = vim.tbl_deep_extend("force", {}, defaults, formatter)
end
if opts.formatters[name].extra_args then
opts.formatters[name].args =
util.extend_args(opts.formatters[name].args or {}, opts.formatters[name].extra_args)
---@diagnostic disable-next-line: undefined-field
if formatter.extra_args then
---@diagnostic disable-next-line: undefined-field
formatter.prepend_args = formatter.extra_args
Util.deprecate(("opts.formatters.%s.extra_args"):format(name), ("opts.formatters.%s.prepend_args"):format(name))
end
end
end
@ -29,10 +22,10 @@ function M.setup(_, opts)
key
)
)
---@diagnostic disable-next-line: no-unknown
opts[key] = nil
end
end
format_opts = opts.format
require("conform").setup(opts)
end
@ -53,7 +46,6 @@ return {
},
},
init = function()
vim.o.formatexpr = "v:lua.require'conform'.formatexpr()"
-- Install the conform formatter on VeryLazy
require("lazyvim.util").on_very_lazy(function()
require("lazyvim.util").format.register({
@ -61,10 +53,14 @@ return {
priority = 100,
primary = true,
format = function(buf)
require("conform").format(Util.merge(format_opts, { bufnr = buf }))
local plugin = require("lazy.core.config").plugins["conform.nvim"]
local Plugin = require("lazy.core.plugin")
local opts = Plugin.values(plugin, "opts", false)
require("conform").format(Util.merge(opts.format, { bufnr = buf }))
end,
sources = function(buf)
local ret = require("conform").list_formatters(buf)
---@param v conform.FormatterInfo
return vim.tbl_map(function(v)
return v.name
end, ret)
@ -82,19 +78,22 @@ return {
}, { title = "LazyVim" })
end
---@class ConformOpts
return {
local opts = {
-- LazyVim will use these options when formatting with the conform.nvim formatter
format = {
timeout_ms = 1000,
timeout_ms = 3000,
async = false, -- not recommended to change
quiet = false, -- not recommended to change
},
---@type table<string, conform.FormatterUnit[]>
formatters_by_ft = {
lua = { "stylua" },
fish = { "fish_indent" },
sh = { "shfmt" },
},
-- LazyVim will merge the options you set here with builtin formatters.
-- The options you set here will be merged with the builtin formatters.
-- You can also define any custom formatters here.
---@type table<string,table>
---@type table<string, conform.FormatterConfigOverride|fun(bufnr: integer): nil|conform.FormatterConfigOverride>
formatters = {
injected = { options = { ignore_errors = true } },
-- # Example of using dprint only when a dprint.json file is present
@ -106,10 +105,11 @@ return {
--
-- # Example of using shfmt with extra args
-- shfmt = {
-- extra_args = { "-i", "2", "-ci" },
-- prepend_args = { "-i", "2", "-ci" },
-- },
},
}
return opts
end,
config = M.setup,
},

View File

@ -7,6 +7,10 @@ return {
events = { "BufWritePost", "BufReadPost", "InsertLeave" },
linters_by_ft = {
fish = { "fish" },
-- Use the "*" filetype to run linters on all filetypes.
-- ['*'] = { 'global linter' },
-- Use the "_" filetype to run linters on filetypes that don't have other linters configured.
-- ['_'] = { 'fallback linter' },
},
-- LazyVim extension to easily override linter options
-- or add custom linters.
@ -23,6 +27,8 @@ return {
},
},
config = function(_, opts)
local Util = require("lazyvim.util")
local M = {}
local lint = require("lint")
@ -47,14 +53,32 @@ return {
end
function M.lint()
local names = lint.linters_by_ft[vim.bo.filetype] or {}
-- Use nvim-lint's logic first:
-- * checks if linters exist for the full filetype first
-- * otherwise will split filetype by "." and add all those linters
-- * this differs from conform.nvim which only uses the first filetype that has a formatter
local names = lint._resolve_linter_by_ft(vim.bo.filetype)
-- Add fallback linters.
if #names == 0 then
vim.list_extend(names, lint.linters_by_ft["_"] or {})
end
-- Add global linters.
vim.list_extend(names, lint.linters_by_ft["*"] or {})
-- Filter out linters that don't exist or don't match the condition.
local ctx = { filename = vim.api.nvim_buf_get_name(0) }
ctx.dirname = vim.fn.fnamemodify(ctx.filename, ":h")
names = vim.tbl_filter(function(name)
local linter = lint.linters[name]
if not linter then
Util.warn("Linter not found: " .. name, { title = "nvim-lint" })
end
return linter and not (type(linter) == "table" and linter.condition and not linter.condition(ctx))
end, names)
-- Run linters.
if #names > 0 then
lint.try_lint(names)
end

View File

@ -7,6 +7,15 @@ return {
version = false, -- last release is way too old and doesn't work on Windows
build = ":TSUpdate",
event = { "LazyFile", "VeryLazy" },
init = function(plugin)
-- PERF: add nvim-treesitter queries to the rtp and it's custom query predicates early
-- This is needed because a bunch of plugins no longer `require("nvim-treesitter")`, which
-- no longer trigger the **nvim-treeitter** module to be loaded in time.
-- Luckily, the only thins that those plugins need are the custom queries, which we make available
-- during startup.
require("lazy.core.loader").add_to_rtp(plugin)
require("nvim-treesitter.query_predicates")
end,
dependencies = {
{
"nvim-treesitter/nvim-treesitter-textobjects",
@ -109,7 +118,7 @@ return {
"nvim-treesitter/nvim-treesitter-context",
event = "LazyFile",
enabled = true,
opts = { mode = "cursor" },
opts = { mode = "cursor", max_lines = 3 },
keys = {
{
"<leader>ut",
@ -131,7 +140,7 @@ return {
-- Automatically add closing tags for HTML and JSX
{
"windwp/nvim-ts-autotag",
event = "InsertEnter",
event = "LazyFile",
opts = {},
},
}

View File

@ -1,3 +1,5 @@
local Util = require("lazyvim.util")
return {
-- Better `vim.notify()`
{
@ -25,7 +27,6 @@ return {
},
init = function()
-- when noice is not enabled, install notify on VeryLazy
local Util = require("lazyvim.util")
if not Util.has("noice.nvim") then
Util.on_very_lazy(function()
vim.notify = require("notify")
@ -60,6 +61,13 @@ return {
keys = {
{ "<leader>bp", "<Cmd>BufferLineTogglePin<CR>", desc = "Toggle pin" },
{ "<leader>bP", "<Cmd>BufferLineGroupClose ungrouped<CR>", desc = "Delete non-pinned buffers" },
{ "<leader>bo", "<Cmd>BufferLineCloseOthers<CR>", desc = "Delete other buffers" },
{ "<leader>br", "<Cmd>BufferLineCloseRight<CR>", desc = "Delete buffers to the right" },
{ "<leader>bl", "<Cmd>BufferLineCloseLeft<CR>", desc = "Delete buffers to the left" },
{ "<S-h>", "<cmd>BufferLineCyclePrev<cr>", desc = "Prev buffer" },
{ "<S-l>", "<cmd>BufferLineCycleNext<cr>", desc = "Next buffer" },
{ "[b", "<cmd>BufferLineCyclePrev<cr>", desc = "Prev buffer" },
{ "]b", "<cmd>BufferLineCycleNext<cr>", desc = "Next buffer" },
},
opts = {
options = {
@ -118,7 +126,6 @@ return {
lualine_require.require = require
local icons = require("lazyvim.config").icons
local Util = require("lazyvim.util")
vim.o.laststatus = vim.g.lualine_laststatus
@ -131,7 +138,9 @@ return {
sections = {
lualine_a = { "mode" },
lualine_b = { "branch" },
lualine_c = {
Util.lualine.root_dir(),
{
"diagnostics",
symbols = {
@ -142,11 +151,7 @@ return {
},
},
{ "filetype", icon_only = true, separator = "", padding = { left = 1, right = 0 } },
{
function()
return Util.root.pretty_path()
end,
},
{ Util.lualine.pretty_path() },
},
lualine_x = {
-- stylua: ignore
@ -179,6 +184,16 @@ return {
modified = icons.git.modified,
removed = icons.git.removed,
},
source = function()
local gitsigns = vim.b.gitsigns_status_dict
if gitsigns then
return {
added = gitsigns.added,
modified = gitsigns.changed,
removed = gitsigns.removed,
}
end
end,
},
},
lualine_y = {
@ -213,6 +228,7 @@ return {
"dashboard",
"neo-tree",
"Trouble",
"trouble",
"lazy",
"mason",
"notify",
@ -244,11 +260,13 @@ return {
"dashboard",
"neo-tree",
"Trouble",
"trouble",
"lazy",
"mason",
"notify",
"toggleterm",
"lazyterm",
"trouble",
},
callback = function()
vim.b.miniindentscope_disable = true
@ -356,15 +374,15 @@ return {
header = vim.split(logo, "\n"),
-- stylua: ignore
center = {
{ action = "Telescope find_files", desc = " Find file", icon = "", key = "f" },
{ action = "ene | startinsert", desc = " New file", icon = "", key = "n" },
{ action = "Telescope oldfiles", desc = " Recent files", icon = "", key = "r" },
{ action = "Telescope live_grep", desc = " Find text", icon = "", key = "g" },
{ action = "e $MYVIMRC", desc = " Config", icon = "", key = "c" },
{ action = 'lua require("persistence").load()', desc = " Restore Session", icon = "", key = "s" },
{ action = "LazyExtras", desc = " Lazy Extras", icon = "", key = "e" },
{ action = "Lazy", desc = " Lazy", icon = "󰒲 ", key = "l" },
{ action = "qa", desc = " Quit", icon = "", key = "q" },
{ action = "Telescope find_files", desc = " Find file", icon = "", key = "f" },
{ action = "ene | startinsert", desc = " New file", icon = "", key = "n" },
{ action = "Telescope oldfiles", desc = " Recent files", icon = "", key = "r" },
{ action = "Telescope live_grep", desc = " Find text", icon = "", key = "g" },
{ action = [[lua require("lazyvim.util").telescope.config_files()()]], desc = " Config", icon = "", key = "c" },
{ action = 'lua require("persistence").load()', desc = " Restore Session", icon = "", key = "s" },
{ action = "LazyExtras", desc = " Lazy Extras", icon = "", key = "x" },
{ action = "Lazy", desc = " Lazy", icon = "󰒲 ", key = "l" },
{ action = "qa", desc = " Quit", icon = "", key = "q" },
},
footer = function()
local stats = require("lazy").stats()
@ -376,6 +394,7 @@ return {
for _, button in ipairs(opts.config.center) do
button.desc = button.desc .. string.rep(" ", 43 - #button.desc)
button.key_format = " %s"
end
-- close Lazy and re-open when the dashboard is ready

View File

@ -25,6 +25,13 @@ function M.register(formatter)
end)
end
function M.formatexpr()
if Util.has("conform.nvim") then
return require("conform").formatexpr()
end
return vim.lsp.formatexpr({ timeout_ms = 3000 })
end
---@param buf? number
---@return (LazyFormatter|{active:boolean,resolved:string[]})[]
function M.resolve(buf)
@ -67,7 +74,7 @@ function M.info(buf)
end
end
if not have then
lines[#lines+1] = "\n***No formatters available for this buffer.***"
lines[#lines + 1] = "\n***No formatters available for this buffer.***"
end
Util[enabled and "info" or "warn"](
table.concat(lines, "\n"),

View File

@ -49,6 +49,10 @@ setmetatable(M, {
end,
})
function M.is_win()
return vim.loop.os_uname().sysname:find("Windows") ~= nil
end
---@param plugin string
function M.has(plugin)
return require("lazy.core.config").spec.plugins[plugin] ~= nil

View File

@ -43,4 +43,101 @@ function M.cmp_source(name, icon)
}
end
---@param component any
---@param text string
---@param hl_group? string
---@return string
function M.format(component, text, hl_group)
if not hl_group then
return text
end
---@type table<string, string>
component.hl_cache = component.hl_cache or {}
local lualine_hl_group = component.hl_cache[hl_group]
if not lualine_hl_group then
local utils = require("lualine.utils.utils")
lualine_hl_group = component:create_hl({ fg = utils.extract_highlight_colors(hl_group, "fg") }, "LV_" .. hl_group)
component.hl_cache[hl_group] = lualine_hl_group
end
return component:format_hl(lualine_hl_group) .. text .. component:get_default_hl()
end
---@param opts? {relative: "cwd"|"root", modified_hl: string?}
function M.pretty_path(opts)
opts = vim.tbl_extend("force", {
relative = "cwd",
modified_hl = "Constant",
}, opts or {})
return function(self)
local path = vim.fn.expand("%:p") --[[@as string]]
if path == "" then
return ""
end
local root = Util.root.get({ normalize = true })
local cwd = Util.root.cwd()
if opts.relative == "cwd" and path:find(cwd, 1, true) == 1 then
path = path:sub(#cwd + 2)
else
path = path:sub(#root + 2)
end
local sep = package.config:sub(1, 1)
local parts = vim.split(path, "[\\/]")
if #parts > 3 then
parts = { parts[1], "", parts[#parts - 1], parts[#parts] }
end
if opts.modified_hl and vim.bo.modified then
parts[#parts] = M.format(self, parts[#parts], opts.modified_hl)
end
return table.concat(parts, sep)
end
end
---@param opts? {cwd:false, subdirectory: true, parent: true, other: true, icon?:string}
function M.root_dir(opts)
opts = vim.tbl_extend("force", {
cwd = false,
subdirectory = true,
parent = true,
other = true,
icon = "󱉭 ",
color = Util.ui.fg("Special"),
}, opts or {})
local function get()
local cwd = Util.root.cwd()
local root = Util.root.get({ normalize = true })
local name = vim.fs.basename(root)
if root == cwd then
-- root is cwd
return opts.cwd and name
elseif root:find(cwd, 1, true) == 1 then
-- root is subdirectory of cwd
return opts.subdirectory and name
elseif cwd:find(root, 1, true) == 1 then
-- root is parent directory of cwd
return opts.parent and name
else
-- root and cwd are not related
return opts.other and name
end
end
return {
function()
return (opts.icon and opts.icon .. " ") .. get()
end,
cond = function()
return type(get()) == "string"
end,
color = opts.color,
}
end
return M

Some files were not shown because too many files have changed in this diff Show More