mirror of
https://github.com/LazyVim/LazyVim.git
synced 2026-07-25 14:01:06 +00:00
Merge branch 'main' into lang/typst
This commit is contained in:
commit
8d5ade612a
108 changed files with 2156 additions and 842 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
|
||||
|
||||
## [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)
|
||||
|
||||
|
||||
|
|
|
|||
27
NEWS.md
27
NEWS.md
|
|
@ -1,5 +1,23 @@
|
|||
# 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
|
||||
|
||||
Big new release with a lot of changes and improvements!
|
||||
|
|
@ -110,7 +128,6 @@ vim.g.snacks_animate = false
|
|||
## 11.x
|
||||
|
||||
- **Keymaps:**
|
||||
|
||||
- `<leader>gB` to open the current repo in the browser
|
||||
- `gco` and `gcO` to add a comment below or above the current line
|
||||
- `<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.
|
||||
|
||||
- `:LazyExtras` now has multiple new sections:
|
||||
|
||||
- **Enabled**: extras that are currently enabled
|
||||
- **Recommended Languages**: language extras recommended for the current buffer / directory
|
||||
- **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:
|
||||
|
||||
- `mini.surround`
|
||||
- `mini.indentscope` scopes are now also highlighted with `indent-blankline`
|
||||
- `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)
|
||||
|
||||
- The **lazygit** integration now configures:
|
||||
|
||||
- the theme based on the colorscheme
|
||||
- nerd font icons (v3)
|
||||
- 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
|
||||
|
||||
- Improved **formatting**:
|
||||
|
||||
- **LazyVim** can now work with multiple formatters. Types:
|
||||
|
||||
- **primary**: only one primary formatter can be active at a time.
|
||||
_(conform, none-ls, LSP)_
|
||||
- **secondary**: multiple secondary formatters can be active _(eslint, ...)_
|
||||
|
|
@ -241,18 +253,15 @@ Additionally, some core plugins have been moved to extras.
|
|||
```
|
||||
|
||||
- `none-ls.nvim` is no longer installed by default
|
||||
|
||||
- `conform.nvim` is now the default formatter
|
||||
- `nvim-lint` is now the default linter
|
||||
- If you want to keep using `none-ls.nvim`,
|
||||
you can enable the **lsp.none-ls** extra
|
||||
|
||||
- `dashboard.nvim` is the new default dashboard plugin
|
||||
|
||||
- If you want to keep using `alpha.nvim`, you can enable the **ui.alpha** extra
|
||||
|
||||
- Improved **root detection**:
|
||||
|
||||
- New `:LazyRoot` command that shows info about the root dir detection
|
||||
- Configurable with `vim.g.root_spec`
|
||||
|
||||
|
|
|
|||
|
|
@ -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** (用于部分克隆支持)
|
||||
- 一个 [Nerd Font](https://www.nerdfonts.com/) 字体 **_(可选)_**
|
||||
- 一个用于 `nvim-treesitter` 的 **C** 编译器。看 [这里](https://github.com/nvim-treesitter/nvim-treesitter#requirements)
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ und die Einfachheit von einem vorgefertigten Setup.
|
|||
|
||||
## ⚡️ 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)
|
||||
- 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
|
||||
|
||||
- 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)
|
||||
- una [Fuente Nerd](https://www.nerdfonts.com/) **_(opcional)_**
|
||||
- un compilador **C** para `nvim-treesitter`. Consulta [aquí](https://github.com/nvim-treesitter/nvim-treesitter#requirements)
|
||||
|
|
|
|||
151
README-FR.md
Normal file
151
README-FR.md
Normal file
|
|
@ -0,0 +1,151 @@
|
|||
<div align="center">
|
||||
<img src="https://user-images.githubusercontent.com/292349/213446185-2db63fd5-8c84-459c-9f04-e286382d6e80.png">
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
|
||||
<h4 align="center">
|
||||
<a href="https://lazyvim.github.io/installation">Install</a>
|
||||
·
|
||||
<a href="https://lazyvim.github.io/configuration">Configure</a>
|
||||
·
|
||||
<a href="https://lazyvim.github.io">Docs</a>
|
||||
</h4>
|
||||
|
||||
<div align="center"><p>
|
||||
<a href="https://github.com/LazyVim/LazyVim/releases/latest">
|
||||
<img alt="Latest release" src="https://img.shields.io/github/v/release/LazyVim/LazyVim?style=for-the-badge&logo=starship&color=C9CBFF&logoColor=D9E0EE&labelColor=302D41&include_prerelease&sort=semver" />
|
||||
</a>
|
||||
<a href="https://github.com/LazyVim/LazyVim/pulse">
|
||||
<img alt="Last commit" src="https://img.shields.io/github/last-commit/LazyVim/LazyVim?style=for-the-badge&logo=starship&color=8bd5ca&logoColor=D9E0EE&labelColor=302D41"/>
|
||||
</a>
|
||||
<a href="https://github.com/LazyVim/LazyVim/blob/main/LICENSE">
|
||||
<img alt="License" src="https://img.shields.io/github/license/LazyVim/LazyVim?style=for-the-badge&logo=starship&color=ee999f&logoColor=D9E0EE&labelColor=302D41" />
|
||||
</a>
|
||||
<a href="https://github.com/LazyVim/LazyVim/stargazers">
|
||||
<img alt="Stars" src="https://img.shields.io/github/stars/LazyVim/LazyVim?style=for-the-badge&logo=starship&color=c69ff5&logoColor=D9E0EE&labelColor=302D41" />
|
||||
</a>
|
||||
<a href="https://github.com/LazyVim/LazyVim/issues">
|
||||
<img alt="Issues" src="https://img.shields.io/github/issues/LazyVim/LazyVim?style=for-the-badge&logo=bilibili&color=F5E0DC&logoColor=D9E0EE&labelColor=302D41" />
|
||||
</a>
|
||||
<a href="https://github.com/LazyVim/LazyVim">
|
||||
<img alt="Repo Size" src="https://img.shields.io/github/repo-size/LazyVim/LazyVim?color=%23DDB6F2&label=SIZE&logo=codesandbox&style=for-the-badge&logoColor=D9E0EE&labelColor=302D41" />
|
||||
</a>
|
||||
<a href="https://twitter.com/intent/follow?screen_name=folke">
|
||||
<img alt="follow on Twitter" src="https://img.shields.io/twitter/follow/folke?style=for-the-badge&logo=twitter&color=8aadf3&logoColor=D9E0EE&labelColor=302D41" />
|
||||
</a>
|
||||
</div>
|
||||
|
||||
LazyVim est une configuration Neovim basée sur [💤 lazy.nvim](https://github.com/folke/lazy.nvim)
|
||||
facilitant la personnalisation et l'ajout d'extensions.
|
||||
Plutôt que d'imposer le choix entre partir de rien et utiliser
|
||||
une distribution toute faite, LazyVim offre le meilleur des deux mondes
|
||||
: la flexibilité d'une config ajustable selon vos besoins, et le confort
|
||||
d'une configuration pensée et peaufinée à l'avance.
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
## ✨ Fonctionnalités
|
||||
|
||||
- 🔥 Transforme Neovim en un environnement de développement complet
|
||||
- 💤 Customise et étends ta config sans effort grâce à [lazy.nvim](https://github.com/folke/lazy.nvim)
|
||||
- 🚀 Rapide comme l'éclair !
|
||||
- 🧹 Configuration par défaut propre et intuitive pour les options, les autocmds, et les keymaps
|
||||
- 📦 Livré avec une variété de plugins pre-configurés et prêts à être utilisés
|
||||
|
||||
## ⚡️ Pré-requis
|
||||
|
||||
- Neovim >= **0.9.0** (doit être compilé avec **LuaJIT**)
|
||||
- Git >= **2.19.0** (pour supporter le clonage partiel)
|
||||
- Un [Nerd Font](https://www.nerdfonts.com/) **_(optionel)_**
|
||||
- Un compileur **C** pour `nvim-treesitter`. Voir [ici](https://github.com/nvim-treesitter/nvim-treesitter#requirements)
|
||||
|
||||
## 🚀 Comment commencer
|
||||
|
||||
Un template pour **LazyVim** peut être trouvé [ici](https://github.com/LazyVim/starter)
|
||||
|
||||
<details><summary>Essayer avec Docker</summary>
|
||||
|
||||
```sh
|
||||
docker run -w /root -it --rm alpine:edge sh -uelic '
|
||||
apk add git lazygit fzf curl neovim ripgrep alpine-sdk --update
|
||||
git clone https://github.com/LazyVim/starter ~/.config/nvim
|
||||
cd ~/.config/nvim
|
||||
nvim
|
||||
'
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
<details><summary>Installer le <a href="https://github.com/LazyVim/starter">LazyVim Starter</a></summary>
|
||||
|
||||
- Sauvegardez votre configuration Neovim :
|
||||
|
||||
```sh
|
||||
mv ~/.config/nvim ~/.config/nvim.bak
|
||||
mv ~/.local/share/nvim ~/.local/share/nvim.bak
|
||||
```
|
||||
|
||||
- Clonez le starter
|
||||
|
||||
```sh
|
||||
git clone https://github.com/LazyVim/starter ~/.config/nvim
|
||||
```
|
||||
|
||||
- Supprimez le dossier `.git`, afin que vous puissiez l'ajouter à votre repo plus tard
|
||||
|
||||
```sh
|
||||
rm -rf ~/.config/nvim/.git
|
||||
```
|
||||
|
||||
- Lancez Neovim !
|
||||
|
||||
```sh
|
||||
nvim
|
||||
```
|
||||
|
||||
Consultez les commentaires dans les fichiers pour savoir comment personnaliser **LazyVim**.
|
||||
|
||||
</details>
|
||||
|
||||
---
|
||||
|
||||
Il y a une superbe vidéo (en anglais) de [@elijahmanor](https://github.com/elijahmanor)
|
||||
qui vous guide pas-à-pas pour commencer.
|
||||
|
||||
[](https://www.youtube.com/watch?v=N93cTbtLCIM)
|
||||
|
||||
[@dusty-phillips](https://github.com/dusty-phillips) a écrit un livre exhaustif
|
||||
sur LazyVim, nommé [LazyVim for Ambitious Developers](https://lazyvim-ambitious-devs.phillips.codes)
|
||||
disponible gratuitement en ligne.
|
||||
|
||||
## 📂 Structure de fichier
|
||||
|
||||
Les fichiers dans le dossier config vont être chargés automatiquement en temps voulu,
|
||||
donc pas besoin de `require` ces fichiers manuellement.
|
||||
**LazyVim** vient avec un ensemble de fichiers de configuration par défaut qui seront chargés
|
||||
**_avant_** les vôtres. Voir [ici](https://github.com/LazyVim/LazyVim/tree/main/lua/lazyvim/config)
|
||||
|
||||
Vous pouvez ajouter vos configurations de plugins sous `lua/plugins/`.
|
||||
Ici, tous les fichiers seront automatiquement chargés par [lazy.nvim](https://github.com/folke/lazy.nvim)
|
||||
|
||||
<pre>
|
||||
~/.config/nvim
|
||||
├── lua
|
||||
│ ├── config
|
||||
│ │ ├── autocmds.lua
|
||||
│ │ ├── keymaps.lua
|
||||
│ │ ├── lazy.lua
|
||||
│ │ └── options.lua
|
||||
│ └── plugins
|
||||
│ ├── spec1.lua
|
||||
│ ├── **
|
||||
│ └── spec2.lua
|
||||
└── init.lua
|
||||
</pre>
|
||||
|
||||
## ⚙️ Configuration
|
||||
|
||||
Veuillez vous référer à la [documentation](https://lazyvim.github.io)
|
||||
|
|
@ -57,7 +57,7 @@ insieme alla comodità di un setup preconfigurato.
|
|||
|
||||
## ⚡️ 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)
|
||||
- a [Nerd Font](https://www.nerdfonts.com/) **_(opzionale)_**
|
||||
- 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サポートのため)
|
||||
- [Nerd Font](https://www.nerdfonts.com/) **_(任意)_**
|
||||
- `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 (이것은 부분적인 클론기능을 지원하기 위함입니다.)
|
||||
- [Nerd Font](https://www.nerdfonts.com/) **_(옵션)_**
|
||||
- `nvim-treesitter`를 위한 **C** 컴파일러. [이 문서](https://github.com/nvim-treesitter/nvim-treesitter#requirements)를 확인해주시기바랍니다.
|
||||
|
|
|
|||
147
README-PL.md
Normal file
147
README-PL.md
Normal file
|
|
@ -0,0 +1,147 @@
|
|||
<div align="center">
|
||||
<img src="https://user-images.githubusercontent.com/292349/213446185-2db63fd5-8c84-459c-9f04-e286382d6e80.png">
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
|
||||
<h4 align="center">
|
||||
<a href="https://lazyvim.github.io/installation">Install</a>
|
||||
·
|
||||
<a href="https://lazyvim.github.io/configuration">Configure</a>
|
||||
·
|
||||
<a href="https://lazyvim.github.io">Docs</a>
|
||||
</h4>
|
||||
|
||||
<div align="center"><p>
|
||||
<a href="https://github.com/LazyVim/LazyVim/releases/latest">
|
||||
<img alt="Latest release" src="https://img.shields.io/github/v/release/LazyVim/LazyVim?style=for-the-badge&logo=starship&color=C9CBFF&logoColor=D9E0EE&labelColor=302D41&include_prerelease&sort=semver" />
|
||||
</a>
|
||||
<a href="https://github.com/LazyVim/LazyVim/pulse">
|
||||
<img alt="Last commit" src="https://img.shields.io/github/last-commit/LazyVim/LazyVim?style=for-the-badge&logo=starship&color=8bd5ca&logoColor=D9E0EE&labelColor=302D41"/>
|
||||
</a>
|
||||
<a href="https://github.com/LazyVim/LazyVim/blob/main/LICENSE">
|
||||
<img alt="License" src="https://img.shields.io/github/license/LazyVim/LazyVim?style=for-the-badge&logo=starship&color=ee999f&logoColor=D9E0EE&labelColor=302D41" />
|
||||
</a>
|
||||
<a href="https://github.com/LazyVim/LazyVim/stargazers">
|
||||
<img alt="Stars" src="https://img.shields.io/github/stars/LazyVim/LazyVim?style=for-the-badge&logo=starship&color=c69ff5&logoColor=D9E0EE&labelColor=302D41" />
|
||||
</a>
|
||||
<a href="https://github.com/LazyVim/LazyVim/issues">
|
||||
<img alt="Issues" src="https://img.shields.io/github/issues/LazyVim/LazyVim?style=for-the-badge&logo=bilibili&color=F5E0DC&logoColor=D9E0EE&labelColor=302D41" />
|
||||
</a>
|
||||
<a href="https://github.com/LazyVim/LazyVim">
|
||||
<img alt="Repo Size" src="https://img.shields.io/github/repo-size/LazyVim/LazyVim?color=%23DDB6F2&label=SIZE&logo=codesandbox&style=for-the-badge&logoColor=D9E0EE&labelColor=302D41" />
|
||||
</a>
|
||||
<a href="https://twitter.com/intent/follow?screen_name=folke">
|
||||
<img alt="follow on Twitter" src="https://img.shields.io/twitter/follow/folke?style=for-the-badge&logo=twitter&color=8aadf3&logoColor=D9E0EE&labelColor=302D41" />
|
||||
</a>
|
||||
</div>
|
||||
|
||||
LazyVim to konfiguracja Neovim oparta na [💤 lazy.nvim](https://github.com/folke/lazy.nvim)
|
||||
która ułatwia dostosowywanie i rozszerzanie konfiguracji.
|
||||
Zamiast wybierać między rozpoczynaniem od zera a używaniem gotowej dystrybucji, LazyVim oferuje najlepsze z obu światów – elastyczność pozwalającą na dostosowanie konfiguracji do własnych potrzeb oraz wygodę wstępnie skonfigurowanego środowiska.
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
## ✨ Funkcje
|
||||
|
||||
- 🔥 Przekształć Neovim w pełnoprawne IDE
|
||||
- 💤 Łatwo dostosowuj i rozszerzaj swoją konfigurację dzięki [lazy.nvim](https://github.com/folke/lazy.nvim)
|
||||
- 🚀 Niezwykle szybkie działanie
|
||||
- 🧹 Przemyślane domyślne ustawienia opcji, autocmd i skrótów klawiszowych
|
||||
- 📦 Zawiera bogaty zestaw wstępnie skonfigurowanych wtyczek gotowych do użycia
|
||||
|
||||
## ⚡️ Wymagania
|
||||
|
||||
- Neovim >= **0.9.0** (musi być skompilowany z **LuaJIT**)
|
||||
- Git >= **2.19.0** (dla obsługi częściowego klonowania repozytoriów)
|
||||
- [Nerd Font](https://www.nerdfonts.com/) **_(opcjonalnie)_**
|
||||
- Kompilator **C** wymagany dla `nvim-treesitter`. Szczegóły [tutaj](https://github.com/nvim-treesitter/nvim-treesitter#requirements)
|
||||
|
||||
## 🚀 Pierwsze kroki
|
||||
|
||||
Szablon startowy dla **LazyVim** znajdziesz [tutaj](https://github.com/LazyVim/starter)
|
||||
|
||||
<details><summary>Wypróbuj z Dockerem</summary>
|
||||
|
||||
```sh
|
||||
docker run -w /root -it --rm alpine:edge sh -uelic '
|
||||
apk add git lazygit fzf curl neovim ripgrep alpine-sdk --update
|
||||
git clone https://github.com/LazyVim/starter ~/.config/nvim
|
||||
cd ~/.config/nvim
|
||||
nvim
|
||||
'
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
<details><summary>Zainstaluj <a href="https://github.com/LazyVim/starter">Starter LazyVim</a></summary>
|
||||
|
||||
- Wykonaj kopię zapasową swoich obecnych plików Neovim:
|
||||
|
||||
```sh
|
||||
mv ~/.config/nvim ~/.config/nvim.bak
|
||||
mv ~/.local/share/nvim ~/.local/share/nvim.bak
|
||||
```
|
||||
|
||||
- Sklonuj repozytorium startowe:
|
||||
|
||||
```sh
|
||||
git clone https://github.com/LazyVim/starter ~/.config/nvim
|
||||
```
|
||||
|
||||
- Usuń folder `.git`, aby później móc dodać własne repozytorium:
|
||||
|
||||
```sh
|
||||
rm -rf ~/.config/nvim/.git
|
||||
```
|
||||
|
||||
- Uruchom Neovim!
|
||||
|
||||
```sh
|
||||
nvim
|
||||
```
|
||||
|
||||
W plikach znajdziesz komentarze, które pomogą Ci dostosować **LazyVim**.
|
||||
|
||||
</details>
|
||||
|
||||
---
|
||||
|
||||
[@elijahmanor](https://github.com/elijahmanor) stworzył świetne wideo z przewodnikiem, jak zacząć.
|
||||
|
||||
[](https://www.youtube.com/watch?v=N93cTbtLCIM)
|
||||
|
||||
[@dusty-phillips](https://github.com/dusty-phillips) napisał obszerną książkę
|
||||
[LazyVim for Ambitious Developers](https://lazyvim-ambitious-devs.phillips.codes),
|
||||
która jest dostępna za darmo online.
|
||||
|
||||
## 📂 Struktura plików
|
||||
|
||||
Pliki w katalogu `config` są automatycznie ładowane w odpowiednim momencie,
|
||||
więc nie musisz ich ręcznie dołączać.
|
||||
**LazyVim** zawiera zestaw domyślnych plików konfiguracyjnych,
|
||||
które zostaną załadowane **_przed_** Twoimi własnymi. Szczegóły znajdziesz [tutaj](https://github.com/LazyVim/LazyVim/tree/main/lua/lazyvim/config).
|
||||
|
||||
Możesz dodać własne specyfikacje wtyczek w katalogu `lua/plugins/`.
|
||||
Wszystkie pliki w tym folderze zostaną automatycznie załadowane przez [lazy.nvim](https://github.com/folke/lazy.nvim).
|
||||
|
||||
<pre>
|
||||
~/.config/nvim
|
||||
├── lua
|
||||
│ ├── config
|
||||
│ │ ├── autocmds.lua
|
||||
│ │ ├── keymaps.lua
|
||||
│ │ ├── lazy.lua
|
||||
│ │ └── options.lua
|
||||
│ └── plugins
|
||||
│ ├── spec1.lua
|
||||
│ ├── **
|
||||
│ └── spec2.lua
|
||||
└── init.lua
|
||||
</pre>
|
||||
|
||||
## ⚙️ Konfiguracja
|
||||
|
||||
Zapoznaj się z [dokumentacją](https://lazyvim.github.io).
|
||||
|
|
@ -57,7 +57,7 @@ como necessário, junto com a conveniência de um setup pré-configurado.
|
|||
|
||||
## ⚡️ 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)
|
||||
- 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)
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ to tweak your config as needed, along with the convenience of a pre-configured s
|
|||
|
||||
## ⚡️ 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)
|
||||
- a [Nerd Font](https://www.nerdfonts.com/) **_(optional)_**
|
||||
- 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*
|
||||
|
|
@ -53,7 +53,7 @@ FEATURES *LazyVim-features*
|
|||
|
||||
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)
|
||||
- a Nerd Font <https://www.nerdfonts.com/> **(optional)**
|
||||
- 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
|
||||
local M = {}
|
||||
|
||||
M.version = "14.15.0" -- x-release-please-version
|
||||
M.version = "15.9.0" -- x-release-please-version
|
||||
LazyVim.config = M
|
||||
|
||||
---@class LazyVimOptions
|
||||
|
|
@ -304,6 +304,8 @@ function M.load(name)
|
|||
end
|
||||
|
||||
M.did_init = false
|
||||
M._options = {} ---@type vim.wo|vim.bo
|
||||
|
||||
function M.init()
|
||||
if M.did_init then
|
||||
return
|
||||
|
|
@ -326,8 +328,14 @@ function M.init()
|
|||
-- this is needed to make sure options will be correctly applied
|
||||
-- after installing missing plugins
|
||||
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
|
||||
lazy_clipboard = vim.opt.clipboard
|
||||
lazy_clipboard = vim.opt.clipboard:get()
|
||||
vim.opt.clipboard = ""
|
||||
|
||||
if vim.g.deprecation_warnings == false then
|
||||
|
|
@ -353,7 +361,7 @@ function M.get_defaults()
|
|||
{ name = "telescope", extra = "editor.telescope" },
|
||||
},
|
||||
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" },
|
||||
},
|
||||
explorer = {
|
||||
|
|
|
|||
|
|
@ -81,8 +81,8 @@ map({ "i", "x", "n", "s" }, "<C-s>", "<cmd>w<cr><esc>", { desc = "Save File" })
|
|||
map("n", "<leader>K", "<cmd>norm! K<cr>", { desc = "Keywordprg" })
|
||||
|
||||
-- better indenting
|
||||
map("v", "<", "<gv")
|
||||
map("v", ">", ">gv")
|
||||
map("x", "<", "<gv")
|
||||
map("x", ">", ">gv")
|
||||
|
||||
-- commenting
|
||||
map("n", "gco", "o<esc>Vcx<esc><cmd>normal gcc<cr>fxa<bs>", { desc = "Add Comment Below" })
|
||||
|
|
@ -114,16 +114,18 @@ map("n", "[q", vim.cmd.cprev, { desc = "Previous Quickfix" })
|
|||
map("n", "]q", vim.cmd.cnext, { desc = "Next Quickfix" })
|
||||
|
||||
-- formatting
|
||||
map({ "n", "v" }, "<leader>cf", function()
|
||||
map({ "n", "x" }, "<leader>cf", function()
|
||||
LazyVim.format({ force = true })
|
||||
end, { desc = "Format" })
|
||||
|
||||
-- diagnostic
|
||||
local diagnostic_goto = function(next, severity)
|
||||
local go = next and vim.diagnostic.goto_next or vim.diagnostic.goto_prev
|
||||
severity = severity and vim.diagnostic.severity[severity] or nil
|
||||
return function()
|
||||
go({ severity = severity })
|
||||
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
|
||||
map("n", "<leader>cd", vim.diagnostic.open_float, { desc = "Line Diagnostics" })
|
||||
|
|
@ -163,12 +165,12 @@ end
|
|||
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() 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
|
||||
|
||||
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>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>gY", function()
|
||||
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
|
||||
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", "<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" })
|
||||
|
||||
-- Terminal Mappings
|
||||
map("t", "<C-/>", "<cmd>close<cr>", { desc = "Hide Terminal" })
|
||||
map("t", "<c-_>", "<cmd>close<cr>", { desc = "which_key_ignore" })
|
||||
map({"n","t"}, "<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 = "which_key_ignore" })
|
||||
|
||||
-- windows
|
||||
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>d", "<cmd>tabclose<cr>", { desc = "Close 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
|
||||
-- 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.completeopt = "menu,menuone,noselect"
|
||||
opt.conceallevel = 2 -- Hide * markup for bold and italic, but not markers with substitutions
|
||||
|
|
@ -69,7 +69,9 @@ opt.fillchars = {
|
|||
eob = " ",
|
||||
}
|
||||
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.grepformat = "%f:%l:%c:%m"
|
||||
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.smartcase = true -- Don't ignore case with capitals
|
||||
opt.smartindent = true -- Insert indents automatically
|
||||
opt.smoothscroll = true
|
||||
opt.spelllang = { "en" }
|
||||
opt.splitbelow = true -- Put new windows below current
|
||||
opt.splitkeep = "screen"
|
||||
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.termguicolors = true -- True color support
|
||||
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.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
|
||||
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 warn = vim.health.warn or vim.health.report_warn
|
||||
local error = vim.health.error or vim.health.report_error
|
||||
local info = vim.health.info or vim.health.report_info
|
||||
|
||||
function M.check()
|
||||
start("LazyVim")
|
||||
|
||||
if vim.fn.has("nvim-0.9.0") == 1 then
|
||||
ok("Using Neovim >= 0.9.0")
|
||||
if vim.fn.has("nvim-0.10.0") == 0 then
|
||||
warn("Use Neovim >= 0.10.0 for the best experience")
|
||||
end
|
||||
if vim.fn.has("nvim-0.11.2") == 1 then
|
||||
ok("Using Neovim >= 0.11.2")
|
||||
else
|
||||
error("Neovim >= 0.9.0 is required")
|
||||
error("Neovim >= 0.11.2 is required")
|
||||
end
|
||||
|
||||
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))
|
||||
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
|
||||
|
||||
return M
|
||||
|
|
|
|||
|
|
@ -1,7 +1,9 @@
|
|||
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",
|
||||
opts = {
|
||||
modes = { insert = true, command = true, terminal = false },
|
||||
|
|
@ -20,16 +22,20 @@ return {
|
|||
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",
|
||||
event = "VeryLazy",
|
||||
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",
|
||||
opts = function()
|
||||
local ai = require("mini.ai")
|
||||
|
|
@ -64,6 +70,8 @@ return {
|
|||
end,
|
||||
},
|
||||
|
||||
-- Configures LuaLS to support auto-completion and type checking
|
||||
-- while editing your Neovim configuration.
|
||||
{
|
||||
"folke/lazydev.nvim",
|
||||
ft = "lua",
|
||||
|
|
|
|||
|
|
@ -13,6 +13,14 @@ return {
|
|||
lazy = true,
|
||||
name = "catppuccin",
|
||||
opts = {
|
||||
lsp_styles = {
|
||||
underlines = {
|
||||
errors = { "undercurl" },
|
||||
hints = { "undercurl" },
|
||||
warnings = { "undercurl" },
|
||||
information = { "undercurl" },
|
||||
},
|
||||
},
|
||||
integrations = {
|
||||
aerial = true,
|
||||
alpha = true,
|
||||
|
|
@ -28,26 +36,14 @@ return {
|
|||
leap = true,
|
||||
lsp_trouble = true,
|
||||
mason = true,
|
||||
markdown = true,
|
||||
mini = true,
|
||||
native_lsp = {
|
||||
enabled = true,
|
||||
underlines = {
|
||||
errors = { "undercurl" },
|
||||
hints = { "undercurl" },
|
||||
warnings = { "undercurl" },
|
||||
information = { "undercurl" },
|
||||
},
|
||||
},
|
||||
navic = { enabled = true, custom_bg = "lualine" },
|
||||
neotest = true,
|
||||
neotree = true,
|
||||
noice = true,
|
||||
notify = true,
|
||||
semantic_tokens = true,
|
||||
snacks = true,
|
||||
telescope = true,
|
||||
treesitter = true,
|
||||
treesitter_context = true,
|
||||
which_key = true,
|
||||
},
|
||||
|
|
@ -58,7 +54,7 @@ return {
|
|||
optional = true,
|
||||
opts = function(_, opts)
|
||||
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,
|
||||
},
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
opts = { headerMaxWidth = 80 },
|
||||
cmd = "GrugFar",
|
||||
cmd = { "GrugFar", "GrugFarWithin" },
|
||||
keys = {
|
||||
{
|
||||
"<leader>sr",
|
||||
|
|
@ -18,7 +18,7 @@ return {
|
|||
},
|
||||
})
|
||||
end,
|
||||
mode = { "n", "v" },
|
||||
mode = { "n", "x" },
|
||||
desc = "Search and Replace",
|
||||
},
|
||||
},
|
||||
|
|
@ -40,6 +40,16 @@ return {
|
|||
{ "r", mode = "o", function() require("flash").remote() end, desc = "Remote Flash" },
|
||||
{ "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" },
|
||||
-- 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" },
|
||||
},
|
||||
},
|
||||
|
||||
|
|
@ -54,7 +64,7 @@ return {
|
|||
defaults = {},
|
||||
spec = {
|
||||
{
|
||||
mode = { "n", "v" },
|
||||
mode = { "n", "x" },
|
||||
{ "<leader><tab>", group = "tabs" },
|
||||
{ "<leader>c", group = "code" },
|
||||
{ "<leader>d", group = "debug" },
|
||||
|
|
@ -64,8 +74,8 @@ return {
|
|||
{ "<leader>gh", group = "hunks" },
|
||||
{ "<leader>q", group = "quit/session" },
|
||||
{ "<leader>s", group = "search" },
|
||||
{ "<leader>u", group = "ui", icon = { icon = " ", color = "cyan" } },
|
||||
{ "<leader>x", group = "diagnostics/quickfix", icon = { icon = " ", color = "green" } },
|
||||
{ "<leader>u", group = "ui" },
|
||||
{ "<leader>x", group = "diagnostics/quickfix" },
|
||||
{ "[", group = "prev" },
|
||||
{ "]", group = "next" },
|
||||
{ "g", group = "goto" },
|
||||
|
|
@ -143,7 +153,7 @@ return {
|
|||
local gs = package.loaded.gitsigns
|
||||
|
||||
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
|
||||
|
||||
-- stylua: ignore start
|
||||
|
|
@ -163,8 +173,8 @@ return {
|
|||
end, "Prev Hunk")
|
||||
map("n", "]H", function() gs.nav_hunk("last") end, "Last Hunk")
|
||||
map("n", "[H", function() gs.nav_hunk("first") end, "First Hunk")
|
||||
map({ "n", "v" }, "<leader>ghs", ":Gitsigns stage_hunk<CR>", "Stage Hunk")
|
||||
map({ "n", "v" }, "<leader>ghr", ":Gitsigns reset_hunk<CR>", "Reset Hunk")
|
||||
map({ "n", "x" }, "<leader>ghs", ":Gitsigns stage_hunk<CR>", "Stage Hunk")
|
||||
map({ "n", "x" }, "<leader>ghr", ":Gitsigns reset_hunk<CR>", "Reset Hunk")
|
||||
map("n", "<leader>ghS", gs.stage_buffer, "Stage Buffer")
|
||||
map("n", "<leader>ghu", gs.undo_stage_hunk, "Undo Stage Hunk")
|
||||
map("n", "<leader>ghR", gs.reset_buffer, "Reset Buffer")
|
||||
|
|
|
|||
|
|
@ -8,8 +8,11 @@ return {
|
|||
user = user:sub(1, 1):upper() .. user:sub(2)
|
||||
return {
|
||||
auto_insert_mode = true,
|
||||
question_header = " " .. user .. " ",
|
||||
answer_header = " Copilot ",
|
||||
headers = {
|
||||
user = " " .. user .. " ",
|
||||
assistant = " Copilot ",
|
||||
tool = " Tool ",
|
||||
},
|
||||
window = {
|
||||
width = 0.4,
|
||||
},
|
||||
|
|
@ -17,14 +20,14 @@ return {
|
|||
end,
|
||||
keys = {
|
||||
{ "<c-s>", "<CR>", ft = "copilot-chat", desc = "Submit Prompt", remap = true },
|
||||
{ "<leader>a", "", desc = "+ai", mode = { "n", "v" } },
|
||||
{ "<leader>a", "", desc = "+ai", mode = { "n", "x" } },
|
||||
{
|
||||
"<leader>aa",
|
||||
function()
|
||||
return require("CopilotChat").toggle()
|
||||
end,
|
||||
desc = "Toggle (CopilotChat)",
|
||||
mode = { "n", "v" },
|
||||
mode = { "n", "x" },
|
||||
},
|
||||
{
|
||||
"<leader>ax",
|
||||
|
|
@ -32,7 +35,7 @@ return {
|
|||
return require("CopilotChat").reset()
|
||||
end,
|
||||
desc = "Clear (CopilotChat)",
|
||||
mode = { "n", "v" },
|
||||
mode = { "n", "x" },
|
||||
},
|
||||
{
|
||||
"<leader>aq",
|
||||
|
|
@ -46,7 +49,7 @@ return {
|
|||
end)
|
||||
end,
|
||||
desc = "Quick Chat (CopilotChat)",
|
||||
mode = { "n", "v" },
|
||||
mode = { "n", "x" },
|
||||
},
|
||||
{
|
||||
"<leader>ap",
|
||||
|
|
@ -54,7 +57,7 @@ return {
|
|||
require("CopilotChat").select_prompt()
|
||||
end,
|
||||
desc = "Prompt Actions (CopilotChat)",
|
||||
mode = { "n", "v" },
|
||||
mode = { "n", "x" },
|
||||
},
|
||||
},
|
||||
config = function(_, opts)
|
||||
|
|
@ -85,4 +88,24 @@ return {
|
|||
})
|
||||
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
|
||||
{
|
||||
"zbirenbaum/copilot.lua",
|
||||
|
|
@ -49,9 +60,9 @@ return {
|
|||
opts.sections.lualine_x,
|
||||
2,
|
||||
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
|
||||
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"
|
||||
end
|
||||
end)
|
||||
|
|
@ -98,15 +109,14 @@ return {
|
|||
{
|
||||
"saghen/blink.cmp",
|
||||
optional = true,
|
||||
dependencies = { "giuxtaposition/blink-cmp-copilot" },
|
||||
dependencies = { "fang2hou/blink-copilot" },
|
||||
opts = {
|
||||
sources = {
|
||||
default = { "copilot" },
|
||||
providers = {
|
||||
copilot = {
|
||||
name = "copilot",
|
||||
module = "blink-cmp-copilot",
|
||||
kind = "Copilot",
|
||||
module = "blink-copilot",
|
||||
score_offset = 100,
|
||||
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 "*",
|
||||
},
|
||||
},
|
||||
event = "InsertEnter",
|
||||
event = { "InsertEnter", "CmdlineEnter" },
|
||||
|
||||
---@module 'blink.cmp'
|
||||
---@type blink.cmp.Config
|
||||
opts = {
|
||||
snippets = {
|
||||
expand = function(snippet, _)
|
||||
return LazyVim.cmp.expand(snippet)
|
||||
end,
|
||||
preset = "default",
|
||||
},
|
||||
|
||||
appearance = {
|
||||
-- sets the fallback highlight groups to nvim-cmp's highlight groups
|
||||
-- useful for when your theme doesn't support blink.cmp
|
||||
|
|
@ -50,6 +49,7 @@ return {
|
|||
-- adjusts spacing to ensure icons are aligned
|
||||
nerd_font_variant = "mono",
|
||||
},
|
||||
|
||||
completion = {
|
||||
accept = {
|
||||
-- experimental auto-brackets support
|
||||
|
|
@ -82,7 +82,21 @@ return {
|
|||
},
|
||||
|
||||
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 = {
|
||||
|
|
@ -109,13 +123,13 @@ return {
|
|||
if not opts.keymap["<Tab>"] then
|
||||
if opts.keymap.preset == "super-tab" then -- super-tab
|
||||
opts.keymap["<Tab>"] = {
|
||||
require("blink.cmp.keymap.presets")["super-tab"]["<Tab>"][1],
|
||||
LazyVim.cmp.map({ "snippet_forward", "ai_accept" }),
|
||||
require("blink.cmp.keymap.presets").get("super-tab")["<Tab>"][1],
|
||||
LazyVim.cmp.map({ "snippet_forward", "ai_nes", "ai_accept" }),
|
||||
"fallback",
|
||||
}
|
||||
else -- other presets
|
||||
opts.keymap["<Tab>"] = {
|
||||
LazyVim.cmp.map({ "snippet_forward", "ai_accept" }),
|
||||
LazyVim.cmp.map({ "snippet_forward", "ai_nes", "ai_accept" }),
|
||||
"fallback",
|
||||
}
|
||||
end
|
||||
|
|
@ -171,8 +185,9 @@ return {
|
|||
"saghen/blink.cmp",
|
||||
opts = {
|
||||
sources = {
|
||||
-- add lazydev to your completion providers
|
||||
default = { "lazydev" },
|
||||
per_filetype = {
|
||||
lua = { inherit_defaults = true, "lazydev" },
|
||||
},
|
||||
providers = {
|
||||
lazydev = {
|
||||
name = "LazyDev",
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
return {
|
||||
-- disable builtin snippet support
|
||||
{ "garymjr/nvim-snippets", enabled = false },
|
||||
{ "garymjr/nvim-snippets", optional = true, enabled = false },
|
||||
|
||||
-- add luasnip
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
return {
|
||||
{
|
||||
"echasnovski/mini.comment",
|
||||
"nvim-mini/mini.comment",
|
||||
event = "VeryLazy",
|
||||
opts = {
|
||||
options = {
|
||||
|
|
|
|||
|
|
@ -1,17 +1,17 @@
|
|||
if lazyvim_docs then
|
||||
-- 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
|
||||
|
||||
-- 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
|
||||
|
||||
-- Example override for your own config:
|
||||
--[[
|
||||
return {
|
||||
{
|
||||
"echasnovski/mini.snippets",
|
||||
"nvim-mini/mini.snippets",
|
||||
opts = function(_, opts)
|
||||
-- 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
|
||||
|
|
@ -63,7 +63,7 @@ return {
|
|||
-- add mini.snippets
|
||||
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...
|
||||
dependencies = "rafamadriz/friendly-snippets",
|
||||
opts = function()
|
||||
|
|
|
|||
|
|
@ -3,12 +3,12 @@
|
|||
-- to select the text inside, change or modify the surrounding characters,
|
||||
-- and more.
|
||||
return {
|
||||
"echasnovski/mini.surround",
|
||||
"nvim-mini/mini.surround",
|
||||
keys = function(_, keys)
|
||||
-- Populate the keys based on the user's options
|
||||
local opts = LazyVim.opts("mini.surround")
|
||||
local mappings = {
|
||||
{ opts.mappings.add, desc = "Add Surrounding", mode = { "n", "v" } },
|
||||
{ opts.mappings.add, desc = "Add Surrounding", mode = { "n", "x" } },
|
||||
{ opts.mappings.delete, desc = "Delete Surrounding" },
|
||||
{ opts.mappings.find, desc = "Find Right Surrounding" },
|
||||
{ opts.mappings.find_left, desc = "Find Left Surrounding" },
|
||||
|
|
|
|||
|
|
@ -25,6 +25,9 @@ return {
|
|||
-- }
|
||||
-- ```
|
||||
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 })
|
||||
local cmp = require("cmp")
|
||||
local defaults = require("cmp.config.default")()
|
||||
|
|
@ -49,7 +52,7 @@ return {
|
|||
fallback()
|
||||
end,
|
||||
["<tab>"] = function(fallback)
|
||||
return LazyVim.cmp.map({ "snippet_forward", "ai_accept" }, fallback)()
|
||||
return LazyVim.cmp.map({ "snippet_forward", "ai_nes", "ai_accept" }, fallback)()
|
||||
end,
|
||||
}),
|
||||
sources = cmp.config.sources({
|
||||
|
|
|
|||
|
|
@ -13,6 +13,8 @@ return {
|
|||
function()
|
||||
if LazyVim.pick.picker.name == "telescope" then
|
||||
require("telescope").extensions.yank_history.yank_history({})
|
||||
elseif LazyVim.pick.picker.name == "snacks" then
|
||||
Snacks.picker.yanky()
|
||||
else
|
||||
vim.cmd([[YankyRingHistory]])
|
||||
end
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@ return {
|
|||
-- stylua: ignore
|
||||
keys = {
|
||||
{ "<leader>du", function() require("dapui").toggle({ }) end, desc = "Dap UI" },
|
||||
{ "<leader>de", function() require("dapui").eval() end, desc = "Eval", mode = {"n", "v"} },
|
||||
{ "<leader>de", function() require("dapui").eval() end, desc = "Eval", mode = {"n", "x"} },
|
||||
},
|
||||
opts = {},
|
||||
config = function(_, opts)
|
||||
|
|
|
|||
|
|
@ -19,8 +19,8 @@ return {
|
|||
keys = {
|
||||
{ "<C-a>", function() return M.dial(true) end, expr = true, desc = "Increment", mode = {"n", "v"} },
|
||||
{ "<C-x>", function() return M.dial(false) end, expr = true, desc = "Decrement", mode = {"n", "v"} },
|
||||
{ "g<C-a>", function() return M.dial(true, true) end, expr = true, desc = "Increment", mode = {"n", "v"} },
|
||||
{ "g<C-x>", function() return M.dial(false, true) end, expr = true, desc = "Decrement", mode = {"n", "v"} },
|
||||
{ "g<C-a>", function() return M.dial(true, true) end, expr = true, desc = "Increment", mode = {"n", "x"} },
|
||||
{ "g<C-x>", function() return M.dial(false, true) end, expr = true, desc = "Decrement", mode = {"n", "x"} },
|
||||
},
|
||||
opts = function()
|
||||
local augend = require("dial.augend")
|
||||
|
|
|
|||
|
|
@ -120,9 +120,9 @@ return {
|
|||
winopts = {
|
||||
layout = "vertical",
|
||||
-- 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,
|
||||
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",
|
||||
vertical = "down:15,border-top",
|
||||
hidden = "hidden",
|
||||
|
|
@ -135,7 +135,7 @@ return {
|
|||
winopts = {
|
||||
width = 0.5,
|
||||
-- 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,
|
||||
|
|
@ -218,6 +218,7 @@ return {
|
|||
{ "<leader><space>", LazyVim.pick("files"), desc = "Find Files (Root Dir)" },
|
||||
-- find
|
||||
{ "<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>ff", LazyVim.pick("files"), desc = "Find Files (Root Dir)" },
|
||||
{ "<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)" },
|
||||
-- git
|
||||
{ "<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_stash<cr>", desc = "Git Stash" },
|
||||
-- search
|
||||
{ '<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>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 commands<cr>", desc = "Commands" },
|
||||
{ "<leader>sd", "<cmd>FzfLua diagnostics_document<cr>", desc = "Document Diagnostics" },
|
||||
{ "<leader>sD", "<cmd>FzfLua diagnostics_workspace<cr>", desc = "Workspace Diagnostics" },
|
||||
{ "<leader>sd", "<cmd>FzfLua diagnostics_workspace<cr>", desc = "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", { root = false }), desc = "Grep (cwd)" },
|
||||
{ "<leader>sh", "<cmd>FzfLua help_tags<cr>", desc = "Help Pages" },
|
||||
|
|
@ -248,8 +253,8 @@ return {
|
|||
{ "<leader>sq", "<cmd>FzfLua quickfix<cr>", desc = "Quickfix List" },
|
||||
{ "<leader>sw", LazyVim.pick("grep_cword"), desc = "Word (Root Dir)" },
|
||||
{ "<leader>sW", LazyVim.pick("grep_cword", { root = false }), desc = "Word (cwd)" },
|
||||
{ "<leader>sw", LazyVim.pick("grep_visual"), mode = "v", desc = "Selection (Root Dir)" },
|
||||
{ "<leader>sW", LazyVim.pick("grep_visual", { root = false }), mode = "v", desc = "Selection (cwd)" },
|
||||
{ "<leader>sw", LazyVim.pick("grep_visual"), mode = "x", desc = "Selection (Root Dir)" },
|
||||
{ "<leader>sW", LazyVim.pick("grep_visual", { root = false }), mode = "x", desc = "Selection (cwd)" },
|
||||
{ "<leader>uC", LazyVim.pick("colorschemes"), desc = "Colorscheme with Preview" },
|
||||
{
|
||||
"<leader>ss",
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ return {
|
|||
},
|
||||
}
|
||||
|
||||
for i = 1, 5 do
|
||||
for i = 1, 9 do
|
||||
table.insert(keys, {
|
||||
"<leader>" .. i,
|
||||
function()
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ return {
|
|||
|
||||
-- rename surround mappings from gs to gz to prevent conflict with leap
|
||||
{
|
||||
"echasnovski/mini.surround",
|
||||
"nvim-mini/mini.surround",
|
||||
optional = true,
|
||||
opts = {
|
||||
mappings = {
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ return {
|
|||
|
||||
-- setup mini.diff
|
||||
{
|
||||
"echasnovski/mini.diff",
|
||||
"nvim-mini/mini.diff",
|
||||
event = "VeryLazy",
|
||||
keys = {
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
return {
|
||||
"echasnovski/mini.files",
|
||||
"nvim-mini/mini.files",
|
||||
opts = {
|
||||
windows = {
|
||||
preview = true,
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
return {
|
||||
{
|
||||
"echasnovski/mini.move",
|
||||
"nvim-mini/mini.move",
|
||||
event = "VeryLazy",
|
||||
opts = {},
|
||||
},
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ return {
|
|||
init = function()
|
||||
vim.g.navic_silence = true
|
||||
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)
|
||||
end
|
||||
end)
|
||||
|
|
|
|||
|
|
@ -30,34 +30,39 @@ return {
|
|||
"nvim-treesitter/nvim-treesitter",
|
||||
},
|
||||
keys = {
|
||||
{ "<leader>r", "", desc = "+refactor", mode = { "n", "v" } },
|
||||
{ "<leader>r", "", desc = "+refactor", mode = { "n", "x" } },
|
||||
{
|
||||
"<leader>rs",
|
||||
pick,
|
||||
mode = "v",
|
||||
mode = { "n", "x" },
|
||||
desc = "Refactor",
|
||||
},
|
||||
{
|
||||
"<leader>ri",
|
||||
function()
|
||||
require("refactoring").refactor("Inline Variable")
|
||||
return require("refactoring").refactor("Inline Variable")
|
||||
end,
|
||||
mode = { "n", "v" },
|
||||
mode = { "n", "x" },
|
||||
desc = "Inline Variable",
|
||||
expr = true,
|
||||
},
|
||||
{
|
||||
"<leader>rb",
|
||||
function()
|
||||
require("refactoring").refactor("Extract Block")
|
||||
return require("refactoring").refactor("Extract Block")
|
||||
end,
|
||||
mode = { "n", "x" },
|
||||
desc = "Extract Block",
|
||||
expr = true,
|
||||
},
|
||||
{
|
||||
"<leader>rf",
|
||||
function()
|
||||
require("refactoring").refactor("Extract Block To File")
|
||||
return require("refactoring").refactor("Extract Block To File")
|
||||
end,
|
||||
mode = { "n", "x" },
|
||||
desc = "Extract Block To File",
|
||||
expr = true,
|
||||
},
|
||||
{
|
||||
"<leader>rP",
|
||||
|
|
@ -71,6 +76,7 @@ return {
|
|||
function()
|
||||
require("refactoring").debug.print_var({ normal = true })
|
||||
end,
|
||||
mode = { "n", "x" },
|
||||
desc = "Debug Print Variable",
|
||||
},
|
||||
{
|
||||
|
|
@ -83,33 +89,36 @@ return {
|
|||
{
|
||||
"<leader>rf",
|
||||
function()
|
||||
require("refactoring").refactor("Extract Function")
|
||||
return require("refactoring").refactor("Extract Function")
|
||||
end,
|
||||
mode = "v",
|
||||
mode = { "n", "x" },
|
||||
desc = "Extract Function",
|
||||
expr = true,
|
||||
},
|
||||
{
|
||||
"<leader>rF",
|
||||
function()
|
||||
require("refactoring").refactor("Extract Function To File")
|
||||
return require("refactoring").refactor("Extract Function To File")
|
||||
end,
|
||||
mode = "v",
|
||||
mode = { "n", "x" },
|
||||
desc = "Extract Function To File",
|
||||
expr = true,
|
||||
},
|
||||
{
|
||||
"<leader>rx",
|
||||
function()
|
||||
require("refactoring").refactor("Extract Variable")
|
||||
return require("refactoring").refactor("Extract Variable")
|
||||
end,
|
||||
mode = "v",
|
||||
mode = { "n", "x" },
|
||||
desc = "Extract Variable",
|
||||
expr = true,
|
||||
},
|
||||
{
|
||||
"<leader>rp",
|
||||
function()
|
||||
require("refactoring").debug.print_var()
|
||||
end,
|
||||
mode = "v",
|
||||
mode = { "n", "x" },
|
||||
desc = "Debug Print Variable",
|
||||
},
|
||||
},
|
||||
|
|
|
|||
|
|
@ -178,7 +178,7 @@ return {
|
|||
end,
|
||||
},
|
||||
{
|
||||
"echasnovski/mini.starter",
|
||||
"nvim-mini/mini.starter",
|
||||
optional = true,
|
||||
opts = function(_, opts)
|
||||
local items = {
|
||||
|
|
|
|||
|
|
@ -101,6 +101,7 @@ return {
|
|||
"<cmd>Telescope buffers sort_mru=true sort_lastused=true ignore_current_buffer=true<cr>",
|
||||
desc = "Buffers",
|
||||
},
|
||||
{ "<leader>fB", "<cmd>Telescope buffers<cr>", desc = "Buffers (all)" },
|
||||
{ "<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", { root = false }), desc = "Find Files (cwd)" },
|
||||
|
|
@ -109,15 +110,18 @@ return {
|
|||
{ "<leader>fR", LazyVim.pick("oldfiles", { cwd = vim.uv.cwd() }), desc = "Recent (cwd)" },
|
||||
-- git
|
||||
{ "<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_stash<cr>", desc = "Git Stash" },
|
||||
-- search
|
||||
{ '<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>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 commands<cr>", desc = "Commands" },
|
||||
{ "<leader>sd", "<cmd>Telescope diagnostics bufnr=0<cr>", desc = "Document Diagnostics" },
|
||||
{ "<leader>sD", "<cmd>Telescope diagnostics<cr>", desc = "Workspace Diagnostics" },
|
||||
{ "<leader>sd", "<cmd>Telescope diagnostics<cr>", desc = "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", { root = false }), desc = "Grep (cwd)" },
|
||||
{ "<leader>sh", "<cmd>Telescope help_tags<cr>", desc = "Help Pages" },
|
||||
|
|
@ -132,8 +136,8 @@ return {
|
|||
{ "<leader>sq", "<cmd>Telescope quickfix<cr>", desc = "Quickfix List" },
|
||||
{ "<leader>sw", LazyVim.pick("grep_string", { word_match = "-w" }), desc = "Word (Root Dir)" },
|
||||
{ "<leader>sW", LazyVim.pick("grep_string", { root = false, word_match = "-w" }), desc = "Word (cwd)" },
|
||||
{ "<leader>sw", LazyVim.pick("grep_string"), mode = "v", desc = "Selection (Root Dir)" },
|
||||
{ "<leader>sW", LazyVim.pick("grep_string", { root = false }), mode = "v", desc = "Selection (cwd)" },
|
||||
{ "<leader>sw", LazyVim.pick("grep_string"), mode = "x", desc = "Selection (Root Dir)" },
|
||||
{ "<leader>sW", LazyVim.pick("grep_string", { root = false }), mode = "x", desc = "Selection (cwd)" },
|
||||
{ "<leader>uC", LazyVim.pick("colorscheme", { enable_preview = true }), desc = "Colorscheme with Preview" },
|
||||
{
|
||||
"<leader>ss",
|
||||
|
|
|
|||
|
|
@ -19,13 +19,14 @@ return {
|
|||
},
|
||||
{
|
||||
"mfussenegger/nvim-ansible",
|
||||
ft = {},
|
||||
ft = { "yaml" },
|
||||
keys = {
|
||||
{
|
||||
"<leader>ta",
|
||||
function()
|
||||
require("ansible").run()
|
||||
end,
|
||||
ft = "yaml.ansible",
|
||||
desc = "Ansible Run Playbook/Role",
|
||||
silent = true,
|
||||
},
|
||||
|
|
|
|||
|
|
@ -9,6 +9,8 @@ return {
|
|||
"compile_commands.json",
|
||||
"compile_flags.txt",
|
||||
"configure.ac", -- AutoTools
|
||||
"meson.build",
|
||||
"build.ninja",
|
||||
},
|
||||
})
|
||||
end,
|
||||
|
|
@ -58,21 +60,21 @@ return {
|
|||
-- Ensure mason installs the server
|
||||
clangd = {
|
||||
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 = {
|
||||
offsetEncoding = { "utf-16" },
|
||||
},
|
||||
|
|
|
|||
|
|
@ -21,13 +21,13 @@ return {
|
|||
},
|
||||
opts = function(_, opts)
|
||||
if type(opts.sources) == "table" then
|
||||
vim.list_extend(opts.sources, { name = "clojure" })
|
||||
vim.list_extend(opts.sources, { name = "conjure" })
|
||||
end
|
||||
end,
|
||||
},
|
||||
|
||||
-- Add s-exp mappings
|
||||
{ "PaterJason/nvim-treesitter-sexp", opts = {}, event = "LazyFile" },
|
||||
{ "julienvincent/nvim-paredit", opts = {}, event = "LazyFile" },
|
||||
|
||||
-- Colorize the output of the log buffer
|
||||
{
|
||||
|
|
@ -76,13 +76,13 @@ return {
|
|||
end
|
||||
|
||||
vim.keymap.set(
|
||||
{ "n", "v" },
|
||||
{ "n", "x" },
|
||||
"[c",
|
||||
"<CMD>call search('^; -\\+$', 'bw')<CR>",
|
||||
{ silent = true, buffer = true, desc = "Jumps to the begining of previous evaluation output." }
|
||||
)
|
||||
vim.keymap.set(
|
||||
{ "n", "v" },
|
||||
{ "n", "x" },
|
||||
"]c",
|
||||
"<CMD>call search('^; -\\+$', 'w')<CR>",
|
||||
{ silent = true, buffer = true, desc = "Jumps to the begining of next evaluation output." }
|
||||
|
|
|
|||
|
|
@ -2,7 +2,14 @@ return {
|
|||
recommended = function()
|
||||
return LazyVim.extras.wants({
|
||||
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,
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,15 +1,15 @@
|
|||
return {
|
||||
recommended = function()
|
||||
return LazyVim.extras.wants({
|
||||
ft = { "cs", "vb" },
|
||||
root = { "*.sln", "*.csproj", "omnisharp.json", "function.json" },
|
||||
ft = { "cs", "vb", "fsharp" },
|
||||
root = { "*.sln", "*.csproj", "*.fsproj", "omnisharp.json", "function.json", "paket.dependencies", "paket.lock" },
|
||||
})
|
||||
end,
|
||||
|
||||
{ "Hoffs/omnisharp-extended-lsp.nvim", lazy = true },
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = { ensure_installed = { "c_sharp" } },
|
||||
opts = { ensure_installed = { "c_sharp", "fsharp" } },
|
||||
},
|
||||
{
|
||||
"nvimtools/none-ls.nvim",
|
||||
|
|
@ -18,6 +18,7 @@ return {
|
|||
local nls = require("null-ls")
|
||||
opts.sources = opts.sources or {}
|
||||
table.insert(opts.sources, nls.builtins.formatting.csharpier)
|
||||
table.insert(opts.sources, nls.builtins.formatting.fantomas)
|
||||
end,
|
||||
},
|
||||
{
|
||||
|
|
@ -26,23 +27,19 @@ return {
|
|||
opts = {
|
||||
formatters_by_ft = {
|
||||
cs = { "csharpier" },
|
||||
},
|
||||
formatters = {
|
||||
csharpier = {
|
||||
command = "dotnet-csharpier",
|
||||
args = { "--write-stdout" },
|
||||
},
|
||||
fsharp = { "fantomas" },
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"mason-org/mason.nvim",
|
||||
opts = { ensure_installed = { "csharpier", "netcoredbg" } },
|
||||
opts = { ensure_installed = { "csharpier", "netcoredbg", "fantomas" } },
|
||||
},
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
opts = {
|
||||
servers = {
|
||||
fsautocomplete = {},
|
||||
omnisharp = {
|
||||
handlers = {
|
||||
["textDocument/definition"] = function(...)
|
||||
|
|
@ -104,12 +101,12 @@ return {
|
|||
"nvim-neotest/neotest",
|
||||
optional = true,
|
||||
dependencies = {
|
||||
"Issafalcon/neotest-dotnet",
|
||||
"Nsidorenco/neotest-vstest",
|
||||
},
|
||||
opts = {
|
||||
adapters = {
|
||||
["neotest-dotnet"] = {
|
||||
-- Here we can set options for neotest-dotnet
|
||||
["neotest-vstest"] = {
|
||||
-- Here we can set options for neotest-vstest
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
@ -17,4 +17,13 @@ return {
|
|||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"conform.nvim",
|
||||
optional = true,
|
||||
opts = {
|
||||
formatters_by_ft = {
|
||||
gleam = { "gleam" },
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -139,7 +139,7 @@ return {
|
|||
|
||||
-- Filetype icons
|
||||
{
|
||||
"echasnovski/mini.icons",
|
||||
"nvim-mini/mini.icons",
|
||||
opts = {
|
||||
file = {
|
||||
[".go-version"] = { glyph = "", hl = "MiniIconsBlue" },
|
||||
|
|
|
|||
|
|
@ -14,17 +14,40 @@ return {
|
|||
|
||||
{
|
||||
"mrcjkb/haskell-tools.nvim",
|
||||
version = "^3",
|
||||
version = false,
|
||||
ft = { "haskell", "lhaskell", "cabal", "cabalproject" },
|
||||
dependencies = {
|
||||
{ "nvim-telescope/telescope.nvim", optional = true },
|
||||
keys = {
|
||||
{
|
||||
"<localleader>e",
|
||||
"<cmd>HlsEvalAll<cr>",
|
||||
ft = "haskell",
|
||||
desc = "Evaluate All",
|
||||
},
|
||||
{
|
||||
"<localleader>h",
|
||||
function()
|
||||
require("haskell-tools").hoogle.hoogle_signature()
|
||||
end,
|
||||
ft = "haskell",
|
||||
desc = "Hoogle Signature",
|
||||
},
|
||||
{
|
||||
"<localleader>r",
|
||||
function()
|
||||
require("haskell-tools").repl.toggle()
|
||||
end,
|
||||
ft = "haskell",
|
||||
desc = "REPL (Package)",
|
||||
},
|
||||
{
|
||||
"<localleader>R",
|
||||
function()
|
||||
require("haskell-tools").repl.toggle(vim.api.nvim_buf_get_name(0))
|
||||
end,
|
||||
ft = "haskell",
|
||||
desc = "REPL (Buffer)",
|
||||
},
|
||||
},
|
||||
config = function()
|
||||
local ok, telescope = pcall(require, "telescope")
|
||||
if ok then
|
||||
telescope.load_extension("ht")
|
||||
end
|
||||
end,
|
||||
},
|
||||
|
||||
{
|
||||
|
|
@ -67,17 +90,48 @@ return {
|
|||
},
|
||||
|
||||
{
|
||||
"luc-tielen/telescope_hoogle",
|
||||
ft = { "haskell", "lhaskell", "cabal", "cabalproject" },
|
||||
dependencies = {
|
||||
{ "nvim-telescope/telescope.nvim" },
|
||||
"nvim-telescope/telescope.nvim",
|
||||
optional = true,
|
||||
specs = {
|
||||
{
|
||||
"luc-tielen/telescope_hoogle",
|
||||
ft = { "haskell", "lhaskell", "cabal", "cabalproject" },
|
||||
opts = function()
|
||||
LazyVim.on_load("telescope.nvim", function()
|
||||
require("telescope").load_extension("ht")
|
||||
end)
|
||||
end,
|
||||
keys = {
|
||||
{
|
||||
"<localleader>H",
|
||||
"<cmd>Telescope hoogle<cr>",
|
||||
ft = "haskell",
|
||||
desc = "Hoogle",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
"stevearc/conform.nvim",
|
||||
optional = true,
|
||||
opts = {
|
||||
formatters_by_ft = {
|
||||
haskell = { "fourmolu" },
|
||||
cabal = { "cabal_fmt" },
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
"mfussenegger/nvim-lint",
|
||||
optional = true,
|
||||
opts = {
|
||||
linters_by_ft = {
|
||||
haskell = { "hlint" },
|
||||
},
|
||||
},
|
||||
config = function()
|
||||
local ok, telescope = pcall(require, "telescope")
|
||||
if ok then
|
||||
telescope.load_extension("hoogle")
|
||||
end
|
||||
end,
|
||||
},
|
||||
|
||||
-- Make sure lspconfig doesn't start hls,
|
||||
|
|
|
|||
|
|
@ -87,14 +87,13 @@ return {
|
|||
opts = function()
|
||||
local cmd = { vim.fn.exepath("jdtls") }
|
||||
if LazyVim.has("mason.nvim") then
|
||||
local mason_registry = require("mason-registry")
|
||||
local lombok_jar = mason_registry.get_package("jdtls"):get_install_path() .. "/lombok.jar"
|
||||
local lombok_jar = vim.fn.expand("$MASON/share/jdtls/lombok.jar")
|
||||
table.insert(cmd, string.format("--jvm-arg=-javaagent:%s", lombok_jar))
|
||||
end
|
||||
return {
|
||||
-- How to find the root dir for a given filename. The default comes from
|
||||
-- lspconfig which provides a function specifically for java projects.
|
||||
root_dir = LazyVim.lsp.get_raw_config("jdtls").default_config.root_dir,
|
||||
root_dir = function(path)
|
||||
return vim.fs.root(path, vim.lsp.config.jdtls.root_markers)
|
||||
end,
|
||||
|
||||
-- How to find the project name for a given root dir.
|
||||
project_name = function(root_dir)
|
||||
|
|
@ -151,23 +150,10 @@ return {
|
|||
if LazyVim.has("mason.nvim") then
|
||||
local mason_registry = require("mason-registry")
|
||||
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")
|
||||
local java_dbg_path = java_dbg_pkg:get_install_path()
|
||||
local jar_patterns = {
|
||||
java_dbg_path .. "/extension/server/com.microsoft.java.debug.plugin-*.jar",
|
||||
}
|
||||
bundles = vim.fn.glob("$MASON/share/java-debug-adapter/com.microsoft.java.debug.plugin-*jar", false, true)
|
||||
-- java-test also depends on java-debug-adapter.
|
||||
if opts.test and mason_registry.is_installed("java-test") then
|
||||
local java_test_pkg = mason_registry.get_package("java-test")
|
||||
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
|
||||
vim.list_extend(bundles, vim.fn.glob("$MASON/share/java-test/*.jar", false, true))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
@ -183,7 +169,9 @@ return {
|
|||
},
|
||||
settings = opts.settings,
|
||||
-- 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)
|
||||
|
||||
-- Existing server will be reused if the root_dir matches.
|
||||
|
|
@ -221,7 +209,7 @@ return {
|
|||
})
|
||||
wk.add({
|
||||
{
|
||||
mode = "v",
|
||||
mode = "x",
|
||||
buffer = args.buf,
|
||||
{ "<leader>cx", group = "extract" },
|
||||
{
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ return {
|
|||
servers = {
|
||||
jsonls = {
|
||||
-- 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 {}
|
||||
vim.list_extend(new_config.settings.json.schemas, require("schemastore").json.schemas())
|
||||
end,
|
||||
|
|
|
|||
|
|
@ -108,7 +108,7 @@ return {
|
|||
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 = {
|
||||
enable = true,
|
||||
-- height of the window
|
||||
|
|
|
|||
|
|
@ -113,17 +113,8 @@ return {
|
|||
require("render-markdown").setup(opts)
|
||||
Snacks.toggle({
|
||||
name = "Render Markdown",
|
||||
get = function()
|
||||
return require("render-markdown.state").enabled
|
||||
end,
|
||||
set = function(enabled)
|
||||
local m = require("render-markdown")
|
||||
if enabled then
|
||||
m.enable()
|
||||
else
|
||||
m.disable()
|
||||
end
|
||||
end,
|
||||
get = require("render-markdown").get,
|
||||
set = require("render-markdown").set,
|
||||
}):map("<leader>um")
|
||||
end,
|
||||
},
|
||||
|
|
|
|||
|
|
@ -24,4 +24,13 @@ return {
|
|||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"mfussenegger/nvim-lint",
|
||||
optional = true,
|
||||
opts = {
|
||||
linters_by_ft = {
|
||||
nix = { "statix" },
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,17 +26,19 @@ return {
|
|||
"reason",
|
||||
"dune",
|
||||
},
|
||||
root_dir = function(fname)
|
||||
return require("lspconfig.util").root_pattern(
|
||||
"*.opam",
|
||||
"esy.json",
|
||||
"package.json",
|
||||
".git",
|
||||
"dune-project",
|
||||
"dune-workspace",
|
||||
"*.ml"
|
||||
)(fname)
|
||||
end,
|
||||
root_markers = {
|
||||
function(name)
|
||||
return name:match(".*%.opam$")
|
||||
end,
|
||||
"esy.json",
|
||||
"package.json",
|
||||
".git",
|
||||
"dune-project",
|
||||
"dune-workspace",
|
||||
function(name)
|
||||
return name:match(".*%.ml$")
|
||||
end,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
|
|||
|
|
@ -48,11 +48,10 @@ return {
|
|||
optional = true,
|
||||
opts = function()
|
||||
local dap = require("dap")
|
||||
local path = require("mason-registry").get_package("php-debug-adapter"):get_install_path()
|
||||
dap.adapters.php = {
|
||||
type = "executable",
|
||||
command = "node",
|
||||
args = { path .. "/extension/out/phpDebug.js" },
|
||||
command = "php-debug-adapter",
|
||||
args = {},
|
||||
}
|
||||
end,
|
||||
},
|
||||
|
|
|
|||
|
|
@ -103,30 +103,20 @@ return {
|
|||
{ "<leader>dPc", function() require('dap-python').test_class() end, desc = "Debug Class", ft = "python" },
|
||||
},
|
||||
config = function()
|
||||
if vim.fn.has("win32") == 1 then
|
||||
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
|
||||
require("dap-python").setup("debugpy-adapter")
|
||||
end,
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
"linux-cultist/venv-selector.nvim",
|
||||
branch = "regexp", -- Use this branch for the new version
|
||||
cmd = "VenvSelect",
|
||||
enabled = function()
|
||||
return LazyVim.has("telescope.nvim")
|
||||
end,
|
||||
opts = {
|
||||
settings = {
|
||||
options = {
|
||||
notify_user_on_venv_activation = true,
|
||||
},
|
||||
options = {
|
||||
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",
|
||||
keys = { { "<leader>cv", "<cmd>:VenvSelect<cr>", desc = "Select VirtualEnv", ft = "python" } },
|
||||
},
|
||||
|
|
|
|||
|
|
@ -17,12 +17,12 @@ return {
|
|||
-- of files supported by R.nvim. This is an
|
||||
-- opportunity to create mappings local to buffers.
|
||||
vim.keymap.set("n", "<Enter>", "<Plug>RDSendLine", { buffer = true })
|
||||
vim.keymap.set("v", "<Enter>", "<Plug>RSendSelection", { buffer = true })
|
||||
vim.keymap.set("x", "<Enter>", "<Plug>RSendSelection", { buffer = true })
|
||||
|
||||
local wk = require("which-key")
|
||||
wk.add({
|
||||
buffer = true,
|
||||
mode = { "n", "v" },
|
||||
mode = { "n", "x" },
|
||||
{ "<localleader>a", group = "all" },
|
||||
{ "<localleader>b", group = "between marks" },
|
||||
{ "<localleader>c", group = "chunks" },
|
||||
|
|
@ -65,11 +65,7 @@ return {
|
|||
opts = {
|
||||
servers = {
|
||||
r_language_server = {
|
||||
root_dir = function(fname)
|
||||
return require("lspconfig.util").root_pattern("DESCRIPTION", "NAMESPACE", ".Rbuildignore")(fname)
|
||||
or require("lspconfig.util").find_git_ancestor(fname)
|
||||
or vim.loop.os_homedir()
|
||||
end,
|
||||
root_markers = { "DESCRIPTION", "NAMESPACE", ".Rbuildignore" },
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
|
|||
|
|
@ -6,10 +6,6 @@ if lazyvim_docs then
|
|||
end
|
||||
|
||||
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"
|
||||
|
||||
return {
|
||||
|
|
@ -25,9 +21,8 @@ return {
|
|||
},
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
---@class PluginLspOpts
|
||||
---@type PluginLspOpts
|
||||
opts = {
|
||||
---@type lspconfig.options
|
||||
servers = {
|
||||
ruby_lsp = {
|
||||
enabled = lsp == "ruby_lsp",
|
||||
|
|
|
|||
|
|
@ -56,7 +56,6 @@ return {
|
|||
|
||||
{
|
||||
"mrcjkb/rustaceanvim",
|
||||
version = vim.fn.has("nvim-0.10.0") == 0 and "^4" or false,
|
||||
ft = { "rust" },
|
||||
opts = {
|
||||
server = {
|
||||
|
|
@ -86,16 +85,12 @@ return {
|
|||
},
|
||||
procMacro = {
|
||||
enable = true,
|
||||
ignored = {
|
||||
["async-trait"] = { "async_trait" },
|
||||
["napi-derive"] = { "napi" },
|
||||
["async-recursion"] = { "async_recursion" },
|
||||
},
|
||||
},
|
||||
files = {
|
||||
excludeDirs = {
|
||||
exclude = {
|
||||
".direnv",
|
||||
".git",
|
||||
".jj",
|
||||
".github",
|
||||
".gitlab",
|
||||
"bin",
|
||||
|
|
@ -104,6 +99,8 @@ return {
|
|||
"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)
|
||||
if LazyVim.has("mason.nvim") then
|
||||
local package_path = require("mason-registry").get_package("codelldb"):get_install_path()
|
||||
local codelldb = package_path .. "/extension/adapter/codelldb"
|
||||
local library_path = package_path .. "/extension/lldb/lib/liblldb.dylib"
|
||||
local uname = io.popen("uname"):read("*l")
|
||||
if uname == "Linux" then
|
||||
library_path = package_path .. "/extension/lldb/lib/liblldb.so"
|
||||
end
|
||||
local codelldb = vim.fn.exepath("codelldb")
|
||||
local codelldb_lib_ext = io.popen("uname"):read("*l") == "Linux" and ".so" or ".dylib"
|
||||
local library_path = vim.fn.expand("$MASON/opt/lldb/lib/liblldb" .. codelldb_lib_ext)
|
||||
opts.dap = {
|
||||
adapter = require("rustaceanvim.config").get_codelldb_adapter(codelldb, library_path),
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,66 +11,70 @@ return {
|
|||
},
|
||||
{
|
||||
"scalameta/nvim-metals",
|
||||
ft = { "scala", "sbt" },
|
||||
config = function() end,
|
||||
},
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
opts = {
|
||||
servers = {
|
||||
metals = {
|
||||
keys = {
|
||||
{
|
||||
"<leader>me",
|
||||
function()
|
||||
require("telescope").extensions.metals.commands()
|
||||
end,
|
||||
desc = "Metals commands",
|
||||
},
|
||||
{
|
||||
"<leader>mc",
|
||||
function()
|
||||
require("metals").compile_cascade()
|
||||
end,
|
||||
desc = "Metals compile cascade",
|
||||
},
|
||||
{
|
||||
"<leader>mh",
|
||||
function()
|
||||
require("metals").hover_worksheet()
|
||||
end,
|
||||
desc = "Metals hover worksheet",
|
||||
},
|
||||
},
|
||||
init_options = {
|
||||
statusBarProvider = "off",
|
||||
},
|
||||
settings = {
|
||||
showImplicitArguments = true,
|
||||
excludedPackages = { "akka.actor.typed.javadsl", "com.github.swagger.akka.javadsl" },
|
||||
},
|
||||
},
|
||||
},
|
||||
setup = {
|
||||
metals = function(_, opts)
|
||||
local metals = require("metals")
|
||||
local metals_config = vim.tbl_deep_extend("force", metals.bare_config(), opts)
|
||||
metals_config.on_attach = LazyVim.has("nvim-dap") and metals.setup_dap or nil
|
||||
|
||||
local nvim_metals_group = vim.api.nvim_create_augroup("nvim-metals", { clear = true })
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
pattern = { "scala", "sbt" },
|
||||
callback = function()
|
||||
metals.initialize_or_attach(metals_config)
|
||||
end,
|
||||
group = nvim_metals_group,
|
||||
})
|
||||
return true
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
},
|
||||
keys = {
|
||||
{
|
||||
"<leader>me",
|
||||
function()
|
||||
require("telescope").extensions.metals.commands()
|
||||
end,
|
||||
desc = "Metals commands",
|
||||
},
|
||||
{
|
||||
"<leader>mc",
|
||||
function()
|
||||
require("metals").compile_cascade()
|
||||
end,
|
||||
desc = "Metals compile cascade",
|
||||
},
|
||||
{
|
||||
"<leader>mh",
|
||||
function()
|
||||
require("metals").hover_worksheet()
|
||||
end,
|
||||
desc = "Metals hover worksheet",
|
||||
},
|
||||
},
|
||||
},
|
||||
ft = { "scala", "sbt", "java" },
|
||||
opts = function()
|
||||
local metals_config = require("metals").bare_config()
|
||||
|
||||
metals_config.init_options.statusBarProvider = "off"
|
||||
|
||||
metals_config.settings = {
|
||||
verboseCompilation = true,
|
||||
showImplicitArguments = true,
|
||||
showImplicitConversionsAndClasses = true,
|
||||
showInferredType = true,
|
||||
superMethodLensesEnabled = true,
|
||||
excludedPackages = {
|
||||
"akka.actor.typed.javadsl",
|
||||
"org.apache.pekko.actor.typed.javadsl",
|
||||
"com.github.swagger.akka.javadsl",
|
||||
},
|
||||
testUserInterface = "Test Explorer",
|
||||
}
|
||||
|
||||
metals_config.on_attach = function(client, bufnr)
|
||||
-- your on_attach function
|
||||
require("metals").setup_dap()
|
||||
end
|
||||
|
||||
return metals_config
|
||||
end,
|
||||
config = function(self, metals_config)
|
||||
local nvim_metals_group = vim.api.nvim_create_augroup("nvim-metals", { clear = true })
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
pattern = self.ft,
|
||||
callback = function()
|
||||
require("metals").initialize_or_attach(metals_config)
|
||||
end,
|
||||
group = nvim_metals_group,
|
||||
})
|
||||
end,
|
||||
},
|
||||
{
|
||||
"mfussenegger/nvim-dap",
|
||||
optional = true,
|
||||
|
|
|
|||
|
|
@ -28,6 +28,11 @@ end
|
|||
|
||||
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 {
|
||||
recommended = function()
|
||||
return LazyVim.extras.wants({
|
||||
|
|
|
|||
|
|
@ -31,11 +31,6 @@ return {
|
|||
desc = "Organize Imports",
|
||||
},
|
||||
},
|
||||
capabilities = {
|
||||
workspace = {
|
||||
didChangeWatchedFiles = vim.fn.has("nvim-0.10") == 0 and { dynamicRegistration = true },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
|
|||
|
|
@ -28,11 +28,10 @@ return {
|
|||
},
|
||||
setup = {
|
||||
tailwindcss = function(_, opts)
|
||||
local tw = LazyVim.lsp.get_raw_config("tailwindcss")
|
||||
opts.filetypes = opts.filetypes or {}
|
||||
|
||||
-- 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
|
||||
--- @param ft string
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ return {
|
|||
opts = function(_, opts)
|
||||
opts.highlight = opts.highlight or {}
|
||||
if type(opts.ensure_installed) == "table" then
|
||||
vim.list_extend(opts.ensure_installed, { "bibtex" })
|
||||
vim.list_extend(opts.ensure_installed, { "bibtex", "latex" })
|
||||
end
|
||||
if type(opts.highlight.disable) == "table" then
|
||||
vim.list_extend(opts.highlight.disable, { "latex" })
|
||||
|
|
|
|||
58
lua/lazyvim/plugins/extras/lang/twig.lua
Normal file
58
lua/lazyvim/plugins/extras/lang/twig.lua
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
return {
|
||||
recommended = function()
|
||||
return LazyVim.extras.wants({
|
||||
ft = "twig",
|
||||
})
|
||||
end,
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = { ensure_installed = { "twig" } },
|
||||
},
|
||||
{
|
||||
"williamboman/mason.nvim",
|
||||
opts = {
|
||||
ensure_installed = {
|
||||
"twigcs",
|
||||
"twig-cs-fixer",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
opts = {
|
||||
servers = {
|
||||
twiggy_language_server = {
|
||||
enabled = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"nvimtools/none-ls.nvim",
|
||||
optional = true,
|
||||
opts = function(_, opts)
|
||||
local nls = require("null-ls")
|
||||
opts.sources = opts.sources or {}
|
||||
table.insert(opts.sources, nls.builtins.diagnostics.twigcs)
|
||||
-- Twig-CS-Fixer builtin not available in none-ls
|
||||
end,
|
||||
},
|
||||
{
|
||||
"mfussenegger/nvim-lint",
|
||||
optional = true,
|
||||
opts = {
|
||||
linters_by_ft = {
|
||||
twig = { "twigcs" },
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"stevearc/conform.nvim",
|
||||
optional = true,
|
||||
opts = {
|
||||
formatters_by_ft = {
|
||||
twig = { "twig-cs-fixer" },
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
@ -69,7 +69,8 @@ return {
|
|||
{
|
||||
"gD",
|
||||
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({
|
||||
command = "typescript.goToSourceDefinition",
|
||||
arguments = { params.textDocument.uri, params.position },
|
||||
|
|
@ -131,20 +132,42 @@ return {
|
|||
return true
|
||||
end,
|
||||
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)
|
||||
client.commands["_typescript.moveToFileRefactoring"] = function(command, ctx)
|
||||
---@type string, string, lsp.Range
|
||||
local action, uri, range = unpack(command.arguments)
|
||||
|
||||
local function move(newf)
|
||||
client.request("workspace/executeCommand", {
|
||||
client:request("workspace/executeCommand", {
|
||||
command = command.command,
|
||||
arguments = { action, uri, range, newf },
|
||||
})
|
||||
end
|
||||
|
||||
local fname = vim.uri_to_fname(uri)
|
||||
client.request("workspace/executeCommand", {
|
||||
client:request("workspace/executeCommand", {
|
||||
command = "typescript.tsserverRequest",
|
||||
arguments = {
|
||||
"getMoveToRefactoringFileSuggestions",
|
||||
|
|
@ -240,6 +263,10 @@ return {
|
|||
|
||||
for _, language in ipairs(js_filetypes) do
|
||||
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] = {
|
||||
{
|
||||
type = "pwa-node",
|
||||
|
|
@ -247,6 +274,16 @@ return {
|
|||
name = "Launch file",
|
||||
program = "${file}",
|
||||
cwd = "${workspaceFolder}",
|
||||
sourceMaps = true,
|
||||
runtimeExecutable = runtimeExecutable,
|
||||
skipFiles = {
|
||||
"<node_internals>/**",
|
||||
"node_modules/**",
|
||||
},
|
||||
resolveSourceMapLocations = {
|
||||
"${workspaceFolder}/**",
|
||||
"!**/node_modules/**",
|
||||
},
|
||||
},
|
||||
{
|
||||
type = "pwa-node",
|
||||
|
|
@ -254,6 +291,16 @@ return {
|
|||
name = "Attach",
|
||||
processId = require("dap.utils").pick_process,
|
||||
cwd = "${workspaceFolder}",
|
||||
sourceMaps = true,
|
||||
runtimeExecutable = runtimeExecutable,
|
||||
skipFiles = {
|
||||
"<node_internals>/**",
|
||||
"node_modules/**",
|
||||
},
|
||||
resolveSourceMapLocations = {
|
||||
"${workspaceFolder}/**",
|
||||
"!**/node_modules/**",
|
||||
},
|
||||
},
|
||||
}
|
||||
end
|
||||
|
|
@ -263,7 +310,7 @@ return {
|
|||
|
||||
-- Filetype icons
|
||||
{
|
||||
"echasnovski/mini.icons",
|
||||
"nvim-mini/mini.icons",
|
||||
opts = {
|
||||
file = {
|
||||
[".eslintrc.js"] = { glyph = "", hl = "MiniIconsYellow" },
|
||||
|
|
|
|||
|
|
@ -19,13 +19,7 @@ return {
|
|||
"neovim/nvim-lspconfig",
|
||||
opts = {
|
||||
servers = {
|
||||
volar = {
|
||||
init_options = {
|
||||
vue = {
|
||||
hybridMode = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
vue_ls = {},
|
||||
vtsls = {},
|
||||
},
|
||||
},
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ return {
|
|||
},
|
||||
},
|
||||
-- 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(
|
||||
"force",
|
||||
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",
|
||||
-- other settings removed for brevity
|
||||
opts = {
|
||||
---@type lspconfig.options
|
||||
---@type table<string, vim.lsp.Config>
|
||||
servers = {
|
||||
eslint = {
|
||||
settings = {
|
||||
|
|
@ -26,10 +26,6 @@ return {
|
|||
return
|
||||
end
|
||||
|
||||
local function get_client(buf)
|
||||
return LazyVim.lsp.get_clients({ name = "eslint", bufnr = buf })[1]
|
||||
end
|
||||
|
||||
local formatter = LazyVim.lsp.formatter({
|
||||
name = "eslint: lsp",
|
||||
primary = false,
|
||||
|
|
@ -37,24 +33,6 @@ return {
|
|||
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
|
||||
LazyVim.format.register(formatter)
|
||||
end,
|
||||
|
|
|
|||
|
|
@ -106,6 +106,7 @@ return {
|
|||
-- stylua: ignore
|
||||
keys = {
|
||||
{"<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.uv.cwd()) end, desc = "Run All Test Files (Neotest)" },
|
||||
{ "<leader>tr", function() require("neotest").run.run() end, desc = "Run Nearest (Neotest)" },
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
return {
|
||||
-- edgy
|
||||
-- Create and display predefined window layouts.
|
||||
{
|
||||
"folke/edgy.nvim",
|
||||
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",
|
||||
cond = vim.g.neovide == nil,
|
||||
opts = function(_, opts)
|
||||
|
|
@ -31,15 +32,19 @@ return {
|
|||
end,
|
||||
})
|
||||
|
||||
Snacks.toggle({
|
||||
name = "Mini Animate",
|
||||
get = function()
|
||||
return not vim.g.minianimate_disable
|
||||
end,
|
||||
set = function(state)
|
||||
vim.g.minianimate_disable = not state
|
||||
end,
|
||||
}):map("<leader>ua")
|
||||
-- schedule setting the mapping to override the default mapping from `keymaps.lua`
|
||||
-- seems `keymaps.lua` is the last event to execute on `VeryLazy` and it overwrites it
|
||||
vim.schedule(function()
|
||||
Snacks.toggle({
|
||||
name = "Mini Animate",
|
||||
get = function()
|
||||
return not vim.g.minianimate_disable
|
||||
end,
|
||||
set = function(state)
|
||||
vim.g.minianimate_disable = not state
|
||||
end,
|
||||
}):map("<leader>ua")
|
||||
end)
|
||||
|
||||
local animate = require("mini.animate")
|
||||
return vim.tbl_deep_extend("force", opts, {
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ return {
|
|||
-- code, this highlights the current level of indentation, and animates
|
||||
-- the highlighting.
|
||||
{
|
||||
"echasnovski/mini.indentscope",
|
||||
"nvim-mini/mini.indentscope",
|
||||
version = false, -- wait till new 0.7.0 release to put it back on semver
|
||||
event = "LazyFile",
|
||||
opts = {
|
||||
|
|
@ -23,6 +23,7 @@ return {
|
|||
"mason",
|
||||
"neo-tree",
|
||||
"notify",
|
||||
"sidekick_terminal",
|
||||
"snacks_dashboard",
|
||||
"snacks_notif",
|
||||
"snacks_terminal",
|
||||
|
|
@ -44,7 +45,7 @@ return {
|
|||
end,
|
||||
},
|
||||
|
||||
-- disable inent-blankline scope when mini-indentscope is enabled
|
||||
-- disable indent-blankline scope when mini-indentscope is enabled
|
||||
{
|
||||
"lukas-reineke/indent-blankline.nvim",
|
||||
optional = true,
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ return {
|
|||
|
||||
-- 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
|
||||
event = "VimEnter",
|
||||
opts = function()
|
||||
|
|
@ -67,7 +67,7 @@ return {
|
|||
local ms = (math.floor(stats.startuptime * 100 + 0.5) / 100)
|
||||
local pad_footer = string.rep(" ", 8)
|
||||
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
|
||||
pcall(starter.refresh)
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
-- Animates cursor movement with a smear effect.
|
||||
return {
|
||||
"sphamba/smear-cursor.nvim",
|
||||
event = "VeryLazy",
|
||||
|
|
@ -9,7 +10,7 @@ return {
|
|||
specs = {
|
||||
-- disable mini.animate cursor
|
||||
{
|
||||
"echasnovski/mini.animate",
|
||||
"nvim-mini/mini.animate",
|
||||
optional = true,
|
||||
opts = {
|
||||
cursor = { enable = false },
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ local pick_chezmoi = function()
|
|||
fzf_lua.actions.vimcmd_entry("ChezmoiEdit", selected, { cwd = os.getenv("HOME") })
|
||||
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
|
||||
local results = require("chezmoi.commands").list({
|
||||
args = {
|
||||
|
|
@ -135,7 +135,7 @@ return {
|
|||
|
||||
-- Filetype icons
|
||||
{
|
||||
"echasnovski/mini.icons",
|
||||
"nvim-mini/mini.icons",
|
||||
opts = {
|
||||
file = {
|
||||
[".chezmoiignore"] = { glyph = "", hl = "MiniIconsGrey" },
|
||||
|
|
|
|||
51
lua/lazyvim/plugins/extras/util/gh.lua
Normal file
51
lua/lazyvim/plugins/extras/util/gh.lua
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
return {
|
||||
|
||||
-- depends on the git extra for highlighting and auto-completion of github issues/prs
|
||||
{ import = "lazyvim.plugins.extras.lang.git" },
|
||||
|
||||
{ "ldelossa/litee.nvim", lazy = true },
|
||||
|
||||
-- gh.nvim
|
||||
{
|
||||
"ldelossa/gh.nvim",
|
||||
opts = {},
|
||||
config = function(_, opts)
|
||||
require("litee.lib").setup()
|
||||
require("litee.gh").setup(opts)
|
||||
end,
|
||||
keys = {
|
||||
{ "<leader>G", "", desc = "+Github" },
|
||||
{ "<leader>Gc", "", desc = "+Commits" },
|
||||
{ "<leader>Gcc", "<cmd>GHCloseCommit<cr>", desc = "Close" },
|
||||
{ "<leader>Gce", "<cmd>GHExpandCommit<cr>", desc = "Expand" },
|
||||
{ "<leader>Gco", "<cmd>GHOpenToCommit<cr>", desc = "Open To" },
|
||||
{ "<leader>Gcp", "<cmd>GHPopOutCommit<cr>", desc = "Pop Out" },
|
||||
{ "<leader>Gcz", "<cmd>GHCollapseCommit<cr>", desc = "Collapse" },
|
||||
{ "<leader>Gi", "", desc = "+Issues" },
|
||||
{ "<leader>Gip", "<cmd>GHPreviewIssue<cr>", desc = "Preview" },
|
||||
{ "<leader>Gio", "<cmd>GHOpenIssue<cr>", desc = "Open" },
|
||||
{ "<leader>Gl", "", desc = "+Litee" },
|
||||
{ "<leader>Glt", "<cmd>LTPanel<cr>", desc = "Toggle Panel" },
|
||||
{ "<leader>Gp", "", desc = "+Pull Request" },
|
||||
{ "<leader>Gpc", "<cmd>GHClosePR<cr>", desc = "Close" },
|
||||
{ "<leader>Gpd", "<cmd>GHPRDetails<cr>", desc = "Details" },
|
||||
{ "<leader>Gpe", "<cmd>GHExpandPR<cr>", desc = "Expand" },
|
||||
{ "<leader>Gpo", "<cmd>GHOpenPR<cr>", desc = "Open" },
|
||||
{ "<leader>Gpp", "<cmd>GHPopOutPR<cr>", desc = "PopOut" },
|
||||
{ "<leader>Gpr", "<cmd>GHRefreshPR<cr>", desc = "Refresh" },
|
||||
{ "<leader>Gpt", "<cmd>GHOpenToPR<cr>", desc = "Open To" },
|
||||
{ "<leader>Gpz", "<cmd>GHCollapsePR<cr>", desc = "Collapse" },
|
||||
{ "<leader>Gr", "", desc = "+Review" },
|
||||
{ "<leader>Grb", "<cmd>GHStartReview<cr>", desc = "Begin" },
|
||||
{ "<leader>Grc", "<cmd>GHCloseReview<cr>", desc = "Close" },
|
||||
{ "<leader>Grd", "<cmd>GHDeleteReview<cr>", desc = "Delete" },
|
||||
{ "<leader>Gre", "<cmd>GHExpandReview<cr>", desc = "Expand" },
|
||||
{ "<leader>Grs", "<cmd>GHSubmitReview<cr>", desc = "Submit" },
|
||||
{ "<leader>Grz", "<cmd>GHCollapseReview<cr>", desc = "Collapse" },
|
||||
{ "<leader>Gt", "", desc = "+Threads" },
|
||||
{ "<leader>Gtc", "<cmd>GHCreateThread<cr>", desc = "Create" },
|
||||
{ "<leader>Gtn", "<cmd>GHNextThread<cr>", desc = "Next" },
|
||||
{ "<leader>Gtt", "<cmd>GHToggleThread<cr>", desc = "Toggle" },
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
@ -4,7 +4,7 @@ local M = {}
|
|||
M.hl = {}
|
||||
|
||||
M.plugin = {
|
||||
"echasnovski/mini.hipatterns",
|
||||
"nvim-mini/mini.hipatterns",
|
||||
recommended = true,
|
||||
desc = "Highlight colors in your code. Also includes Tailwind CSS support.",
|
||||
event = "LazyFile",
|
||||
|
|
|
|||
|
|
@ -126,7 +126,7 @@ return {
|
|||
"goolord/alpha-nvim",
|
||||
optional = true,
|
||||
opts = function(_, dashboard)
|
||||
local button = dashboard.button("p", " " .. " Projects", pick)
|
||||
local button = dashboard.button("P", " " .. " Projects (util.project)", pick)
|
||||
button.opts.hl = "AlphaButtons"
|
||||
button.opts.hl_shortcut = "AlphaShortcut"
|
||||
table.insert(dashboard.section.buttons.val, 4, button)
|
||||
|
|
@ -134,12 +134,12 @@ return {
|
|||
},
|
||||
|
||||
{
|
||||
"echasnovski/mini.starter",
|
||||
"nvim-mini/mini.starter",
|
||||
optional = true,
|
||||
opts = function(_, opts)
|
||||
local items = {
|
||||
{
|
||||
name = "Projects",
|
||||
name = "Projects (util.project)",
|
||||
action = pick,
|
||||
section = string.rep(" ", 22) .. "Telescope",
|
||||
},
|
||||
|
|
@ -157,9 +157,9 @@ return {
|
|||
end
|
||||
local projects = {
|
||||
action = pick,
|
||||
desc = " Projects",
|
||||
desc = " Projects (util.project)",
|
||||
icon = " ",
|
||||
key = "p",
|
||||
key = "P",
|
||||
}
|
||||
|
||||
projects.desc = projects.desc .. string.rep(" ", 43 - #projects.desc)
|
||||
|
|
@ -175,9 +175,9 @@ return {
|
|||
opts = function(_, opts)
|
||||
table.insert(opts.dashboard.preset.keys, 3, {
|
||||
action = pick,
|
||||
desc = "Projects",
|
||||
desc = "Projects (util.project)",
|
||||
icon = " ",
|
||||
key = "p",
|
||||
key = "P",
|
||||
})
|
||||
end,
|
||||
},
|
||||
|
|
|
|||
|
|
@ -8,10 +8,11 @@ return {
|
|||
"mistweaverco/kulala.nvim",
|
||||
ft = "http",
|
||||
keys = {
|
||||
{ "<leader>R", "", desc = "+Rest", ft = "http" },
|
||||
{ "<leader>Rb", "<cmd>lua require('kulala').scratchpad()<cr>", desc = "Open scratchpad", ft = "http" },
|
||||
{ "<leader>R", "", desc = "+Rest" },
|
||||
{ "<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').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",
|
||||
"<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>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>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').show_stats()<cr>", desc = "Show stats", ft = "http" },
|
||||
{ "<leader>Rt", "<cmd>lua require('kulala').toggle_view()<cr>", desc = "Toggle headers/body", ft = "http" },
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ local enabled = {
|
|||
}
|
||||
|
||||
local Config = require("lazy.core.config")
|
||||
local vscode = require("vscode")
|
||||
Config.options.checker.enabled = false
|
||||
Config.options.change_detection.enabled = false
|
||||
Config.options.defaults.cond = function(plugin)
|
||||
|
|
@ -36,23 +37,30 @@ vim.api.nvim_create_autocmd("User", {
|
|||
callback = function()
|
||||
-- VSCode-specific keymaps for search and navigation
|
||||
vim.keymap.set("n", "<leader><space>", "<cmd>Find<cr>")
|
||||
vim.keymap.set("n", "<leader>/", [[<cmd>lua require('vscode').action('workbench.action.findInFiles')<cr>]])
|
||||
vim.keymap.set("n", "<leader>ss", [[<cmd>lua require('vscode').action('workbench.action.gotoSymbol')<cr>]])
|
||||
vim.keymap.set("n", "<leader>/", function()
|
||||
vscode.call("workbench.action.findInFiles")
|
||||
end)
|
||||
vim.keymap.set("n", "<leader>ss", function()
|
||||
vscode.call("workbench.action.gotoSymbol")
|
||||
end)
|
||||
|
||||
-- Keep undo/redo lists in sync with VsCode
|
||||
vim.keymap.set("n", "u", "<Cmd>call VSCodeNotify('undo')<CR>")
|
||||
vim.keymap.set("n", "<C-r>", "<Cmd>call VSCodeNotify('redo')<CR>")
|
||||
-- Toggle VS Code integrated terminal
|
||||
for _, lhs in ipairs({ "<leader>ft", "<leader>fT", "<c-/>" }) do
|
||||
vim.keymap.set("n", lhs, function()
|
||||
vscode.call("workbench.action.terminal.toggleTerminal")
|
||||
end)
|
||||
end
|
||||
|
||||
-- Navigate VSCode tabs like lazyvim buffers
|
||||
vim.keymap.set("n", "<S-h>", "<Cmd>call VSCodeNotify('workbench.action.previousEditor')<CR>")
|
||||
vim.keymap.set("n", "<S-l>", "<Cmd>call VSCodeNotify('workbench.action.nextEditor')<CR>")
|
||||
vim.keymap.set("n", "<S-h>", function()
|
||||
vscode.call("workbench.action.previousEditor")
|
||||
end)
|
||||
vim.keymap.set("n", "<S-l>", function()
|
||||
vscode.call("workbench.action.nextEditor")
|
||||
end)
|
||||
end,
|
||||
})
|
||||
|
||||
function LazyVim.terminal()
|
||||
require("vscode").action("workbench.action.terminal.toggleTerminal")
|
||||
end
|
||||
|
||||
return {
|
||||
{
|
||||
"snacks.nvim",
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ return {
|
|||
function()
|
||||
require("conform").format({ formatters = { "injected" }, timeout_ms = 3000 })
|
||||
end,
|
||||
mode = { "n", "v" },
|
||||
mode = { "n", "x" },
|
||||
desc = "Format Injected Langs",
|
||||
},
|
||||
},
|
||||
|
|
|
|||
|
|
@ -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({
|
||||
{ "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" },
|
||||
}, true, {})
|
||||
vim.fn.getchar()
|
||||
vim.cmd([[quit]])
|
||||
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
|
||||
|
||||
require("lazyvim.config").init()
|
||||
|
|
|
|||
|
|
@ -1,4 +1,6 @@
|
|||
return {
|
||||
-- Asynchronously calls language-specific linter tools and reports
|
||||
-- their results via the `vim.diagnostic` module.
|
||||
{
|
||||
"mfussenegger/nvim-lint",
|
||||
event = "LazyFile",
|
||||
|
|
|
|||
|
|
@ -20,7 +20,6 @@ return {
|
|||
source = "if_many",
|
||||
prefix = "●",
|
||||
-- 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",
|
||||
},
|
||||
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
|
||||
-- provide the inlay hints.
|
||||
inlay_hints = {
|
||||
enabled = true,
|
||||
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
|
||||
-- provide the code lenses.
|
||||
codelens = {
|
||||
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
|
||||
capabilities = {
|
||||
workspace = {
|
||||
|
|
@ -63,8 +68,10 @@ return {
|
|||
timeout_ms = nil,
|
||||
},
|
||||
-- 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 = {
|
||||
stylua = { enabled = false },
|
||||
lua_ls = {
|
||||
-- mason = false, -- set to false if you don't want this server to be installed with mason
|
||||
-- Use this to add any additional keymaps
|
||||
|
|
@ -99,7 +106,7 @@ return {
|
|||
},
|
||||
-- you can do any additional lsp server setup here
|
||||
-- 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 = {
|
||||
-- example to setup with typescript.nvim
|
||||
-- tsserver = function(_, opts)
|
||||
|
|
@ -113,7 +120,7 @@ return {
|
|||
return ret
|
||||
end,
|
||||
---@param opts PluginLspOpts
|
||||
config = function(_, opts)
|
||||
config = vim.schedule_wrap(function(_, opts)
|
||||
-- setup autoformat
|
||||
LazyVim.format.register(LazyVim.lsp.formatter())
|
||||
|
||||
|
|
@ -125,133 +132,95 @@ return {
|
|||
LazyVim.lsp.setup()
|
||||
LazyVim.lsp.on_dynamic_capability(require("lazyvim.plugins.lsp.keymaps").on_attach)
|
||||
|
||||
-- diagnostics signs
|
||||
if vim.fn.has("nvim-0.10.0") == 0 then
|
||||
if type(opts.diagnostics.signs) ~= "boolean" then
|
||||
for severity, icon in pairs(opts.diagnostics.signs.text) do
|
||||
local name = vim.diagnostic.severity[severity]:lower():gsub("^%l", string.upper)
|
||||
name = "DiagnosticSign" .. name
|
||||
vim.fn.sign_define(name, { text = icon, texthl = name, numhl = "" })
|
||||
-- inlay hints
|
||||
if opts.inlay_hints.enabled then
|
||||
LazyVim.lsp.on_supports_method("textDocument/inlayHint", function(client, buffer)
|
||||
if
|
||||
vim.api.nvim_buf_is_valid(buffer)
|
||||
and vim.bo[buffer].buftype == ""
|
||||
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
|
||||
|
||||
if vim.fn.has("nvim-0.10") == 1 then
|
||||
-- inlay hints
|
||||
if opts.inlay_hints.enabled then
|
||||
LazyVim.lsp.on_supports_method("textDocument/inlayHint", function(client, buffer)
|
||||
if
|
||||
vim.api.nvim_buf_is_valid(buffer)
|
||||
and vim.bo[buffer].buftype == ""
|
||||
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
|
||||
-- folds
|
||||
if opts.folds.enabled then
|
||||
LazyVim.lsp.on_supports_method("textDocument/foldingRange", function(client, buffer)
|
||||
if LazyVim.set_default("foldmethod", "expr") then
|
||||
LazyVim.set_default("foldexpr", "v:lua.vim.lsp.foldexpr()")
|
||||
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
|
||||
opts.diagnostics.virtual_text.prefix = vim.fn.has("nvim-0.10.0") == 0 and "●"
|
||||
or function(diagnostic)
|
||||
local icons = LazyVim.config.icons.diagnostics
|
||||
for d, icon in pairs(icons) do
|
||||
if diagnostic.severity == vim.diagnostic.severity[d:upper()] then
|
||||
return icon
|
||||
end
|
||||
opts.diagnostics.virtual_text.prefix = function(diagnostic)
|
||||
local icons = LazyVim.config.icons.diagnostics
|
||||
for d, icon in pairs(icons) do
|
||||
if diagnostic.severity == vim.diagnostic.severity[d:upper()] then
|
||||
return icon
|
||||
end
|
||||
end
|
||||
return "●"
|
||||
end
|
||||
end
|
||||
|
||||
vim.diagnostic.config(vim.deepcopy(opts.diagnostics))
|
||||
|
||||
local servers = opts.servers
|
||||
local has_cmp, cmp_nvim_lsp = pcall(require, "cmp_nvim_lsp")
|
||||
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)
|
||||
if opts.capabilities then
|
||||
vim.lsp.config("*", { capabilities = opts.capabilities })
|
||||
end
|
||||
|
||||
-- get all the servers that are available through mason-lspconfig
|
||||
local have_mason, mlsp = pcall(require, "mason-lspconfig")
|
||||
local all_mslp_servers = {}
|
||||
if have_mason then
|
||||
all_mslp_servers = vim.tbl_keys(require("mason-lspconfig.mappings.server").lspconfig_to_package)
|
||||
end
|
||||
local have_mason = LazyVim.has("mason-lspconfig.nvim")
|
||||
local mason_all = have_mason
|
||||
and vim.tbl_keys(require("mason-lspconfig.mappings").get_mason_map().lspconfig_to_package)
|
||||
or {} --[[ @as string[] ]]
|
||||
local mason_exclude = {} ---@type string[]
|
||||
|
||||
local ensure_installed = {} ---@type string[]
|
||||
for server, server_opts in pairs(servers) do
|
||||
if server_opts then
|
||||
server_opts = server_opts == true and {} or server_opts
|
||||
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 server_opts.mason == false or not vim.tbl_contains(all_mslp_servers, server) then
|
||||
setup(server)
|
||||
else
|
||||
ensure_installed[#ensure_installed + 1] = server
|
||||
end
|
||||
---@return boolean? exclude automatic setup
|
||||
local function configure(server)
|
||||
local sopts = opts.servers[server]
|
||||
sopts = sopts == true and {} or (not sopts) and { enabled = false } or sopts --[[@as lazyvim.lsp.Config]]
|
||||
|
||||
if sopts.enabled == false then
|
||||
mason_exclude[#mason_exclude + 1] = server
|
||||
return
|
||||
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
|
||||
return use_mason
|
||||
end
|
||||
|
||||
local install = vim.tbl_filter(configure, vim.tbl_keys(opts.servers))
|
||||
if have_mason then
|
||||
mlsp.setup({
|
||||
ensure_installed = vim.tbl_deep_extend(
|
||||
"force",
|
||||
ensure_installed,
|
||||
LazyVim.opts("mason-lspconfig.nvim").ensure_installed or {}
|
||||
),
|
||||
handlers = { setup },
|
||||
require("mason-lspconfig").setup({
|
||||
ensure_installed = vim.list_extend(install, LazyVim.opts("mason-lspconfig.nvim").ensure_installed or {}),
|
||||
automatic_enable = { exclude = mason_exclude },
|
||||
})
|
||||
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,
|
||||
end),
|
||||
},
|
||||
|
||||
-- cmdline tools and lsp servers
|
||||
|
|
@ -292,8 +261,4 @@ return {
|
|||
end)
|
||||
end,
|
||||
},
|
||||
|
||||
-- pin to v1 for now
|
||||
{ "mason-org/mason.nvim", version = "^1.0.0" },
|
||||
{ "mason-org/mason-lspconfig.nvim", version = "^1.0.0" },
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,8 +22,8 @@ function M.get()
|
|||
{ "K", function() return vim.lsp.buf.hover() end, desc = "Hover" },
|
||||
{ "gK", function() return vim.lsp.buf.signature_help() end, desc = "Signature Help", has = "signatureHelp" },
|
||||
{ "<c-k>", function() return vim.lsp.buf.signature_help() end, mode = "i", desc = "Signature Help", has = "signatureHelp" },
|
||||
{ "<leader>ca", vim.lsp.buf.code_action, desc = "Code Action", mode = { "n", "v" }, has = "codeAction" },
|
||||
{ "<leader>cc", vim.lsp.codelens.run, desc = "Run Codelens", mode = { "n", "v" }, has = "codeLens" },
|
||||
{ "<leader>ca", vim.lsp.buf.code_action, desc = "Code Action", mode = { "n", "x" }, has = "codeAction" },
|
||||
{ "<leader>cc", vim.lsp.codelens.run, desc = "Run Codelens", mode = { "n", "x" }, has = "codeLens" },
|
||||
{ "<leader>cC", vim.lsp.codelens.refresh, desc = "Refresh & Display Codelens", mode = { "n" }, has = "codeLens" },
|
||||
{ "<leader>cR", function() Snacks.rename.rename_file() end, desc = "Rename File", mode ={"n"}, has = { "workspace/didRenameFiles", "workspace/willRenameFiles" } },
|
||||
{ "<leader>cr", vim.lsp.buf.rename, desc = "Rename", has = "rename" },
|
||||
|
|
@ -52,9 +52,9 @@ function M.has(buffer, method)
|
|||
return false
|
||||
end
|
||||
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
|
||||
if client.supports_method(method) then
|
||||
if client:supports_method(method) then
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
|
@ -69,7 +69,7 @@ function M.resolve(buffer)
|
|||
end
|
||||
local spec = vim.tbl_extend("force", {}, M.get())
|
||||
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
|
||||
local maps = opts.servers[client.name] and opts.servers[client.name].keys or {}
|
||||
vim.list_extend(spec, maps)
|
||||
|
|
|
|||
|
|
@ -1,43 +1,34 @@
|
|||
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
|
||||
-- use in Neovim to power faster and more accurate
|
||||
-- syntax highlighting.
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
branch = "main",
|
||||
version = false, -- last release is way too old and doesn't work on Windows
|
||||
build = ":TSUpdate",
|
||||
event = { "LazyFile", "VeryLazy" },
|
||||
lazy = vim.fn.argc(-1) == 0, -- load treesitter early when opening a file from the cmdline
|
||||
init = function(plugin)
|
||||
-- PERF: add nvim-treesitter queries to the rtp and it's custom query predicates early
|
||||
-- This is needed because a bunch of plugins no longer `require("nvim-treesitter")`, which
|
||||
-- no longer trigger the **nvim-treesitter** module to be loaded in time.
|
||||
-- Luckily, the only things that those plugins need are the custom queries, which we make available
|
||||
-- during startup.
|
||||
require("lazy.core.loader").add_to_rtp(plugin)
|
||||
require("nvim-treesitter.query_predicates")
|
||||
build = function()
|
||||
local TS = require("nvim-treesitter")
|
||||
if not TS.get_installed then
|
||||
LazyVim.error("Please restart Neovim and run `:TSUpdate` to use the `nvim-treesitter` **main** branch.")
|
||||
return
|
||||
end
|
||||
-- make sure we're using the latest treesitter util
|
||||
package.loaded["lazyvim.util.treesitter"] = nil
|
||||
LazyVim.treesitter.build(function()
|
||||
TS.update(nil, { summary = true })
|
||||
end)
|
||||
end,
|
||||
cmd = { "TSUpdateSync", "TSUpdate", "TSInstall" },
|
||||
keys = {
|
||||
{ "<c-space>", desc = "Increment Selection" },
|
||||
{ "<bs>", desc = "Decrement Selection", mode = "x" },
|
||||
},
|
||||
event = { "LazyFile", "VeryLazy" },
|
||||
cmd = { "TSUpdate", "TSInstall", "TSLog", "TSUninstall" },
|
||||
opts_extend = { "ensure_installed" },
|
||||
---@type TSConfig
|
||||
---@diagnostic disable-next-line: missing-fields
|
||||
---@alias lazyvim.TSFeat { enable?: boolean, disable?: string[] }
|
||||
---@class lazyvim.TSConfig: TSConfig
|
||||
opts = {
|
||||
highlight = { enable = true },
|
||||
indent = { enable = true },
|
||||
-- LazyVim config for treesitter
|
||||
indent = { enable = true }, ---@type lazyvim.TSFeat
|
||||
highlight = { enable = true }, ---@type lazyvim.TSFeat
|
||||
folds = { enable = true }, ---@type lazyvim.TSFeat
|
||||
ensure_installed = {
|
||||
"bash",
|
||||
"c",
|
||||
|
|
@ -64,18 +55,97 @@ return {
|
|||
"xml",
|
||||
"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,
|
||||
keymaps = {
|
||||
init_selection = "<C-space>",
|
||||
node_incremental = "<C-space>",
|
||||
scope_incremental = false,
|
||||
node_decremental = "<bs>",
|
||||
},
|
||||
},
|
||||
textobjects = {
|
||||
move = {
|
||||
enable = true,
|
||||
set_jumps = true, -- whether to set jumps in the jumplist
|
||||
-- LazyVim extention to create buffer-local keymaps
|
||||
keys = {
|
||||
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_previous_start = { ["[f"] = "@function.outer", ["[c"] = "@class.outer", ["[a"] = "@parameter.inner" },
|
||||
|
|
@ -83,46 +153,48 @@ return {
|
|||
},
|
||||
},
|
||||
},
|
||||
---@param opts TSConfig
|
||||
config = function(_, opts)
|
||||
if type(opts.ensure_installed) == "table" then
|
||||
opts.ensure_installed = LazyVim.dedup(opts.ensure_installed)
|
||||
local TS = require("nvim-treesitter-textobjects")
|
||||
if not TS.setup then
|
||||
LazyVim.error("Please use `:Lazy` and update `nvim-treesitter`")
|
||||
return
|
||||
end
|
||||
require("nvim-treesitter.configs").setup(opts)
|
||||
end,
|
||||
},
|
||||
TS.setup(opts)
|
||||
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter-textobjects",
|
||||
event = "VeryLazy",
|
||||
enabled = true,
|
||||
config = function()
|
||||
-- If treesitter is already loaded, we need to run config again for textobjects
|
||||
if LazyVim.is_loaded("nvim-treesitter") then
|
||||
local opts = LazyVim.opts("nvim-treesitter")
|
||||
require("nvim-treesitter.configs").setup({ textobjects = opts.textobjects })
|
||||
end
|
||||
local function attach(buf)
|
||||
local ft = vim.bo[buf].filetype
|
||||
if not (vim.tbl_get(opts, "move", "enable") and LazyVim.treesitter.have(ft, "textobjects")) then
|
||||
return
|
||||
end
|
||||
---@type table<string, table<string, string>>
|
||||
local moves = vim.tbl_get(opts, "move", "keys") or {}
|
||||
|
||||
-- When in diff mode, we want to use the default
|
||||
-- vim text objects c & C instead of the treesitter ones.
|
||||
local move = require("nvim-treesitter.textobjects.move") ---@type table<string,fun(...)>
|
||||
local configs = require("nvim-treesitter.configs")
|
||||
for name, fn in pairs(move) do
|
||||
if name:find("goto") == 1 then
|
||||
move[name] = function(q, ...)
|
||||
if vim.wo.diff then
|
||||
local config = configs.get_module("textobjects.move")[name] ---@type table<string,string>
|
||||
for key, query in pairs(config or {}) do
|
||||
if q == query and key:find("[%]%[][cC]") then
|
||||
vim.cmd("normal! " .. key)
|
||||
return
|
||||
end
|
||||
end
|
||||
for method, keymaps in pairs(moves) do
|
||||
for key, query in pairs(keymaps) do
|
||||
local desc = query:gsub("@", ""):gsub("%..*", "")
|
||||
desc = desc:sub(1, 1):upper() .. desc:sub(2)
|
||||
desc = (key:sub(1, 1) == "[" and "Prev " or "Next ") .. desc
|
||||
desc = desc .. (key:sub(2, 2) == key:sub(2, 2):upper() and " End" or " Start")
|
||||
if not (vim.wo.diff and key:find("[cC]")) then
|
||||
vim.keymap.set({ "n", "x", "o" }, key, function()
|
||||
require("nvim-treesitter-textobjects.move")[method](query, "textobjects")
|
||||
end, {
|
||||
buffer = buf,
|
||||
desc = desc,
|
||||
silent = true,
|
||||
})
|
||||
end
|
||||
return fn(q, ...)
|
||||
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,
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -60,7 +60,8 @@ return {
|
|||
end,
|
||||
},
|
||||
|
||||
-- statusline
|
||||
-- Displays a fancy status line with git status,
|
||||
-- LSP diagnostics, filetype information, and more.
|
||||
{
|
||||
"nvim-lualine/lualine.nvim",
|
||||
event = "VeryLazy",
|
||||
|
|
@ -245,7 +246,7 @@ return {
|
|||
|
||||
-- icons
|
||||
{
|
||||
"echasnovski/mini.icons",
|
||||
"nvim-mini/mini.icons",
|
||||
lazy = true,
|
||||
opts = {
|
||||
file = {
|
||||
|
|
|
|||
|
|
@ -23,6 +23,8 @@ return {
|
|||
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_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.dap.core"] = 1,
|
||||
["lazyvim.plugins.extras.coding.nvim-cmp"] = 2,
|
||||
["lazyvim.plugins.extras.ui.edgy"] = 2,
|
||||
["lazyvim.plugins.extras.lang.typescript"] = 5,
|
||||
["lazyvim.plugins.extras.editor.neo-tree"] = 2,
|
||||
["lazyvim.plugins.extras.ui.edgy"] = 3,
|
||||
["lazyvim.plugins.extras.ai.copilot-native"] = 4,
|
||||
["lazyvim.plugins.extras.coding.blink"] = 5,
|
||||
["lazyvim.plugins.extras.lang.typescript"] = 5,
|
||||
["lazyvim.plugins.extras.formatting.prettier"] = 10,
|
||||
-- default core extra priority is 20
|
||||
-- default priority is 50
|
||||
|
|
@ -23,12 +25,29 @@ end
|
|||
local extras = {} ---@type string[]
|
||||
local defaults = LazyVim.config.get_defaults()
|
||||
|
||||
local changed = false
|
||||
local updated = {} ---@type string[]
|
||||
|
||||
-- Add extras from LazyExtras that are not disabled
|
||||
for _, extra in ipairs(LazyVim.config.json.data.extras) do
|
||||
local def = defaults[extra]
|
||||
if not (def and def.enabled == false) then
|
||||
extras[#extras + 1] = extra
|
||||
if LazyVim.plugin.renamed_extras[extra] then
|
||||
extra = LazyVim.plugin.renamed_extras[extra]
|
||||
changed = true
|
||||
end
|
||||
if LazyVim.plugin.deprecated_extras[extra] then
|
||||
changed = true
|
||||
else
|
||||
updated[#updated + 1] = extra
|
||||
local def = defaults[extra]
|
||||
if not (def and def.enabled == false) then
|
||||
extras[#extras + 1] = extra
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if changed then
|
||||
LazyVim.config.json.data.extras = updated
|
||||
LazyVim.json.save()
|
||||
end
|
||||
|
||||
-- Add default extras
|
||||
|
|
@ -42,15 +61,7 @@ end
|
|||
---@type string[]
|
||||
extras = LazyVim.dedup(extras)
|
||||
|
||||
local version = vim.version()
|
||||
local v = version.major .. "_" .. version.minor
|
||||
|
||||
local compat = { "0_9" }
|
||||
|
||||
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
|
||||
table.insert(extras, 1, "lazyvim.plugins.extras.vscode")
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
---@class lazyvim.util.deprecated
|
||||
local M = {}
|
||||
|
||||
M.moved = {
|
||||
|
|
@ -13,6 +14,7 @@ M.moved = {
|
|||
ui = {
|
||||
statuscolumn = { "Snacks.statuscolumn" },
|
||||
bufremove = { "Snacks.bufdelete" },
|
||||
foldexpr = { "LazyVim.treesitter.foldexpr", stacktrace = false },
|
||||
fg = {
|
||||
"{ fg = Snacks.util.color(...) }",
|
||||
fn = function(...)
|
||||
|
|
@ -28,7 +30,7 @@ function M.decorate(name, mod)
|
|||
if not M.moved[name] then
|
||||
return mod
|
||||
end
|
||||
setmetatable(mod, {
|
||||
return setmetatable(mod, {
|
||||
__call = function(_, ...)
|
||||
local to = M.moved[name].__call[1]
|
||||
LazyVim.deprecate("LazyVim." .. name, to)
|
||||
|
|
@ -38,7 +40,9 @@ function M.decorate(name, mod)
|
|||
__index = function(_, k)
|
||||
if M.moved[name][k] then
|
||||
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
|
||||
return M.moved[name][k].fn
|
||||
end
|
||||
|
|
@ -55,6 +59,10 @@ function M.lazygit()
|
|||
return Snacks.lazygit
|
||||
end
|
||||
|
||||
function M.ui()
|
||||
return M.decorate("ui", {})
|
||||
end
|
||||
|
||||
function M.toggle()
|
||||
LazyVim.deprecate("LazyVim.toggle", "Snacks.toggle")
|
||||
return {
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ local LazyUtil = require("lazy.core.util")
|
|||
|
||||
---@class lazyvim.util: LazyUtilCore
|
||||
---@field config LazyVimConfig
|
||||
---@field ui lazyvim.util.ui
|
||||
---@field treesitter lazyvim.util.treesitter
|
||||
---@field lsp lazyvim.util.lsp
|
||||
---@field root lazyvim.util.root
|
||||
---@field terminal lazyvim.util.terminal
|
||||
|
|
@ -16,14 +16,16 @@ local LazyUtil = require("lazy.core.util")
|
|||
---@field mini lazyvim.util.mini
|
||||
---@field pick lazyvim.util.pick
|
||||
---@field cmp lazyvim.util.cmp
|
||||
---@field deprecated lazyvim.util.deprecated
|
||||
local M = {}
|
||||
M.deprecated = require("lazyvim.util.deprecated")
|
||||
|
||||
setmetatable(M, {
|
||||
__index = function(t, k)
|
||||
if LazyUtil[k] then
|
||||
return LazyUtil[k]
|
||||
end
|
||||
if k == "lazygit" or k == "toggle" then -- HACK: special case for lazygit
|
||||
if M.deprecated[k] then
|
||||
return M.deprecated[k]()
|
||||
end
|
||||
---@diagnostic disable-next-line: no-unknown
|
||||
|
|
@ -125,13 +127,17 @@ function M.opts(name)
|
|||
return Plugin.values(plugin, "opts", false)
|
||||
end
|
||||
|
||||
function M.deprecate(old, new)
|
||||
M.warn(("`%s` is deprecated. Please use `%s` instead"):format(old, new), {
|
||||
title = "LazyVim",
|
||||
once = true,
|
||||
stacktrace = true,
|
||||
stacklevel = 6,
|
||||
})
|
||||
---@param opts? LazyNotifyOpts
|
||||
function M.deprecate(old, new, opts)
|
||||
M.warn(
|
||||
("`%s` is deprecated. Please use `%s` instead"):format(old, new),
|
||||
vim.tbl_extend("force", {
|
||||
title = "LazyVim",
|
||||
once = true,
|
||||
stacktrace = true,
|
||||
stacklevel = 6,
|
||||
}, opts or {})
|
||||
)
|
||||
end
|
||||
|
||||
-- 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.warn = opts.warn == nil and true or opts.warn
|
||||
path = path or ""
|
||||
local ret = root .. "/packages/" .. pkg .. "/" .. path
|
||||
if opts.warn and not vim.loop.fs_stat(ret) and not require("lazy.core.config").headless() then
|
||||
M.warn(
|
||||
("Mason package path not found for **%s**:\n- `%s`\nYou may need to force update the package."):format(pkg, path)
|
||||
)
|
||||
local ret = vim.fs.normalize(root .. "/packages/" .. pkg .. "/" .. path)
|
||||
if opts.warn then
|
||||
vim.schedule(function()
|
||||
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
|
||||
return ret
|
||||
end
|
||||
|
|
@ -286,4 +299,63 @@ function M.memoize(fn)
|
|||
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
|
||||
|
|
|
|||
|
|
@ -1,26 +1,6 @@
|
|||
---@class lazyvim.util.lsp
|
||||
local M = {}
|
||||
|
||||
---@alias lsp.Client.filter {id?: number, bufnr?: number, name?: string, method?: string, filter?:fun(client: lsp.Client):boolean}
|
||||
|
||||
---@param opts? lsp.Client.filter
|
||||
function M.get_clients(opts)
|
||||
local ret = {} ---@type 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 name? string
|
||||
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
|
||||
clients[client] = clients[client] or {}
|
||||
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
|
||||
vim.api.nvim_exec_autocmds("User", {
|
||||
pattern = "LspSupportsMethod",
|
||||
|
|
@ -118,45 +98,12 @@ function M.on_supports_method(method, fn)
|
|||
})
|
||||
end
|
||||
|
||||
---@return _.lspconfig.options
|
||||
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)}
|
||||
---@param opts? LazyFormatter| {filter?: (string|vim.lsp.get_clients.Filter)}
|
||||
function M.formatter(opts)
|
||||
opts = opts or {}
|
||||
local filter = opts.filter or {}
|
||||
filter = type(filter) == "string" and { name = filter } or filter
|
||||
---@cast filter lsp.Client.filter
|
||||
---@cast filter vim.lsp.get_clients.Filter
|
||||
---@type LazyFormatter
|
||||
local ret = {
|
||||
name = "LSP",
|
||||
|
|
@ -166,11 +113,11 @@ function M.formatter(opts)
|
|||
M.format(LazyVim.merge({}, filter, { bufnr = buf }))
|
||||
end,
|
||||
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
|
||||
local ret = vim.tbl_filter(function(client)
|
||||
return client.supports_method("textDocument/formatting")
|
||||
or client.supports_method("textDocument/rangeFormatting")
|
||||
return client:supports_method("textDocument/formatting")
|
||||
or client:supports_method("textDocument/rangeFormatting")
|
||||
end, clients)
|
||||
---@param client vim.lsp.Client
|
||||
return vim.tbl_map(function(client)
|
||||
|
|
@ -181,7 +128,7 @@ function M.formatter(opts)
|
|||
return LazyVim.merge(ret, opts) --[[@as LazyFormatter]]
|
||||
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
|
||||
function M.format(opts)
|
||||
|
|
|
|||
|
|
@ -101,9 +101,20 @@ function M.pretty_path(opts)
|
|||
local root = LazyVim.root.get({ normalize = true })
|
||||
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)
|
||||
elseif path:find(root, 1, true) == 1 then
|
||||
elseif norm_path:find(root, 1, true) == 1 then
|
||||
path = path:sub(#root + 2)
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
local Meta = require("lazy.core.meta")
|
||||
local Plugin = require("lazy.core.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.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-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.lazyrc"] = "local spec files are now a lazy.nvim feature",
|
||||
["lazyvim.plugins.extras.editor.trouble-v3"] = "Trouble v3 has been merged in main",
|
||||
|
|
@ -24,6 +26,9 @@ M.deprecated_extras = {
|
|||
Either use `basedpyright`, or copy the [old extra](https://github.com/LazyVim/LazyVim/blob/c1f5fcf9c7ed2659c9d5ac41b3bb8a93e0a3c6a0/lua/lazyvim/plugins/extras/lang/python-semshi.lua#L1) to your own config.
|
||||
]],
|
||||
}
|
||||
M.renamed_extras = {
|
||||
["lazyvim.plugins.extras.lang.omnisharp"] = "lazyvim.plugins.extras.lang.dotnet",
|
||||
}
|
||||
|
||||
M.deprecated_modules = {}
|
||||
|
||||
|
|
@ -92,6 +97,18 @@ function M.fix_imports()
|
|||
return false
|
||||
end
|
||||
end
|
||||
local rename = M.renamed_extras[spec.import]
|
||||
if rename then
|
||||
LazyVim.warn(
|
||||
("The extra `%s` was renamed to `%s`.\nPlease update your config for `%s`"):format(
|
||||
spec.import,
|
||||
rename,
|
||||
spec.importing or "LazyVim"
|
||||
),
|
||||
{ title = "LazyVim" }
|
||||
)
|
||||
spec.import = rename
|
||||
end
|
||||
local dep = M.deprecated_extras[spec and spec.import]
|
||||
if dep then
|
||||
dep = dep .. "\n" .. "Please remove the extra from `lazyvim.json` to hide this warning."
|
||||
|
|
@ -102,9 +119,17 @@ function M.fix_imports()
|
|||
end
|
||||
|
||||
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 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(
|
||||
("Plugin `%s` was renamed to `%s`.\nPlease update your config for `%s`"):format(
|
||||
plugin[1],
|
||||
|
|
@ -113,7 +138,7 @@ function M.fix_renames()
|
|||
),
|
||||
{ title = "LazyVim" }
|
||||
)
|
||||
plugin[1] = M.renames[plugin[1]]
|
||||
plugin[1] = M.renames[name]
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue