Compare commits
43 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 9f04e1e20d | |||
| edff9b1a25 | |||
| 38d2c8aab0 | |||
| 50a358bc1e | |||
| b1d456cda7 | |||
| b9f3cada8a | |||
| 777be2fabd | |||
| 5c5e7c65c7 | |||
| 5b51df3f39 | |||
| 204be37843 | |||
| f98c4a26b3 | |||
| 94de32c598 | |||
| 118ca3309d | |||
| 8597c2085f | |||
| c38c3bf407 | |||
| f535fb6891 | |||
| cb6832d8ad | |||
| c555e17e48 | |||
| 20d36ccd84 | |||
| 13366c6488 | |||
| d6bc320f20 | |||
| 7bbd48caa0 | |||
| 761171a872 | |||
| 092b1fd802 | |||
| d2d5d9f53c | |||
| 38b530d33d | |||
| 739409cd4b | |||
| 058089d0d6 | |||
| 03c5aa71f3 | |||
| 0f0a81c175 | |||
| 286a6fb8ae | |||
| b72a5c2dfa | |||
| 704e85183b | |||
| b5495eb38a | |||
| 27ceb433a9 | |||
| 171a843edf | |||
| 5538ab2d64 | |||
| 65874d161a | |||
| 90a8200e7c | |||
| 1599edd10a | |||
| eac18246d4 | |||
| aa0e4f52e4 | |||
| b304db9236 |
+6
-127
@@ -1,126 +1,5 @@
|
||||
# Changelog
|
||||
|
||||
## [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)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **config:** make lazyvim.json idempotent, pretty-printed and remove full paths ([2a0b7a8](https://github.com/LazyVim/LazyVim/commit/2a0b7a88ba4b4562361dd5abb4a071547d004e59))
|
||||
* **toggle:** dont show incorrect deprecation warning for toggle. Fixes [#1679](https://github.com/LazyVim/LazyVim/issues/1679) ([7c7b4be](https://github.com/LazyVim/LazyVim/commit/7c7b4be8dbec5c5e888d02ebdaae944fecf99407))
|
||||
|
||||
## [10.0.0](https://github.com/LazyVim/LazyVim/compare/v9.9.1...v10.0.0) (2023-10-12)
|
||||
|
||||
|
||||
### ⚠ BREAKING CHANGES
|
||||
|
||||
* **starter:** `dashboard.nvim` is now the default starter. To keep using `alpha.nvim`, enable the extra.
|
||||
* make `conform.nvim` and `nvim-lint` the default formatters/linters
|
||||
|
||||
### Features
|
||||
|
||||
* added aerial extra with integrations for edgy, telescope and lualine ([b43c57d](https://github.com/LazyVim/LazyVim/commit/b43c57d943b2a13460d45f01a288e98cb54f2c1f))
|
||||
* added NEWS.md and option to automatically show when changed (enabled by default) ([73acab1](https://github.com/LazyVim/LazyVim/commit/73acab16758d37982bd6b2d9b2be37c4ee83cde3))
|
||||
* **config:** better kind filter default for lua to deal with luals weirdness ([f64039f](https://github.com/LazyVim/LazyVim/commit/f64039f54620fe3fc9e8f464e35b184c6834ed6e))
|
||||
* **config:** load/save some data in lazyvim.json ([11d66e7](https://github.com/LazyVim/LazyVim/commit/11d66e713467410add9ad5a7a68a3bca0aa24082))
|
||||
* **config:** make kind filter configurable for telescope/aerial/... ([eb7a7d7](https://github.com/LazyVim/LazyVim/commit/eb7a7d7a8e586d30ed6839f4a621e0f019d32410))
|
||||
* **config:** use lazy's new custom events (`Event.mappings`) for a better `LazyFile` ([4ea1c68](https://github.com/LazyVim/LazyVim/commit/4ea1c6865e6d877207de8626e11a5a863950ae55))
|
||||
* **dashboard:** added LazyExtras shortcut to dashboard/alpha ([5bb7420](https://github.com/LazyVim/LazyVim/commit/5bb74205a06a89f048902ba142473dd679b228b8))
|
||||
* **extras:** added extra for `symbols-outline.nvim` ([b4ba5d8](https://github.com/LazyVim/LazyVim/commit/b4ba5d881dcb801d3c502665f9767d2f75ca1110))
|
||||
* **format:** new LazyVim formatter with integrations for lsp/none-ls/conform/eslint/... ([f1a8f24](https://github.com/LazyVim/LazyVim/commit/f1a8f24a361d0de198f6b1458168652a6835c932))
|
||||
* **inject:** util method to get upvalue ([14f3f03](https://github.com/LazyVim/LazyVim/commit/14f3f036e9223315f310ba9d35182690638e7bd7))
|
||||
* make `conform.nvim` and `nvim-lint` the default formatters/linters ([14c091b](https://github.com/LazyVim/LazyVim/commit/14c091b1fc6b0dc0b22ac49ccac69f8a02e3844c))
|
||||
* **mini.starter:** adding mini.starter to lualine disabled files ([#1667](https://github.com/LazyVim/LazyVim/issues/1667)) ([1c34af7](https://github.com/LazyVim/LazyVim/commit/1c34af7f0138323d9f465437d0bcef621a8dbe94))
|
||||
* **navic:** moved navic to extras ([305e82f](https://github.com/LazyVim/LazyVim/commit/305e82f2cacd5d0074027ea545a87a41379afc88))
|
||||
* **root:** allow custom functions as part of `vim.g.root_spec` ([c33e748](https://github.com/LazyVim/LazyVim/commit/c33e7489ecdaef7295a63079410f2f24a1cbc9b6))
|
||||
* **root:** cached pretty path function for statuslines ([8d7361c](https://github.com/LazyVim/LazyVim/commit/8d7361c4602993a7ea119cb7ce78d421b6787dfb))
|
||||
* **root:** customizable root detection and `:LazyRoot` command ([a2d6049](https://github.com/LazyVim/LazyVim/commit/a2d604928b5629d14797437a26022065f7385216))
|
||||
* **starter:** `dashboard.nvim` is now the default starter. To keep using `alpha.nvim`, enable the extra. ([4cbe42c](https://github.com/LazyVim/LazyVim/commit/4cbe42cd247c72dfc70c3fcddfa3fb6b5e6485e0))
|
||||
* **starter:** added Lazy Extras to `mini.starter` ([ce74e28](https://github.com/LazyVim/LazyVim/commit/ce74e28464daa7d694f9ab4e41fae3174e30c8b3))
|
||||
* **treesitter:** add nvim-treesitter-context by default ([7b2c317](https://github.com/LazyVim/LazyVim/commit/7b2c31740782fb0754ce715be6ea128083e48c4f))
|
||||
* **treesitter:** install nvim-ts-autotag by default ([cb7f5ac](https://github.com/LazyVim/LazyVim/commit/cb7f5aca7a04cf2d1d06397e9a80fe078d17976b))
|
||||
* **ui:** added `:LazyExtras` to manage enabled extras in LazyVim ([c4e55e4](https://github.com/LazyVim/LazyVim/commit/c4e55e4d67a7195b7aa9160cd8ece3ddc2f6cb51))
|
||||
* **ui:** show optional plugins in a different color ([eedb4a3](https://github.com/LazyVim/LazyVim/commit/eedb4a34050443448d0b752e22803d5b1278b419))
|
||||
* **util:** inject module ([e239235](https://github.com/LazyVim/LazyVim/commit/e239235cd34ac9c286eac1e620670784566ef673))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **aerial:** keymap ([c772027](https://github.com/LazyVim/LazyVim/commit/c7720275c3fa8b19c9ad7e05bfb6ed5c510bf2bb))
|
||||
* **dap:** copy config before overriding args ([72f3cc6](https://github.com/LazyVim/LazyVim/commit/72f3cc684bd1e8f19b2d3c56da3f359032b8c5dc))
|
||||
* **extras:** make sure we use priorities to import extras in correct order ([a4e3931](https://github.com/LazyVim/LazyVim/commit/a4e393154f61b95da5835b6461e211eb94740268))
|
||||
* **format:** always show formatter status even when no sources available ([a4abbdc](https://github.com/LazyVim/LazyVim/commit/a4abbdc89bd1d49378ac5873db1279e7e5398927))
|
||||
* **lualine:** when opening nvim with a file, show an empty statusline till lualine loads ([8373467](https://github.com/LazyVim/LazyVim/commit/83734675b0f93fbd11a350ee0662c09995836b59))
|
||||
* **neo-tree:** during init check global argslist instead of window-local ([8fbde2c](https://github.com/LazyVim/LazyVim/commit/8fbde2c3668960ed085f9225bb4650aca77cc495))
|
||||
* **nlua:** make nlua dap work with regular continue. Fixes [#1666](https://github.com/LazyVim/LazyVim/issues/1666) ([85215f3](https://github.com/LazyVim/LazyVim/commit/85215f396b6fd4de24636a202ec1149dafa5f7b5))
|
||||
* **notify:** set default zindex=100 ([7fb7948](https://github.com/LazyVim/LazyVim/commit/7fb79486ed1b251b98b95a44ef50b3742edd708d))
|
||||
* **plugin:** add nvim-treesitter-context rename warning ([db5d28b](https://github.com/LazyVim/LazyVim/commit/db5d28b039f656ccb47d3b9f787e8bb482cc6ec1))
|
||||
* **plugin:** enable lazy_file ([f59cdff](https://github.com/LazyVim/LazyVim/commit/f59cdff4d9f04ff349cefdee0b363d573954ce0d))
|
||||
* **plugin:** show warning of removed core plugin when trying to load them without having the extra ([3256abd](https://github.com/LazyVim/LazyVim/commit/3256abda65ae03358ecdbef1c7789782440fe39e))
|
||||
* **root:** only use workspace folders that contain the buffer ([592f3b0](https://github.com/LazyVim/LazyVim/commit/592f3b03bb3cd01df42ee5db4cd6ba43937f067e))
|
||||
* **ui:** dont show left signs on virtual line numbers (wrap). Fixes [#1654](https://github.com/LazyVim/LazyVim/issues/1654) ([e6d294d](https://github.com/LazyVim/LazyVim/commit/e6d294df6fbd973644d4b7f9691d5f48cc5efdde))
|
||||
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* **lualine:** get rid of lualine's weird lualine_require ([13dbe4a](https://github.com/LazyVim/LazyVim/commit/13dbe4ad55a4e4b9a3dd345521b359411cdc5879))
|
||||
* **plugin:** move all lazy.nvim related code to `lazyvim.util.plugin` ([70f9195](https://github.com/LazyVim/LazyVim/commit/70f91956e7f03e740b51cbc14c87df6a6f74538f))
|
||||
* **util:** split lazyvim.util in smaller separate modules ([c8c929c](https://github.com/LazyVim/LazyVim/commit/c8c929c9fdc44cc69cb034c47bd89d2bc4e4a429))
|
||||
|
||||
## [9.9.1](https://github.com/LazyVim/LazyVim/compare/v9.9.0...v9.9.1) (2023-10-11)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **config:** disable LazyFile till v10.0 ([ee7a401](https://github.com/LazyVim/LazyVim/commit/ee7a401388f2933729afcd7090fb8e69631b912f))
|
||||
|
||||
## [9.9.0](https://github.com/LazyVim/LazyVim/compare/v9.8.0...v9.9.0) (2023-10-10)
|
||||
|
||||
|
||||
@@ -292,7 +171,7 @@
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **dashboard:** disable alpha only once ([d6b56c0](https://github.com/LazyVim/LazyVim/commit/d6b56c075e88ce12e9e16fb2eeeea38fb7853600))
|
||||
* **dasboard:** 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))
|
||||
|
||||
@@ -333,7 +212,7 @@
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **autocmds:** restore last location for correct buffer ([afc8e7f](https://github.com/LazyVim/LazyVim/commit/afc8e7f8cac06335efd12ec5f71cabb1f38a09b0))
|
||||
* **autocmds:** retore 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))
|
||||
@@ -1056,7 +935,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 adapters that use `setup()` for custom setup ([2a3bac7](https://github.com/LazyVim/LazyVim/commit/2a3bac769045abac76395fcabb36b17b68bc42fc))
|
||||
* **neotest:** support neotest adapaters that use `setup()` for custom setup ([2a3bac7](https://github.com/LazyVim/LazyVim/commit/2a3bac769045abac76395fcabb36b17b68bc42fc))
|
||||
|
||||
## [4.2.0](https://github.com/LazyVim/LazyVim/compare/v4.1.1...v4.2.0) (2023-05-26)
|
||||
|
||||
@@ -1663,7 +1542,7 @@
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **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))
|
||||
* **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))
|
||||
* **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))
|
||||
@@ -1807,7 +1686,7 @@
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **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))
|
||||
* **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))
|
||||
* **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))
|
||||
|
||||
@@ -1982,7 +1861,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 directory on the cmdline ([81d798f](https://github.com/LazyVim/LazyVim/commit/81d798fdaa5bf49737969e0f15af4a90621a0a61))
|
||||
* **neo-tree:** load neo-tree when specifying a direcory 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))
|
||||
|
||||
@@ -1,68 +0,0 @@
|
||||
# What's new?
|
||||
|
||||
## 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
|
||||
|
||||
- Added extra for `symbols-outline.nvim`
|
||||
|
||||
- Added extra for `aerial.nvim`
|
||||
|
||||
- `nvim-navic` has been removed. If you want to keep using `nvim-navic`,
|
||||
you can enable the **editor.navic** extra
|
||||
|
||||
- New `:LazyExtras` command for managing **LazyVim** extras
|
||||
|
||||
- Improved **formatting**:
|
||||
|
||||
- **LazyVim** can now work with multiple formatters. Types:
|
||||
|
||||
- **primary**: only one primary formatter can be active at a time.
|
||||
_(conform, none-ls, LSP)_
|
||||
- **secondary**: multiple secondary formatters can be active _(eslint, ...)_
|
||||
|
||||
- **LazyVim** automatically selects the primary formatter based on the
|
||||
current available sources and priorities.
|
||||
|
||||
- New `:LazyFormat` command for formatting the current selection or buffer
|
||||
- New `:LazyFormatInfo` command for displaying the active formatters
|
||||
for the current buffer
|
||||
- Auto-formatting can be disabled with:
|
||||
|
||||
```lua
|
||||
vim.g.autoformat = false -- globally
|
||||
vim.b.autoformat = false -- buffer-local
|
||||
```
|
||||
|
||||
- `none-ls.nvim` is no longer installed by default
|
||||
|
||||
- `conform.nvim` is now the default formatter
|
||||
- `nvim-lint` is now the default linter
|
||||
- If you want to keep using `none-ls.nvim`,
|
||||
you can enable the **lsp.none-ls** extra
|
||||
|
||||
- `dashboard.nvim` is the new default dashboard plugin
|
||||
|
||||
- If you want to keep using `alpha.nvim`, you can enable the **ui.alpha** extra
|
||||
|
||||
- Improved **root detection**:
|
||||
|
||||
- New `:LazyRoot` command that shows info about the root dir detection
|
||||
- Configurable with `vim.g.root_spec`
|
||||
|
||||
```lua
|
||||
-- LazyVim root dir detection
|
||||
-- Each entry can be:
|
||||
-- * the name of a detector function like `lsp` or `cwd`
|
||||
-- * a pattern or array of patterns like `.git` or `lua`.
|
||||
-- * a function with signature `function(buf) -> string|string[]`
|
||||
vim.g.root_spec = { "lsp", { ".git", "lua" }, "cwd" }
|
||||
|
||||
-- To disable root detection set to just "cwd"
|
||||
vim.g.root_spec = { "cwd" }
|
||||
```
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
*LazyVim.txt* For Neovim >= 0.8.0 Last change: 2023 October 14
|
||||
*LazyVim.txt* For Neovim >= 0.8.0 Last change: 2023 October 11
|
||||
|
||||
==============================================================================
|
||||
Table of Contents *LazyVim-table-of-contents*
|
||||
|
||||
+12
-15
@@ -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.0.0" -- x-release-please-version
|
||||
|
||||
---@class LazyVimOptions
|
||||
local defaults = {
|
||||
@@ -19,13 +19,6 @@ local defaults = {
|
||||
-- lazyvim.config.options can't be configured here since that's loaded before lazyvim setup
|
||||
-- if you want to disable loading options, add `package.loaded["lazyvim.config.options"] = true` to the top of your init.lua
|
||||
},
|
||||
news = {
|
||||
-- When enabled, NEWS.md will be shown when changed.
|
||||
-- This only contains big new features and breaking changes.
|
||||
lazyvim = true,
|
||||
-- Same but for Neovim's news.txt
|
||||
neovim = false,
|
||||
},
|
||||
-- icons used by other plugins
|
||||
-- stylua: ignore
|
||||
icons = {
|
||||
@@ -84,7 +77,6 @@ local defaults = {
|
||||
Snippet = " ",
|
||||
String = " ",
|
||||
Struct = " ",
|
||||
TabNine = " ",
|
||||
Text = " ",
|
||||
TypeParameter = " ",
|
||||
Unit = " ",
|
||||
@@ -129,10 +121,8 @@ local defaults = {
|
||||
}
|
||||
|
||||
M.json = {
|
||||
version = 2,
|
||||
data = {
|
||||
version = nil, ---@type string?
|
||||
news = {}, ---@type table<string, string>
|
||||
extras = {}, ---@type string[]
|
||||
},
|
||||
}
|
||||
@@ -146,13 +136,19 @@ 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.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(vim.json.encode(M.json.data))
|
||||
f:close()
|
||||
end
|
||||
end
|
||||
|
||||
---@type LazyVimOptions
|
||||
local options
|
||||
|
||||
@@ -176,8 +172,9 @@ function M.setup(opts)
|
||||
end
|
||||
M.load("keymaps")
|
||||
|
||||
Util.warn("This branch has been merged on main. Please update your config.")
|
||||
|
||||
Util.format.setup()
|
||||
Util.news.setup()
|
||||
|
||||
vim.api.nvim_create_user_command("LazyRoot", function()
|
||||
Util.root.info()
|
||||
|
||||
@@ -98,22 +98,6 @@ 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
|
||||
@@ -141,7 +125,7 @@ map("n", "<leader>qq", "<cmd>qa<cr>", { desc = "Quit all" })
|
||||
map("n", "<leader>ui", vim.show_pos, { desc = "Inspect Pos" })
|
||||
|
||||
-- LazyVim Changelog
|
||||
map("n", "<leader>L", function() Util.news.changelog() end, { desc = "LazyVim Changelog" })
|
||||
map("n", "<leader>L", Util.changelog, {desc = "LazyVim Changelog"})
|
||||
|
||||
-- floating terminal
|
||||
local lazyterm = function() Util.terminal(nil, { cwd = Util.root() }) end
|
||||
|
||||
@@ -24,20 +24,6 @@ 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]])
|
||||
|
||||
@@ -27,7 +27,43 @@ return {
|
||||
optional = true,
|
||||
event = "VeryLazy",
|
||||
opts = function(_, opts)
|
||||
table.insert(opts.sections.lualine_x, 2, require("lazyvim.util").lualine.cmp_source("codeium"))
|
||||
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,
|
||||
})
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
||||
@@ -1,50 +0,0 @@
|
||||
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 = "./install.sh",
|
||||
dependencies = "hrsh7th/nvim-cmp",
|
||||
opts = {
|
||||
max_lines = 1000,
|
||||
max_num_results = 3,
|
||||
sort = true,
|
||||
},
|
||||
config = function(_, opts)
|
||||
local tabnine = require("cmp_tabnine.config")
|
||||
tabnine: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,11 +2,22 @@ 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
|
||||
@@ -99,8 +110,8 @@ return {
|
||||
opts = function(_, opts)
|
||||
table.insert(opts.sections.lualine_c, {
|
||||
"aerial",
|
||||
sep = " ", -- separator between symbols
|
||||
sep_icon = "", -- separator between icon and symbol
|
||||
-- The separator to be used to separate symbols in status line.
|
||||
sep = " ",
|
||||
|
||||
-- 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
|
||||
|
||||
@@ -82,32 +82,15 @@ 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,
|
||||
},
|
||||
@@ -116,7 +99,7 @@ return {
|
||||
optional = true,
|
||||
opts = {
|
||||
formatters_by_ft = {
|
||||
go = { "goimports", "gofumpt" },
|
||||
go = { "goimports" },
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -125,10 +108,10 @@ return {
|
||||
optional = true,
|
||||
dependencies = {
|
||||
{
|
||||
"williamboman/mason.nvim",
|
||||
"mason.nvim",
|
||||
opts = function(_, opts)
|
||||
opts.ensure_installed = opts.ensure_installed or {}
|
||||
vim.list_extend(opts.ensure_installed, { "delve" })
|
||||
vim.list_extend(opts.ensure_installed, { "gomodifytags", "impl", "goimports", "delve" })
|
||||
end,
|
||||
},
|
||||
{
|
||||
|
||||
@@ -1,64 +0,0 @@
|
||||
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" })
|
||||
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 = "Peek (Markdown Preview)",
|
||||
},
|
||||
},
|
||||
config = function()
|
||||
vim.cmd([[do FileType]])
|
||||
end,
|
||||
},
|
||||
}
|
||||
@@ -12,23 +12,7 @@ return {
|
||||
opts = {
|
||||
servers = {
|
||||
pyright = {},
|
||||
ruff_lsp = {
|
||||
keys = {
|
||||
{
|
||||
"<leader>co",
|
||||
function()
|
||||
vim.lsp.buf.code_action({
|
||||
apply = true,
|
||||
context = {
|
||||
only = { "source.organizeImports" },
|
||||
diagnostics = {},
|
||||
},
|
||||
})
|
||||
end,
|
||||
desc = "Organize Imports",
|
||||
},
|
||||
},
|
||||
},
|
||||
ruff_lsp = {},
|
||||
},
|
||||
setup = {
|
||||
ruff_lsp = function()
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
return {
|
||||
|
||||
{ "nvimdev/dashboard-nvim", enabled = false },
|
||||
{ "glepnir/dashboard-nvim", enabled = false },
|
||||
{ "echasnovski/mini.starter", enabled = false },
|
||||
-- Dashboard. This runs when neovim starts, and is what displays
|
||||
-- the "LAZYVIM" banner.
|
||||
|
||||
@@ -49,7 +49,7 @@ return {
|
||||
return vim.bo[buf].buftype == "help"
|
||||
end,
|
||||
},
|
||||
{ title = "Spectre", ft = "spectre_panel", size = { height = 0.4 } },
|
||||
{ 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 },
|
||||
{ "nvimdev/dashboard-nvim", enabled = false },
|
||||
{ "glepnir/dashboard-nvim", enabled = false },
|
||||
|
||||
-- enable mini.starter
|
||||
{
|
||||
|
||||
@@ -11,9 +11,7 @@ return {
|
||||
-- Add Hyprland Parser
|
||||
{
|
||||
"luckasRanarison/tree-sitter-hypr",
|
||||
enabled = function()
|
||||
return have("hypr")
|
||||
end,
|
||||
enabled = have("hypr"),
|
||||
event = "BufRead */hypr/*.conf",
|
||||
build = ":TSUpdate hypr",
|
||||
config = function()
|
||||
|
||||
@@ -45,7 +45,7 @@ return {
|
||||
end,
|
||||
},
|
||||
{
|
||||
"nvimdev/dashboard-nvim",
|
||||
"glepnir/dashboard-nvim",
|
||||
optional = true,
|
||||
opts = function(_, opts)
|
||||
local projects = {
|
||||
|
||||
@@ -1,41 +1,3 @@
|
||||
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
|
||||
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)
|
||||
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
|
||||
)
|
||||
)
|
||||
opts[key] = nil
|
||||
end
|
||||
end
|
||||
format_opts = opts.format
|
||||
require("conform").setup(opts)
|
||||
end
|
||||
|
||||
return {
|
||||
{
|
||||
"stevearc/conform.nvim",
|
||||
@@ -61,7 +23,7 @@ return {
|
||||
priority = 100,
|
||||
primary = true,
|
||||
format = function(buf)
|
||||
require("conform").format(Util.merge(format_opts, { bufnr = buf }))
|
||||
require("conform").format({ bufnr = buf })
|
||||
end,
|
||||
sources = function(buf)
|
||||
local ret = require("conform").list_formatters(buf)
|
||||
@@ -72,45 +34,36 @@ return {
|
||||
})
|
||||
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" })
|
||||
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
|
||||
end
|
||||
---@class ConformOpts
|
||||
return {
|
||||
-- LazyVim will use these options when formatting with the conform.nvim formatter
|
||||
format = {
|
||||
timeout_ms = 1000,
|
||||
},
|
||||
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,
|
||||
-- },
|
||||
--
|
||||
-- # Example of using shfmt with extra args
|
||||
-- shfmt = {
|
||||
-- extra_args = { "-i", "2", "-ci" },
|
||||
-- },
|
||||
},
|
||||
}
|
||||
require("conform").setup(opts)
|
||||
end,
|
||||
config = M.setup,
|
||||
},
|
||||
}
|
||||
|
||||
@@ -27,10 +27,8 @@ return {
|
||||
|
||||
local lint = require("lint")
|
||||
for name, linter in pairs(opts.linters) do
|
||||
if type(linter) == "table" and type(lint.linters[name]) == "table" then
|
||||
if type(linter) == "table" and type(lint.linters) == "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
|
||||
|
||||
@@ -218,15 +218,6 @@ 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,6 +13,7 @@ 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" },
|
||||
@@ -22,6 +23,12 @@ 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",
|
||||
@@ -99,4 +106,12 @@ 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,22 +110,6 @@ 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
|
||||
|
||||
@@ -331,7 +331,7 @@ return {
|
||||
end,
|
||||
},
|
||||
{
|
||||
"nvimdev/dashboard-nvim",
|
||||
"glepnir/dashboard-nvim",
|
||||
event = "VimEnter",
|
||||
opts = function()
|
||||
local logo = [[
|
||||
|
||||
@@ -2,10 +2,10 @@ local Config = require("lazyvim.config")
|
||||
|
||||
-- Some extras need to be loaded before others
|
||||
local prios = {
|
||||
["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,
|
||||
["editor.aerial"] = 100,
|
||||
["editor.symbols-outline"] = 100,
|
||||
["test.core"] = 1,
|
||||
["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 = extra }
|
||||
return { import = "lazyvim.plugins.extras." .. extra }
|
||||
end, Config.json.data.extras)
|
||||
|
||||
+36
-66
@@ -5,16 +5,8 @@ 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
|
||||
@@ -24,12 +16,6 @@ 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
|
||||
@@ -37,52 +23,42 @@ M.state = nil
|
||||
---@return LazyExtra[]
|
||||
function M.get()
|
||||
M.state = M.state or LazyConfig.spec.modules
|
||||
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)
|
||||
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
|
||||
end
|
||||
end
|
||||
table.sort(extras, function(a, b)
|
||||
return a.name < b.name
|
||||
end)
|
||||
return extras
|
||||
end
|
||||
table.sort(extras)
|
||||
|
||||
---@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
|
||||
---@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
|
||||
end
|
||||
end
|
||||
table.sort(plugins)
|
||||
table.sort(optional)
|
||||
table.sort(plugins)
|
||||
table.sort(optional)
|
||||
|
||||
---@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,
|
||||
}
|
||||
return {
|
||||
name = extra,
|
||||
enabled = enabled,
|
||||
managed = vim.tbl_contains(Config.json.data.extras, extra) or not enabled,
|
||||
plugins = plugins,
|
||||
optional = optional,
|
||||
}
|
||||
end, extras)
|
||||
end
|
||||
|
||||
---@class LazyExtraView
|
||||
@@ -124,17 +100,17 @@ function X:toggle()
|
||||
end
|
||||
extra.enabled = not extra.enabled
|
||||
Config.json.data.extras = vim.tbl_filter(function(name)
|
||||
return name ~= extra.module
|
||||
return name ~= extra.name
|
||||
end, Config.json.data.extras)
|
||||
M.state = vim.tbl_filter(function(name)
|
||||
return name ~= extra.module
|
||||
return name ~= "lazyvim.plugins.extras." .. extra.name
|
||||
end, M.state)
|
||||
if extra.enabled then
|
||||
table.insert(Config.json.data.extras, extra.module)
|
||||
M.state[#M.state + 1] = extra.module
|
||||
table.insert(Config.json.data.extras, extra.name)
|
||||
M.state[#M.state + 1] = "lazyvim.plugins.extras." .. extra.name
|
||||
end
|
||||
table.sort(Config.json.data.extras)
|
||||
Util.json.save()
|
||||
Config.json.save()
|
||||
Util.info(
|
||||
"`"
|
||||
.. extra.name
|
||||
@@ -204,18 +180,12 @@ 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
|
||||
|
||||
|
||||
@@ -130,7 +130,7 @@ function M.health()
|
||||
local has_extra = vim.tbl_contains(Config.spec.modules, "lazyvim.plugins.extras.lsp.none-ls")
|
||||
if has_plugin and not has_extra then
|
||||
Util.warn({
|
||||
"`conform.nvim` and `nvim-lint` are now the default formatters and linters in LazyVim.",
|
||||
"`conform.nvim` and `nvim-lint` are now the default forrmatters and linters in LazyVim.",
|
||||
"",
|
||||
"You can use those plugins together with `none-ls.nvim`,",
|
||||
"but you need to enable the `lazyvim.plugins.extras.lsp.none-ls` extra,",
|
||||
|
||||
@@ -11,9 +11,6 @@ local LazyUtil = require("lazy.core.util")
|
||||
---@field plugin lazyvim.util.plugin
|
||||
---@field extras lazyvim.util.extras
|
||||
---@field inject lazyvim.util.inject
|
||||
---@field news lazyvim.util.news
|
||||
---@field json lazyvim.util.json
|
||||
---@field lualine lazyvim.util.lualine
|
||||
local M = {}
|
||||
|
||||
---@type table<string, string|string[]>
|
||||
@@ -24,6 +21,7 @@ local deprecated = {
|
||||
root_patterns = { "root", "patterns" },
|
||||
get_root = { "root", "get" },
|
||||
float_term = { "terminal", "open" },
|
||||
toggle = { "toggle", "option" },
|
||||
toggle_diagnostics = { "toggle", "diagnostics" },
|
||||
toggle_number = { "toggle", "number" },
|
||||
fg = "ui",
|
||||
@@ -139,6 +137,14 @@ function M.on_load(name, fn)
|
||||
end
|
||||
end
|
||||
|
||||
function M.changelog()
|
||||
local lv = require("lazy.core.config").plugins.LazyVim
|
||||
local float = require("lazy.util").open(lv.dir .. "/CHANGELOG.md")
|
||||
vim.wo[float.win].spell = false
|
||||
vim.wo[float.win].wrap = false
|
||||
vim.diagnostic.disable(float.buf)
|
||||
end
|
||||
|
||||
-- Wrapper around vim.keymap.set that will
|
||||
-- not create a keymap if a lazy key handler exists.
|
||||
-- It will also set `silent` to true by default.
|
||||
|
||||
@@ -1,82 +0,0 @@
|
||||
local Config = require("lazyvim.config")
|
||||
local Util = require("lazyvim.util")
|
||||
|
||||
---@class lazyvim.util.json
|
||||
local M = {}
|
||||
|
||||
---@param value any
|
||||
---@param indent string
|
||||
local function encode(value, indent)
|
||||
local t = type(value)
|
||||
|
||||
if t == "string" then
|
||||
return string.format("%q", value)
|
||||
elseif t == "number" or t == "boolean" then
|
||||
return tostring(value)
|
||||
elseif t == "table" then
|
||||
local is_list = Util.is_list(value)
|
||||
local parts = {}
|
||||
local next_indent = indent .. " "
|
||||
|
||||
if is_list then
|
||||
---@diagnostic disable-next-line: no-unknown
|
||||
for _, v in ipairs(value) do
|
||||
local e = encode(v, next_indent)
|
||||
if e then
|
||||
table.insert(parts, next_indent .. e)
|
||||
end
|
||||
end
|
||||
return "[\n" .. table.concat(parts, ",\n") .. "\n" .. indent .. "]"
|
||||
else
|
||||
local keys = vim.tbl_keys(value)
|
||||
table.sort(keys)
|
||||
---@diagnostic disable-next-line: no-unknown
|
||||
for _, k in ipairs(keys) do
|
||||
local e = encode(value[k], next_indent)
|
||||
if e then
|
||||
table.insert(parts, next_indent .. string.format("%q", k) .. ": " .. e)
|
||||
end
|
||||
end
|
||||
return "{\n" .. table.concat(parts, ",\n") .. "\n" .. indent .. "}"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function M.encode(value)
|
||||
return encode(value, "")
|
||||
end
|
||||
|
||||
function M.save()
|
||||
Config.json.data.version = Config.json.version
|
||||
local path = vim.fn.stdpath("config") .. "/lazyvim.json"
|
||||
local f = io.open(path, "w")
|
||||
if f then
|
||||
f:write(Util.json.encode(Config.json.data))
|
||||
f:close()
|
||||
end
|
||||
end
|
||||
|
||||
function M.migrate()
|
||||
Util.info("Migrating `lazyvim.json` to version `" .. Config.json.version .. "`")
|
||||
local json = Config.json
|
||||
|
||||
-- v0
|
||||
if not json.data.version then
|
||||
if json.data.hashes then
|
||||
---@diagnostic disable-next-line: no-unknown
|
||||
json.data.hashes = nil
|
||||
end
|
||||
json.data.extras = vim.tbl_map(function(extra)
|
||||
return "lazyvim.plugins.extras." .. extra
|
||||
end, json.data.extras or {})
|
||||
elseif json.data.version == 1 then
|
||||
json.data.extras = vim.tbl_map(function(extra)
|
||||
-- replace double extras module name
|
||||
return extra:gsub("^lazyvim%.plugins%.extras%.lazyvim%.plugins%.extras%.", "lazyvim.plugins.extras.")
|
||||
end, json.data.extras or {})
|
||||
end
|
||||
|
||||
M.save()
|
||||
end
|
||||
|
||||
return M
|
||||
+30
-43
@@ -1,26 +1,10 @@
|
||||
local Util = require("lazyvim.util")
|
||||
|
||||
---@class lazyvim.util.lsp
|
||||
local M = {}
|
||||
|
||||
---@alias lsp.Client.filter {id?: number, bufnr?: number, name?: string, method?: string, filter?:fun(client: lsp.Client):boolean}
|
||||
|
||||
---@param opts? lsp.Client.filter
|
||||
function M.get_clients(opts)
|
||||
local ret = {} ---@type lsp.Client[]
|
||||
if vim.lsp.get_clients then
|
||||
ret = vim.lsp.get_clients(opts)
|
||||
else
|
||||
---@diagnostic disable-next-line: deprecated
|
||||
ret = vim.lsp.get_active_clients(opts)
|
||||
if opts and opts.method then
|
||||
---@param client lsp.Client
|
||||
ret = vim.tbl_filter(function(client)
|
||||
return client.supports_method(opts.method, { bufnr = opts.bufnr })
|
||||
end, ret)
|
||||
end
|
||||
end
|
||||
return opts and opts.filter and vim.tbl_filter(opts.filter, ret) or ret
|
||||
function M.get_clients(...)
|
||||
---@diagnostic disable-next-line: deprecated
|
||||
local fn = vim.lsp.get_clients or vim.lsp.get_active_clients
|
||||
return fn(...)
|
||||
end
|
||||
|
||||
---@param on_attach fun(client, buffer)
|
||||
@@ -75,26 +59,39 @@ function M.disable(server, cond)
|
||||
end)
|
||||
end
|
||||
|
||||
---@param opts? LazyFormatter| {filter?: (string|lsp.Client.filter)}
|
||||
---@alias lsp.Client.filter fun(client: lsp.Client): boolean
|
||||
|
||||
---@param name string
|
||||
---@return lsp.Client.filter
|
||||
function M.filter(name)
|
||||
return function(client)
|
||||
return client.name == name
|
||||
end
|
||||
end
|
||||
|
||||
---@param opts? LazyFormatter| {filter?: (string|lsp.Client.filter), bufnr?: number}
|
||||
function M.formatter(opts)
|
||||
opts = opts or {}
|
||||
local filter = opts.filter or {}
|
||||
filter = type(filter) == "string" and { name = filter } or filter
|
||||
---@cast filter lsp.Client.filter
|
||||
local filter = opts.filter
|
||||
filter = type(filter) == "string" and M.filter(filter) or filter
|
||||
---@cast filter lsp.Client.filter?
|
||||
---@type LazyFormatter
|
||||
local ret = {
|
||||
name = "LSP",
|
||||
primary = true,
|
||||
priority = 1,
|
||||
format = function(buf)
|
||||
M.format(Util.merge(filter, { bufnr = buf }))
|
||||
M.format({ bufnr = buf, filter = filter })
|
||||
end,
|
||||
sources = function(buf)
|
||||
local clients = M.get_clients(Util.merge(filter, { bufnr = buf }))
|
||||
local clients = M.get_clients({ bufnr = buf })
|
||||
---@param client lsp.Client
|
||||
local ret = vim.tbl_filter(function(client)
|
||||
return client.supports_method("textDocument/formatting")
|
||||
or client.supports_method("textDocument/rangeFormatting")
|
||||
return (not filter or filter(client))
|
||||
and (
|
||||
client.supports_method("textDocument/formatting")
|
||||
or client.supports_method("textDocument/rangeFormatting")
|
||||
)
|
||||
end, clients)
|
||||
---@param client lsp.Client
|
||||
return vim.tbl_map(function(client)
|
||||
@@ -102,24 +99,14 @@ function M.formatter(opts)
|
||||
end, ret)
|
||||
end,
|
||||
}
|
||||
return Util.merge(ret, opts) --[[@as LazyFormatter]]
|
||||
return vim.tbl_deep_extend("force", ret, opts) --[[@as LazyFormatter]]
|
||||
end
|
||||
|
||||
---@alias lsp.Client.format {timeout_ms?: number, format_options?: table} | lsp.Client.filter
|
||||
|
||||
---@param opts? lsp.Client.format
|
||||
---@param opts? {filter?: lsp.Client.filter, bufnr?: number}
|
||||
function M.format(opts)
|
||||
opts = vim.tbl_deep_extend("force", {}, opts or {}, require("lazyvim.util").opts("nvim-lspconfig").format or {})
|
||||
local ok, conform = pcall(require, "conform")
|
||||
-- use conform for formatting with LSP when available,
|
||||
-- since it has better format diffing
|
||||
if ok then
|
||||
opts.formatters = {}
|
||||
opts.lsp_fallback = true
|
||||
conform.format(opts)
|
||||
else
|
||||
vim.lsp.buf.format(opts)
|
||||
end
|
||||
vim.lsp.buf.format(
|
||||
vim.tbl_deep_extend("force", opts or {}, require("lazyvim.util").opts("nvim-lspconfig").format or {})
|
||||
)
|
||||
end
|
||||
|
||||
return M
|
||||
|
||||
@@ -1,46 +0,0 @@
|
||||
local Util = require("lazyvim.util")
|
||||
|
||||
---@class lazyvim.util.lualine
|
||||
local M = {}
|
||||
|
||||
function M.cmp_source(name, icon)
|
||||
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 == name 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 colors = {
|
||||
ok = Util.ui.fg("Special"),
|
||||
error = Util.ui.fg("DiagnosticError"),
|
||||
pending = Util.ui.fg("DiagnosticWarn"),
|
||||
}
|
||||
|
||||
return {
|
||||
function()
|
||||
return icon or require("lazyvim.config").icons.kinds[name:sub(1, 1):upper() .. name:sub(2)]
|
||||
end,
|
||||
cond = function()
|
||||
return status() ~= nil
|
||||
end,
|
||||
color = function()
|
||||
return colors[status()] or colors.ok
|
||||
end,
|
||||
}
|
||||
end
|
||||
|
||||
return M
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user