mirror of
https://github.com/LazyVim/LazyVim.git
synced 2026-07-22 12:31:07 +00:00
Compare commits
95 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
459a4c3b10 | ||
|
|
c10948c50b | ||
|
|
35f56b9189 | ||
|
|
6eb16e730d | ||
|
|
b30c0312ea | ||
|
|
c429ebb628 | ||
|
|
b830a523b5 | ||
|
|
fa88241e2f | ||
|
|
58089db8b1 | ||
|
|
2dc527e511 | ||
|
|
dc6240f4d5 | ||
|
|
7c1301b895 | ||
|
|
d840410047 | ||
|
|
cdc47ae615 | ||
|
|
d92692309c | ||
|
|
83d90f339d | ||
|
|
ef272ff7cc | ||
|
|
d07070bf2f | ||
|
|
85afbbc94b | ||
|
|
96f4f18d7d | ||
|
|
2a5c892835 | ||
|
|
6d0da34de9 | ||
|
|
6dadcc2065 | ||
|
|
8bcb620802 | ||
|
|
59126caa31 | ||
|
|
4e9eac57ab | ||
|
|
9029d928d2 | ||
|
|
1b4be534f1 | ||
|
|
8764dfbc8f | ||
|
|
76cb567e5c | ||
|
|
53f4eabd77 | ||
|
|
ad25b31e51 | ||
|
|
e54689ebdc | ||
|
|
242f0983de | ||
|
|
fbf52d5496 | ||
|
|
3b3d649333 | ||
|
|
5450006ccd | ||
|
|
36f594716b | ||
|
|
e6f26f0f23 | ||
|
|
b2830cfcc5 | ||
|
|
50159fe344 | ||
|
|
6055e59613 | ||
|
|
954d8746e5 | ||
|
|
31caef21fd | ||
|
|
d0fe8c896f | ||
|
|
fca0af57cc | ||
|
|
a50072fa16 | ||
|
|
87c0027892 | ||
|
|
b2917bd3bf | ||
|
|
3f91371e21 | ||
|
|
e77d4ab0d6 | ||
|
|
730b69114d | ||
|
|
03f1293e33 | ||
|
|
16713e6e12 | ||
|
|
92607e79e0 | ||
|
|
8652c95703 | ||
|
|
ecd31f844e | ||
|
|
27824d79a9 | ||
|
|
a4e19e9c9c | ||
|
|
244af66f8b | ||
|
|
60fea6236e | ||
|
|
c64a61734f | ||
|
|
a507822c0f | ||
|
|
42c9f7152b | ||
|
|
28db03f958 | ||
|
|
5e981f9a8c | ||
|
|
6b52a3059e | ||
|
|
064e61058b | ||
|
|
cd745b14f8 | ||
|
|
29fb479522 | ||
|
|
d72127eb93 | ||
|
|
1a40162714 | ||
|
|
235cadf4cf | ||
|
|
7831bff9af | ||
|
|
d2d0c641ed | ||
|
|
b5ea1e9d25 | ||
|
|
8b8ceb6c87 | ||
|
|
acc3538229 | ||
|
|
cd8c4977a0 | ||
|
|
3964433062 | ||
|
|
f581de8013 | ||
|
|
84ca4dffdb | ||
|
|
46e419d27e | ||
|
|
4796fb4ac5 | ||
|
|
28aa8feaf7 | ||
|
|
231e476ec9 | ||
|
|
5098a69870 | ||
|
|
0329bc0e50 | ||
|
|
4fd9878dea | ||
|
|
0b4999a4b5 | ||
|
|
f0a91d9fa5 | ||
|
|
b6e48a57fb | ||
|
|
6568b1d4c2 | ||
|
|
b38de4e2fe | ||
|
|
e8a1d8b628 |
62 changed files with 1238 additions and 942 deletions
2
.github/.release-please-manifest.json
vendored
2
.github/.release-please-manifest.json
vendored
|
|
@ -1,3 +1,3 @@
|
||||||
{
|
{
|
||||||
".": "15.10.1"
|
".": "16.0.0"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
3
.markdownlint-cli2.yaml
Normal file
3
.markdownlint-cli2.yaml
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
config:
|
||||||
|
MD013: false
|
||||||
|
MD033: false
|
||||||
146
CHANGELOG.md
146
CHANGELOG.md
|
|
@ -1,5 +1,151 @@
|
||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## [16.0.0](https://github.com/LazyVim/LazyVim/compare/v15.15.0...v16.0.0) (2026-05-27)
|
||||||
|
|
||||||
|
|
||||||
|
### ⚠ BREAKING CHANGES
|
||||||
|
|
||||||
|
* **refactoring:** conform to upstream breaking changes on 2.0 branch ([#7124](https://github.com/LazyVim/LazyVim/issues/7124))
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **keymaps:** added leader+bi to delete invisible buffers ([58089db](https://github.com/LazyVim/LazyVim/commit/58089db8b198fc81f91789b6f12d0617cae21437))
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **autocmds:** correct version check for nvim-0.13 ([#7184](https://github.com/LazyVim/LazyVim/issues/7184)) ([6eb16e7](https://github.com/LazyVim/LazyVim/commit/6eb16e730d1a686224dca41b05ba125cfd62c1bb))
|
||||||
|
* **autocmds:** replace `vim.hl.on_yank` with `vim.hl.hl_op` for `nvim-0.13` and above ([#7171](https://github.com/LazyVim/LazyVim/issues/7171)) ([b30c031](https://github.com/LazyVim/LazyVim/commit/b30c0312ea1c5bed6b28e72d930059622b0525f8))
|
||||||
|
* **go:** use semanticTokens if setup in gopls config init_options ([#7172](https://github.com/LazyVim/LazyVim/issues/7172)) ([b830a52](https://github.com/LazyVim/LazyVim/commit/b830a523b5973c300639d4d9c4fea7d92fa04dc3))
|
||||||
|
* **hipatterns:** don't color #add (use it too often as a private function in TS) ([dc6240f](https://github.com/LazyVim/LazyVim/commit/dc6240f4d56ae0d40cd0e673ca740dda50c4bf3b))
|
||||||
|
* **oxc:** prefer top-level oxlint root_dir in monorepos ([d840410](https://github.com/LazyVim/LazyVim/commit/d840410047d20a8f93fb8d473599209ebe95584e))
|
||||||
|
* **refactoring:** conform to upstream breaking changes on 2.0 branch ([#7124](https://github.com/LazyVim/LazyVim/issues/7124)) ([d926923](https://github.com/LazyVim/LazyVim/commit/d92692309c41581e1f839033fbccd745be732c7e))
|
||||||
|
|
||||||
|
## [15.15.0](https://github.com/LazyVim/LazyVim/compare/v15.14.0...v15.15.0) (2026-04-02)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **biome:** enable biome lsp for linting ([b2830cf](https://github.com/LazyVim/LazyVim/commit/b2830cfcc5c9c09ebbf9545beb3947a55ce89dbd))
|
||||||
|
* **biome:** move biome extra from formatting.biome -> lang.typescript.biome ([242f098](https://github.com/LazyVim/LazyVim/commit/242f0983de9fdb70f0d82057a8039e32bc171764))
|
||||||
|
* **lazydev:** make lspconfig types available on word `lspconfig.settings` ([36f5947](https://github.com/LazyVim/LazyVim/commit/36f594716bcb0bec84a05a6c55f702134d2e89c3))
|
||||||
|
* **lsp:** auto add organizeImport keymaps for LSPs that support it ([e54689e](https://github.com/LazyVim/LazyVim/commit/e54689ebdc5458cb30f4a48b954c710bb381cd01))
|
||||||
|
* **oxc:** added oxc extra for oxfmt and oxlint ([4e9eac5](https://github.com/LazyVim/LazyVim/commit/4e9eac57aba1ea575ef008a503cba8327257e4a4))
|
||||||
|
* **sidekick:** ctrl+. focuses sidekick, but when already inside sidekick, hides it ([50159fe](https://github.com/LazyVim/LazyVim/commit/50159fe344d93329a569cee136c0323e48b0d3da))
|
||||||
|
* **typescript:** set `vim.g.lazyvim_ts_lsp = "tsgo"` to use the much faster experimental lsp server ([e6f26f0](https://github.com/LazyVim/LazyVim/commit/e6f26f0f23e9cb4c6bcc351b06474f4863319aff))
|
||||||
|
* **typescript:** split typescript extra in main, vtsls and tsgo ([9029d92](https://github.com/LazyVim/LazyVim/commit/9029d928d2f7b7f76f132b618d2931499c9b6eb9))
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **biome:** added recommendation when root has biome config file ([ad25b31](https://github.com/LazyVim/LazyVim/commit/ad25b31e512892ca51a1fa3ffa96d1375c391039))
|
||||||
|
* **biome:** biome mason install is no longer needed ([5450006](https://github.com/LazyVim/LazyVim/commit/5450006ccdd7df341f7f60dded58ea4a87aa9c15))
|
||||||
|
* **biome:** use biome-check in conform that also fixes linting issues and sorts imports ([954d874](https://github.com/LazyVim/LazyVim/commit/954d8746e5cf1266d93cf4210c00c1506f20423b))
|
||||||
|
* **lsp:** sort server names before setting keymaps ([6d0da34](https://github.com/LazyVim/LazyVim/commit/6d0da34de9c4a82170e3359d4e7853bf89a557b3))
|
||||||
|
* **oxc:** added `fixKind = "all"` ([85afbbc](https://github.com/LazyVim/LazyVim/commit/85afbbc94bb45891799a4851b2edf753b51f18b0))
|
||||||
|
* **r:** recommend for *.qmd instead of *qmd files ([3b3d649](https://github.com/LazyVim/LazyVim/commit/3b3d6493332798674fb7b82aea600bab18eaf311))
|
||||||
|
* **terminal:** use Snacks.terminal.focus() for <C-/> mapping ([96f4f18](https://github.com/LazyVim/LazyVim/commit/96f4f18d7d81c786ac0df5723bc7aca058bf2165)), closes [#7048](https://github.com/LazyVim/LazyVim/issues/7048)
|
||||||
|
* **treesitter:** `nvim-treesitter` on longer support nvim-0.11, so pin when needed. Fixes [#7092](https://github.com/LazyVim/LazyVim/issues/7092) ([ef272ff](https://github.com/LazyVim/LazyVim/commit/ef272ff7cc9b53d48baf6544618b5923d65c0282))
|
||||||
|
* **tsgo:** disable inlayHints.functionLikeReturnTypes by default. Too noisy ([8bcb620](https://github.com/LazyVim/LazyVim/commit/8bcb6208021bd4e4257de64c9598c6b78688be28))
|
||||||
|
* **tsgo:** remove some noisy inlay hints ([d07070b](https://github.com/LazyVim/LazyVim/commit/d07070bf2ff83ae513097d02d71460920af85a91))
|
||||||
|
* **typescript:** remove keymaps for non-existing code actions ([53f4eab](https://github.com/LazyVim/LazyVim/commit/53f4eabd7723faba2d7c14afe53226d8c18bf16c))
|
||||||
|
* **util.plugin:** single imports for extras ([1b4be53](https://github.com/LazyVim/LazyVim/commit/1b4be534f1d8959480ba1f622a457654bd737ce5))
|
||||||
|
|
||||||
|
|
||||||
|
### Performance Improvements
|
||||||
|
|
||||||
|
* **extras:** never load nested extras ([8764dfb](https://github.com/LazyVim/LazyVim/commit/8764dfbc8fcb8923397153eb3a2cfcac7ea988f1))
|
||||||
|
|
||||||
|
|
||||||
|
### Reverts
|
||||||
|
|
||||||
|
* **lsp:** revert changes for [#6456](https://github.com/LazyVim/LazyVim/issues/6456). Closes [#6779](https://github.com/LazyVim/LazyVim/issues/6779) ([d0fe8c8](https://github.com/LazyVim/LazyVim/commit/d0fe8c896f4dca003e8d56e2091ee5ec7da7af75))
|
||||||
|
|
||||||
|
## [15.14.0](https://github.com/LazyVim/LazyVim/compare/v15.13.0...v15.14.0) (2026-03-01)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **bufferline:** add <leader>bj keymap for BufferLinePick ([#6968](https://github.com/LazyVim/LazyVim/issues/6968)) ([a50072f](https://github.com/LazyVim/LazyVim/commit/a50072fa16cfc1f00b1ae282150bc667f1d1e096))
|
||||||
|
* **dap:** close dap-float window with `q`. ([#6884](https://github.com/LazyVim/LazyVim/issues/6884)) ([87c0027](https://github.com/LazyVim/LazyVim/commit/87c002789220d922bb94637c690b444bd1ba5611))
|
||||||
|
* **treesitter:** support query table in treesitter-textobjects mappings ([#6736](https://github.com/LazyVim/LazyVim/issues/6736)) ([42c9f71](https://github.com/LazyVim/LazyVim/commit/42c9f7152b9bd1a4f739b115390370c208dc2a55))
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **editor.overseer:** migrate to v2 ([#6907](https://github.com/LazyVim/LazyVim/issues/6907)) ([27824d7](https://github.com/LazyVim/LazyVim/commit/27824d79a952c54cd9d93c85a699543e4a031dd4))
|
||||||
|
* **fzf:** correct git_diff description from 'hunks' to 'files' ([#6983](https://github.com/LazyVim/LazyVim/issues/6983)) ([e77d4ab](https://github.com/LazyVim/LazyVim/commit/e77d4ab0d6574efb7142ec40f4f5dcff750a3ee9))
|
||||||
|
* **lang.clang:** fix `clangd_extensions.nvim` ([#6804](https://github.com/LazyVim/LazyVim/issues/6804)) ([730b691](https://github.com/LazyVim/LazyVim/commit/730b69114d56834f4499fd3e5aecf18920234c39))
|
||||||
|
* **leap:** update urls to new leap.nvim repo. Fixes [#6958](https://github.com/LazyVim/LazyVim/issues/6958) ([244af66](https://github.com/LazyVim/LazyVim/commit/244af66f8b4e376d60c6604f9b3fd758165f5799))
|
||||||
|
* **news:** resolve news.txt from $VIMRUNTIME first ([60fea62](https://github.com/LazyVim/LazyVim/commit/60fea6236e342e1f4aa34d078461746d5f587c74)), closes [#7019](https://github.com/LazyVim/LazyVim/issues/7019)
|
||||||
|
* **python:** set venv-selector.nvim override_notify = false ([#6936](https://github.com/LazyVim/LazyVim/issues/6936)) ([b2917bd](https://github.com/LazyVim/LazyVim/commit/b2917bd3bfe61c40e686f5a2c20f540430945b73))
|
||||||
|
* **terminal:** add -NoProfile to powershell shellcmdflag ([#6757](https://github.com/LazyVim/LazyVim/issues/6757)) ([a507822](https://github.com/LazyVim/LazyVim/commit/a507822c0f67df661d1411f9274a65ca9cc832f5))
|
||||||
|
* **terminal:** partially revert previous mappings ([#6770](https://github.com/LazyVim/LazyVim/issues/6770)) ([c64a617](https://github.com/LazyVim/LazyVim/commit/c64a61734fc9d45470a72603395c02137802bc6f))
|
||||||
|
* **treesitter:** fix `]c` textobject mappings when in diff mode ([#6911](https://github.com/LazyVim/LazyVim/issues/6911)) ([16713e6](https://github.com/LazyVim/LazyVim/commit/16713e6e1200eb90ad4b4a394bb7254fb5612484))
|
||||||
|
* **treesitter:** remove deleted jsonc parser ([#6848](https://github.com/LazyVim/LazyVim/issues/6848)) ([92607e7](https://github.com/LazyVim/LazyVim/commit/92607e79e09a2761d930877a09edc00438b97fc3))
|
||||||
|
* **util.lsp:** `LazyVim.lsp.execute` only request single client ([#6904](https://github.com/LazyVim/LazyVim/issues/6904)) ([a4e19e9](https://github.com/LazyVim/LazyVim/commit/a4e19e9c9c939c1a3fc2f30ffefe37311d3ecadf))
|
||||||
|
* **util.lsp:** pass `formatters_by_ft` to `opts` ([#6894](https://github.com/LazyVim/LazyVim/issues/6894)) ([03f1293](https://github.com/LazyVim/LazyVim/commit/03f1293e33541073288f23abdaf581a8e0dec4c4))
|
||||||
|
* **vtsls:** remove redundant deno logic, upstreamed in `nvim-lspconfig` ([#7011](https://github.com/LazyVim/LazyVim/issues/7011)) ([8652c95](https://github.com/LazyVim/LazyVim/commit/8652c9570377678a78ecb19dbd33695e0e4ec4fc))
|
||||||
|
|
||||||
|
## [15.13.0](https://github.com/LazyVim/LazyVim/compare/v15.12.2...v15.13.0) (2025-11-01)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **snacks:** `snacks.gh` integration. Enabled by default, unless the `util.octo` extra is enabled. ([5e981f9](https://github.com/LazyVim/LazyVim/commit/5e981f9a8cd75eb6f49756e188411037b82b8045))
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **treesitter:** remove node requirement ([6b52a30](https://github.com/LazyVim/LazyVim/commit/6b52a3059e52eed062b6ff3f56e70cffcbf879fe))
|
||||||
|
|
||||||
|
## [15.12.2](https://github.com/LazyVim/LazyVim/compare/v15.12.1...v15.12.2) (2025-10-26)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **lsp.keymaps:** make cond -> enabled work again. Closes [#6697](https://github.com/LazyVim/LazyVim/issues/6697) ([1a40162](https://github.com/LazyVim/LazyVim/commit/1a401627146c66beaeb213f66dd02662f1006e82))
|
||||||
|
|
||||||
|
## [15.12.1](https://github.com/LazyVim/LazyVim/compare/v15.12.0...v15.12.1) (2025-10-26)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **fzf-lua:** LSP keymaps. Closes [#6698](https://github.com/LazyVim/LazyVim/issues/6698) ([b5ea1e9](https://github.com/LazyVim/LazyVim/commit/b5ea1e9d25202e38a47f0b03ac35cc587c80e6d7))
|
||||||
|
* **navic:** navic attach. Closes [#6702](https://github.com/LazyVim/LazyVim/issues/6702) ([d2d0c64](https://github.com/LazyVim/LazyVim/commit/d2d0c641ed443f8d2ea9e131ec90df59ea149d0a))
|
||||||
|
|
||||||
|
## [15.12.0](https://github.com/LazyVim/LazyVim/compare/v15.11.0...v15.12.0) (2025-10-25)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **keymaps:** added `<localleader>r` to run the selection/file with lua ([acc3538](https://github.com/LazyVim/LazyVim/commit/acc35382294d91b279b319510b906249a03b2764))
|
||||||
|
* **lsp:** lsp keymaps can now be configured with `lsp-config.opts.servers['*'].keys` like for lsp servers ([cd8c497](https://github.com/LazyVim/LazyVim/commit/cd8c4977a0a8e80750ed6a10992f988f811c6417))
|
||||||
|
* **lsp:** refactor lsp code to use `Snacks.util.lsp.on` ([3964433](https://github.com/LazyVim/LazyVim/commit/39644330624139dddb857ed833987c1cfd8432cf))
|
||||||
|
* **sidekick:** added NES toggle `<leader>uN`. Closes [#6692](https://github.com/LazyVim/LazyVim/issues/6692) ([84ca4df](https://github.com/LazyVim/LazyVim/commit/84ca4dffdbf175a5e7bc39904157700854d8b2ad))
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **chezmoi:** use vim.env.HOME instead of os.getenv("HOME") for Windows compatibility ([231e476](https://github.com/LazyVim/LazyVim/commit/231e476ec9292b56258f86e28773843cddaf34b8))
|
||||||
|
* **clipboard:** connecting via vscpde's remote-ssh extension causes severe lag during yank and copy operations. ([#6664](https://github.com/LazyVim/LazyVim/issues/6664)) ([5098a69](https://github.com/LazyVim/LazyVim/commit/5098a6987009199d5a5c4bfb8086d0fe4a94e0bb))
|
||||||
|
* **lang.ember:** remove '.git' lang.ember ([#6685](https://github.com/LazyVim/LazyVim/issues/6685)) ([4796fb4](https://github.com/LazyVim/LazyVim/commit/4796fb4ac54744b69a45a6044655543b1c4231f0))
|
||||||
|
* **root:** don't use fs_realpath on windows ([46e419d](https://github.com/LazyVim/LazyVim/commit/46e419d27efb5b7282a5ab17a49f4745ce23b55a))
|
||||||
|
|
||||||
|
## [15.11.0](https://github.com/LazyVim/LazyVim/compare/v15.10.1...v15.11.0) (2025-10-23)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **snacks_picker:** added gai/gao keymaps for calls incoming/outgoing ([b6e48a5](https://github.com/LazyVim/LazyVim/commit/b6e48a57fb4ad7a79f24646016926eef68ce3002))
|
||||||
|
* **snacks.picker:** added `<leader>gD` to diff against merge base of branch/PR ([f0a91d9](https://github.com/LazyVim/LazyVim/commit/f0a91d9fa5f0cf27d6ba5fac759fa1d4e0df97a3))
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **avante:** unset default keymaps ([#6657](https://github.com/LazyVim/LazyVim/issues/6657)) ([e8a1d8b](https://github.com/LazyVim/LazyVim/commit/e8a1d8b6286f82d75e5830de5ea93bd7622cec8c))
|
||||||
|
* **extras:** remove custom formatter opts for dart/solidity. Closes [#6665](https://github.com/LazyVim/LazyVim/issues/6665) ([b38de4e](https://github.com/LazyVim/LazyVim/commit/b38de4e2fe4ad887cae1604fd9f1fbd230e0118f))
|
||||||
|
|
||||||
## [15.10.1](https://github.com/LazyVim/LazyVim/compare/v15.10.0...v15.10.1) (2025-10-20)
|
## [15.10.1](https://github.com/LazyVim/LazyVim/compare/v15.10.0...v15.10.1) (2025-10-20)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -29,3 +29,21 @@
|
||||||
- Every language extra requires a `recommended` section as part of the extra.
|
- Every language extra requires a `recommended` section as part of the extra.
|
||||||
Check lspconfig server configurations for the proper filetypes and root directories.
|
Check lspconfig server configurations for the proper filetypes and root directories.
|
||||||
Refer to other extras for creating the `recommended` section.
|
Refer to other extras for creating the `recommended` section.
|
||||||
|
|
||||||
|
### Language-Specific Keymaps
|
||||||
|
|
||||||
|
- Use `<localleader>` for language-specific keymaps (follows Vim/Neovim convention for filetype-specific mappings).
|
||||||
|
- For LSP servers, define keymaps in the server's `keys` field, not in `on_attach`:
|
||||||
|
```lua
|
||||||
|
servers = {
|
||||||
|
rust_analyzer = {
|
||||||
|
keys = {
|
||||||
|
{ "<localleader>e", function() vim.cmd.RustLsp("expandMacro") end, desc = "Expand Macro" },
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
- LazyVim's LSP system will automatically resolve and apply these keymaps (see `lua/lazyvim/plugins/lsp/keymaps.lua`).
|
||||||
|
- Don't override standard LSP keymaps (like `K` for hover, `gd` for definition) unless absolutely necessary.
|
||||||
|
- Use standard `<leader>c*` keymaps where they make sense (e.g., `<leader>co` for organize imports).
|
||||||
|
- Refer to the R and Haskell extras for examples of proper `<localleader>` usage.
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
*LazyVim.txt* For Neovim Last change: 2025 October 20
|
*LazyVim.txt* LazyVim docs
|
||||||
|
For Neovim Last change: 2026 June 02
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
Table of Contents *LazyVim-table-of-contents*
|
Table of Contents *LazyVim-table-of-contents*
|
||||||
|
|
@ -78,22 +79,26 @@ Try it with Docker ~
|
||||||
Install the LazyVim Starter ~
|
Install the LazyVim Starter ~
|
||||||
|
|
||||||
- Make a backup of your current Neovim files:
|
- Make a backup of your current Neovim files:
|
||||||
>sh
|
|
||||||
|
>sh
|
||||||
mv ~/.config/nvim ~/.config/nvim.bak
|
mv ~/.config/nvim ~/.config/nvim.bak
|
||||||
mv ~/.local/share/nvim ~/.local/share/nvim.bak
|
mv ~/.local/share/nvim ~/.local/share/nvim.bak
|
||||||
<
|
<
|
||||||
- Clone the starter
|
- Clone the starter
|
||||||
>sh
|
|
||||||
|
>sh
|
||||||
git clone https://github.com/LazyVim/starter ~/.config/nvim
|
git clone https://github.com/LazyVim/starter ~/.config/nvim
|
||||||
<
|
<
|
||||||
- Remove the `.git` folder, so you can add it to your own repo later
|
- Remove the `.git` folder, so you can add it to your own repo later
|
||||||
>sh
|
|
||||||
|
>sh
|
||||||
rm -rf ~/.config/nvim/.git
|
rm -rf ~/.config/nvim/.git
|
||||||
<
|
<
|
||||||
- Start Neovim!
|
- Start Neovim!
|
||||||
>sh
|
|
||||||
|
>sh
|
||||||
nvim
|
nvim
|
||||||
<
|
<
|
||||||
Refer to the comments in the files on how to customize **LazyVim**.
|
Refer to the comments in the files on how to customize **LazyVim**.
|
||||||
|
|
||||||
------------------------------------------------------------------------------
|
------------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,11 @@ vim.api.nvim_create_autocmd({ "FocusGained", "TermClose", "TermLeave" }, {
|
||||||
vim.api.nvim_create_autocmd("TextYankPost", {
|
vim.api.nvim_create_autocmd("TextYankPost", {
|
||||||
group = augroup("highlight_yank"),
|
group = augroup("highlight_yank"),
|
||||||
callback = function()
|
callback = function()
|
||||||
(vim.hl or vim.highlight).on_yank()
|
if vim.fn.has("nvim-0.13") == 1 then
|
||||||
|
vim.hl.hl_op()
|
||||||
|
else
|
||||||
|
(vim.hl or vim.highlight).on_yank()
|
||||||
|
end
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
@ -56,6 +60,7 @@ vim.api.nvim_create_autocmd("FileType", {
|
||||||
pattern = {
|
pattern = {
|
||||||
"PlenaryTestPopup",
|
"PlenaryTestPopup",
|
||||||
"checkhealth",
|
"checkhealth",
|
||||||
|
"dap-float",
|
||||||
"dbout",
|
"dbout",
|
||||||
"gitsigns-blame",
|
"gitsigns-blame",
|
||||||
"grug-far",
|
"grug-far",
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ _G.LazyVim = require("lazyvim.util")
|
||||||
---@class LazyVimConfig: LazyVimOptions
|
---@class LazyVimConfig: LazyVimOptions
|
||||||
local M = {}
|
local M = {}
|
||||||
|
|
||||||
M.version = "15.10.1" -- x-release-please-version
|
M.version = "16.0.0" -- x-release-please-version
|
||||||
LazyVim.config = M
|
LazyVim.config = M
|
||||||
|
|
||||||
---@class LazyVimOptions
|
---@class LazyVimOptions
|
||||||
|
|
@ -34,7 +34,9 @@ local defaults = {
|
||||||
dots = "",
|
dots = "",
|
||||||
},
|
},
|
||||||
ft = {
|
ft = {
|
||||||
octo = "",
|
octo = " ",
|
||||||
|
gh = " ",
|
||||||
|
["markdown.gh"] = " ",
|
||||||
},
|
},
|
||||||
dap = {
|
dap = {
|
||||||
Stopped = { " ", "DiagnosticWarn", "DapStoppedLine" },
|
Stopped = { " ", "DiagnosticWarn", "DapStoppedLine" },
|
||||||
|
|
@ -346,13 +348,81 @@ function M.init()
|
||||||
M.json.load()
|
M.json.load()
|
||||||
end
|
end
|
||||||
|
|
||||||
---@alias LazyVimDefault {name: string, extra: string, enabled?: boolean, origin?: "global" | "default" | "extra" }
|
---@alias LazyVimDefault {name: string, group: string, extra: string, import: string, enabled?: boolean, origin?: "global" | "default" | "extra" }
|
||||||
|
---
|
||||||
local default_extras ---@type table<string, LazyVimDefault>
|
local default_extras ---@type table<string, LazyVimDefault>
|
||||||
|
|
||||||
|
---@param name string
|
||||||
|
---@param extras LazyVimDefault[]
|
||||||
|
function M.register_defaults(name, extras)
|
||||||
|
assert(default_extras, "defaults should be loaded by now, this should never happen")
|
||||||
|
local valid = vim.tbl_map(function(extra)
|
||||||
|
return extra.name
|
||||||
|
end, extras) --[[@as string[] ]]
|
||||||
|
|
||||||
|
local origin = "default"
|
||||||
|
local ret ---@type LazyVimDefault?
|
||||||
|
local use ---@type string?
|
||||||
|
|
||||||
|
local global = vim.g["lazyvim_" .. name]
|
||||||
|
if vim.tbl_contains(valid, global) then
|
||||||
|
origin = "global" -- was set by the user in their config
|
||||||
|
use = global
|
||||||
|
else
|
||||||
|
if global and global ~= "auto" then
|
||||||
|
vim.notify(
|
||||||
|
("Invalid value for `vim.g.lazyvim_%s`: `%s`\nValid options are: %s"):format(
|
||||||
|
name,
|
||||||
|
global,
|
||||||
|
table.concat(valid, ", ")
|
||||||
|
),
|
||||||
|
vim.log.levels.ERROR,
|
||||||
|
{ title = "LazyVim" }
|
||||||
|
)
|
||||||
|
end
|
||||||
|
for _, extra in ipairs(extras) do
|
||||||
|
if LazyVim.has_extra(extra.extra) then
|
||||||
|
use = extra.name -- was imported by the user in their lazy spec or added by LazyExtras
|
||||||
|
origin = "extra"
|
||||||
|
break
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
use = use or valid[1] -- fallback to the first one if nothing was set
|
||||||
|
|
||||||
|
for _, extra in ipairs(extras) do
|
||||||
|
local import = "lazyvim.plugins.extras." .. extra.extra
|
||||||
|
extra = vim.deepcopy(extra)
|
||||||
|
extra.enabled = extra.name == use
|
||||||
|
extra.import = import
|
||||||
|
extra.group = name
|
||||||
|
if extra.enabled then
|
||||||
|
extra.origin = origin
|
||||||
|
ret = extra
|
||||||
|
end
|
||||||
|
default_extras[import] = extra
|
||||||
|
end
|
||||||
|
|
||||||
|
return assert(ret, "One of the extras should be enabled, this should never happen")
|
||||||
|
end
|
||||||
|
|
||||||
|
---@param group string
|
||||||
|
---@return LazyVimDefault?
|
||||||
|
function M.get_default(group)
|
||||||
|
for _, extra in pairs(M.get_defaults()) do
|
||||||
|
if extra.group == group and extra.enabled then
|
||||||
|
return extra
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
function M.get_defaults()
|
function M.get_defaults()
|
||||||
if default_extras then
|
if default_extras then
|
||||||
return default_extras
|
return default_extras
|
||||||
end
|
end
|
||||||
|
default_extras = {}
|
||||||
|
|
||||||
---@type table<string, LazyVimDefault[]>
|
---@type table<string, LazyVimDefault[]>
|
||||||
local checks = {
|
local checks = {
|
||||||
picker = {
|
picker = {
|
||||||
|
|
@ -376,36 +446,10 @@ function M.get_defaults()
|
||||||
table.insert(checks.explorer, 1, table.remove(checks.explorer, 2))
|
table.insert(checks.explorer, 1, table.remove(checks.explorer, 2))
|
||||||
end
|
end
|
||||||
|
|
||||||
default_extras = {}
|
for name, extras in pairs(checks) do
|
||||||
for name, check in pairs(checks) do
|
M.register_defaults(name, extras)
|
||||||
local valid = {} ---@type string[]
|
|
||||||
for _, extra in ipairs(check) do
|
|
||||||
if extra.enabled ~= false then
|
|
||||||
valid[#valid + 1] = extra.name
|
|
||||||
end
|
|
||||||
end
|
|
||||||
local origin = "default"
|
|
||||||
local use = vim.g["lazyvim_" .. name]
|
|
||||||
use = vim.tbl_contains(valid, use or "auto") and use or nil
|
|
||||||
origin = use and "global" or origin
|
|
||||||
for _, extra in ipairs(use and {} or check) do
|
|
||||||
if extra.enabled ~= false and LazyVim.has_extra(extra.extra) then
|
|
||||||
use = extra.name
|
|
||||||
break
|
|
||||||
end
|
|
||||||
end
|
|
||||||
origin = use and "extra" or origin
|
|
||||||
use = use or valid[1]
|
|
||||||
for _, extra in ipairs(check) do
|
|
||||||
local import = "lazyvim.plugins.extras." .. extra.extra
|
|
||||||
extra = vim.deepcopy(extra)
|
|
||||||
extra.enabled = extra.name == use
|
|
||||||
if extra.enabled then
|
|
||||||
extra.origin = origin
|
|
||||||
end
|
|
||||||
default_extras[import] = extra
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
return default_extras
|
return default_extras
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -43,6 +43,9 @@ end, { desc = "Delete Buffer" })
|
||||||
map("n", "<leader>bo", function()
|
map("n", "<leader>bo", function()
|
||||||
Snacks.bufdelete.other()
|
Snacks.bufdelete.other()
|
||||||
end, { desc = "Delete Other Buffers" })
|
end, { desc = "Delete Other Buffers" })
|
||||||
|
map("n", "<leader>bi", function()
|
||||||
|
Snacks.bufdelete.invisible()
|
||||||
|
end, { desc = "Delete Invisible Buffers" })
|
||||||
map("n", "<leader>bD", "<cmd>:bd<cr>", { desc = "Delete Buffer and Window" })
|
map("n", "<leader>bD", "<cmd>:bd<cr>", { desc = "Delete Buffer and Window" })
|
||||||
|
|
||||||
-- Clear search and stop snippet on escape
|
-- Clear search and stop snippet on escape
|
||||||
|
|
@ -189,8 +192,8 @@ map("n", "<leader>L", function() LazyVim.news.changelog() end, { desc = "LazyVim
|
||||||
-- floating terminal
|
-- floating terminal
|
||||||
map("n", "<leader>fT", function() Snacks.terminal() end, { desc = "Terminal (cwd)" })
|
map("n", "<leader>fT", function() Snacks.terminal() end, { desc = "Terminal (cwd)" })
|
||||||
map("n", "<leader>ft", function() Snacks.terminal(nil, { cwd = LazyVim.root() }) end, { desc = "Terminal (Root Dir)" })
|
map("n", "<leader>ft", function() Snacks.terminal(nil, { cwd = LazyVim.root() }) end, { desc = "Terminal (Root Dir)" })
|
||||||
map({"n","t"}, "<c-/>",function() Snacks.terminal(nil, { cwd = LazyVim.root() }) end, { desc = "Terminal (Root Dir)" })
|
map({"n","t"}, "<c-/>",function() Snacks.terminal.focus(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" })
|
map({"n","t"}, "<c-_>",function() Snacks.terminal.focus(nil, { cwd = LazyVim.root() }) end, { desc = "which_key_ignore" })
|
||||||
|
|
||||||
-- windows
|
-- windows
|
||||||
map("n", "<leader>-", "<C-W>s", { desc = "Split Window Below", remap = true })
|
map("n", "<leader>-", "<C-W>s", { desc = "Split Window Below", remap = true })
|
||||||
|
|
@ -207,3 +210,6 @@ map("n", "<leader><tab><tab>", "<cmd>tabnew<cr>", { desc = "New Tab" })
|
||||||
map("n", "<leader><tab>]", "<cmd>tabnext<cr>", { desc = "Next Tab" })
|
map("n", "<leader><tab>]", "<cmd>tabnext<cr>", { desc = "Next Tab" })
|
||||||
map("n", "<leader><tab>d", "<cmd>tabclose<cr>", { desc = "Close Tab" })
|
map("n", "<leader><tab>d", "<cmd>tabclose<cr>", { desc = "Close Tab" })
|
||||||
map("n", "<leader><tab>[", "<cmd>tabprevious<cr>", { desc = "Previous Tab" })
|
map("n", "<leader><tab>[", "<cmd>tabprevious<cr>", { desc = "Previous Tab" })
|
||||||
|
|
||||||
|
-- lua
|
||||||
|
map({"n", "x"}, "<localleader>r", function() Snacks.debug.run() end, { desc = "Run Lua", ft = "lua" })
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,7 @@ local opt = vim.opt
|
||||||
opt.autowrite = true -- Enable auto write
|
opt.autowrite = true -- Enable auto write
|
||||||
-- only set clipboard if not in ssh, to make sure the OSC 52
|
-- only set clipboard if not in ssh, to make sure the OSC 52
|
||||||
-- integration works automatically.
|
-- integration works automatically.
|
||||||
opt.clipboard = vim.env.SSH_TTY and "" or "unnamedplus" -- Sync with system clipboard
|
opt.clipboard = vim.env.SSH_CONNECTION and "" or "unnamedplus" -- Sync with system clipboard
|
||||||
opt.completeopt = "menu,menuone,noselect"
|
opt.completeopt = "menu,menuone,noselect"
|
||||||
opt.conceallevel = 2 -- Hide * markup for bold and italic, but not markers with substitutions
|
opt.conceallevel = 2 -- Hide * markup for bold and italic, but not markers with substitutions
|
||||||
opt.confirm = true -- Confirm to save changes before exiting modified buffer
|
opt.confirm = true -- Confirm to save changes before exiting modified buffer
|
||||||
|
|
|
||||||
|
|
@ -82,6 +82,7 @@ return {
|
||||||
{ path = "LazyVim", words = { "LazyVim" } },
|
{ path = "LazyVim", words = { "LazyVim" } },
|
||||||
{ path = "snacks.nvim", words = { "Snacks" } },
|
{ path = "snacks.nvim", words = { "Snacks" } },
|
||||||
{ path = "lazy.nvim", words = { "LazyVim" } },
|
{ path = "lazy.nvim", words = { "LazyVim" } },
|
||||||
|
{ path = "nvim-lspconfig", words = { "lspconfig.settings" } },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,9 @@ return {
|
||||||
selection = {
|
selection = {
|
||||||
hint_display = "none",
|
hint_display = "none",
|
||||||
},
|
},
|
||||||
|
behaviour = {
|
||||||
|
auto_set_keymaps = false,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
cmd = {
|
cmd = {
|
||||||
"AvanteAsk",
|
"AvanteAsk",
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ if lazyvim_docs then
|
||||||
end
|
end
|
||||||
|
|
||||||
if LazyVim.has_extra("ai.copilot-native") then
|
if LazyVim.has_extra("ai.copilot-native") then
|
||||||
if not vim.lsp.inline_completion then
|
if vim.fn.has("nvim-0.12") == 0 then
|
||||||
LazyVim.error("You need Neovim >= 0.12 to use the `ai.copilot-native` extra.")
|
LazyVim.error("You need Neovim >= 0.12 to use the `ai.copilot-native` extra.")
|
||||||
return {}
|
return {}
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -70,60 +70,58 @@ return {
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
||||||
vim.g.ai_cmp
|
vim.g.ai_cmp and {
|
||||||
and {
|
-- copilot cmp source
|
||||||
-- copilot cmp source
|
{
|
||||||
|
"hrsh7th/nvim-cmp",
|
||||||
|
optional = true,
|
||||||
|
dependencies = { -- this will only be evaluated if nvim-cmp is enabled
|
||||||
{
|
{
|
||||||
"hrsh7th/nvim-cmp",
|
"zbirenbaum/copilot-cmp",
|
||||||
optional = true,
|
opts = {},
|
||||||
dependencies = { -- this will only be evaluated if nvim-cmp is enabled
|
config = function(_, opts)
|
||||||
|
local copilot_cmp = require("copilot_cmp")
|
||||||
|
copilot_cmp.setup(opts)
|
||||||
|
-- attach cmp source whenever copilot attaches
|
||||||
|
-- fixes lazy-loading issues with the copilot cmp source
|
||||||
|
Snacks.util.lsp.on({ name = "copilot" }, function()
|
||||||
|
copilot_cmp._on_insert_enter({})
|
||||||
|
end)
|
||||||
|
end,
|
||||||
|
specs = {
|
||||||
{
|
{
|
||||||
"zbirenbaum/copilot-cmp",
|
"hrsh7th/nvim-cmp",
|
||||||
opts = {},
|
optional = true,
|
||||||
config = function(_, opts)
|
---@param opts cmp.ConfigSchema
|
||||||
local copilot_cmp = require("copilot_cmp")
|
opts = function(_, opts)
|
||||||
copilot_cmp.setup(opts)
|
table.insert(opts.sources, 1, {
|
||||||
-- attach cmp source whenever copilot attaches
|
|
||||||
-- fixes lazy-loading issues with the copilot cmp source
|
|
||||||
LazyVim.lsp.on_attach(function()
|
|
||||||
copilot_cmp._on_insert_enter({})
|
|
||||||
end, "copilot")
|
|
||||||
end,
|
|
||||||
specs = {
|
|
||||||
{
|
|
||||||
"hrsh7th/nvim-cmp",
|
|
||||||
optional = true,
|
|
||||||
---@param opts cmp.ConfigSchema
|
|
||||||
opts = function(_, opts)
|
|
||||||
table.insert(opts.sources, 1, {
|
|
||||||
name = "copilot",
|
|
||||||
group_index = 1,
|
|
||||||
priority = 100,
|
|
||||||
})
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"saghen/blink.cmp",
|
|
||||||
optional = true,
|
|
||||||
dependencies = { "fang2hou/blink-copilot" },
|
|
||||||
opts = {
|
|
||||||
sources = {
|
|
||||||
default = { "copilot" },
|
|
||||||
providers = {
|
|
||||||
copilot = {
|
|
||||||
name = "copilot",
|
name = "copilot",
|
||||||
module = "blink-copilot",
|
group_index = 1,
|
||||||
score_offset = 100,
|
priority = 100,
|
||||||
async = true,
|
})
|
||||||
},
|
end,
|
||||||
},
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
},
|
||||||
or nil,
|
},
|
||||||
|
{
|
||||||
|
"saghen/blink.cmp",
|
||||||
|
optional = true,
|
||||||
|
dependencies = { "fang2hou/blink-copilot" },
|
||||||
|
opts = {
|
||||||
|
sources = {
|
||||||
|
default = { "copilot" },
|
||||||
|
providers = {
|
||||||
|
copilot = {
|
||||||
|
name = "copilot",
|
||||||
|
module = "blink-copilot",
|
||||||
|
score_offset = 100,
|
||||||
|
async = true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
} or nil,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -65,6 +65,15 @@ return {
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Snacks.toggle({
|
||||||
|
name = "Sidekick NES",
|
||||||
|
get = function()
|
||||||
|
return require("sidekick.nes").enabled
|
||||||
|
end,
|
||||||
|
set = function(state)
|
||||||
|
require("sidekick.nes").enable(state)
|
||||||
|
end,
|
||||||
|
}):map("<leader>uN")
|
||||||
end,
|
end,
|
||||||
-- stylua: ignore
|
-- stylua: ignore
|
||||||
keys = {
|
keys = {
|
||||||
|
|
@ -73,8 +82,8 @@ return {
|
||||||
{ "<leader>a", "", desc = "+ai", mode = { "n", "v" } },
|
{ "<leader>a", "", desc = "+ai", mode = { "n", "v" } },
|
||||||
{
|
{
|
||||||
"<c-.>",
|
"<c-.>",
|
||||||
function() require("sidekick.cli").toggle() end,
|
function() require("sidekick.cli").focus() end,
|
||||||
desc = "Sidekick Toggle",
|
desc = "Sidekick Focus",
|
||||||
mode = { "n", "t", "i", "x" },
|
mode = { "n", "t", "i", "x" },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,9 @@ return {
|
||||||
desc = "Better Yank/Paste",
|
desc = "Better Yank/Paste",
|
||||||
event = "LazyFile",
|
event = "LazyFile",
|
||||||
opts = {
|
opts = {
|
||||||
|
system_clipboard = {
|
||||||
|
sync_with_ring = not vim.env.SSH_CONNECTION,
|
||||||
|
},
|
||||||
highlight = { timer = 150 },
|
highlight = { timer = 150 },
|
||||||
},
|
},
|
||||||
keys = {
|
keys = {
|
||||||
|
|
|
||||||
|
|
@ -53,20 +53,6 @@ return {
|
||||||
cyclic = true,
|
cyclic = true,
|
||||||
})
|
})
|
||||||
|
|
||||||
local weekdays = augend.constant.new({
|
|
||||||
elements = {
|
|
||||||
"Monday",
|
|
||||||
"Tuesday",
|
|
||||||
"Wednesday",
|
|
||||||
"Thursday",
|
|
||||||
"Friday",
|
|
||||||
"Saturday",
|
|
||||||
"Sunday",
|
|
||||||
},
|
|
||||||
word = true,
|
|
||||||
cyclic = true,
|
|
||||||
})
|
|
||||||
|
|
||||||
local months = augend.constant.new({
|
local months = augend.constant.new({
|
||||||
elements = {
|
elements = {
|
||||||
"January",
|
"January",
|
||||||
|
|
@ -86,15 +72,6 @@ return {
|
||||||
cyclic = true,
|
cyclic = true,
|
||||||
})
|
})
|
||||||
|
|
||||||
local capitalized_boolean = augend.constant.new({
|
|
||||||
elements = {
|
|
||||||
"True",
|
|
||||||
"False",
|
|
||||||
},
|
|
||||||
word = true,
|
|
||||||
cyclic = true,
|
|
||||||
})
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
dials_by_ft = {
|
dials_by_ft = {
|
||||||
css = "css",
|
css = "css",
|
||||||
|
|
@ -116,11 +93,12 @@ return {
|
||||||
augend.integer.alias.decimal_int, -- nonnegative and negative decimal number
|
augend.integer.alias.decimal_int, -- nonnegative and negative decimal number
|
||||||
augend.integer.alias.hex, -- nonnegative hex number (0x01, 0x1a1f, etc.)
|
augend.integer.alias.hex, -- nonnegative hex number (0x01, 0x1a1f, etc.)
|
||||||
augend.date.alias["%Y/%m/%d"], -- date (2022/02/19, etc.)
|
augend.date.alias["%Y/%m/%d"], -- date (2022/02/19, etc.)
|
||||||
|
augend.constant.alias.en_weekday, -- Mon, Tue, ..., Sat, Sun
|
||||||
|
augend.constant.alias.en_weekday_full, -- Monday, Tuesday, ..., Saturday, Sunday
|
||||||
ordinal_numbers,
|
ordinal_numbers,
|
||||||
weekdays,
|
|
||||||
months,
|
months,
|
||||||
capitalized_boolean,
|
|
||||||
augend.constant.alias.bool, -- boolean value (true <-> false)
|
augend.constant.alias.bool, -- boolean value (true <-> false)
|
||||||
|
augend.constant.alias.Bool, -- boolean value (True <-> False)
|
||||||
logical_alias,
|
logical_alias,
|
||||||
},
|
},
|
||||||
vue = {
|
vue = {
|
||||||
|
|
|
||||||
|
|
@ -227,7 +227,7 @@ return {
|
||||||
{ "<leader>fR", LazyVim.pick("oldfiles", { cwd = vim.uv.cwd() }), desc = "Recent (cwd)" },
|
{ "<leader>fR", LazyVim.pick("oldfiles", { cwd = vim.uv.cwd() }), desc = "Recent (cwd)" },
|
||||||
-- git
|
-- git
|
||||||
{ "<leader>gc", "<cmd>FzfLua git_commits<CR>", desc = "Commits" },
|
{ "<leader>gc", "<cmd>FzfLua git_commits<CR>", desc = "Commits" },
|
||||||
{ "<leader>gd", "<cmd>FzfLua git_diff<cr>", desc = "Git Diff (hunks)" },
|
{ "<leader>gd", "<cmd>FzfLua git_diff<cr>", desc = "Git Diff (files)" },
|
||||||
{ "<leader>gl", "<cmd>FzfLua git_commits<CR>", desc = "Commits" },
|
{ "<leader>gl", "<cmd>FzfLua git_commits<CR>", desc = "Commits" },
|
||||||
{ "<leader>gs", "<cmd>FzfLua git_status<CR>", desc = "Status" },
|
{ "<leader>gs", "<cmd>FzfLua git_status<CR>", desc = "Status" },
|
||||||
{ "<leader>gS", "<cmd>FzfLua git_stash<cr>", desc = "Git Stash" },
|
{ "<leader>gS", "<cmd>FzfLua git_stash<cr>", desc = "Git Stash" },
|
||||||
|
|
@ -289,15 +289,18 @@ return {
|
||||||
|
|
||||||
{
|
{
|
||||||
"neovim/nvim-lspconfig",
|
"neovim/nvim-lspconfig",
|
||||||
opts = function()
|
opts = {
|
||||||
local Keys = require("lazyvim.plugins.lsp.keymaps").get()
|
servers = {
|
||||||
-- stylua: ignore
|
-- stylua: ignore
|
||||||
vim.list_extend(Keys, {
|
["*"] = {
|
||||||
{ "gd", "<cmd>FzfLua lsp_definitions jump1=true ignore_current_line=true<cr>", desc = "Goto Definition", has = "definition" },
|
keys = {
|
||||||
{ "gr", "<cmd>FzfLua lsp_references jump1=true ignore_current_line=true<cr>", desc = "References", nowait = true },
|
{ "gd", "<cmd>FzfLua lsp_definitions jump1=true ignore_current_line=true<cr>", desc = "Goto Definition", has = "definition" },
|
||||||
{ "gI", "<cmd>FzfLua lsp_implementations jump1=true ignore_current_line=true<cr>", desc = "Goto Implementation" },
|
{ "gr", "<cmd>FzfLua lsp_references jump1=true ignore_current_line=true<cr>", desc = "References", nowait = true },
|
||||||
{ "gy", "<cmd>FzfLua lsp_typedefs jump1=true ignore_current_line=true<cr>", desc = "Goto T[y]pe Definition" },
|
{ "gI", "<cmd>FzfLua lsp_implementations jump1=true ignore_current_line=true<cr>", desc = "Goto Implementation" },
|
||||||
})
|
{ "gy", "<cmd>FzfLua lsp_typedefs jump1=true ignore_current_line=true<cr>", desc = "Goto T[y]pe Definition" },
|
||||||
end,
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -12,19 +12,24 @@ return {
|
||||||
-- LSP Keymaps
|
-- LSP Keymaps
|
||||||
{
|
{
|
||||||
"neovim/nvim-lspconfig",
|
"neovim/nvim-lspconfig",
|
||||||
opts = function()
|
opts = {
|
||||||
local keys = require("lazyvim.plugins.lsp.keymaps").get()
|
servers = {
|
||||||
keys[#keys + 1] = {
|
["*"] = {
|
||||||
"<leader>cr",
|
keys = {
|
||||||
function()
|
{
|
||||||
local inc_rename = require("inc_rename")
|
"<leader>cr",
|
||||||
return ":" .. inc_rename.config.cmd_name .. " " .. vim.fn.expand("<cword>")
|
function()
|
||||||
end,
|
local inc_rename = require("inc_rename")
|
||||||
expr = true,
|
return ":" .. inc_rename.config.cmd_name .. " " .. vim.fn.expand("<cword>")
|
||||||
desc = "Rename (inc-rename.nvim)",
|
end,
|
||||||
has = "rename",
|
expr = true,
|
||||||
}
|
desc = "Rename (inc-rename.nvim)",
|
||||||
end,
|
has = "rename",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
--- Noice integration
|
--- Noice integration
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ return {
|
||||||
|
|
||||||
-- easily jump to any location and enhanced f/t motions for Leap
|
-- easily jump to any location and enhanced f/t motions for Leap
|
||||||
{
|
{
|
||||||
"ggandor/flit.nvim",
|
url = "https://codeberg.org/andyg/leap.nvim.git",
|
||||||
enabled = true,
|
enabled = true,
|
||||||
keys = function()
|
keys = function()
|
||||||
---@type LazyKeysSpec[]
|
---@type LazyKeysSpec[]
|
||||||
|
|
@ -17,7 +17,7 @@ return {
|
||||||
opts = { labeled_modes = "nx" },
|
opts = { labeled_modes = "nx" },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ggandor/leap.nvim",
|
url = "https://codeberg.org/andyg/leap.nvim.git",
|
||||||
enabled = true,
|
enabled = true,
|
||||||
keys = {
|
keys = {
|
||||||
{ "s", mode = { "n", "x", "o" }, desc = "Leap Forward to" },
|
{ "s", mode = { "n", "x", "o" }, desc = "Leap Forward to" },
|
||||||
|
|
|
||||||
|
|
@ -7,13 +7,11 @@ return {
|
||||||
lazy = true,
|
lazy = true,
|
||||||
init = function()
|
init = function()
|
||||||
vim.g.navic_silence = true
|
vim.g.navic_silence = true
|
||||||
LazyVim.lsp.on_attach(function(client, buffer)
|
|
||||||
if client:supports_method("textDocument/documentSymbol") then
|
|
||||||
require("nvim-navic").attach(client, buffer)
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
end,
|
end,
|
||||||
opts = function()
|
opts = function()
|
||||||
|
Snacks.util.lsp.on({ method = "textDocument/documentSymbol" }, function(buffer, client)
|
||||||
|
require("nvim-navic").attach(client, buffer)
|
||||||
|
end)
|
||||||
return {
|
return {
|
||||||
separator = " ",
|
separator = " ",
|
||||||
highlight = true,
|
highlight = true,
|
||||||
|
|
|
||||||
|
|
@ -8,29 +8,20 @@ return {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"stevearc/overseer.nvim",
|
"stevearc/overseer.nvim",
|
||||||
|
lazy = false, -- plugin is self-lazy-loading
|
||||||
cmd = {
|
cmd = {
|
||||||
"OverseerOpen",
|
"OverseerOpen",
|
||||||
"OverseerClose",
|
"OverseerClose",
|
||||||
"OverseerToggle",
|
"OverseerToggle",
|
||||||
"OverseerSaveBundle",
|
|
||||||
"OverseerLoadBundle",
|
|
||||||
"OverseerDeleteBundle",
|
|
||||||
"OverseerRunCmd",
|
|
||||||
"OverseerRun",
|
"OverseerRun",
|
||||||
"OverseerInfo",
|
|
||||||
"OverseerBuild",
|
|
||||||
"OverseerQuickAction",
|
|
||||||
"OverseerTaskAction",
|
"OverseerTaskAction",
|
||||||
"OverseerClearCache",
|
|
||||||
},
|
},
|
||||||
opts = {
|
opts = {
|
||||||
dap = false,
|
dap = false,
|
||||||
task_list = {
|
task_list = {
|
||||||
bindings = {
|
keymaps = {
|
||||||
["<C-h>"] = false,
|
|
||||||
["<C-j>"] = false,
|
["<C-j>"] = false,
|
||||||
["<C-k>"] = false,
|
["<C-k>"] = false,
|
||||||
["<C-l>"] = false,
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
form = {
|
form = {
|
||||||
|
|
@ -38,11 +29,6 @@ return {
|
||||||
winblend = 0,
|
winblend = 0,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
confirm = {
|
|
||||||
win_opts = {
|
|
||||||
winblend = 0,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
task_win = {
|
task_win = {
|
||||||
win_opts = {
|
win_opts = {
|
||||||
winblend = 0,
|
winblend = 0,
|
||||||
|
|
@ -51,13 +37,9 @@ return {
|
||||||
},
|
},
|
||||||
-- stylua: ignore
|
-- stylua: ignore
|
||||||
keys = {
|
keys = {
|
||||||
{ "<leader>ow", "<cmd>OverseerToggle<cr>", desc = "Task list" },
|
{ "<leader>ow", "<cmd>OverseerToggle!<cr>", desc = "Task list" },
|
||||||
{ "<leader>oo", "<cmd>OverseerRun<cr>", desc = "Run task" },
|
{ "<leader>oo", "<cmd>OverseerRun<cr>", desc = "Run task" },
|
||||||
{ "<leader>oq", "<cmd>OverseerQuickAction<cr>", desc = "Action recent task" },
|
{ "<leader>ot", "<cmd>OverseerTaskAction<cr>", desc = "Task action" },
|
||||||
{ "<leader>oi", "<cmd>OverseerInfo<cr>", desc = "Overseer Info" },
|
|
||||||
{ "<leader>ob", "<cmd>OverseerBuild<cr>", desc = "Task builder" },
|
|
||||||
{ "<leader>ot", "<cmd>OverseerTaskAction<cr>", desc = "Task action" },
|
|
||||||
{ "<leader>oc", "<cmd>OverseerClearCache<cr>", desc = "Clear cache" },
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,95 +1,64 @@
|
||||||
local pick = function()
|
if LazyVim.has_extra("editor.refactoring") then
|
||||||
local refactoring = require("refactoring")
|
if vim.fn.has("nvim-0.12") == 0 then
|
||||||
if LazyVim.pick.picker.name == "telescope" then
|
LazyVim.error("refactoring.nvim requires Neovim 0.12 or higher", { title = "refactoring.nvim" })
|
||||||
return require("telescope").extensions.refactoring.refactors()
|
return {}
|
||||||
elseif LazyVim.pick.picker.name == "fzf" then
|
|
||||||
local fzf_lua = require("fzf-lua")
|
|
||||||
local results = refactoring.get_refactors()
|
|
||||||
|
|
||||||
local opts = {
|
|
||||||
fzf_opts = {},
|
|
||||||
fzf_colors = true,
|
|
||||||
actions = {
|
|
||||||
["default"] = function(selected)
|
|
||||||
refactoring.refactor(selected[1])
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
fzf_lua.fzf_exec(results, opts)
|
|
||||||
else
|
|
||||||
refactoring.select_refactor()
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
{ "lewis6991/async.nvim", lazy = true },
|
||||||
|
|
||||||
{
|
{
|
||||||
"ThePrimeagen/refactoring.nvim",
|
"ThePrimeagen/refactoring.nvim",
|
||||||
event = { "BufReadPre", "BufNewFile" },
|
event = { "BufReadPre", "BufNewFile" },
|
||||||
dependencies = {
|
|
||||||
"nvim-lua/plenary.nvim",
|
|
||||||
"nvim-treesitter/nvim-treesitter",
|
|
||||||
},
|
|
||||||
keys = {
|
keys = {
|
||||||
{ "<leader>r", "", desc = "+refactor", mode = { "n", "x" } },
|
{ "<leader>r", "", desc = "+refactor", mode = { "n", "x" } },
|
||||||
{
|
{
|
||||||
"<leader>rs",
|
"<leader>rs",
|
||||||
pick,
|
function()
|
||||||
|
return require("refactoring").select_refactor()
|
||||||
|
end,
|
||||||
mode = { "n", "x" },
|
mode = { "n", "x" },
|
||||||
desc = "Refactor",
|
desc = "Select Refactor",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"<leader>ri",
|
"<leader>ri",
|
||||||
function()
|
function()
|
||||||
return require("refactoring").refactor("Inline Variable")
|
return require("refactoring").inline_var()
|
||||||
end,
|
end,
|
||||||
mode = { "n", "x" },
|
mode = { "n", "x" },
|
||||||
desc = "Inline Variable",
|
desc = "Inline Variable",
|
||||||
expr = true,
|
expr = true,
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"<leader>rb",
|
|
||||||
function()
|
|
||||||
return require("refactoring").refactor("Extract Block")
|
|
||||||
end,
|
|
||||||
mode = { "n", "x" },
|
|
||||||
desc = "Extract Block",
|
|
||||||
expr = true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"<leader>rf",
|
|
||||||
function()
|
|
||||||
return require("refactoring").refactor("Extract Block To File")
|
|
||||||
end,
|
|
||||||
mode = { "n", "x" },
|
|
||||||
desc = "Extract Block To File",
|
|
||||||
expr = true,
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"<leader>rP",
|
"<leader>rP",
|
||||||
function()
|
function()
|
||||||
require("refactoring").debug.printf({ below = false })
|
return require("refactoring.debug").print_loc({ output_location = "below" })
|
||||||
end,
|
end,
|
||||||
desc = "Debug Print",
|
desc = "Debug Print Location",
|
||||||
|
expr = true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"<leader>rp",
|
"<leader>rp",
|
||||||
function()
|
function()
|
||||||
require("refactoring").debug.print_var({ normal = true })
|
return require("refactoring.debug").print_var({ output_location = "below" }) .. "iw"
|
||||||
end,
|
end,
|
||||||
mode = { "n", "x" },
|
mode = { "n", "x" },
|
||||||
desc = "Debug Print Variable",
|
desc = "Debug Print Variable",
|
||||||
|
expr = true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"<leader>rc",
|
"<leader>rc",
|
||||||
function()
|
function()
|
||||||
require("refactoring").debug.cleanup({})
|
return require("refactoring.debug").cleanup({ restore_view = true }) .. "ag"
|
||||||
end,
|
end,
|
||||||
desc = "Debug Cleanup",
|
desc = "Debug Cleanup",
|
||||||
|
expr = true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"<leader>rf",
|
"<leader>rf",
|
||||||
function()
|
function()
|
||||||
return require("refactoring").refactor("Extract Function")
|
return require("refactoring").extract_func()
|
||||||
end,
|
end,
|
||||||
mode = { "n", "x" },
|
mode = { "n", "x" },
|
||||||
desc = "Extract Function",
|
desc = "Extract Function",
|
||||||
|
|
@ -98,7 +67,7 @@ return {
|
||||||
{
|
{
|
||||||
"<leader>rF",
|
"<leader>rF",
|
||||||
function()
|
function()
|
||||||
return require("refactoring").refactor("Extract Function To File")
|
return require("refactoring").extract_func_to_file()
|
||||||
end,
|
end,
|
||||||
mode = { "n", "x" },
|
mode = { "n", "x" },
|
||||||
desc = "Extract Function To File",
|
desc = "Extract Function To File",
|
||||||
|
|
@ -107,52 +76,13 @@ return {
|
||||||
{
|
{
|
||||||
"<leader>rx",
|
"<leader>rx",
|
||||||
function()
|
function()
|
||||||
return require("refactoring").refactor("Extract Variable")
|
return require("refactoring").extract_var()
|
||||||
end,
|
end,
|
||||||
mode = { "n", "x" },
|
mode = { "n", "x" },
|
||||||
desc = "Extract Variable",
|
desc = "Extract Variable",
|
||||||
expr = true,
|
expr = true,
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"<leader>rp",
|
|
||||||
function()
|
|
||||||
require("refactoring").debug.print_var()
|
|
||||||
end,
|
|
||||||
mode = { "n", "x" },
|
|
||||||
desc = "Debug Print Variable",
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
opts = {
|
opts = {},
|
||||||
prompt_func_return_type = {
|
|
||||||
go = false,
|
|
||||||
java = false,
|
|
||||||
cpp = false,
|
|
||||||
c = false,
|
|
||||||
h = false,
|
|
||||||
hpp = false,
|
|
||||||
cxx = false,
|
|
||||||
},
|
|
||||||
prompt_func_param_type = {
|
|
||||||
go = false,
|
|
||||||
java = false,
|
|
||||||
cpp = false,
|
|
||||||
c = false,
|
|
||||||
h = false,
|
|
||||||
hpp = false,
|
|
||||||
cxx = false,
|
|
||||||
},
|
|
||||||
printf_statements = {},
|
|
||||||
print_var_statements = {},
|
|
||||||
show_success_message = true, -- shows a message with information about the refactor on success
|
|
||||||
-- i.e. [Refactor] Inlined 3 variable occurrences
|
|
||||||
},
|
|
||||||
config = function(_, opts)
|
|
||||||
require("refactoring").setup(opts)
|
|
||||||
if LazyVim.has("telescope.nvim") then
|
|
||||||
LazyVim.on_load("telescope.nvim", function()
|
|
||||||
require("telescope").load_extension("refactoring")
|
|
||||||
end)
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -73,8 +73,13 @@ return {
|
||||||
{ "<leader>fp", function() Snacks.picker.projects() end, desc = "Projects" },
|
{ "<leader>fp", function() Snacks.picker.projects() end, desc = "Projects" },
|
||||||
-- git
|
-- git
|
||||||
{ "<leader>gd", function() Snacks.picker.git_diff() end, desc = "Git Diff (hunks)" },
|
{ "<leader>gd", function() Snacks.picker.git_diff() end, desc = "Git Diff (hunks)" },
|
||||||
|
{ "<leader>gD", function() Snacks.picker.git_diff({ base = "origin", group = true }) end, desc = "Git Diff (origin)" },
|
||||||
{ "<leader>gs", function() Snacks.picker.git_status() end, desc = "Git Status" },
|
{ "<leader>gs", function() Snacks.picker.git_status() end, desc = "Git Status" },
|
||||||
{ "<leader>gS", function() Snacks.picker.git_stash() end, desc = "Git Stash" },
|
{ "<leader>gS", function() Snacks.picker.git_stash() end, desc = "Git Stash" },
|
||||||
|
{ "<leader>gi", function() Snacks.picker.gh_issue() end, desc = "GitHub Issues (open)" },
|
||||||
|
{ "<leader>gI", function() Snacks.picker.gh_issue({ state = "all" }) end, desc = "GitHub Issues (all)" },
|
||||||
|
{ "<leader>gp", function() Snacks.picker.gh_pr() end, desc = "GitHub Pull Requests (open)" },
|
||||||
|
{ "<leader>gP", function() Snacks.picker.gh_pr({ state = "all" }) end, desc = "GitHub Pull Requests (all)" },
|
||||||
-- Grep
|
-- Grep
|
||||||
{ "<leader>sb", function() Snacks.picker.lines() end, desc = "Buffer Lines" },
|
{ "<leader>sb", function() Snacks.picker.lines() end, desc = "Buffer Lines" },
|
||||||
{ "<leader>sB", function() Snacks.picker.grep_buffers() end, desc = "Grep Open Buffers" },
|
{ "<leader>sB", function() Snacks.picker.grep_buffers() end, desc = "Grep Open Buffers" },
|
||||||
|
|
@ -134,18 +139,23 @@ return {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"neovim/nvim-lspconfig",
|
"neovim/nvim-lspconfig",
|
||||||
opts = function()
|
opts = {
|
||||||
local Keys = require("lazyvim.plugins.lsp.keymaps").get()
|
servers = {
|
||||||
-- stylua: ignore
|
["*"] = {
|
||||||
vim.list_extend(Keys, {
|
-- stylua: ignore
|
||||||
{ "gd", function() Snacks.picker.lsp_definitions() end, desc = "Goto Definition", has = "definition" },
|
keys = {
|
||||||
{ "gr", function() Snacks.picker.lsp_references() end, nowait = true, desc = "References" },
|
{ "gd", function() Snacks.picker.lsp_definitions() end, desc = "Goto Definition", has = "definition" },
|
||||||
{ "gI", function() Snacks.picker.lsp_implementations() end, desc = "Goto Implementation" },
|
{ "gr", function() Snacks.picker.lsp_references() end, nowait = true, desc = "References" },
|
||||||
{ "gy", function() Snacks.picker.lsp_type_definitions() end, desc = "Goto T[y]pe Definition" },
|
{ "gI", function() Snacks.picker.lsp_implementations() end, desc = "Goto Implementation" },
|
||||||
{ "<leader>ss", function() Snacks.picker.lsp_symbols({ filter = LazyVim.config.kind_filter }) end, desc = "LSP Symbols", has = "documentSymbol" },
|
{ "gy", function() Snacks.picker.lsp_type_definitions() end, desc = "Goto T[y]pe Definition" },
|
||||||
{ "<leader>sS", function() Snacks.picker.lsp_workspace_symbols({ filter = LazyVim.config.kind_filter }) end, desc = "LSP Workspace Symbols", has = "workspace/symbols" },
|
{ "<leader>ss", function() Snacks.picker.lsp_symbols({ filter = LazyVim.config.kind_filter }) end, desc = "LSP Symbols", has = "documentSymbol" },
|
||||||
})
|
{ "<leader>sS", function() Snacks.picker.lsp_workspace_symbols({ filter = LazyVim.config.kind_filter }) end, desc = "LSP Workspace Symbols", has = "workspace/symbols" },
|
||||||
end,
|
{ "gai", function() Snacks.picker.lsp_incoming_calls() end, desc = "C[a]lls Incoming", has = "callHierarchy/incomingCalls" },
|
||||||
|
{ "gao", function() Snacks.picker.lsp_outgoing_calls() end, desc = "C[a]lls Outgoing", has = "callHierarchy/outgoingCalls" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"folke/todo-comments.nvim",
|
"folke/todo-comments.nvim",
|
||||||
|
|
|
||||||
|
|
@ -284,15 +284,18 @@ return {
|
||||||
|
|
||||||
{
|
{
|
||||||
"neovim/nvim-lspconfig",
|
"neovim/nvim-lspconfig",
|
||||||
opts = function()
|
opts = {
|
||||||
local Keys = require("lazyvim.plugins.lsp.keymaps").get()
|
servers = {
|
||||||
-- stylua: ignore
|
["*"] = {
|
||||||
vim.list_extend(Keys, {
|
-- stylua: ignore
|
||||||
{ "gd", function() require("telescope.builtin").lsp_definitions({ reuse_win = true }) end, desc = "Goto Definition", has = "definition" },
|
keys = {
|
||||||
{ "gr", "<cmd>Telescope lsp_references<cr>", desc = "References", nowait = true },
|
{ "gd", function() require("telescope.builtin").lsp_definitions({ reuse_win = true }) end, desc = "Goto Definition", has = "definition" },
|
||||||
{ "gI", function() require("telescope.builtin").lsp_implementations({ reuse_win = true }) end, desc = "Goto Implementation" },
|
{ "gr", "<cmd>Telescope lsp_references<cr>", desc = "References", nowait = true },
|
||||||
{ "gy", function() require("telescope.builtin").lsp_type_definitions({ reuse_win = true }) end, desc = "Goto T[y]pe Definition" },
|
{ "gI", function() require("telescope.builtin").lsp_implementations({ reuse_win = true }) end, desc = "Goto Implementation" },
|
||||||
})
|
{ "gy", function() require("telescope.builtin").lsp_type_definitions({ reuse_win = true }) end, desc = "Goto T[y]pe Definition" },
|
||||||
end,
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -35,10 +35,10 @@ return {
|
||||||
},
|
},
|
||||||
setup = {
|
setup = {
|
||||||
angularls = function()
|
angularls = function()
|
||||||
LazyVim.lsp.on_attach(function(client)
|
Snacks.util.lsp.on({ name = "angularls" }, function(_, client)
|
||||||
--HACK: disable angular renaming capability due to duplicate rename popping up
|
--HACK: disable angular renaming capability due to duplicate rename popping up
|
||||||
client.server_capabilities.renameProvider = false
|
client.server_capabilities.renameProvider = false
|
||||||
end, "angularls")
|
end)
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -23,8 +23,7 @@ return {
|
||||||
|
|
||||||
{
|
{
|
||||||
"p00f/clangd_extensions.nvim",
|
"p00f/clangd_extensions.nvim",
|
||||||
lazy = true,
|
ft = { "c", "cpp", "objc", "objcpp" },
|
||||||
config = function() end,
|
|
||||||
opts = {
|
opts = {
|
||||||
inlay_hints = {
|
inlay_hints = {
|
||||||
inline = false,
|
inline = false,
|
||||||
|
|
@ -94,13 +93,6 @@ return {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
setup = {
|
|
||||||
clangd = function(_, opts)
|
|
||||||
local clangd_ext_opts = LazyVim.opts("clangd_extensions.nvim")
|
|
||||||
require("clangd_extensions").setup(vim.tbl_deep_extend("force", clangd_ext_opts or {}, { server = opts }))
|
|
||||||
return false
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,6 @@ return {
|
||||||
event = "LazyFile",
|
event = "LazyFile",
|
||||||
config = function(_, _)
|
config = function(_, _)
|
||||||
require("conjure.main").main()
|
require("conjure.main").main()
|
||||||
require("conjure.mapping")["on-filetype"]()
|
|
||||||
end,
|
end,
|
||||||
init = function()
|
init = function()
|
||||||
-- print color codes if baleia.nvim is available
|
-- print color codes if baleia.nvim is available
|
||||||
|
|
|
||||||
|
|
@ -20,11 +20,6 @@ return {
|
||||||
{
|
{
|
||||||
"stevearc/conform.nvim",
|
"stevearc/conform.nvim",
|
||||||
opts = {
|
opts = {
|
||||||
formatters = {
|
|
||||||
dart_format = {
|
|
||||||
args = { "format", "--line-length", "120" },
|
|
||||||
},
|
|
||||||
},
|
|
||||||
formatters_by_ft = {
|
formatters_by_ft = {
|
||||||
dart = { "dart_format" },
|
dart = { "dart_format" },
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,8 @@ return {
|
||||||
function()
|
function()
|
||||||
local params = vim.lsp.util.make_position_params()
|
local params = vim.lsp.util.make_position_params()
|
||||||
LazyVim.lsp.execute({
|
LazyVim.lsp.execute({
|
||||||
|
title = "toPipe",
|
||||||
|
filter = "elixirls",
|
||||||
command = "manipulatePipes:serverid",
|
command = "manipulatePipes:serverid",
|
||||||
arguments = { "toPipe", params.textDocument.uri, params.position.line, params.position.character },
|
arguments = { "toPipe", params.textDocument.uri, params.position.line, params.position.character },
|
||||||
})
|
})
|
||||||
|
|
@ -27,6 +29,8 @@ return {
|
||||||
function()
|
function()
|
||||||
local params = vim.lsp.util.make_position_params()
|
local params = vim.lsp.util.make_position_params()
|
||||||
LazyVim.lsp.execute({
|
LazyVim.lsp.execute({
|
||||||
|
title = "fromPipe",
|
||||||
|
filter = "elixirls",
|
||||||
command = "manipulatePipes:serverid",
|
command = "manipulatePipes:serverid",
|
||||||
arguments = { "fromPipe", params.textDocument.uri, params.position.line, params.position.character },
|
arguments = { "fromPipe", params.textDocument.uri, params.position.line, params.position.character },
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ return {
|
||||||
recommended = function()
|
recommended = function()
|
||||||
return LazyVim.extras.wants({
|
return LazyVim.extras.wants({
|
||||||
ft = { "handlebars", "typescript", "javascript", "typescript.glimmer", "javascript.glimmer" },
|
ft = { "handlebars", "typescript", "javascript", "typescript.glimmer", "javascript.glimmer" },
|
||||||
root = { "ember-cli-build.js", ".git" },
|
root = { "ember-cli-build.js" },
|
||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,9 @@ return {
|
||||||
opts = {
|
opts = {
|
||||||
servers = {
|
servers = {
|
||||||
gopls = {
|
gopls = {
|
||||||
|
init_options = {
|
||||||
|
semanticTokens = true,
|
||||||
|
},
|
||||||
settings = {
|
settings = {
|
||||||
gopls = {
|
gopls = {
|
||||||
gofumpt = true,
|
gofumpt = true,
|
||||||
|
|
@ -46,7 +49,6 @@ return {
|
||||||
completeUnimported = true,
|
completeUnimported = true,
|
||||||
staticcheck = true,
|
staticcheck = true,
|
||||||
directoryFilters = { "-.git", "-.vscode", "-.idea", "-.vscode-test", "-node_modules" },
|
directoryFilters = { "-.git", "-.vscode", "-.idea", "-.vscode-test", "-node_modules" },
|
||||||
semanticTokens = true,
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
@ -55,8 +57,13 @@ return {
|
||||||
gopls = function(_, opts)
|
gopls = function(_, opts)
|
||||||
-- workaround for gopls not supporting semanticTokensProvider
|
-- workaround for gopls not supporting semanticTokensProvider
|
||||||
-- https://github.com/golang/go/issues/54531#issuecomment-1464982242
|
-- https://github.com/golang/go/issues/54531#issuecomment-1464982242
|
||||||
LazyVim.lsp.on_attach(function(client, _)
|
Snacks.util.lsp.on({ name = "gopls" }, function(_, client)
|
||||||
if not client.server_capabilities.semanticTokensProvider then
|
if
|
||||||
|
client.config
|
||||||
|
and client.config.init_options
|
||||||
|
and client.config.init_options.semanticTokens
|
||||||
|
and not client.server_capabilities.semanticTokensProvider
|
||||||
|
then
|
||||||
local semantic = client.config.capabilities.textDocument.semanticTokens
|
local semantic = client.config.capabilities.textDocument.semanticTokens
|
||||||
client.server_capabilities.semanticTokensProvider = {
|
client.server_capabilities.semanticTokensProvider = {
|
||||||
full = true,
|
full = true,
|
||||||
|
|
@ -67,7 +74,7 @@ return {
|
||||||
range = true,
|
range = true,
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
end, "gopls")
|
end)
|
||||||
-- end workaround
|
-- end workaround
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -38,30 +38,15 @@ return {
|
||||||
logLevel = "error",
|
logLevel = "error",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
keys = {
|
|
||||||
{
|
|
||||||
"<leader>co",
|
|
||||||
LazyVim.lsp.action["source.organizeImports"],
|
|
||||||
desc = "Organize Imports",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
ruff_lsp = {
|
|
||||||
keys = {
|
|
||||||
{
|
|
||||||
"<leader>co",
|
|
||||||
LazyVim.lsp.action["source.organizeImports"],
|
|
||||||
desc = "Organize Imports",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
|
ruff_lsp = {},
|
||||||
},
|
},
|
||||||
setup = {
|
setup = {
|
||||||
[ruff] = function()
|
[ruff] = function()
|
||||||
LazyVim.lsp.on_attach(function(client, _)
|
Snacks.util.lsp.on({ name = ruff }, function(_, client)
|
||||||
-- Disable hover in favor of Pyright
|
-- Disable hover in favor of Pyright
|
||||||
client.server_capabilities.hoverProvider = false
|
client.server_capabilities.hoverProvider = false
|
||||||
end, ruff)
|
end)
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
@ -114,6 +99,7 @@ return {
|
||||||
opts = {
|
opts = {
|
||||||
options = {
|
options = {
|
||||||
notify_user_on_venv_activation = true,
|
notify_user_on_venv_activation = true,
|
||||||
|
override_notify = false,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
-- Call config for Python files and load the cached venv automatically
|
-- Call config for Python files and load the cached venv automatically
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ return {
|
||||||
recommended = function()
|
recommended = function()
|
||||||
return LazyVim.extras.wants({
|
return LazyVim.extras.wants({
|
||||||
ft = "r",
|
ft = "r",
|
||||||
root = { "*.R", "*.Rmd", "*qmd" },
|
root = { "*.R", "*.Rmd", "*.qmd" },
|
||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -32,12 +32,6 @@ return {
|
||||||
formatters_by_ft = {
|
formatters_by_ft = {
|
||||||
solidity = { "forge_fmt" },
|
solidity = { "forge_fmt" },
|
||||||
},
|
},
|
||||||
formatters = {
|
|
||||||
forge_fmt = {
|
|
||||||
command = "forge",
|
|
||||||
args = { "fmt" },
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -23,15 +23,7 @@ return {
|
||||||
"neovim/nvim-lspconfig",
|
"neovim/nvim-lspconfig",
|
||||||
opts = {
|
opts = {
|
||||||
servers = {
|
servers = {
|
||||||
svelte = {
|
svelte = {},
|
||||||
keys = {
|
|
||||||
{
|
|
||||||
"<leader>co",
|
|
||||||
LazyVim.lsp.action["source.organizeImports"],
|
|
||||||
desc = "Organize Imports",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -1,340 +0,0 @@
|
||||||
return {
|
|
||||||
recommended = function()
|
|
||||||
return LazyVim.extras.wants({
|
|
||||||
ft = {
|
|
||||||
"javascript",
|
|
||||||
"javascriptreact",
|
|
||||||
"javascript.jsx",
|
|
||||||
"typescript",
|
|
||||||
"typescriptreact",
|
|
||||||
"typescript.tsx",
|
|
||||||
},
|
|
||||||
root = { "tsconfig.json", "package.json", "jsconfig.json" },
|
|
||||||
})
|
|
||||||
end,
|
|
||||||
|
|
||||||
-- correctly setup lspconfig
|
|
||||||
{
|
|
||||||
"neovim/nvim-lspconfig",
|
|
||||||
opts = {
|
|
||||||
-- make sure mason installs the server
|
|
||||||
servers = {
|
|
||||||
--- @deprecated -- tsserver renamed to ts_ls but not yet released, so keep this for now
|
|
||||||
--- the proper approach is to check the nvim-lspconfig release version when it's released to determine the server name dynamically
|
|
||||||
tsserver = {
|
|
||||||
enabled = false,
|
|
||||||
},
|
|
||||||
ts_ls = {
|
|
||||||
enabled = false,
|
|
||||||
},
|
|
||||||
vtsls = {
|
|
||||||
-- explicitly add default filetypes, so that we can extend
|
|
||||||
-- them in related extras
|
|
||||||
filetypes = {
|
|
||||||
"javascript",
|
|
||||||
"javascriptreact",
|
|
||||||
"javascript.jsx",
|
|
||||||
"typescript",
|
|
||||||
"typescriptreact",
|
|
||||||
"typescript.tsx",
|
|
||||||
},
|
|
||||||
settings = {
|
|
||||||
complete_function_calls = true,
|
|
||||||
vtsls = {
|
|
||||||
enableMoveToFileCodeAction = true,
|
|
||||||
autoUseWorkspaceTsdk = true,
|
|
||||||
experimental = {
|
|
||||||
maxInlayHintLength = 30,
|
|
||||||
completion = {
|
|
||||||
enableServerSideFuzzyMatch = true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
typescript = {
|
|
||||||
updateImportsOnFileMove = { enabled = "always" },
|
|
||||||
suggest = {
|
|
||||||
completeFunctionCalls = true,
|
|
||||||
},
|
|
||||||
inlayHints = {
|
|
||||||
enumMemberValues = { enabled = true },
|
|
||||||
functionLikeReturnTypes = { enabled = true },
|
|
||||||
parameterNames = { enabled = "literals" },
|
|
||||||
parameterTypes = { enabled = true },
|
|
||||||
propertyDeclarationTypes = { enabled = true },
|
|
||||||
variableTypes = { enabled = false },
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
keys = {
|
|
||||||
{
|
|
||||||
"gD",
|
|
||||||
function()
|
|
||||||
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 },
|
|
||||||
open = true,
|
|
||||||
})
|
|
||||||
end,
|
|
||||||
desc = "Goto Source Definition",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"gR",
|
|
||||||
function()
|
|
||||||
LazyVim.lsp.execute({
|
|
||||||
command = "typescript.findAllFileReferences",
|
|
||||||
arguments = { vim.uri_from_bufnr(0) },
|
|
||||||
open = true,
|
|
||||||
})
|
|
||||||
end,
|
|
||||||
desc = "File References",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"<leader>co",
|
|
||||||
LazyVim.lsp.action["source.organizeImports"],
|
|
||||||
desc = "Organize Imports",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"<leader>cM",
|
|
||||||
LazyVim.lsp.action["source.addMissingImports.ts"],
|
|
||||||
desc = "Add missing imports",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"<leader>cu",
|
|
||||||
LazyVim.lsp.action["source.removeUnused.ts"],
|
|
||||||
desc = "Remove unused imports",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"<leader>cD",
|
|
||||||
LazyVim.lsp.action["source.fixAll.ts"],
|
|
||||||
desc = "Fix all diagnostics",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"<leader>cV",
|
|
||||||
function()
|
|
||||||
LazyVim.lsp.execute({ command = "typescript.selectTypeScriptVersion" })
|
|
||||||
end,
|
|
||||||
desc = "Select TS workspace version",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
setup = {
|
|
||||||
--- @deprecated -- tsserver renamed to ts_ls but not yet released, so keep this for now
|
|
||||||
--- the proper approach is to check the nvim-lspconfig release version when it's released to determine the server name dynamically
|
|
||||||
tsserver = function()
|
|
||||||
-- disable tsserver
|
|
||||||
return true
|
|
||||||
end,
|
|
||||||
ts_ls = function()
|
|
||||||
-- disable tsserver
|
|
||||||
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", {
|
|
||||||
command = command.command,
|
|
||||||
arguments = { action, uri, range, newf },
|
|
||||||
})
|
|
||||||
end
|
|
||||||
|
|
||||||
local fname = vim.uri_to_fname(uri)
|
|
||||||
client:request("workspace/executeCommand", {
|
|
||||||
command = "typescript.tsserverRequest",
|
|
||||||
arguments = {
|
|
||||||
"getMoveToRefactoringFileSuggestions",
|
|
||||||
{
|
|
||||||
file = fname,
|
|
||||||
startLine = range.start.line + 1,
|
|
||||||
startOffset = range.start.character + 1,
|
|
||||||
endLine = range["end"].line + 1,
|
|
||||||
endOffset = range["end"].character + 1,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}, function(_, result)
|
|
||||||
---@type string[]
|
|
||||||
local files = result.body.files
|
|
||||||
table.insert(files, 1, "Enter new path...")
|
|
||||||
vim.ui.select(files, {
|
|
||||||
prompt = "Select move destination:",
|
|
||||||
format_item = function(f)
|
|
||||||
return vim.fn.fnamemodify(f, ":~:.")
|
|
||||||
end,
|
|
||||||
}, function(f)
|
|
||||||
if f and f:find("^Enter new path") then
|
|
||||||
vim.ui.input({
|
|
||||||
prompt = "Enter move destination:",
|
|
||||||
default = vim.fn.fnamemodify(fname, ":h") .. "/",
|
|
||||||
completion = "file",
|
|
||||||
}, function(newf)
|
|
||||||
return newf and move(newf)
|
|
||||||
end)
|
|
||||||
elseif f then
|
|
||||||
move(f)
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
end)
|
|
||||||
end
|
|
||||||
end, "vtsls")
|
|
||||||
-- copy typescript settings to javascript
|
|
||||||
opts.settings.javascript =
|
|
||||||
vim.tbl_deep_extend("force", {}, opts.settings.typescript, opts.settings.javascript or {})
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
"mfussenegger/nvim-dap",
|
|
||||||
optional = true,
|
|
||||||
dependencies = {
|
|
||||||
{
|
|
||||||
"mason-org/mason.nvim",
|
|
||||||
opts = function(_, opts)
|
|
||||||
opts.ensure_installed = opts.ensure_installed or {}
|
|
||||||
table.insert(opts.ensure_installed, "js-debug-adapter")
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
opts = function()
|
|
||||||
local dap = require("dap")
|
|
||||||
|
|
||||||
for _, adapterType in ipairs({ "node", "chrome", "msedge" }) do
|
|
||||||
local pwaType = "pwa-" .. adapterType
|
|
||||||
|
|
||||||
if not dap.adapters[pwaType] then
|
|
||||||
dap.adapters[pwaType] = {
|
|
||||||
type = "server",
|
|
||||||
host = "localhost",
|
|
||||||
port = "${port}",
|
|
||||||
executable = {
|
|
||||||
command = "js-debug-adapter",
|
|
||||||
args = { "${port}" },
|
|
||||||
},
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Define adapters without the "pwa-" prefix for VSCode compatibility
|
|
||||||
if not dap.adapters[adapterType] then
|
|
||||||
dap.adapters[adapterType] = function(cb, config)
|
|
||||||
local nativeAdapter = dap.adapters[pwaType]
|
|
||||||
|
|
||||||
config.type = pwaType
|
|
||||||
|
|
||||||
if type(nativeAdapter) == "function" then
|
|
||||||
nativeAdapter(cb, config)
|
|
||||||
else
|
|
||||||
cb(nativeAdapter)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
local js_filetypes = { "typescript", "javascript", "typescriptreact", "javascriptreact" }
|
|
||||||
|
|
||||||
local vscode = require("dap.ext.vscode")
|
|
||||||
vscode.type_to_filetypes["node"] = js_filetypes
|
|
||||||
vscode.type_to_filetypes["pwa-node"] = js_filetypes
|
|
||||||
|
|
||||||
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",
|
|
||||||
request = "launch",
|
|
||||||
name = "Launch file",
|
|
||||||
program = "${file}",
|
|
||||||
cwd = "${workspaceFolder}",
|
|
||||||
sourceMaps = true,
|
|
||||||
runtimeExecutable = runtimeExecutable,
|
|
||||||
skipFiles = {
|
|
||||||
"<node_internals>/**",
|
|
||||||
"node_modules/**",
|
|
||||||
},
|
|
||||||
resolveSourceMapLocations = {
|
|
||||||
"${workspaceFolder}/**",
|
|
||||||
"!**/node_modules/**",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type = "pwa-node",
|
|
||||||
request = "attach",
|
|
||||||
name = "Attach",
|
|
||||||
processId = require("dap.utils").pick_process,
|
|
||||||
cwd = "${workspaceFolder}",
|
|
||||||
sourceMaps = true,
|
|
||||||
runtimeExecutable = runtimeExecutable,
|
|
||||||
skipFiles = {
|
|
||||||
"<node_internals>/**",
|
|
||||||
"node_modules/**",
|
|
||||||
},
|
|
||||||
resolveSourceMapLocations = {
|
|
||||||
"${workspaceFolder}/**",
|
|
||||||
"!**/node_modules/**",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
"jay-babu/mason-nvim-dap.nvim",
|
|
||||||
optional = true,
|
|
||||||
opts = {
|
|
||||||
-- chrome adapter is deprecated, use js-debug-adapter instead
|
|
||||||
automatic_installation = { exclude = { "chrome" } },
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
-- Filetype icons
|
|
||||||
{
|
|
||||||
"nvim-mini/mini.icons",
|
|
||||||
opts = {
|
|
||||||
file = {
|
|
||||||
[".eslintrc.js"] = { glyph = "", hl = "MiniIconsYellow" },
|
|
||||||
[".node-version"] = { glyph = "", hl = "MiniIconsGreen" },
|
|
||||||
[".prettierrc"] = { glyph = "", hl = "MiniIconsPurple" },
|
|
||||||
[".yarnrc.yml"] = { glyph = "", hl = "MiniIconsBlue" },
|
|
||||||
["eslint.config.js"] = { glyph = "", hl = "MiniIconsYellow" },
|
|
||||||
["package.json"] = { glyph = "", hl = "MiniIconsGreen" },
|
|
||||||
["tsconfig.json"] = { glyph = "", hl = "MiniIconsAzure" },
|
|
||||||
["tsconfig.build.json"] = { glyph = "", hl = "MiniIconsAzure" },
|
|
||||||
["yarn.lock"] = { glyph = "", hl = "MiniIconsBlue" },
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
@ -1,3 +1,5 @@
|
||||||
|
---@module "conform"
|
||||||
|
|
||||||
---@diagnostic disable: inject-field
|
---@diagnostic disable: inject-field
|
||||||
if lazyvim_docs then
|
if lazyvim_docs then
|
||||||
-- Enable this option to avoid conflicts with Prettier.
|
-- Enable this option to avoid conflicts with Prettier.
|
||||||
|
|
@ -8,6 +10,7 @@ end
|
||||||
local supported = {
|
local supported = {
|
||||||
"astro",
|
"astro",
|
||||||
"css",
|
"css",
|
||||||
|
"scss",
|
||||||
"graphql",
|
"graphql",
|
||||||
-- "html",
|
-- "html",
|
||||||
"javascript",
|
"javascript",
|
||||||
|
|
@ -23,24 +26,35 @@ local supported = {
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
recommended = function()
|
||||||
|
return LazyVim.extras.wants({
|
||||||
|
root = { "biome.json", "biome.jsonc" },
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
|
||||||
{
|
{
|
||||||
"mason-org/mason.nvim",
|
"neovim/nvim-lspconfig",
|
||||||
opts = { ensure_installed = { "biome" } },
|
opts = {
|
||||||
|
servers = {
|
||||||
|
---@type lspconfig.settings.biome
|
||||||
|
biome = {},
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
"stevearc/conform.nvim",
|
"stevearc/conform.nvim",
|
||||||
optional = true,
|
optional = true,
|
||||||
---@param opts ConformOpts
|
---@param opts conform.setupOpts
|
||||||
opts = function(_, opts)
|
opts = function(_, opts)
|
||||||
opts.formatters_by_ft = opts.formatters_by_ft or {}
|
opts.formatters_by_ft = opts.formatters_by_ft or {}
|
||||||
for _, ft in ipairs(supported) do
|
for _, ft in ipairs(supported) do
|
||||||
opts.formatters_by_ft[ft] = opts.formatters_by_ft[ft] or {}
|
opts.formatters_by_ft[ft] = opts.formatters_by_ft[ft] or {}
|
||||||
table.insert(opts.formatters_by_ft[ft], "biome")
|
table.insert(opts.formatters_by_ft[ft], "biome-check")
|
||||||
end
|
end
|
||||||
|
|
||||||
opts.formatters = opts.formatters or {}
|
opts.formatters = opts.formatters or {}
|
||||||
opts.formatters.biome = {
|
opts.formatters["biome-check"] = {
|
||||||
require_cwd = true,
|
require_cwd = true,
|
||||||
}
|
}
|
||||||
end,
|
end,
|
||||||
171
lua/lazyvim/plugins/extras/lang/typescript/init.lua
Normal file
171
lua/lazyvim/plugins/extras/lang/typescript/init.lua
Normal file
|
|
@ -0,0 +1,171 @@
|
||||||
|
if lazyvim_docs then
|
||||||
|
-- LSP Server to use for TypeScript.
|
||||||
|
---@type "vtsls" | "tsgo"
|
||||||
|
vim.g.lazyvim_ts_lsp = "vtsls" -- currently the default
|
||||||
|
|
||||||
|
-- To use the newer, much faster `tsgo` LSP server, either:
|
||||||
|
-- * enable the `tsgo` extra, or
|
||||||
|
-- * set `vim.g.lazyvim_ts_lsp = "tsgo"` in your `options.lua`
|
||||||
|
end
|
||||||
|
|
||||||
|
local extra = LazyVim.config.register_defaults("ts_lsp", {
|
||||||
|
{ name = "vtsls", extra = "lang.typescript.vtsls" },
|
||||||
|
{ name = "tsgo", extra = "lang.typescript.tsgo" },
|
||||||
|
})
|
||||||
|
|
||||||
|
return {
|
||||||
|
recommended = function()
|
||||||
|
return LazyVim.extras.wants({
|
||||||
|
ft = {
|
||||||
|
"javascript",
|
||||||
|
"javascriptreact",
|
||||||
|
"javascript.jsx",
|
||||||
|
"typescript",
|
||||||
|
"typescriptreact",
|
||||||
|
"typescript.tsx",
|
||||||
|
},
|
||||||
|
root = { "tsconfig.json", "package.json", "jsconfig.json" },
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
|
||||||
|
{ import = extra.import },
|
||||||
|
|
||||||
|
-- correctly setup lspconfig
|
||||||
|
{
|
||||||
|
"neovim/nvim-lspconfig",
|
||||||
|
opts = function(_, opts)
|
||||||
|
local lsp = extra.name or "vtsls"
|
||||||
|
local servers = { "tsserver", "ts_ls", "vtsls", "tsgo", lsp }
|
||||||
|
for _, server in ipairs(servers) do
|
||||||
|
opts.servers[server] = opts.servers[server] or {}
|
||||||
|
opts.servers[server].enabled = server == lsp
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
"mfussenegger/nvim-dap",
|
||||||
|
optional = true,
|
||||||
|
dependencies = {
|
||||||
|
{
|
||||||
|
"mason-org/mason.nvim",
|
||||||
|
opts = function(_, opts)
|
||||||
|
opts.ensure_installed = opts.ensure_installed or {}
|
||||||
|
table.insert(opts.ensure_installed, "js-debug-adapter")
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
opts = function()
|
||||||
|
local dap = require("dap")
|
||||||
|
|
||||||
|
for _, adapterType in ipairs({ "node", "chrome", "msedge" }) do
|
||||||
|
local pwaType = "pwa-" .. adapterType
|
||||||
|
|
||||||
|
if not dap.adapters[pwaType] then
|
||||||
|
dap.adapters[pwaType] = {
|
||||||
|
type = "server",
|
||||||
|
host = "localhost",
|
||||||
|
port = "${port}",
|
||||||
|
executable = {
|
||||||
|
command = "js-debug-adapter",
|
||||||
|
args = { "${port}" },
|
||||||
|
},
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Define adapters without the "pwa-" prefix for VSCode compatibility
|
||||||
|
if not dap.adapters[adapterType] then
|
||||||
|
dap.adapters[adapterType] = function(cb, config)
|
||||||
|
local nativeAdapter = dap.adapters[pwaType]
|
||||||
|
|
||||||
|
config.type = pwaType
|
||||||
|
|
||||||
|
if type(nativeAdapter) == "function" then
|
||||||
|
nativeAdapter(cb, config)
|
||||||
|
else
|
||||||
|
cb(nativeAdapter)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local js_filetypes = { "typescript", "javascript", "typescriptreact", "javascriptreact" }
|
||||||
|
|
||||||
|
local vscode = require("dap.ext.vscode")
|
||||||
|
vscode.type_to_filetypes["node"] = js_filetypes
|
||||||
|
vscode.type_to_filetypes["pwa-node"] = js_filetypes
|
||||||
|
|
||||||
|
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",
|
||||||
|
request = "launch",
|
||||||
|
name = "Launch file",
|
||||||
|
program = "${file}",
|
||||||
|
cwd = "${workspaceFolder}",
|
||||||
|
sourceMaps = true,
|
||||||
|
runtimeExecutable = runtimeExecutable,
|
||||||
|
skipFiles = {
|
||||||
|
"<node_internals>/**",
|
||||||
|
"node_modules/**",
|
||||||
|
},
|
||||||
|
resolveSourceMapLocations = {
|
||||||
|
"${workspaceFolder}/**",
|
||||||
|
"!**/node_modules/**",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type = "pwa-node",
|
||||||
|
request = "attach",
|
||||||
|
name = "Attach",
|
||||||
|
processId = require("dap.utils").pick_process,
|
||||||
|
cwd = "${workspaceFolder}",
|
||||||
|
sourceMaps = true,
|
||||||
|
runtimeExecutable = runtimeExecutable,
|
||||||
|
skipFiles = {
|
||||||
|
"<node_internals>/**",
|
||||||
|
"node_modules/**",
|
||||||
|
},
|
||||||
|
resolveSourceMapLocations = {
|
||||||
|
"${workspaceFolder}/**",
|
||||||
|
"!**/node_modules/**",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
"jay-babu/mason-nvim-dap.nvim",
|
||||||
|
optional = true,
|
||||||
|
opts = {
|
||||||
|
-- chrome adapter is deprecated, use js-debug-adapter instead
|
||||||
|
automatic_installation = { exclude = { "chrome" } },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
-- Filetype icons
|
||||||
|
{
|
||||||
|
"nvim-mini/mini.icons",
|
||||||
|
opts = {
|
||||||
|
file = {
|
||||||
|
[".eslintrc.js"] = { glyph = "", hl = "MiniIconsYellow" },
|
||||||
|
[".node-version"] = { glyph = "", hl = "MiniIconsGreen" },
|
||||||
|
[".prettierrc"] = { glyph = "", hl = "MiniIconsPurple" },
|
||||||
|
[".yarnrc.yml"] = { glyph = "", hl = "MiniIconsBlue" },
|
||||||
|
["eslint.config.js"] = { glyph = "", hl = "MiniIconsYellow" },
|
||||||
|
["package.json"] = { glyph = "", hl = "MiniIconsGreen" },
|
||||||
|
["tsconfig.json"] = { glyph = "", hl = "MiniIconsAzure" },
|
||||||
|
["tsconfig.build.json"] = { glyph = "", hl = "MiniIconsAzure" },
|
||||||
|
["yarn.lock"] = { glyph = "", hl = "MiniIconsBlue" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
68
lua/lazyvim/plugins/extras/lang/typescript/oxc.lua
Normal file
68
lua/lazyvim/plugins/extras/lang/typescript/oxc.lua
Normal file
|
|
@ -0,0 +1,68 @@
|
||||||
|
local supported = {
|
||||||
|
"javascript",
|
||||||
|
"javascriptreact",
|
||||||
|
"typescript",
|
||||||
|
"typescriptreact",
|
||||||
|
"json",
|
||||||
|
"jsonc",
|
||||||
|
"vue",
|
||||||
|
"svelte",
|
||||||
|
"astro",
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
recommended = function()
|
||||||
|
return LazyVim.extras.wants({
|
||||||
|
root = {
|
||||||
|
".oxlintrc.json",
|
||||||
|
".oxlintrc.jsonc",
|
||||||
|
"oxlint.config.ts",
|
||||||
|
".oxfmtrc.json",
|
||||||
|
".oxfmtrc.jsonc",
|
||||||
|
"oxfmt.config.ts",
|
||||||
|
},
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
|
||||||
|
{
|
||||||
|
"neovim/nvim-lspconfig",
|
||||||
|
opts = {
|
||||||
|
servers = {
|
||||||
|
---@type lspconfig.settings.oxlint
|
||||||
|
oxlint = {
|
||||||
|
root_dir = function(bufnr, on_dir)
|
||||||
|
-- prefer the top-level oxlint config if it exists (monorepo support)
|
||||||
|
local git = vim.fs.root(bufnr, ".git")
|
||||||
|
local markers = { ".oxlintrc.json", ".oxlintrc.jsonc", "oxlint.config.ts" }
|
||||||
|
local root = git and vim.fs.root(git, markers) or vim.fs.root(bufnr, markers)
|
||||||
|
if root then
|
||||||
|
on_dir(root)
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
settings = {
|
||||||
|
fixKind = "all",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
--- disable the oxfmt lsp server since we use conform for formatting
|
||||||
|
oxfmt = { enabled = false },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
"mason-org/mason.nvim",
|
||||||
|
opts = { ensure_installed = { "oxfmt" } },
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
"stevearc/conform.nvim",
|
||||||
|
optional = true,
|
||||||
|
opts = function(_, opts)
|
||||||
|
opts.formatters_by_ft = opts.formatters_by_ft or {}
|
||||||
|
for _, ft in ipairs(supported) do
|
||||||
|
opts.formatters_by_ft[ft] = opts.formatters_by_ft[ft] or {}
|
||||||
|
table.insert(opts.formatters_by_ft[ft], "oxfmt")
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
}
|
||||||
58
lua/lazyvim/plugins/extras/lang/typescript/tsgo.lua
Normal file
58
lua/lazyvim/plugins/extras/lang/typescript/tsgo.lua
Normal file
|
|
@ -0,0 +1,58 @@
|
||||||
|
return {
|
||||||
|
recommended = function()
|
||||||
|
return LazyVim.extras.wants({
|
||||||
|
ft = {
|
||||||
|
"javascript",
|
||||||
|
"javascriptreact",
|
||||||
|
"javascript.jsx",
|
||||||
|
"typescript",
|
||||||
|
"typescriptreact",
|
||||||
|
"typescript.tsx",
|
||||||
|
},
|
||||||
|
root = { "tsconfig.json", "package.json", "jsconfig.json" },
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
|
||||||
|
-- correctly setup lspconfig
|
||||||
|
{
|
||||||
|
"neovim/nvim-lspconfig",
|
||||||
|
opts = {
|
||||||
|
-- make sure mason installs the server
|
||||||
|
servers = {
|
||||||
|
---@type lspconfig.settings.tsgo
|
||||||
|
tsgo = {
|
||||||
|
-- explicitly add default filetypes, so that we can extend
|
||||||
|
-- them in related extras
|
||||||
|
filetypes = {
|
||||||
|
"javascript",
|
||||||
|
"javascriptreact",
|
||||||
|
"javascript.jsx",
|
||||||
|
"typescript",
|
||||||
|
"typescriptreact",
|
||||||
|
"typescript.tsx",
|
||||||
|
},
|
||||||
|
settings = {
|
||||||
|
typescript = {
|
||||||
|
inlayHints = {
|
||||||
|
enumMemberValues = { enabled = true },
|
||||||
|
functionLikeReturnTypes = { enabled = false },
|
||||||
|
parameterNames = {
|
||||||
|
enabled = "literals",
|
||||||
|
suppressWhenArgumentMatchesName = true,
|
||||||
|
},
|
||||||
|
parameterTypes = { enabled = true },
|
||||||
|
propertyDeclarationTypes = { enabled = true },
|
||||||
|
variableTypes = { enabled = false },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
-- correctly setup lspconfig
|
||||||
|
{
|
||||||
|
"neovim/nvim-lspconfig",
|
||||||
|
opts = {},
|
||||||
|
},
|
||||||
|
}
|
||||||
174
lua/lazyvim/plugins/extras/lang/typescript/vtsls.lua
Normal file
174
lua/lazyvim/plugins/extras/lang/typescript/vtsls.lua
Normal file
|
|
@ -0,0 +1,174 @@
|
||||||
|
return {
|
||||||
|
recommended = function()
|
||||||
|
return LazyVim.extras.wants({
|
||||||
|
ft = {
|
||||||
|
"javascript",
|
||||||
|
"javascriptreact",
|
||||||
|
"javascript.jsx",
|
||||||
|
"typescript",
|
||||||
|
"typescriptreact",
|
||||||
|
"typescript.tsx",
|
||||||
|
},
|
||||||
|
root = { "tsconfig.json", "package.json", "jsconfig.json" },
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
|
||||||
|
-- correctly setup lspconfig
|
||||||
|
{
|
||||||
|
"neovim/nvim-lspconfig",
|
||||||
|
opts = {
|
||||||
|
-- make sure mason installs the server
|
||||||
|
servers = {
|
||||||
|
vtsls = {
|
||||||
|
-- explicitly add default filetypes, so that we can extend
|
||||||
|
-- them in related extras
|
||||||
|
filetypes = {
|
||||||
|
"javascript",
|
||||||
|
"javascriptreact",
|
||||||
|
"javascript.jsx",
|
||||||
|
"typescript",
|
||||||
|
"typescriptreact",
|
||||||
|
"typescript.tsx",
|
||||||
|
},
|
||||||
|
settings = {
|
||||||
|
complete_function_calls = true,
|
||||||
|
vtsls = {
|
||||||
|
enableMoveToFileCodeAction = true,
|
||||||
|
autoUseWorkspaceTsdk = true,
|
||||||
|
experimental = {
|
||||||
|
maxInlayHintLength = 30,
|
||||||
|
completion = {
|
||||||
|
enableServerSideFuzzyMatch = true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
typescript = {
|
||||||
|
updateImportsOnFileMove = { enabled = "always" },
|
||||||
|
suggest = {
|
||||||
|
completeFunctionCalls = true,
|
||||||
|
},
|
||||||
|
inlayHints = {
|
||||||
|
enumMemberValues = { enabled = true },
|
||||||
|
functionLikeReturnTypes = { enabled = true },
|
||||||
|
parameterNames = { enabled = "literals" },
|
||||||
|
parameterTypes = { enabled = true },
|
||||||
|
propertyDeclarationTypes = { enabled = true },
|
||||||
|
variableTypes = { enabled = false },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
keys = {
|
||||||
|
{
|
||||||
|
"gD",
|
||||||
|
function()
|
||||||
|
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 },
|
||||||
|
open = true,
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
desc = "Goto Source Definition",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"gR",
|
||||||
|
function()
|
||||||
|
LazyVim.lsp.execute({
|
||||||
|
command = "typescript.findAllFileReferences",
|
||||||
|
arguments = { vim.uri_from_bufnr(0) },
|
||||||
|
open = true,
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
desc = "File References",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"<leader>cM",
|
||||||
|
LazyVim.lsp.action["source.addMissingImports.ts"],
|
||||||
|
desc = "Add missing imports",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"<leader>cD",
|
||||||
|
LazyVim.lsp.action["source.fixAll.ts"],
|
||||||
|
desc = "Fix all diagnostics",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"<leader>cV",
|
||||||
|
function()
|
||||||
|
LazyVim.lsp.execute({
|
||||||
|
title = "Select TypeScript Version",
|
||||||
|
filter = "vtsls",
|
||||||
|
command = "typescript.selectTypeScriptVersion",
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
desc = "Select TS workspace version",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
setup = {
|
||||||
|
vtsls = function(_, opts)
|
||||||
|
Snacks.util.lsp.on({ name = "vtsls" }, function(buffer, client)
|
||||||
|
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", {
|
||||||
|
command = command.command,
|
||||||
|
arguments = { action, uri, range, newf },
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
local fname = vim.uri_to_fname(uri)
|
||||||
|
client:request("workspace/executeCommand", {
|
||||||
|
command = "typescript.tsserverRequest",
|
||||||
|
arguments = {
|
||||||
|
"getMoveToRefactoringFileSuggestions",
|
||||||
|
{
|
||||||
|
file = fname,
|
||||||
|
startLine = range.start.line + 1,
|
||||||
|
startOffset = range.start.character + 1,
|
||||||
|
endLine = range["end"].line + 1,
|
||||||
|
endOffset = range["end"].character + 1,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}, function(_, result)
|
||||||
|
---@type string[]
|
||||||
|
local files = result.body.files
|
||||||
|
table.insert(files, 1, "Enter new path...")
|
||||||
|
vim.ui.select(files, {
|
||||||
|
prompt = "Select move destination:",
|
||||||
|
format_item = function(f)
|
||||||
|
return vim.fn.fnamemodify(f, ":~:.")
|
||||||
|
end,
|
||||||
|
}, function(f)
|
||||||
|
if f and f:find("^Enter new path") then
|
||||||
|
vim.ui.input({
|
||||||
|
prompt = "Enter move destination:",
|
||||||
|
default = vim.fn.fnamemodify(fname, ":h") .. "/",
|
||||||
|
completion = "file",
|
||||||
|
}, function(newf)
|
||||||
|
return newf and move(newf)
|
||||||
|
end)
|
||||||
|
elseif f then
|
||||||
|
move(f)
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
-- copy typescript settings to javascript
|
||||||
|
opts.settings.javascript =
|
||||||
|
vim.tbl_deep_extend("force", {}, opts.settings.typescript, opts.settings.javascript or {})
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
-- correctly setup lspconfig
|
||||||
|
{
|
||||||
|
"neovim/nvim-lspconfig",
|
||||||
|
opts = {},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
@ -24,6 +24,8 @@ return {
|
||||||
local buf_name = vim.api.nvim_buf_get_name(0)
|
local buf_name = vim.api.nvim_buf_get_name(0)
|
||||||
local file_name = vim.fn.fnamemodify(buf_name, ":t")
|
local file_name = vim.fn.fnamemodify(buf_name, ":t")
|
||||||
LazyVim.lsp.execute({
|
LazyVim.lsp.execute({
|
||||||
|
title = "Pin Main",
|
||||||
|
filter = "tinymist",
|
||||||
command = "tinymist.pinMain",
|
command = "tinymist.pinMain",
|
||||||
arguments = { buf_name },
|
arguments = { buf_name },
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -55,7 +55,7 @@ return {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
-- disable snacks scroll when mini-indentscope is enabled
|
-- disable snacks scope when mini-indentscope is enabled
|
||||||
{
|
{
|
||||||
"snacks.nvim",
|
"snacks.nvim",
|
||||||
opts = {
|
opts = {
|
||||||
|
|
|
||||||
|
|
@ -5,10 +5,15 @@ local pick_chezmoi = function()
|
||||||
local fzf_lua = require("fzf-lua")
|
local fzf_lua = require("fzf-lua")
|
||||||
local actions = {
|
local actions = {
|
||||||
["enter"] = function(selected)
|
["enter"] = function(selected)
|
||||||
fzf_lua.actions.vimcmd_entry("ChezmoiEdit", selected, { cwd = os.getenv("HOME") })
|
fzf_lua.actions.vimcmd_entry("ChezmoiEdit", selected, { cwd = vim.env.HOME })
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
fzf_lua.files({ cmd = "chezmoi managed --include=files,symlinks", actions = actions, hidden = false })
|
fzf_lua.files({
|
||||||
|
cmd = "chezmoi managed --include=files,symlinks",
|
||||||
|
actions = actions,
|
||||||
|
cwd = vim.env.HOME,
|
||||||
|
hidden = false,
|
||||||
|
})
|
||||||
elseif LazyVim.pick.picker.name == "snacks" then
|
elseif LazyVim.pick.picker.name == "snacks" then
|
||||||
local results = require("chezmoi.commands").list({
|
local results = require("chezmoi.commands").list({
|
||||||
args = {
|
args = {
|
||||||
|
|
@ -50,7 +55,7 @@ return {
|
||||||
"alker0/chezmoi.vim",
|
"alker0/chezmoi.vim",
|
||||||
init = function()
|
init = function()
|
||||||
vim.g["chezmoi#use_tmp_buffer"] = 1
|
vim.g["chezmoi#use_tmp_buffer"] = 1
|
||||||
vim.g["chezmoi#source_dir_path"] = os.getenv("HOME") .. "/.local/share/chezmoi"
|
vim.g["chezmoi#source_dir_path"] = vim.env.HOME .. "/.local/share/chezmoi"
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
@ -80,7 +85,7 @@ return {
|
||||||
init = function()
|
init = function()
|
||||||
-- run chezmoi edit on file enter
|
-- run chezmoi edit on file enter
|
||||||
vim.api.nvim_create_autocmd({ "BufRead", "BufNewFile" }, {
|
vim.api.nvim_create_autocmd({ "BufRead", "BufNewFile" }, {
|
||||||
pattern = { os.getenv("HOME") .. "/.local/share/chezmoi/*" },
|
pattern = { vim.env.HOME .. "/.local/share/chezmoi/*" },
|
||||||
callback = function()
|
callback = function()
|
||||||
vim.schedule(require("chezmoi.commands.__edit").watch)
|
vim.schedule(require("chezmoi.commands.__edit").watch)
|
||||||
end,
|
end,
|
||||||
|
|
|
||||||
|
|
@ -39,6 +39,9 @@ M.plugin = {
|
||||||
group = function(_, _, data)
|
group = function(_, _, data)
|
||||||
---@type string
|
---@type string
|
||||||
local match = data.full_match
|
local match = data.full_match
|
||||||
|
if match == "#add" then
|
||||||
|
return
|
||||||
|
end
|
||||||
local r, g, b = match:sub(2, 2), match:sub(3, 3), match:sub(4, 4)
|
local r, g, b = match:sub(2, 2), match:sub(3, 3), match:sub(4, 4)
|
||||||
local hex_color = "#" .. r .. r .. g .. g .. b .. b
|
local hex_color = "#" .. r .. r .. g .. g .. b .. b
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,16 @@ return {
|
||||||
-- depends on the git extra for highlighting and auto-completion of github issues/prs
|
-- depends on the git extra for highlighting and auto-completion of github issues/prs
|
||||||
{ import = "lazyvim.plugins.extras.lang.git" },
|
{ import = "lazyvim.plugins.extras.lang.git" },
|
||||||
|
|
||||||
|
{
|
||||||
|
"folke/snacks.nvim",
|
||||||
|
keys = { -- disable conflicting keymaps
|
||||||
|
{ "<leader>gi", false },
|
||||||
|
{ "<leader>gI", false },
|
||||||
|
{ "<leader>gp", false },
|
||||||
|
{ "<leader>gP", false },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
-- Octo
|
-- Octo
|
||||||
{
|
{
|
||||||
"pwntester/octo.nvim",
|
"pwntester/octo.nvim",
|
||||||
|
|
|
||||||
|
|
@ -7,14 +7,6 @@ if vim.fn.has("nvim-0.11.2") == 0 then
|
||||||
vim.fn.getchar()
|
vim.fn.getchar()
|
||||||
vim.cmd([[quit]])
|
vim.cmd([[quit]])
|
||||||
return {}
|
return {}
|
||||||
elseif not vim.lsp.is_enabled then
|
|
||||||
vim.schedule(function()
|
|
||||||
LazyVim.warn({
|
|
||||||
"You're using an **old** `nightly` version of **Neovim**",
|
|
||||||
"Please update to a recent `nightly`,",
|
|
||||||
"or a stable version (`>= 0.11.2`).",
|
|
||||||
})
|
|
||||||
end)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
require("lazyvim.config").init()
|
require("lazyvim.config").init()
|
||||||
|
|
|
||||||
|
|
@ -2,11 +2,12 @@ return {
|
||||||
-- lspconfig
|
-- lspconfig
|
||||||
{
|
{
|
||||||
"neovim/nvim-lspconfig",
|
"neovim/nvim-lspconfig",
|
||||||
event = "LazyFile",
|
event = { "BufReadPre", "BufNewFile" },
|
||||||
dependencies = {
|
dependencies = {
|
||||||
"mason.nvim",
|
"mason.nvim",
|
||||||
{ "mason-org/mason-lspconfig.nvim", config = function() end },
|
{ "mason-org/mason-lspconfig.nvim", config = function() end },
|
||||||
},
|
},
|
||||||
|
opts_extend = { "servers.*.keys" },
|
||||||
opts = function()
|
opts = function()
|
||||||
---@class PluginLspOpts
|
---@class PluginLspOpts
|
||||||
local ret = {
|
local ret = {
|
||||||
|
|
@ -51,15 +52,6 @@ return {
|
||||||
folds = {
|
folds = {
|
||||||
enabled = true,
|
enabled = true,
|
||||||
},
|
},
|
||||||
-- add any global capabilities here
|
|
||||||
capabilities = {
|
|
||||||
workspace = {
|
|
||||||
fileOperations = {
|
|
||||||
didRename = true,
|
|
||||||
willRename = true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
-- options for vim.lsp.buf.format
|
-- options for vim.lsp.buf.format
|
||||||
-- `bufnr` and `filter` is handled by the LazyVim formatter,
|
-- `bufnr` and `filter` is handled by the LazyVim formatter,
|
||||||
-- but can be also overridden when specified
|
-- but can be also overridden when specified
|
||||||
|
|
@ -68,9 +60,59 @@ return {
|
||||||
timeout_ms = nil,
|
timeout_ms = nil,
|
||||||
},
|
},
|
||||||
-- LSP Server Settings
|
-- LSP Server Settings
|
||||||
---@alias lazyvim.lsp.Config vim.lsp.Config|{mason?:boolean, enabled?:boolean}
|
-- Sets the default configuration for an LSP client (or all clients if the special name "*" is used).
|
||||||
|
---@alias lazyvim.lsp.Config vim.lsp.Config|{mason?:boolean, enabled?:boolean, keys?:LazyKeysLspSpec[]}
|
||||||
---@type table<string, lazyvim.lsp.Config|boolean>
|
---@type table<string, lazyvim.lsp.Config|boolean>
|
||||||
servers = {
|
servers = {
|
||||||
|
-- configuration for all lsp servers
|
||||||
|
["*"] = {
|
||||||
|
capabilities = {
|
||||||
|
workspace = {
|
||||||
|
fileOperations = {
|
||||||
|
didRename = true,
|
||||||
|
willRename = true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
-- stylua: ignore
|
||||||
|
keys = {
|
||||||
|
{ "<leader>cl", function() Snacks.picker.lsp_config() end, desc = "Lsp Info" },
|
||||||
|
{ "gd", vim.lsp.buf.definition, desc = "Goto Definition", has = "definition" },
|
||||||
|
{ "gr", vim.lsp.buf.references, desc = "References", nowait = true },
|
||||||
|
{ "gI", vim.lsp.buf.implementation, desc = "Goto Implementation" },
|
||||||
|
{ "gy", vim.lsp.buf.type_definition, desc = "Goto T[y]pe Definition" },
|
||||||
|
{ "gD", vim.lsp.buf.declaration, desc = "Goto Declaration" },
|
||||||
|
{ "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", "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" },
|
||||||
|
{ "<leader>cA", LazyVim.lsp.action.source, desc = "Source Action", has = "codeAction" },
|
||||||
|
{ "]]", function() Snacks.words.jump(vim.v.count1) end, has = "documentHighlight",
|
||||||
|
desc = "Next Reference", enabled = function() return Snacks.words.is_enabled() end },
|
||||||
|
{ "[[", function() Snacks.words.jump(-vim.v.count1) end, has = "documentHighlight",
|
||||||
|
desc = "Prev Reference", enabled = function() return Snacks.words.is_enabled() end },
|
||||||
|
{ "<a-n>", function() Snacks.words.jump(vim.v.count1, true) end, has = "documentHighlight",
|
||||||
|
desc = "Next Reference", enabled = function() return Snacks.words.is_enabled() end },
|
||||||
|
{ "<a-p>", function() Snacks.words.jump(-vim.v.count1, true) end, has = "documentHighlight",
|
||||||
|
desc = "Prev Reference", enabled = function() return Snacks.words.is_enabled() end },
|
||||||
|
{
|
||||||
|
"<leader>co",
|
||||||
|
LazyVim.lsp.action["source.organizeImports"],
|
||||||
|
desc = "Organize Imports",
|
||||||
|
has = "codeAction",
|
||||||
|
enabled = function(buf)
|
||||||
|
local code_actions = vim.tbl_filter(function(action)
|
||||||
|
return action:find("^source%.organizeImports%.?$")
|
||||||
|
end, LazyVim.lsp.code_actions({ bufnr = buf }))
|
||||||
|
return #code_actions > 0
|
||||||
|
end
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
stylua = { enabled = false },
|
stylua = { enabled = false },
|
||||||
lua_ls = {
|
lua_ls = {
|
||||||
-- mason = false, -- set to false if you don't want this server to be installed with mason
|
-- mason = false, -- set to false if you don't want this server to be installed with mason
|
||||||
|
|
@ -120,21 +162,23 @@ return {
|
||||||
return ret
|
return ret
|
||||||
end,
|
end,
|
||||||
---@param opts PluginLspOpts
|
---@param opts PluginLspOpts
|
||||||
config = vim.schedule_wrap(function(_, opts)
|
config = function(_, opts)
|
||||||
-- setup autoformat
|
-- setup autoformat
|
||||||
LazyVim.format.register(LazyVim.lsp.formatter())
|
LazyVim.format.register(LazyVim.lsp.formatter())
|
||||||
|
|
||||||
-- setup keymaps
|
-- setup keymaps
|
||||||
LazyVim.lsp.on_attach(function(client, buffer)
|
local names = vim.tbl_keys(opts.servers) ---@type string[]
|
||||||
require("lazyvim.plugins.lsp.keymaps").on_attach(client, buffer)
|
table.sort(names)
|
||||||
end)
|
for _, server in ipairs(names) do
|
||||||
|
local server_opts = opts.servers[server]
|
||||||
LazyVim.lsp.setup()
|
if type(server_opts) == "table" and server_opts.keys then
|
||||||
LazyVim.lsp.on_dynamic_capability(require("lazyvim.plugins.lsp.keymaps").on_attach)
|
require("lazyvim.plugins.lsp.keymaps").set({ name = server ~= "*" and server or nil }, server_opts.keys)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
-- inlay hints
|
-- inlay hints
|
||||||
if opts.inlay_hints.enabled then
|
if opts.inlay_hints.enabled then
|
||||||
LazyVim.lsp.on_supports_method("textDocument/inlayHint", function(client, buffer)
|
Snacks.util.lsp.on({ method = "textDocument/inlayHint" }, function(buffer)
|
||||||
if
|
if
|
||||||
vim.api.nvim_buf_is_valid(buffer)
|
vim.api.nvim_buf_is_valid(buffer)
|
||||||
and vim.bo[buffer].buftype == ""
|
and vim.bo[buffer].buftype == ""
|
||||||
|
|
@ -147,7 +191,7 @@ return {
|
||||||
|
|
||||||
-- folds
|
-- folds
|
||||||
if opts.folds.enabled then
|
if opts.folds.enabled then
|
||||||
LazyVim.lsp.on_supports_method("textDocument/foldingRange", function(client, buffer)
|
Snacks.util.lsp.on({ method = "textDocument/foldingRange" }, function()
|
||||||
if LazyVim.set_default("foldmethod", "expr") then
|
if LazyVim.set_default("foldmethod", "expr") then
|
||||||
LazyVim.set_default("foldexpr", "v:lua.vim.lsp.foldexpr()")
|
LazyVim.set_default("foldexpr", "v:lua.vim.lsp.foldexpr()")
|
||||||
end
|
end
|
||||||
|
|
@ -156,7 +200,7 @@ return {
|
||||||
|
|
||||||
-- code lens
|
-- code lens
|
||||||
if opts.codelens.enabled and vim.lsp.codelens then
|
if opts.codelens.enabled and vim.lsp.codelens then
|
||||||
LazyVim.lsp.on_supports_method("textDocument/codeLens", function(client, buffer)
|
Snacks.util.lsp.on({ method = "textDocument/codeLens" }, function(buffer)
|
||||||
vim.lsp.codelens.refresh()
|
vim.lsp.codelens.refresh()
|
||||||
vim.api.nvim_create_autocmd({ "BufEnter", "CursorHold", "InsertLeave" }, {
|
vim.api.nvim_create_autocmd({ "BufEnter", "CursorHold", "InsertLeave" }, {
|
||||||
buffer = buffer,
|
buffer = buffer,
|
||||||
|
|
@ -180,7 +224,14 @@ return {
|
||||||
vim.diagnostic.config(vim.deepcopy(opts.diagnostics))
|
vim.diagnostic.config(vim.deepcopy(opts.diagnostics))
|
||||||
|
|
||||||
if opts.capabilities then
|
if opts.capabilities then
|
||||||
vim.lsp.config("*", { capabilities = opts.capabilities })
|
LazyVim.deprecate("lsp-config.opts.capabilities", "Use lsp-config.opts.servers['*'].capabilities instead")
|
||||||
|
opts.servers["*"] = vim.tbl_deep_extend("force", opts.servers["*"] or {}, {
|
||||||
|
capabilities = opts.capabilities,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
if opts.servers["*"] then
|
||||||
|
vim.lsp.config("*", opts.servers["*"])
|
||||||
end
|
end
|
||||||
|
|
||||||
-- get all the servers that are available through mason-lspconfig
|
-- get all the servers that are available through mason-lspconfig
|
||||||
|
|
@ -192,6 +243,9 @@ return {
|
||||||
|
|
||||||
---@return boolean? exclude automatic setup
|
---@return boolean? exclude automatic setup
|
||||||
local function configure(server)
|
local function configure(server)
|
||||||
|
if server == "*" then
|
||||||
|
return false
|
||||||
|
end
|
||||||
local sopts = opts.servers[server]
|
local sopts = opts.servers[server]
|
||||||
sopts = sopts == true and {} or (not sopts) and { enabled = false } or sopts --[[@as lazyvim.lsp.Config]]
|
sopts = sopts == true and {} or (not sopts) and { enabled = false } or sopts --[[@as lazyvim.lsp.Config]]
|
||||||
|
|
||||||
|
|
@ -220,7 +274,7 @@ return {
|
||||||
automatic_enable = { exclude = mason_exclude },
|
automatic_enable = { exclude = mason_exclude },
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
end),
|
end,
|
||||||
},
|
},
|
||||||
|
|
||||||
-- cmdline tools and lsp servers
|
-- cmdline tools and lsp servers
|
||||||
|
|
|
||||||
|
|
@ -1,97 +1,65 @@
|
||||||
local M = {}
|
local M = {}
|
||||||
|
|
||||||
---@type LazyKeysLspSpec[]|nil
|
---@type LazyKeysLspSpec[]|nil
|
||||||
M._keys = nil
|
M._keys = {}
|
||||||
|
|
||||||
---@alias LazyKeysLspSpec LazyKeysSpec|{has?:string|string[], cond?:fun():boolean}
|
---@alias LazyKeysLspSpec LazyKeysSpec|{has?:string|string[], enabled?:(fun(buf:number):boolean)}
|
||||||
---@alias LazyKeysLsp LazyKeys|{has?:string|string[], cond?:fun():boolean}
|
---@alias LazyKeysLsp LazyKeys|{has?:string|string[], enabled?:fun(buf:number):boolean}
|
||||||
|
|
||||||
|
---@deprecated
|
||||||
---@return LazyKeysLspSpec[]
|
---@return LazyKeysLspSpec[]
|
||||||
function M.get()
|
function M.get()
|
||||||
if M._keys then
|
LazyVim.warn({
|
||||||
return M._keys
|
'Adding LSP keymaps via `require("lazyvim.plugins.lsp.keymaps").get()` is deprecated.',
|
||||||
end
|
"Please set keymaps via the `keys` field in the LSP server config.",
|
||||||
-- stylua: ignore
|
[[
|
||||||
M._keys = {
|
```lua
|
||||||
{ "<leader>cl", function() Snacks.picker.lsp_config() end, desc = "Lsp Info" },
|
{
|
||||||
{ "gd", vim.lsp.buf.definition, desc = "Goto Definition", has = "definition" },
|
"neovim/nvim-lspconfig",
|
||||||
{ "gr", vim.lsp.buf.references, desc = "References", nowait = true },
|
opts = {
|
||||||
{ "gI", vim.lsp.buf.implementation, desc = "Goto Implementation" },
|
servers = {
|
||||||
{ "gy", vim.lsp.buf.type_definition, desc = "Goto T[y]pe Definition" },
|
['*'] = {
|
||||||
{ "gD", vim.lsp.buf.declaration, desc = "Goto Declaration" },
|
keys = {
|
||||||
{ "K", function() return vim.lsp.buf.hover() end, desc = "Hover" },
|
{ "gd", "<cmd>lua vim.lsp.buf.definition()<CR>", has = "definition"},
|
||||||
{ "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", "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" },
|
}, { stacktrace = true })
|
||||||
{ "<leader>cA", LazyVim.lsp.action.source, desc = "Source Action", has = "codeAction" },
|
vim.schedule(function()
|
||||||
{ "]]", function() Snacks.words.jump(vim.v.count1) end, has = "documentHighlight",
|
if #M._keys > 0 then
|
||||||
desc = "Next Reference", cond = function() return Snacks.words.is_enabled() end },
|
M.set({}, M._keys)
|
||||||
{ "[[", function() Snacks.words.jump(-vim.v.count1) end, has = "documentHighlight",
|
M._keys = {}
|
||||||
desc = "Prev Reference", cond = function() return Snacks.words.is_enabled() end },
|
end
|
||||||
{ "<a-n>", function() Snacks.words.jump(vim.v.count1, true) end, has = "documentHighlight",
|
end)
|
||||||
desc = "Next Reference", cond = function() return Snacks.words.is_enabled() end },
|
|
||||||
{ "<a-p>", function() Snacks.words.jump(-vim.v.count1, true) end, has = "documentHighlight",
|
|
||||||
desc = "Prev Reference", cond = function() return Snacks.words.is_enabled() end },
|
|
||||||
}
|
|
||||||
|
|
||||||
return M._keys
|
return M._keys
|
||||||
end
|
end
|
||||||
|
|
||||||
---@param method string|string[]
|
---@param filter vim.lsp.get_clients.Filter
|
||||||
function M.has(buffer, method)
|
---@param spec LazyKeysLspSpec[]
|
||||||
if type(method) == "table" then
|
function M.set(filter, spec)
|
||||||
for _, m in ipairs(method) do
|
local Keys = require("lazy.core.handler.keys")
|
||||||
if M.has(buffer, m) then
|
for _, keys in pairs(Keys.resolve(spec)) do
|
||||||
return true
|
---@cast keys LazyKeysLsp
|
||||||
|
local filters = {} ---@type vim.lsp.get_clients.Filter[]
|
||||||
|
if keys.has then
|
||||||
|
local methods = type(keys.has) == "string" and { keys.has } or keys.has --[[@as string[] ]]
|
||||||
|
for _, method in ipairs(methods) do
|
||||||
|
method = method:find("/") and method or ("textDocument/" .. method)
|
||||||
|
filters[#filters + 1] = vim.tbl_extend("force", vim.deepcopy(filter), { method = method })
|
||||||
end
|
end
|
||||||
|
else
|
||||||
|
filters[#filters + 1] = filter
|
||||||
end
|
end
|
||||||
return false
|
|
||||||
end
|
|
||||||
method = method:find("/") and method or "textDocument/" .. method
|
|
||||||
local clients = vim.lsp.get_clients({ bufnr = buffer })
|
|
||||||
for _, client in ipairs(clients) do
|
|
||||||
if client:supports_method(method) then
|
|
||||||
return true
|
|
||||||
end
|
|
||||||
end
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
|
|
||||||
---@return LazyKeysLsp[]
|
for _, f in ipairs(filters) do
|
||||||
function M.resolve(buffer)
|
|
||||||
local Keys = require("lazy.core.handler.keys")
|
|
||||||
if not Keys.resolve then
|
|
||||||
return {}
|
|
||||||
end
|
|
||||||
local spec = vim.tbl_extend("force", {}, M.get())
|
|
||||||
local opts = LazyVim.opts("nvim-lspconfig")
|
|
||||||
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)
|
|
||||||
end
|
|
||||||
return Keys.resolve(spec)
|
|
||||||
end
|
|
||||||
|
|
||||||
function M.on_attach(_, buffer)
|
|
||||||
local Keys = require("lazy.core.handler.keys")
|
|
||||||
local keymaps = M.resolve(buffer)
|
|
||||||
|
|
||||||
for _, keys in pairs(keymaps) do
|
|
||||||
local has = not keys.has or M.has(buffer, keys.has)
|
|
||||||
local cond = not (keys.cond == false or ((type(keys.cond) == "function") and not keys.cond()))
|
|
||||||
|
|
||||||
if has and cond then
|
|
||||||
local opts = Keys.opts(keys)
|
local opts = Keys.opts(keys)
|
||||||
opts.cond = nil
|
---@cast opts snacks.keymap.set.Opts
|
||||||
opts.has = nil
|
opts.lsp = f
|
||||||
opts.silent = opts.silent ~= false
|
opts.enabled = keys.enabled
|
||||||
opts.buffer = buffer
|
Snacks.keymap.set(keys.mode or "n", keys.lhs, keys.rhs, opts)
|
||||||
vim.keymap.set(keys.mode or "n", keys.lhs, keys.rhs, opts)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ return {
|
||||||
{
|
{
|
||||||
"nvim-treesitter/nvim-treesitter",
|
"nvim-treesitter/nvim-treesitter",
|
||||||
branch = "main",
|
branch = "main",
|
||||||
|
commit = vim.fn.has("nvim-0.12") == 0 and "7caec274fd19c12b55902a5b795100d21531391f" or nil,
|
||||||
version = false, -- last release is way too old and doesn't work on Windows
|
version = false, -- last release is way too old and doesn't work on Windows
|
||||||
build = function()
|
build = function()
|
||||||
local TS = require("nvim-treesitter")
|
local TS = require("nvim-treesitter")
|
||||||
|
|
@ -37,7 +38,6 @@ return {
|
||||||
"javascript",
|
"javascript",
|
||||||
"jsdoc",
|
"jsdoc",
|
||||||
"json",
|
"json",
|
||||||
"jsonc",
|
|
||||||
"lua",
|
"lua",
|
||||||
"luadoc",
|
"luadoc",
|
||||||
"luap",
|
"luap",
|
||||||
|
|
@ -171,19 +171,26 @@ return {
|
||||||
|
|
||||||
for method, keymaps in pairs(moves) do
|
for method, keymaps in pairs(moves) do
|
||||||
for key, query in pairs(keymaps) do
|
for key, query in pairs(keymaps) do
|
||||||
local desc = query:gsub("@", ""):gsub("%..*", "")
|
local queries = type(query) == "table" and query or { query }
|
||||||
desc = desc:sub(1, 1):upper() .. desc:sub(2)
|
local parts = {}
|
||||||
|
for _, q in ipairs(queries) do
|
||||||
|
local part = q:gsub("@", ""):gsub("%..*", "")
|
||||||
|
part = part:sub(1, 1):upper() .. part:sub(2)
|
||||||
|
table.insert(parts, part)
|
||||||
|
end
|
||||||
|
local desc = table.concat(parts, " or ")
|
||||||
desc = (key:sub(1, 1) == "[" and "Prev " or "Next ") .. desc
|
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")
|
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()
|
||||||
vim.keymap.set({ "n", "x", "o" }, key, function()
|
if vim.wo.diff and key:find("[cC]") then
|
||||||
require("nvim-treesitter-textobjects.move")[method](query, "textobjects")
|
return vim.cmd("normal! " .. key)
|
||||||
end, {
|
end
|
||||||
buffer = buf,
|
require("nvim-treesitter-textobjects.move")[method](query, "textobjects")
|
||||||
desc = desc,
|
end, {
|
||||||
silent = true,
|
buffer = buf,
|
||||||
})
|
desc = desc,
|
||||||
end
|
silent = true,
|
||||||
|
})
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,7 @@ return {
|
||||||
{ "]b", "<cmd>BufferLineCycleNext<cr>", desc = "Next Buffer" },
|
{ "]b", "<cmd>BufferLineCycleNext<cr>", desc = "Next Buffer" },
|
||||||
{ "[B", "<cmd>BufferLineMovePrev<cr>", desc = "Move buffer prev" },
|
{ "[B", "<cmd>BufferLineMovePrev<cr>", desc = "Move buffer prev" },
|
||||||
{ "]B", "<cmd>BufferLineMoveNext<cr>", desc = "Move buffer next" },
|
{ "]B", "<cmd>BufferLineMoveNext<cr>", desc = "Move buffer next" },
|
||||||
|
{ "<leader>bj", "<cmd>BufferLinePick<cr>", desc = "Pick Buffer" },
|
||||||
},
|
},
|
||||||
opts = {
|
opts = {
|
||||||
options = {
|
options = {
|
||||||
|
|
|
||||||
|
|
@ -23,8 +23,8 @@ return {
|
||||||
nav_j = { "<C-j>", term_nav("j"), desc = "Go to Lower Window", expr = true, mode = "t" },
|
nav_j = { "<C-j>", term_nav("j"), desc = "Go to Lower Window", expr = true, mode = "t" },
|
||||||
nav_k = { "<C-k>", term_nav("k"), desc = "Go to Upper Window", expr = true, mode = "t" },
|
nav_k = { "<C-k>", term_nav("k"), desc = "Go to Upper Window", expr = true, mode = "t" },
|
||||||
nav_l = { "<C-l>", term_nav("l"), desc = "Go to Right Window", expr = true, mode = "t" },
|
nav_l = { "<C-l>", term_nav("l"), desc = "Go to Right Window", expr = true, mode = "t" },
|
||||||
hide_slash = { "<C-/>", "hide", desc = "Hide Terminal", mode = { "t", "n" } },
|
hide_slash = { "<C-/>", "hide", desc = "Hide Terminal", mode = "t" },
|
||||||
hide_underscore = { "<c-_>", "hide", desc = "which_key_ignore", mode = { "t", "n" } },
|
hide_underscore = { "<c-_>", "hide", desc = "which_key_ignore", mode = "t" },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,22 @@ M.moved = {
|
||||||
rename_file = { "Snacks.rename.rename_file" },
|
rename_file = { "Snacks.rename.rename_file" },
|
||||||
on_rename = { "Snacks.rename.on_rename_file" },
|
on_rename = { "Snacks.rename.on_rename_file" },
|
||||||
words = { "Snacks.words" },
|
words = { "Snacks.words" },
|
||||||
|
on_supports_method = {
|
||||||
|
"Snacks.util.lsp.on",
|
||||||
|
fn = function(method, cb)
|
||||||
|
return Snacks.util.lsp.on({ method = method }, function(buffer, client)
|
||||||
|
cb(client, buffer)
|
||||||
|
end)
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
on_attach = {
|
||||||
|
"Snacks.util.lsp.on",
|
||||||
|
fn = function(cb, name)
|
||||||
|
return Snacks.util.lsp.on({ name = name }, function(buffer, client)
|
||||||
|
cb(client, buffer)
|
||||||
|
end)
|
||||||
|
end,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
terminal = {
|
terminal = {
|
||||||
open = { "Snacks.terminal" },
|
open = { "Snacks.terminal" },
|
||||||
|
|
|
||||||
|
|
@ -65,7 +65,7 @@ function M.get()
|
||||||
if root then
|
if root then
|
||||||
LazyVim.walk(root, function(path, name, type)
|
LazyVim.walk(root, function(path, name, type)
|
||||||
if (type == "file" or type == "link") and name:match("%.lua$") then
|
if (type == "file" or type == "link") and name:match("%.lua$") then
|
||||||
name = path:sub(#root + 2, -5):gsub("/", ".")
|
name = path:sub(#root + 2, -5):gsub("/", "."):gsub("%.init$", "")
|
||||||
local ok, extra = pcall(M.get_extra, source, source.module .. "." .. name)
|
local ok, extra = pcall(M.get_extra, source, source.module .. "." .. name)
|
||||||
if ok then
|
if ok then
|
||||||
extras[#extras + 1] = extra
|
extras[#extras + 1] = extra
|
||||||
|
|
@ -115,6 +115,13 @@ function M.get_extra(source, modname)
|
||||||
recommended = M.wants(recommended)
|
recommended = M.wants(recommended)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- language extras that are disabled because a conflict with another extra is enabled are not recommended
|
||||||
|
local defaults = LazyVim.config.get_defaults()
|
||||||
|
local def = defaults[modname]
|
||||||
|
if def and def.enabled == false and vim.startswith(modname, "lazyvim.plugins.extras.lang.") then
|
||||||
|
recommended = false
|
||||||
|
end
|
||||||
|
|
||||||
---@type LazyExtra
|
---@type LazyExtra
|
||||||
return {
|
return {
|
||||||
source = source,
|
source = source,
|
||||||
|
|
|
||||||
|
|
@ -221,7 +221,7 @@ function M.safe_keymap_set(mode, lhs, rhs, opts)
|
||||||
---@diagnostic disable-next-line: no-unknown
|
---@diagnostic disable-next-line: no-unknown
|
||||||
opts.remap = nil
|
opts.remap = nil
|
||||||
end
|
end
|
||||||
vim.keymap.set(modes, lhs, rhs, opts)
|
Snacks.keymap.set(modes, lhs, rhs, opts)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,103 +1,6 @@
|
||||||
---@class lazyvim.util.lsp
|
---@class lazyvim.util.lsp
|
||||||
local M = {}
|
local M = {}
|
||||||
|
|
||||||
---@param on_attach fun(client:vim.lsp.Client, buffer)
|
|
||||||
---@param name? string
|
|
||||||
function M.on_attach(on_attach, name)
|
|
||||||
return vim.api.nvim_create_autocmd("LspAttach", {
|
|
||||||
callback = function(args)
|
|
||||||
local buffer = args.buf ---@type number
|
|
||||||
local client = vim.lsp.get_client_by_id(args.data.client_id)
|
|
||||||
if client and (not name or client.name == name) then
|
|
||||||
return on_attach(client, buffer)
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
end
|
|
||||||
|
|
||||||
---@type table<string, table<vim.lsp.Client, table<number, boolean>>>
|
|
||||||
M._supports_method = {}
|
|
||||||
|
|
||||||
function M.setup()
|
|
||||||
local register_capability = vim.lsp.handlers["client/registerCapability"]
|
|
||||||
vim.lsp.handlers["client/registerCapability"] = function(err, res, ctx)
|
|
||||||
---@diagnostic disable-next-line: no-unknown
|
|
||||||
local ret = register_capability(err, res, ctx)
|
|
||||||
local client = vim.lsp.get_client_by_id(ctx.client_id)
|
|
||||||
if client then
|
|
||||||
for buffer in pairs(client.attached_buffers) do
|
|
||||||
vim.api.nvim_exec_autocmds("User", {
|
|
||||||
pattern = "LspDynamicCapability",
|
|
||||||
data = { client_id = client.id, buffer = buffer },
|
|
||||||
})
|
|
||||||
end
|
|
||||||
end
|
|
||||||
return ret
|
|
||||||
end
|
|
||||||
M.on_attach(M._check_methods)
|
|
||||||
M.on_dynamic_capability(M._check_methods)
|
|
||||||
end
|
|
||||||
|
|
||||||
---@param client vim.lsp.Client
|
|
||||||
function M._check_methods(client, buffer)
|
|
||||||
-- don't trigger on invalid buffers
|
|
||||||
if not vim.api.nvim_buf_is_valid(buffer) then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
-- don't trigger on non-listed buffers
|
|
||||||
if not vim.bo[buffer].buflisted then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
-- don't trigger on nofile buffers
|
|
||||||
if vim.bo[buffer].buftype == "nofile" then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
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, buffer) then
|
|
||||||
clients[client][buffer] = true
|
|
||||||
vim.api.nvim_exec_autocmds("User", {
|
|
||||||
pattern = "LspSupportsMethod",
|
|
||||||
data = { client_id = client.id, buffer = buffer, method = method },
|
|
||||||
})
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
---@param fn fun(client:vim.lsp.Client, buffer):boolean?
|
|
||||||
---@param opts? {group?: integer}
|
|
||||||
function M.on_dynamic_capability(fn, opts)
|
|
||||||
return vim.api.nvim_create_autocmd("User", {
|
|
||||||
pattern = "LspDynamicCapability",
|
|
||||||
group = opts and opts.group or nil,
|
|
||||||
callback = function(args)
|
|
||||||
local client = vim.lsp.get_client_by_id(args.data.client_id)
|
|
||||||
local buffer = args.data.buffer ---@type number
|
|
||||||
if client then
|
|
||||||
return fn(client, buffer)
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
end
|
|
||||||
|
|
||||||
---@param method string
|
|
||||||
---@param fn fun(client:vim.lsp.Client, buffer)
|
|
||||||
function M.on_supports_method(method, fn)
|
|
||||||
M._supports_method[method] = M._supports_method[method] or setmetatable({}, { __mode = "k" })
|
|
||||||
return vim.api.nvim_create_autocmd("User", {
|
|
||||||
pattern = "LspSupportsMethod",
|
|
||||||
callback = function(args)
|
|
||||||
local client = vim.lsp.get_client_by_id(args.data.client_id)
|
|
||||||
local buffer = args.data.buffer ---@type number
|
|
||||||
if client and method == args.data.method then
|
|
||||||
return fn(client, buffer)
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
end
|
|
||||||
|
|
||||||
---@param opts? LazyFormatter| {filter?: (string|vim.lsp.get_clients.Filter)}
|
---@param opts? LazyFormatter| {filter?: (string|vim.lsp.get_clients.Filter)}
|
||||||
function M.formatter(opts)
|
function M.formatter(opts)
|
||||||
opts = opts or {}
|
opts = opts or {}
|
||||||
|
|
@ -132,18 +35,14 @@ end
|
||||||
|
|
||||||
---@param opts? lsp.Client.format
|
---@param opts? lsp.Client.format
|
||||||
function M.format(opts)
|
function M.format(opts)
|
||||||
opts = vim.tbl_deep_extend(
|
opts = vim.tbl_deep_extend("force", {}, opts or {}, LazyVim.opts("nvim-lspconfig").format or {})
|
||||||
"force",
|
|
||||||
{},
|
|
||||||
opts or {},
|
|
||||||
LazyVim.opts("nvim-lspconfig").format or {},
|
|
||||||
LazyVim.opts("conform.nvim").format or {}
|
|
||||||
)
|
|
||||||
local ok, conform = pcall(require, "conform")
|
local ok, conform = pcall(require, "conform")
|
||||||
-- use conform for formatting with LSP when available,
|
-- use conform for formatting with LSP when available,
|
||||||
-- since it has better format diffing
|
-- since it has better format diffing
|
||||||
if ok then
|
if ok then
|
||||||
opts.formatters = {}
|
-- It should be `nil`, otherwise it doesn't fetch options from `formatters_by_ft`,
|
||||||
|
-- see https://github.com/stevearc/conform.nvim/blob/5420c4b5ea0aeb99c09cfbd4fd0b70d257b44f25/lua/conform/init.lua#L417-L418
|
||||||
|
opts.formatters = nil
|
||||||
conform.format(opts)
|
conform.format(opts)
|
||||||
else
|
else
|
||||||
vim.lsp.buf.format(opts)
|
vim.lsp.buf.format(opts)
|
||||||
|
|
@ -167,9 +66,18 @@ M.action = setmetatable({}, {
|
||||||
---@class LspCommand: lsp.ExecuteCommandParams
|
---@class LspCommand: lsp.ExecuteCommandParams
|
||||||
---@field open? boolean
|
---@field open? boolean
|
||||||
---@field handler? lsp.Handler
|
---@field handler? lsp.Handler
|
||||||
|
---@field filter? string|vim.lsp.get_clients.Filter
|
||||||
|
---@field title? string
|
||||||
|
|
||||||
---@param opts LspCommand
|
---@param opts LspCommand
|
||||||
function M.execute(opts)
|
function M.execute(opts)
|
||||||
|
local filter = opts.filter or {}
|
||||||
|
filter = type(filter) == "string" and { name = filter } or filter
|
||||||
|
local buf = vim.api.nvim_get_current_buf()
|
||||||
|
|
||||||
|
---@cast filter vim.lsp.get_clients.Filter
|
||||||
|
local client = vim.lsp.get_clients(LazyVim.merge({}, filter, { bufnr = buf }))[1]
|
||||||
|
|
||||||
local params = {
|
local params = {
|
||||||
command = opts.command,
|
command = opts.command,
|
||||||
arguments = opts.arguments,
|
arguments = opts.arguments,
|
||||||
|
|
@ -180,8 +88,26 @@ function M.execute(opts)
|
||||||
params = params,
|
params = params,
|
||||||
})
|
})
|
||||||
else
|
else
|
||||||
return vim.lsp.buf_request(0, "workspace/executeCommand", params, opts.handler)
|
vim.list_extend(params, { title = opts.title })
|
||||||
|
return client:exec_cmd(params, { bufnr = buf }, opts.handler)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
---@param filter? vim.lsp.get_clients.Filter
|
||||||
|
function M.code_actions(filter)
|
||||||
|
filter = filter or {}
|
||||||
|
local ret = {} ---@type string[]
|
||||||
|
local clients = vim.lsp.get_clients(filter)
|
||||||
|
for _, client in ipairs(clients) do
|
||||||
|
-- check server cababilities first
|
||||||
|
vim.list_extend(ret, vim.tbl_get(client, "server_capabilities", "codeActionProvider", "codeActionKinds") or {})
|
||||||
|
-- check dynamic capabilities
|
||||||
|
local regs = client.dynamic_capabilities:get("codeActionProvider", filter)
|
||||||
|
for _, reg in ipairs(regs or {}) do
|
||||||
|
vim.list_extend(ret, vim.tbl_get(reg, "registerOptions", "codeActionKinds") or {})
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return LazyVim.dedup(ret)
|
||||||
|
end
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,9 @@ function M.open(file, opts)
|
||||||
end
|
end
|
||||||
file = plugin.dir .. "/" .. file
|
file = plugin.dir .. "/" .. file
|
||||||
elseif opts.rtp then
|
elseif opts.rtp then
|
||||||
file = vim.api.nvim_get_runtime_file(file, false)[1]
|
-- first check if file exists in VIMRUNTIME, then check the full runtimepath
|
||||||
|
local path = vim.env.VIMRUNTIME .. "/" .. file --[[@as string]]
|
||||||
|
file = vim.uv.fs_stat(path) and path or vim.api.nvim_get_runtime_file(file, false)[1]
|
||||||
end
|
end
|
||||||
|
|
||||||
if not file then
|
if not file then
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,7 @@ M.deprecated_extras = {
|
||||||
}
|
}
|
||||||
M.renamed_extras = {
|
M.renamed_extras = {
|
||||||
["lazyvim.plugins.extras.lang.omnisharp"] = "lazyvim.plugins.extras.lang.dotnet",
|
["lazyvim.plugins.extras.lang.omnisharp"] = "lazyvim.plugins.extras.lang.dotnet",
|
||||||
|
["lazyvim.plugins.extras.formatting.biome"] = "lazyvim.plugins.extras.lang.typescript.biome",
|
||||||
}
|
}
|
||||||
|
|
||||||
M.deprecated_modules = {}
|
M.deprecated_modules = {}
|
||||||
|
|
@ -42,6 +43,7 @@ M.renames = {
|
||||||
["markdown.nvim"] = "render-markdown.nvim",
|
["markdown.nvim"] = "render-markdown.nvim",
|
||||||
["williamboman/mason.nvim"] = "mason-org/mason.nvim",
|
["williamboman/mason.nvim"] = "mason-org/mason.nvim",
|
||||||
["williamboman/mason-lspconfig.nvim"] = "mason-org/mason-lspconfig.nvim",
|
["williamboman/mason-lspconfig.nvim"] = "mason-org/mason-lspconfig.nvim",
|
||||||
|
["ggandor/leap.nvim"] = "https://codeberg.org/andyg/leap.nvim.git",
|
||||||
}
|
}
|
||||||
|
|
||||||
function M.save_core()
|
function M.save_core()
|
||||||
|
|
@ -109,15 +111,43 @@ function M.fix_imports()
|
||||||
)
|
)
|
||||||
spec.import = rename
|
spec.import = rename
|
||||||
end
|
end
|
||||||
local dep = M.deprecated_extras[spec and spec.import]
|
local dep = M.deprecated_extras[spec.import]
|
||||||
if dep then
|
if dep then
|
||||||
dep = dep .. "\n" .. "Please remove the extra from `lazyvim.json` to hide this warning."
|
dep = dep .. "\n" .. "Please remove the extra from `lazyvim.json` to hide this warning."
|
||||||
LazyVim.warn(dep, { title = "LazyVim", once = true, stacktrace = true, stacklevel = 6 })
|
LazyVim.warn(dep, { title = "LazyVim", once = true, stacktrace = true, stacklevel = 6 })
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local modname = spec.import
|
||||||
|
if type(modname) == "string" and vim.startswith(modname, "lazyvim.plugins.extras.") then
|
||||||
|
M.single_import(spec)
|
||||||
|
end
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
---@param spec LazySpecImport
|
||||||
|
function M.single_import(spec)
|
||||||
|
local modname = spec.import
|
||||||
|
if type(modname) ~= "string" then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
spec.name = modname
|
||||||
|
spec.import = function()
|
||||||
|
local modinfo = vim.loader.find(modname)[1]
|
||||||
|
local modpath = modinfo and modinfo.modpath
|
||||||
|
local mod, err = loadfile(modpath)
|
||||||
|
if mod then
|
||||||
|
local ret, foo = mod()
|
||||||
|
if foo then
|
||||||
|
return nil, "Spec module returned more than one value. Expected a single value."
|
||||||
|
end
|
||||||
|
return ret
|
||||||
|
else
|
||||||
|
return nil, err
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
function M.fix_renames()
|
function M.fix_renames()
|
||||||
---@param plugin LazyPluginSpec
|
---@param plugin LazyPluginSpec
|
||||||
Meta.add = LazyVim.inject.args(Meta.add, function(self, plugin)
|
Meta.add = LazyVim.inject.args(Meta.add, function(self, plugin)
|
||||||
|
|
|
||||||
|
|
@ -78,7 +78,7 @@ function M.realpath(path)
|
||||||
if path == "" or path == nil then
|
if path == "" or path == nil then
|
||||||
return nil
|
return nil
|
||||||
end
|
end
|
||||||
path = vim.uv.fs_realpath(path) or path
|
path = vim.fn.has("win32") == 0 and vim.uv.fs_realpath(path) or path
|
||||||
return LazyVim.norm(path)
|
return LazyVim.norm(path)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ function M.setup(shell)
|
||||||
|
|
||||||
-- Setting shell command flags
|
-- Setting shell command flags
|
||||||
vim.o.shellcmdflag =
|
vim.o.shellcmdflag =
|
||||||
"-NoLogo -NonInteractive -ExecutionPolicy RemoteSigned -Command [Console]::InputEncoding=[Console]::OutputEncoding=[System.Text.UTF8Encoding]::new();$PSDefaultParameterValues['Out-File:Encoding']='utf8';$PSStyle.OutputRendering='plaintext';Remove-Alias -Force -ErrorAction SilentlyContinue tee;"
|
"-NoProfile -NoLogo -NonInteractive -ExecutionPolicy RemoteSigned -Command [Console]::InputEncoding=[Console]::OutputEncoding=[System.Text.UTF8Encoding]::new();$PSDefaultParameterValues['Out-File:Encoding']='utf8';$PSStyle.OutputRendering='plaintext';Remove-Alias -Force -ErrorAction SilentlyContinue tee;"
|
||||||
|
|
||||||
-- Setting shell redirection
|
-- Setting shell redirection
|
||||||
vim.o.shellredir = '2>&1 | %%{ "$_" } | Out-File %s; exit $LastExitCode'
|
vim.o.shellredir = '2>&1 | %%{ "$_" } | Out-File %s; exit $LastExitCode'
|
||||||
|
|
|
||||||
|
|
@ -80,7 +80,6 @@ function M.check()
|
||||||
["C compiler"] = have_cc,
|
["C compiler"] = have_cc,
|
||||||
tar = have("tar"),
|
tar = have("tar"),
|
||||||
curl = have("curl"),
|
curl = have("curl"),
|
||||||
node = have("node"),
|
|
||||||
}
|
}
|
||||||
local ok = true
|
local ok = true
|
||||||
for _, v in pairs(ret) do
|
for _, v in pairs(ret) do
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,9 @@ local Icons = require("mini.icons")
|
||||||
|
|
||||||
local Plugin = require("lazy.core.plugin")
|
local Plugin = require("lazy.core.plugin")
|
||||||
_G.LazyVim = require("lazyvim.util")
|
_G.LazyVim = require("lazyvim.util")
|
||||||
|
require("lazyvim.config")
|
||||||
|
LazyVim.config.get_defaults()
|
||||||
|
LazyVim.plugin.setup()
|
||||||
|
|
||||||
describe("Extra", function()
|
describe("Extra", function()
|
||||||
local Config = require("lazy.core.config")
|
local Config = require("lazy.core.config")
|
||||||
|
|
@ -77,10 +80,12 @@ describe("Extra", function()
|
||||||
it("it has no renamed plugins", function()
|
it("it has no renamed plugins", function()
|
||||||
for _, p in pairs(spec.plugins) do
|
for _, p in pairs(spec.plugins) do
|
||||||
local short_url = p[1]
|
local short_url = p[1]
|
||||||
assert(
|
if short_url then
|
||||||
not LazyVim.plugin.renames[short_url],
|
assert(
|
||||||
"Plugin " .. short_url .. " has been renamed to " .. (LazyVim.plugin.renames[short_url] or "")
|
not LazyVim.plugin.renames[short_url],
|
||||||
)
|
"Plugin " .. short_url .. " has been renamed to " .. (LazyVim.plugin.renames[short_url] or "")
|
||||||
|
)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
|
@ -91,8 +96,13 @@ describe("Extra", function()
|
||||||
local mason = spec.plugins["mason.nvim"]
|
local mason = spec.plugins["mason.nvim"]
|
||||||
local mason_opts = Plugin.values(mason, "opts", false)
|
local mason_opts = Plugin.values(mason, "opts", false)
|
||||||
|
|
||||||
for lsp in pairs(lspconfig_opts.servers or {}) do
|
for lsp, lsp_opts in pairs(lspconfig_opts.servers or {}) do
|
||||||
local lsp_pkg = lsp_to_pkg[lsp]
|
local lsp_pkg = lsp_to_pkg[lsp]
|
||||||
|
-- Skip if the LSP server is disabled in the config since mason.nvim won't install it
|
||||||
|
-- and it might still be used for conform.nvim or nvim-lint, etc.
|
||||||
|
if type(lsp_opts) == "table" and lsp_opts.enabled == false then
|
||||||
|
lsp_pkg = false
|
||||||
|
end
|
||||||
assert(
|
assert(
|
||||||
not (lsp_pkg and vim.tbl_contains(mason_opts.ensure_installed, lsp_pkg)),
|
not (lsp_pkg and vim.tbl_contains(mason_opts.ensure_installed, lsp_pkg)),
|
||||||
"LSP server "
|
"LSP server "
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue