Compare commits
68 Commits
Author | SHA1 | Date | |
---|---|---|---|
0e12b00743 | |||
2e308d5440 | |||
5c1656729a | |||
1d4fbd3b2e | |||
b0ded5c015 | |||
c711309a67 | |||
af3ca06472 | |||
4da4583b4a | |||
315df373f2 | |||
42ba1af40f | |||
ff64cc5399 | |||
fef0b3f756 | |||
5926cda069 | |||
3dbeda9d96 | |||
98db7ec0d2 | |||
db175ef3f6 | |||
f513e1cede | |||
9517e64009 | |||
152e1c6692 | |||
982c8e301b | |||
5c4f881158 | |||
8c726cd166 | |||
c3daced11c | |||
66482927cb | |||
be5eea476c | |||
e26a127185 | |||
c8e5501ee5 | |||
dfdfcad1aa | |||
6f88b8b36f | |||
8af7309c7e | |||
782fe0bef0 | |||
57b504b9e8 | |||
53e1637a86 | |||
7c60431c58 | |||
5ea0dd716a | |||
6e0e352fea | |||
f29543f2c9 | |||
95ff5aaa62 | |||
1a4342abae | |||
8f42733ce5 | |||
b3d46bc014 | |||
121df70604 | |||
3a93757bb1 | |||
6b9ee963e2 | |||
5b89bc8cbf | |||
5e1a86d3b2 | |||
f724eae2e3 | |||
ff9bf005b6 | |||
7fe68d9f05 | |||
b6e68fa2bf | |||
3eb91c64b5 | |||
873ff89284 | |||
385c99dbb7 | |||
c7244d9d47 | |||
6fd66f486e | |||
3f1bf70b14 | |||
4584410e76 | |||
ea4174d460 | |||
1b1d9a16ee | |||
66f0d55beb | |||
01dbd07073 | |||
bd1928ba59 | |||
1e79248786 | |||
b31d71da9d | |||
1bcf6b9a28 | |||
c9892652d2 | |||
8e71968c2b | |||
cdae38ddd4 |
.github/workflows
CHANGELOG.mdNEWS.mddoc
lua/lazyvim
config
plugins
editor.luaformatting.lualinting.lua
extras
coding
editor
formatting
lang
test
ui
util
lsp
treesitter.luaui.luaxtras.luautil
2
.github/workflows/ci.yml
vendored
2
.github/workflows/ci.yml
vendored
@ -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
|
||||
|
126
CHANGELOG.md
126
CHANGELOG.md
@ -1,5 +1,119 @@
|
||||
# Changelog
|
||||
|
||||
## [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)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **conform:** make it easier to add `extra_args` ([3eb91c6](https://github.com/LazyVim/LazyVim/commit/3eb91c64b5960ccd84bd8e6a3318a1ee79cb85c5))
|
||||
* **conform:** show error when user overwrites conform config function ([b6e68fa](https://github.com/LazyVim/LazyVim/commit/b6e68fa2bf829753be86ba8cc56baafd47b7da67))
|
||||
* **conform:** use conform.nvim `opts.format` options for formatting with conform ([6fd66f4](https://github.com/LazyVim/LazyVim/commit/6fd66f486e210e35b4c375691fbfd61a611b6027))
|
||||
* **extras:** added TabNine ([#1651](https://github.com/LazyVim/LazyVim/issues/1651)) ([95ff5aa](https://github.com/LazyVim/LazyVim/commit/95ff5aaa6245244d45609916b0a623c5e8c79d16))
|
||||
* **format:** use conform as lsp formatter since it has better format diffs ([4584410](https://github.com/LazyVim/LazyVim/commit/4584410e76bf8a6ba426270bef8eca5a100d4cce))
|
||||
* **go:** add gofumpt formatter with conform/none-ls ([#1683](https://github.com/LazyVim/LazyVim/issues/1683)) ([385c99d](https://github.com/LazyVim/LazyVim/commit/385c99dbb7ccdcf53276086892cceee65b85fa21))
|
||||
* **lang:** add markdown support ([#1718](https://github.com/LazyVim/LazyVim/issues/1718)) ([b3d46bc](https://github.com/LazyVim/LazyVim/commit/b3d46bc0141c23bfd4302718ff42dfa172c6952b))
|
||||
* **python:** add key binding for organize imports ([#1670](https://github.com/LazyVim/LazyVim/issues/1670)) ([8f42733](https://github.com/LazyVim/LazyVim/commit/8f42733ce526b6c866b26824d78a1822730c2852))
|
||||
* **toggle:** add keymap to toggle treesitter context ([#1711](https://github.com/LazyVim/LazyVim/issues/1711)) ([5e1a86d](https://github.com/LazyVim/LazyVim/commit/5e1a86d3b257db37c8b443deea6ca1fefcb0b1aa))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **dashboard-nvim:** repository has moved to nvimdev/dashboard-nvim ([#1715](https://github.com/LazyVim/LazyVim/issues/1715)) ([ff9bf00](https://github.com/LazyVim/LazyVim/commit/ff9bf005b6957bb46a5541188925f32a1d86365d))
|
||||
* dont lazy-load on ft. Load on cmd or keys only ([3a93757](https://github.com/LazyVim/LazyVim/commit/3a93757bb1ee28c3e1b59c6c47ea5c4e74d8f1b2))
|
||||
* **keymaps:** no diagnostic keymaps w/o lsp attached ([#1698](https://github.com/LazyVim/LazyVim/issues/1698)) ([873ff89](https://github.com/LazyVim/LazyVim/commit/873ff892843898033be0b59cee8130c6b1b29d85))
|
||||
* **lsp:** trigger FileType commands after installing LSP servers ([5b89bc8](https://github.com/LazyVim/LazyVim/commit/5b89bc8cbf990edec201d07c146a3fe28db3302f))
|
||||
* **news:** dont show news when it has never been viewed (new install) ([6b9ee96](https://github.com/LazyVim/LazyVim/commit/6b9ee963e2684e7b37120b86bab5049918e14899))
|
||||
* **spectre:** add title to Spectre panel in edgy ([#1703](https://github.com/LazyVim/LazyVim/issues/1703)) ([7fe68d9](https://github.com/LazyVim/LazyVim/commit/7fe68d9f055fd34d95f19a8711e281ab40629482))
|
||||
|
||||
## [10.1.1](https://github.com/LazyVim/LazyVim/compare/v10.1.0...v10.1.1) (2023-10-13)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **aerial:** use new sep_icon option for aerial lualine component ([bd1928b](https://github.com/LazyVim/LazyVim/commit/bd1928ba597d777ca79f9f2f4b14217de4c291bc))
|
||||
* **json:** always write version to prevent spurious migrations. Fixes [#1692](https://github.com/LazyVim/LazyVim/issues/1692) ([01dbd07](https://github.com/LazyVim/LazyVim/commit/01dbd070738a9448ffbdc63602ed9eb5421158da))
|
||||
|
||||
## [10.1.0](https://github.com/LazyVim/LazyVim/compare/v10.0.1...v10.1.0) (2023-10-12)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **config:** `lazyvim.json` is now versioned and migrates to a newer version when needed ([c989265](https://github.com/LazyVim/LazyVim/commit/c9892652d271663f52edd7b0d88d2565d8f65a52))
|
||||
* **extras:** LazyExtras can now manage user extras `lua/plugins/extras`. Fixes [#1681](https://github.com/LazyVim/LazyVim/issues/1681) ([1bcf6b9](https://github.com/LazyVim/LazyVim/commit/1bcf6b9a282bc839d4fde92a94b800185ad58118))
|
||||
* **neot-ree:** add keymaps to toggle git & buffer ([#1339](https://github.com/LazyVim/LazyVim/issues/1339)) ([b31d71d](https://github.com/LazyVim/LazyVim/commit/b31d71da9d6ca6c290a8ee7e7cc7ad5ccb3cc0bd))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **nvim-lint:** check on linter name instead of linter. Fixes [#1685](https://github.com/LazyVim/LazyVim/issues/1685) ([cdae38d](https://github.com/LazyVim/LazyVim/commit/cdae38ddd44edbf5e124129fc94e9d1038592760))
|
||||
* **nvim-lint:** make sure to set custom linters. Fixes [#1687](https://github.com/LazyVim/LazyVim/issues/1687) ([8e71968](https://github.com/LazyVim/LazyVim/commit/8e71968c2bd9e59e535cdac0a99e667f8f120322))
|
||||
|
||||
## [10.0.1](https://github.com/LazyVim/LazyVim/compare/v10.0.0...v10.0.1) (2023-10-12)
|
||||
|
||||
|
||||
@ -244,7 +358,7 @@
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **dasboard:** disable alpha only once ([d6b56c0](https://github.com/LazyVim/LazyVim/commit/d6b56c075e88ce12e9e16fb2eeeea38fb7853600))
|
||||
* **dashboard:** disable alpha only once ([d6b56c0](https://github.com/LazyVim/LazyVim/commit/d6b56c075e88ce12e9e16fb2eeeea38fb7853600))
|
||||
* **options:** set default laststatus=3 and set it to 0 before loading dashboard to prevent flickering ([1eb0192](https://github.com/LazyVim/LazyVim/commit/1eb019274b5564e66ac6c7e119c140bae262e10c))
|
||||
* **tailwind:** allow overriding filetypes. Fixes [#1590](https://github.com/LazyVim/LazyVim/issues/1590) ([d3e7f77](https://github.com/LazyVim/LazyVim/commit/d3e7f7717e960bb883b35e9a75badfd5b938cace))
|
||||
|
||||
@ -285,7 +399,7 @@
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **autocmds:** retore last location for correct buffer ([afc8e7f](https://github.com/LazyVim/LazyVim/commit/afc8e7f8cac06335efd12ec5f71cabb1f38a09b0))
|
||||
* **autocmds:** restore last location for correct buffer ([afc8e7f](https://github.com/LazyVim/LazyVim/commit/afc8e7f8cac06335efd12ec5f71cabb1f38a09b0))
|
||||
* **conform:** dont try merging function formatters. Fixes [#1582](https://github.com/LazyVim/LazyVim/issues/1582) ([f475085](https://github.com/LazyVim/LazyVim/commit/f4750859f2c2c9a41b3974ac05962ce9648d6c16))
|
||||
* **conform:** dont try to merge formatter functions ([9f034ab](https://github.com/LazyVim/LazyVim/commit/9f034ab10650e306e178d5189ee9214a52f2e8e5))
|
||||
* **nvim-lint:** dont try merging function linters ([79010ae](https://github.com/LazyVim/LazyVim/commit/79010ae671035d8ed0040ce51df4fb59ec3962f8))
|
||||
@ -1008,7 +1122,7 @@
|
||||
|
||||
* **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))
|
||||
* **neotest:** support neotest adapters 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)
|
||||
|
||||
@ -1615,7 +1729,7 @@
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **illuminate:** always set refernce keymaps on the buffer as well to properly overwrite ftplugin mappings. Fixes [#292](https://github.com/LazyVim/LazyVim/issues/292) ([a0cf00c](https://github.com/LazyVim/LazyVim/commit/a0cf00c81b3a4a352cdc26c94112d9a5827881e1))
|
||||
* **illuminate:** always set reference keymaps on the buffer as well to properly overwrite ftplugin mappings. Fixes [#292](https://github.com/LazyVim/LazyVim/issues/292) ([a0cf00c](https://github.com/LazyVim/LazyVim/commit/a0cf00c81b3a4a352cdc26c94112d9a5827881e1))
|
||||
* **mini.surround:** don't create empty keymaps. Fixes [#296](https://github.com/LazyVim/LazyVim/issues/296) ([8e84dcf](https://github.com/LazyVim/LazyVim/commit/8e84dcf85c8a73ebcf6ade6b7b77544f468f1dfa))
|
||||
* **treesitter:** disable indent only for python right now ([de6a28b](https://github.com/LazyVim/LazyVim/commit/de6a28b781e8a06e4f70c913539c97260392131a))
|
||||
* **treesitter:** disable treesitter indent by default, since it has too many issues. See [#297](https://github.com/LazyVim/LazyVim/issues/297) ([329a2da](https://github.com/LazyVim/LazyVim/commit/329a2daff493abd2bd5c8fedbf0dfa13039d3931))
|
||||
@ -1759,7 +1873,7 @@
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **mini.ai:** load ai on VeryLazy. Keymaps interfer with which-key. [#155](https://github.com/LazyVim/LazyVim/issues/155) ([3b5f363](https://github.com/LazyVim/LazyVim/commit/3b5f36307438ad05beae6796ca005f6b56d6a360))
|
||||
* **mini.ai:** load ai on VeryLazy. Keymaps interfere with which-key. [#155](https://github.com/LazyVim/LazyVim/issues/155) ([3b5f363](https://github.com/LazyVim/LazyVim/commit/3b5f36307438ad05beae6796ca005f6b56d6a360))
|
||||
* **noice:** scroll doc window in normal, insert and select mode ([c5b22c0](https://github.com/LazyVim/LazyVim/commit/c5b22c0832603198f571ff68b6fb9d0c17f73d33))
|
||||
* **nvim-navic:** use kinds icons for navic. Fixes [#164](https://github.com/LazyVim/LazyVim/issues/164) ([b81ecf9](https://github.com/LazyVim/LazyVim/commit/b81ecf9f7ac78e3f87a4d9b305fa0d3cfd6decf2))
|
||||
|
||||
@ -1934,7 +2048,7 @@
|
||||
* **lsp:** allow overriding options for vim.lsp.buf.format. Fixes [#51](https://github.com/LazyVim/LazyVim/issues/51) ([40d363c](https://github.com/LazyVim/LazyVim/commit/40d363cf3f468a1cc4ea482eaabbd5c7e224f397))
|
||||
* **lsp:** make diagnostics configurable with `{"neovim/nvim-lspconfig", opts = {diagnostics = {}}}`. Fixes [#55](https://github.com/LazyVim/LazyVim/issues/55) ([1efc925](https://github.com/LazyVim/LazyVim/commit/1efc925d16b57659cbb9af5a1579cb1b9ee9643f))
|
||||
* **neo-tree:** added `<leader>e` and `<leader>E` to toggle neo-tree ([542920f](https://github.com/LazyVim/LazyVim/commit/542920fb8249d45d1e9ddbf6517a8f8539769eda))
|
||||
* **neo-tree:** load neo-tree when specifying a direcory on the cmdline ([81d798f](https://github.com/LazyVim/LazyVim/commit/81d798fdaa5bf49737969e0f15af4a90621a0a61))
|
||||
* **neo-tree:** load neo-tree when specifying a directory on the cmdline ([81d798f](https://github.com/LazyVim/LazyVim/commit/81d798fdaa5bf49737969e0f15af4a90621a0a61))
|
||||
* **notify:** delay notifs till replaced or at most 500ms to prevent more prompts ([701337f](https://github.com/LazyVim/LazyVim/commit/701337fac8cb1de0f3e31400cef30b053762320f))
|
||||
* **notify:** lazy-load nvim-notify to show proper notifs before Noice loads ([7406313](https://github.com/LazyVim/LazyVim/commit/74063135d838b0ed9fe1a8d0e777c8cfe83ae28f))
|
||||
* **util:** use lazy's notify instead of `vim.notify` ([48d1e8d](https://github.com/LazyVim/LazyVim/commit/48d1e8df12795cf559f704223b63e76259998582))
|
||||
|
3
NEWS.md
3
NEWS.md
@ -2,6 +2,9 @@
|
||||
|
||||
## 10.x
|
||||
|
||||
- User extras under `lua/plugins/extras` can now also be managed
|
||||
with **LazyExtras**
|
||||
|
||||
- `nvim-ts-autotag` is now included by default
|
||||
|
||||
- `nvim-treesitter-context` is now included by default
|
||||
|
@ -1,4 +1,4 @@
|
||||
*LazyVim.txt* For Neovim >= 0.8.0 Last change: 2023 October 12
|
||||
*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2023 October 17
|
||||
|
||||
==============================================================================
|
||||
Table of Contents *LazyVim-table-of-contents*
|
||||
|
@ -3,7 +3,7 @@ local Util = require("lazyvim.util")
|
||||
---@class LazyVimConfig: LazyVimOptions
|
||||
local M = {}
|
||||
|
||||
M.version = "10.0.1" -- x-release-please-version
|
||||
M.version = "10.4.3" -- x-release-please-version
|
||||
|
||||
---@class LazyVimOptions
|
||||
local defaults = {
|
||||
@ -84,6 +84,7 @@ local defaults = {
|
||||
Snippet = " ",
|
||||
String = " ",
|
||||
Struct = " ",
|
||||
TabNine = " ",
|
||||
Text = " ",
|
||||
TypeParameter = " ",
|
||||
Unit = " ",
|
||||
@ -91,7 +92,7 @@ local defaults = {
|
||||
Variable = " ",
|
||||
},
|
||||
},
|
||||
---@type table<string, string[]>?
|
||||
---@type table<string, string[]|boolean>?
|
||||
kind_filter = {
|
||||
default = {
|
||||
"Class",
|
||||
@ -108,6 +109,8 @@ local defaults = {
|
||||
"Struct",
|
||||
"Trait",
|
||||
},
|
||||
markdown = false,
|
||||
help = false,
|
||||
-- you can specify a different filter for each filetype
|
||||
lua = {
|
||||
"Class",
|
||||
@ -128,6 +131,7 @@ local defaults = {
|
||||
}
|
||||
|
||||
M.json = {
|
||||
version = 2,
|
||||
data = {
|
||||
version = nil, ---@type string?
|
||||
news = {}, ---@type table<string, string>
|
||||
@ -144,24 +148,13 @@ function M.json.load()
|
||||
local ok, json = pcall(vim.json.decode, data, { luanil = { object = true, array = true } })
|
||||
if ok then
|
||||
M.json.data = vim.tbl_deep_extend("force", M.json.data, json or {})
|
||||
if M.json.data.hashes then
|
||||
---@diagnostic disable-next-line: no-unknown
|
||||
M.json.data.hashes = nil
|
||||
M.json.save()
|
||||
if M.json.data.version ~= M.json.version then
|
||||
Util.json.migrate()
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function M.json.save()
|
||||
local path = vim.fn.stdpath("config") .. "/lazyvim.json"
|
||||
local f = io.open(path, "w")
|
||||
if f then
|
||||
f:write(Util.json.encode(M.json.data))
|
||||
f:close()
|
||||
end
|
||||
end
|
||||
|
||||
---@type LazyVimOptions
|
||||
local options
|
||||
|
||||
@ -187,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()
|
||||
@ -223,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"
|
||||
|
@ -30,17 +30,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 +50,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,16 +81,30 @@ 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()
|
||||
Util.format({ force = true })
|
||||
end, { desc = "Format" })
|
||||
|
||||
-- diagnostic
|
||||
local diagnostic_goto = function(next, severity)
|
||||
local go = next and vim.diagnostic.goto_next or vim.diagnostic.goto_prev
|
||||
severity = severity and vim.diagnostic.severity[severity] or nil
|
||||
return function()
|
||||
go({ severity = severity })
|
||||
end
|
||||
end
|
||||
map("n", "<leader>cd", vim.diagnostic.open_float, { desc = "Line Diagnostics" })
|
||||
map("n", "]d", diagnostic_goto(true), { desc = "Next Diagnostic" })
|
||||
map("n", "[d", diagnostic_goto(false), { desc = "Prev Diagnostic" })
|
||||
map("n", "]e", diagnostic_goto(true, "ERROR"), { desc = "Next Error" })
|
||||
map("n", "[e", diagnostic_goto(false, "ERROR"), { desc = "Prev Error" })
|
||||
map("n", "]w", diagnostic_goto(true, "WARN"), { desc = "Next Warning" })
|
||||
map("n", "[w", diagnostic_goto(false, "WARN"), { desc = "Prev Warning" })
|
||||
|
||||
-- stylua: ignore start
|
||||
|
||||
-- toggle options
|
||||
@ -113,6 +120,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)" })
|
||||
|
@ -87,5 +87,7 @@ 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
|
||||
|
@ -24,6 +24,20 @@ return {
|
||||
},
|
||||
{ "<leader>e", "<leader>fe", desc = "Explorer NeoTree (root dir)", remap = true },
|
||||
{ "<leader>E", "<leader>fE", desc = "Explorer NeoTree (cwd)", remap = true },
|
||||
{
|
||||
"<leader>ge",
|
||||
function()
|
||||
require("neo-tree.command").execute({ source = "git_status", toggle = true })
|
||||
end,
|
||||
desc = "Git explorer",
|
||||
},
|
||||
{
|
||||
"<leader>be",
|
||||
function()
|
||||
require("neo-tree.command").execute({ source = "buffers", toggle = true })
|
||||
end,
|
||||
desc = "Buffer explorer",
|
||||
},
|
||||
},
|
||||
deactivate = function()
|
||||
vim.cmd([[Neotree close]])
|
||||
@ -119,6 +133,7 @@ return {
|
||||
{ "<leader><space>", Util.telescope("files"), desc = "Find Files (root dir)" },
|
||||
-- find
|
||||
{ "<leader>fb", "<cmd>Telescope buffers<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" },
|
||||
|
@ -27,43 +27,7 @@ return {
|
||||
optional = true,
|
||||
event = "VeryLazy",
|
||||
opts = function(_, opts)
|
||||
local started = false
|
||||
local function status()
|
||||
if not package.loaded["cmp"] then
|
||||
return
|
||||
end
|
||||
for _, s in ipairs(require("cmp").core.sources) do
|
||||
if s.name == "codeium" then
|
||||
if s.source:is_available() then
|
||||
started = true
|
||||
else
|
||||
return started and "error" or nil
|
||||
end
|
||||
if s.status == s.SourceStatus.FETCHING then
|
||||
return "pending"
|
||||
end
|
||||
return "ok"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local Util = require("lazyvim.util")
|
||||
local colors = {
|
||||
ok = Util.ui.fg("Special"),
|
||||
error = Util.ui.fg("DiagnosticError"),
|
||||
pending = Util.ui.fg("DiagnosticWarn"),
|
||||
}
|
||||
table.insert(opts.sections.lualine_x, 2, {
|
||||
function()
|
||||
return require("lazyvim.config").icons.kinds.Codeium
|
||||
end,
|
||||
cond = function()
|
||||
return status() ~= nil
|
||||
end,
|
||||
color = function()
|
||||
return colors[status()] or colors.ok
|
||||
end,
|
||||
})
|
||||
table.insert(opts.sections.lualine_x, 2, require("lazyvim.util").lualine.cmp_source("codeium"))
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
49
lua/lazyvim/plugins/extras/coding/tabnine.lua
Normal file
49
lua/lazyvim/plugins/extras/coding/tabnine.lua
Normal file
@ -0,0 +1,49 @@
|
||||
local Util = require("lazyvim.util")
|
||||
|
||||
return {
|
||||
-- Tabnine cmp source
|
||||
{
|
||||
"nvim-cmp",
|
||||
dependencies = {
|
||||
-- Add TabNine support, make sure you run :CmpTabnineHub after installation.
|
||||
{
|
||||
"tzachar/cmp-tabnine",
|
||||
build = Util.is_win() and "pwsh -noni .\\install.ps1" or "./install.sh",
|
||||
dependencies = "hrsh7th/nvim-cmp",
|
||||
opts = {
|
||||
max_lines = 1000,
|
||||
max_num_results = 3,
|
||||
sort = true,
|
||||
},
|
||||
config = function(_, opts)
|
||||
require("cmp_tabnine.config"):setup(opts)
|
||||
end,
|
||||
},
|
||||
},
|
||||
---@param opts cmp.ConfigSchema
|
||||
opts = function(_, opts)
|
||||
table.insert(opts.sources, 1, {
|
||||
name = "cmp_tabnine",
|
||||
group_index = 1,
|
||||
priority = 100,
|
||||
})
|
||||
|
||||
opts.formatting.format = Util.inject.args(opts.formatting.format, function(entry, item)
|
||||
-- Hide percentage in the menu
|
||||
if entry.source.name == "cmp_tabnine" then
|
||||
item.menu = ""
|
||||
end
|
||||
end)
|
||||
end,
|
||||
},
|
||||
-- Show TabNine status in lualine
|
||||
{
|
||||
"nvim-lualine/lualine.nvim",
|
||||
optional = true,
|
||||
event = "VeryLazy",
|
||||
opts = function(_, opts)
|
||||
local icon = require("lazyvim.config").icons.kinds.TabNine
|
||||
table.insert(opts.sections.lualine_x, 2, require("lazyvim.util").lualine.cmp_source("cmp_tabnine", icon))
|
||||
end,
|
||||
},
|
||||
}
|
@ -2,22 +2,11 @@ local Config = require("lazyvim.config")
|
||||
local Util = require("lazyvim.util")
|
||||
|
||||
return {
|
||||
desc = "Aerial Symbol Browser",
|
||||
{
|
||||
"stevearc/aerial.nvim",
|
||||
event = "LazyFile",
|
||||
opts = function()
|
||||
---@diagnostic disable-next-line: no-unknown
|
||||
local lualine = require("lualine.components.aerial")
|
||||
|
||||
-- Strip trailing spaces from symbols in statusline
|
||||
---@param _ any
|
||||
---@param symbols {icon?:string}[]
|
||||
lualine.format_status = Util.inject.args(lualine.format_status, function(_, symbols)
|
||||
for _, s in ipairs(symbols) do
|
||||
s.icon = s.icon and s.icon:gsub("%s*$", "") or nil
|
||||
end
|
||||
end)
|
||||
|
||||
local icons = vim.deepcopy(Config.icons.kinds)
|
||||
|
||||
-- HACK: fix lua's weird choice for `Package` for control
|
||||
@ -110,8 +99,8 @@ return {
|
||||
opts = function(_, opts)
|
||||
table.insert(opts.sections.lualine_c, {
|
||||
"aerial",
|
||||
-- The separator to be used to separate symbols in status line.
|
||||
sep = " ",
|
||||
sep = " ", -- separator between symbols
|
||||
sep_icon = "", -- separator between icon and symbol
|
||||
|
||||
-- The number of symbols to render top-down. In order to render only 'N' last
|
||||
-- symbols, negative numbers may be supplied. For instance, 'depth = -1' can
|
||||
|
@ -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
|
||||
|
@ -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" },
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -82,15 +82,32 @@ return {
|
||||
},
|
||||
},
|
||||
-- Ensure Go tools are installed
|
||||
{
|
||||
"williamboman/mason.nvim",
|
||||
opts = function(_, opts)
|
||||
opts.ensure_installed = opts.ensure_installed or {}
|
||||
vim.list_extend(opts.ensure_installed, { "goimports", "gofumpt" })
|
||||
end,
|
||||
},
|
||||
{
|
||||
"nvimtools/none-ls.nvim",
|
||||
optional = true,
|
||||
dependencies = {
|
||||
{
|
||||
"williamboman/mason.nvim",
|
||||
opts = function(_, opts)
|
||||
opts.ensure_installed = opts.ensure_installed or {}
|
||||
vim.list_extend(opts.ensure_installed, { "gomodifytags", "impl" })
|
||||
end,
|
||||
},
|
||||
},
|
||||
opts = function(_, opts)
|
||||
local nls = require("null-ls")
|
||||
opts.sources = vim.list_extend(opts.sources or {}, {
|
||||
nls.builtins.code_actions.gomodifytags,
|
||||
nls.builtins.code_actions.impl,
|
||||
nls.builtins.formatting.goimports,
|
||||
nls.builtins.formatting.gofumpt,
|
||||
})
|
||||
end,
|
||||
},
|
||||
@ -99,7 +116,7 @@ return {
|
||||
optional = true,
|
||||
opts = {
|
||||
formatters_by_ft = {
|
||||
go = { "goimports" },
|
||||
go = { "goimports", "gofumpt" },
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -108,10 +125,10 @@ return {
|
||||
optional = true,
|
||||
dependencies = {
|
||||
{
|
||||
"mason.nvim",
|
||||
"williamboman/mason.nvim",
|
||||
opts = function(_, opts)
|
||||
opts.ensure_installed = opts.ensure_installed or {}
|
||||
vim.list_extend(opts.ensure_installed, { "gomodifytags", "impl", "goimports", "delve" })
|
||||
vim.list_extend(opts.ensure_installed, { "delve" })
|
||||
end,
|
||||
},
|
||||
{
|
||||
|
79
lua/lazyvim/plugins/extras/lang/markdown.lua
Normal file
79
lua/lazyvim/plugins/extras/lang/markdown.lua
Normal file
@ -0,0 +1,79 @@
|
||||
return {
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = function(_, opts)
|
||||
if type(opts.ensure_installed) == "table" then
|
||||
vim.list_extend(opts.ensure_installed, { "markdown", "markdown_inline" })
|
||||
end
|
||||
end,
|
||||
},
|
||||
{
|
||||
"williamboman/mason.nvim",
|
||||
opts = function(_, opts)
|
||||
opts.ensure_installed = opts.ensure_installed or {}
|
||||
vim.list_extend(opts.ensure_installed, { "markdownlint", "marksman" })
|
||||
end,
|
||||
},
|
||||
{
|
||||
"nvimtools/none-ls.nvim",
|
||||
optional = true,
|
||||
opts = function(_, opts)
|
||||
local nls = require("null-ls")
|
||||
opts.sources = vim.list_extend(opts.sources or {}, {
|
||||
nls.builtins.diagnostics.markdownlint,
|
||||
})
|
||||
end,
|
||||
},
|
||||
{
|
||||
"mfussenegger/nvim-lint",
|
||||
optional = true,
|
||||
opts = {
|
||||
linters_by_ft = {
|
||||
markdown = { "markdownlint" },
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
opts = {
|
||||
servers = {
|
||||
marksman = {},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
-- Markdown preview
|
||||
{
|
||||
"iamcco/markdown-preview.nvim",
|
||||
cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" },
|
||||
build = function()
|
||||
vim.fn["mkdp#util#install"]()
|
||||
end,
|
||||
keys = {
|
||||
{
|
||||
"<leader>cp",
|
||||
ft = "markdown",
|
||||
"<cmd>MarkdownPreviewToggle<cr>",
|
||||
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
|
||||
table.insert(opts[ft].headline_highlights, "Headline" .. i)
|
||||
end
|
||||
end
|
||||
return opts
|
||||
end,
|
||||
ft = { "markdown", "norg", "rmd", "org" },
|
||||
},
|
||||
}
|
@ -12,7 +12,23 @@ return {
|
||||
opts = {
|
||||
servers = {
|
||||
pyright = {},
|
||||
ruff_lsp = {},
|
||||
ruff_lsp = {
|
||||
keys = {
|
||||
{
|
||||
"<leader>co",
|
||||
function()
|
||||
vim.lsp.buf.code_action({
|
||||
apply = true,
|
||||
context = {
|
||||
only = { "source.organizeImports" },
|
||||
diagnostics = {},
|
||||
},
|
||||
})
|
||||
end,
|
||||
desc = "Organize Imports",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
setup = {
|
||||
ruff_lsp = function()
|
||||
@ -49,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()
|
||||
|
@ -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
|
||||
|
@ -1,6 +1,6 @@
|
||||
return {
|
||||
|
||||
{ "glepnir/dashboard-nvim", enabled = false },
|
||||
{ "nvimdev/dashboard-nvim", enabled = false },
|
||||
{ "echasnovski/mini.starter", enabled = false },
|
||||
-- Dashboard. This runs when neovim starts, and is what displays
|
||||
-- the "LAZYVIM" banner.
|
||||
@ -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>"),
|
||||
}
|
||||
|
@ -49,7 +49,7 @@ return {
|
||||
return vim.bo[buf].buftype == "help"
|
||||
end,
|
||||
},
|
||||
{ ft = "spectre_panel", size = { height = 0.4 } },
|
||||
{ title = "Spectre", ft = "spectre_panel", size = { height = 0.4 } },
|
||||
{ title = "Neotest Output", ft = "neotest-output-panel", size = { height = 15 } },
|
||||
},
|
||||
left = {
|
||||
|
@ -2,7 +2,7 @@
|
||||
return {
|
||||
-- disable alpha
|
||||
{ "goolord/alpha-nvim", enabled = false },
|
||||
{ "glepnir/dashboard-nvim", enabled = false },
|
||||
{ "nvimdev/dashboard-nvim", enabled = false },
|
||||
|
||||
-- enable mini.starter
|
||||
{
|
||||
@ -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),
|
||||
|
@ -11,7 +11,9 @@ return {
|
||||
-- Add Hyprland Parser
|
||||
{
|
||||
"luckasRanarison/tree-sitter-hypr",
|
||||
enabled = have("hypr"),
|
||||
enabled = function()
|
||||
return have("hypr")
|
||||
end,
|
||||
event = "BufRead */hypr/*.conf",
|
||||
build = ":TSUpdate hypr",
|
||||
config = function()
|
||||
@ -35,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
|
||||
|
@ -45,7 +45,7 @@ return {
|
||||
end,
|
||||
},
|
||||
{
|
||||
"glepnir/dashboard-nvim",
|
||||
"nvimdev/dashboard-nvim",
|
||||
optional = true,
|
||||
opts = function(_, opts)
|
||||
local projects = {
|
||||
|
@ -1,3 +1,38 @@
|
||||
local Util = require("lazyvim.util")
|
||||
|
||||
local M = {}
|
||||
|
||||
---@type ConformOpts
|
||||
local conform_opts = {}
|
||||
|
||||
---@param opts ConformOpts
|
||||
function M.setup(_, opts)
|
||||
for name, formatter in pairs(opts.formatters or {}) do
|
||||
if type(formatter) == "table" then
|
||||
---@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
|
||||
|
||||
for _, key in ipairs({ "format_on_save", "format_after_save" }) do
|
||||
if opts[key] then
|
||||
Util.warn(
|
||||
("Don't set `opts.%s` for `conform.nvim`.\n**LazyVim** will use the conform formatter automatically"):format(
|
||||
key
|
||||
)
|
||||
)
|
||||
---@diagnostic disable-next-line: no-unknown
|
||||
opts[key] = nil
|
||||
end
|
||||
end
|
||||
conform_opts = opts
|
||||
require("conform").setup(opts)
|
||||
end
|
||||
|
||||
return {
|
||||
{
|
||||
"stevearc/conform.nvim",
|
||||
@ -15,7 +50,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({
|
||||
@ -23,10 +57,15 @@ return {
|
||||
priority = 100,
|
||||
primary = true,
|
||||
format = function(buf)
|
||||
require("conform").format({ bufnr = buf })
|
||||
require("conform").format(Util.merge({
|
||||
timeout_ms = conform_opts.format.timeout_ms,
|
||||
async = conform_opts.format.async,
|
||||
quiet = conform_opts.format.quiet,
|
||||
}, { 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)
|
||||
@ -34,36 +73,49 @@ return {
|
||||
})
|
||||
end)
|
||||
end,
|
||||
opts = {
|
||||
formatters_by_ft = {
|
||||
lua = { "stylua" },
|
||||
fish = { "fish_indent" },
|
||||
sh = { "shfmt" },
|
||||
},
|
||||
-- LazyVim will merge the options you set here with builtin formatters.
|
||||
-- You can also define any custom formatters here.
|
||||
---@type table<string,table>
|
||||
formatters = {
|
||||
injected = { options = { ignore_errors = true } },
|
||||
-- -- Example of using dprint only when a dprint.json file is present
|
||||
-- dprint = {
|
||||
-- condition = function(ctx)
|
||||
-- return vim.fs.find({ "dprint.json" }, { path = ctx.filename, upward = true })[1]
|
||||
-- end,
|
||||
-- },
|
||||
},
|
||||
},
|
||||
config = function(_, opts)
|
||||
opts.formatters = opts.formatters or {}
|
||||
for name, formatter in pairs(opts.formatters) 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
|
||||
end
|
||||
opts = function()
|
||||
local plugin = require("lazy.core.config").plugins["conform.nvim"]
|
||||
if plugin.config ~= M.setup then
|
||||
Util.error({
|
||||
"Don't set `plugin.config` for `conform.nvim`.\n",
|
||||
"This will break **LazyVim** formatting.\n",
|
||||
"Please refer to the docs at https://www.lazyvim.org/plugins/formatting",
|
||||
}, { title = "LazyVim" })
|
||||
end
|
||||
require("conform").setup(opts)
|
||||
---@class ConformOpts
|
||||
local opts = {
|
||||
-- LazyVim will use these options when formatting with the conform.nvim formatter
|
||||
format = {
|
||||
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" },
|
||||
},
|
||||
-- The options you set here will be merged with the builtin formatters.
|
||||
-- You can also define any custom formatters here.
|
||||
---@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
|
||||
-- dprint = {
|
||||
-- condition = function(ctx)
|
||||
-- return vim.fs.find({ "dprint.json" }, { path = ctx.filename, upward = true })[1]
|
||||
-- end,
|
||||
-- },
|
||||
--
|
||||
-- # Example of using shfmt with extra args
|
||||
-- shfmt = {
|
||||
-- prepend_args = { "-i", "2", "-ci" },
|
||||
-- },
|
||||
},
|
||||
}
|
||||
return opts
|
||||
end,
|
||||
config = M.setup,
|
||||
},
|
||||
}
|
||||
|
@ -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,12 +27,16 @@ return {
|
||||
},
|
||||
},
|
||||
config = function(_, opts)
|
||||
local Util = require("lazyvim.util")
|
||||
|
||||
local M = {}
|
||||
|
||||
local lint = require("lint")
|
||||
for name, linter in pairs(opts.linters) do
|
||||
if type(linter) == "table" and type(lint.linters) == "table" then
|
||||
if type(linter) == "table" and type(lint.linters[name]) == "table" then
|
||||
lint.linters[name] = vim.tbl_deep_extend("force", lint.linters[name], linter)
|
||||
else
|
||||
lint.linters[name] = linter
|
||||
end
|
||||
end
|
||||
lint.linters_by_ft = opts.linters_by_ft
|
||||
@ -45,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
|
||||
|
@ -218,6 +218,15 @@ return {
|
||||
config = function(_, opts)
|
||||
require("mason").setup(opts)
|
||||
local mr = require("mason-registry")
|
||||
mr:on("package:install:success", function()
|
||||
vim.defer_fn(function()
|
||||
-- trigger FileType event to possibly load this newly installed LSP server
|
||||
require("lazy.core.handler.event").trigger({
|
||||
event = "FileType",
|
||||
buf = vim.api.nvim_get_current_buf(),
|
||||
})
|
||||
end, 100)
|
||||
end)
|
||||
local function ensure_installed()
|
||||
for _, tool in ipairs(opts.ensure_installed) do
|
||||
local p = mr.get_package(tool)
|
||||
|
@ -13,7 +13,6 @@ function M.get()
|
||||
end
|
||||
-- stylua: ignore
|
||||
M._keys = {
|
||||
{ "<leader>cd", vim.diagnostic.open_float, desc = "Line Diagnostics" },
|
||||
{ "<leader>cl", "<cmd>LspInfo<cr>", desc = "Lsp Info" },
|
||||
{ "gd", function() require("telescope.builtin").lsp_definitions({ reuse_win = true }) end, desc = "Goto Definition", has = "definition" },
|
||||
{ "gr", "<cmd>Telescope lsp_references<cr>", desc = "References" },
|
||||
@ -23,12 +22,6 @@ function M.get()
|
||||
{ "K", vim.lsp.buf.hover, desc = "Hover" },
|
||||
{ "gK", vim.lsp.buf.signature_help, desc = "Signature Help", has = "signatureHelp" },
|
||||
{ "<c-k>", vim.lsp.buf.signature_help, mode = "i", desc = "Signature Help", has = "signatureHelp" },
|
||||
{ "]d", M.diagnostic_goto(true), desc = "Next Diagnostic" },
|
||||
{ "[d", M.diagnostic_goto(false), desc = "Prev Diagnostic" },
|
||||
{ "]e", M.diagnostic_goto(true, "ERROR"), desc = "Next Error" },
|
||||
{ "[e", M.diagnostic_goto(false, "ERROR"), desc = "Prev Error" },
|
||||
{ "]w", M.diagnostic_goto(true, "WARN"), desc = "Next Warning" },
|
||||
{ "[w", M.diagnostic_goto(false, "WARN"), desc = "Prev Warning" },
|
||||
{ "<leader>ca", vim.lsp.buf.code_action, desc = "Code Action", mode = { "n", "v" }, has = "codeAction" },
|
||||
{
|
||||
"<leader>cA",
|
||||
@ -106,12 +99,4 @@ function M.on_attach(_, buffer)
|
||||
end
|
||||
end
|
||||
|
||||
function M.diagnostic_goto(next, severity)
|
||||
local go = next and vim.diagnostic.goto_next or vim.diagnostic.goto_prev
|
||||
severity = severity and vim.diagnostic.severity[severity] or nil
|
||||
return function()
|
||||
go({ severity = severity })
|
||||
end
|
||||
end
|
||||
|
||||
return M
|
||||
|
@ -110,6 +110,22 @@ return {
|
||||
event = "LazyFile",
|
||||
enabled = true,
|
||||
opts = { mode = "cursor" },
|
||||
keys = {
|
||||
{
|
||||
"<leader>ut",
|
||||
function()
|
||||
local Util = require("lazyvim.util")
|
||||
local tsc = require("treesitter-context")
|
||||
tsc.toggle()
|
||||
if Util.inject.get_upvalue(tsc.toggle, "enabled") then
|
||||
Util.info("Enabled Treesitter Context", { title = "Option" })
|
||||
else
|
||||
Util.warn("Disabled Treesitter Context", { title = "Option" })
|
||||
end
|
||||
end,
|
||||
desc = "Toggle Treesitter Context",
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
-- Automatically add closing tags for HTML and JSX
|
||||
|
@ -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 = {
|
||||
@ -331,7 +346,7 @@ return {
|
||||
end,
|
||||
},
|
||||
{
|
||||
"glepnir/dashboard-nvim",
|
||||
"nvimdev/dashboard-nvim",
|
||||
event = "VimEnter",
|
||||
opts = function()
|
||||
local logo = [[
|
||||
@ -356,15 +371,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()
|
||||
|
@ -2,10 +2,10 @@ local Config = require("lazyvim.config")
|
||||
|
||||
-- Some extras need to be loaded before others
|
||||
local prios = {
|
||||
["editor.aerial"] = 100,
|
||||
["editor.symbols-outline"] = 100,
|
||||
["test.core"] = 1,
|
||||
["dap.core"] = 1,
|
||||
["lazyvim.plugins.extras.editor.aerial"] = 100,
|
||||
["lazyvim.plugins.extras.editor.symbols-outline"] = 100,
|
||||
["lazyvim.plugins.extras.test.core"] = 1,
|
||||
["lazyvim.plugins.extras.dap.core"] = 1,
|
||||
}
|
||||
|
||||
table.sort(Config.json.data.extras, function(a, b)
|
||||
@ -19,5 +19,5 @@ end)
|
||||
|
||||
---@param extra string
|
||||
return vim.tbl_map(function(extra)
|
||||
return { import = "lazyvim.plugins.extras." .. extra }
|
||||
return { import = extra }
|
||||
end, Config.json.data.extras)
|
||||
|
@ -5,8 +5,16 @@ local Plugin = require("lazy.core.plugin")
|
||||
local Text = require("lazy.view.text")
|
||||
local Util = require("lazyvim.util")
|
||||
|
||||
---@class LazyExtraSource
|
||||
---@field name string
|
||||
---@field desc? string
|
||||
---@field module string
|
||||
|
||||
---@class LazyExtra
|
||||
---@field name string
|
||||
---@field source LazyExtraSource
|
||||
---@field module string
|
||||
---@field desc? string
|
||||
---@field enabled boolean
|
||||
---@field managed boolean
|
||||
---@field row? number
|
||||
@ -16,6 +24,12 @@ local Util = require("lazyvim.util")
|
||||
---@class lazyvim.util.extras
|
||||
local M = {}
|
||||
|
||||
---@type LazyExtraSource[]
|
||||
M.sources = {
|
||||
{ name = "LazyVim", desc = "LazyVim extras", module = "lazyvim.plugins.extras" },
|
||||
{ name = "User", desc = "User extras", module = "plugins.extras" },
|
||||
}
|
||||
|
||||
M.ns = vim.api.nvim_create_namespace("lazyvim.extras")
|
||||
---@type string[]
|
||||
M.state = nil
|
||||
@ -23,42 +37,52 @@ M.state = nil
|
||||
---@return LazyExtra[]
|
||||
function M.get()
|
||||
M.state = M.state or LazyConfig.spec.modules
|
||||
local root = LazyConfig.plugins.LazyVim.dir .. "/lua/lazyvim/plugins/extras"
|
||||
local extras = {} ---@type string[]
|
||||
|
||||
Util.walk(root, function(path, name, type)
|
||||
if type == "file" and name:match("%.lua$") then
|
||||
local extra = path:sub(#root + 2, -5):gsub("/", ".")
|
||||
extras[#extras + 1] = extra
|
||||
local extras = {} ---@type LazyExtra[]
|
||||
for _, source in ipairs(M.sources) do
|
||||
local root = Util.find_root(source.module)
|
||||
if root then
|
||||
Util.walk(root, function(path, name, type)
|
||||
if type == "file" and name:match("%.lua$") then
|
||||
name = path:sub(#root + 2, -5):gsub("/", ".")
|
||||
extras[#extras + 1] = M.get_extra(source, source.module .. "." .. name)
|
||||
end
|
||||
end)
|
||||
end
|
||||
end
|
||||
table.sort(extras, function(a, b)
|
||||
return a.name < b.name
|
||||
end)
|
||||
table.sort(extras)
|
||||
return extras
|
||||
end
|
||||
|
||||
---@param extra string
|
||||
return vim.tbl_map(function(extra)
|
||||
local modname = "lazyvim.plugins.extras." .. extra
|
||||
local enabled = vim.tbl_contains(M.state, modname)
|
||||
local spec = Plugin.Spec.new({ import = "lazyvim.plugins.extras." .. extra }, { optional = true })
|
||||
local plugins = {} ---@type string[]
|
||||
local optional = {} ---@type string[]
|
||||
for _, p in pairs(spec.plugins) do
|
||||
if p.optional then
|
||||
optional[#optional + 1] = p.name
|
||||
else
|
||||
plugins[#plugins + 1] = p.name
|
||||
end
|
||||
---@param modname string
|
||||
---@param source LazyExtraSource
|
||||
function M.get_extra(source, modname)
|
||||
local enabled = vim.tbl_contains(M.state, modname)
|
||||
local spec = Plugin.Spec.new({ import = modname }, { optional = true })
|
||||
local plugins = {} ---@type string[]
|
||||
local optional = {} ---@type string[]
|
||||
for _, p in pairs(spec.plugins) do
|
||||
if p.optional then
|
||||
optional[#optional + 1] = p.name
|
||||
else
|
||||
plugins[#plugins + 1] = p.name
|
||||
end
|
||||
table.sort(plugins)
|
||||
table.sort(optional)
|
||||
end
|
||||
table.sort(plugins)
|
||||
table.sort(optional)
|
||||
|
||||
return {
|
||||
name = extra,
|
||||
enabled = enabled,
|
||||
managed = vim.tbl_contains(Config.json.data.extras, extra) or not enabled,
|
||||
plugins = plugins,
|
||||
optional = optional,
|
||||
}
|
||||
end, extras)
|
||||
---@type LazyExtra
|
||||
return {
|
||||
source = source,
|
||||
name = modname:sub(#source.module + 2),
|
||||
module = modname,
|
||||
enabled = enabled,
|
||||
desc = require(modname).desc,
|
||||
managed = vim.tbl_contains(Config.json.data.extras, modname) or not enabled,
|
||||
plugins = plugins,
|
||||
optional = optional,
|
||||
}
|
||||
end
|
||||
|
||||
---@class LazyExtraView
|
||||
@ -100,17 +124,17 @@ function X:toggle()
|
||||
end
|
||||
extra.enabled = not extra.enabled
|
||||
Config.json.data.extras = vim.tbl_filter(function(name)
|
||||
return name ~= extra.name
|
||||
return name ~= extra.module
|
||||
end, Config.json.data.extras)
|
||||
M.state = vim.tbl_filter(function(name)
|
||||
return name ~= "lazyvim.plugins.extras." .. extra.name
|
||||
return name ~= extra.module
|
||||
end, M.state)
|
||||
if extra.enabled then
|
||||
table.insert(Config.json.data.extras, extra.name)
|
||||
M.state[#M.state + 1] = "lazyvim.plugins.extras." .. extra.name
|
||||
table.insert(Config.json.data.extras, extra.module)
|
||||
M.state[#M.state + 1] = extra.module
|
||||
end
|
||||
table.sort(Config.json.data.extras)
|
||||
Config.json.save()
|
||||
Util.json.save()
|
||||
Util.info(
|
||||
"`"
|
||||
.. extra.name
|
||||
@ -180,12 +204,18 @@ function X:extra(extra)
|
||||
self.text:append(" " .. LazyConfig.options.ui.icons.not_loaded .. " ", hl)
|
||||
end
|
||||
self.text:append(extra.name)
|
||||
if extra.source.name ~= "LazyVim" then
|
||||
self.text:append(" "):append(LazyConfig.options.ui.icons.event .. " " .. extra.source.name, "LazyReasonEvent")
|
||||
end
|
||||
for _, plugin in ipairs(extra.plugins) do
|
||||
self.text:append(" "):append(LazyConfig.options.ui.icons.plugin .. "" .. plugin, "LazyReasonPlugin")
|
||||
end
|
||||
for _, plugin in ipairs(extra.optional) do
|
||||
self.text:append(" "):append(LazyConfig.options.ui.icons.plugin .. "" .. plugin, "LazyReasonRequire")
|
||||
end
|
||||
if extra.desc then
|
||||
self.text:nl():append(" " .. extra.desc, "LazyComment")
|
||||
end
|
||||
self.text:nl()
|
||||
end
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user