mirror of
https://github.com/LazyVim/LazyVim.git
synced 2026-07-25 14:01:06 +00:00
Merge branch 'main' into vscode
This commit is contained in:
commit
836e1ecf42
99 changed files with 1515 additions and 716 deletions
2
.github/.release-please-manifest.json
vendored
2
.github/.release-please-manifest.json
vendored
|
|
@ -1,3 +1,3 @@
|
||||||
{
|
{
|
||||||
".": "14.15.0"
|
".": "15.9.0"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
282
CHANGELOG.md
282
CHANGELOG.md
|
|
@ -1,5 +1,287 @@
|
||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## [15.9.0](https://github.com/LazyVim/LazyVim/compare/v15.8.1...v15.9.0) (2025-10-19)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **docker:** associate 'Containerfile' with 'dockerfile' filetype ([#5974](https://github.com/LazyVim/LazyVim/issues/5974)) ([97af4a2](https://github.com/LazyVim/LazyVim/commit/97af4a23bccac85eb02e489f573db68863d6ed33))
|
||||||
|
* **extras.rest:** add keymap for changing environment ([#5678](https://github.com/LazyVim/LazyVim/issues/5678)) ([1da659d](https://github.com/LazyVim/LazyVim/commit/1da659db4a3fbcd6d171f3b38d0092ced0887e61))
|
||||||
|
* **java:** enable `blink.cmp` capabilities to show signature documentation ([#5218](https://github.com/LazyVim/LazyVim/issues/5218)) ([9618e32](https://github.com/LazyVim/LazyVim/commit/9618e327edfb79d9cbb037a2039c4315a95df63f))
|
||||||
|
* **lang/omnisharp:** switch neotest adapter to vstest ([#6540](https://github.com/LazyVim/LazyVim/issues/6540)) ([4086d44](https://github.com/LazyVim/LazyVim/commit/4086d44a0b5c576630c603c7b71c6be5198d9eaf))
|
||||||
|
* **neotest:** extra keymap to attach to a test ([#6198](https://github.com/LazyVim/LazyVim/issues/6198)) ([66e927f](https://github.com/LazyVim/LazyVim/commit/66e927fd9d0b0ff2886b9fe1465d9396461a2665))
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **blink:** remove snippet expand override (no longer needed). Closes [#6044](https://github.com/LazyVim/LazyVim/issues/6044) ([336e2c3](https://github.com/LazyVim/LazyVim/commit/336e2c3ea67636c4eea3cf8f7538feb86b5a0610))
|
||||||
|
* **chezmoi:** add `hidden=false` to fzf picker ([#6095](https://github.com/LazyVim/LazyVim/issues/6095)) ([1aa1b59](https://github.com/LazyVim/LazyVim/commit/1aa1b59a7ec7cab61fa7b096db53df15ec5008e7))
|
||||||
|
* **copilot-chat:** use up to date config for chat headers ([#6543](https://github.com/LazyVim/LazyVim/issues/6543)) ([2c5eef7](https://github.com/LazyVim/LazyVim/commit/2c5eef7df7520fbc6fe0d90150cd26ac9e4f325b))
|
||||||
|
* **extras/rust:** fix config key for files.exclude ([#5664](https://github.com/LazyVim/LazyVim/issues/5664)) ([762a34d](https://github.com/LazyVim/LazyVim/commit/762a34d5ad95447b241287e8d540b657a699d141))
|
||||||
|
* **extras:** adjust switch source/header shortcut ([#6567](https://github.com/LazyVim/LazyVim/issues/6567)) ([b36b858](https://github.com/LazyVim/LazyVim/commit/b36b8589b62f55b181367afe954606c73233c0a1))
|
||||||
|
* **extras:** remove procMacro ignored ([#6117](https://github.com/LazyVim/LazyVim/issues/6117)) ([4a3702e](https://github.com/LazyVim/LazyVim/commit/4a3702e050881fea262ccae980ae1ff9e849d275))
|
||||||
|
* **lang.omnisharp:** update CSharpier command and arguments for Mason compatibility ([#6156](https://github.com/LazyVim/LazyVim/issues/6156)) ([dfebe70](https://github.com/LazyVim/LazyVim/commit/dfebe70b8d09514dd3ee85e12463f266f93c5dd7))
|
||||||
|
* **lang.rust:** rust-analyzer hanging on root scanned ([#6178](https://github.com/LazyVim/LazyVim/issues/6178)) ([7bf8c22](https://github.com/LazyVim/LazyVim/commit/7bf8c22c56283fa6d5d35246dcd0f49d37a5c709))
|
||||||
|
* **latex:** ensure tex extra installs latex tree-sitter parser ([#6357](https://github.com/LazyVim/LazyVim/issues/6357)) ([ae74622](https://github.com/LazyVim/LazyVim/commit/ae74622e6666ea4c3e6c58c4ef2d3f313d8e8f20))
|
||||||
|
* **mini.animate:** schedule the toggle mapping to correctly take effect ([#6483](https://github.com/LazyVim/LazyVim/issues/6483)) ([bd23357](https://github.com/LazyVim/LazyVim/commit/bd233579a66018f526b6b0970e33afde4cde399e))
|
||||||
|
* **sql:** fix autocomplete when `omni` is used as a `blink.cmp` source ([#5652](https://github.com/LazyVim/LazyVim/issues/5652)) ([f6f72b9](https://github.com/LazyVim/LazyVim/commit/f6f72b90d41d9347b93a07d0b680195541f64c55))
|
||||||
|
* **treesitter:** attach textobject keymaps to existing buffers on load. Closes [#6642](https://github.com/LazyVim/LazyVim/issues/6642). Closes [#6639](https://github.com/LazyVim/LazyVim/issues/6639) ([92a7728](https://github.com/LazyVim/LazyVim/commit/92a77287321236f52ff38648a38cf314ab223137))
|
||||||
|
* **typescript:** make_position_params with offset encoding. ([#6277](https://github.com/LazyVim/LazyVim/issues/6277)) ([22152e9](https://github.com/LazyVim/LazyVim/commit/22152e958f3f7c2b732cb6429ccc90541e0ad17f))
|
||||||
|
* **ui:** ignore sidekick_terminal in mini-indentscope ([#6619](https://github.com/LazyVim/LazyVim/issues/6619)) ([f0b32b5](https://github.com/LazyVim/LazyVim/commit/f0b32b5955889d4d2d3636a52d2ddf5d113646df))
|
||||||
|
* **util:** add some kulala keymaps back to global ([#5960](https://github.com/LazyVim/LazyVim/issues/5960)) ([a16739e](https://github.com/LazyVim/LazyVim/commit/a16739e3328c2687d96f868839c575765c49baad))
|
||||||
|
* **vscode:** don't sync undo/redo with vscode ([#5957](https://github.com/LazyVim/LazyVim/issues/5957)) ([706ec44](https://github.com/LazyVim/LazyVim/commit/706ec4443a33ec474f2329b5b806e9cdb85cce43))
|
||||||
|
|
||||||
|
## [15.8.1](https://github.com/LazyVim/LazyVim/compare/v15.8.0...v15.8.1) (2025-10-18)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **treesitter:** reload lazyvim.tresitter.util to prevent issues with stale modules when upgrading ([62ce8a2](https://github.com/LazyVim/LazyVim/commit/62ce8a23d89fa766956447a3df01d9f3448e9a66))
|
||||||
|
|
||||||
|
## [15.8.0](https://github.com/LazyVim/LazyVim/compare/v15.7.1...v15.8.0) (2025-10-17)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **gleam:** add conform ([#5640](https://github.com/LazyVim/LazyVim/issues/5640)) ([02b8dd3](https://github.com/LazyVim/LazyVim/commit/02b8dd3f4bd55f06be133471fad027f3131238f4))
|
||||||
|
* **sidekick:** added `<leader>ad` to close/detach a terminal/session ([f8b062b](https://github.com/LazyVim/LazyVim/commit/f8b062b130177f07d3c1c13b642402d42e980df5))
|
||||||
|
* **sidekick:** changed default keymaps for sidekick. Please check updated docs at sidekick.nvim ([a3e52dd](https://github.com/LazyVim/LazyVim/commit/a3e52dd346ea35db5521b66e46dca95d32f00cb4))
|
||||||
|
* **sidekick:** use `<a-a>` in any snacks picker to send the (selected) results to an AI tool ([26c43a9](https://github.com/LazyVim/LazyVim/commit/26c43a9b931f3ab04a8c449671250182ac9ddca6))
|
||||||
|
* **treesitter:** add installation instructions to get a C compiler on windows ([37032da](https://github.com/LazyVim/LazyVim/commit/37032dabd657ae567011e7ab4f881ecbf476eb76))
|
||||||
|
* **treesitter:** added support for `disable` langs to indent/highlight/folds. Closes [#6608](https://github.com/LazyVim/LazyVim/issues/6608) ([0e8069c](https://github.com/LazyVim/LazyVim/commit/0e8069c78ee92279055236388df8c2019476767a))
|
||||||
|
* **treesitter:** better health checks for treesitter requirements ([413b9d5](https://github.com/LazyVim/LazyVim/commit/413b9d5fa91c5bd5088b28c6d1764caa88542cb1))
|
||||||
|
* **treesitter:** on windows, use `gcc` if available and `cl.exe` is not available for building parsers ([2a1f3c3](https://github.com/LazyVim/LazyVim/commit/2a1f3c370145c3465c0142deade3e3b2660ce829))
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **blink:** disable blink left/right key in the cmdline ([94c4603](https://github.com/LazyVim/LazyVim/commit/94c4603b6838fbe75343b6e3342b4343744157dc))
|
||||||
|
* **keymaps:** update deprecated diagnostic keymap to latest api change ([#6574](https://github.com/LazyVim/LazyVim/issues/6574)) ([b9d38f6](https://github.com/LazyVim/LazyVim/commit/b9d38f692015fecaa72d55282b74a3d601e4c9fa))
|
||||||
|
* **sidekick:** only add copilot to lspconfig when `opts.nes.enabled ~= false` ([049db39](https://github.com/LazyVim/LazyVim/commit/049db39de0f272e8368a4b3881ac5a13f0d04b09))
|
||||||
|
* **terminal:** term toggle keymaps now only work for snacks terminals. Closes [#6573](https://github.com/LazyVim/LazyVim/issues/6573) ([4efd0e2](https://github.com/LazyVim/LazyVim/commit/4efd0e2bea2a387d6fcdea8cf36a62049e8bafed))
|
||||||
|
* **treesiter:** check that `disable` options are tables ([e8c5fa7](https://github.com/LazyVim/LazyVim/commit/e8c5fa7eae06539c883699507caeadb46d74f401))
|
||||||
|
* **treesitter:** better check on windows if microsoft build tools is installed ([5effc77](https://github.com/LazyVim/LazyVim/commit/5effc77185f94f557809375b5650d427e7171c32))
|
||||||
|
* **xtras:** load `copilot-native` before `blink` ([#6588](https://github.com/LazyVim/LazyVim/issues/6588)) ([aa2c436](https://github.com/LazyVim/LazyVim/commit/aa2c43633adee0f80faf8d743d6476ea4f8ba5ca))
|
||||||
|
|
||||||
|
|
||||||
|
### Performance Improvements
|
||||||
|
|
||||||
|
* **ansible:** load on ft=yaml and run should only be mapped on ft=yaml.ansible ([ebdcf1b](https://github.com/LazyVim/LazyVim/commit/ebdcf1ba7ef18daa8c897c8922a5ef770e8bcffb))
|
||||||
|
|
||||||
|
## [15.7.1](https://github.com/LazyVim/LazyVim/compare/v15.7.0...v15.7.1) (2025-10-02)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **sidekick:** better keymaps ([188b288](https://github.com/LazyVim/LazyVim/commit/188b2886147acb4d9e2a5c8ae7b73770fd66a92c))
|
||||||
|
|
||||||
|
## [15.7.0](https://github.com/LazyVim/LazyVim/compare/v15.6.0...v15.7.0) (2025-10-01)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **sidekick:** updated keymaps for sidekick ([2942bd4](https://github.com/LazyVim/LazyVim/commit/2942bd4a0d738d693af51354e96aa7be5407d105))
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **copilot-native:** schedule inline_completion.enable ([23b1da1](https://github.com/LazyVim/LazyVim/commit/23b1da170f6367fafe0be47b9c141770ed75a78e))
|
||||||
|
* **sidekick:** better keymaps ([aabc03f](https://github.com/LazyVim/LazyVim/commit/aabc03f88d30b0424926d9d894adc5c91eb84ec2))
|
||||||
|
* **stylua:** stylua is now also an LSP. Disable it since we use the CLI tool. ([2f76d57](https://github.com/LazyVim/LazyVim/commit/2f76d572a2b172e5e7e236d3e972443242c36b66))
|
||||||
|
|
||||||
|
## [15.6.0](https://github.com/LazyVim/LazyVim/compare/v15.5.0...v15.6.0) (2025-09-30)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **sidekick:** added keymaps to work with AI cli tools ([5d18a46](https://github.com/LazyVim/LazyVim/commit/5d18a46b6a7bb5b946a6c87b9a45a2738c9ec9c3))
|
||||||
|
* **sidekick:** fancier lualine component ([b889978](https://github.com/LazyVim/LazyVim/commit/b8899781516da71ba0f63afa93fb4a6b25dff144))
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **config:** clipboard:get() ([22851dc](https://github.com/LazyVim/LazyVim/commit/22851dce979c4cac379c6795ca7885c83c1c7eaf))
|
||||||
|
* **copilot-native:** change Copilot-native's `<M-[>` description to "Prev Suggestion" ([#6553](https://github.com/LazyVim/LazyVim/issues/6553)) ([089d0a5](https://github.com/LazyVim/LazyVim/commit/089d0a5ac1ab85238804e017ac1ef0dc0a8341f0))
|
||||||
|
* **sidekick:** changed keymap to open new tool ([3d3739b](https://github.com/LazyVim/LazyVim/commit/3d3739b4b8943b5e7143d37f60bb0adbb6cf82f3))
|
||||||
|
|
||||||
|
## [15.5.0](https://github.com/LazyVim/LazyVim/compare/v15.4.0...v15.5.0) (2025-09-27)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **ai.copilot-native:** let sidekick.nvim handle some things if available ([b25ea9c](https://github.com/LazyVim/LazyVim/commit/b25ea9c153e76d11579731e1d5529f275a36f91d))
|
||||||
|
* **ai:** added completion hooks for next edit suggestions ([30a325d](https://github.com/LazyVim/LazyVim/commit/30a325d67184a80006dc55352d9663cdf01082d5))
|
||||||
|
* **extras:** added extra for `sidekick.nvim` (Copilot LSP integration) ([dbfe209](https://github.com/LazyVim/LazyVim/commit/dbfe20996ce62d6b0048245ab4e304610548da04))
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **ai.copilot:** disable copilot lsp if installed. copilot.lua needs its own version of the LSP ([e9bc607](https://github.com/LazyVim/LazyVim/commit/e9bc6074d1ea69e921a6195d1dc34333eaa310f8))
|
||||||
|
|
||||||
|
## [15.4.0](https://github.com/LazyVim/LazyVim/compare/v15.3.0...v15.4.0) (2025-09-26)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **copilot-native:** added experimental support for next edit suggestions. check the docs to enable ([c83df9e](https://github.com/LazyVim/LazyVim/commit/c83df9e68dd41f5a3f7df5a7048169ee286a7da8))
|
||||||
|
* **copilot-native:** added keymaps to cycle suggestions ([6bd630c](https://github.com/LazyVim/LazyVim/commit/6bd630cec6f905665691d593dc5d0fb3d54f560c))
|
||||||
|
* **copilot-native:** better lualine status ([9913e16](https://github.com/LazyVim/LazyVim/commit/9913e1665d783d9c4407633bc33475d403aff433))
|
||||||
|
* **copilot-native:** removed experimental **nes** support with `copilot_lsp` for now, since it's not the best experience right now ([ed637bb](https://github.com/LazyVim/LazyVim/commit/ed637bb0f7f418de069a4d5a7ed8a7b3b93eb425))
|
||||||
|
* **copilot:** added `copilot-native` extra to setup native inline completions in Neovim ([3b02963](https://github.com/LazyVim/LazyVim/commit/3b0296358508da1eb258c8716df163dd04fa6449))
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **catppuccin:** follow-up on api change ([#6505](https://github.com/LazyVim/LazyVim/issues/6505)) ([af6e250](https://github.com/LazyVim/LazyVim/commit/af6e2505b54270c30145e8f4191b865870537287))
|
||||||
|
* **treesitter:** create buffer-local textobjects keymaps only when available. Closes [#6508](https://github.com/LazyVim/LazyVim/issues/6508) ([5985ca0](https://github.com/LazyVim/LazyVim/commit/5985ca0cf1a0c1ddee8b2b718c730f988cec7001))
|
||||||
|
|
||||||
|
## [15.3.0](https://github.com/LazyVim/LazyVim/compare/v15.2.0...v15.3.0) (2025-09-23)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **copilot:** use `blink-copilot` as blink.cmp copilot source ([#5551](https://github.com/LazyVim/LazyVim/issues/5551)) ([13069f2](https://github.com/LazyVim/LazyVim/commit/13069f20183655d8a02f3acbd21d0ac4c9ce811c))
|
||||||
|
* **treesitter:** show an error if the user tries to set a custom treesitter compiler ([89ff1fd](https://github.com/LazyVim/LazyVim/commit/89ff1fd600bb6ff4cf2c9edbc2217a40ecb8d160))
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **jdtls:** allow mason jdtls installation ([#6498](https://github.com/LazyVim/LazyVim/issues/6498)) ([80990ec](https://github.com/LazyVim/LazyVim/commit/80990ec62fd36fc4b6b921a9041f55858e33e030))
|
||||||
|
* **jdtls:** bundle configuration bug fix ([#6499](https://github.com/LazyVim/LazyVim/issues/6499)) ([c423765](https://github.com/LazyVim/LazyVim/commit/c4237659621e406089f4d13d32192954d52c4924))
|
||||||
|
* **keymaps:** enable snacks git keybindings ([#6323](https://github.com/LazyVim/LazyVim/issues/6323)) ([720e06a](https://github.com/LazyVim/LazyVim/commit/720e06a908cbf6e3afb4eccc049d58df9ace770a))
|
||||||
|
* **lsp:** fix mason install/exclude. Closes [#6504](https://github.com/LazyVim/LazyVim/issues/6504) ([37b1ec4](https://github.com/LazyVim/LazyVim/commit/37b1ec41ae57e8396d5c923a4bfdf7050215b4d6))
|
||||||
|
* **lsp:** fixup for when not using mason ([a90b565](https://github.com/LazyVim/LazyVim/commit/a90b56518f4f2291985952d79472d4f935c0bad0))
|
||||||
|
* **luasnip:** add missing optional tag to garymjr/nvim-snippets ([#5733](https://github.com/LazyVim/LazyVim/issues/5733)) ([37a1c1a](https://github.com/LazyVim/LazyVim/commit/37a1c1af5dbbcf069bb94a71b4dda3626fbda77a))
|
||||||
|
* **vtsls:** fix and move denols/vtsls disambigutaion to typescript extra. Fixes [#6476](https://github.com/LazyVim/LazyVim/issues/6476) ([775621a](https://github.com/LazyVim/LazyVim/commit/775621ac0af42486ef1cd4254d1a6625a190040b))
|
||||||
|
|
||||||
|
## [15.2.0](https://github.com/LazyVim/LazyVim/compare/v15.1.1...v15.2.0) (2025-09-20)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **clojure:** use 'nvim-paredit' instead 'nvim-treesitter-sexp' as clojure S-exp Plugin ([#5876](https://github.com/LazyVim/LazyVim/issues/5876)) ([2659028](https://github.com/LazyVim/LazyVim/commit/26590285ead7a89bb45f309714f7f40136c89267))
|
||||||
|
* **core:** relax hard requirement for `vim.lsp.is_enabled`. Show warning instead ([3ca7b47](https://github.com/LazyVim/LazyVim/commit/3ca7b47365c85a07047e48cad450feff66c8bdd6))
|
||||||
|
* **options:** don't overwrite indentexpr/foldexpr/foldmethod when set by plugins. Fixes [#6464](https://github.com/LazyVim/LazyVim/issues/6464) ([ccbaf55](https://github.com/LazyVim/LazyVim/commit/ccbaf55c2f8bc691f8f64fe40ce00a1abda4fbac))
|
||||||
|
* **yanky:** use snacks picker for improved yank history navigation ([#5802](https://github.com/LazyVim/LazyVim/issues/5802)) ([55e762a](https://github.com/LazyVim/LazyVim/commit/55e762a8888cd5f336e4e2d4b2cc6b8b1b950663))
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **editor:** calculate the height passed to the prompt of fzf-lua properly ([#6481](https://github.com/LazyVim/LazyVim/issues/6481)) ([65e38d3](https://github.com/LazyVim/LazyVim/commit/65e38d3b34cab653a05318c1a9014df3c89fdb53))
|
||||||
|
* **lang.clojure:** correct cmp-conjure source name ([#6208](https://github.com/LazyVim/LazyVim/issues/6208)) ([55b5c1f](https://github.com/LazyVim/LazyVim/commit/55b5c1fecb0b7e71c5eb40555b17d1e4820690f0))
|
||||||
|
* **options:** set_default option ([2401d5f](https://github.com/LazyVim/LazyVim/commit/2401d5fca6f2a2fcaca4f9c4c84c4b713c602352))
|
||||||
|
* **options:** track some initial options right after loading `options.lua`. See [#6463](https://github.com/LazyVim/LazyVim/issues/6463) ([9c611b0](https://github.com/LazyVim/LazyVim/commit/9c611b0c5758d0d659e7fdb29119b7083a56f989))
|
||||||
|
* **treesitter:** check if queries for indent/fold exists before enabling it. Fixes [#6474](https://github.com/LazyVim/LazyVim/issues/6474) ([5ce7cd6](https://github.com/LazyVim/LazyVim/commit/5ce7cd650a5fffc257e0312b82fffd26abe2a1fa))
|
||||||
|
|
||||||
|
## [15.1.1](https://github.com/LazyVim/LazyVim/compare/v15.1.0...v15.1.1) (2025-09-18)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **core:** check for outdated nightly. See [#6458](https://github.com/LazyVim/LazyVim/issues/6458) ([cfac3c9](https://github.com/LazyVim/LazyVim/commit/cfac3c9a85526ad7406f9b246097a1ec4fa1a2c3))
|
||||||
|
* **lspconfig:** remove all usage of `lspconfig` ([36b4191](https://github.com/LazyVim/LazyVim/commit/36b41911ab90fe19505af306a31a5a699342d3c3))
|
||||||
|
* **lsp:** schedule_wrap setting up LSPs to work around root cause of [#6456](https://github.com/LazyVim/LazyVim/issues/6456). Fixes [#6456](https://github.com/LazyVim/LazyVim/issues/6456) ([75a3809](https://github.com/LazyVim/LazyVim/commit/75a3809e15a0ecff9adc46c6cd3aaac51d99b561))
|
||||||
|
|
||||||
|
## [15.1.0](https://github.com/LazyVim/LazyVim/compare/v15.0.3...v15.1.0) (2025-09-18)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **treesitter:** automatically install and use mason's tree-sitter-cli if not installed on system ([725d048](https://github.com/LazyVim/LazyVim/commit/725d048e009b866425b2a0cc620ba2c413e8b65f))
|
||||||
|
* **treesitter:** refactored setting up treesitter indent/highlight/folds ([b93303d](https://github.com/LazyVim/LazyVim/commit/b93303d2339b1117171780cebed1d710fd3805d5))
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **snacks:** safe wrapper around snacks statuscolumn to prevent errors when LazyVim is still installing ([5bf2378](https://github.com/LazyVim/LazyVim/commit/5bf237820d7938b1b6490164fbd75e4117d341c1))
|
||||||
|
|
||||||
|
## [15.0.3](https://github.com/LazyVim/LazyVim/compare/v15.0.2...v15.0.3) (2025-09-17)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **treesitter:** properly update installedd languages after setup ([c28f599](https://github.com/LazyVim/LazyVim/commit/c28f599d4f5d175f3d259a621c4e7b5d0b2a0759))
|
||||||
|
|
||||||
|
## [15.0.2](https://github.com/LazyVim/LazyVim/compare/v15.0.1...v15.0.2) (2025-09-17)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **python:** remove the wrapping `settings` key from `setup()` options ([#6069](https://github.com/LazyVim/LazyVim/issues/6069)) ([ed3aa74](https://github.com/LazyVim/LazyVim/commit/ed3aa74c107de7dc3e06367ce4afb20056710441))
|
||||||
|
* **treesitter:** indentexpr/foldexpr now work as intended and override ftplugin settings. Fixes [#6447](https://github.com/LazyVim/LazyVim/issues/6447) ([a6b38de](https://github.com/LazyVim/LazyVim/commit/a6b38de763addf2d22e8a43a1e679cc855dc376d))
|
||||||
|
|
||||||
|
## [15.0.1](https://github.com/LazyVim/LazyVim/compare/v15.0.0...v15.0.1) (2025-09-17)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **treesitter:** TS update during inital build ([2d56d3b](https://github.com/LazyVim/LazyVim/commit/2d56d3b37c275890a403845c00b5c8d38cb387e6))
|
||||||
|
|
||||||
|
## [15.0.0](https://github.com/LazyVim/LazyVim/compare/v14.15.1...v15.0.0) (2025-09-17)
|
||||||
|
|
||||||
|
|
||||||
|
### ⚠ BREAKING CHANGES
|
||||||
|
|
||||||
|
* **treesitter:** migrate to `nvim-treesitter` **main** branch
|
||||||
|
* bump Neovim requirement to 0.11.2
|
||||||
|
* LazyVim now requires Neovim >= 0.11 See #6421 for more info
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **blink:** enable blink cmdline completions ([011a35c](https://github.com/LazyVim/LazyVim/commit/011a35ccb810cbe5d25def9cc92271e8423feb74))
|
||||||
|
* **blink:** enable cmdline completions ([ff7c12c](https://github.com/LazyVim/LazyVim/commit/ff7c12c48e23941ffd9a7bbe61857624929ae9da))
|
||||||
|
* bump Neovim requirement to 0.11.2 ([cccfe70](https://github.com/LazyVim/LazyVim/commit/cccfe70ea4390c1915f67ab7d2893971fba3f3fa))
|
||||||
|
* **extras:** added an experimental extra for the treesitter `main` branch ([5668ad7](https://github.com/LazyVim/LazyVim/commit/5668ad72ca806b3a7915bb7b35dcc5cccfe774f7))
|
||||||
|
* LazyVim now requires Neovim >= 0.11 See [#6421](https://github.com/LazyVim/LazyVim/issues/6421) for more info ([e7ce65e](https://github.com/LazyVim/LazyVim/commit/e7ce65e1bb814f79ecb45bfeca934e997e0ee42c))
|
||||||
|
* **lsp:** enable LSP folds when available ([5e2c4e6](https://github.com/LazyVim/LazyVim/commit/5e2c4e62f28a85e0b27d5c97ea92af8c1ab74cef))
|
||||||
|
* **treesitter:** migrate to `nvim-treesitter` **main** branch ([5eac460](https://github.com/LazyVim/LazyVim/commit/5eac460c092103e5516bec345236853b9f35ec7c))
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **blink:** make blink completions in cmdline behave more like regular cmdline ([f54fd7f](https://github.com/LazyVim/LazyVim/commit/f54fd7f751e902e824c3a4c9d212a0d18387d0b6))
|
||||||
|
* **catppuccin:** follow renamed integration ([#6354](https://github.com/LazyVim/LazyVim/issues/6354)) ([02d0c9a](https://github.com/LazyVim/LazyVim/commit/02d0c9aebddb902d9c974a38bb44db9bae4eac6d))
|
||||||
|
* **clangd:** file detection improvements ([#6436](https://github.com/LazyVim/LazyVim/issues/6436)) ([aab503f](https://github.com/LazyVim/LazyVim/commit/aab503fda63f34cff6bce229f73ea5209e8afaf0))
|
||||||
|
* **clangd:** rewrite the root_dir function ([#6060](https://github.com/LazyVim/LazyVim/issues/6060)) ([167d39b](https://github.com/LazyVim/LazyVim/commit/167d39b2bef24024be1a48267e14cc6c82146462))
|
||||||
|
* **eslint:** remove old 0.10 code ([919c9e5](https://github.com/LazyVim/LazyVim/commit/919c9e5d091f11b2892c56825249fc4a495d3e8f))
|
||||||
|
* **extras:** disable blink path source in CopilotChat ([#5666](https://github.com/LazyVim/LazyVim/issues/5666)) ([#5754](https://github.com/LazyVim/LazyVim/issues/5754)) ([3aa2916](https://github.com/LazyVim/LazyVim/commit/3aa2916569df2664cb68e1c7c38882868f36f8d0))
|
||||||
|
* **gitsigns:** use silent for gitsigns keymaps ([#5841](https://github.com/LazyVim/LazyVim/issues/5841)) ([6eed178](https://github.com/LazyVim/LazyVim/commit/6eed1781c185ea6d1f313aee60a7097448f473cb))
|
||||||
|
* **grug-far:** add support for GrugFarWithin so it gets loaded by default ([#5772](https://github.com/LazyVim/LazyVim/issues/5772)) ([fd1b02a](https://github.com/LazyVim/LazyVim/commit/fd1b02ae5740dc651cc43291391084dbe7b1b3c4))
|
||||||
|
* **harpoon:** keymaps for 1-9. Fixes [#6319](https://github.com/LazyVim/LazyVim/issues/6319) ([e2ba6bb](https://github.com/LazyVim/LazyVim/commit/e2ba6bb51107cbd076b53b49ed7be99fc2fa3991))
|
||||||
|
* **jdtls:** root_dir ([271fecb](https://github.com/LazyVim/LazyVim/commit/271fecb067ec223a8eab90c1abd1162e9ebae5df))
|
||||||
|
* **jdtls:** root_dir ([#6429](https://github.com/LazyVim/LazyVim/issues/6429)) ([c053921](https://github.com/LazyVim/LazyVim/commit/c05392186e9e540d4af169922c333b5baa583cbe))
|
||||||
|
* **lang.haskell:** prevent Haskell extras from installing telescope.nvim ([#6419](https://github.com/LazyVim/LazyVim/issues/6419)) ([cc4a3e5](https://github.com/LazyVim/LazyVim/commit/cc4a3e556424dba784b41ec3bd92eeb7b62746bc))
|
||||||
|
* **lsp:** buffer should be second arg for supports_method ([44ade7f](https://github.com/LazyVim/LazyVim/commit/44ade7fdea98a0356c64ff9edaf2534547b958bc))
|
||||||
|
* **lspconfig:** remove all references to lspconfig. Closes [#6426](https://github.com/LazyVim/LazyVim/issues/6426) ([23b9cde](https://github.com/LazyVim/LazyVim/commit/23b9cdeb3471b655532e9884fa2dd36ee83062d5))
|
||||||
|
* **lsp:** properly ambiguate denols vs vtsls ([2f75d9a](https://github.com/LazyVim/LazyVim/commit/2f75d9a90fc9cf43f7ba2365dbb745e5595fc02e))
|
||||||
|
* **lsp:** properly register capabilities with new vim.lsp.config. Not needed for blink ([9fa832d](https://github.com/LazyVim/LazyVim/commit/9fa832dc95cb77a5551bbeff12b4520d8b7bdc2a))
|
||||||
|
* **mason:** migrate to mason v2 ([#6053](https://github.com/LazyVim/LazyVim/issues/6053)) ([773f28b](https://github.com/LazyVim/LazyVim/commit/773f28b4912d5505a21da9686d56ab7cf41a9be7))
|
||||||
|
* **mini:** update mini plugin references from echasnovski to nvim-mini ([#6374](https://github.com/LazyVim/LazyVim/issues/6374)) ([ae3aaf2](https://github.com/LazyVim/LazyVim/commit/ae3aaf2dd3a04eb5dbc5b1e34843558c85e45ac2))
|
||||||
|
* **neo-tree:** import neo-tree Extra before edgy Extra ([#5763](https://github.com/LazyVim/LazyVim/issues/5763)) ([848dd31](https://github.com/LazyVim/LazyVim/commit/848dd3132af50f6d211d0c07166ea7c1a4259088))
|
||||||
|
* **ocaml:** use `root_dir` instead of `root_markers` for globs support ([#6428](https://github.com/LazyVim/LazyVim/issues/6428)) ([44cc063](https://github.com/LazyVim/LazyVim/commit/44cc0635bc3d2ccc55eb76bc7668092befcf0536))
|
||||||
|
* **refactoring:** update funcs to return, add `expr=true`, operator mode ([#5882](https://github.com/LazyVim/LazyVim/issues/5882)) ([6e1de74](https://github.com/LazyVim/LazyVim/commit/6e1de74597fa07ea805920da370f9d998740bc5e))
|
||||||
|
* remove 0.9 compat ([3516ae7](https://github.com/LazyVim/LazyVim/commit/3516ae736a333185f6f17b70af20b088d04cbbb6))
|
||||||
|
* **schemastore:** use `before_init` instead of `on_new_config` to load schema store ([#6427](https://github.com/LazyVim/LazyVim/issues/6427)) ([14d2a9b](https://github.com/LazyVim/LazyVim/commit/14d2a9baa1306bd0969112fcf8f69a11840cc5e6))
|
||||||
|
* **treesitter-main:** move exe check to config ([96316e5](https://github.com/LazyVim/LazyVim/commit/96316e5a69b4cc45311f5b7225e7d7bea1f977ee))
|
||||||
|
* **treesitter-main:** set vim.bo.indentexpr in FileType autocmd ([#6430](https://github.com/LazyVim/LazyVim/issues/6430)) ([b926e7d](https://github.com/LazyVim/LazyVim/commit/b926e7db417bc7b0e80feb778bed7924ffe8e85d))
|
||||||
|
* **vue:** `volar` -> `vua_ls`. Fixes [#6236](https://github.com/LazyVim/LazyVim/issues/6236). Closes [#6238](https://github.com/LazyVim/LazyVim/issues/6238). Closes [#6174](https://github.com/LazyVim/LazyVim/issues/6174) ([4a3b4a8](https://github.com/LazyVim/LazyVim/commit/4a3b4a80a89fe5a52d30fbe4afe85c152878ab1b))
|
||||||
|
|
||||||
|
|
||||||
|
### Performance Improvements
|
||||||
|
|
||||||
|
* **blink:** only enable lazydev in lua files ([4961b3d](https://github.com/LazyVim/LazyVim/commit/4961b3d4d4b2999816e978c3ea4ef7c320e4206d))
|
||||||
|
* **treesitter-main:** only enable highlighting for installed treesitter langs ([2f309fc](https://github.com/LazyVim/LazyVim/commit/2f309fc8b5bf93af25293c1e4688d409de718a36))
|
||||||
|
|
||||||
|
## [14.15.1](https://github.com/LazyVim/LazyVim/compare/v14.15.0...v14.15.1) (2025-09-15)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **blink:** use .get method to access presets ([#6183](https://github.com/LazyVim/LazyVim/issues/6183)) ([1a729e2](https://github.com/LazyVim/LazyVim/commit/1a729e2d4c4162501fe13224d669a654849deb36))
|
||||||
|
* **extras.ai.copilot:** update status retrieval for lualine ([#5900](https://github.com/LazyVim/LazyVim/issues/5900)) ([55e9944](https://github.com/LazyVim/LazyVim/commit/55e9944e2b1e152b5acdc9cc015978a905fc2966))
|
||||||
|
* **lang.python:** enable venv-selector even when telescope is not available ([#5829](https://github.com/LazyVim/LazyVim/issues/5829)) ([10e5bf5](https://github.com/LazyVim/LazyVim/commit/10e5bf5c5b5fb4da0afbb2d4d2b75595502c9690))
|
||||||
|
* **lsp:** fixed deprecated warnings ([bed725a](https://github.com/LazyVim/LazyVim/commit/bed725a054ed3e8c8c56dce7e2100335e567cf01))
|
||||||
|
|
||||||
## [14.15.0](https://github.com/LazyVim/LazyVim/compare/v14.14.0...v14.15.0) (2025-05-12)
|
## [14.15.0](https://github.com/LazyVim/LazyVim/compare/v14.14.0...v14.15.0) (2025-05-12)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
27
NEWS.md
27
NEWS.md
|
|
@ -1,5 +1,23 @@
|
||||||
# What's new?
|
# What's new?
|
||||||
|
|
||||||
|
## 15.x
|
||||||
|
|
||||||
|
**Neovim** `>= 0.11.2` includes a lot of changes to the underlying LSP implementation.
|
||||||
|
|
||||||
|
Going forward, **LazyVim** requires **Neovim** `>= 0.11.2`, and drops support for older versions.
|
||||||
|
|
||||||
|
### Changes
|
||||||
|
|
||||||
|
- removed compatibility code for Neovim `< 0.11.2`
|
||||||
|
- configure **LSP** with the native `vim.lsp.config`
|
||||||
|
- migrated **mason.nvim** and **mason-lspconfig.nvim** to `v2.x`
|
||||||
|
- migrated to [nvim-treesitter](https://github.com/nvim-treesitter/nvim-treesitter/tree/main) **main** branch
|
||||||
|
- with the new version, the `tree-sitter` cli is **required** to install parsers
|
||||||
|
- best to run `:checkhealth nvim-treesitter` after updating
|
||||||
|
- replace `nvim-treesitter` incremental selection with `flash.nvim`, since it is no longer supported
|
||||||
|
- enabled [blink.cmp](https://github.com/saghen/blink.cmp) **cmdline** completions
|
||||||
|
- use **LSP** based folding when available (disable with `nvim-lspconfig.folds.enabled = false`)
|
||||||
|
|
||||||
## 14.x
|
## 14.x
|
||||||
|
|
||||||
Big new release with a lot of changes and improvements!
|
Big new release with a lot of changes and improvements!
|
||||||
|
|
@ -110,7 +128,6 @@ vim.g.snacks_animate = false
|
||||||
## 11.x
|
## 11.x
|
||||||
|
|
||||||
- **Keymaps:**
|
- **Keymaps:**
|
||||||
|
|
||||||
- `<leader>gB` to open the current repo in the browser
|
- `<leader>gB` to open the current repo in the browser
|
||||||
- `gco` and `gcO` to add a comment below or above the current line
|
- `gco` and `gcO` to add a comment below or above the current line
|
||||||
- `<leader>wm` to toggle window maximize
|
- `<leader>wm` to toggle window maximize
|
||||||
|
|
@ -123,7 +140,6 @@ vim.g.snacks_animate = false
|
||||||
It's a great plugin that enhances the native text objects.
|
It's a great plugin that enhances the native text objects.
|
||||||
|
|
||||||
- `:LazyExtras` now has multiple new sections:
|
- `:LazyExtras` now has multiple new sections:
|
||||||
|
|
||||||
- **Enabled**: extras that are currently enabled
|
- **Enabled**: extras that are currently enabled
|
||||||
- **Recommended Languages**: language extras recommended for the current buffer / directory
|
- **Recommended Languages**: language extras recommended for the current buffer / directory
|
||||||
- **Recommended Plugins**: extras that are recommended for most users
|
- **Recommended Plugins**: extras that are recommended for most users
|
||||||
|
|
@ -161,7 +177,6 @@ Additionally, some core plugins have been moved to extras.
|
||||||
```
|
```
|
||||||
|
|
||||||
- plugins moved to extras:
|
- plugins moved to extras:
|
||||||
|
|
||||||
- `mini.surround`
|
- `mini.surround`
|
||||||
- `mini.indentscope` scopes are now also highlighted with `indent-blankline`
|
- `mini.indentscope` scopes are now also highlighted with `indent-blankline`
|
||||||
- `nvim-treesitter-context`
|
- `nvim-treesitter-context`
|
||||||
|
|
@ -179,7 +194,6 @@ Additionally, some core plugins have been moved to extras.
|
||||||
You can find the updated docs [here](https://github.com/folke/trouble.nvim/tree/dev)
|
You can find the updated docs [here](https://github.com/folke/trouble.nvim/tree/dev)
|
||||||
|
|
||||||
- The **lazygit** integration now configures:
|
- The **lazygit** integration now configures:
|
||||||
|
|
||||||
- the theme based on the colorscheme
|
- the theme based on the colorscheme
|
||||||
- nerd font icons (v3)
|
- nerd font icons (v3)
|
||||||
- editor preset is set to `nvim-remote` for better interop with Neovim
|
- editor preset is set to `nvim-remote` for better interop with Neovim
|
||||||
|
|
@ -220,9 +234,7 @@ Additionally, some core plugins have been moved to extras.
|
||||||
- New `:LazyExtras` command for managing **LazyVim** extras
|
- New `:LazyExtras` command for managing **LazyVim** extras
|
||||||
|
|
||||||
- Improved **formatting**:
|
- Improved **formatting**:
|
||||||
|
|
||||||
- **LazyVim** can now work with multiple formatters. Types:
|
- **LazyVim** can now work with multiple formatters. Types:
|
||||||
|
|
||||||
- **primary**: only one primary formatter can be active at a time.
|
- **primary**: only one primary formatter can be active at a time.
|
||||||
_(conform, none-ls, LSP)_
|
_(conform, none-ls, LSP)_
|
||||||
- **secondary**: multiple secondary formatters can be active _(eslint, ...)_
|
- **secondary**: multiple secondary formatters can be active _(eslint, ...)_
|
||||||
|
|
@ -241,18 +253,15 @@ Additionally, some core plugins have been moved to extras.
|
||||||
```
|
```
|
||||||
|
|
||||||
- `none-ls.nvim` is no longer installed by default
|
- `none-ls.nvim` is no longer installed by default
|
||||||
|
|
||||||
- `conform.nvim` is now the default formatter
|
- `conform.nvim` is now the default formatter
|
||||||
- `nvim-lint` is now the default linter
|
- `nvim-lint` is now the default linter
|
||||||
- If you want to keep using `none-ls.nvim`,
|
- If you want to keep using `none-ls.nvim`,
|
||||||
you can enable the **lsp.none-ls** extra
|
you can enable the **lsp.none-ls** extra
|
||||||
|
|
||||||
- `dashboard.nvim` is the new default dashboard plugin
|
- `dashboard.nvim` is the new default dashboard plugin
|
||||||
|
|
||||||
- If you want to keep using `alpha.nvim`, you can enable the **ui.alpha** extra
|
- If you want to keep using `alpha.nvim`, you can enable the **ui.alpha** extra
|
||||||
|
|
||||||
- Improved **root detection**:
|
- Improved **root detection**:
|
||||||
|
|
||||||
- New `:LazyRoot` command that shows info about the root dir detection
|
- New `:LazyRoot` command that shows info about the root dir detection
|
||||||
- Configurable with `vim.g.root_spec`
|
- Configurable with `vim.g.root_spec`
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,7 @@ LazyVim 是一个基于 [💤 lazy.nvim](https://github.com/folke/lazy.nvim) 的
|
||||||
|
|
||||||
## ⚡️ 环境要求
|
## ⚡️ 环境要求
|
||||||
|
|
||||||
- Neovim >= **0.9.0** (需要用 **LuaJIT** 构建)
|
- Neovim >= **0.11.2** (需要用 **LuaJIT** 构建)
|
||||||
- Git >= **2.19.0** (用于部分克隆支持)
|
- Git >= **2.19.0** (用于部分克隆支持)
|
||||||
- 一个 [Nerd Font](https://www.nerdfonts.com/) 字体 **_(可选)_**
|
- 一个 [Nerd Font](https://www.nerdfonts.com/) 字体 **_(可选)_**
|
||||||
- 一个用于 `nvim-treesitter` 的 **C** 编译器。看 [这里](https://github.com/nvim-treesitter/nvim-treesitter#requirements)
|
- 一个用于 `nvim-treesitter` 的 **C** 编译器。看 [这里](https://github.com/nvim-treesitter/nvim-treesitter#requirements)
|
||||||
|
|
|
||||||
|
|
@ -56,7 +56,7 @@ und die Einfachheit von einem vorgefertigten Setup.
|
||||||
|
|
||||||
## ⚡️ Vorraussetzungen
|
## ⚡️ Vorraussetzungen
|
||||||
|
|
||||||
- Neovim >= **0.8.0** (gebraucht um mit **LuaJIT** zu bauen)
|
- Neovim >= **0.11.2** (gebraucht um mit **LuaJIT** zu bauen)
|
||||||
- Git >= **2.19.0** (um Teil-Klone zu unterstützen)
|
- Git >= **2.19.0** (um Teil-Klone zu unterstützen)
|
||||||
- eine [Nerd Font](https://www.nerdfonts.com/) **_(optional)_**
|
- eine [Nerd Font](https://www.nerdfonts.com/) **_(optional)_**
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,7 @@ LazyVim es una configuración de Neovim impulsada por [💤 lazy.nvim](https://g
|
||||||
|
|
||||||
## ⚡️ Requisitos
|
## ⚡️ Requisitos
|
||||||
|
|
||||||
- Neovim >= **0.9.0** (debe ser compilado con **LuaJIT**)
|
- Neovim >= **0.11.2** (debe ser compilado con **LuaJIT**)
|
||||||
- Git >= **2.19.0** (para soporte de clones parciales)
|
- Git >= **2.19.0** (para soporte de clones parciales)
|
||||||
- una [Fuente Nerd](https://www.nerdfonts.com/) **_(opcional)_**
|
- una [Fuente Nerd](https://www.nerdfonts.com/) **_(opcional)_**
|
||||||
- un compilador **C** para `nvim-treesitter`. Consulta [aquí](https://github.com/nvim-treesitter/nvim-treesitter#requirements)
|
- un compilador **C** para `nvim-treesitter`. Consulta [aquí](https://github.com/nvim-treesitter/nvim-treesitter#requirements)
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,7 @@ insieme alla comodità di un setup preconfigurato.
|
||||||
|
|
||||||
## ⚡️ Requisiti
|
## ⚡️ Requisiti
|
||||||
|
|
||||||
- Neovim >= **0.9.0** (deve essere compilato con **LuaJIT**)
|
- Neovim >= **0.11.2** (deve essere compilato con **LuaJIT**)
|
||||||
- Git >= **2.19.0** (per supportare cloni parziali)
|
- Git >= **2.19.0** (per supportare cloni parziali)
|
||||||
- a [Nerd Font](https://www.nerdfonts.com/) **_(opzionale)_**
|
- a [Nerd Font](https://www.nerdfonts.com/) **_(opzionale)_**
|
||||||
- un compilatore **C** per `nvim-treesitter`. Leggi [qui](https://github.com/nvim-treesitter/nvim-treesitter#requirements)
|
- un compilatore **C** per `nvim-treesitter`. Leggi [qui](https://github.com/nvim-treesitter/nvim-treesitter#requirements)
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,7 @@ LazyVimは、ゼロから始めるか、あらかじめ作成されたディス
|
||||||
|
|
||||||
## ⚡️ 必要要件
|
## ⚡️ 必要要件
|
||||||
|
|
||||||
- Neovim >= **0.9.0** (**LuaJIT**でビルドされている必要があります)
|
- Neovim >= **0.11.2** (**LuaJIT**でビルドされている必要があります)
|
||||||
- Git >= **2.19.0** (部分的なcloneサポートのため)
|
- Git >= **2.19.0** (部分的なcloneサポートのため)
|
||||||
- [Nerd Font](https://www.nerdfonts.com/) **_(任意)_**
|
- [Nerd Font](https://www.nerdfonts.com/) **_(任意)_**
|
||||||
- `nvim-treesitter`用の**C**コンパイラ。詳細は[こちら](https://github.com/nvim-treesitter/nvim-treesitter#requirements)
|
- `nvim-treesitter`用の**C**コンパイラ。詳細は[こちら](https://github.com/nvim-treesitter/nvim-treesitter#requirements)
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,7 @@ LazyVim은 [💤 lazy.nvim](https://github.com/folke/lazy.nvim)를 기반으로
|
||||||
|
|
||||||
## ⚡️ 요구사항
|
## ⚡️ 요구사항
|
||||||
|
|
||||||
- **0.9.0**이상의 Neovim (LuaJIT과 함께 개발이 되어져있어야함니다.)
|
- **0.11.2**이상의 Neovim (LuaJIT과 함께 개발이 되어져있어야함니다.)
|
||||||
- **2.19.0**이상의 Git (이것은 부분적인 클론기능을 지원하기 위함입니다.)
|
- **2.19.0**이상의 Git (이것은 부분적인 클론기능을 지원하기 위함입니다.)
|
||||||
- [Nerd Font](https://www.nerdfonts.com/) **_(옵션)_**
|
- [Nerd Font](https://www.nerdfonts.com/) **_(옵션)_**
|
||||||
- `nvim-treesitter`를 위한 **C** 컴파일러. [이 문서](https://github.com/nvim-treesitter/nvim-treesitter#requirements)를 확인해주시기바랍니다.
|
- `nvim-treesitter`를 위한 **C** 컴파일러. [이 문서](https://github.com/nvim-treesitter/nvim-treesitter#requirements)를 확인해주시기바랍니다.
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,7 @@ como necessário, junto com a conveniência de um setup pré-configurado.
|
||||||
|
|
||||||
## ⚡️ Requesitos
|
## ⚡️ Requesitos
|
||||||
|
|
||||||
- Neovim >= **0.9.0** (preciso fazer build com **LuaJIT**)
|
- Neovim >= **0.11.2** (preciso fazer build com **LuaJIT**)
|
||||||
- Git >= **2.19.0** (para suporte parcial de clones)
|
- Git >= **2.19.0** (para suporte parcial de clones)
|
||||||
- uma [Nerd Font](https://www.nerdfonts.com/) **_(opcional)_**
|
- uma [Nerd Font](https://www.nerdfonts.com/) **_(opcional)_**
|
||||||
- um compilador de **C** para `nvim-treesitter`. Mais informações [aqui](https://github.com/nvim-treesitter/nvim-treesitter#requirements)
|
- um compilador de **C** para `nvim-treesitter`. Mais informações [aqui](https://github.com/nvim-treesitter/nvim-treesitter#requirements)
|
||||||
|
|
|
||||||
|
|
@ -56,7 +56,7 @@ to tweak your config as needed, along with the convenience of a pre-configured s
|
||||||
|
|
||||||
## ⚡️ Requirements
|
## ⚡️ Requirements
|
||||||
|
|
||||||
- Neovim >= **0.9.0** (needs to be built with **LuaJIT**)
|
- Neovim >= **0.11.2** (needs to be built with **LuaJIT**)
|
||||||
- Git >= **2.19.0** (for partial clones support)
|
- Git >= **2.19.0** (for partial clones support)
|
||||||
- a [Nerd Font](https://www.nerdfonts.com/) **_(optional)_**
|
- a [Nerd Font](https://www.nerdfonts.com/) **_(optional)_**
|
||||||
- a **C** compiler for `nvim-treesitter`. See [here](https://github.com/nvim-treesitter/nvim-treesitter#requirements)
|
- a **C** compiler for `nvim-treesitter`. See [here](https://github.com/nvim-treesitter/nvim-treesitter#requirements)
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
*LazyVim.txt* For Neovim Last change: 2025 May 12
|
*LazyVim.txt* For Neovim Last change: 2025 October 20
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
Table of Contents *LazyVim-table-of-contents*
|
Table of Contents *LazyVim-table-of-contents*
|
||||||
|
|
@ -53,7 +53,7 @@ FEATURES *LazyVim-features*
|
||||||
|
|
||||||
REQUIREMENTS *LazyVim-requirements*
|
REQUIREMENTS *LazyVim-requirements*
|
||||||
|
|
||||||
- Neovim >= **0.9.0** (needs to be built with **LuaJIT**)
|
- Neovim >= **0.11.2** (needs to be built with **LuaJIT**)
|
||||||
- Git >= **2.19.0** (for partial clones support)
|
- Git >= **2.19.0** (for partial clones support)
|
||||||
- a Nerd Font <https://www.nerdfonts.com/> **(optional)**
|
- a Nerd Font <https://www.nerdfonts.com/> **(optional)**
|
||||||
- a **C** compiler for `nvim-treesitter`. See here <https://github.com/nvim-treesitter/nvim-treesitter#requirements>
|
- a **C** compiler for `nvim-treesitter`. See here <https://github.com/nvim-treesitter/nvim-treesitter#requirements>
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ _G.LazyVim = require("lazyvim.util")
|
||||||
---@class LazyVimConfig: LazyVimOptions
|
---@class LazyVimConfig: LazyVimOptions
|
||||||
local M = {}
|
local M = {}
|
||||||
|
|
||||||
M.version = "14.15.0" -- x-release-please-version
|
M.version = "15.9.0" -- x-release-please-version
|
||||||
LazyVim.config = M
|
LazyVim.config = M
|
||||||
|
|
||||||
---@class LazyVimOptions
|
---@class LazyVimOptions
|
||||||
|
|
@ -304,6 +304,8 @@ function M.load(name)
|
||||||
end
|
end
|
||||||
|
|
||||||
M.did_init = false
|
M.did_init = false
|
||||||
|
M._options = {} ---@type vim.wo|vim.bo
|
||||||
|
|
||||||
function M.init()
|
function M.init()
|
||||||
if M.did_init then
|
if M.did_init then
|
||||||
return
|
return
|
||||||
|
|
@ -326,8 +328,14 @@ function M.init()
|
||||||
-- this is needed to make sure options will be correctly applied
|
-- this is needed to make sure options will be correctly applied
|
||||||
-- after installing missing plugins
|
-- after installing missing plugins
|
||||||
M.load("options")
|
M.load("options")
|
||||||
|
|
||||||
|
-- save some options to track defaults
|
||||||
|
M._options.indentexpr = vim.o.indentexpr
|
||||||
|
M._options.foldmethod = vim.o.foldmethod
|
||||||
|
M._options.foldexpr = vim.o.foldexpr
|
||||||
|
|
||||||
-- defer built-in clipboard handling: "xsel" and "pbcopy" can be slow
|
-- defer built-in clipboard handling: "xsel" and "pbcopy" can be slow
|
||||||
lazy_clipboard = vim.opt.clipboard
|
lazy_clipboard = vim.opt.clipboard:get()
|
||||||
vim.opt.clipboard = ""
|
vim.opt.clipboard = ""
|
||||||
|
|
||||||
if vim.g.deprecation_warnings == false then
|
if vim.g.deprecation_warnings == false then
|
||||||
|
|
@ -353,7 +361,7 @@ function M.get_defaults()
|
||||||
{ name = "telescope", extra = "editor.telescope" },
|
{ name = "telescope", extra = "editor.telescope" },
|
||||||
},
|
},
|
||||||
cmp = {
|
cmp = {
|
||||||
{ name = "blink.cmp", extra = "coding.blink", enabled = vim.fn.has("nvim-0.10") == 1 },
|
{ name = "blink.cmp", extra = "coding.blink" },
|
||||||
{ name = "nvim-cmp", extra = "coding.nvim-cmp" },
|
{ name = "nvim-cmp", extra = "coding.nvim-cmp" },
|
||||||
},
|
},
|
||||||
explorer = {
|
explorer = {
|
||||||
|
|
|
||||||
|
|
@ -120,10 +120,12 @@ end, { desc = "Format" })
|
||||||
|
|
||||||
-- diagnostic
|
-- diagnostic
|
||||||
local diagnostic_goto = function(next, severity)
|
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()
|
return function()
|
||||||
go({ severity = severity })
|
vim.diagnostic.jump({
|
||||||
|
count = (next and 1 or -1) * vim.v.count1,
|
||||||
|
severity = severity and vim.diagnostic.severity[severity] or nil,
|
||||||
|
float = true,
|
||||||
|
})
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
map("n", "<leader>cd", vim.diagnostic.open_float, { desc = "Line Diagnostics" })
|
map("n", "<leader>cd", vim.diagnostic.open_float, { desc = "Line Diagnostics" })
|
||||||
|
|
@ -163,12 +165,12 @@ end
|
||||||
if vim.fn.executable("lazygit") == 1 then
|
if vim.fn.executable("lazygit") == 1 then
|
||||||
map("n", "<leader>gg", function() Snacks.lazygit( { cwd = LazyVim.root.git() }) end, { desc = "Lazygit (Root Dir)" })
|
map("n", "<leader>gg", function() Snacks.lazygit( { cwd = LazyVim.root.git() }) end, { desc = "Lazygit (Root Dir)" })
|
||||||
map("n", "<leader>gG", function() Snacks.lazygit() end, { desc = "Lazygit (cwd)" })
|
map("n", "<leader>gG", function() Snacks.lazygit() end, { desc = "Lazygit (cwd)" })
|
||||||
map("n", "<leader>gf", function() Snacks.picker.git_log_file() end, { desc = "Git Current File History" })
|
|
||||||
map("n", "<leader>gl", function() Snacks.picker.git_log({ cwd = LazyVim.root.git() }) end, { desc = "Git Log" })
|
|
||||||
map("n", "<leader>gL", function() Snacks.picker.git_log() end, { desc = "Git Log (cwd)" })
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
map("n", "<leader>gL", function() Snacks.picker.git_log() end, { desc = "Git Log (cwd)" })
|
||||||
map("n", "<leader>gb", function() Snacks.picker.git_log_line() end, { desc = "Git Blame Line" })
|
map("n", "<leader>gb", function() Snacks.picker.git_log_line() end, { desc = "Git Blame Line" })
|
||||||
|
map("n", "<leader>gf", function() Snacks.picker.git_log_file() end, { desc = "Git Current File History" })
|
||||||
|
map("n", "<leader>gl", function() Snacks.picker.git_log({ cwd = LazyVim.root.git() }) end, { desc = "Git Log" })
|
||||||
map({ "n", "x" }, "<leader>gB", function() Snacks.gitbrowse() end, { desc = "Git Browse (open)" })
|
map({ "n", "x" }, "<leader>gB", function() Snacks.gitbrowse() end, { desc = "Git Browse (open)" })
|
||||||
map({"n", "x" }, "<leader>gY", function()
|
map({"n", "x" }, "<leader>gY", function()
|
||||||
Snacks.gitbrowse({ open = function(url) vim.fn.setreg("+", url) end, notify = false })
|
Snacks.gitbrowse({ open = function(url) vim.fn.setreg("+", url) end, notify = false })
|
||||||
|
|
@ -187,12 +189,8 @@ map("n", "<leader>L", function() LazyVim.news.changelog() end, { desc = "LazyVim
|
||||||
-- floating terminal
|
-- floating terminal
|
||||||
map("n", "<leader>fT", function() Snacks.terminal() end, { desc = "Terminal (cwd)" })
|
map("n", "<leader>fT", function() Snacks.terminal() end, { desc = "Terminal (cwd)" })
|
||||||
map("n", "<leader>ft", function() Snacks.terminal(nil, { cwd = LazyVim.root() }) end, { desc = "Terminal (Root Dir)" })
|
map("n", "<leader>ft", function() Snacks.terminal(nil, { cwd = LazyVim.root() }) end, { desc = "Terminal (Root Dir)" })
|
||||||
map("n", "<c-/>", function() Snacks.terminal(nil, { cwd = LazyVim.root() }) end, { desc = "Terminal (Root Dir)" })
|
map({"n","t"}, "<c-/>",function() Snacks.terminal(nil, { cwd = LazyVim.root() }) end, { desc = "Terminal (Root Dir)" })
|
||||||
map("n", "<c-_>", function() Snacks.terminal(nil, { cwd = LazyVim.root() }) end, { desc = "which_key_ignore" })
|
map({"n","t"}, "<c-_>",function() Snacks.terminal(nil, { cwd = LazyVim.root() }) end, { desc = "which_key_ignore" })
|
||||||
|
|
||||||
-- Terminal Mappings
|
|
||||||
map("t", "<C-/>", "<cmd>close<cr>", { desc = "Hide Terminal" })
|
|
||||||
map("t", "<c-_>", "<cmd>close<cr>", { desc = "which_key_ignore" })
|
|
||||||
|
|
||||||
-- windows
|
-- windows
|
||||||
map("n", "<leader>-", "<C-W>s", { desc = "Split Window Below", remap = true })
|
map("n", "<leader>-", "<C-W>s", { desc = "Split Window Below", remap = true })
|
||||||
|
|
@ -209,13 +207,3 @@ map("n", "<leader><tab><tab>", "<cmd>tabnew<cr>", { desc = "New Tab" })
|
||||||
map("n", "<leader><tab>]", "<cmd>tabnext<cr>", { desc = "Next Tab" })
|
map("n", "<leader><tab>]", "<cmd>tabnext<cr>", { desc = "Next Tab" })
|
||||||
map("n", "<leader><tab>d", "<cmd>tabclose<cr>", { desc = "Close Tab" })
|
map("n", "<leader><tab>d", "<cmd>tabclose<cr>", { desc = "Close Tab" })
|
||||||
map("n", "<leader><tab>[", "<cmd>tabprevious<cr>", { desc = "Previous Tab" })
|
map("n", "<leader><tab>[", "<cmd>tabprevious<cr>", { desc = "Previous Tab" })
|
||||||
|
|
||||||
-- native snippets. only needed on < 0.11, as 0.11 creates these by default
|
|
||||||
if vim.fn.has("nvim-0.11") == 0 then
|
|
||||||
map("s", "<Tab>", function()
|
|
||||||
return vim.snippet.active({ direction = 1 }) and "<cmd>lua vim.snippet.jump(1)<cr>" or "<Tab>"
|
|
||||||
end, { expr = true, desc = "Jump Next" })
|
|
||||||
map({ "i", "s" }, "<S-Tab>", function()
|
|
||||||
return vim.snippet.active({ direction = -1 }) and "<cmd>lua vim.snippet.jump(-1)<cr>" or "<S-Tab>"
|
|
||||||
end, { expr = true, desc = "Jump Previous" })
|
|
||||||
end
|
|
||||||
|
|
|
||||||
|
|
@ -53,7 +53,7 @@ local opt = vim.opt
|
||||||
|
|
||||||
opt.autowrite = true -- Enable auto write
|
opt.autowrite = true -- Enable auto write
|
||||||
-- only set clipboard if not in ssh, to make sure the OSC 52
|
-- only set clipboard if not in ssh, to make sure the OSC 52
|
||||||
-- integration works automatically. Requires Neovim >= 0.10.0
|
-- integration works automatically.
|
||||||
opt.clipboard = vim.env.SSH_TTY and "" or "unnamedplus" -- Sync with system clipboard
|
opt.clipboard = vim.env.SSH_TTY and "" or "unnamedplus" -- Sync with system clipboard
|
||||||
opt.completeopt = "menu,menuone,noselect"
|
opt.completeopt = "menu,menuone,noselect"
|
||||||
opt.conceallevel = 2 -- Hide * markup for bold and italic, but not markers with substitutions
|
opt.conceallevel = 2 -- Hide * markup for bold and italic, but not markers with substitutions
|
||||||
|
|
@ -69,7 +69,9 @@ opt.fillchars = {
|
||||||
eob = " ",
|
eob = " ",
|
||||||
}
|
}
|
||||||
opt.foldlevel = 99
|
opt.foldlevel = 99
|
||||||
opt.formatexpr = "v:lua.require'lazyvim.util'.format.formatexpr()"
|
opt.foldmethod = "indent"
|
||||||
|
opt.foldtext = ""
|
||||||
|
opt.formatexpr = "v:lua.LazyVim.format.formatexpr()"
|
||||||
opt.formatoptions = "jcroqlnt" -- tcqj
|
opt.formatoptions = "jcroqlnt" -- tcqj
|
||||||
opt.grepformat = "%f:%l:%c:%m"
|
opt.grepformat = "%f:%l:%c:%m"
|
||||||
opt.grepprg = "rg --vimgrep"
|
opt.grepprg = "rg --vimgrep"
|
||||||
|
|
@ -95,11 +97,12 @@ opt.sidescrolloff = 8 -- Columns of context
|
||||||
opt.signcolumn = "yes" -- Always show the signcolumn, otherwise it would shift the text each time
|
opt.signcolumn = "yes" -- Always show the signcolumn, otherwise it would shift the text each time
|
||||||
opt.smartcase = true -- Don't ignore case with capitals
|
opt.smartcase = true -- Don't ignore case with capitals
|
||||||
opt.smartindent = true -- Insert indents automatically
|
opt.smartindent = true -- Insert indents automatically
|
||||||
|
opt.smoothscroll = true
|
||||||
opt.spelllang = { "en" }
|
opt.spelllang = { "en" }
|
||||||
opt.splitbelow = true -- Put new windows below current
|
opt.splitbelow = true -- Put new windows below current
|
||||||
opt.splitkeep = "screen"
|
opt.splitkeep = "screen"
|
||||||
opt.splitright = true -- Put new windows right of current
|
opt.splitright = true -- Put new windows right of current
|
||||||
opt.statuscolumn = [[%!v:lua.require'snacks.statuscolumn'.get()]]
|
opt.statuscolumn = [[%!v:lua.LazyVim.statuscolumn()]]
|
||||||
opt.tabstop = 2 -- Number of spaces tabs count for
|
opt.tabstop = 2 -- Number of spaces tabs count for
|
||||||
opt.termguicolors = true -- True color support
|
opt.termguicolors = true -- True color support
|
||||||
opt.timeoutlen = vim.g.vscode and 1000 or 300 -- Lower than default (1000) to quickly trigger which-key
|
opt.timeoutlen = vim.g.vscode and 1000 or 300 -- Lower than default (1000) to quickly trigger which-key
|
||||||
|
|
@ -111,15 +114,5 @@ opt.wildmode = "longest:full,full" -- Command-line completion mode
|
||||||
opt.winminwidth = 5 -- Minimum window width
|
opt.winminwidth = 5 -- Minimum window width
|
||||||
opt.wrap = false -- Disable line wrap
|
opt.wrap = false -- Disable line wrap
|
||||||
|
|
||||||
if vim.fn.has("nvim-0.10") == 1 then
|
|
||||||
opt.smoothscroll = true
|
|
||||||
opt.foldexpr = "v:lua.require'lazyvim.util'.ui.foldexpr()"
|
|
||||||
opt.foldmethod = "expr"
|
|
||||||
opt.foldtext = ""
|
|
||||||
else
|
|
||||||
opt.foldmethod = "indent"
|
|
||||||
opt.foldtext = "v:lua.require'lazyvim.util'.ui.foldtext()"
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Fix markdown indentation settings
|
-- Fix markdown indentation settings
|
||||||
vim.g.markdown_recommended_style = 0
|
vim.g.markdown_recommended_style = 0
|
||||||
|
|
|
||||||
|
|
@ -4,17 +4,15 @@ local start = vim.health.start or vim.health.report_start
|
||||||
local ok = vim.health.ok or vim.health.report_ok
|
local ok = vim.health.ok or vim.health.report_ok
|
||||||
local warn = vim.health.warn or vim.health.report_warn
|
local warn = vim.health.warn or vim.health.report_warn
|
||||||
local error = vim.health.error or vim.health.report_error
|
local error = vim.health.error or vim.health.report_error
|
||||||
|
local info = vim.health.info or vim.health.report_info
|
||||||
|
|
||||||
function M.check()
|
function M.check()
|
||||||
start("LazyVim")
|
start("LazyVim")
|
||||||
|
|
||||||
if vim.fn.has("nvim-0.9.0") == 1 then
|
if vim.fn.has("nvim-0.11.2") == 1 then
|
||||||
ok("Using Neovim >= 0.9.0")
|
ok("Using Neovim >= 0.11.2")
|
||||||
if vim.fn.has("nvim-0.10.0") == 0 then
|
|
||||||
warn("Use Neovim >= 0.10.0 for the best experience")
|
|
||||||
end
|
|
||||||
else
|
else
|
||||||
error("Neovim >= 0.9.0 is required")
|
error("Neovim >= 0.11.2 is required")
|
||||||
end
|
end
|
||||||
|
|
||||||
for _, cmd in ipairs({ "git", "rg", { "fd", "fdfind" }, "lazygit", "fzf", "curl" }) do
|
for _, cmd in ipairs({ "git", "rg", { "fd", "fdfind" }, "lazygit", "fzf", "curl" }) do
|
||||||
|
|
@ -36,6 +34,23 @@ function M.check()
|
||||||
warn(("`%s` is not installed"):format(name))
|
warn(("`%s` is not installed"):format(name))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
start("LazyVim nvim-treesitter")
|
||||||
|
local tsok, health = LazyVim.treesitter.check()
|
||||||
|
local keys = vim.tbl_keys(health) ---@type string[]
|
||||||
|
table.sort(keys)
|
||||||
|
for _, k in pairs(keys) do
|
||||||
|
(health[k] and ok or error)(("`%s` is %s"):format(k, health[k] and "installed" or "not installed"))
|
||||||
|
end
|
||||||
|
if not tsok then
|
||||||
|
info(
|
||||||
|
"See the requirements at [nvim-treesitter](https://github.com/nvim-treesitter/nvim-treesitter/tree/main?tab=readme-ov-file#requirements)"
|
||||||
|
)
|
||||||
|
info("Run `:checkhealth nvim-treesitter` for more information.")
|
||||||
|
if vim.fn.has("win32") == 1 and not health["C compiler"] then
|
||||||
|
info("Install a C compiler with `winget install --id=BrechtSanders.WinLibs.POSIX.UCRT -e`")
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,9 @@
|
||||||
return {
|
return {
|
||||||
-- auto pairs
|
-- Auto pairs
|
||||||
|
-- Automatically inserts a matching closing character
|
||||||
|
-- when you type an opening character like `"`, `[`, or `(`.
|
||||||
{
|
{
|
||||||
"echasnovski/mini.pairs",
|
"nvim-mini/mini.pairs",
|
||||||
event = "VeryLazy",
|
event = "VeryLazy",
|
||||||
opts = {
|
opts = {
|
||||||
modes = { insert = true, command = true, terminal = false },
|
modes = { insert = true, command = true, terminal = false },
|
||||||
|
|
@ -20,16 +22,20 @@ return {
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
||||||
-- comments
|
-- Improves comment syntax, lets Neovim handle multiple
|
||||||
|
-- types of comments for a single language, and relaxes rules
|
||||||
|
-- for uncommenting.
|
||||||
{
|
{
|
||||||
"folke/ts-comments.nvim",
|
"folke/ts-comments.nvim",
|
||||||
event = "VeryLazy",
|
event = "VeryLazy",
|
||||||
opts = {},
|
opts = {},
|
||||||
},
|
},
|
||||||
|
|
||||||
-- Better text-objects
|
-- Extends the a & i text objects, this adds the ability to select
|
||||||
|
-- arguments, function calls, text within quotes and brackets, and to
|
||||||
|
-- repeat those selections to select an outer text object.
|
||||||
{
|
{
|
||||||
"echasnovski/mini.ai",
|
"nvim-mini/mini.ai",
|
||||||
event = "VeryLazy",
|
event = "VeryLazy",
|
||||||
opts = function()
|
opts = function()
|
||||||
local ai = require("mini.ai")
|
local ai = require("mini.ai")
|
||||||
|
|
@ -64,6 +70,8 @@ return {
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
-- Configures LuaLS to support auto-completion and type checking
|
||||||
|
-- while editing your Neovim configuration.
|
||||||
{
|
{
|
||||||
"folke/lazydev.nvim",
|
"folke/lazydev.nvim",
|
||||||
ft = "lua",
|
ft = "lua",
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,14 @@ return {
|
||||||
lazy = true,
|
lazy = true,
|
||||||
name = "catppuccin",
|
name = "catppuccin",
|
||||||
opts = {
|
opts = {
|
||||||
|
lsp_styles = {
|
||||||
|
underlines = {
|
||||||
|
errors = { "undercurl" },
|
||||||
|
hints = { "undercurl" },
|
||||||
|
warnings = { "undercurl" },
|
||||||
|
information = { "undercurl" },
|
||||||
|
},
|
||||||
|
},
|
||||||
integrations = {
|
integrations = {
|
||||||
aerial = true,
|
aerial = true,
|
||||||
alpha = true,
|
alpha = true,
|
||||||
|
|
@ -28,26 +36,14 @@ return {
|
||||||
leap = true,
|
leap = true,
|
||||||
lsp_trouble = true,
|
lsp_trouble = true,
|
||||||
mason = true,
|
mason = true,
|
||||||
markdown = true,
|
|
||||||
mini = true,
|
mini = true,
|
||||||
native_lsp = {
|
|
||||||
enabled = true,
|
|
||||||
underlines = {
|
|
||||||
errors = { "undercurl" },
|
|
||||||
hints = { "undercurl" },
|
|
||||||
warnings = { "undercurl" },
|
|
||||||
information = { "undercurl" },
|
|
||||||
},
|
|
||||||
},
|
|
||||||
navic = { enabled = true, custom_bg = "lualine" },
|
navic = { enabled = true, custom_bg = "lualine" },
|
||||||
neotest = true,
|
neotest = true,
|
||||||
neotree = true,
|
neotree = true,
|
||||||
noice = true,
|
noice = true,
|
||||||
notify = true,
|
notify = true,
|
||||||
semantic_tokens = true,
|
|
||||||
snacks = true,
|
snacks = true,
|
||||||
telescope = true,
|
telescope = true,
|
||||||
treesitter = true,
|
|
||||||
treesitter_context = true,
|
treesitter_context = true,
|
||||||
which_key = true,
|
which_key = true,
|
||||||
},
|
},
|
||||||
|
|
@ -58,7 +54,7 @@ return {
|
||||||
optional = true,
|
optional = true,
|
||||||
opts = function(_, opts)
|
opts = function(_, opts)
|
||||||
if (vim.g.colors_name or ""):find("catppuccin") then
|
if (vim.g.colors_name or ""):find("catppuccin") then
|
||||||
opts.highlights = require("catppuccin.groups.integrations.bufferline").get()
|
opts.highlights = require("catppuccin.special.bufferline").get_theme()
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -1,41 +0,0 @@
|
||||||
-- Compatibility with Neovim 0.9
|
|
||||||
return {
|
|
||||||
-- Use LuaSnip instead of native snippets
|
|
||||||
{ "garymjr/nvim-snippets", enabled = false },
|
|
||||||
{ import = "lazyvim.plugins.extras.coding.luasnip" },
|
|
||||||
|
|
||||||
-- Use nvim-cmp instead of blink.cmp
|
|
||||||
{ import = "lazyvim.plugins.extras.coding.nvim-cmp" },
|
|
||||||
|
|
||||||
-- Use mini.comment instead of ts-comments
|
|
||||||
{ "folke/ts-comments.nvim", enabled = false },
|
|
||||||
{ import = "lazyvim.plugins.extras.coding.mini-comment" },
|
|
||||||
|
|
||||||
-- Use neodev-types with lazydev
|
|
||||||
{ "folke/neodev.nvim", config = function() end },
|
|
||||||
{
|
|
||||||
"folke/lazydev.nvim",
|
|
||||||
opts = function(_, opts)
|
|
||||||
opts.library = opts.library or {}
|
|
||||||
table.insert(opts.library, { "neodev.nvim/types/stable" })
|
|
||||||
end,
|
|
||||||
config = function(_, opts)
|
|
||||||
-- force lazydev to load on Neovim 0.9
|
|
||||||
require("lazydev.config").have_0_10 = true
|
|
||||||
require("lazydev").setup(opts)
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"neovim/nvim-lspconfig",
|
|
||||||
dependencies = {},
|
|
||||||
},
|
|
||||||
|
|
||||||
-- dummy import to save core imports
|
|
||||||
{
|
|
||||||
import = "foobar",
|
|
||||||
enabled = function()
|
|
||||||
LazyVim.plugin.save_core()
|
|
||||||
return false
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
@ -4,7 +4,7 @@ return {
|
||||||
{
|
{
|
||||||
"MagicDuck/grug-far.nvim",
|
"MagicDuck/grug-far.nvim",
|
||||||
opts = { headerMaxWidth = 80 },
|
opts = { headerMaxWidth = 80 },
|
||||||
cmd = "GrugFar",
|
cmd = { "GrugFar", "GrugFarWithin" },
|
||||||
keys = {
|
keys = {
|
||||||
{
|
{
|
||||||
"<leader>sr",
|
"<leader>sr",
|
||||||
|
|
@ -40,6 +40,16 @@ return {
|
||||||
{ "r", mode = "o", function() require("flash").remote() end, desc = "Remote Flash" },
|
{ "r", mode = "o", function() require("flash").remote() end, desc = "Remote Flash" },
|
||||||
{ "R", mode = { "o", "x" }, function() require("flash").treesitter_search() end, desc = "Treesitter Search" },
|
{ "R", mode = { "o", "x" }, function() require("flash").treesitter_search() end, desc = "Treesitter Search" },
|
||||||
{ "<c-s>", mode = { "c" }, function() require("flash").toggle() end, desc = "Toggle Flash Search" },
|
{ "<c-s>", mode = { "c" }, function() require("flash").toggle() end, desc = "Toggle Flash Search" },
|
||||||
|
-- Simulate nvim-treesitter incremental selection
|
||||||
|
{ "<c-space>", mode = { "n", "o", "x" },
|
||||||
|
function()
|
||||||
|
require("flash").treesitter({
|
||||||
|
actions = {
|
||||||
|
["<c-space>"] = "next",
|
||||||
|
["<BS>"] = "prev"
|
||||||
|
}
|
||||||
|
})
|
||||||
|
end, desc = "Treesitter Incremental Selection" },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -64,8 +74,8 @@ return {
|
||||||
{ "<leader>gh", group = "hunks" },
|
{ "<leader>gh", group = "hunks" },
|
||||||
{ "<leader>q", group = "quit/session" },
|
{ "<leader>q", group = "quit/session" },
|
||||||
{ "<leader>s", group = "search" },
|
{ "<leader>s", group = "search" },
|
||||||
{ "<leader>u", group = "ui", icon = { icon = " ", color = "cyan" } },
|
{ "<leader>u", group = "ui" },
|
||||||
{ "<leader>x", group = "diagnostics/quickfix", icon = { icon = " ", color = "green" } },
|
{ "<leader>x", group = "diagnostics/quickfix" },
|
||||||
{ "[", group = "prev" },
|
{ "[", group = "prev" },
|
||||||
{ "]", group = "next" },
|
{ "]", group = "next" },
|
||||||
{ "g", group = "goto" },
|
{ "g", group = "goto" },
|
||||||
|
|
@ -143,7 +153,7 @@ return {
|
||||||
local gs = package.loaded.gitsigns
|
local gs = package.loaded.gitsigns
|
||||||
|
|
||||||
local function map(mode, l, r, desc)
|
local function map(mode, l, r, desc)
|
||||||
vim.keymap.set(mode, l, r, { buffer = buffer, desc = desc })
|
vim.keymap.set(mode, l, r, { buffer = buffer, desc = desc, silent = true })
|
||||||
end
|
end
|
||||||
|
|
||||||
-- stylua: ignore start
|
-- stylua: ignore start
|
||||||
|
|
|
||||||
|
|
@ -8,8 +8,11 @@ return {
|
||||||
user = user:sub(1, 1):upper() .. user:sub(2)
|
user = user:sub(1, 1):upper() .. user:sub(2)
|
||||||
return {
|
return {
|
||||||
auto_insert_mode = true,
|
auto_insert_mode = true,
|
||||||
question_header = " " .. user .. " ",
|
headers = {
|
||||||
answer_header = " Copilot ",
|
user = " " .. user .. " ",
|
||||||
|
assistant = " Copilot ",
|
||||||
|
tool = " Tool ",
|
||||||
|
},
|
||||||
window = {
|
window = {
|
||||||
width = 0.4,
|
width = 0.4,
|
||||||
},
|
},
|
||||||
|
|
@ -85,4 +88,24 @@ return {
|
||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
-- Blink integration
|
||||||
|
{
|
||||||
|
"saghen/blink.cmp",
|
||||||
|
optional = true,
|
||||||
|
---@module 'blink.cmp'
|
||||||
|
---@type blink.cmp.Config
|
||||||
|
opts = {
|
||||||
|
sources = {
|
||||||
|
providers = {
|
||||||
|
path = {
|
||||||
|
-- Path sources triggered by "/" interfere with CopilotChat commands
|
||||||
|
enabled = function()
|
||||||
|
return vim.bo.filetype ~= "copilot-chat"
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
|
||||||
95
lua/lazyvim/plugins/extras/ai/copilot-native.lua
Normal file
95
lua/lazyvim/plugins/extras/ai/copilot-native.lua
Normal file
|
|
@ -0,0 +1,95 @@
|
||||||
|
---@diagnostic disable: missing-fields
|
||||||
|
if lazyvim_docs then
|
||||||
|
-- Native inline completions don't support being shown as regular completions
|
||||||
|
vim.g.ai_cmp = false
|
||||||
|
end
|
||||||
|
|
||||||
|
if LazyVim.has_extra("ai.copilot-native") then
|
||||||
|
if not vim.lsp.inline_completion then
|
||||||
|
LazyVim.error("You need Neovim >= 0.12 to use the `ai.copilot-native` extra.")
|
||||||
|
return {}
|
||||||
|
end
|
||||||
|
if LazyVim.has_extra("ai.copilot") then
|
||||||
|
LazyVim.error("Please disable the `ai.copilot` extra if you want to use `ai.copilot-native`")
|
||||||
|
return {}
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
vim.g.ai_cmp = false
|
||||||
|
local status = {} ---@type table<number, "ok" | "error" | "pending">
|
||||||
|
|
||||||
|
return {
|
||||||
|
desc = "Native Copilot LSP integration. Requires Neovim >= 0.12",
|
||||||
|
-- copilot-language-server
|
||||||
|
{
|
||||||
|
"neovim/nvim-lspconfig",
|
||||||
|
opts = {
|
||||||
|
servers = {
|
||||||
|
copilot = {
|
||||||
|
-- stylua: ignore
|
||||||
|
keys = {
|
||||||
|
{
|
||||||
|
"<M-]>",
|
||||||
|
function() vim.lsp.inline_completion.select({ count = 1 }) end,
|
||||||
|
desc = "Next Copilot Suggestion",
|
||||||
|
mode = { "i", "n" },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"<M-[>",
|
||||||
|
function() vim.lsp.inline_completion.select({ count = -1 }) end,
|
||||||
|
desc = "Prev Copilot Suggestion",
|
||||||
|
mode = { "i", "n" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
setup = {
|
||||||
|
copilot = function()
|
||||||
|
vim.schedule(function()
|
||||||
|
vim.lsp.inline_completion.enable()
|
||||||
|
end)
|
||||||
|
-- Accept inline suggestions or next edits
|
||||||
|
LazyVim.cmp.actions.ai_accept = function()
|
||||||
|
return vim.lsp.inline_completion.get()
|
||||||
|
end
|
||||||
|
|
||||||
|
if not LazyVim.has_extra("ai.sidekick") then
|
||||||
|
vim.lsp.config("copilot", {
|
||||||
|
handlers = {
|
||||||
|
didChangeStatus = function(err, res, ctx)
|
||||||
|
if err then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
status[ctx.client_id] = res.kind ~= "Normal" and "error" or res.busy and "pending" or "ok"
|
||||||
|
if res.status == "Error" then
|
||||||
|
LazyVim.error("Please use `:LspCopilotSignIn` to sign in to Copilot")
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
-- lualine
|
||||||
|
{
|
||||||
|
"nvim-lualine/lualine.nvim",
|
||||||
|
optional = true,
|
||||||
|
event = "VeryLazy",
|
||||||
|
opts = function(_, opts)
|
||||||
|
if LazyVim.has_extra("ai.sidekick") then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
table.insert(
|
||||||
|
opts.sections.lualine_x,
|
||||||
|
2,
|
||||||
|
LazyVim.lualine.status(LazyVim.config.icons.kinds.Copilot, function()
|
||||||
|
local clients = vim.lsp.get_clients({ name = "copilot", bufnr = 0 })
|
||||||
|
return #clients > 0 and status[clients[1].id] or nil
|
||||||
|
end)
|
||||||
|
)
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
@ -25,6 +25,17 @@ return {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
-- copilot-language-server
|
||||||
|
{
|
||||||
|
"neovim/nvim-lspconfig",
|
||||||
|
opts = {
|
||||||
|
servers = {
|
||||||
|
-- copilot.lua only works with its own copilot lsp server
|
||||||
|
copilot = { enabled = false },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
-- add ai_accept action
|
-- add ai_accept action
|
||||||
{
|
{
|
||||||
"zbirenbaum/copilot.lua",
|
"zbirenbaum/copilot.lua",
|
||||||
|
|
@ -49,9 +60,9 @@ return {
|
||||||
opts.sections.lualine_x,
|
opts.sections.lualine_x,
|
||||||
2,
|
2,
|
||||||
LazyVim.lualine.status(LazyVim.config.icons.kinds.Copilot, function()
|
LazyVim.lualine.status(LazyVim.config.icons.kinds.Copilot, function()
|
||||||
local clients = package.loaded["copilot"] and LazyVim.lsp.get_clients({ name = "copilot", bufnr = 0 }) or {}
|
local clients = package.loaded["copilot"] and vim.lsp.get_clients({ name = "copilot", bufnr = 0 }) or {}
|
||||||
if #clients > 0 then
|
if #clients > 0 then
|
||||||
local status = require("copilot.api").status.data.status
|
local status = require("copilot.status").data.status
|
||||||
return (status == "InProgress" and "pending") or (status == "Warning" and "error") or "ok"
|
return (status == "InProgress" and "pending") or (status == "Warning" and "error") or "ok"
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
@ -98,15 +109,14 @@ return {
|
||||||
{
|
{
|
||||||
"saghen/blink.cmp",
|
"saghen/blink.cmp",
|
||||||
optional = true,
|
optional = true,
|
||||||
dependencies = { "giuxtaposition/blink-cmp-copilot" },
|
dependencies = { "fang2hou/blink-copilot" },
|
||||||
opts = {
|
opts = {
|
||||||
sources = {
|
sources = {
|
||||||
default = { "copilot" },
|
default = { "copilot" },
|
||||||
providers = {
|
providers = {
|
||||||
copilot = {
|
copilot = {
|
||||||
name = "copilot",
|
name = "copilot",
|
||||||
module = "blink-cmp-copilot",
|
module = "blink-copilot",
|
||||||
kind = "Copilot",
|
|
||||||
score_offset = 100,
|
score_offset = 100,
|
||||||
async = true,
|
async = true,
|
||||||
},
|
},
|
||||||
|
|
|
||||||
146
lua/lazyvim/plugins/extras/ai/sidekick.lua
Normal file
146
lua/lazyvim/plugins/extras/ai/sidekick.lua
Normal file
|
|
@ -0,0 +1,146 @@
|
||||||
|
return {
|
||||||
|
desc = "Next edit suggestions with the Copilot LSP server",
|
||||||
|
|
||||||
|
-- copilot-language-server
|
||||||
|
{
|
||||||
|
"neovim/nvim-lspconfig",
|
||||||
|
opts = function(_, opts)
|
||||||
|
local sk = LazyVim.opts("sidekick.nvim") ---@type sidekick.Config|{}
|
||||||
|
if vim.tbl_get(sk, "nes", "enabled") ~= false then
|
||||||
|
opts.servers = opts.servers or {}
|
||||||
|
opts.servers.copilot = opts.servers.copilot or {}
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
|
-- lualine
|
||||||
|
{
|
||||||
|
"nvim-lualine/lualine.nvim",
|
||||||
|
optional = true,
|
||||||
|
event = "VeryLazy",
|
||||||
|
opts = function(_, opts)
|
||||||
|
local icons = {
|
||||||
|
Error = { " ", "DiagnosticError" },
|
||||||
|
Inactive = { " ", "MsgArea" },
|
||||||
|
Warning = { " ", "DiagnosticWarn" },
|
||||||
|
Normal = { LazyVim.config.icons.kinds.Copilot, "Special" },
|
||||||
|
}
|
||||||
|
table.insert(opts.sections.lualine_x, 2, {
|
||||||
|
function()
|
||||||
|
local status = require("sidekick.status").get()
|
||||||
|
return status and vim.tbl_get(icons, status.kind, 1)
|
||||||
|
end,
|
||||||
|
cond = function()
|
||||||
|
return require("sidekick.status").get() ~= nil
|
||||||
|
end,
|
||||||
|
color = function()
|
||||||
|
local status = require("sidekick.status").get()
|
||||||
|
local hl = status and (status.busy and "DiagnosticWarn" or vim.tbl_get(icons, status.kind, 2))
|
||||||
|
return { fg = Snacks.util.color(hl) }
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
table.insert(opts.sections.lualine_x, 2, {
|
||||||
|
function()
|
||||||
|
local status = require("sidekick.status").cli()
|
||||||
|
return " " .. (#status > 1 and #status or "")
|
||||||
|
end,
|
||||||
|
cond = function()
|
||||||
|
return #require("sidekick.status").cli() > 0
|
||||||
|
end,
|
||||||
|
color = function()
|
||||||
|
return { fg = Snacks.util.color("Special") }
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
"folke/sidekick.nvim",
|
||||||
|
opts = function()
|
||||||
|
-- Accept inline suggestions or next edits
|
||||||
|
LazyVim.cmp.actions.ai_nes = function()
|
||||||
|
local Nes = require("sidekick.nes")
|
||||||
|
if Nes.have() and (Nes.jump() or Nes.apply()) then
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
-- stylua: ignore
|
||||||
|
keys = {
|
||||||
|
-- nes is also useful in normal mode
|
||||||
|
{ "<tab>", LazyVim.cmp.map({ "ai_nes" }, "<tab>"), mode = { "n" }, expr = true },
|
||||||
|
{ "<leader>a", "", desc = "+ai", mode = { "n", "v" } },
|
||||||
|
{
|
||||||
|
"<c-.>",
|
||||||
|
function() require("sidekick.cli").toggle() end,
|
||||||
|
desc = "Sidekick Toggle",
|
||||||
|
mode = { "n", "t", "i", "x" },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"<leader>aa",
|
||||||
|
function() require("sidekick.cli").toggle() end,
|
||||||
|
desc = "Sidekick Toggle CLI",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"<leader>as",
|
||||||
|
function() require("sidekick.cli").select() end,
|
||||||
|
-- Or to select only installed tools:
|
||||||
|
-- require("sidekick.cli").select({ filter = { installed = true } })
|
||||||
|
desc = "Select CLI",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"<leader>ad",
|
||||||
|
function() require("sidekick.cli").close() end,
|
||||||
|
desc = "Detach a CLI Session",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"<leader>at",
|
||||||
|
function() require("sidekick.cli").send({ msg = "{this}" }) end,
|
||||||
|
mode = { "x", "n" },
|
||||||
|
desc = "Send This",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"<leader>af",
|
||||||
|
function() require("sidekick.cli").send({ msg = "{file}" }) end,
|
||||||
|
desc = "Send File",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"<leader>av",
|
||||||
|
function() require("sidekick.cli").send({ msg = "{selection}" }) end,
|
||||||
|
mode = { "x" },
|
||||||
|
desc = "Send Visual Selection",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"<leader>ap",
|
||||||
|
function() require("sidekick.cli").prompt() end,
|
||||||
|
mode = { "n", "x" },
|
||||||
|
desc = "Sidekick Select Prompt",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
"folke/snacks.nvim",
|
||||||
|
optional = true,
|
||||||
|
opts = {
|
||||||
|
picker = {
|
||||||
|
actions = {
|
||||||
|
sidekick_send = function(...)
|
||||||
|
return require("sidekick.cli.picker.snacks").send(...)
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
win = {
|
||||||
|
input = {
|
||||||
|
keys = {
|
||||||
|
["<a-a>"] = {
|
||||||
|
"sidekick_send",
|
||||||
|
mode = { "n", "i" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
@ -31,16 +31,15 @@ return {
|
||||||
version = not vim.g.lazyvim_blink_main and "*",
|
version = not vim.g.lazyvim_blink_main and "*",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
event = "InsertEnter",
|
event = { "InsertEnter", "CmdlineEnter" },
|
||||||
|
|
||||||
---@module 'blink.cmp'
|
---@module 'blink.cmp'
|
||||||
---@type blink.cmp.Config
|
---@type blink.cmp.Config
|
||||||
opts = {
|
opts = {
|
||||||
snippets = {
|
snippets = {
|
||||||
expand = function(snippet, _)
|
preset = "default",
|
||||||
return LazyVim.cmp.expand(snippet)
|
|
||||||
end,
|
|
||||||
},
|
},
|
||||||
|
|
||||||
appearance = {
|
appearance = {
|
||||||
-- sets the fallback highlight groups to nvim-cmp's highlight groups
|
-- sets the fallback highlight groups to nvim-cmp's highlight groups
|
||||||
-- useful for when your theme doesn't support blink.cmp
|
-- useful for when your theme doesn't support blink.cmp
|
||||||
|
|
@ -50,6 +49,7 @@ return {
|
||||||
-- adjusts spacing to ensure icons are aligned
|
-- adjusts spacing to ensure icons are aligned
|
||||||
nerd_font_variant = "mono",
|
nerd_font_variant = "mono",
|
||||||
},
|
},
|
||||||
|
|
||||||
completion = {
|
completion = {
|
||||||
accept = {
|
accept = {
|
||||||
-- experimental auto-brackets support
|
-- experimental auto-brackets support
|
||||||
|
|
@ -82,7 +82,21 @@ return {
|
||||||
},
|
},
|
||||||
|
|
||||||
cmdline = {
|
cmdline = {
|
||||||
enabled = false,
|
enabled = true,
|
||||||
|
keymap = {
|
||||||
|
preset = "cmdline",
|
||||||
|
["<Right>"] = false,
|
||||||
|
["<Left>"] = false,
|
||||||
|
},
|
||||||
|
completion = {
|
||||||
|
list = { selection = { preselect = false } },
|
||||||
|
menu = {
|
||||||
|
auto_show = function(ctx)
|
||||||
|
return vim.fn.getcmdtype() == ":"
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
ghost_text = { enabled = true },
|
||||||
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
keymap = {
|
keymap = {
|
||||||
|
|
@ -109,13 +123,13 @@ return {
|
||||||
if not opts.keymap["<Tab>"] then
|
if not opts.keymap["<Tab>"] then
|
||||||
if opts.keymap.preset == "super-tab" then -- super-tab
|
if opts.keymap.preset == "super-tab" then -- super-tab
|
||||||
opts.keymap["<Tab>"] = {
|
opts.keymap["<Tab>"] = {
|
||||||
require("blink.cmp.keymap.presets")["super-tab"]["<Tab>"][1],
|
require("blink.cmp.keymap.presets").get("super-tab")["<Tab>"][1],
|
||||||
LazyVim.cmp.map({ "snippet_forward", "ai_accept" }),
|
LazyVim.cmp.map({ "snippet_forward", "ai_nes", "ai_accept" }),
|
||||||
"fallback",
|
"fallback",
|
||||||
}
|
}
|
||||||
else -- other presets
|
else -- other presets
|
||||||
opts.keymap["<Tab>"] = {
|
opts.keymap["<Tab>"] = {
|
||||||
LazyVim.cmp.map({ "snippet_forward", "ai_accept" }),
|
LazyVim.cmp.map({ "snippet_forward", "ai_nes", "ai_accept" }),
|
||||||
"fallback",
|
"fallback",
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
@ -171,8 +185,9 @@ return {
|
||||||
"saghen/blink.cmp",
|
"saghen/blink.cmp",
|
||||||
opts = {
|
opts = {
|
||||||
sources = {
|
sources = {
|
||||||
-- add lazydev to your completion providers
|
per_filetype = {
|
||||||
default = { "lazydev" },
|
lua = { inherit_defaults = true, "lazydev" },
|
||||||
|
},
|
||||||
providers = {
|
providers = {
|
||||||
lazydev = {
|
lazydev = {
|
||||||
name = "LazyDev",
|
name = "LazyDev",
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
return {
|
return {
|
||||||
-- disable builtin snippet support
|
-- disable builtin snippet support
|
||||||
{ "garymjr/nvim-snippets", enabled = false },
|
{ "garymjr/nvim-snippets", optional = true, enabled = false },
|
||||||
|
|
||||||
-- add luasnip
|
-- add luasnip
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
return {
|
return {
|
||||||
{
|
{
|
||||||
"echasnovski/mini.comment",
|
"nvim-mini/mini.comment",
|
||||||
event = "VeryLazy",
|
event = "VeryLazy",
|
||||||
opts = {
|
opts = {
|
||||||
options = {
|
options = {
|
||||||
|
|
|
||||||
|
|
@ -1,17 +1,17 @@
|
||||||
if lazyvim_docs then
|
if lazyvim_docs then
|
||||||
-- Set to `false` to prevent "non-lsp snippets"" from appearing inside completion windows
|
-- Set to `false` to prevent "non-lsp snippets"" from appearing inside completion windows
|
||||||
-- Motivation: Less clutter in completion windows and a more direct usage of snippits
|
-- Motivation: Less clutter in completion windows and a more direct usage of snippets
|
||||||
vim.g.lazyvim_mini_snippets_in_completion = true
|
vim.g.lazyvim_mini_snippets_in_completion = true
|
||||||
|
|
||||||
-- NOTE: Please also read:
|
-- NOTE: Please also read:
|
||||||
-- https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-snippets.md#expand
|
-- https://github.com/nvim-mini/mini.nvim/blob/main/readmes/mini-snippets.md#expand
|
||||||
-- :h MiniSnippets-session
|
-- :h MiniSnippets-session
|
||||||
|
|
||||||
-- Example override for your own config:
|
-- Example override for your own config:
|
||||||
--[[
|
--[[
|
||||||
return {
|
return {
|
||||||
{
|
{
|
||||||
"echasnovski/mini.snippets",
|
"nvim-mini/mini.snippets",
|
||||||
opts = function(_, opts)
|
opts = function(_, opts)
|
||||||
-- By default, for opts.snippets, the extra for mini.snippets only adds gen_loader.from_lang()
|
-- By default, for opts.snippets, the extra for mini.snippets only adds gen_loader.from_lang()
|
||||||
-- This provides a sensible quickstart, integrating with friendly-snippets
|
-- This provides a sensible quickstart, integrating with friendly-snippets
|
||||||
|
|
@ -63,7 +63,7 @@ return {
|
||||||
-- add mini.snippets
|
-- add mini.snippets
|
||||||
desc = "Manage and expand snippets (alternative to Luasnip)",
|
desc = "Manage and expand snippets (alternative to Luasnip)",
|
||||||
{
|
{
|
||||||
"echasnovski/mini.snippets",
|
"nvim-mini/mini.snippets",
|
||||||
event = "InsertEnter", -- don't depend on other plugins to load...
|
event = "InsertEnter", -- don't depend on other plugins to load...
|
||||||
dependencies = "rafamadriz/friendly-snippets",
|
dependencies = "rafamadriz/friendly-snippets",
|
||||||
opts = function()
|
opts = function()
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
-- to select the text inside, change or modify the surrounding characters,
|
-- to select the text inside, change or modify the surrounding characters,
|
||||||
-- and more.
|
-- and more.
|
||||||
return {
|
return {
|
||||||
"echasnovski/mini.surround",
|
"nvim-mini/mini.surround",
|
||||||
keys = function(_, keys)
|
keys = function(_, keys)
|
||||||
-- Populate the keys based on the user's options
|
-- Populate the keys based on the user's options
|
||||||
local opts = LazyVim.opts("mini.surround")
|
local opts = LazyVim.opts("mini.surround")
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,9 @@ return {
|
||||||
-- }
|
-- }
|
||||||
-- ```
|
-- ```
|
||||||
opts = function()
|
opts = function()
|
||||||
|
-- Register nvim-cmp lsp capabilities
|
||||||
|
vim.lsp.config("*", { capabilities = require("cmp_nvim_lsp").default_capabilities() })
|
||||||
|
|
||||||
vim.api.nvim_set_hl(0, "CmpGhostText", { link = "Comment", default = true })
|
vim.api.nvim_set_hl(0, "CmpGhostText", { link = "Comment", default = true })
|
||||||
local cmp = require("cmp")
|
local cmp = require("cmp")
|
||||||
local defaults = require("cmp.config.default")()
|
local defaults = require("cmp.config.default")()
|
||||||
|
|
@ -49,7 +52,7 @@ return {
|
||||||
fallback()
|
fallback()
|
||||||
end,
|
end,
|
||||||
["<tab>"] = function(fallback)
|
["<tab>"] = function(fallback)
|
||||||
return LazyVim.cmp.map({ "snippet_forward", "ai_accept" }, fallback)()
|
return LazyVim.cmp.map({ "snippet_forward", "ai_nes", "ai_accept" }, fallback)()
|
||||||
end,
|
end,
|
||||||
}),
|
}),
|
||||||
sources = cmp.config.sources({
|
sources = cmp.config.sources({
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,8 @@ return {
|
||||||
function()
|
function()
|
||||||
if LazyVim.pick.picker.name == "telescope" then
|
if LazyVim.pick.picker.name == "telescope" then
|
||||||
require("telescope").extensions.yank_history.yank_history({})
|
require("telescope").extensions.yank_history.yank_history({})
|
||||||
|
elseif LazyVim.pick.picker.name == "snacks" then
|
||||||
|
Snacks.picker.yanky()
|
||||||
else
|
else
|
||||||
vim.cmd([[YankyRingHistory]])
|
vim.cmd([[YankyRingHistory]])
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -120,9 +120,9 @@ return {
|
||||||
winopts = {
|
winopts = {
|
||||||
layout = "vertical",
|
layout = "vertical",
|
||||||
-- height is number of items minus 15 lines for the preview, with a max of 80% screen height
|
-- height is number of items minus 15 lines for the preview, with a max of 80% screen height
|
||||||
height = math.floor(math.min(vim.o.lines * 0.8 - 16, #items + 2) + 0.5) + 16,
|
height = math.floor(math.min(vim.o.lines * 0.8 - 16, #items + 4) + 0.5) + 16,
|
||||||
width = 0.5,
|
width = 0.5,
|
||||||
preview = not vim.tbl_isempty(LazyVim.lsp.get_clients({ bufnr = 0, name = "vtsls" })) and {
|
preview = not vim.tbl_isempty(vim.lsp.get_clients({ bufnr = 0, name = "vtsls" })) and {
|
||||||
layout = "vertical",
|
layout = "vertical",
|
||||||
vertical = "down:15,border-top",
|
vertical = "down:15,border-top",
|
||||||
hidden = "hidden",
|
hidden = "hidden",
|
||||||
|
|
@ -135,7 +135,7 @@ return {
|
||||||
winopts = {
|
winopts = {
|
||||||
width = 0.5,
|
width = 0.5,
|
||||||
-- height is number of items, with a max of 80% screen height
|
-- height is number of items, with a max of 80% screen height
|
||||||
height = math.floor(math.min(vim.o.lines * 0.8, #items + 2) + 0.5),
|
height = math.floor(math.min(vim.o.lines * 0.8, #items + 4) + 0.5),
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
|
|
@ -218,6 +218,7 @@ return {
|
||||||
{ "<leader><space>", LazyVim.pick("files"), desc = "Find Files (Root Dir)" },
|
{ "<leader><space>", LazyVim.pick("files"), desc = "Find Files (Root Dir)" },
|
||||||
-- find
|
-- find
|
||||||
{ "<leader>fb", "<cmd>FzfLua buffers sort_mru=true sort_lastused=true<cr>", desc = "Buffers" },
|
{ "<leader>fb", "<cmd>FzfLua buffers sort_mru=true sort_lastused=true<cr>", desc = "Buffers" },
|
||||||
|
{ "<leader>fB", "<cmd>FzfLua buffers<cr>", desc = "Buffers (all)" },
|
||||||
{ "<leader>fc", LazyVim.pick.config_files(), desc = "Find Config File" },
|
{ "<leader>fc", LazyVim.pick.config_files(), desc = "Find Config File" },
|
||||||
{ "<leader>ff", LazyVim.pick("files"), desc = "Find Files (Root Dir)" },
|
{ "<leader>ff", LazyVim.pick("files"), desc = "Find Files (Root Dir)" },
|
||||||
{ "<leader>fF", LazyVim.pick("files", { root = false }), desc = "Find Files (cwd)" },
|
{ "<leader>fF", LazyVim.pick("files", { root = false }), desc = "Find Files (cwd)" },
|
||||||
|
|
@ -226,15 +227,19 @@ return {
|
||||||
{ "<leader>fR", LazyVim.pick("oldfiles", { cwd = vim.uv.cwd() }), desc = "Recent (cwd)" },
|
{ "<leader>fR", LazyVim.pick("oldfiles", { cwd = vim.uv.cwd() }), desc = "Recent (cwd)" },
|
||||||
-- git
|
-- git
|
||||||
{ "<leader>gc", "<cmd>FzfLua git_commits<CR>", desc = "Commits" },
|
{ "<leader>gc", "<cmd>FzfLua git_commits<CR>", desc = "Commits" },
|
||||||
|
{ "<leader>gd", "<cmd>FzfLua git_diff<cr>", desc = "Git Diff (hunks)" },
|
||||||
|
{ "<leader>gl", "<cmd>FzfLua git_commits<CR>", desc = "Commits" },
|
||||||
{ "<leader>gs", "<cmd>FzfLua git_status<CR>", desc = "Status" },
|
{ "<leader>gs", "<cmd>FzfLua git_status<CR>", desc = "Status" },
|
||||||
|
{ "<leader>gS", "<cmd>FzfLua git_stash<cr>", desc = "Git Stash" },
|
||||||
-- search
|
-- search
|
||||||
{ '<leader>s"', "<cmd>FzfLua registers<cr>", desc = "Registers" },
|
{ '<leader>s"', "<cmd>FzfLua registers<cr>", desc = "Registers" },
|
||||||
|
{ '<leader>s/', "<cmd>FzfLua search_history<cr>", desc = "Search History" },
|
||||||
{ "<leader>sa", "<cmd>FzfLua autocmds<cr>", desc = "Auto Commands" },
|
{ "<leader>sa", "<cmd>FzfLua autocmds<cr>", desc = "Auto Commands" },
|
||||||
{ "<leader>sb", "<cmd>FzfLua grep_curbuf<cr>", desc = "Buffer" },
|
{ "<leader>sb", "<cmd>FzfLua lines<cr>", desc = "Buffer Lines" },
|
||||||
{ "<leader>sc", "<cmd>FzfLua command_history<cr>", desc = "Command History" },
|
{ "<leader>sc", "<cmd>FzfLua command_history<cr>", desc = "Command History" },
|
||||||
{ "<leader>sC", "<cmd>FzfLua commands<cr>", desc = "Commands" },
|
{ "<leader>sC", "<cmd>FzfLua commands<cr>", desc = "Commands" },
|
||||||
{ "<leader>sd", "<cmd>FzfLua diagnostics_document<cr>", desc = "Document Diagnostics" },
|
{ "<leader>sd", "<cmd>FzfLua diagnostics_workspace<cr>", desc = "Diagnostics" },
|
||||||
{ "<leader>sD", "<cmd>FzfLua diagnostics_workspace<cr>", desc = "Workspace Diagnostics" },
|
{ "<leader>sD", "<cmd>FzfLua diagnostics_document<cr>", desc = "Buffer Diagnostics" },
|
||||||
{ "<leader>sg", LazyVim.pick("live_grep"), desc = "Grep (Root Dir)" },
|
{ "<leader>sg", LazyVim.pick("live_grep"), desc = "Grep (Root Dir)" },
|
||||||
{ "<leader>sG", LazyVim.pick("live_grep", { root = false }), desc = "Grep (cwd)" },
|
{ "<leader>sG", LazyVim.pick("live_grep", { root = false }), desc = "Grep (cwd)" },
|
||||||
{ "<leader>sh", "<cmd>FzfLua help_tags<cr>", desc = "Help Pages" },
|
{ "<leader>sh", "<cmd>FzfLua help_tags<cr>", desc = "Help Pages" },
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ return {
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
for i = 1, 5 do
|
for i = 1, 9 do
|
||||||
table.insert(keys, {
|
table.insert(keys, {
|
||||||
"<leader>" .. i,
|
"<leader>" .. i,
|
||||||
function()
|
function()
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@ return {
|
||||||
|
|
||||||
-- rename surround mappings from gs to gz to prevent conflict with leap
|
-- rename surround mappings from gs to gz to prevent conflict with leap
|
||||||
{
|
{
|
||||||
"echasnovski/mini.surround",
|
"nvim-mini/mini.surround",
|
||||||
optional = true,
|
optional = true,
|
||||||
opts = {
|
opts = {
|
||||||
mappings = {
|
mappings = {
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ return {
|
||||||
|
|
||||||
-- setup mini.diff
|
-- setup mini.diff
|
||||||
{
|
{
|
||||||
"echasnovski/mini.diff",
|
"nvim-mini/mini.diff",
|
||||||
event = "VeryLazy",
|
event = "VeryLazy",
|
||||||
keys = {
|
keys = {
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
return {
|
return {
|
||||||
"echasnovski/mini.files",
|
"nvim-mini/mini.files",
|
||||||
opts = {
|
opts = {
|
||||||
windows = {
|
windows = {
|
||||||
preview = true,
|
preview = true,
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
return {
|
return {
|
||||||
{
|
{
|
||||||
"echasnovski/mini.move",
|
"nvim-mini/mini.move",
|
||||||
event = "VeryLazy",
|
event = "VeryLazy",
|
||||||
opts = {},
|
opts = {},
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ return {
|
||||||
init = function()
|
init = function()
|
||||||
vim.g.navic_silence = true
|
vim.g.navic_silence = true
|
||||||
LazyVim.lsp.on_attach(function(client, buffer)
|
LazyVim.lsp.on_attach(function(client, buffer)
|
||||||
if client.supports_method("textDocument/documentSymbol") then
|
if client:supports_method("textDocument/documentSymbol") then
|
||||||
require("nvim-navic").attach(client, buffer)
|
require("nvim-navic").attach(client, buffer)
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
|
||||||
|
|
@ -30,34 +30,39 @@ return {
|
||||||
"nvim-treesitter/nvim-treesitter",
|
"nvim-treesitter/nvim-treesitter",
|
||||||
},
|
},
|
||||||
keys = {
|
keys = {
|
||||||
{ "<leader>r", "", desc = "+refactor", mode = { "n", "v" } },
|
{ "<leader>r", "", desc = "+refactor", mode = { "n", "x" } },
|
||||||
{
|
{
|
||||||
"<leader>rs",
|
"<leader>rs",
|
||||||
pick,
|
pick,
|
||||||
mode = "v",
|
mode = { "n", "x" },
|
||||||
desc = "Refactor",
|
desc = "Refactor",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"<leader>ri",
|
"<leader>ri",
|
||||||
function()
|
function()
|
||||||
require("refactoring").refactor("Inline Variable")
|
return require("refactoring").refactor("Inline Variable")
|
||||||
end,
|
end,
|
||||||
mode = { "n", "v" },
|
mode = { "n", "x" },
|
||||||
desc = "Inline Variable",
|
desc = "Inline Variable",
|
||||||
|
expr = true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"<leader>rb",
|
"<leader>rb",
|
||||||
function()
|
function()
|
||||||
require("refactoring").refactor("Extract Block")
|
return require("refactoring").refactor("Extract Block")
|
||||||
end,
|
end,
|
||||||
|
mode = { "n", "x" },
|
||||||
desc = "Extract Block",
|
desc = "Extract Block",
|
||||||
|
expr = true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"<leader>rf",
|
"<leader>rf",
|
||||||
function()
|
function()
|
||||||
require("refactoring").refactor("Extract Block To File")
|
return require("refactoring").refactor("Extract Block To File")
|
||||||
end,
|
end,
|
||||||
|
mode = { "n", "x" },
|
||||||
desc = "Extract Block To File",
|
desc = "Extract Block To File",
|
||||||
|
expr = true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"<leader>rP",
|
"<leader>rP",
|
||||||
|
|
@ -71,6 +76,7 @@ return {
|
||||||
function()
|
function()
|
||||||
require("refactoring").debug.print_var({ normal = true })
|
require("refactoring").debug.print_var({ normal = true })
|
||||||
end,
|
end,
|
||||||
|
mode = { "n", "x" },
|
||||||
desc = "Debug Print Variable",
|
desc = "Debug Print Variable",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
@ -83,33 +89,36 @@ return {
|
||||||
{
|
{
|
||||||
"<leader>rf",
|
"<leader>rf",
|
||||||
function()
|
function()
|
||||||
require("refactoring").refactor("Extract Function")
|
return require("refactoring").refactor("Extract Function")
|
||||||
end,
|
end,
|
||||||
mode = "v",
|
mode = { "n", "x" },
|
||||||
desc = "Extract Function",
|
desc = "Extract Function",
|
||||||
|
expr = true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"<leader>rF",
|
"<leader>rF",
|
||||||
function()
|
function()
|
||||||
require("refactoring").refactor("Extract Function To File")
|
return require("refactoring").refactor("Extract Function To File")
|
||||||
end,
|
end,
|
||||||
mode = "v",
|
mode = { "n", "x" },
|
||||||
desc = "Extract Function To File",
|
desc = "Extract Function To File",
|
||||||
|
expr = true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"<leader>rx",
|
"<leader>rx",
|
||||||
function()
|
function()
|
||||||
require("refactoring").refactor("Extract Variable")
|
return require("refactoring").refactor("Extract Variable")
|
||||||
end,
|
end,
|
||||||
mode = "v",
|
mode = { "n", "x" },
|
||||||
desc = "Extract Variable",
|
desc = "Extract Variable",
|
||||||
|
expr = true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"<leader>rp",
|
"<leader>rp",
|
||||||
function()
|
function()
|
||||||
require("refactoring").debug.print_var()
|
require("refactoring").debug.print_var()
|
||||||
end,
|
end,
|
||||||
mode = "v",
|
mode = { "n", "x" },
|
||||||
desc = "Debug Print Variable",
|
desc = "Debug Print Variable",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -178,7 +178,7 @@ return {
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"echasnovski/mini.starter",
|
"nvim-mini/mini.starter",
|
||||||
optional = true,
|
optional = true,
|
||||||
opts = function(_, opts)
|
opts = function(_, opts)
|
||||||
local items = {
|
local items = {
|
||||||
|
|
|
||||||
|
|
@ -101,6 +101,7 @@ return {
|
||||||
"<cmd>Telescope buffers sort_mru=true sort_lastused=true ignore_current_buffer=true<cr>",
|
"<cmd>Telescope buffers sort_mru=true sort_lastused=true ignore_current_buffer=true<cr>",
|
||||||
desc = "Buffers",
|
desc = "Buffers",
|
||||||
},
|
},
|
||||||
|
{ "<leader>fB", "<cmd>Telescope buffers<cr>", desc = "Buffers (all)" },
|
||||||
{ "<leader>fc", LazyVim.pick.config_files(), desc = "Find Config File" },
|
{ "<leader>fc", LazyVim.pick.config_files(), desc = "Find Config File" },
|
||||||
{ "<leader>ff", LazyVim.pick("files"), desc = "Find Files (Root Dir)" },
|
{ "<leader>ff", LazyVim.pick("files"), desc = "Find Files (Root Dir)" },
|
||||||
{ "<leader>fF", LazyVim.pick("files", { root = false }), desc = "Find Files (cwd)" },
|
{ "<leader>fF", LazyVim.pick("files", { root = false }), desc = "Find Files (cwd)" },
|
||||||
|
|
@ -109,15 +110,18 @@ return {
|
||||||
{ "<leader>fR", LazyVim.pick("oldfiles", { cwd = vim.uv.cwd() }), desc = "Recent (cwd)" },
|
{ "<leader>fR", LazyVim.pick("oldfiles", { cwd = vim.uv.cwd() }), desc = "Recent (cwd)" },
|
||||||
-- git
|
-- git
|
||||||
{ "<leader>gc", "<cmd>Telescope git_commits<CR>", desc = "Commits" },
|
{ "<leader>gc", "<cmd>Telescope git_commits<CR>", desc = "Commits" },
|
||||||
|
{ "<leader>gl", "<cmd>Telescope git_commits<CR>", desc = "Commits" },
|
||||||
{ "<leader>gs", "<cmd>Telescope git_status<CR>", desc = "Status" },
|
{ "<leader>gs", "<cmd>Telescope git_status<CR>", desc = "Status" },
|
||||||
|
{ "<leader>gS", "<cmd>Telescope git_stash<cr>", desc = "Git Stash" },
|
||||||
-- search
|
-- search
|
||||||
{ '<leader>s"', "<cmd>Telescope registers<cr>", desc = "Registers" },
|
{ '<leader>s"', "<cmd>Telescope registers<cr>", desc = "Registers" },
|
||||||
|
{ '<leader>s/', "<cmd>Telescope search_history<cr>", desc = "Search History" },
|
||||||
{ "<leader>sa", "<cmd>Telescope autocommands<cr>", desc = "Auto Commands" },
|
{ "<leader>sa", "<cmd>Telescope autocommands<cr>", desc = "Auto Commands" },
|
||||||
{ "<leader>sb", "<cmd>Telescope current_buffer_fuzzy_find<cr>", desc = "Buffer" },
|
{ "<leader>sb", "<cmd>Telescope current_buffer_fuzzy_find<cr>", desc = "Buffer Lines" },
|
||||||
{ "<leader>sc", "<cmd>Telescope command_history<cr>", desc = "Command History" },
|
{ "<leader>sc", "<cmd>Telescope command_history<cr>", desc = "Command History" },
|
||||||
{ "<leader>sC", "<cmd>Telescope commands<cr>", desc = "Commands" },
|
{ "<leader>sC", "<cmd>Telescope commands<cr>", desc = "Commands" },
|
||||||
{ "<leader>sd", "<cmd>Telescope diagnostics bufnr=0<cr>", desc = "Document Diagnostics" },
|
{ "<leader>sd", "<cmd>Telescope diagnostics<cr>", desc = "Diagnostics" },
|
||||||
{ "<leader>sD", "<cmd>Telescope diagnostics<cr>", desc = "Workspace Diagnostics" },
|
{ "<leader>sD", "<cmd>Telescope diagnostics bufnr=0<cr>", desc = "Buffer Diagnostics" },
|
||||||
{ "<leader>sg", LazyVim.pick("live_grep"), desc = "Grep (Root Dir)" },
|
{ "<leader>sg", LazyVim.pick("live_grep"), desc = "Grep (Root Dir)" },
|
||||||
{ "<leader>sG", LazyVim.pick("live_grep", { root = false }), desc = "Grep (cwd)" },
|
{ "<leader>sG", LazyVim.pick("live_grep", { root = false }), desc = "Grep (cwd)" },
|
||||||
{ "<leader>sh", "<cmd>Telescope help_tags<cr>", desc = "Help Pages" },
|
{ "<leader>sh", "<cmd>Telescope help_tags<cr>", desc = "Help Pages" },
|
||||||
|
|
|
||||||
|
|
@ -19,13 +19,14 @@ return {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"mfussenegger/nvim-ansible",
|
"mfussenegger/nvim-ansible",
|
||||||
ft = {},
|
ft = { "yaml" },
|
||||||
keys = {
|
keys = {
|
||||||
{
|
{
|
||||||
"<leader>ta",
|
"<leader>ta",
|
||||||
function()
|
function()
|
||||||
require("ansible").run()
|
require("ansible").run()
|
||||||
end,
|
end,
|
||||||
|
ft = "yaml.ansible",
|
||||||
desc = "Ansible Run Playbook/Role",
|
desc = "Ansible Run Playbook/Role",
|
||||||
silent = true,
|
silent = true,
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,8 @@ return {
|
||||||
"compile_commands.json",
|
"compile_commands.json",
|
||||||
"compile_flags.txt",
|
"compile_flags.txt",
|
||||||
"configure.ac", -- AutoTools
|
"configure.ac", -- AutoTools
|
||||||
|
"meson.build",
|
||||||
|
"build.ninja",
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
|
|
@ -58,21 +60,21 @@ return {
|
||||||
-- Ensure mason installs the server
|
-- Ensure mason installs the server
|
||||||
clangd = {
|
clangd = {
|
||||||
keys = {
|
keys = {
|
||||||
{ "<leader>ch", "<cmd>ClangdSwitchSourceHeader<cr>", desc = "Switch Source/Header (C/C++)" },
|
{ "<leader>ch", "<cmd>LspClangdSwitchSourceHeader<cr>", desc = "Switch Source/Header (C/C++)" },
|
||||||
|
},
|
||||||
|
root_markers = {
|
||||||
|
"compile_commands.json",
|
||||||
|
"compile_flags.txt",
|
||||||
|
"configure.ac", -- AutoTools
|
||||||
|
"Makefile",
|
||||||
|
"configure.ac",
|
||||||
|
"configure.in",
|
||||||
|
"config.h.in",
|
||||||
|
"meson.build",
|
||||||
|
"meson_options.txt",
|
||||||
|
"build.ninja",
|
||||||
|
".git",
|
||||||
},
|
},
|
||||||
root_dir = function(fname)
|
|
||||||
return require("lspconfig.util").root_pattern(
|
|
||||||
"Makefile",
|
|
||||||
"configure.ac",
|
|
||||||
"configure.in",
|
|
||||||
"config.h.in",
|
|
||||||
"meson.build",
|
|
||||||
"meson_options.txt",
|
|
||||||
"build.ninja"
|
|
||||||
)(fname) or require("lspconfig.util").root_pattern("compile_commands.json", "compile_flags.txt")(
|
|
||||||
fname
|
|
||||||
) or require("lspconfig.util").find_git_ancestor(fname)
|
|
||||||
end,
|
|
||||||
capabilities = {
|
capabilities = {
|
||||||
offsetEncoding = { "utf-16" },
|
offsetEncoding = { "utf-16" },
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -21,13 +21,13 @@ return {
|
||||||
},
|
},
|
||||||
opts = function(_, opts)
|
opts = function(_, opts)
|
||||||
if type(opts.sources) == "table" then
|
if type(opts.sources) == "table" then
|
||||||
vim.list_extend(opts.sources, { name = "clojure" })
|
vim.list_extend(opts.sources, { name = "conjure" })
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
||||||
-- Add s-exp mappings
|
-- Add s-exp mappings
|
||||||
{ "PaterJason/nvim-treesitter-sexp", opts = {}, event = "LazyFile" },
|
{ "julienvincent/nvim-paredit", opts = {}, event = "LazyFile" },
|
||||||
|
|
||||||
-- Colorize the output of the log buffer
|
-- Colorize the output of the log buffer
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,14 @@ return {
|
||||||
recommended = function()
|
recommended = function()
|
||||||
return LazyVim.extras.wants({
|
return LazyVim.extras.wants({
|
||||||
ft = "dockerfile",
|
ft = "dockerfile",
|
||||||
root = { "Dockerfile", "docker-compose.yml", "compose.yml", "docker-compose.yaml", "compose.yaml" },
|
root = {
|
||||||
|
"Dockerfile",
|
||||||
|
"Containerfile",
|
||||||
|
"docker-compose.yml",
|
||||||
|
"compose.yml",
|
||||||
|
"docker-compose.yaml",
|
||||||
|
"compose.yaml",
|
||||||
|
},
|
||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -17,4 +17,13 @@ return {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"conform.nvim",
|
||||||
|
optional = true,
|
||||||
|
opts = {
|
||||||
|
formatters_by_ft = {
|
||||||
|
gleam = { "gleam" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -139,7 +139,7 @@ return {
|
||||||
|
|
||||||
-- Filetype icons
|
-- Filetype icons
|
||||||
{
|
{
|
||||||
"echasnovski/mini.icons",
|
"nvim-mini/mini.icons",
|
||||||
opts = {
|
opts = {
|
||||||
file = {
|
file = {
|
||||||
[".go-version"] = { glyph = "", hl = "MiniIconsBlue" },
|
[".go-version"] = { glyph = "", hl = "MiniIconsBlue" },
|
||||||
|
|
|
||||||
|
|
@ -70,7 +70,7 @@ return {
|
||||||
"luc-tielen/telescope_hoogle",
|
"luc-tielen/telescope_hoogle",
|
||||||
ft = { "haskell", "lhaskell", "cabal", "cabalproject" },
|
ft = { "haskell", "lhaskell", "cabal", "cabalproject" },
|
||||||
dependencies = {
|
dependencies = {
|
||||||
{ "nvim-telescope/telescope.nvim" },
|
{ "nvim-telescope/telescope.nvim", optional = true },
|
||||||
},
|
},
|
||||||
config = function()
|
config = function()
|
||||||
local ok, telescope = pcall(require, "telescope")
|
local ok, telescope = pcall(require, "telescope")
|
||||||
|
|
|
||||||
|
|
@ -87,14 +87,13 @@ return {
|
||||||
opts = function()
|
opts = function()
|
||||||
local cmd = { vim.fn.exepath("jdtls") }
|
local cmd = { vim.fn.exepath("jdtls") }
|
||||||
if LazyVim.has("mason.nvim") then
|
if LazyVim.has("mason.nvim") then
|
||||||
local mason_registry = require("mason-registry")
|
local lombok_jar = vim.fn.expand("$MASON/share/jdtls/lombok.jar")
|
||||||
local lombok_jar = mason_registry.get_package("jdtls"):get_install_path() .. "/lombok.jar"
|
|
||||||
table.insert(cmd, string.format("--jvm-arg=-javaagent:%s", lombok_jar))
|
table.insert(cmd, string.format("--jvm-arg=-javaagent:%s", lombok_jar))
|
||||||
end
|
end
|
||||||
return {
|
return {
|
||||||
-- How to find the root dir for a given filename. The default comes from
|
root_dir = function(path)
|
||||||
-- lspconfig which provides a function specifically for java projects.
|
return vim.fs.root(path, vim.lsp.config.jdtls.root_markers)
|
||||||
root_dir = LazyVim.lsp.get_raw_config("jdtls").default_config.root_dir,
|
end,
|
||||||
|
|
||||||
-- How to find the project name for a given root dir.
|
-- How to find the project name for a given root dir.
|
||||||
project_name = function(root_dir)
|
project_name = function(root_dir)
|
||||||
|
|
@ -151,23 +150,10 @@ return {
|
||||||
if LazyVim.has("mason.nvim") then
|
if LazyVim.has("mason.nvim") then
|
||||||
local mason_registry = require("mason-registry")
|
local mason_registry = require("mason-registry")
|
||||||
if opts.dap and LazyVim.has("nvim-dap") and mason_registry.is_installed("java-debug-adapter") then
|
if opts.dap and LazyVim.has("nvim-dap") and mason_registry.is_installed("java-debug-adapter") then
|
||||||
local java_dbg_pkg = mason_registry.get_package("java-debug-adapter")
|
bundles = vim.fn.glob("$MASON/share/java-debug-adapter/com.microsoft.java.debug.plugin-*jar", false, true)
|
||||||
local java_dbg_path = java_dbg_pkg:get_install_path()
|
|
||||||
local jar_patterns = {
|
|
||||||
java_dbg_path .. "/extension/server/com.microsoft.java.debug.plugin-*.jar",
|
|
||||||
}
|
|
||||||
-- java-test also depends on java-debug-adapter.
|
-- java-test also depends on java-debug-adapter.
|
||||||
if opts.test and mason_registry.is_installed("java-test") then
|
if opts.test and mason_registry.is_installed("java-test") then
|
||||||
local java_test_pkg = mason_registry.get_package("java-test")
|
vim.list_extend(bundles, vim.fn.glob("$MASON/share/java-test/*.jar", false, true))
|
||||||
local java_test_path = java_test_pkg:get_install_path()
|
|
||||||
vim.list_extend(jar_patterns, {
|
|
||||||
java_test_path .. "/extension/server/*.jar",
|
|
||||||
})
|
|
||||||
end
|
|
||||||
for _, jar_pattern in ipairs(jar_patterns) do
|
|
||||||
for _, bundle in ipairs(vim.split(vim.fn.glob(jar_pattern), "\n")) do
|
|
||||||
table.insert(bundles, bundle)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
@ -183,7 +169,9 @@ return {
|
||||||
},
|
},
|
||||||
settings = opts.settings,
|
settings = opts.settings,
|
||||||
-- enable CMP capabilities
|
-- enable CMP capabilities
|
||||||
capabilities = LazyVim.has("cmp-nvim-lsp") and require("cmp_nvim_lsp").default_capabilities() or nil,
|
capabilities = LazyVim.has("blink.cmp") and require("blink.cmp").get_lsp_capabilities() or LazyVim.has(
|
||||||
|
"cmp-nvim-lsp"
|
||||||
|
) and require("cmp_nvim_lsp").default_capabilities() or nil,
|
||||||
}, opts.jdtls)
|
}, opts.jdtls)
|
||||||
|
|
||||||
-- Existing server will be reused if the root_dir matches.
|
-- Existing server will be reused if the root_dir matches.
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ return {
|
||||||
servers = {
|
servers = {
|
||||||
jsonls = {
|
jsonls = {
|
||||||
-- lazy-load schemastore when needed
|
-- lazy-load schemastore when needed
|
||||||
on_new_config = function(new_config)
|
before_init = function(_, new_config)
|
||||||
new_config.settings.json.schemas = new_config.settings.json.schemas or {}
|
new_config.settings.json.schemas = new_config.settings.json.schemas or {}
|
||||||
vim.list_extend(new_config.settings.json.schemas, require("schemastore").json.schemas())
|
vim.list_extend(new_config.settings.json.schemas, require("schemastore").json.schemas())
|
||||||
end,
|
end,
|
||||||
|
|
|
||||||
|
|
@ -108,7 +108,7 @@ return {
|
||||||
priority = 10,
|
priority = 10,
|
||||||
},
|
},
|
||||||
|
|
||||||
-- Redirect Lean's stderr messages somehwere (to a buffer by default)
|
-- Redirect Lean's stderr messages somewhere (to a buffer by default)
|
||||||
stderr = {
|
stderr = {
|
||||||
enable = true,
|
enable = true,
|
||||||
-- height of the window
|
-- height of the window
|
||||||
|
|
|
||||||
|
|
@ -113,17 +113,8 @@ return {
|
||||||
require("render-markdown").setup(opts)
|
require("render-markdown").setup(opts)
|
||||||
Snacks.toggle({
|
Snacks.toggle({
|
||||||
name = "Render Markdown",
|
name = "Render Markdown",
|
||||||
get = function()
|
get = require("render-markdown").get,
|
||||||
return require("render-markdown.state").enabled
|
set = require("render-markdown").set,
|
||||||
end,
|
|
||||||
set = function(enabled)
|
|
||||||
local m = require("render-markdown")
|
|
||||||
if enabled then
|
|
||||||
m.enable()
|
|
||||||
else
|
|
||||||
m.disable()
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
}):map("<leader>um")
|
}):map("<leader>um")
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -24,4 +24,13 @@ return {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"mfussenegger/nvim-lint",
|
||||||
|
optional = true,
|
||||||
|
opts = {
|
||||||
|
linters_by_ft = {
|
||||||
|
nix = { "statix" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -26,17 +26,19 @@ return {
|
||||||
"reason",
|
"reason",
|
||||||
"dune",
|
"dune",
|
||||||
},
|
},
|
||||||
root_dir = function(fname)
|
root_markers = {
|
||||||
return require("lspconfig.util").root_pattern(
|
function(name)
|
||||||
"*.opam",
|
return name:match(".*%.opam$")
|
||||||
"esy.json",
|
end,
|
||||||
"package.json",
|
"esy.json",
|
||||||
".git",
|
"package.json",
|
||||||
"dune-project",
|
".git",
|
||||||
"dune-workspace",
|
"dune-project",
|
||||||
"*.ml"
|
"dune-workspace",
|
||||||
)(fname)
|
function(name)
|
||||||
end,
|
return name:match(".*%.ml$")
|
||||||
|
end,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -27,12 +27,6 @@ return {
|
||||||
formatters_by_ft = {
|
formatters_by_ft = {
|
||||||
cs = { "csharpier" },
|
cs = { "csharpier" },
|
||||||
},
|
},
|
||||||
formatters = {
|
|
||||||
csharpier = {
|
|
||||||
command = "dotnet-csharpier",
|
|
||||||
args = { "--write-stdout" },
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
@ -104,12 +98,12 @@ return {
|
||||||
"nvim-neotest/neotest",
|
"nvim-neotest/neotest",
|
||||||
optional = true,
|
optional = true,
|
||||||
dependencies = {
|
dependencies = {
|
||||||
"Issafalcon/neotest-dotnet",
|
"Nsidorenco/neotest-vstest",
|
||||||
},
|
},
|
||||||
opts = {
|
opts = {
|
||||||
adapters = {
|
adapters = {
|
||||||
["neotest-dotnet"] = {
|
["neotest-vstest"] = {
|
||||||
-- Here we can set options for neotest-dotnet
|
-- Here we can set options for neotest-vstest
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -48,11 +48,10 @@ return {
|
||||||
optional = true,
|
optional = true,
|
||||||
opts = function()
|
opts = function()
|
||||||
local dap = require("dap")
|
local dap = require("dap")
|
||||||
local path = require("mason-registry").get_package("php-debug-adapter"):get_install_path()
|
|
||||||
dap.adapters.php = {
|
dap.adapters.php = {
|
||||||
type = "executable",
|
type = "executable",
|
||||||
command = "node",
|
command = "php-debug-adapter",
|
||||||
args = { path .. "/extension/out/phpDebug.js" },
|
args = {},
|
||||||
}
|
}
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -103,30 +103,20 @@ return {
|
||||||
{ "<leader>dPc", function() require('dap-python').test_class() end, desc = "Debug Class", ft = "python" },
|
{ "<leader>dPc", function() require('dap-python').test_class() end, desc = "Debug Class", ft = "python" },
|
||||||
},
|
},
|
||||||
config = function()
|
config = function()
|
||||||
if vim.fn.has("win32") == 1 then
|
require("dap-python").setup("debugpy-adapter")
|
||||||
require("dap-python").setup(LazyVim.get_pkg_path("debugpy", "/venv/Scripts/pythonw.exe"))
|
|
||||||
else
|
|
||||||
require("dap-python").setup(LazyVim.get_pkg_path("debugpy", "/venv/bin/python"))
|
|
||||||
end
|
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
"linux-cultist/venv-selector.nvim",
|
"linux-cultist/venv-selector.nvim",
|
||||||
branch = "regexp", -- Use this branch for the new version
|
|
||||||
cmd = "VenvSelect",
|
cmd = "VenvSelect",
|
||||||
enabled = function()
|
|
||||||
return LazyVim.has("telescope.nvim")
|
|
||||||
end,
|
|
||||||
opts = {
|
opts = {
|
||||||
settings = {
|
options = {
|
||||||
options = {
|
notify_user_on_venv_activation = true,
|
||||||
notify_user_on_venv_activation = true,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
-- Call config for python files and load the cached venv automatically
|
-- Call config for Python files and load the cached venv automatically
|
||||||
ft = "python",
|
ft = "python",
|
||||||
keys = { { "<leader>cv", "<cmd>:VenvSelect<cr>", desc = "Select VirtualEnv", ft = "python" } },
|
keys = { { "<leader>cv", "<cmd>:VenvSelect<cr>", desc = "Select VirtualEnv", ft = "python" } },
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -65,11 +65,7 @@ return {
|
||||||
opts = {
|
opts = {
|
||||||
servers = {
|
servers = {
|
||||||
r_language_server = {
|
r_language_server = {
|
||||||
root_dir = function(fname)
|
root_markers = { "DESCRIPTION", "NAMESPACE", ".Rbuildignore" },
|
||||||
return require("lspconfig.util").root_pattern("DESCRIPTION", "NAMESPACE", ".Rbuildignore")(fname)
|
|
||||||
or require("lspconfig.util").find_git_ancestor(fname)
|
|
||||||
or vim.loop.os_homedir()
|
|
||||||
end,
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -6,10 +6,6 @@ if lazyvim_docs then
|
||||||
end
|
end
|
||||||
|
|
||||||
local lsp = vim.g.lazyvim_ruby_lsp or "ruby_lsp"
|
local lsp = vim.g.lazyvim_ruby_lsp or "ruby_lsp"
|
||||||
if vim.fn.has("nvim-0.10") == 0 then
|
|
||||||
-- ruby_lsp does not work well with Neovim < 0.10
|
|
||||||
lsp = vim.g.lazyvim_ruby_lsp or "solargraph"
|
|
||||||
end
|
|
||||||
local formatter = vim.g.lazyvim_ruby_formatter or "rubocop"
|
local formatter = vim.g.lazyvim_ruby_formatter or "rubocop"
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|
@ -25,9 +21,8 @@ return {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"neovim/nvim-lspconfig",
|
"neovim/nvim-lspconfig",
|
||||||
---@class PluginLspOpts
|
---@type PluginLspOpts
|
||||||
opts = {
|
opts = {
|
||||||
---@type lspconfig.options
|
|
||||||
servers = {
|
servers = {
|
||||||
ruby_lsp = {
|
ruby_lsp = {
|
||||||
enabled = lsp == "ruby_lsp",
|
enabled = lsp == "ruby_lsp",
|
||||||
|
|
|
||||||
|
|
@ -56,7 +56,6 @@ return {
|
||||||
|
|
||||||
{
|
{
|
||||||
"mrcjkb/rustaceanvim",
|
"mrcjkb/rustaceanvim",
|
||||||
version = vim.fn.has("nvim-0.10.0") == 0 and "^4" or false,
|
|
||||||
ft = { "rust" },
|
ft = { "rust" },
|
||||||
opts = {
|
opts = {
|
||||||
server = {
|
server = {
|
||||||
|
|
@ -86,16 +85,12 @@ return {
|
||||||
},
|
},
|
||||||
procMacro = {
|
procMacro = {
|
||||||
enable = true,
|
enable = true,
|
||||||
ignored = {
|
|
||||||
["async-trait"] = { "async_trait" },
|
|
||||||
["napi-derive"] = { "napi" },
|
|
||||||
["async-recursion"] = { "async_recursion" },
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
files = {
|
files = {
|
||||||
excludeDirs = {
|
exclude = {
|
||||||
".direnv",
|
".direnv",
|
||||||
".git",
|
".git",
|
||||||
|
".jj",
|
||||||
".github",
|
".github",
|
||||||
".gitlab",
|
".gitlab",
|
||||||
"bin",
|
"bin",
|
||||||
|
|
@ -104,6 +99,8 @@ return {
|
||||||
"venv",
|
"venv",
|
||||||
".venv",
|
".venv",
|
||||||
},
|
},
|
||||||
|
-- Avoid Roots Scanned hanging, see https://github.com/rust-lang/rust-analyzer/issues/12613#issuecomment-2096386344
|
||||||
|
watcher = "client",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
@ -111,13 +108,9 @@ return {
|
||||||
},
|
},
|
||||||
config = function(_, opts)
|
config = function(_, opts)
|
||||||
if LazyVim.has("mason.nvim") then
|
if LazyVim.has("mason.nvim") then
|
||||||
local package_path = require("mason-registry").get_package("codelldb"):get_install_path()
|
local codelldb = vim.fn.exepath("codelldb")
|
||||||
local codelldb = package_path .. "/extension/adapter/codelldb"
|
local codelldb_lib_ext = io.popen("uname"):read("*l") == "Linux" and ".so" or ".dylib"
|
||||||
local library_path = package_path .. "/extension/lldb/lib/liblldb.dylib"
|
local library_path = vim.fn.expand("$MASON/opt/lldb/lib/liblldb" .. codelldb_lib_ext)
|
||||||
local uname = io.popen("uname"):read("*l")
|
|
||||||
if uname == "Linux" then
|
|
||||||
library_path = package_path .. "/extension/lldb/lib/liblldb.so"
|
|
||||||
end
|
|
||||||
opts.dap = {
|
opts.dap = {
|
||||||
adapter = require("rustaceanvim.config").get_codelldb_adapter(codelldb, library_path),
|
adapter = require("rustaceanvim.config").get_codelldb_adapter(codelldb, library_path),
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,11 @@ end
|
||||||
|
|
||||||
local sql_ft = { "sql", "mysql", "plsql" }
|
local sql_ft = { "sql", "mysql", "plsql" }
|
||||||
|
|
||||||
|
-- disable nvim default `sql_completion` plugin to be compatible with blink.cmp's omni
|
||||||
|
-- while still showing some keywords from the syntax autocomplete sources
|
||||||
|
vim.g.omni_sql_default_compl_type = "syntax"
|
||||||
|
vim.g.loaded_sql_completion = true
|
||||||
|
|
||||||
return {
|
return {
|
||||||
recommended = function()
|
recommended = function()
|
||||||
return LazyVim.extras.wants({
|
return LazyVim.extras.wants({
|
||||||
|
|
|
||||||
|
|
@ -31,11 +31,6 @@ return {
|
||||||
desc = "Organize Imports",
|
desc = "Organize Imports",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
capabilities = {
|
|
||||||
workspace = {
|
|
||||||
didChangeWatchedFiles = vim.fn.has("nvim-0.10") == 0 and { dynamicRegistration = true },
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -28,11 +28,10 @@ return {
|
||||||
},
|
},
|
||||||
setup = {
|
setup = {
|
||||||
tailwindcss = function(_, opts)
|
tailwindcss = function(_, opts)
|
||||||
local tw = LazyVim.lsp.get_raw_config("tailwindcss")
|
|
||||||
opts.filetypes = opts.filetypes or {}
|
opts.filetypes = opts.filetypes or {}
|
||||||
|
|
||||||
-- Add default filetypes
|
-- Add default filetypes
|
||||||
vim.list_extend(opts.filetypes, tw.default_config.filetypes)
|
vim.list_extend(opts.filetypes, vim.lsp.config.tailwindcss.filetypes)
|
||||||
|
|
||||||
-- Remove excluded filetypes
|
-- Remove excluded filetypes
|
||||||
--- @param ft string
|
--- @param ft string
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ return {
|
||||||
opts = function(_, opts)
|
opts = function(_, opts)
|
||||||
opts.highlight = opts.highlight or {}
|
opts.highlight = opts.highlight or {}
|
||||||
if type(opts.ensure_installed) == "table" then
|
if type(opts.ensure_installed) == "table" then
|
||||||
vim.list_extend(opts.ensure_installed, { "bibtex" })
|
vim.list_extend(opts.ensure_installed, { "bibtex", "latex" })
|
||||||
end
|
end
|
||||||
if type(opts.highlight.disable) == "table" then
|
if type(opts.highlight.disable) == "table" then
|
||||||
vim.list_extend(opts.highlight.disable, { "latex" })
|
vim.list_extend(opts.highlight.disable, { "latex" })
|
||||||
|
|
|
||||||
|
|
@ -69,7 +69,8 @@ return {
|
||||||
{
|
{
|
||||||
"gD",
|
"gD",
|
||||||
function()
|
function()
|
||||||
local params = vim.lsp.util.make_position_params()
|
local win = vim.api.nvim_get_current_win()
|
||||||
|
local params = vim.lsp.util.make_position_params(win, "utf-16")
|
||||||
LazyVim.lsp.execute({
|
LazyVim.lsp.execute({
|
||||||
command = "typescript.goToSourceDefinition",
|
command = "typescript.goToSourceDefinition",
|
||||||
arguments = { params.textDocument.uri, params.position },
|
arguments = { params.textDocument.uri, params.position },
|
||||||
|
|
@ -131,20 +132,42 @@ return {
|
||||||
return true
|
return true
|
||||||
end,
|
end,
|
||||||
vtsls = function(_, opts)
|
vtsls = function(_, opts)
|
||||||
|
if vim.lsp.config.denols and vim.lsp.config.vtsls then
|
||||||
|
---@param server string
|
||||||
|
local resolve = function(server)
|
||||||
|
local markers, root_dir = vim.lsp.config[server].root_markers, vim.lsp.config[server].root_dir
|
||||||
|
vim.lsp.config(server, {
|
||||||
|
root_dir = function(bufnr, on_dir)
|
||||||
|
local is_deno = vim.fs.root(bufnr, { "deno.json", "deno.jsonc" }) ~= nil
|
||||||
|
if is_deno == (server == "denols") then
|
||||||
|
if root_dir then
|
||||||
|
return root_dir(bufnr, on_dir)
|
||||||
|
elseif type(markers) == "table" then
|
||||||
|
local root = vim.fs.root(bufnr, markers)
|
||||||
|
return root and on_dir(root)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
resolve("denols")
|
||||||
|
resolve("vtsls")
|
||||||
|
end
|
||||||
|
|
||||||
LazyVim.lsp.on_attach(function(client, buffer)
|
LazyVim.lsp.on_attach(function(client, buffer)
|
||||||
client.commands["_typescript.moveToFileRefactoring"] = function(command, ctx)
|
client.commands["_typescript.moveToFileRefactoring"] = function(command, ctx)
|
||||||
---@type string, string, lsp.Range
|
---@type string, string, lsp.Range
|
||||||
local action, uri, range = unpack(command.arguments)
|
local action, uri, range = unpack(command.arguments)
|
||||||
|
|
||||||
local function move(newf)
|
local function move(newf)
|
||||||
client.request("workspace/executeCommand", {
|
client:request("workspace/executeCommand", {
|
||||||
command = command.command,
|
command = command.command,
|
||||||
arguments = { action, uri, range, newf },
|
arguments = { action, uri, range, newf },
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
local fname = vim.uri_to_fname(uri)
|
local fname = vim.uri_to_fname(uri)
|
||||||
client.request("workspace/executeCommand", {
|
client:request("workspace/executeCommand", {
|
||||||
command = "typescript.tsserverRequest",
|
command = "typescript.tsserverRequest",
|
||||||
arguments = {
|
arguments = {
|
||||||
"getMoveToRefactoringFileSuggestions",
|
"getMoveToRefactoringFileSuggestions",
|
||||||
|
|
@ -240,6 +263,10 @@ return {
|
||||||
|
|
||||||
for _, language in ipairs(js_filetypes) do
|
for _, language in ipairs(js_filetypes) do
|
||||||
if not dap.configurations[language] then
|
if not dap.configurations[language] then
|
||||||
|
local runtimeExecutable = nil
|
||||||
|
if language:find("typescript") then
|
||||||
|
runtimeExecutable = vim.fn.executable("tsx") == 1 and "tsx" or "ts-node"
|
||||||
|
end
|
||||||
dap.configurations[language] = {
|
dap.configurations[language] = {
|
||||||
{
|
{
|
||||||
type = "pwa-node",
|
type = "pwa-node",
|
||||||
|
|
@ -247,6 +274,16 @@ return {
|
||||||
name = "Launch file",
|
name = "Launch file",
|
||||||
program = "${file}",
|
program = "${file}",
|
||||||
cwd = "${workspaceFolder}",
|
cwd = "${workspaceFolder}",
|
||||||
|
sourceMaps = true,
|
||||||
|
runtimeExecutable = runtimeExecutable,
|
||||||
|
skipFiles = {
|
||||||
|
"<node_internals>/**",
|
||||||
|
"node_modules/**",
|
||||||
|
},
|
||||||
|
resolveSourceMapLocations = {
|
||||||
|
"${workspaceFolder}/**",
|
||||||
|
"!**/node_modules/**",
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type = "pwa-node",
|
type = "pwa-node",
|
||||||
|
|
@ -254,6 +291,16 @@ return {
|
||||||
name = "Attach",
|
name = "Attach",
|
||||||
processId = require("dap.utils").pick_process,
|
processId = require("dap.utils").pick_process,
|
||||||
cwd = "${workspaceFolder}",
|
cwd = "${workspaceFolder}",
|
||||||
|
sourceMaps = true,
|
||||||
|
runtimeExecutable = runtimeExecutable,
|
||||||
|
skipFiles = {
|
||||||
|
"<node_internals>/**",
|
||||||
|
"node_modules/**",
|
||||||
|
},
|
||||||
|
resolveSourceMapLocations = {
|
||||||
|
"${workspaceFolder}/**",
|
||||||
|
"!**/node_modules/**",
|
||||||
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
@ -263,7 +310,7 @@ return {
|
||||||
|
|
||||||
-- Filetype icons
|
-- Filetype icons
|
||||||
{
|
{
|
||||||
"echasnovski/mini.icons",
|
"nvim-mini/mini.icons",
|
||||||
opts = {
|
opts = {
|
||||||
file = {
|
file = {
|
||||||
[".eslintrc.js"] = { glyph = "", hl = "MiniIconsYellow" },
|
[".eslintrc.js"] = { glyph = "", hl = "MiniIconsYellow" },
|
||||||
|
|
|
||||||
|
|
@ -19,13 +19,7 @@ return {
|
||||||
"neovim/nvim-lspconfig",
|
"neovim/nvim-lspconfig",
|
||||||
opts = {
|
opts = {
|
||||||
servers = {
|
servers = {
|
||||||
volar = {
|
vue_ls = {},
|
||||||
init_options = {
|
|
||||||
vue = {
|
|
||||||
hybridMode = true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
vtsls = {},
|
vtsls = {},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ return {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
-- lazy-load schemastore when needed
|
-- lazy-load schemastore when needed
|
||||||
on_new_config = function(new_config)
|
before_init = function(_, new_config)
|
||||||
new_config.settings.yaml.schemas = vim.tbl_deep_extend(
|
new_config.settings.yaml.schemas = vim.tbl_deep_extend(
|
||||||
"force",
|
"force",
|
||||||
new_config.settings.yaml.schemas or {},
|
new_config.settings.yaml.schemas or {},
|
||||||
|
|
@ -55,16 +55,6 @@ return {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
setup = {
|
|
||||||
yamlls = function()
|
|
||||||
-- Neovim < 0.10 does not have dynamic registration for formatting
|
|
||||||
if vim.fn.has("nvim-0.10") == 0 then
|
|
||||||
LazyVim.lsp.on_attach(function(client, _)
|
|
||||||
client.server_capabilities.documentFormattingProvider = true
|
|
||||||
end, "yamlls")
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ return {
|
||||||
"neovim/nvim-lspconfig",
|
"neovim/nvim-lspconfig",
|
||||||
-- other settings removed for brevity
|
-- other settings removed for brevity
|
||||||
opts = {
|
opts = {
|
||||||
---@type lspconfig.options
|
---@type table<string, vim.lsp.Config>
|
||||||
servers = {
|
servers = {
|
||||||
eslint = {
|
eslint = {
|
||||||
settings = {
|
settings = {
|
||||||
|
|
@ -26,10 +26,6 @@ return {
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
local function get_client(buf)
|
|
||||||
return LazyVim.lsp.get_clients({ name = "eslint", bufnr = buf })[1]
|
|
||||||
end
|
|
||||||
|
|
||||||
local formatter = LazyVim.lsp.formatter({
|
local formatter = LazyVim.lsp.formatter({
|
||||||
name = "eslint: lsp",
|
name = "eslint: lsp",
|
||||||
primary = false,
|
primary = false,
|
||||||
|
|
@ -37,24 +33,6 @@ return {
|
||||||
filter = "eslint",
|
filter = "eslint",
|
||||||
})
|
})
|
||||||
|
|
||||||
-- Use EslintFixAll on Neovim < 0.10.0
|
|
||||||
if not pcall(require, "vim.lsp._dynamic") then
|
|
||||||
formatter.name = "eslint: EslintFixAll"
|
|
||||||
formatter.sources = function(buf)
|
|
||||||
local client = get_client(buf)
|
|
||||||
return client and { "eslint" } or {}
|
|
||||||
end
|
|
||||||
formatter.format = function(buf)
|
|
||||||
local client = get_client(buf)
|
|
||||||
if client then
|
|
||||||
local diag = vim.diagnostic.get(buf, { namespace = vim.lsp.diagnostic.get_namespace(client.id) })
|
|
||||||
if #diag > 0 then
|
|
||||||
vim.cmd("EslintFixAll")
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
-- register the formatter with LazyVim
|
-- register the formatter with LazyVim
|
||||||
LazyVim.format.register(formatter)
|
LazyVim.format.register(formatter)
|
||||||
end,
|
end,
|
||||||
|
|
|
||||||
|
|
@ -106,6 +106,7 @@ return {
|
||||||
-- stylua: ignore
|
-- stylua: ignore
|
||||||
keys = {
|
keys = {
|
||||||
{"<leader>t", "", desc = "+test"},
|
{"<leader>t", "", desc = "+test"},
|
||||||
|
{ "<leader>ta", function() require("neotest").run.attach() end, desc = "Attach to Test (Neotest)" },
|
||||||
{ "<leader>tt", function() require("neotest").run.run(vim.fn.expand("%")) end, desc = "Run File (Neotest)" },
|
{ "<leader>tt", function() require("neotest").run.run(vim.fn.expand("%")) end, desc = "Run File (Neotest)" },
|
||||||
{ "<leader>tT", function() require("neotest").run.run(vim.uv.cwd()) end, desc = "Run All Test Files (Neotest)" },
|
{ "<leader>tT", function() require("neotest").run.run(vim.uv.cwd()) end, desc = "Run All Test Files (Neotest)" },
|
||||||
{ "<leader>tr", function() require("neotest").run.run() end, desc = "Run Nearest (Neotest)" },
|
{ "<leader>tr", function() require("neotest").run.run() end, desc = "Run Nearest (Neotest)" },
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
return {
|
return {
|
||||||
-- edgy
|
-- Create and display predefined window layouts.
|
||||||
{
|
{
|
||||||
"folke/edgy.nvim",
|
"folke/edgy.nvim",
|
||||||
event = "VeryLazy",
|
event = "VeryLazy",
|
||||||
|
|
|
||||||
|
|
@ -8,9 +8,10 @@ return {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
-- setup animate
|
-- Animates many common Neovim actions, like scrolling,
|
||||||
|
-- moving the cursor, and resizing windows.
|
||||||
{
|
{
|
||||||
"echasnovski/mini.animate",
|
"nvim-mini/mini.animate",
|
||||||
event = "VeryLazy",
|
event = "VeryLazy",
|
||||||
cond = vim.g.neovide == nil,
|
cond = vim.g.neovide == nil,
|
||||||
opts = function(_, opts)
|
opts = function(_, opts)
|
||||||
|
|
@ -31,15 +32,19 @@ return {
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
Snacks.toggle({
|
-- schedule setting the mapping to override the default mapping from `keymaps.lua`
|
||||||
name = "Mini Animate",
|
-- seems `keymaps.lua` is the last event to execute on `VeryLazy` and it overwrites it
|
||||||
get = function()
|
vim.schedule(function()
|
||||||
return not vim.g.minianimate_disable
|
Snacks.toggle({
|
||||||
end,
|
name = "Mini Animate",
|
||||||
set = function(state)
|
get = function()
|
||||||
vim.g.minianimate_disable = not state
|
return not vim.g.minianimate_disable
|
||||||
end,
|
end,
|
||||||
}):map("<leader>ua")
|
set = function(state)
|
||||||
|
vim.g.minianimate_disable = not state
|
||||||
|
end,
|
||||||
|
}):map("<leader>ua")
|
||||||
|
end)
|
||||||
|
|
||||||
local animate = require("mini.animate")
|
local animate = require("mini.animate")
|
||||||
return vim.tbl_deep_extend("force", opts, {
|
return vim.tbl_deep_extend("force", opts, {
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ return {
|
||||||
-- code, this highlights the current level of indentation, and animates
|
-- code, this highlights the current level of indentation, and animates
|
||||||
-- the highlighting.
|
-- the highlighting.
|
||||||
{
|
{
|
||||||
"echasnovski/mini.indentscope",
|
"nvim-mini/mini.indentscope",
|
||||||
version = false, -- wait till new 0.7.0 release to put it back on semver
|
version = false, -- wait till new 0.7.0 release to put it back on semver
|
||||||
event = "LazyFile",
|
event = "LazyFile",
|
||||||
opts = {
|
opts = {
|
||||||
|
|
@ -23,6 +23,7 @@ return {
|
||||||
"mason",
|
"mason",
|
||||||
"neo-tree",
|
"neo-tree",
|
||||||
"notify",
|
"notify",
|
||||||
|
"sidekick_terminal",
|
||||||
"snacks_dashboard",
|
"snacks_dashboard",
|
||||||
"snacks_notif",
|
"snacks_notif",
|
||||||
"snacks_terminal",
|
"snacks_terminal",
|
||||||
|
|
@ -44,7 +45,7 @@ return {
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
||||||
-- disable inent-blankline scope when mini-indentscope is enabled
|
-- disable indent-blankline scope when mini-indentscope is enabled
|
||||||
{
|
{
|
||||||
"lukas-reineke/indent-blankline.nvim",
|
"lukas-reineke/indent-blankline.nvim",
|
||||||
optional = true,
|
optional = true,
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ return {
|
||||||
|
|
||||||
-- enable mini.starter
|
-- enable mini.starter
|
||||||
{
|
{
|
||||||
"echasnovski/mini.starter",
|
"nvim-mini/mini.starter",
|
||||||
version = false, -- wait till new 0.7.0 release to put it back on semver
|
version = false, -- wait till new 0.7.0 release to put it back on semver
|
||||||
event = "VimEnter",
|
event = "VimEnter",
|
||||||
opts = function()
|
opts = function()
|
||||||
|
|
@ -67,7 +67,7 @@ return {
|
||||||
local ms = (math.floor(stats.startuptime * 100 + 0.5) / 100)
|
local ms = (math.floor(stats.startuptime * 100 + 0.5) / 100)
|
||||||
local pad_footer = string.rep(" ", 8)
|
local pad_footer = string.rep(" ", 8)
|
||||||
starter.config.footer = pad_footer .. "⚡ Neovim loaded " .. stats.count .. " plugins in " .. ms .. "ms"
|
starter.config.footer = pad_footer .. "⚡ Neovim loaded " .. stats.count .. " plugins in " .. ms .. "ms"
|
||||||
-- INFO: based on @echasnovski's recommendation (thanks a lot!!!)
|
-- INFO: based on @nvim-mini's recommendation (thanks a lot!!!)
|
||||||
if vim.bo[ev.buf].filetype == "ministarter" then
|
if vim.bo[ev.buf].filetype == "ministarter" then
|
||||||
pcall(starter.refresh)
|
pcall(starter.refresh)
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
-- Animates cursor movement with a smear effect.
|
||||||
return {
|
return {
|
||||||
"sphamba/smear-cursor.nvim",
|
"sphamba/smear-cursor.nvim",
|
||||||
event = "VeryLazy",
|
event = "VeryLazy",
|
||||||
|
|
@ -9,7 +10,7 @@ return {
|
||||||
specs = {
|
specs = {
|
||||||
-- disable mini.animate cursor
|
-- disable mini.animate cursor
|
||||||
{
|
{
|
||||||
"echasnovski/mini.animate",
|
"nvim-mini/mini.animate",
|
||||||
optional = true,
|
optional = true,
|
||||||
opts = {
|
opts = {
|
||||||
cursor = { enable = false },
|
cursor = { enable = false },
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ local pick_chezmoi = function()
|
||||||
fzf_lua.actions.vimcmd_entry("ChezmoiEdit", selected, { cwd = os.getenv("HOME") })
|
fzf_lua.actions.vimcmd_entry("ChezmoiEdit", selected, { cwd = os.getenv("HOME") })
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
fzf_lua.files({ cmd = "chezmoi managed --include=files,symlinks", actions = actions })
|
fzf_lua.files({ cmd = "chezmoi managed --include=files,symlinks", actions = actions, hidden = false })
|
||||||
elseif LazyVim.pick.picker.name == "snacks" then
|
elseif LazyVim.pick.picker.name == "snacks" then
|
||||||
local results = require("chezmoi.commands").list({
|
local results = require("chezmoi.commands").list({
|
||||||
args = {
|
args = {
|
||||||
|
|
@ -135,7 +135,7 @@ return {
|
||||||
|
|
||||||
-- Filetype icons
|
-- Filetype icons
|
||||||
{
|
{
|
||||||
"echasnovski/mini.icons",
|
"nvim-mini/mini.icons",
|
||||||
opts = {
|
opts = {
|
||||||
file = {
|
file = {
|
||||||
[".chezmoiignore"] = { glyph = "", hl = "MiniIconsGrey" },
|
[".chezmoiignore"] = { glyph = "", hl = "MiniIconsGrey" },
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ local M = {}
|
||||||
M.hl = {}
|
M.hl = {}
|
||||||
|
|
||||||
M.plugin = {
|
M.plugin = {
|
||||||
"echasnovski/mini.hipatterns",
|
"nvim-mini/mini.hipatterns",
|
||||||
recommended = true,
|
recommended = true,
|
||||||
desc = "Highlight colors in your code. Also includes Tailwind CSS support.",
|
desc = "Highlight colors in your code. Also includes Tailwind CSS support.",
|
||||||
event = "LazyFile",
|
event = "LazyFile",
|
||||||
|
|
|
||||||
|
|
@ -134,7 +134,7 @@ return {
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
"echasnovski/mini.starter",
|
"nvim-mini/mini.starter",
|
||||||
optional = true,
|
optional = true,
|
||||||
opts = function(_, opts)
|
opts = function(_, opts)
|
||||||
local items = {
|
local items = {
|
||||||
|
|
|
||||||
|
|
@ -8,10 +8,11 @@ return {
|
||||||
"mistweaverco/kulala.nvim",
|
"mistweaverco/kulala.nvim",
|
||||||
ft = "http",
|
ft = "http",
|
||||||
keys = {
|
keys = {
|
||||||
{ "<leader>R", "", desc = "+Rest", ft = "http" },
|
{ "<leader>R", "", desc = "+Rest" },
|
||||||
{ "<leader>Rb", "<cmd>lua require('kulala').scratchpad()<cr>", desc = "Open scratchpad", ft = "http" },
|
{ "<leader>Rb", "<cmd>lua require('kulala').scratchpad()<cr>", desc = "Open scratchpad" },
|
||||||
{ "<leader>Rc", "<cmd>lua require('kulala').copy()<cr>", desc = "Copy as cURL", ft = "http" },
|
{ "<leader>Rc", "<cmd>lua require('kulala').copy()<cr>", desc = "Copy as cURL", ft = "http" },
|
||||||
{ "<leader>RC", "<cmd>lua require('kulala').from_curl()<cr>", desc = "Paste from curl", ft = "http" },
|
{ "<leader>RC", "<cmd>lua require('kulala').from_curl()<cr>", desc = "Paste from curl", ft = "http" },
|
||||||
|
{ "<leader>Re", "<cmd>lua require('kulala').set_selected_env()<cr>", desc = "Set environment", ft = "http" },
|
||||||
{
|
{
|
||||||
"<leader>Rg",
|
"<leader>Rg",
|
||||||
"<cmd>lua require('kulala').download_graphql_schema()<cr>",
|
"<cmd>lua require('kulala').download_graphql_schema()<cr>",
|
||||||
|
|
@ -22,7 +23,7 @@ return {
|
||||||
{ "<leader>Rn", "<cmd>lua require('kulala').jump_next()<cr>", desc = "Jump to next request", ft = "http" },
|
{ "<leader>Rn", "<cmd>lua require('kulala').jump_next()<cr>", desc = "Jump to next request", ft = "http" },
|
||||||
{ "<leader>Rp", "<cmd>lua require('kulala').jump_prev()<cr>", desc = "Jump to previous request", ft = "http" },
|
{ "<leader>Rp", "<cmd>lua require('kulala').jump_prev()<cr>", desc = "Jump to previous request", ft = "http" },
|
||||||
{ "<leader>Rq", "<cmd>lua require('kulala').close()<cr>", desc = "Close window", ft = "http" },
|
{ "<leader>Rq", "<cmd>lua require('kulala').close()<cr>", desc = "Close window", ft = "http" },
|
||||||
{ "<leader>Rr", "<cmd>lua require('kulala').replay()<cr>", desc = "Replay the last request", ft = "http" },
|
{ "<leader>Rr", "<cmd>lua require('kulala').replay()<cr>", desc = "Replay the last request" },
|
||||||
{ "<leader>Rs", "<cmd>lua require('kulala').run()<cr>", desc = "Send the request", ft = "http" },
|
{ "<leader>Rs", "<cmd>lua require('kulala').run()<cr>", desc = "Send the request", ft = "http" },
|
||||||
{ "<leader>RS", "<cmd>lua require('kulala').show_stats()<cr>", desc = "Show stats", ft = "http" },
|
{ "<leader>RS", "<cmd>lua require('kulala').show_stats()<cr>", desc = "Show stats", ft = "http" },
|
||||||
{ "<leader>Rt", "<cmd>lua require('kulala').toggle_view()<cr>", desc = "Toggle headers/body", ft = "http" },
|
{ "<leader>Rt", "<cmd>lua require('kulala').toggle_view()<cr>", desc = "Toggle headers/body", ft = "http" },
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,20 @@
|
||||||
if vim.fn.has("nvim-0.9.0") == 0 then
|
if vim.fn.has("nvim-0.11.2") == 0 then
|
||||||
vim.api.nvim_echo({
|
vim.api.nvim_echo({
|
||||||
{ "LazyVim requires Neovim >= 0.9.0\n", "ErrorMsg" },
|
{ "LazyVim requires Neovim >= 0.11.2\n", "ErrorMsg" },
|
||||||
|
{ "For more info, see: https://github.com/LazyVim/LazyVim/issues/6421\n", "Comment" },
|
||||||
{ "Press any key to exit", "MoreMsg" },
|
{ "Press any key to exit", "MoreMsg" },
|
||||||
}, true, {})
|
}, true, {})
|
||||||
vim.fn.getchar()
|
vim.fn.getchar()
|
||||||
vim.cmd([[quit]])
|
vim.cmd([[quit]])
|
||||||
return {}
|
return {}
|
||||||
|
elseif not vim.lsp.is_enabled then
|
||||||
|
vim.schedule(function()
|
||||||
|
LazyVim.warn({
|
||||||
|
"You're using an **old** `nightly` version of **Neovim**",
|
||||||
|
"Please update to a recent `nightly`,",
|
||||||
|
"or a stable version (`>= 0.11.2`).",
|
||||||
|
})
|
||||||
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
require("lazyvim.config").init()
|
require("lazyvim.config").init()
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,6 @@
|
||||||
return {
|
return {
|
||||||
|
-- Asynchronously calls language-specific linter tools and reports
|
||||||
|
-- their results via the `vim.diagnostic` module.
|
||||||
{
|
{
|
||||||
"mfussenegger/nvim-lint",
|
"mfussenegger/nvim-lint",
|
||||||
event = "LazyFile",
|
event = "LazyFile",
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,6 @@ return {
|
||||||
source = "if_many",
|
source = "if_many",
|
||||||
prefix = "●",
|
prefix = "●",
|
||||||
-- this will set set the prefix to a function that returns the diagnostics icon based on the severity
|
-- this will set set the prefix to a function that returns the diagnostics icon based on the severity
|
||||||
-- this only works on a recent 0.10.0 build. Will be set to "●" when not supported
|
|
||||||
-- prefix = "icons",
|
-- prefix = "icons",
|
||||||
},
|
},
|
||||||
severity_sort = true,
|
severity_sort = true,
|
||||||
|
|
@ -33,19 +32,25 @@ return {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
-- Enable this to enable the builtin LSP inlay hints on Neovim >= 0.10.0
|
-- Enable this to enable the builtin LSP inlay hints on Neovim.
|
||||||
-- Be aware that you also will need to properly configure your LSP server to
|
-- Be aware that you also will need to properly configure your LSP server to
|
||||||
-- provide the inlay hints.
|
-- provide the inlay hints.
|
||||||
inlay_hints = {
|
inlay_hints = {
|
||||||
enabled = true,
|
enabled = true,
|
||||||
exclude = { "vue" }, -- filetypes for which you don't want to enable inlay hints
|
exclude = { "vue" }, -- filetypes for which you don't want to enable inlay hints
|
||||||
},
|
},
|
||||||
-- Enable this to enable the builtin LSP code lenses on Neovim >= 0.10.0
|
-- Enable this to enable the builtin LSP code lenses on Neovim.
|
||||||
-- Be aware that you also will need to properly configure your LSP server to
|
-- Be aware that you also will need to properly configure your LSP server to
|
||||||
-- provide the code lenses.
|
-- provide the code lenses.
|
||||||
codelens = {
|
codelens = {
|
||||||
enabled = false,
|
enabled = false,
|
||||||
},
|
},
|
||||||
|
-- Enable this to enable the builtin LSP folding on Neovim.
|
||||||
|
-- Be aware that you also will need to properly configure your LSP server to
|
||||||
|
-- provide the folds.
|
||||||
|
folds = {
|
||||||
|
enabled = true,
|
||||||
|
},
|
||||||
-- add any global capabilities here
|
-- add any global capabilities here
|
||||||
capabilities = {
|
capabilities = {
|
||||||
workspace = {
|
workspace = {
|
||||||
|
|
@ -63,8 +68,10 @@ return {
|
||||||
timeout_ms = nil,
|
timeout_ms = nil,
|
||||||
},
|
},
|
||||||
-- LSP Server Settings
|
-- LSP Server Settings
|
||||||
---@type lspconfig.options
|
---@alias lazyvim.lsp.Config vim.lsp.Config|{mason?:boolean, enabled?:boolean}
|
||||||
|
---@type table<string, lazyvim.lsp.Config|boolean>
|
||||||
servers = {
|
servers = {
|
||||||
|
stylua = { enabled = false },
|
||||||
lua_ls = {
|
lua_ls = {
|
||||||
-- mason = false, -- set to false if you don't want this server to be installed with mason
|
-- mason = false, -- set to false if you don't want this server to be installed with mason
|
||||||
-- Use this to add any additional keymaps
|
-- Use this to add any additional keymaps
|
||||||
|
|
@ -99,7 +106,7 @@ return {
|
||||||
},
|
},
|
||||||
-- you can do any additional lsp server setup here
|
-- you can do any additional lsp server setup here
|
||||||
-- return true if you don't want this server to be setup with lspconfig
|
-- return true if you don't want this server to be setup with lspconfig
|
||||||
---@type table<string, fun(server:string, opts:_.lspconfig.options):boolean?>
|
---@type table<string, fun(server:string, opts: vim.lsp.Config):boolean?>
|
||||||
setup = {
|
setup = {
|
||||||
-- example to setup with typescript.nvim
|
-- example to setup with typescript.nvim
|
||||||
-- tsserver = function(_, opts)
|
-- tsserver = function(_, opts)
|
||||||
|
|
@ -113,7 +120,7 @@ return {
|
||||||
return ret
|
return ret
|
||||||
end,
|
end,
|
||||||
---@param opts PluginLspOpts
|
---@param opts PluginLspOpts
|
||||||
config = function(_, opts)
|
config = vim.schedule_wrap(function(_, opts)
|
||||||
-- setup autoformat
|
-- setup autoformat
|
||||||
LazyVim.format.register(LazyVim.lsp.formatter())
|
LazyVim.format.register(LazyVim.lsp.formatter())
|
||||||
|
|
||||||
|
|
@ -125,133 +132,95 @@ return {
|
||||||
LazyVim.lsp.setup()
|
LazyVim.lsp.setup()
|
||||||
LazyVim.lsp.on_dynamic_capability(require("lazyvim.plugins.lsp.keymaps").on_attach)
|
LazyVim.lsp.on_dynamic_capability(require("lazyvim.plugins.lsp.keymaps").on_attach)
|
||||||
|
|
||||||
-- diagnostics signs
|
-- inlay hints
|
||||||
if vim.fn.has("nvim-0.10.0") == 0 then
|
if opts.inlay_hints.enabled then
|
||||||
if type(opts.diagnostics.signs) ~= "boolean" then
|
LazyVim.lsp.on_supports_method("textDocument/inlayHint", function(client, buffer)
|
||||||
for severity, icon in pairs(opts.diagnostics.signs.text) do
|
if
|
||||||
local name = vim.diagnostic.severity[severity]:lower():gsub("^%l", string.upper)
|
vim.api.nvim_buf_is_valid(buffer)
|
||||||
name = "DiagnosticSign" .. name
|
and vim.bo[buffer].buftype == ""
|
||||||
vim.fn.sign_define(name, { text = icon, texthl = name, numhl = "" })
|
and not vim.tbl_contains(opts.inlay_hints.exclude, vim.bo[buffer].filetype)
|
||||||
|
then
|
||||||
|
vim.lsp.inlay_hint.enable(true, { bufnr = buffer })
|
||||||
end
|
end
|
||||||
end
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
if vim.fn.has("nvim-0.10") == 1 then
|
-- folds
|
||||||
-- inlay hints
|
if opts.folds.enabled then
|
||||||
if opts.inlay_hints.enabled then
|
LazyVim.lsp.on_supports_method("textDocument/foldingRange", function(client, buffer)
|
||||||
LazyVim.lsp.on_supports_method("textDocument/inlayHint", function(client, buffer)
|
if LazyVim.set_default("foldmethod", "expr") then
|
||||||
if
|
LazyVim.set_default("foldexpr", "v:lua.vim.lsp.foldexpr()")
|
||||||
vim.api.nvim_buf_is_valid(buffer)
|
end
|
||||||
and vim.bo[buffer].buftype == ""
|
end)
|
||||||
and not vim.tbl_contains(opts.inlay_hints.exclude, vim.bo[buffer].filetype)
|
|
||||||
then
|
|
||||||
vim.lsp.inlay_hint.enable(true, { bufnr = buffer })
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- code lens
|
|
||||||
if opts.codelens.enabled and vim.lsp.codelens then
|
|
||||||
LazyVim.lsp.on_supports_method("textDocument/codeLens", function(client, buffer)
|
|
||||||
vim.lsp.codelens.refresh()
|
|
||||||
vim.api.nvim_create_autocmd({ "BufEnter", "CursorHold", "InsertLeave" }, {
|
|
||||||
buffer = buffer,
|
|
||||||
callback = vim.lsp.codelens.refresh,
|
|
||||||
})
|
|
||||||
end)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- code lens
|
||||||
|
if opts.codelens.enabled and vim.lsp.codelens then
|
||||||
|
LazyVim.lsp.on_supports_method("textDocument/codeLens", function(client, buffer)
|
||||||
|
vim.lsp.codelens.refresh()
|
||||||
|
vim.api.nvim_create_autocmd({ "BufEnter", "CursorHold", "InsertLeave" }, {
|
||||||
|
buffer = buffer,
|
||||||
|
callback = vim.lsp.codelens.refresh,
|
||||||
|
})
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- diagnostics
|
||||||
if type(opts.diagnostics.virtual_text) == "table" and opts.diagnostics.virtual_text.prefix == "icons" then
|
if type(opts.diagnostics.virtual_text) == "table" and opts.diagnostics.virtual_text.prefix == "icons" then
|
||||||
opts.diagnostics.virtual_text.prefix = vim.fn.has("nvim-0.10.0") == 0 and "●"
|
opts.diagnostics.virtual_text.prefix = function(diagnostic)
|
||||||
or function(diagnostic)
|
local icons = LazyVim.config.icons.diagnostics
|
||||||
local icons = LazyVim.config.icons.diagnostics
|
for d, icon in pairs(icons) do
|
||||||
for d, icon in pairs(icons) do
|
if diagnostic.severity == vim.diagnostic.severity[d:upper()] then
|
||||||
if diagnostic.severity == vim.diagnostic.severity[d:upper()] then
|
return icon
|
||||||
return icon
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
return "●"
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
vim.diagnostic.config(vim.deepcopy(opts.diagnostics))
|
vim.diagnostic.config(vim.deepcopy(opts.diagnostics))
|
||||||
|
|
||||||
local servers = opts.servers
|
if opts.capabilities then
|
||||||
local has_cmp, cmp_nvim_lsp = pcall(require, "cmp_nvim_lsp")
|
vim.lsp.config("*", { capabilities = opts.capabilities })
|
||||||
local has_blink, blink = pcall(require, "blink.cmp")
|
|
||||||
local capabilities = vim.tbl_deep_extend(
|
|
||||||
"force",
|
|
||||||
{},
|
|
||||||
vim.lsp.protocol.make_client_capabilities(),
|
|
||||||
has_cmp and cmp_nvim_lsp.default_capabilities() or {},
|
|
||||||
has_blink and blink.get_lsp_capabilities() or {},
|
|
||||||
opts.capabilities or {}
|
|
||||||
)
|
|
||||||
|
|
||||||
local function setup(server)
|
|
||||||
local server_opts = vim.tbl_deep_extend("force", {
|
|
||||||
capabilities = vim.deepcopy(capabilities),
|
|
||||||
}, servers[server] or {})
|
|
||||||
if server_opts.enabled == false then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
if opts.setup[server] then
|
|
||||||
if opts.setup[server](server, server_opts) then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
elseif opts.setup["*"] then
|
|
||||||
if opts.setup["*"](server, server_opts) then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
end
|
|
||||||
require("lspconfig")[server].setup(server_opts)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
-- get all the servers that are available through mason-lspconfig
|
-- get all the servers that are available through mason-lspconfig
|
||||||
local have_mason, mlsp = pcall(require, "mason-lspconfig")
|
local have_mason = LazyVim.has("mason-lspconfig.nvim")
|
||||||
local all_mslp_servers = {}
|
local mason_all = have_mason
|
||||||
if have_mason then
|
and vim.tbl_keys(require("mason-lspconfig.mappings").get_mason_map().lspconfig_to_package)
|
||||||
all_mslp_servers = vim.tbl_keys(require("mason-lspconfig.mappings.server").lspconfig_to_package)
|
or {} --[[ @as string[] ]]
|
||||||
end
|
local mason_exclude = {} ---@type string[]
|
||||||
|
|
||||||
local ensure_installed = {} ---@type string[]
|
---@return boolean? exclude automatic setup
|
||||||
for server, server_opts in pairs(servers) do
|
local function configure(server)
|
||||||
if server_opts then
|
local sopts = opts.servers[server]
|
||||||
server_opts = server_opts == true and {} or server_opts
|
sopts = sopts == true and {} or (not sopts) and { enabled = false } or sopts --[[@as lazyvim.lsp.Config]]
|
||||||
if server_opts.enabled ~= false then
|
|
||||||
-- run manual setup if mason=false or if this is a server that cannot be installed with mason-lspconfig
|
if sopts.enabled == false then
|
||||||
if server_opts.mason == false or not vim.tbl_contains(all_mslp_servers, server) then
|
mason_exclude[#mason_exclude + 1] = server
|
||||||
setup(server)
|
return
|
||||||
else
|
end
|
||||||
ensure_installed[#ensure_installed + 1] = server
|
|
||||||
end
|
local use_mason = sopts.mason ~= false and vim.tbl_contains(mason_all, server)
|
||||||
|
local setup = opts.setup[server] or opts.setup["*"]
|
||||||
|
if setup and setup(server, sopts) then
|
||||||
|
mason_exclude[#mason_exclude + 1] = server
|
||||||
|
else
|
||||||
|
vim.lsp.config(server, sopts) -- configure the server
|
||||||
|
if not use_mason then
|
||||||
|
vim.lsp.enable(server)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
return use_mason
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local install = vim.tbl_filter(configure, vim.tbl_keys(opts.servers))
|
||||||
if have_mason then
|
if have_mason then
|
||||||
mlsp.setup({
|
require("mason-lspconfig").setup({
|
||||||
ensure_installed = vim.tbl_deep_extend(
|
ensure_installed = vim.list_extend(install, LazyVim.opts("mason-lspconfig.nvim").ensure_installed or {}),
|
||||||
"force",
|
automatic_enable = { exclude = mason_exclude },
|
||||||
ensure_installed,
|
|
||||||
LazyVim.opts("mason-lspconfig.nvim").ensure_installed or {}
|
|
||||||
),
|
|
||||||
handlers = { setup },
|
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
end),
|
||||||
if LazyVim.lsp.is_enabled("denols") and LazyVim.lsp.is_enabled("vtsls") then
|
|
||||||
local is_deno = require("lspconfig.util").root_pattern("deno.json", "deno.jsonc")
|
|
||||||
LazyVim.lsp.disable("vtsls", is_deno)
|
|
||||||
LazyVim.lsp.disable("denols", function(root_dir, config)
|
|
||||||
if not is_deno(root_dir) then
|
|
||||||
config.settings.deno.enable = false
|
|
||||||
end
|
|
||||||
return false
|
|
||||||
end)
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
},
|
},
|
||||||
|
|
||||||
-- cmdline tools and lsp servers
|
-- cmdline tools and lsp servers
|
||||||
|
|
@ -292,8 +261,4 @@ return {
|
||||||
end)
|
end)
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
||||||
-- pin to v1 for now
|
|
||||||
{ "mason-org/mason.nvim", version = "^1.0.0" },
|
|
||||||
{ "mason-org/mason-lspconfig.nvim", version = "^1.0.0" },
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -52,9 +52,9 @@ function M.has(buffer, method)
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
method = method:find("/") and method or "textDocument/" .. method
|
method = method:find("/") and method or "textDocument/" .. method
|
||||||
local clients = LazyVim.lsp.get_clients({ bufnr = buffer })
|
local clients = vim.lsp.get_clients({ bufnr = buffer })
|
||||||
for _, client in ipairs(clients) do
|
for _, client in ipairs(clients) do
|
||||||
if client.supports_method(method) then
|
if client:supports_method(method) then
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
@ -69,7 +69,7 @@ function M.resolve(buffer)
|
||||||
end
|
end
|
||||||
local spec = vim.tbl_extend("force", {}, M.get())
|
local spec = vim.tbl_extend("force", {}, M.get())
|
||||||
local opts = LazyVim.opts("nvim-lspconfig")
|
local opts = LazyVim.opts("nvim-lspconfig")
|
||||||
local clients = LazyVim.lsp.get_clients({ bufnr = buffer })
|
local clients = vim.lsp.get_clients({ bufnr = buffer })
|
||||||
for _, client in ipairs(clients) do
|
for _, client in ipairs(clients) do
|
||||||
local maps = opts.servers[client.name] and opts.servers[client.name].keys or {}
|
local maps = opts.servers[client.name] and opts.servers[client.name].keys or {}
|
||||||
vim.list_extend(spec, maps)
|
vim.list_extend(spec, maps)
|
||||||
|
|
|
||||||
|
|
@ -1,43 +1,34 @@
|
||||||
return {
|
return {
|
||||||
{
|
|
||||||
"folke/which-key.nvim",
|
|
||||||
opts = {
|
|
||||||
spec = {
|
|
||||||
{ "<BS>", desc = "Decrement Selection", mode = "x" },
|
|
||||||
{ "<c-space>", desc = "Increment Selection", mode = { "x", "n" } },
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
-- Treesitter is a new parser generator tool that we can
|
-- Treesitter is a new parser generator tool that we can
|
||||||
-- use in Neovim to power faster and more accurate
|
-- use in Neovim to power faster and more accurate
|
||||||
-- syntax highlighting.
|
-- syntax highlighting.
|
||||||
{
|
{
|
||||||
"nvim-treesitter/nvim-treesitter",
|
"nvim-treesitter/nvim-treesitter",
|
||||||
|
branch = "main",
|
||||||
version = false, -- last release is way too old and doesn't work on Windows
|
version = false, -- last release is way too old and doesn't work on Windows
|
||||||
build = ":TSUpdate",
|
build = function()
|
||||||
event = { "LazyFile", "VeryLazy" },
|
local TS = require("nvim-treesitter")
|
||||||
lazy = vim.fn.argc(-1) == 0, -- load treesitter early when opening a file from the cmdline
|
if not TS.get_installed then
|
||||||
init = function(plugin)
|
LazyVim.error("Please restart Neovim and run `:TSUpdate` to use the `nvim-treesitter` **main** branch.")
|
||||||
-- PERF: add nvim-treesitter queries to the rtp and it's custom query predicates early
|
return
|
||||||
-- This is needed because a bunch of plugins no longer `require("nvim-treesitter")`, which
|
end
|
||||||
-- no longer trigger the **nvim-treesitter** module to be loaded in time.
|
-- make sure we're using the latest treesitter util
|
||||||
-- Luckily, the only things that those plugins need are the custom queries, which we make available
|
package.loaded["lazyvim.util.treesitter"] = nil
|
||||||
-- during startup.
|
LazyVim.treesitter.build(function()
|
||||||
require("lazy.core.loader").add_to_rtp(plugin)
|
TS.update(nil, { summary = true })
|
||||||
require("nvim-treesitter.query_predicates")
|
end)
|
||||||
end,
|
end,
|
||||||
cmd = { "TSUpdateSync", "TSUpdate", "TSInstall" },
|
event = { "LazyFile", "VeryLazy" },
|
||||||
keys = {
|
cmd = { "TSUpdate", "TSInstall", "TSLog", "TSUninstall" },
|
||||||
{ "<c-space>", desc = "Increment Selection" },
|
|
||||||
{ "<bs>", desc = "Decrement Selection", mode = "x" },
|
|
||||||
},
|
|
||||||
opts_extend = { "ensure_installed" },
|
opts_extend = { "ensure_installed" },
|
||||||
---@type TSConfig
|
---@alias lazyvim.TSFeat { enable?: boolean, disable?: string[] }
|
||||||
---@diagnostic disable-next-line: missing-fields
|
---@class lazyvim.TSConfig: TSConfig
|
||||||
opts = {
|
opts = {
|
||||||
highlight = { enable = true },
|
-- LazyVim config for treesitter
|
||||||
indent = { enable = true },
|
indent = { enable = true }, ---@type lazyvim.TSFeat
|
||||||
|
highlight = { enable = true }, ---@type lazyvim.TSFeat
|
||||||
|
folds = { enable = true }, ---@type lazyvim.TSFeat
|
||||||
ensure_installed = {
|
ensure_installed = {
|
||||||
"bash",
|
"bash",
|
||||||
"c",
|
"c",
|
||||||
|
|
@ -64,18 +55,97 @@ return {
|
||||||
"xml",
|
"xml",
|
||||||
"yaml",
|
"yaml",
|
||||||
},
|
},
|
||||||
incremental_selection = {
|
},
|
||||||
|
---@param opts lazyvim.TSConfig
|
||||||
|
config = function(_, opts)
|
||||||
|
local TS = require("nvim-treesitter")
|
||||||
|
|
||||||
|
setmetatable(require("nvim-treesitter.install"), {
|
||||||
|
__newindex = function(_, k)
|
||||||
|
if k == "compilers" then
|
||||||
|
vim.schedule(function()
|
||||||
|
LazyVim.error({
|
||||||
|
"Setting custom compilers for `nvim-treesitter` is no longer supported.",
|
||||||
|
"",
|
||||||
|
"For more info, see:",
|
||||||
|
"- [compilers](https://docs.rs/cc/latest/cc/#compile-time-requirements)",
|
||||||
|
})
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
-- some quick sanity checks
|
||||||
|
if not TS.get_installed then
|
||||||
|
return LazyVim.error("Please use `:Lazy` and update `nvim-treesitter`")
|
||||||
|
elseif type(opts.ensure_installed) ~= "table" then
|
||||||
|
return LazyVim.error("`nvim-treesitter` opts.ensure_installed must be a table")
|
||||||
|
end
|
||||||
|
|
||||||
|
-- setup treesitter
|
||||||
|
TS.setup(opts)
|
||||||
|
LazyVim.treesitter.get_installed(true) -- initialize the installed langs
|
||||||
|
|
||||||
|
-- install missing parsers
|
||||||
|
local install = vim.tbl_filter(function(lang)
|
||||||
|
return not LazyVim.treesitter.have(lang)
|
||||||
|
end, opts.ensure_installed or {})
|
||||||
|
if #install > 0 then
|
||||||
|
LazyVim.treesitter.build(function()
|
||||||
|
TS.install(install, { summary = true }):await(function()
|
||||||
|
LazyVim.treesitter.get_installed(true) -- refresh the installed langs
|
||||||
|
end)
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
|
||||||
|
vim.api.nvim_create_autocmd("FileType", {
|
||||||
|
group = vim.api.nvim_create_augroup("lazyvim_treesitter", { clear = true }),
|
||||||
|
callback = function(ev)
|
||||||
|
local ft, lang = ev.match, vim.treesitter.language.get_lang(ev.match)
|
||||||
|
if not LazyVim.treesitter.have(ft) then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
---@param feat string
|
||||||
|
---@param query string
|
||||||
|
local function enabled(feat, query)
|
||||||
|
local f = opts[feat] or {} ---@type lazyvim.TSFeat
|
||||||
|
return f.enable ~= false
|
||||||
|
and not (type(f.disable) == "table" and vim.tbl_contains(f.disable, lang))
|
||||||
|
and LazyVim.treesitter.have(ft, query)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- highlighting
|
||||||
|
if enabled("highlight", "highlights") then
|
||||||
|
pcall(vim.treesitter.start)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- indents
|
||||||
|
if enabled("indent", "indents") then
|
||||||
|
LazyVim.set_default("indentexpr", "v:lua.LazyVim.treesitter.indentexpr()")
|
||||||
|
end
|
||||||
|
|
||||||
|
-- folds
|
||||||
|
if enabled("folds", "folds") then
|
||||||
|
if LazyVim.set_default("foldmethod", "expr") then
|
||||||
|
LazyVim.set_default("foldexpr", "v:lua.LazyVim.treesitter.foldexpr()")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
"nvim-treesitter/nvim-treesitter-textobjects",
|
||||||
|
branch = "main",
|
||||||
|
event = "VeryLazy",
|
||||||
|
opts = {
|
||||||
|
move = {
|
||||||
enable = true,
|
enable = true,
|
||||||
keymaps = {
|
set_jumps = true, -- whether to set jumps in the jumplist
|
||||||
init_selection = "<C-space>",
|
-- LazyVim extention to create buffer-local keymaps
|
||||||
node_incremental = "<C-space>",
|
keys = {
|
||||||
scope_incremental = false,
|
|
||||||
node_decremental = "<bs>",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
textobjects = {
|
|
||||||
move = {
|
|
||||||
enable = true,
|
|
||||||
goto_next_start = { ["]f"] = "@function.outer", ["]c"] = "@class.outer", ["]a"] = "@parameter.inner" },
|
goto_next_start = { ["]f"] = "@function.outer", ["]c"] = "@class.outer", ["]a"] = "@parameter.inner" },
|
||||||
goto_next_end = { ["]F"] = "@function.outer", ["]C"] = "@class.outer", ["]A"] = "@parameter.inner" },
|
goto_next_end = { ["]F"] = "@function.outer", ["]C"] = "@class.outer", ["]A"] = "@parameter.inner" },
|
||||||
goto_previous_start = { ["[f"] = "@function.outer", ["[c"] = "@class.outer", ["[a"] = "@parameter.inner" },
|
goto_previous_start = { ["[f"] = "@function.outer", ["[c"] = "@class.outer", ["[a"] = "@parameter.inner" },
|
||||||
|
|
@ -83,46 +153,48 @@ return {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
---@param opts TSConfig
|
|
||||||
config = function(_, opts)
|
config = function(_, opts)
|
||||||
if type(opts.ensure_installed) == "table" then
|
local TS = require("nvim-treesitter-textobjects")
|
||||||
opts.ensure_installed = LazyVim.dedup(opts.ensure_installed)
|
if not TS.setup then
|
||||||
|
LazyVim.error("Please use `:Lazy` and update `nvim-treesitter`")
|
||||||
|
return
|
||||||
end
|
end
|
||||||
require("nvim-treesitter.configs").setup(opts)
|
TS.setup(opts)
|
||||||
end,
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
local function attach(buf)
|
||||||
"nvim-treesitter/nvim-treesitter-textobjects",
|
local ft = vim.bo[buf].filetype
|
||||||
event = "VeryLazy",
|
if not (vim.tbl_get(opts, "move", "enable") and LazyVim.treesitter.have(ft, "textobjects")) then
|
||||||
enabled = true,
|
return
|
||||||
config = function()
|
end
|
||||||
-- If treesitter is already loaded, we need to run config again for textobjects
|
---@type table<string, table<string, string>>
|
||||||
if LazyVim.is_loaded("nvim-treesitter") then
|
local moves = vim.tbl_get(opts, "move", "keys") or {}
|
||||||
local opts = LazyVim.opts("nvim-treesitter")
|
|
||||||
require("nvim-treesitter.configs").setup({ textobjects = opts.textobjects })
|
|
||||||
end
|
|
||||||
|
|
||||||
-- When in diff mode, we want to use the default
|
for method, keymaps in pairs(moves) do
|
||||||
-- vim text objects c & C instead of the treesitter ones.
|
for key, query in pairs(keymaps) do
|
||||||
local move = require("nvim-treesitter.textobjects.move") ---@type table<string,fun(...)>
|
local desc = query:gsub("@", ""):gsub("%..*", "")
|
||||||
local configs = require("nvim-treesitter.configs")
|
desc = desc:sub(1, 1):upper() .. desc:sub(2)
|
||||||
for name, fn in pairs(move) do
|
desc = (key:sub(1, 1) == "[" and "Prev " or "Next ") .. desc
|
||||||
if name:find("goto") == 1 then
|
desc = desc .. (key:sub(2, 2) == key:sub(2, 2):upper() and " End" or " Start")
|
||||||
move[name] = function(q, ...)
|
if not (vim.wo.diff and key:find("[cC]")) then
|
||||||
if vim.wo.diff then
|
vim.keymap.set({ "n", "x", "o" }, key, function()
|
||||||
local config = configs.get_module("textobjects.move")[name] ---@type table<string,string>
|
require("nvim-treesitter-textobjects.move")[method](query, "textobjects")
|
||||||
for key, query in pairs(config or {}) do
|
end, {
|
||||||
if q == query and key:find("[%]%[][cC]") then
|
buffer = buf,
|
||||||
vim.cmd("normal! " .. key)
|
desc = desc,
|
||||||
return
|
silent = true,
|
||||||
end
|
})
|
||||||
end
|
|
||||||
end
|
end
|
||||||
return fn(q, ...)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
vim.api.nvim_create_autocmd("FileType", {
|
||||||
|
group = vim.api.nvim_create_augroup("lazyvim_treesitter_textobjects", { clear = true }),
|
||||||
|
callback = function(ev)
|
||||||
|
attach(ev.buf)
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
vim.tbl_map(attach, vim.api.nvim_list_bufs())
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -60,7 +60,8 @@ return {
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
||||||
-- statusline
|
-- Displays a fancy status line with git status,
|
||||||
|
-- LSP diagnostics, filetype information, and more.
|
||||||
{
|
{
|
||||||
"nvim-lualine/lualine.nvim",
|
"nvim-lualine/lualine.nvim",
|
||||||
event = "VeryLazy",
|
event = "VeryLazy",
|
||||||
|
|
@ -245,7 +246,7 @@ return {
|
||||||
|
|
||||||
-- icons
|
-- icons
|
||||||
{
|
{
|
||||||
"echasnovski/mini.icons",
|
"nvim-mini/mini.icons",
|
||||||
lazy = true,
|
lazy = true,
|
||||||
opts = {
|
opts = {
|
||||||
file = {
|
file = {
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,8 @@ return {
|
||||||
nav_j = { "<C-j>", term_nav("j"), desc = "Go to Lower Window", expr = true, mode = "t" },
|
nav_j = { "<C-j>", term_nav("j"), desc = "Go to Lower Window", expr = true, mode = "t" },
|
||||||
nav_k = { "<C-k>", term_nav("k"), desc = "Go to Upper Window", expr = true, mode = "t" },
|
nav_k = { "<C-k>", term_nav("k"), desc = "Go to Upper Window", expr = true, mode = "t" },
|
||||||
nav_l = { "<C-l>", term_nav("l"), desc = "Go to Right Window", expr = true, mode = "t" },
|
nav_l = { "<C-l>", term_nav("l"), desc = "Go to Right Window", expr = true, mode = "t" },
|
||||||
|
hide_slash = { "<C-/>", "hide", desc = "Hide Terminal", mode = { "t", "n" } },
|
||||||
|
hide_underscore = { "<c-_>", "hide", desc = "which_key_ignore", mode = { "t", "n" } },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -3,9 +3,11 @@ local prios = {
|
||||||
["lazyvim.plugins.extras.test.core"] = 1,
|
["lazyvim.plugins.extras.test.core"] = 1,
|
||||||
["lazyvim.plugins.extras.dap.core"] = 1,
|
["lazyvim.plugins.extras.dap.core"] = 1,
|
||||||
["lazyvim.plugins.extras.coding.nvim-cmp"] = 2,
|
["lazyvim.plugins.extras.coding.nvim-cmp"] = 2,
|
||||||
["lazyvim.plugins.extras.ui.edgy"] = 2,
|
["lazyvim.plugins.extras.editor.neo-tree"] = 2,
|
||||||
["lazyvim.plugins.extras.lang.typescript"] = 5,
|
["lazyvim.plugins.extras.ui.edgy"] = 3,
|
||||||
|
["lazyvim.plugins.extras.ai.copilot-native"] = 4,
|
||||||
["lazyvim.plugins.extras.coding.blink"] = 5,
|
["lazyvim.plugins.extras.coding.blink"] = 5,
|
||||||
|
["lazyvim.plugins.extras.lang.typescript"] = 5,
|
||||||
["lazyvim.plugins.extras.formatting.prettier"] = 10,
|
["lazyvim.plugins.extras.formatting.prettier"] = 10,
|
||||||
-- default core extra priority is 20
|
-- default core extra priority is 20
|
||||||
-- default priority is 50
|
-- default priority is 50
|
||||||
|
|
@ -42,15 +44,7 @@ end
|
||||||
---@type string[]
|
---@type string[]
|
||||||
extras = LazyVim.dedup(extras)
|
extras = LazyVim.dedup(extras)
|
||||||
|
|
||||||
local version = vim.version()
|
|
||||||
local v = version.major .. "_" .. version.minor
|
|
||||||
|
|
||||||
local compat = { "0_9" }
|
|
||||||
|
|
||||||
LazyVim.plugin.save_core()
|
LazyVim.plugin.save_core()
|
||||||
if vim.tbl_contains(compat, v) then
|
|
||||||
table.insert(extras, 1, "lazyvim.plugins.compat.nvim-" .. v)
|
|
||||||
end
|
|
||||||
if vim.g.vscode then
|
if vim.g.vscode then
|
||||||
table.insert(extras, 1, "lazyvim.plugins.extras.vscode")
|
table.insert(extras, 1, "lazyvim.plugins.extras.vscode")
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
---@class lazyvim.util.deprecated
|
||||||
local M = {}
|
local M = {}
|
||||||
|
|
||||||
M.moved = {
|
M.moved = {
|
||||||
|
|
@ -13,6 +14,7 @@ M.moved = {
|
||||||
ui = {
|
ui = {
|
||||||
statuscolumn = { "Snacks.statuscolumn" },
|
statuscolumn = { "Snacks.statuscolumn" },
|
||||||
bufremove = { "Snacks.bufdelete" },
|
bufremove = { "Snacks.bufdelete" },
|
||||||
|
foldexpr = { "LazyVim.treesitter.foldexpr", stacktrace = false },
|
||||||
fg = {
|
fg = {
|
||||||
"{ fg = Snacks.util.color(...) }",
|
"{ fg = Snacks.util.color(...) }",
|
||||||
fn = function(...)
|
fn = function(...)
|
||||||
|
|
@ -28,7 +30,7 @@ function M.decorate(name, mod)
|
||||||
if not M.moved[name] then
|
if not M.moved[name] then
|
||||||
return mod
|
return mod
|
||||||
end
|
end
|
||||||
setmetatable(mod, {
|
return setmetatable(mod, {
|
||||||
__call = function(_, ...)
|
__call = function(_, ...)
|
||||||
local to = M.moved[name].__call[1]
|
local to = M.moved[name].__call[1]
|
||||||
LazyVim.deprecate("LazyVim." .. name, to)
|
LazyVim.deprecate("LazyVim." .. name, to)
|
||||||
|
|
@ -38,7 +40,9 @@ function M.decorate(name, mod)
|
||||||
__index = function(_, k)
|
__index = function(_, k)
|
||||||
if M.moved[name][k] then
|
if M.moved[name][k] then
|
||||||
local to = M.moved[name][k][1]
|
local to = M.moved[name][k][1]
|
||||||
LazyVim.deprecate("LazyVim." .. name .. "." .. k, to)
|
LazyVim.deprecate("LazyVim." .. name .. "." .. k, to, {
|
||||||
|
stacktrace = M.moved[name][k].stacktrace,
|
||||||
|
})
|
||||||
if M.moved[name][k].fn then
|
if M.moved[name][k].fn then
|
||||||
return M.moved[name][k].fn
|
return M.moved[name][k].fn
|
||||||
end
|
end
|
||||||
|
|
@ -55,6 +59,10 @@ function M.lazygit()
|
||||||
return Snacks.lazygit
|
return Snacks.lazygit
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function M.ui()
|
||||||
|
return M.decorate("ui", {})
|
||||||
|
end
|
||||||
|
|
||||||
function M.toggle()
|
function M.toggle()
|
||||||
LazyVim.deprecate("LazyVim.toggle", "Snacks.toggle")
|
LazyVim.deprecate("LazyVim.toggle", "Snacks.toggle")
|
||||||
return {
|
return {
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ local LazyUtil = require("lazy.core.util")
|
||||||
|
|
||||||
---@class lazyvim.util: LazyUtilCore
|
---@class lazyvim.util: LazyUtilCore
|
||||||
---@field config LazyVimConfig
|
---@field config LazyVimConfig
|
||||||
---@field ui lazyvim.util.ui
|
---@field treesitter lazyvim.util.treesitter
|
||||||
---@field lsp lazyvim.util.lsp
|
---@field lsp lazyvim.util.lsp
|
||||||
---@field root lazyvim.util.root
|
---@field root lazyvim.util.root
|
||||||
---@field terminal lazyvim.util.terminal
|
---@field terminal lazyvim.util.terminal
|
||||||
|
|
@ -16,14 +16,16 @@ local LazyUtil = require("lazy.core.util")
|
||||||
---@field mini lazyvim.util.mini
|
---@field mini lazyvim.util.mini
|
||||||
---@field pick lazyvim.util.pick
|
---@field pick lazyvim.util.pick
|
||||||
---@field cmp lazyvim.util.cmp
|
---@field cmp lazyvim.util.cmp
|
||||||
|
---@field deprecated lazyvim.util.deprecated
|
||||||
local M = {}
|
local M = {}
|
||||||
|
M.deprecated = require("lazyvim.util.deprecated")
|
||||||
|
|
||||||
setmetatable(M, {
|
setmetatable(M, {
|
||||||
__index = function(t, k)
|
__index = function(t, k)
|
||||||
if LazyUtil[k] then
|
if LazyUtil[k] then
|
||||||
return LazyUtil[k]
|
return LazyUtil[k]
|
||||||
end
|
end
|
||||||
if k == "lazygit" or k == "toggle" then -- HACK: special case for lazygit
|
if M.deprecated[k] then
|
||||||
return M.deprecated[k]()
|
return M.deprecated[k]()
|
||||||
end
|
end
|
||||||
---@diagnostic disable-next-line: no-unknown
|
---@diagnostic disable-next-line: no-unknown
|
||||||
|
|
@ -125,13 +127,17 @@ function M.opts(name)
|
||||||
return Plugin.values(plugin, "opts", false)
|
return Plugin.values(plugin, "opts", false)
|
||||||
end
|
end
|
||||||
|
|
||||||
function M.deprecate(old, new)
|
---@param opts? LazyNotifyOpts
|
||||||
M.warn(("`%s` is deprecated. Please use `%s` instead"):format(old, new), {
|
function M.deprecate(old, new, opts)
|
||||||
title = "LazyVim",
|
M.warn(
|
||||||
once = true,
|
("`%s` is deprecated. Please use `%s` instead"):format(old, new),
|
||||||
stacktrace = true,
|
vim.tbl_extend("force", {
|
||||||
stacklevel = 6,
|
title = "LazyVim",
|
||||||
})
|
once = true,
|
||||||
|
stacktrace = true,
|
||||||
|
stacklevel = 6,
|
||||||
|
}, opts or {})
|
||||||
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- delay notifications till vim.notify was replaced or after 500ms
|
-- delay notifications till vim.notify was replaced or after 500ms
|
||||||
|
|
@ -253,11 +259,18 @@ function M.get_pkg_path(pkg, path, opts)
|
||||||
opts = opts or {}
|
opts = opts or {}
|
||||||
opts.warn = opts.warn == nil and true or opts.warn
|
opts.warn = opts.warn == nil and true or opts.warn
|
||||||
path = path or ""
|
path = path or ""
|
||||||
local ret = root .. "/packages/" .. pkg .. "/" .. path
|
local ret = vim.fs.normalize(root .. "/packages/" .. pkg .. "/" .. path)
|
||||||
if opts.warn and not vim.loop.fs_stat(ret) and not require("lazy.core.config").headless() then
|
if opts.warn then
|
||||||
M.warn(
|
vim.schedule(function()
|
||||||
("Mason package path not found for **%s**:\n- `%s`\nYou may need to force update the package."):format(pkg, path)
|
if not require("lazy.core.config").headless() and not vim.loop.fs_stat(ret) then
|
||||||
)
|
M.warn(
|
||||||
|
("Mason package path not found for **%s**:\n- `%s`\nYou may need to force update the package."):format(
|
||||||
|
pkg,
|
||||||
|
path
|
||||||
|
)
|
||||||
|
)
|
||||||
|
end
|
||||||
|
end)
|
||||||
end
|
end
|
||||||
return ret
|
return ret
|
||||||
end
|
end
|
||||||
|
|
@ -286,4 +299,63 @@ function M.memoize(fn)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Safe wrapper around snacks to prevent errors when LazyVim is still installing
|
||||||
|
function M.statuscolumn()
|
||||||
|
return package.loaded.snacks and require("snacks.statuscolumn").get() or ""
|
||||||
|
end
|
||||||
|
|
||||||
|
local _defaults = {} ---@type table<string, boolean>
|
||||||
|
|
||||||
|
-- Determines whether it's safe to set an option to a default value.
|
||||||
|
--
|
||||||
|
-- It will only set the option if:
|
||||||
|
-- * it is the same as the global value
|
||||||
|
-- * it's current value is a default value
|
||||||
|
-- * it was last set by a script in $VIMRUNTIME
|
||||||
|
---@param option string
|
||||||
|
---@param value string|number|boolean
|
||||||
|
---@return boolean was_set
|
||||||
|
function M.set_default(option, value)
|
||||||
|
local l = vim.api.nvim_get_option_value(option, { scope = "local" })
|
||||||
|
local g = LazyVim.config._options[option] or vim.api.nvim_get_option_value(option, { scope = "global" })
|
||||||
|
|
||||||
|
_defaults[("%s=%s"):format(option, value)] = true
|
||||||
|
local key = ("%s=%s"):format(option, l)
|
||||||
|
|
||||||
|
local source = ""
|
||||||
|
if l ~= g and not _defaults[key] then
|
||||||
|
-- Option does not match global and is not a default value
|
||||||
|
-- Check if it was set by a script in $VIMRUNTIME
|
||||||
|
local info = vim.api.nvim_get_option_info2(option, { scope = "local" })
|
||||||
|
---@param e vim.fn.getscriptinfo.ret
|
||||||
|
local scriptinfo = vim.tbl_filter(function(e)
|
||||||
|
return e.sid == info.last_set_sid
|
||||||
|
end, vim.fn.getscriptinfo())
|
||||||
|
source = scriptinfo[1] and scriptinfo[1].name or ""
|
||||||
|
local by_rtp = #scriptinfo == 1 and vim.startswith(scriptinfo[1].name, vim.fn.expand("$VIMRUNTIME"))
|
||||||
|
if not by_rtp then
|
||||||
|
if vim.g.lazyvim_debug_set_default then
|
||||||
|
LazyVim.warn(
|
||||||
|
("Not setting option `%s` to `%q` because it was changed by a plugin."):format(option, value),
|
||||||
|
{ title = "LazyVim", once = true }
|
||||||
|
)
|
||||||
|
end
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
if vim.g.lazyvim_debug_set_default then
|
||||||
|
LazyVim.info({
|
||||||
|
("Setting option `%s` to `%q`"):format(option, value),
|
||||||
|
("Was: %q"):format(l),
|
||||||
|
("Global: %q"):format(g),
|
||||||
|
source ~= "" and ("Last set by: %s"):format(source) or "",
|
||||||
|
"buf: " .. vim.api.nvim_buf_get_name(0),
|
||||||
|
}, { title = "LazyVim", once = true })
|
||||||
|
end
|
||||||
|
|
||||||
|
vim.api.nvim_set_option_value(option, value, { scope = "local" })
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
|
|
||||||
|
|
@ -1,26 +1,6 @@
|
||||||
---@class lazyvim.util.lsp
|
---@class lazyvim.util.lsp
|
||||||
local M = {}
|
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 vim.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 vim.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
|
|
||||||
end
|
|
||||||
|
|
||||||
---@param on_attach fun(client:vim.lsp.Client, buffer)
|
---@param on_attach fun(client:vim.lsp.Client, buffer)
|
||||||
---@param name? string
|
---@param name? string
|
||||||
function M.on_attach(on_attach, name)
|
function M.on_attach(on_attach, name)
|
||||||
|
|
@ -75,7 +55,7 @@ function M._check_methods(client, buffer)
|
||||||
for method, clients in pairs(M._supports_method) do
|
for method, clients in pairs(M._supports_method) do
|
||||||
clients[client] = clients[client] or {}
|
clients[client] = clients[client] or {}
|
||||||
if not clients[client][buffer] then
|
if not clients[client][buffer] then
|
||||||
if client.supports_method and client.supports_method(method, { bufnr = buffer }) then
|
if client.supports_method and client:supports_method(method, buffer) then
|
||||||
clients[client][buffer] = true
|
clients[client][buffer] = true
|
||||||
vim.api.nvim_exec_autocmds("User", {
|
vim.api.nvim_exec_autocmds("User", {
|
||||||
pattern = "LspSupportsMethod",
|
pattern = "LspSupportsMethod",
|
||||||
|
|
@ -118,45 +98,12 @@ function M.on_supports_method(method, fn)
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
---@return _.lspconfig.options
|
---@param opts? LazyFormatter| {filter?: (string|vim.lsp.get_clients.Filter)}
|
||||||
function M.get_config(server)
|
|
||||||
local configs = require("lspconfig.configs")
|
|
||||||
return rawget(configs, server)
|
|
||||||
end
|
|
||||||
|
|
||||||
---@return {default_config:lspconfig.Config}
|
|
||||||
function M.get_raw_config(server)
|
|
||||||
local ok, ret = pcall(require, "lspconfig.configs." .. server)
|
|
||||||
if ok then
|
|
||||||
return ret
|
|
||||||
end
|
|
||||||
return require("lspconfig.server_configurations." .. server)
|
|
||||||
end
|
|
||||||
|
|
||||||
function M.is_enabled(server)
|
|
||||||
local c = M.get_config(server)
|
|
||||||
return c and c.enabled ~= false
|
|
||||||
end
|
|
||||||
|
|
||||||
---@param server string
|
|
||||||
---@param cond fun( root_dir, config): boolean
|
|
||||||
function M.disable(server, cond)
|
|
||||||
local util = require("lspconfig.util")
|
|
||||||
local def = M.get_config(server)
|
|
||||||
---@diagnostic disable-next-line: undefined-field
|
|
||||||
def.document_config.on_new_config = util.add_hook_before(def.document_config.on_new_config, function(config, root_dir)
|
|
||||||
if cond(root_dir, config) then
|
|
||||||
config.enabled = false
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
end
|
|
||||||
|
|
||||||
---@param opts? LazyFormatter| {filter?: (string|lsp.Client.filter)}
|
|
||||||
function M.formatter(opts)
|
function M.formatter(opts)
|
||||||
opts = opts or {}
|
opts = opts or {}
|
||||||
local filter = opts.filter or {}
|
local filter = opts.filter or {}
|
||||||
filter = type(filter) == "string" and { name = filter } or filter
|
filter = type(filter) == "string" and { name = filter } or filter
|
||||||
---@cast filter lsp.Client.filter
|
---@cast filter vim.lsp.get_clients.Filter
|
||||||
---@type LazyFormatter
|
---@type LazyFormatter
|
||||||
local ret = {
|
local ret = {
|
||||||
name = "LSP",
|
name = "LSP",
|
||||||
|
|
@ -166,11 +113,11 @@ function M.formatter(opts)
|
||||||
M.format(LazyVim.merge({}, filter, { bufnr = buf }))
|
M.format(LazyVim.merge({}, filter, { bufnr = buf }))
|
||||||
end,
|
end,
|
||||||
sources = function(buf)
|
sources = function(buf)
|
||||||
local clients = M.get_clients(LazyVim.merge({}, filter, { bufnr = buf }))
|
local clients = vim.lsp.get_clients(LazyVim.merge({}, filter, { bufnr = buf }))
|
||||||
---@param client vim.lsp.Client
|
---@param client vim.lsp.Client
|
||||||
local ret = vim.tbl_filter(function(client)
|
local ret = vim.tbl_filter(function(client)
|
||||||
return client.supports_method("textDocument/formatting")
|
return client:supports_method("textDocument/formatting")
|
||||||
or client.supports_method("textDocument/rangeFormatting")
|
or client:supports_method("textDocument/rangeFormatting")
|
||||||
end, clients)
|
end, clients)
|
||||||
---@param client vim.lsp.Client
|
---@param client vim.lsp.Client
|
||||||
return vim.tbl_map(function(client)
|
return vim.tbl_map(function(client)
|
||||||
|
|
@ -181,7 +128,7 @@ function M.formatter(opts)
|
||||||
return LazyVim.merge(ret, opts) --[[@as LazyFormatter]]
|
return LazyVim.merge(ret, opts) --[[@as LazyFormatter]]
|
||||||
end
|
end
|
||||||
|
|
||||||
---@alias lsp.Client.format {timeout_ms?: number, format_options?: table} | lsp.Client.filter
|
---@alias lsp.Client.format {timeout_ms?: number, format_options?: table} | vim.lsp.get_clients.Filter
|
||||||
|
|
||||||
---@param opts? lsp.Client.format
|
---@param opts? lsp.Client.format
|
||||||
function M.format(opts)
|
function M.format(opts)
|
||||||
|
|
|
||||||
|
|
@ -101,9 +101,20 @@ function M.pretty_path(opts)
|
||||||
local root = LazyVim.root.get({ normalize = true })
|
local root = LazyVim.root.get({ normalize = true })
|
||||||
local cwd = LazyVim.root.cwd()
|
local cwd = LazyVim.root.cwd()
|
||||||
|
|
||||||
if opts.relative == "cwd" and path:find(cwd, 1, true) == 1 then
|
-- original path is preserved to provide user with expected result of pretty_path, not a normalized one,
|
||||||
|
-- which might be confusing
|
||||||
|
local norm_path = path
|
||||||
|
|
||||||
|
if LazyVim.is_win() then
|
||||||
|
-- in case any of the provided paths involved mixed case, an additional normalization step for windows
|
||||||
|
norm_path = norm_path:lower()
|
||||||
|
root = root:lower()
|
||||||
|
cwd = cwd:lower()
|
||||||
|
end
|
||||||
|
|
||||||
|
if opts.relative == "cwd" and norm_path:find(cwd, 1, true) == 1 then
|
||||||
path = path:sub(#cwd + 2)
|
path = path:sub(#cwd + 2)
|
||||||
elseif path:find(root, 1, true) == 1 then
|
elseif norm_path:find(root, 1, true) == 1 then
|
||||||
path = path:sub(#root + 2)
|
path = path:sub(#root + 2)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
local Meta = require("lazy.core.meta")
|
||||||
local Plugin = require("lazy.core.plugin")
|
local Plugin = require("lazy.core.plugin")
|
||||||
|
|
||||||
---@class lazyvim.util.plugin
|
---@class lazyvim.util.plugin
|
||||||
|
|
@ -16,6 +17,7 @@ M.deprecated_extras = {
|
||||||
["lazyvim.plugins.extras.ui.dashboard"] = "`dashboard.nvim` is now the default **LazyVim** starter.",
|
["lazyvim.plugins.extras.ui.dashboard"] = "`dashboard.nvim` is now the default **LazyVim** starter.",
|
||||||
["lazyvim.plugins.extras.coding.native_snippets"] = "Native snippets are now the default for **Neovim >= 0.10**",
|
["lazyvim.plugins.extras.coding.native_snippets"] = "Native snippets are now the default for **Neovim >= 0.10**",
|
||||||
["lazyvim.plugins.extras.ui.treesitter-rewrite"] = "Disabled `treesitter-rewrite` extra for now. Not ready yet.",
|
["lazyvim.plugins.extras.ui.treesitter-rewrite"] = "Disabled `treesitter-rewrite` extra for now. Not ready yet.",
|
||||||
|
["lazyvim.plugins.extras.ui.treesitter-main"] = "the `nvim-treesitter` main branch is now used by default",
|
||||||
["lazyvim.plugins.extras.coding.mini-ai"] = "`mini.ai` is now a core LazyVim plugin (again)",
|
["lazyvim.plugins.extras.coding.mini-ai"] = "`mini.ai` is now a core LazyVim plugin (again)",
|
||||||
["lazyvim.plugins.extras.lazyrc"] = "local spec files are now a lazy.nvim feature",
|
["lazyvim.plugins.extras.lazyrc"] = "local spec files are now a lazy.nvim feature",
|
||||||
["lazyvim.plugins.extras.editor.trouble-v3"] = "Trouble v3 has been merged in main",
|
["lazyvim.plugins.extras.editor.trouble-v3"] = "Trouble v3 has been merged in main",
|
||||||
|
|
@ -102,9 +104,17 @@ function M.fix_imports()
|
||||||
end
|
end
|
||||||
|
|
||||||
function M.fix_renames()
|
function M.fix_renames()
|
||||||
Plugin.Spec.add = LazyVim.inject.args(Plugin.Spec.add, function(self, plugin)
|
---@param plugin LazyPluginSpec
|
||||||
|
Meta.add = LazyVim.inject.args(Meta.add, function(self, plugin)
|
||||||
if type(plugin) == "table" then
|
if type(plugin) == "table" then
|
||||||
if M.renames[plugin[1]] then
|
local name = plugin[1]
|
||||||
|
if not name then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
if name:find("echasnovski") then
|
||||||
|
M.renames[name] = name:gsub("echasnovski", "nvim-mini")
|
||||||
|
end
|
||||||
|
if M.renames[name] then
|
||||||
LazyVim.warn(
|
LazyVim.warn(
|
||||||
("Plugin `%s` was renamed to `%s`.\nPlease update your config for `%s`"):format(
|
("Plugin `%s` was renamed to `%s`.\nPlease update your config for `%s`"):format(
|
||||||
plugin[1],
|
plugin[1],
|
||||||
|
|
@ -113,7 +123,7 @@ function M.fix_renames()
|
||||||
),
|
),
|
||||||
{ title = "LazyVim" }
|
{ title = "LazyVim" }
|
||||||
)
|
)
|
||||||
plugin[1] = M.renames[plugin[1]]
|
plugin[1] = M.renames[name]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
|
||||||
|
|
@ -29,10 +29,10 @@ function M.detectors.lsp(buf)
|
||||||
return {}
|
return {}
|
||||||
end
|
end
|
||||||
local roots = {} ---@type string[]
|
local roots = {} ---@type string[]
|
||||||
local clients = LazyVim.lsp.get_clients({ bufnr = buf })
|
local clients = vim.lsp.get_clients({ bufnr = buf })
|
||||||
clients = vim.tbl_filter(function(client)
|
clients = vim.tbl_filter(function(client)
|
||||||
return not vim.tbl_contains(vim.g.root_lsp_ignore or {}, client.name)
|
return not vim.tbl_contains(vim.g.root_lsp_ignore or {}, client.name)
|
||||||
end, clients)
|
end, clients) --[[@as vim.lsp.Client[] ]]
|
||||||
for _, client in pairs(clients) do
|
for _, client in pairs(clients) do
|
||||||
local workspace = client.config.workspace_folders
|
local workspace = client.config.workspace_folders
|
||||||
for _, ws in pairs(workspace or {}) do
|
for _, ws in pairs(workspace or {}) do
|
||||||
|
|
|
||||||
155
lua/lazyvim/util/treesitter.lua
Normal file
155
lua/lazyvim/util/treesitter.lua
Normal file
|
|
@ -0,0 +1,155 @@
|
||||||
|
---@class lazyvim.util.treesitter
|
||||||
|
local M = {}
|
||||||
|
|
||||||
|
M._installed = nil ---@type table<string,boolean>?
|
||||||
|
M._queries = {} ---@type table<string,boolean>
|
||||||
|
|
||||||
|
---@param update boolean?
|
||||||
|
function M.get_installed(update)
|
||||||
|
if update then
|
||||||
|
M._installed, M._queries = {}, {}
|
||||||
|
for _, lang in ipairs(require("nvim-treesitter").get_installed("parsers")) do
|
||||||
|
M._installed[lang] = true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return M._installed or {}
|
||||||
|
end
|
||||||
|
|
||||||
|
---@param lang string
|
||||||
|
---@param query string
|
||||||
|
function M.have_query(lang, query)
|
||||||
|
local key = lang .. ":" .. query
|
||||||
|
if M._queries[key] == nil then
|
||||||
|
M._queries[key] = vim.treesitter.query.get(lang, query) ~= nil
|
||||||
|
end
|
||||||
|
return M._queries[key]
|
||||||
|
end
|
||||||
|
|
||||||
|
---@param what string|number|nil
|
||||||
|
---@param query? string
|
||||||
|
---@overload fun(buf?:number):boolean
|
||||||
|
---@overload fun(ft:string):boolean
|
||||||
|
---@return boolean
|
||||||
|
function M.have(what, query)
|
||||||
|
what = what or vim.api.nvim_get_current_buf()
|
||||||
|
what = type(what) == "number" and vim.bo[what].filetype or what --[[@as string]]
|
||||||
|
local lang = vim.treesitter.language.get_lang(what)
|
||||||
|
if lang == nil or M.get_installed()[lang] == nil then
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
if query and not M.have_query(lang, query) then
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
|
||||||
|
function M.foldexpr()
|
||||||
|
return M.have(nil, "folds") and vim.treesitter.foldexpr() or "0"
|
||||||
|
end
|
||||||
|
|
||||||
|
function M.indentexpr()
|
||||||
|
return M.have(nil, "indents") and require("nvim-treesitter").indentexpr() or -1
|
||||||
|
end
|
||||||
|
|
||||||
|
---@return string?
|
||||||
|
local function win_find_cl()
|
||||||
|
local path = "C:/Program Files (x86)/Microsoft Visual Studio"
|
||||||
|
local pattern = "*/*/VC/Tools/MSVC/*/bin/Hostx64/x64/cl.exe"
|
||||||
|
return vim.fn.globpath(path, pattern, true, true)[1]
|
||||||
|
end
|
||||||
|
|
||||||
|
---@return boolean ok, lazyvim.util.treesitter.Health health
|
||||||
|
function M.check()
|
||||||
|
local is_win = vim.fn.has("win32") == 1
|
||||||
|
---@param tool string
|
||||||
|
---@param win boolean?
|
||||||
|
local function have(tool, win)
|
||||||
|
return (win == nil or is_win == win) and vim.fn.executable(tool) == 1
|
||||||
|
end
|
||||||
|
|
||||||
|
local have_cc = vim.env.CC ~= nil or have("cc", false) or have("cl", true) or (is_win and win_find_cl() ~= nil)
|
||||||
|
|
||||||
|
if not have_cc and is_win and vim.fn.executable("gcc") == 1 then
|
||||||
|
vim.env.CC = "gcc"
|
||||||
|
have_cc = true
|
||||||
|
end
|
||||||
|
|
||||||
|
---@class lazyvim.util.treesitter.Health: table<string,boolean>
|
||||||
|
local ret = {
|
||||||
|
["tree-sitter (CLI)"] = have("tree-sitter"),
|
||||||
|
["C compiler"] = have_cc,
|
||||||
|
tar = have("tar"),
|
||||||
|
curl = have("curl"),
|
||||||
|
node = have("node"),
|
||||||
|
}
|
||||||
|
local ok = true
|
||||||
|
for _, v in pairs(ret) do
|
||||||
|
ok = ok and v
|
||||||
|
end
|
||||||
|
return ok, ret
|
||||||
|
end
|
||||||
|
|
||||||
|
---@param cb fun()
|
||||||
|
function M.build(cb)
|
||||||
|
M.ensure_treesitter_cli(function(_, err)
|
||||||
|
local ok, health = M.check()
|
||||||
|
if ok then
|
||||||
|
return cb()
|
||||||
|
else
|
||||||
|
local lines = { "Unmet requirements for **nvim-treesitter** `main`:" }
|
||||||
|
local keys = vim.tbl_keys(health) ---@type string[]
|
||||||
|
table.sort(keys)
|
||||||
|
for _, k in pairs(keys) do
|
||||||
|
lines[#lines + 1] = ("- %s `%s`"):format(health[k] and "✅" or "❌", k)
|
||||||
|
end
|
||||||
|
vim.list_extend(lines, {
|
||||||
|
"",
|
||||||
|
"See the requirements at [nvim-treesitter](https://github.com/nvim-treesitter/nvim-treesitter/tree/main?tab=readme-ov-file#requirements)",
|
||||||
|
"Run `:checkhealth nvim-treesitter` for more information.",
|
||||||
|
})
|
||||||
|
if vim.fn.has("win32") == 1 and not health["C compiler"] then
|
||||||
|
lines[#lines + 1] = "Install a C compiler with `winget install --id=BrechtSanders.WinLibs.POSIX.UCRT -e`"
|
||||||
|
end
|
||||||
|
vim.list_extend(lines, err and { "", err } or {})
|
||||||
|
LazyVim.error(lines, { title = "LazyVim Treesitter" })
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
|
||||||
|
---@param cb fun(ok:boolean, err?:string)
|
||||||
|
function M.ensure_treesitter_cli(cb)
|
||||||
|
if vim.fn.executable("tree-sitter") == 1 then
|
||||||
|
return cb(true)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- try installing with mason
|
||||||
|
if not pcall(require, "mason") then
|
||||||
|
return cb(false, "`mason.nvim` is disabled in your config, so we cannot install it automatically.")
|
||||||
|
end
|
||||||
|
|
||||||
|
-- check again since we might have installed it already
|
||||||
|
if vim.fn.executable("tree-sitter") == 1 then
|
||||||
|
return cb(true)
|
||||||
|
end
|
||||||
|
|
||||||
|
local mr = require("mason-registry")
|
||||||
|
mr.refresh(function()
|
||||||
|
local p = mr.get_package("tree-sitter-cli")
|
||||||
|
if not p:is_installed() then
|
||||||
|
LazyVim.info("Installing `tree-sitter-cli` with `mason.nvim`...")
|
||||||
|
p:install(
|
||||||
|
nil,
|
||||||
|
vim.schedule_wrap(function(success)
|
||||||
|
if success then
|
||||||
|
LazyVim.info("Installed `tree-sitter-cli` with `mason.nvim`.")
|
||||||
|
cb(true)
|
||||||
|
else
|
||||||
|
cb(false, "Failed to install `tree-sitter-cli` with `mason.nvim`.")
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
)
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
|
||||||
|
return M
|
||||||
|
|
@ -1,27 +0,0 @@
|
||||||
---@class lazyvim.util.ui
|
|
||||||
local M = {}
|
|
||||||
|
|
||||||
-- foldtext for Neovim < 0.10.0
|
|
||||||
function M.foldtext()
|
|
||||||
return vim.api.nvim_buf_get_lines(0, vim.v.lnum - 1, vim.v.lnum, false)[1]
|
|
||||||
end
|
|
||||||
|
|
||||||
-- optimized treesitter foldexpr for Neovim >= 0.10.0
|
|
||||||
function M.foldexpr()
|
|
||||||
local buf = vim.api.nvim_get_current_buf()
|
|
||||||
if vim.b[buf].ts_folds == nil then
|
|
||||||
-- as long as we don't have a filetype, don't bother
|
|
||||||
-- checking if treesitter is available (it won't)
|
|
||||||
if vim.bo[buf].filetype == "" then
|
|
||||||
return "0"
|
|
||||||
end
|
|
||||||
if vim.bo[buf].filetype:find("dashboard") then
|
|
||||||
vim.b[buf].ts_folds = false
|
|
||||||
else
|
|
||||||
vim.b[buf].ts_folds = pcall(vim.treesitter.get_parser, buf)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
return vim.b[buf].ts_folds and vim.treesitter.foldexpr() or "0"
|
|
||||||
end
|
|
||||||
|
|
||||||
return M
|
|
||||||
|
|
@ -1,3 +1,3 @@
|
||||||
#!/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
nvim -l tests/minit.lua --minitest
|
nvim -l tests/minit.lua --minitest "$@"
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,8 @@ describe("Extra", function()
|
||||||
return not vim.tbl_contains(ignore, extra.modname)
|
return not vim.tbl_contains(ignore, extra.modname)
|
||||||
end, extras)
|
end, extras)
|
||||||
|
|
||||||
local lsp_to_pkg = require("mason-lspconfig.mappings.server").lspconfig_to_package
|
local lsp_to_pkg = {}
|
||||||
|
lsp_to_pkg = require("mason-lspconfig.mappings").get_mason_map().lspconfig_to_package
|
||||||
|
|
||||||
local tsspec = Plugin.Spec.new({
|
local tsspec = Plugin.Spec.new({
|
||||||
import = "lazyvim.plugins.treesitter",
|
import = "lazyvim.plugins.treesitter",
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,13 @@
|
||||||
#!/usr/bin/env -S nvim -l
|
#!/usr/bin/env -S nvim -l
|
||||||
|
|
||||||
vim.env.LAZY_STDPATH = ".tests"
|
vim.env.LAZY_STDPATH = ".tests"
|
||||||
load(vim.fn.system("curl -s https://raw.githubusercontent.com/folke/lazy.nvim/main/bootstrap.lua"))()
|
vim.env.LAZY_PATH = vim.fs.normalize("~/projects/lazy.nvim")
|
||||||
|
|
||||||
|
if vim.fn.isdirectory(vim.env.LAZY_PATH) == 1 then
|
||||||
|
loadfile(vim.env.LAZY_PATH .. "/bootstrap.lua")()
|
||||||
|
else
|
||||||
|
load(vim.fn.system("curl -s https://raw.githubusercontent.com/folke/lazy.nvim/main/bootstrap.lua"), "bootstrap.lua")()
|
||||||
|
end
|
||||||
|
|
||||||
-- Setup lazy.nvim
|
-- Setup lazy.nvim
|
||||||
require("lazy.minit").setup({
|
require("lazy.minit").setup({
|
||||||
|
|
@ -9,8 +15,8 @@ require("lazy.minit").setup({
|
||||||
{ dir = vim.uv.cwd() },
|
{ dir = vim.uv.cwd() },
|
||||||
{ "LazyVim/starter" },
|
{ "LazyVim/starter" },
|
||||||
{ "nvim-treesitter/nvim-treesitter" },
|
{ "nvim-treesitter/nvim-treesitter" },
|
||||||
{ "mason-org/mason-lspconfig.nvim", version = "^1.0.0" },
|
{ "mason-org/mason-lspconfig.nvim" },
|
||||||
{ "mason-org/mason.nvim", version = "^1.0.0" },
|
{ "mason-org/mason.nvim" },
|
||||||
{ "echasnovski/mini.icons", opts = {} },
|
{ "nvim-mini/mini.icons", opts = {} },
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
|
||||||
21
vim.toml
21
vim.toml
|
|
@ -1,21 +0,0 @@
|
||||||
[selene]
|
|
||||||
base = "lua51"
|
|
||||||
name = "vim"
|
|
||||||
|
|
||||||
[vim]
|
|
||||||
any = true
|
|
||||||
|
|
||||||
[jit]
|
|
||||||
any = true
|
|
||||||
|
|
||||||
[assert]
|
|
||||||
any = true
|
|
||||||
|
|
||||||
[describe]
|
|
||||||
any = true
|
|
||||||
|
|
||||||
[it]
|
|
||||||
any = true
|
|
||||||
|
|
||||||
[before_each.args]
|
|
||||||
any = true
|
|
||||||
19
vim.yml
Normal file
19
vim.yml
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
base: lua51
|
||||||
|
lua_versions:
|
||||||
|
- luajit
|
||||||
|
|
||||||
|
globals:
|
||||||
|
Snacks:
|
||||||
|
any: true
|
||||||
|
vim:
|
||||||
|
any: true
|
||||||
|
jit:
|
||||||
|
any: true
|
||||||
|
assert:
|
||||||
|
any: true
|
||||||
|
describe:
|
||||||
|
any: true
|
||||||
|
it:
|
||||||
|
any: true
|
||||||
|
before_each:
|
||||||
|
any: true
|
||||||
Loading…
Add table
Reference in a new issue