mirror of
https://github.com/LazyVim/LazyVim.git
synced 2026-07-25 14:01:06 +00:00
Merge branch 'main' into main
This commit is contained in:
commit
9b92c63455
27 changed files with 900 additions and 162 deletions
3
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
3
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
|
|
@ -16,7 +16,7 @@ body:
|
||||||
required: true
|
required: true
|
||||||
- label: I have searched the existing issues of LazyVim
|
- label: I have searched the existing issues of LazyVim
|
||||||
required: true
|
required: true
|
||||||
- label: I have searched the exsiting issues of plugins related to this issue
|
- label: I have searched the existing issues of plugins related to this issue
|
||||||
required: true
|
required: true
|
||||||
- type: input
|
- type: input
|
||||||
attributes:
|
attributes:
|
||||||
|
|
@ -59,6 +59,7 @@ body:
|
||||||
value: |
|
value: |
|
||||||
-- DO NOT change the paths and don't remove the colorscheme
|
-- DO NOT change the paths and don't remove the colorscheme
|
||||||
local root = vim.fn.fnamemodify("./.repro", ":p")
|
local root = vim.fn.fnamemodify("./.repro", ":p")
|
||||||
|
|
||||||
-- set stdpaths to use .repro
|
-- set stdpaths to use .repro
|
||||||
for _, name in ipairs({ "config", "data", "state", "cache" }) do
|
for _, name in ipairs({ "config", "data", "state", "cache" }) do
|
||||||
vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
|
vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
|
||||||
|
|
|
||||||
10
.github/workflows/ci.yml
vendored
10
.github/workflows/ci.yml
vendored
|
|
@ -15,8 +15,12 @@ jobs:
|
||||||
- name: Install Neovim
|
- name: Install Neovim
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
wget -q https://github.com/neovim/neovim/releases/download/nightly/nvim-linux64.deb -O /tmp/nvim.deb
|
mkdir -p /tmp/nvim
|
||||||
sudo dpkg -i /tmp/nvim.deb
|
wget -q https://github.com/neovim/neovim/releases/download/nightly/nvim.appimage -O /tmp/nvim/nvim.appimage
|
||||||
|
cd /tmp/nvim
|
||||||
|
chmod a+x ./nvim.appimage
|
||||||
|
./nvim.appimage --appimage-extract
|
||||||
|
echo "/tmp/nvim/squashfs-root/usr/bin/" >> $GITHUB_PATH
|
||||||
- name: Run Tests
|
- name: Run Tests
|
||||||
run: |
|
run: |
|
||||||
nvim --version
|
nvim --version
|
||||||
|
|
@ -55,7 +59,7 @@ jobs:
|
||||||
with:
|
with:
|
||||||
release-type: simple
|
release-type: simple
|
||||||
package-name: LazyVim
|
package-name: LazyVim
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
- name: tag stable versions
|
- name: tag stable versions
|
||||||
if: ${{ steps.release.outputs.release_created }}
|
if: ${{ steps.release.outputs.release_created }}
|
||||||
run: |
|
run: |
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@
|
||||||
},
|
},
|
||||||
"neoconf": {
|
"neoconf": {
|
||||||
"plugins": {
|
"plugins": {
|
||||||
"sumneko_lua": {
|
"lua_ls": {
|
||||||
"enabled": true
|
"enabled": true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
317
CHANGELOG.md
317
CHANGELOG.md
|
|
@ -1,5 +1,322 @@
|
||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## [2.5.0](https://github.com/LazyVim/LazyVim/compare/v2.4.3...v2.5.0) (2023-04-19)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **lsp:** added support for setting global lsp client capabilities ([ac10516](https://github.com/LazyVim/LazyVim/commit/ac1051686bcff8377f1d99228bcbe64530ec384a))
|
||||||
|
|
||||||
|
## [2.4.3](https://github.com/LazyVim/LazyVim/compare/v2.4.2...v2.4.3) (2023-04-19)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **treesitter:** de-duplicate langs in endure_installed. Fixes [#628](https://github.com/LazyVim/LazyVim/issues/628) ([1d2c97c](https://github.com/LazyVim/LazyVim/commit/1d2c97cbda099c76ee132ee5019a3f80fd88f8ed))
|
||||||
|
|
||||||
|
## [2.4.2](https://github.com/LazyVim/LazyVim/compare/v2.4.1...v2.4.2) (2023-04-19)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **diagnostics:** deepcopy diagnostic params. Fixes [#621](https://github.com/LazyVim/LazyVim/issues/621) ([1caa27b](https://github.com/LazyVim/LazyVim/commit/1caa27ba4acb04ebbc64a91de242574790dcf92f))
|
||||||
|
|
||||||
|
## [2.4.1](https://github.com/LazyVim/LazyVim/compare/v2.4.0...v2.4.1) (2023-04-19)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **lsp:** properly check that diagnostics virtual_text is a table. Fixes [#618](https://github.com/LazyVim/LazyVim/issues/618) ([17fe32e](https://github.com/LazyVim/LazyVim/commit/17fe32e428bbade6f91770814e8748425bfc01a2))
|
||||||
|
|
||||||
|
## [2.4.0](https://github.com/LazyVim/LazyVim/compare/v2.3.0...v2.4.0) (2023-04-18)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **dap:** add more keybindings and lualine component ([#612](https://github.com/LazyVim/LazyVim/issues/612)) ([38ad79d](https://github.com/LazyVim/LazyVim/commit/38ad79d5485c083afdb04b1fb9f9683403a6d7bd))
|
||||||
|
* **diagnostics:** added support for setting prefix = "icons". Check the docs on how to enable ([01a1b8e](https://github.com/LazyVim/LazyVim/commit/01a1b8e80db55963f281cf36674cf1c174e2f50e))
|
||||||
|
* **diagnostics:** show diagnostics source when more than one source is reporting diagnostics ([06c38c5](https://github.com/LazyVim/LazyVim/commit/06c38c52a91bb1dcc2dec2d79d6e13606324be77))
|
||||||
|
|
||||||
|
## [2.3.0](https://github.com/LazyVim/LazyVim/compare/v2.2.1...v2.3.0) (2023-04-17)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **dap:** add step out, rebind step over ([#605](https://github.com/LazyVim/LazyVim/issues/605)) ([cfaf3b0](https://github.com/LazyVim/LazyVim/commit/cfaf3b054e1a68ea0f7a73d51a0f6c27395198e9))
|
||||||
|
|
||||||
|
## [2.2.1](https://github.com/LazyVim/LazyVim/compare/v2.2.0...v2.2.1) (2023-04-17)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **telescope:** typo ([a94f7af](https://github.com/LazyVim/LazyVim/commit/a94f7afdebc56338b5552de11561646d8ef4b5be))
|
||||||
|
|
||||||
|
## [2.2.0](https://github.com/LazyVim/LazyVim/compare/v2.1.0...v2.2.0) (2023-04-17)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **noice:** added keymap to dismiss all noice messages ([0155de0](https://github.com/LazyVim/LazyVim/commit/0155de00ab76e7ffc1d8232c10121f24c4e84cd9))
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **lsp:** gT => gy. keymap for goto type definition. Fixes [#554](https://github.com/LazyVim/LazyVim/issues/554) ([0cb8974](https://github.com/LazyVim/LazyVim/commit/0cb89742216d4c73fa944ab9e2fcd21793ed7a78))
|
||||||
|
* **telescope:** consistent keymap description. Fixes [#600](https://github.com/LazyVim/LazyVim/issues/600) ([df9547f](https://github.com/LazyVim/LazyVim/commit/df9547f43223fd89ccc7c1fa5088623ca3c2cfd4))
|
||||||
|
|
||||||
|
## [2.1.0](https://github.com/LazyVim/LazyVim/compare/v2.0.0...v2.1.0) (2023-04-16)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* added extra for dap ([bc14e02](https://github.com/LazyVim/LazyVim/commit/bc14e02a1ff43f1a69d2a6755faeec8a5ec26ac9))
|
||||||
|
* **dap:** added extra for dap nlua ([f562d1d](https://github.com/LazyVim/LazyVim/commit/f562d1d19761c3419380c3b175fd00a440ff0932))
|
||||||
|
* **which-key:** easier integration for which-key group names ([df94a04](https://github.com/LazyVim/LazyVim/commit/df94a044ec656c456067b550531a62e80a5be420))
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **dap:** added DapInstall and DapUninstall to cmds ([feaeab9](https://github.com/LazyVim/LazyVim/commit/feaeab9fcabf005cbf18b846d2ab0129a73837a9))
|
||||||
|
|
||||||
|
## [2.0.0](https://github.com/LazyVim/LazyVim/compare/v1.24.0...v2.0.0) (2023-04-16)
|
||||||
|
|
||||||
|
|
||||||
|
### ⚠ BREAKING CHANGES
|
||||||
|
|
||||||
|
* **treesitter:** rename help to vimdoc ([#521](https://github.com/LazyVim/LazyVim/issues/521))
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **autocmds:** add checkhealth filetype to close_with_q list ([#512](https://github.com/LazyVim/LazyVim/issues/512)) ([1defd5f](https://github.com/LazyVim/LazyVim/commit/1defd5f67008c695a7d99d72bc50432de5eaed3a))
|
||||||
|
* **keymaps:** Get rename command from inc_rename configuration ([#579](https://github.com/LazyVim/LazyVim/issues/579)) ([a099b2d](https://github.com/LazyVim/LazyVim/commit/a099b2d3ab3ff3bafb075c101e2b2a48b44fe869))
|
||||||
|
* **telescope:** add document/workspace diagnostics and todo/fixme telescope keymaps ([#557](https://github.com/LazyVim/LazyVim/issues/557)) ([98775f5](https://github.com/LazyVim/LazyVim/commit/98775f56312110c640be7e9d43ecc766a116427a))
|
||||||
|
* **telescope:** use the new dynamic workspace symbols ([#577](https://github.com/LazyVim/LazyVim/issues/577)) ([6e01e85](https://github.com/LazyVim/LazyVim/commit/6e01e8560e4ca197bc56666e9b969fe75d91b310))
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **autocmds:** don't auto create dirs for urls. Fixes [#583](https://github.com/LazyVim/LazyVim/issues/583) ([7476da7](https://github.com/LazyVim/LazyVim/commit/7476da78117b032bc34d0130e6b1f9c7eea77073))
|
||||||
|
* **config:** options cant be disabled with lazyvim config. Fixes [#566](https://github.com/LazyVim/LazyVim/issues/566) ([02c5e8d](https://github.com/LazyVim/LazyVim/commit/02c5e8d953fff68b832a8f22a83428bd229ddc59))
|
||||||
|
* **format:** ignore vim.b.autoformat when formatting using key bindings. Fixes [#575](https://github.com/LazyVim/LazyVim/issues/575) ([bef36bb](https://github.com/LazyVim/LazyVim/commit/bef36bb2fd7493828529ed49a071d240602b164d))
|
||||||
|
* **lazygit:** dont use `<esc><esc>` for normal more for laygit to prevent delays on `<esc>`. Fixes [#567](https://github.com/LazyVim/LazyVim/issues/567) ([a9e9204](https://github.com/LazyVim/LazyVim/commit/a9e9204daec3355015bbe677068198cf38cd2cf3))
|
||||||
|
* **lsp:** gt -> gT. Fixes [#554](https://github.com/LazyVim/LazyVim/issues/554) ([2d8116e](https://github.com/LazyVim/LazyVim/commit/2d8116ef674ad4b2a3ba62f590ff32d1c30a2f9c))
|
||||||
|
|
||||||
|
|
||||||
|
### Code Refactoring
|
||||||
|
|
||||||
|
* **treesitter:** rename help to vimdoc ([#521](https://github.com/LazyVim/LazyVim/issues/521)) ([078250a](https://github.com/LazyVim/LazyVim/commit/078250a114b45785743fcfe0482c7667f304f92c))
|
||||||
|
|
||||||
|
## [1.24.0](https://github.com/LazyVim/LazyVim/compare/v1.23.0...v1.24.0) (2023-03-31)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **autocmds:** add auto create dir ([#493](https://github.com/LazyVim/LazyVim/issues/493)) ([ed48b85](https://github.com/LazyVim/LazyVim/commit/ed48b85dbea30a15518b4caa58cbf5d2b54f97a0))
|
||||||
|
* **lualine:** added lazy extension ([79fe045](https://github.com/LazyVim/LazyVim/commit/79fe0455a02b791eae26e9934fdbaf075d9522ae))
|
||||||
|
|
||||||
|
## [1.23.0](https://github.com/LazyVim/LazyVim/compare/v1.22.0...v1.23.0) (2023-03-25)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **treesitter:** use Python indents as they've improved greatly ([#490](https://github.com/LazyVim/LazyVim/issues/490)) ([59eb198](https://github.com/LazyVim/LazyVim/commit/59eb19835f3b291912d46e5e8ea762367201cbf1))
|
||||||
|
|
||||||
|
## [1.22.0](https://github.com/LazyVim/LazyVim/compare/v1.21.2...v1.22.0) (2023-03-23)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **mason:** compatibility with the new mason registry ([df5cbfd](https://github.com/LazyVim/LazyVim/commit/df5cbfdbeccfa37ee391be8b49da7a4a4b6dcc40))
|
||||||
|
* **treesitter:** add luadoc ([#469](https://github.com/LazyVim/LazyVim/issues/469)) ([ade4342](https://github.com/LazyVim/LazyVim/commit/ade4342c42c47f4eadae3e6267ac35f546692158))
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **autocmd:** remove query from q-to-quit autocmd ([#473](https://github.com/LazyVim/LazyVim/issues/473)) ([b0cef1f](https://github.com/LazyVim/LazyVim/commit/b0cef1f506e4bbaa8cfe07990ee49518d8e13f3d))
|
||||||
|
* **mason:** removed flake8. You can add it back in your own configs if you need it or add ruff_lsp ([381ee0a](https://github.com/LazyVim/LazyVim/commit/381ee0a9fc536a4e1ed9ad3e089f10129f0d50a0))
|
||||||
|
|
||||||
|
## [1.21.2](https://github.com/LazyVim/LazyVim/compare/v1.21.1...v1.21.2) (2023-03-19)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **alpha:** use `AlphaFooter` highlight for footer section ([#461](https://github.com/LazyVim/LazyVim/issues/461)) ([a7b25e1](https://github.com/LazyVim/LazyVim/commit/a7b25e13fa645dea848047e0dda54db9b254ec8e))
|
||||||
|
|
||||||
|
## [1.21.1](https://github.com/LazyVim/LazyVim/compare/v1.21.0...v1.21.1) (2023-03-17)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **config:** compat with lazy.nvim ([501474e](https://github.com/LazyVim/LazyVim/commit/501474e42166e199e61b4e704b266bd0a9625a65))
|
||||||
|
|
||||||
|
## [1.21.0](https://github.com/LazyVim/LazyVim/compare/v1.20.0...v1.21.0) (2023-03-17)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **lsp:** added keymap to see source actions with `<leader>cA` (useful for tsserver and others) ([9f5a0f1](https://github.com/LazyVim/LazyVim/commit/9f5a0f1bd847663deea9cb48a178b85d7bdb3ec6))
|
||||||
|
|
||||||
|
## [1.20.0](https://github.com/LazyVim/LazyVim/compare/v1.19.0...v1.20.0) (2023-03-17)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **lsp:** make lsp work when mason-lspconfig is disabled. Fixed [#445](https://github.com/LazyVim/LazyVim/issues/445) ([c10e550](https://github.com/LazyVim/LazyVim/commit/c10e550639caef68146d122d9bc4a66f2f38650a))
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **icons:** replace obsolete icons ([#441](https://github.com/LazyVim/LazyVim/issues/441)) ([cec000d](https://github.com/LazyVim/LazyVim/commit/cec000dfd863bd681a5195eb71c0797f5d030062))
|
||||||
|
|
||||||
|
## [1.19.0](https://github.com/LazyVim/LazyVim/compare/v1.18.2...v1.19.0) (2023-03-14)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **mini-starter:** add Session restore to starter menu ([#421](https://github.com/LazyVim/LazyVim/issues/421)) ([bcdcfab](https://github.com/LazyVim/LazyVim/commit/bcdcfab020308a90c8cb347cf63d318f4cb05941))
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **core:** set `cond=true` for LazyVim ([df6ac59](https://github.com/LazyVim/LazyVim/commit/df6ac591baf8ab2ef40e3ddcaf34ed124f42469f))
|
||||||
|
|
||||||
|
## [1.18.2](https://github.com/LazyVim/LazyVim/compare/v1.18.1...v1.18.2) (2023-03-12)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **lsp:** allow `silent=false` for lsp keymaps. Fixes [#414](https://github.com/LazyVim/LazyVim/issues/414) ([a28885b](https://github.com/LazyVim/LazyVim/commit/a28885be3f2428c993a3133f283d5648b6fa6b94))
|
||||||
|
|
||||||
|
## [1.18.1](https://github.com/LazyVim/LazyVim/compare/v1.18.0...v1.18.1) (2023-03-10)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **prettier:** extend ensure_installed instead of overwriting it. Fixes [#406](https://github.com/LazyVim/LazyVim/issues/406) ([9f30a2e](https://github.com/LazyVim/LazyVim/commit/9f30a2e03a66775bcbf3601e7a46e0aacf1bb291))
|
||||||
|
|
||||||
|
## [1.18.0](https://github.com/LazyVim/LazyVim/compare/v1.17.1...v1.18.0) (2023-03-10)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **copilot:** better sorting for cmp sources when using copilot ([23ba877](https://github.com/LazyVim/LazyVim/commit/23ba877bb07f17a44af60e341be9f246ece5c133))
|
||||||
|
* **eslint:** added an extra for eslint lsp that runs EslintFixAll before saving a buffer ([75299da](https://github.com/LazyVim/LazyVim/commit/75299da24c4982f0d3ec6c9c3fbad7f94aa9eb72))
|
||||||
|
* **null-ls:** added .neoconf.json to null-ls root_dir ([5aad574](https://github.com/LazyVim/LazyVim/commit/5aad5749a745f928b0a1954917467f04c84e8a07))
|
||||||
|
* **null-ls:** added fish_indent and fish diag ([8f3834b](https://github.com/LazyVim/LazyVim/commit/8f3834bc13c6ca5acf82c1e44c5c250799d683a0))
|
||||||
|
* **prettierd:** added an extra for prettierd with null-ls ([aa8bae0](https://github.com/LazyVim/LazyVim/commit/aa8bae07aea7a81e2f507e1920fd84a6b83c34ad))
|
||||||
|
* **shfmt:** added shfmt to null-ls and mason ([c407ddf](https://github.com/LazyVim/LazyVim/commit/c407ddfe8ab36608ba1fe1c1d4f6723cce506a01))
|
||||||
|
* **typescript:** added null-ls typescript code actions ([5bb2314](https://github.com/LazyVim/LazyVim/commit/5bb23147877b3fcbe4cc28c0a7d820bcb52bb141))
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **eslint:** only run EslintFixAll on buffers where eslint is attached ([f1dbd09](https://github.com/LazyVim/LazyVim/commit/f1dbd097e4461c322d6982c925d605a6ed57a4b2))
|
||||||
|
|
||||||
|
## [1.17.1](https://github.com/LazyVim/LazyVim/compare/v1.17.0...v1.17.1) (2023-03-05)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **copilot:** confirm with replace for copilot only ([079d396](https://github.com/LazyVim/LazyVim/commit/079d3967d03d47b95bdec10bb2621db1c4a07dce))
|
||||||
|
|
||||||
|
## [1.17.0](https://github.com/LazyVim/LazyVim/compare/v1.16.0...v1.17.0) (2023-03-05)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* add luap to nvim-treesitter ensure_installed ([#383](https://github.com/LazyVim/LazyVim/issues/383)) ([f441faa](https://github.com/LazyVim/LazyVim/commit/f441faad03501198a4a1ed52bca48aac3c7158c3))
|
||||||
|
* **autocmds:** added 'query' to close_with_q autocmd ([2e951e4](https://github.com/LazyVim/LazyVim/commit/2e951e4f4414ba88895b1ddc3a189dd3213be404))
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **mason:** removed installing of shellcheck and shfmt. Use bashls instead ([e7a515e](https://github.com/LazyVim/LazyVim/commit/e7a515e5481e6cd2f00e8da523454713009f12a5))
|
||||||
|
* rename more appropriately (also a typo) ([#378](https://github.com/LazyVim/LazyVim/issues/378)) ([9dd2487](https://github.com/LazyVim/LazyVim/commit/9dd2487529d6012088e86f089c445549aa4b37bb))
|
||||||
|
* **typescript:** enable function call completion snippets ([6fec14e](https://github.com/LazyVim/LazyVim/commit/6fec14e5082363ab87efb169f312a396e5e2dbb7))
|
||||||
|
|
||||||
|
## [1.16.0](https://github.com/LazyVim/LazyVim/compare/v1.15.0...v1.16.0) (2023-03-03)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **neo-tree:** added expanders ([57c2dcb](https://github.com/LazyVim/LazyVim/commit/57c2dcb3a35704a849ea8ba210f963c22fb6d1ce))
|
||||||
|
|
||||||
|
## [1.15.0](https://github.com/LazyVim/LazyVim/compare/v1.14.1...v1.15.0) (2023-03-03)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **cmp:** added `<s-CR>` to confirm completion with replace ([3a52307](https://github.com/LazyVim/LazyVim/commit/3a523075057f346451075454a96b1ca355f7592a))
|
||||||
|
* **copilot:** added an extra to enable copilot. `{import = "lazyvim.plugins.extras.coding.copilot"}` ([368c65e](https://github.com/LazyVim/LazyVim/commit/368c65e14b1155d051b4aa6bac91808a2bc5f5ba))
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **luasnip:** added note that jsregexp is optional if it fails to build ([04a60e2](https://github.com/LazyVim/LazyVim/commit/04a60e251b1c2437ad6d0a237fbacc1848d4aac1))
|
||||||
|
|
||||||
|
## [1.14.1](https://github.com/LazyVim/LazyVim/compare/v1.14.0...v1.14.1) (2023-03-02)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **alpha:** larger session icon. Fixes [#365](https://github.com/LazyVim/LazyVim/issues/365) ([d00aade](https://github.com/LazyVim/LazyVim/commit/d00aade8dbb7720b3f501424814ec3dd357b7373))
|
||||||
|
* **leap:** unpin leap ([16e4a3f](https://github.com/LazyVim/LazyVim/commit/16e4a3f8fd5929c9ef2cf2c12b076bcbc947ab36))
|
||||||
|
* **luasnip:** dont build jsregexp on Windows ([f6f3ce4](https://github.com/LazyVim/LazyVim/commit/f6f3ce4a9b7a797653dc290b9485d2ce970af871))
|
||||||
|
|
||||||
|
## [1.14.0](https://github.com/LazyVim/LazyVim/compare/v1.13.1...v1.14.0) (2023-03-01)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **telescope:** Add open selected with trouble keymap ([#357](https://github.com/LazyVim/LazyVim/issues/357)) ([f9b7406](https://github.com/LazyVim/LazyVim/commit/f9b7406df96cf1fad5685865ffef5ec725573f1c))
|
||||||
|
|
||||||
|
## [1.13.1](https://github.com/LazyVim/LazyVim/compare/v1.13.0...v1.13.1) (2023-03-01)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **leap:** pin leap for now till flit issue is fixed ([787ceab](https://github.com/LazyVim/LazyVim/commit/787ceab0311ce20cc37ef2a81dabafdc09f1c624))
|
||||||
|
|
||||||
|
## [1.13.0](https://github.com/LazyVim/LazyVim/compare/v1.12.1...v1.13.0) (2023-02-28)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **keymaps:** Add previous/next trouble/quickfix item keymap `[q`, `]q` ([#299](https://github.com/LazyVim/LazyVim/issues/299)) ([59fa836](https://github.com/LazyVim/LazyVim/commit/59fa83653f3d4f1911e220c2a96a7e47878a16bc))
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **git-signs:** larger icons for delete ([4b37723](https://github.com/LazyVim/LazyVim/commit/4b37723558e45f14c3e8d05fc84ad3a701b9faf0))
|
||||||
|
* **icons:** replace obsolete Nerd icons ([#331](https://github.com/LazyVim/LazyVim/issues/331)) ([588dc5d](https://github.com/LazyVim/LazyVim/commit/588dc5dd65aa3881122aa4e59710de6722423251))
|
||||||
|
* **lsp:** only map lsp goto definition when client has definitionProvider ([#348](https://github.com/LazyVim/LazyVim/issues/348)) ([5abb10b](https://github.com/LazyVim/LazyVim/commit/5abb10b5ab3c2c5462f699fc98f618f39543f8f4))
|
||||||
|
* **luasnips:** make install_jsregexp ([bd62cbe](https://github.com/LazyVim/LazyVim/commit/bd62cbe370a72525a29790c710d3f213c3e184e4))
|
||||||
|
* **mini-indentscope:** disable indentscope for filetypes during init. Fixes [#318](https://github.com/LazyVim/LazyVim/issues/318) ([d97bf66](https://github.com/LazyVim/LazyVim/commit/d97bf66eed76c91eac11c81dad69aff9f632b214))
|
||||||
|
* **treesitter:** always install all built-in treesitter parsers to prevent queriy issues ([fc765e9](https://github.com/LazyVim/LazyVim/commit/fc765e9e3d1fe8dc9f84087a73f12a2b3bbe60c4))
|
||||||
|
|
||||||
|
## [1.12.1](https://github.com/LazyVim/LazyVim/compare/v1.12.0...v1.12.1) (2023-02-20)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **treesitter:** nil check [#312](https://github.com/LazyVim/LazyVim/issues/312) ([#313](https://github.com/LazyVim/LazyVim/issues/313)) ([0eef2c2](https://github.com/LazyVim/LazyVim/commit/0eef2c2f29cc95b6a3da8c9dced215acf60147dc))
|
||||||
|
|
||||||
|
## [1.12.0](https://github.com/LazyVim/LazyVim/compare/v1.11.0...v1.12.0) (2023-02-20)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* persist pinned tabs ([#304](https://github.com/LazyVim/LazyVim/issues/304)) ([6b9f0c0](https://github.com/LazyVim/LazyVim/commit/6b9f0c0c3c16b39a0764632402707822a084af50))
|
||||||
|
* **telescope:** add `<leader>sS` for `:Telescope lsp_workspace_symbols` ([#309](https://github.com/LazyVim/LazyVim/issues/309)) ([cccdc1c](https://github.com/LazyVim/LazyVim/commit/cccdc1cacfa486edcaf67111aa3c6fd9a626ae1f))
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **illuminate:** always set refernce keymaps on the buffer as well to properly overwrite ftplugin mappings. Fixes [#292](https://github.com/LazyVim/LazyVim/issues/292) ([a0cf00c](https://github.com/LazyVim/LazyVim/commit/a0cf00c81b3a4a352cdc26c94112d9a5827881e1))
|
||||||
|
* **mini.surround:** don't create empty keymaps. Fixes [#296](https://github.com/LazyVim/LazyVim/issues/296) ([8e84dcf](https://github.com/LazyVim/LazyVim/commit/8e84dcf85c8a73ebcf6ade6b7b77544f468f1dfa))
|
||||||
|
* **treesitter:** disable indent only for python right now ([de6a28b](https://github.com/LazyVim/LazyVim/commit/de6a28b781e8a06e4f70c913539c97260392131a))
|
||||||
|
* **treesitter:** disable treesitter indent by default, since it has too many issues. See [#297](https://github.com/LazyVim/LazyVim/issues/297) ([329a2da](https://github.com/LazyVim/LazyVim/commit/329a2daff493abd2bd5c8fedbf0dfa13039d3931))
|
||||||
|
|
||||||
## [1.11.0](https://github.com/LazyVim/LazyVim/compare/v1.10.0...v1.11.0) (2023-02-17)
|
## [1.11.0](https://github.com/LazyVim/LazyVim/compare/v1.10.0...v1.11.0) (2023-02-17)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
101
doc/LazyVim.txt
101
doc/LazyVim.txt
|
|
@ -1,4 +1,4 @@
|
||||||
*LazyVim.txt* For Neovim >= 0.8.0 Last change: 2023 February 18
|
*LazyVim.txt* For Neovim >= 0.8.0 Last change: 2023 April 19
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
Table of Contents *LazyVim-table-of-contents*
|
Table of Contents *LazyVim-table-of-contents*
|
||||||
|
|
@ -9,46 +9,29 @@ Table of Contents *LazyVim-table-of-contents*
|
||||||
- File Structure |LazyVim-file-structure|
|
- File Structure |LazyVim-file-structure|
|
||||||
- Configuration |LazyVim-configuration|
|
- Configuration |LazyVim-configuration|
|
||||||
|
|
||||||
<img
|
Install
|
||||||
src="https://user-images.githubusercontent.com/292349/213446185-2db63fd5-8c84-459c-9f04-e286382d6e80.png">
|
|
||||||
|
|
||||||
<hr>
|
|
||||||
|
|
||||||
<h4 align="center">
|
|
||||||
|
|
||||||
<a href="https://lazyvim.github.io/installation">Install</a>
|
|
||||||
·
|
·
|
||||||
<a href="https://lazyvim.github.io/configuration">Configure</a>
|
Configure
|
||||||
·
|
·
|
||||||
<a href="https://lazyvim.github.io">Docs</a>
|
Docs
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</h4>
|
|
||||||
|
|
||||||
<div align="center">
|
|
||||||
|
|
||||||
<a href="https://github.com/LazyVim/LazyVim/releases/latest">
|
|
||||||
<img alt="Latest release" src="https://img.shields.io/github/v/release/LazyVim/LazyVim?style=for-the-badge&logo=starship&color=C9CBFF&logoColor=D9E0EE&labelColor=302D41&include_prerelease&sort=semver" />
|
|
||||||
</a>
|
|
||||||
<a href="https://github.com/LazyVim/LazyVim/pulse">
|
|
||||||
<img alt="Last commit" src="https://img.shields.io/github/last-commit/LazyVim/LazyVim?style=for-the-badge&logo=starship&color=8bd5ca&logoColor=D9E0EE&labelColor=302D41"/>
|
|
||||||
</a>
|
|
||||||
<a href="https://github.com/LazyVim/LazyVim/blob/main/LICENSE">
|
|
||||||
<img alt="License" src="https://img.shields.io/github/license/LazyVim/LazyVim?style=for-the-badge&logo=starship&color=ee999f&logoColor=D9E0EE&labelColor=302D41" />
|
|
||||||
</a>
|
|
||||||
<a href="https://github.com/LazyVim/LazyVim/stargazers">
|
|
||||||
<img alt="Stars" src="https://img.shields.io/github/stars/LazyVim/LazyVim?style=for-the-badge&logo=starship&color=c69ff5&logoColor=D9E0EE&labelColor=302D41" />
|
|
||||||
</a>
|
|
||||||
<a href="https://github.com/LazyVim/LazyVim/issues">
|
|
||||||
<img alt="Issues" src="https://img.shields.io/github/issues/LazyVim/LazyVim?style=for-the-badge&logo=bilibili&color=F5E0DC&logoColor=D9E0EE&labelColor=302D41" />
|
|
||||||
</a>
|
|
||||||
<a href="https://github.com/LazyVim/LazyVim">
|
|
||||||
<img alt="Repo Size" src="https://img.shields.io/github/repo-size/LazyVim/LazyVim?color=%23DDB6F2&label=SIZE&logo=codesandbox&style=for-the-badge&logoColor=D9E0EE&labelColor=302D41" />
|
|
||||||
</a>
|
|
||||||
<a href="https://twitter.com/intent/follow?screen_name=folke">
|
|
||||||
<img alt="follow on Twitter" src="https://img.shields.io/twitter/follow/folke?style=for-the-badge&logo=twitter&color=8aadf3&logoColor=D9E0EE&labelColor=302D41" />
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
LazyVim is a Neovim setup powered by lazy.nvim
|
LazyVim is a Neovim setup powered by lazy.nvim
|
||||||
<https://github.com/folke/lazy.nvim> to make it easy to customize and extend
|
<https://github.com/folke/lazy.nvim> to make it easy to customize and extend
|
||||||
|
|
@ -57,15 +40,6 @@ using a pre-made distro, LazyVim offers the best of both worlds - the
|
||||||
flexibility to tweak your config as needed, along with the convenience of a
|
flexibility to tweak your config as needed, along with the convenience of a
|
||||||
pre-configured setup.
|
pre-configured setup.
|
||||||
|
|
||||||
<div class="figure">
|
|
||||||
<img src="https://user-images.githubusercontent.com/292349/211285846-0b7bb3bf-0462-4029-b64c-4ee1d037fc1c.png" title="fig:"/>
|
|
||||||
<p class="caption">image</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="figure">
|
|
||||||
<img src="https://user-images.githubusercontent.com/292349/213447056-92290767-ea16-430c-8727-ce994c93e9cc.png" title="fig:"/>
|
|
||||||
<p class="caption">image</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
FEATURES *LazyVim-features*
|
FEATURES *LazyVim-features*
|
||||||
|
|
||||||
|
|
@ -82,7 +56,7 @@ REQUIREMENTS *LazyVim-requirements*
|
||||||
|
|
||||||
- Neovim >= **0.8.0** (needs to be built with **LuaJIT**)
|
- Neovim >= **0.8.0** (needs to be built with **LuaJIT**)
|
||||||
- Git >= **2.19.0** (for partial clones support)
|
- Git >= **2.19.0** (for partial clones support)
|
||||||
- a Nerd Font <https://www.nerdfonts.com/> **_(optional)_**
|
- a Nerd Font <https://www.nerdfonts.com/> **(optional)**
|
||||||
|
|
||||||
|
|
||||||
GETTING STARTED *LazyVim-getting-started*
|
GETTING STARTED *LazyVim-getting-started*
|
||||||
|
|
@ -90,7 +64,7 @@ GETTING STARTED *LazyVim-getting-started*
|
||||||
You can find a starter template for **LazyVim** here
|
You can find a starter template for **LazyVim** here
|
||||||
<https://github.com/LazyVim/starter>
|
<https://github.com/LazyVim/starter>
|
||||||
|
|
||||||
Try it with Docker
|
Try it with Docker ~
|
||||||
|
|
||||||
>sh
|
>sh
|
||||||
docker run -w /root -it --rm alpine:edge sh -uelic '
|
docker run -w /root -it --rm alpine:edge sh -uelic '
|
||||||
|
|
@ -101,8 +75,7 @@ Try it with Docker
|
||||||
'
|
'
|
||||||
<
|
<
|
||||||
|
|
||||||
|
Install the LazyVim Starter ~
|
||||||
Install the <a href="https://github.com/LazyVim/starter">LazyVim Starter</a>
|
|
||||||
|
|
||||||
|
|
||||||
- Make a backup of your current Neovim files:
|
- Make a backup of your current Neovim files:
|
||||||
|
|
@ -124,44 +97,36 @@ Install the <a href="https://github.com/LazyVim/starter">LazyVim Starter</a>
|
||||||
<
|
<
|
||||||
Refer to the comments in the files on how to customize **LazyVim**.
|
Refer to the comments in the files on how to customize **LazyVim**.
|
||||||
|
|
||||||
|
|
||||||
------------------------------------------------------------------------------
|
------------------------------------------------------------------------------
|
||||||
|
There’s a great video created by @elijahmanor
|
||||||
|
<https://github.com/elijahmanor> with a walkthrough to get started.
|
||||||
|
|
||||||
There’s a great video created by elijahmano <https://github.com/elijahmanor>
|
|
||||||
with a walkthrough to get started.
|
|
||||||
|
|
||||||
<img src='https://img.youtube.com/vi/N93cTbtLCIM/hqdefault.jpg' title=''/>
|
|
||||||
<https://www.youtube.com/watch?v=N93cTbtLCIM>
|
<https://www.youtube.com/watch?v=N93cTbtLCIM>
|
||||||
|
|
||||||
|
|
||||||
FILE STRUCTURE *LazyVim-file-structure*
|
FILE STRUCTURE *LazyVim-file-structure*
|
||||||
|
|
||||||
The files under config will be automatically loaded at the appropriate time, so
|
The files under config will be automatically loaded at the appropriate time, so
|
||||||
you don’t need to require those files manually. **LazyVim** comes with a set
|
you don’t need to require those files manually. **LazyVim** comes with a set
|
||||||
of default config files that will be loaded **_before_** your own. See here
|
of default config files that will be loaded **before** your own. See here
|
||||||
<https://github.com/LazyVim/LazyVim/tree/main/lua/lazyvim/config>
|
<https://github.com/LazyVim/LazyVim/tree/main/lua/lazyvim/config>
|
||||||
|
|
||||||
You can add your custom plugin specs under `lua/plugins/`. All files there will
|
You can add your custom plugin specs under `lua/plugins/`. All files there will
|
||||||
be automatically loaded by lazy.nvim <https://github.com/folke/lazy.nvim>
|
be automatically loaded by lazy.nvim <https://github.com/folke/lazy.nvim>
|
||||||
|
|
||||||
<pre>
|
|
||||||
~/.config/nvim
|
|
||||||
lua
|
|
||||||
config
|
|
||||||
autocmds.lua
|
|
||||||
keymaps.lua
|
|
||||||
lazy.lua
|
|
||||||
options.lua
|
|
||||||
plugins
|
|
||||||
spec1.lua
|
|
||||||
|
|
||||||
spec2.lua
|
|
||||||
init.lua
|
|
||||||
</pre>
|
|
||||||
|
|
||||||
CONFIGURATION *LazyVim-configuration*
|
CONFIGURATION *LazyVim-configuration*
|
||||||
|
|
||||||
Refer to the docs <https://lazyvim.github.io>
|
Refer to the docs <https://lazyvim.github.io>
|
||||||
|
|
||||||
|
==============================================================================
|
||||||
|
1. Links *LazyVim-links*
|
||||||
|
|
||||||
|
1. *image*: https://user-images.githubusercontent.com/292349/211285846-0b7bb3bf-0462-4029-b64c-4ee1d037fc1c.png
|
||||||
|
2. *image*: https://user-images.githubusercontent.com/292349/213447056-92290767-ea16-430c-8727-ce994c93e9cc.png
|
||||||
|
3. *@elijahmanor*:
|
||||||
|
4. *Watch the video*: https://img.youtube.com/vi/N93cTbtLCIM/hqdefault.jpg
|
||||||
|
|
||||||
Generated by panvimdoc <https://github.com/kdheepak/panvimdoc>
|
Generated by panvimdoc <https://github.com/kdheepak/panvimdoc>
|
||||||
|
|
||||||
vim:tw=78:ts=8:noet:ft=help:norl:
|
vim:tw=78:ts=8:noet:ft=help:norl:
|
||||||
|
|
|
||||||
|
|
@ -42,15 +42,16 @@ vim.api.nvim_create_autocmd("BufReadPost", {
|
||||||
vim.api.nvim_create_autocmd("FileType", {
|
vim.api.nvim_create_autocmd("FileType", {
|
||||||
group = augroup("close_with_q"),
|
group = augroup("close_with_q"),
|
||||||
pattern = {
|
pattern = {
|
||||||
"qf",
|
"PlenaryTestPopup",
|
||||||
"help",
|
"help",
|
||||||
|
"lspinfo",
|
||||||
"man",
|
"man",
|
||||||
"notify",
|
"notify",
|
||||||
"lspinfo",
|
"qf",
|
||||||
"spectre_panel",
|
"spectre_panel",
|
||||||
"startuptime",
|
"startuptime",
|
||||||
"tsplayground",
|
"tsplayground",
|
||||||
"PlenaryTestPopup",
|
"checkhealth",
|
||||||
},
|
},
|
||||||
callback = function(event)
|
callback = function(event)
|
||||||
vim.bo[event.buf].buflisted = false
|
vim.bo[event.buf].buflisted = false
|
||||||
|
|
@ -67,3 +68,15 @@ vim.api.nvim_create_autocmd("FileType", {
|
||||||
vim.opt_local.spell = true
|
vim.opt_local.spell = true
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
-- Auto create dir when saving a file, in case some intermediate directory does not exist
|
||||||
|
vim.api.nvim_create_autocmd({ "BufWritePre" }, {
|
||||||
|
group = augroup("auto_create_dir"),
|
||||||
|
callback = function(event)
|
||||||
|
if event.match:match("^%w%w+://") then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
local file = vim.loop.fs_realpath(event.match) or event.match
|
||||||
|
vim.fn.mkdir(vim.fn.fnamemodify(file, ":p:h"), "p")
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
|
||||||
|
|
@ -14,14 +14,22 @@ local defaults = {
|
||||||
defaults = {
|
defaults = {
|
||||||
autocmds = true, -- lazyvim.config.autocmds
|
autocmds = true, -- lazyvim.config.autocmds
|
||||||
keymaps = true, -- lazyvim.config.keymaps
|
keymaps = true, -- lazyvim.config.keymaps
|
||||||
options = true, -- lazyvim.config.options
|
-- lazyvim.config.options can't be configured here since that's loaded before lazyvim setup
|
||||||
|
-- if you want to disable loading options, add `package.loaded["lazyvim.config.options"] = true` to the top of your init.lua
|
||||||
},
|
},
|
||||||
-- icons used by other plugins
|
-- icons used by other plugins
|
||||||
icons = {
|
icons = {
|
||||||
|
dap = {
|
||||||
|
Stopped = { " ", "DiagnosticWarn", "DapStoppedLine" },
|
||||||
|
Breakpoint = " ",
|
||||||
|
BreakpointCondition = " ",
|
||||||
|
BreakpointRejected = { " ", "DiagnosticError" },
|
||||||
|
LogPoint = ".>",
|
||||||
|
},
|
||||||
diagnostics = {
|
diagnostics = {
|
||||||
Error = " ",
|
Error = " ",
|
||||||
Warn = " ",
|
Warn = " ",
|
||||||
Hint = " ",
|
Hint = " ",
|
||||||
Info = " ",
|
Info = " ",
|
||||||
},
|
},
|
||||||
git = {
|
git = {
|
||||||
|
|
@ -42,7 +50,7 @@ local defaults = {
|
||||||
Event = " ",
|
Event = " ",
|
||||||
Field = " ",
|
Field = " ",
|
||||||
File = " ",
|
File = " ",
|
||||||
Folder = " ",
|
Folder = " ",
|
||||||
Function = " ",
|
Function = " ",
|
||||||
Interface = " ",
|
Interface = " ",
|
||||||
Key = " ",
|
Key = " ",
|
||||||
|
|
@ -50,7 +58,7 @@ local defaults = {
|
||||||
Method = " ",
|
Method = " ",
|
||||||
Module = " ",
|
Module = " ",
|
||||||
Namespace = " ",
|
Namespace = " ",
|
||||||
Null = "ﳠ ",
|
Null = " ",
|
||||||
Number = " ",
|
Number = " ",
|
||||||
Object = " ",
|
Object = " ",
|
||||||
Operator = " ",
|
Operator = " ",
|
||||||
|
|
@ -132,15 +140,16 @@ function M.load(name)
|
||||||
end, {
|
end, {
|
||||||
msg = "Failed loading " .. mod,
|
msg = "Failed loading " .. mod,
|
||||||
on_error = function(msg)
|
on_error = function(msg)
|
||||||
local modpath = require("lazy.core.cache").find(mod)
|
local info = require("lazy.core.cache").find(mod)
|
||||||
if modpath then
|
if info == nil or (type(info) == "table" and #info == 0) then
|
||||||
Util.error(msg)
|
return
|
||||||
end
|
end
|
||||||
|
Util.error(msg)
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
-- always load lazyvim, then user file
|
-- always load lazyvim, then user file
|
||||||
if M.defaults[name] then
|
if M.defaults[name] or name == "options" then
|
||||||
_load("lazyvim.config." .. name)
|
_load("lazyvim.config." .. name)
|
||||||
end
|
end
|
||||||
_load("config." .. name)
|
_load("config." .. name)
|
||||||
|
|
|
||||||
|
|
@ -64,8 +64,7 @@ map(
|
||||||
{ desc = "Redraw / clear hlsearch / diff update" }
|
{ desc = "Redraw / clear hlsearch / diff update" }
|
||||||
)
|
)
|
||||||
|
|
||||||
map("n", "gw", "*N")
|
map({ "n", "x" }, "gw", "*N", { desc = "Search word under cursor" })
|
||||||
map("x", "gw", "*N")
|
|
||||||
|
|
||||||
-- https://github.com/mhinz/vim-galore#saner-behavior-of-n-and-n
|
-- https://github.com/mhinz/vim-galore#saner-behavior-of-n-and-n
|
||||||
map("n", "n", "'Nn'[v:searchforward]", { expr = true, desc = "Next search result" })
|
map("n", "n", "'Nn'[v:searchforward]", { expr = true, desc = "Next search result" })
|
||||||
|
|
@ -96,6 +95,11 @@ map("n", "<leader>fn", "<cmd>enew<cr>", { desc = "New File" })
|
||||||
map("n", "<leader>xl", "<cmd>lopen<cr>", { desc = "Location List" })
|
map("n", "<leader>xl", "<cmd>lopen<cr>", { desc = "Location List" })
|
||||||
map("n", "<leader>xq", "<cmd>copen<cr>", { desc = "Quickfix List" })
|
map("n", "<leader>xq", "<cmd>copen<cr>", { desc = "Quickfix List" })
|
||||||
|
|
||||||
|
if not Util.has("trouble.nvim") then
|
||||||
|
map("n", "[q", vim.cmd.cprev, { desc = "Previous quickfix" })
|
||||||
|
map("n", "]q", vim.cmd.cnext, { desc = "Next quickfix" })
|
||||||
|
end
|
||||||
|
|
||||||
-- stylua: ignore start
|
-- stylua: ignore start
|
||||||
|
|
||||||
-- toggle options
|
-- toggle options
|
||||||
|
|
@ -108,8 +112,8 @@ local conceallevel = vim.o.conceallevel > 0 and vim.o.conceallevel or 3
|
||||||
map("n", "<leader>uc", function() Util.toggle("conceallevel", false, {0, conceallevel}) end, { desc = "Toggle Conceal" })
|
map("n", "<leader>uc", function() Util.toggle("conceallevel", false, {0, conceallevel}) end, { desc = "Toggle Conceal" })
|
||||||
|
|
||||||
-- lazygit
|
-- lazygit
|
||||||
map("n", "<leader>gg", function() Util.float_term({ "lazygit" }, { cwd = Util.get_root() }) end, { desc = "Lazygit (root dir)" })
|
map("n", "<leader>gg", function() Util.float_term({ "lazygit" }, { cwd = Util.get_root(), esc_esc = false }) end, { desc = "Lazygit (root dir)" })
|
||||||
map("n", "<leader>gG", function() Util.float_term({ "lazygit" }) end, { desc = "Lazygit (cwd)" })
|
map("n", "<leader>gG", function() Util.float_term({ "lazygit" }, {esc_esc = false}) end, { desc = "Lazygit (cwd)" })
|
||||||
|
|
||||||
-- quit
|
-- quit
|
||||||
map("n", "<leader>qq", "<cmd>qa<cr>", { desc = "Quit all" })
|
map("n", "<leader>qq", "<cmd>qa<cr>", { desc = "Quit all" })
|
||||||
|
|
@ -122,7 +126,7 @@ end
|
||||||
-- floating terminal
|
-- floating terminal
|
||||||
map("n", "<leader>ft", function() Util.float_term(nil, { cwd = Util.get_root() }) end, { desc = "Terminal (root dir)" })
|
map("n", "<leader>ft", function() Util.float_term(nil, { cwd = Util.get_root() }) end, { desc = "Terminal (root dir)" })
|
||||||
map("n", "<leader>fT", function() Util.float_term() end, { desc = "Terminal (cwd)" })
|
map("n", "<leader>fT", function() Util.float_term() end, { desc = "Terminal (cwd)" })
|
||||||
map("t", "<esc><esc>", "<c-\\><c-n>", {desc = "Enter Normal Mode"})
|
map("t", "<esc><esc>", "<c-\\><c-n>", { desc = "Enter Normal Mode" })
|
||||||
|
|
||||||
-- windows
|
-- windows
|
||||||
map("n", "<leader>ww", "<C-W>p", { desc = "Other window" })
|
map("n", "<leader>ww", "<C-W>p", { desc = "Other window" })
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,4 @@
|
||||||
-- This file is automatically loaded by plugins.config
|
-- This file is automatically loaded by plugins.config
|
||||||
|
|
||||||
vim.g.mapleader = " "
|
vim.g.mapleader = " "
|
||||||
vim.g.maplocalleader = " "
|
vim.g.maplocalleader = " "
|
||||||
|
|
||||||
|
|
@ -28,7 +27,7 @@ opt.scrolloff = 4 -- Lines of context
|
||||||
opt.sessionoptions = { "buffers", "curdir", "tabpages", "winsize" }
|
opt.sessionoptions = { "buffers", "curdir", "tabpages", "winsize" }
|
||||||
opt.shiftround = true -- Round indent
|
opt.shiftround = true -- Round indent
|
||||||
opt.shiftwidth = 2 -- Size of an indent
|
opt.shiftwidth = 2 -- Size of an indent
|
||||||
opt.shortmess:append { W = true, I = true, c = true }
|
opt.shortmess:append({ W = true, I = true, c = true })
|
||||||
opt.showmode = false -- Dont show mode since we have a statusline
|
opt.showmode = false -- Dont show mode since we have a statusline
|
||||||
opt.sidescrolloff = 8 -- Columns of context
|
opt.sidescrolloff = 8 -- Columns of context
|
||||||
opt.signcolumn = "yes" -- Always show the signcolumn, otherwise it would shift the text each time
|
opt.signcolumn = "yes" -- Always show the signcolumn, otherwise it would shift the text each time
|
||||||
|
|
@ -49,7 +48,7 @@ opt.wrap = false -- Disable line wrap
|
||||||
|
|
||||||
if vim.fn.has("nvim-0.9.0") == 1 then
|
if vim.fn.has("nvim-0.9.0") == 1 then
|
||||||
opt.splitkeep = "screen"
|
opt.splitkeep = "screen"
|
||||||
opt.shortmess:append { C = true }
|
opt.shortmess:append({ C = true })
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Fix markdown indentation settings
|
-- Fix markdown indentation settings
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,9 @@ return {
|
||||||
-- snippets
|
-- snippets
|
||||||
{
|
{
|
||||||
"L3MON4D3/LuaSnip",
|
"L3MON4D3/LuaSnip",
|
||||||
|
build = (not jit.os:find("Windows"))
|
||||||
|
and "echo -e 'NOTE: jsregexp is optional, so not a big deal if it fails to build\n'; make install_jsregexp"
|
||||||
|
or nil,
|
||||||
dependencies = {
|
dependencies = {
|
||||||
"rafamadriz/friendly-snippets",
|
"rafamadriz/friendly-snippets",
|
||||||
config = function()
|
config = function()
|
||||||
|
|
@ -57,6 +60,10 @@ return {
|
||||||
["<C-Space>"] = cmp.mapping.complete(),
|
["<C-Space>"] = cmp.mapping.complete(),
|
||||||
["<C-e>"] = cmp.mapping.abort(),
|
["<C-e>"] = cmp.mapping.abort(),
|
||||||
["<CR>"] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
|
["<CR>"] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
|
||||||
|
["<S-CR>"] = cmp.mapping.confirm({
|
||||||
|
behavior = cmp.ConfirmBehavior.Replace,
|
||||||
|
select = true,
|
||||||
|
}), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
|
||||||
}),
|
}),
|
||||||
sources = cmp.config.sources({
|
sources = cmp.config.sources({
|
||||||
{ name = "nvim_lsp" },
|
{ name = "nvim_lsp" },
|
||||||
|
|
|
||||||
|
|
@ -2,5 +2,5 @@ require("lazyvim.config").init()
|
||||||
|
|
||||||
return {
|
return {
|
||||||
{ "folke/lazy.nvim", version = "*" },
|
{ "folke/lazy.nvim", version = "*" },
|
||||||
{ "LazyVim/LazyVim", priority = 10000, lazy = false, config = true, version = "*" },
|
{ "LazyVim/LazyVim", priority = 10000, lazy = false, config = true, cond = true, version = "*" },
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -46,6 +46,14 @@ return {
|
||||||
["<space>"] = "none",
|
["<space>"] = "none",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
default_component_configs = {
|
||||||
|
indent = {
|
||||||
|
with_expanders = true, -- if nil and file nesting is enabled, will enable expanders
|
||||||
|
expander_collapsed = "",
|
||||||
|
expander_expanded = "",
|
||||||
|
expander_highlight = "NeoTreeExpander",
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -65,7 +73,7 @@ return {
|
||||||
version = false, -- telescope did only one release, so use HEAD for now
|
version = false, -- telescope did only one release, so use HEAD for now
|
||||||
keys = {
|
keys = {
|
||||||
{ "<leader>,", "<cmd>Telescope buffers show_all_buffers=true<cr>", desc = "Switch Buffer" },
|
{ "<leader>,", "<cmd>Telescope buffers show_all_buffers=true<cr>", desc = "Switch Buffer" },
|
||||||
{ "<leader>/", Util.telescope("live_grep"), desc = "Find in Files (Grep)" },
|
{ "<leader>/", Util.telescope("live_grep"), desc = "Grep (root dir)" },
|
||||||
{ "<leader>:", "<cmd>Telescope command_history<cr>", desc = "Command History" },
|
{ "<leader>:", "<cmd>Telescope command_history<cr>", desc = "Command History" },
|
||||||
{ "<leader><space>", Util.telescope("files"), desc = "Find Files (root dir)" },
|
{ "<leader><space>", Util.telescope("files"), desc = "Find Files (root dir)" },
|
||||||
-- find
|
-- find
|
||||||
|
|
@ -81,7 +89,8 @@ return {
|
||||||
{ "<leader>sb", "<cmd>Telescope current_buffer_fuzzy_find<cr>", desc = "Buffer" },
|
{ "<leader>sb", "<cmd>Telescope current_buffer_fuzzy_find<cr>", desc = "Buffer" },
|
||||||
{ "<leader>sc", "<cmd>Telescope command_history<cr>", desc = "Command History" },
|
{ "<leader>sc", "<cmd>Telescope command_history<cr>", desc = "Command History" },
|
||||||
{ "<leader>sC", "<cmd>Telescope commands<cr>", desc = "Commands" },
|
{ "<leader>sC", "<cmd>Telescope commands<cr>", desc = "Commands" },
|
||||||
{ "<leader>sd", "<cmd>Telescope diagnostics<cr>", desc = "Diagnostics" },
|
{ "<leader>sd", "<cmd>Telescope diagnostics bufnr=0<cr>", desc = "Document diagnostics" },
|
||||||
|
{ "<leader>sD", "<cmd>Telescope diagnostics<cr>", desc = "Workspace diagnostics" },
|
||||||
{ "<leader>sg", Util.telescope("live_grep"), desc = "Grep (root dir)" },
|
{ "<leader>sg", Util.telescope("live_grep"), desc = "Grep (root dir)" },
|
||||||
{ "<leader>sG", Util.telescope("live_grep", { cwd = false }), desc = "Grep (cwd)" },
|
{ "<leader>sG", Util.telescope("live_grep", { cwd = false }), desc = "Grep (cwd)" },
|
||||||
{ "<leader>sh", "<cmd>Telescope help_tags<cr>", desc = "Help Pages" },
|
{ "<leader>sh", "<cmd>Telescope help_tags<cr>", desc = "Help Pages" },
|
||||||
|
|
@ -112,6 +121,24 @@ return {
|
||||||
}),
|
}),
|
||||||
desc = "Goto Symbol",
|
desc = "Goto Symbol",
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"<leader>sS",
|
||||||
|
Util.telescope("lsp_dynamic_workspace_symbols", {
|
||||||
|
symbols = {
|
||||||
|
"Class",
|
||||||
|
"Function",
|
||||||
|
"Method",
|
||||||
|
"Constructor",
|
||||||
|
"Interface",
|
||||||
|
"Module",
|
||||||
|
"Struct",
|
||||||
|
"Trait",
|
||||||
|
"Field",
|
||||||
|
"Property",
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
desc = "Goto Symbol (Workspace)",
|
||||||
|
},
|
||||||
},
|
},
|
||||||
opts = {
|
opts = {
|
||||||
defaults = {
|
defaults = {
|
||||||
|
|
@ -122,6 +149,9 @@ return {
|
||||||
["<c-t>"] = function(...)
|
["<c-t>"] = function(...)
|
||||||
return require("trouble.providers.telescope").open_with_trouble(...)
|
return require("trouble.providers.telescope").open_with_trouble(...)
|
||||||
end,
|
end,
|
||||||
|
["<a-t>"] = function(...)
|
||||||
|
return require("trouble.providers.telescope").open_selected_with_trouble(...)
|
||||||
|
end,
|
||||||
["<a-i>"] = function()
|
["<a-i>"] = function()
|
||||||
Util.telescope("find_files", { no_ignore = true })()
|
Util.telescope("find_files", { no_ignore = true })()
|
||||||
end,
|
end,
|
||||||
|
|
@ -188,11 +218,7 @@ return {
|
||||||
event = "VeryLazy",
|
event = "VeryLazy",
|
||||||
opts = {
|
opts = {
|
||||||
plugins = { spelling = true },
|
plugins = { spelling = true },
|
||||||
},
|
defaults = {
|
||||||
config = function(_, opts)
|
|
||||||
local wk = require("which-key")
|
|
||||||
wk.setup(opts)
|
|
||||||
local keymaps = {
|
|
||||||
mode = { "n", "v" },
|
mode = { "n", "v" },
|
||||||
["g"] = { name = "+goto" },
|
["g"] = { name = "+goto" },
|
||||||
["gz"] = { name = "+surround" },
|
["gz"] = { name = "+surround" },
|
||||||
|
|
@ -209,11 +235,12 @@ return {
|
||||||
["<leader>u"] = { name = "+ui" },
|
["<leader>u"] = { name = "+ui" },
|
||||||
["<leader>w"] = { name = "+windows" },
|
["<leader>w"] = { name = "+windows" },
|
||||||
["<leader>x"] = { name = "+diagnostics/quickfix" },
|
["<leader>x"] = { name = "+diagnostics/quickfix" },
|
||||||
}
|
},
|
||||||
if Util.has("noice.nvim") then
|
},
|
||||||
keymaps["<leader>sn"] = { name = "+noice" }
|
config = function(_, opts)
|
||||||
end
|
local wk = require("which-key")
|
||||||
wk.register(keymaps)
|
wk.setup(opts)
|
||||||
|
wk.register(opts.defaults)
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -225,8 +252,8 @@ return {
|
||||||
signs = {
|
signs = {
|
||||||
add = { text = "▎" },
|
add = { text = "▎" },
|
||||||
change = { text = "▎" },
|
change = { text = "▎" },
|
||||||
delete = { text = "契" },
|
delete = { text = "" },
|
||||||
topdelete = { text = "契" },
|
topdelete = { text = "" },
|
||||||
changedelete = { text = "▎" },
|
changedelete = { text = "▎" },
|
||||||
untracked = { text = "▎" },
|
untracked = { text = "▎" },
|
||||||
},
|
},
|
||||||
|
|
@ -306,6 +333,28 @@ return {
|
||||||
{ "<leader>xX", "<cmd>TroubleToggle workspace_diagnostics<cr>", desc = "Workspace Diagnostics (Trouble)" },
|
{ "<leader>xX", "<cmd>TroubleToggle workspace_diagnostics<cr>", desc = "Workspace Diagnostics (Trouble)" },
|
||||||
{ "<leader>xL", "<cmd>TroubleToggle loclist<cr>", desc = "Location List (Trouble)" },
|
{ "<leader>xL", "<cmd>TroubleToggle loclist<cr>", desc = "Location List (Trouble)" },
|
||||||
{ "<leader>xQ", "<cmd>TroubleToggle quickfix<cr>", desc = "Quickfix List (Trouble)" },
|
{ "<leader>xQ", "<cmd>TroubleToggle quickfix<cr>", desc = "Quickfix List (Trouble)" },
|
||||||
|
{
|
||||||
|
"[q",
|
||||||
|
function()
|
||||||
|
if require("trouble").is_open() then
|
||||||
|
require("trouble").previous({ skip_groups = true, jump = true })
|
||||||
|
else
|
||||||
|
vim.cmd.cprev()
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
desc = "Previous trouble/quickfix item",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"]q",
|
||||||
|
function()
|
||||||
|
if require("trouble").is_open() then
|
||||||
|
require("trouble").next({ skip_groups = true, jump = true })
|
||||||
|
else
|
||||||
|
vim.cmd.cnext()
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
desc = "Next trouble/quickfix item",
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -322,6 +371,7 @@ return {
|
||||||
{ "<leader>xt", "<cmd>TodoTrouble<cr>", desc = "Todo (Trouble)" },
|
{ "<leader>xt", "<cmd>TodoTrouble<cr>", desc = "Todo (Trouble)" },
|
||||||
{ "<leader>xT", "<cmd>TodoTrouble keywords=TODO,FIX,FIXME<cr>", desc = "Todo/Fix/Fixme (Trouble)" },
|
{ "<leader>xT", "<cmd>TodoTrouble keywords=TODO,FIX,FIXME<cr>", desc = "Todo/Fix/Fixme (Trouble)" },
|
||||||
{ "<leader>st", "<cmd>TodoTelescope<cr>", desc = "Todo" },
|
{ "<leader>st", "<cmd>TodoTelescope<cr>", desc = "Todo" },
|
||||||
|
{ "<leader>sT", "<cmd>TodoTelescope keywords=TODO,FIX,FIXME<cr>", desc = "Todo/Fix/Fixme" },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
||||||
76
lua/lazyvim/plugins/extras/coding/copilot.lua
Normal file
76
lua/lazyvim/plugins/extras/coding/copilot.lua
Normal file
|
|
@ -0,0 +1,76 @@
|
||||||
|
return {
|
||||||
|
|
||||||
|
-- copilot
|
||||||
|
{
|
||||||
|
"zbirenbaum/copilot.lua",
|
||||||
|
cmd = "Copilot",
|
||||||
|
build = ":Copilot auth",
|
||||||
|
opts = {
|
||||||
|
suggestion = { enabled = false },
|
||||||
|
panel = { enabled = false },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
-- copilot cmp source
|
||||||
|
{
|
||||||
|
"nvim-cmp",
|
||||||
|
dependencies = {
|
||||||
|
{
|
||||||
|
"zbirenbaum/copilot-cmp",
|
||||||
|
dependencies = "copilot.lua",
|
||||||
|
opts = {},
|
||||||
|
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
|
||||||
|
require("lazyvim.util").on_attach(function(client)
|
||||||
|
if client.name == "copilot" then
|
||||||
|
copilot_cmp._on_insert_enter()
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
---@param opts cmp.ConfigSchema
|
||||||
|
opts = function(_, opts)
|
||||||
|
local cmp = require("cmp")
|
||||||
|
|
||||||
|
table.insert(opts.sources, 1, { name = "copilot", group_index = 2 })
|
||||||
|
|
||||||
|
local confirm = opts.mapping["<CR>"]
|
||||||
|
local confirm_copilot = cmp.mapping.confirm({
|
||||||
|
select = true,
|
||||||
|
behavior = cmp.ConfirmBehavior.Replace,
|
||||||
|
})
|
||||||
|
|
||||||
|
opts.mapping = vim.tbl_extend("force", opts.mapping, {
|
||||||
|
["<CR>"] = function(...)
|
||||||
|
local entry = cmp.get_selected_entry()
|
||||||
|
if entry and entry.source.name == "copilot" then
|
||||||
|
return confirm_copilot(...)
|
||||||
|
end
|
||||||
|
return confirm(...)
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
opts.sorting = {
|
||||||
|
priority_weight = 2,
|
||||||
|
comparators = {
|
||||||
|
require("copilot_cmp.comparators").prioritize,
|
||||||
|
|
||||||
|
-- Below is the default comparitor list and order for nvim-cmp
|
||||||
|
cmp.config.compare.offset,
|
||||||
|
-- cmp.config.compare.scopes, --this is commented in nvim-cmp too
|
||||||
|
cmp.config.compare.exact,
|
||||||
|
cmp.config.compare.score,
|
||||||
|
cmp.config.compare.recently_used,
|
||||||
|
cmp.config.compare.locality,
|
||||||
|
cmp.config.compare.kind,
|
||||||
|
cmp.config.compare.sort_text,
|
||||||
|
cmp.config.compare.length,
|
||||||
|
cmp.config.compare.order,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
}
|
||||||
103
lua/lazyvim/plugins/extras/dap/core.lua
Normal file
103
lua/lazyvim/plugins/extras/dap/core.lua
Normal file
|
|
@ -0,0 +1,103 @@
|
||||||
|
return {
|
||||||
|
"mfussenegger/nvim-dap",
|
||||||
|
|
||||||
|
dependencies = {
|
||||||
|
|
||||||
|
-- fancy UI for the debugger
|
||||||
|
{
|
||||||
|
"rcarriga/nvim-dap-ui",
|
||||||
|
-- stylua: ignore
|
||||||
|
keys = {
|
||||||
|
{ "<leader>du", function() require("dapui").toggle({ }) end, desc = "Dap UI" },
|
||||||
|
{ "<leader>de", function() require("dapui").eval() end, desc = "Eval", mode = {"n", "v"} },
|
||||||
|
},
|
||||||
|
opts = {},
|
||||||
|
config = function(_, opts)
|
||||||
|
local dap = require("dap")
|
||||||
|
local dapui = require("dapui")
|
||||||
|
dapui.setup(opts)
|
||||||
|
dap.listeners.after.event_initialized["dapui_config"] = function()
|
||||||
|
dapui.open({})
|
||||||
|
end
|
||||||
|
dap.listeners.before.event_terminated["dapui_config"] = function()
|
||||||
|
dapui.close({})
|
||||||
|
end
|
||||||
|
dap.listeners.before.event_exited["dapui_config"] = function()
|
||||||
|
dapui.close({})
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
|
-- virtual text for the debugger
|
||||||
|
{
|
||||||
|
"theHamsta/nvim-dap-virtual-text",
|
||||||
|
opts = {},
|
||||||
|
},
|
||||||
|
|
||||||
|
-- which key integration
|
||||||
|
{
|
||||||
|
"folke/which-key.nvim",
|
||||||
|
opts = {
|
||||||
|
defaults = {
|
||||||
|
["<leader>d"] = { name = "+debug" },
|
||||||
|
["<leader>da"] = { name = "+adapters" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
-- mason.nvim integration
|
||||||
|
{
|
||||||
|
"jay-babu/mason-nvim-dap.nvim",
|
||||||
|
dependencies = "mason.nvim",
|
||||||
|
cmd = { "DapInstall", "DapUninstall" },
|
||||||
|
opts = {
|
||||||
|
-- Makes a best effort to setup the various debuggers with
|
||||||
|
-- reasonable debug configurations
|
||||||
|
automatic_setup = true,
|
||||||
|
|
||||||
|
-- You can provide additional configuration to the handlers,
|
||||||
|
-- see mason-nvim-dap README for more information
|
||||||
|
handlers = {},
|
||||||
|
|
||||||
|
-- You'll need to check that you have the required things installed
|
||||||
|
-- online, please don't ask me how to install them :)
|
||||||
|
ensure_installed = {
|
||||||
|
-- Update this to ensure that you have the debuggers for the langs you want
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
-- stylua: ignore
|
||||||
|
keys = {
|
||||||
|
{ "<leader>dB", function() require("dap").set_breakpoint(vim.fn.input('Breakpoint condition: ')) end, desc = "Breakpoint Condition" },
|
||||||
|
{ "<leader>db", function() require("dap").toggle_breakpoint() end, desc = "Toggle Breakpoint" },
|
||||||
|
{ "<leader>dc", function() require("dap").continue() end, desc = "Continue" },
|
||||||
|
{ "<leader>dC", function() require("dap").run_to_cursor() end, desc = "Run to Cursor" },
|
||||||
|
{ "<leader>dg", function() require("dap").goto_() end, desc = "Go to line (no execute)" },
|
||||||
|
{ "<leader>di", function() require("dap").step_into() end, desc = "Step Into" },
|
||||||
|
{ "<leader>dj", function() require("dap").down() end, desc = "Down" },
|
||||||
|
{ "<leader>dk", function() require("dap").up() end, desc = "Up" },
|
||||||
|
{ "<leader>dl", function() require("dap").run_last() end, desc = "Run Last" },
|
||||||
|
{ "<leader>do", function() require("dap").step_out() end, desc = "Step Out" },
|
||||||
|
{ "<leader>dO", function() require("dap").step_over() end, desc = "Step Over" },
|
||||||
|
{ "<leader>dp", function() require("dap").pause() end, desc = "Pause" },
|
||||||
|
{ "<leader>dr", function() require("dap").repl.open() end, desc = "Repl" },
|
||||||
|
{ "<leader>ds", function() require("dap").session() end, desc = "Session" },
|
||||||
|
{ "<leader>dt", function() require("dap").terminate() end, desc = "Terminate" },
|
||||||
|
{ "<leader>dw", function() require("dap.ui.widgets").hover() end, desc = "Widgets" },
|
||||||
|
},
|
||||||
|
|
||||||
|
config = function()
|
||||||
|
local Config = require("lazyvim.config")
|
||||||
|
vim.api.nvim_set_hl(0, "DapStoppedLine", { default = true, link = "Visual" })
|
||||||
|
|
||||||
|
for name, sign in pairs(Config.icons.dap) do
|
||||||
|
sign = type(sign) == "table" and sign or { sign }
|
||||||
|
vim.fn.sign_define(
|
||||||
|
"Dap" .. name,
|
||||||
|
{ text = sign[1], texthl = sign[2] or "DiagnosticInfo", linehl = sign[3], numhl = sign[3] }
|
||||||
|
)
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
}
|
||||||
27
lua/lazyvim/plugins/extras/dap/nlua.lua
Normal file
27
lua/lazyvim/plugins/extras/dap/nlua.lua
Normal file
|
|
@ -0,0 +1,27 @@
|
||||||
|
return {
|
||||||
|
"mfussenegger/nvim-dap",
|
||||||
|
|
||||||
|
dependencies = {
|
||||||
|
{
|
||||||
|
"jbyuki/one-small-step-for-vimkind",
|
||||||
|
-- stylua: ignore
|
||||||
|
keys = {
|
||||||
|
{ "<leader>daL", function() require("osv").launch({ port = 8086 }) end, desc = "Adapter Lua Server" },
|
||||||
|
{ "<leader>dal", function() require("osv").run_this() end, desc = "Adapter Lua" },
|
||||||
|
},
|
||||||
|
config = function()
|
||||||
|
local dap = require("dap")
|
||||||
|
dap.adapters.nlua = function(callback, config)
|
||||||
|
callback({ type = "server", host = config.host or "127.0.0.1", port = config.port or 8086 })
|
||||||
|
end
|
||||||
|
dap.configurations.lua = {
|
||||||
|
{
|
||||||
|
type = "nlua",
|
||||||
|
request = "attach",
|
||||||
|
name = "Attach to running Neovim instance",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
15
lua/lazyvim/plugins/extras/formatting/prettier.lua
Normal file
15
lua/lazyvim/plugins/extras/formatting/prettier.lua
Normal file
|
|
@ -0,0 +1,15 @@
|
||||||
|
return {
|
||||||
|
{
|
||||||
|
"williamboman/mason.nvim",
|
||||||
|
opts = function(_, opts)
|
||||||
|
table.insert(opts.ensure_installed, "prettierd")
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"jose-elias-alvarez/null-ls.nvim",
|
||||||
|
opts = function(_, opts)
|
||||||
|
local nls = require("null-ls")
|
||||||
|
table.insert(opts.sources, nls.builtins.formatting.prettierd)
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
@ -17,7 +17,14 @@ return {
|
||||||
opts = {
|
opts = {
|
||||||
-- make sure mason installs the server
|
-- make sure mason installs the server
|
||||||
servers = {
|
servers = {
|
||||||
tsserver = {},
|
---@type lspconfig.options.tsserver
|
||||||
|
tsserver = {
|
||||||
|
settings = {
|
||||||
|
completions = {
|
||||||
|
completeFunctionCalls = true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
setup = {
|
setup = {
|
||||||
tsserver = function(_, opts)
|
tsserver = function(_, opts)
|
||||||
|
|
@ -25,6 +32,7 @@ return {
|
||||||
if client.name == "tsserver" then
|
if client.name == "tsserver" then
|
||||||
-- stylua: ignore
|
-- stylua: ignore
|
||||||
vim.keymap.set("n", "<leader>co", "<cmd>TypescriptOrganizeImports<CR>", { buffer = buffer, desc = "Organize Imports" })
|
vim.keymap.set("n", "<leader>co", "<cmd>TypescriptOrganizeImports<CR>", { buffer = buffer, desc = "Organize Imports" })
|
||||||
|
-- stylua: ignore
|
||||||
vim.keymap.set("n", "<leader>cR", "<cmd>TypescriptRenameFile<CR>", { desc = "Rename File", buffer = buffer })
|
vim.keymap.set("n", "<leader>cR", "<cmd>TypescriptRenameFile<CR>", { desc = "Rename File", buffer = buffer })
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
@ -34,4 +42,10 @@ return {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"jose-elias-alvarez/null-ls.nvim",
|
||||||
|
opts = function(_, opts)
|
||||||
|
table.insert(opts.sources, require("typescript.extensions.null-ls.code-actions"))
|
||||||
|
end,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
|
||||||
27
lua/lazyvim/plugins/extras/linting/eslint.lua
Normal file
27
lua/lazyvim/plugins/extras/linting/eslint.lua
Normal file
|
|
@ -0,0 +1,27 @@
|
||||||
|
return {
|
||||||
|
{
|
||||||
|
"neovim/nvim-lspconfig",
|
||||||
|
-- other settings removed for brevity
|
||||||
|
opts = {
|
||||||
|
servers = {
|
||||||
|
eslint = {
|
||||||
|
settings = {
|
||||||
|
-- helps eslint find the eslintrc when it's placed in a subfolder instead of the cwd root
|
||||||
|
workingDirectory = { mode = "auto" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
setup = {
|
||||||
|
eslint = function()
|
||||||
|
vim.api.nvim_create_autocmd("BufWritePre", {
|
||||||
|
callback = function(event)
|
||||||
|
if require("lspconfig.util").get_active_client_by_name(event.buf, "eslint") then
|
||||||
|
vim.cmd("EslintFixAll")
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
@ -35,6 +35,7 @@ return {
|
||||||
new_section("Lazy", "Lazy", "Config"),
|
new_section("Lazy", "Lazy", "Config"),
|
||||||
new_section("New file", "ene | startinsert", "Built-in"),
|
new_section("New file", "ene | startinsert", "Built-in"),
|
||||||
new_section("Quit", "qa", "Built-in"),
|
new_section("Quit", "qa", "Built-in"),
|
||||||
|
new_section("Session restore", [[lua require("persistence").load()]], "Session"),
|
||||||
},
|
},
|
||||||
content_hooks = {
|
content_hooks = {
|
||||||
starter.gen_hook.adding_bullet(pad .. "░ ", false),
|
starter.gen_hook.adding_bullet(pad .. "░ ", false),
|
||||||
|
|
|
||||||
|
|
@ -18,9 +18,10 @@ function M.toggle()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function M.format()
|
---@param opts? {force?:boolean}
|
||||||
|
function M.format(opts)
|
||||||
local buf = vim.api.nvim_get_current_buf()
|
local buf = vim.api.nvim_get_current_buf()
|
||||||
if vim.b.autoformat == false then
|
if vim.b.autoformat == false and not (opts and opts.force) then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
local ft = vim.bo[buf].filetype
|
local ft = vim.bo[buf].filetype
|
||||||
|
|
|
||||||
|
|
@ -21,9 +21,18 @@ return {
|
||||||
diagnostics = {
|
diagnostics = {
|
||||||
underline = true,
|
underline = true,
|
||||||
update_in_insert = false,
|
update_in_insert = false,
|
||||||
virtual_text = { spacing = 4, prefix = "●" },
|
virtual_text = {
|
||||||
|
spacing = 4,
|
||||||
|
source = "if_many",
|
||||||
|
prefix = "●",
|
||||||
|
-- this will set set the prefix to a function that returns the diagnostics icon based on the severity
|
||||||
|
-- this only works on a recent 0.10.0 build. Will be set to "●" when not supported
|
||||||
|
-- prefix = "icons",
|
||||||
|
},
|
||||||
severity_sort = true,
|
severity_sort = true,
|
||||||
},
|
},
|
||||||
|
-- add any global capabilities here
|
||||||
|
capabilities = {},
|
||||||
-- Automatically format on save
|
-- Automatically format on save
|
||||||
autoformat = true,
|
autoformat = true,
|
||||||
-- options for vim.lsp.buf.format
|
-- options for vim.lsp.buf.format
|
||||||
|
|
@ -65,7 +74,7 @@ return {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
---@param opts PluginLspOpts
|
---@param opts PluginLspOpts
|
||||||
config = function(plugin, opts)
|
config = function(_, opts)
|
||||||
-- setup autoformat
|
-- setup autoformat
|
||||||
require("lazyvim.plugins.lsp.format").autoformat = opts.autoformat
|
require("lazyvim.plugins.lsp.format").autoformat = opts.autoformat
|
||||||
-- setup formatting and keymaps
|
-- setup formatting and keymaps
|
||||||
|
|
@ -79,10 +88,29 @@ return {
|
||||||
name = "DiagnosticSign" .. name
|
name = "DiagnosticSign" .. name
|
||||||
vim.fn.sign_define(name, { text = icon, texthl = name, numhl = "" })
|
vim.fn.sign_define(name, { text = icon, texthl = name, numhl = "" })
|
||||||
end
|
end
|
||||||
vim.diagnostic.config(opts.diagnostics)
|
|
||||||
|
if type(opts.diagnostics.virtual_text) == "table" and opts.diagnostics.virtual_text.prefix == "icons" then
|
||||||
|
opts.diagnostics.virtual_text.prefix = vim.fn.has("nvim-0.10.0") == 0 and "●"
|
||||||
|
or function(diagnostic)
|
||||||
|
local icons = require("lazyvim.config").icons.diagnostics
|
||||||
|
for d, icon in pairs(icons) do
|
||||||
|
if diagnostic.severity == vim.diagnostic.severity[d:upper()] then
|
||||||
|
return icon
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
vim.diagnostic.config(vim.deepcopy(opts.diagnostics))
|
||||||
|
|
||||||
local servers = opts.servers
|
local servers = opts.servers
|
||||||
local capabilities = require("cmp_nvim_lsp").default_capabilities(vim.lsp.protocol.make_client_capabilities())
|
local capabilities = vim.tbl_deep_extend(
|
||||||
|
"force",
|
||||||
|
{},
|
||||||
|
vim.lsp.protocol.make_client_capabilities(),
|
||||||
|
require("cmp_nvim_lsp").default_capabilities(),
|
||||||
|
opts.capabilities or {}
|
||||||
|
)
|
||||||
|
|
||||||
local function setup(server)
|
local function setup(server)
|
||||||
local server_opts = vim.tbl_deep_extend("force", {
|
local server_opts = vim.tbl_deep_extend("force", {
|
||||||
|
|
@ -101,23 +129,19 @@ return {
|
||||||
require("lspconfig")[server].setup(server_opts)
|
require("lspconfig")[server].setup(server_opts)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- temp fix for lspconfig rename
|
-- get all the servers that are available thourgh mason-lspconfig
|
||||||
-- https://github.com/neovim/nvim-lspconfig/pull/2439
|
local have_mason, mlsp = pcall(require, "mason-lspconfig")
|
||||||
local mappings = require("mason-lspconfig.mappings.server")
|
local all_mslp_servers = {}
|
||||||
if not mappings.lspconfig_to_package.lua_ls then
|
if have_mason then
|
||||||
mappings.lspconfig_to_package.lua_ls = "lua-language-server"
|
all_mslp_servers = vim.tbl_keys(require("mason-lspconfig.mappings.server").lspconfig_to_package)
|
||||||
mappings.package_to_lspconfig["lua-language-server"] = "lua_ls"
|
|
||||||
end
|
end
|
||||||
|
|
||||||
local mlsp = require("mason-lspconfig")
|
|
||||||
local available = mlsp.get_available_servers()
|
|
||||||
|
|
||||||
local ensure_installed = {} ---@type string[]
|
local ensure_installed = {} ---@type string[]
|
||||||
for server, server_opts in pairs(servers) do
|
for server, server_opts in pairs(servers) do
|
||||||
if server_opts then
|
if server_opts then
|
||||||
server_opts = server_opts == true and {} or server_opts
|
server_opts = server_opts == true and {} or server_opts
|
||||||
-- run manual setup if mason=false or if this is a server that cannot be installed with mason-lspconfig
|
-- run manual setup if mason=false or if this is a server that cannot be installed with mason-lspconfig
|
||||||
if server_opts.mason == false or not vim.tbl_contains(available, server) then
|
if server_opts.mason == false or not vim.tbl_contains(all_mslp_servers, server) then
|
||||||
setup(server)
|
setup(server)
|
||||||
else
|
else
|
||||||
ensure_installed[#ensure_installed + 1] = server
|
ensure_installed[#ensure_installed + 1] = server
|
||||||
|
|
@ -125,8 +149,10 @@ return {
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
require("mason-lspconfig").setup({ ensure_installed = ensure_installed })
|
if have_mason then
|
||||||
require("mason-lspconfig").setup_handlers({ setup })
|
mlsp.setup({ ensure_installed = ensure_installed })
|
||||||
|
mlsp.setup_handlers({ setup })
|
||||||
|
end
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -138,10 +164,13 @@ return {
|
||||||
opts = function()
|
opts = function()
|
||||||
local nls = require("null-ls")
|
local nls = require("null-ls")
|
||||||
return {
|
return {
|
||||||
|
root_dir = require("null-ls.utils").root_pattern(".null-ls-root", ".neoconf.json", "Makefile", ".git"),
|
||||||
sources = {
|
sources = {
|
||||||
-- nls.builtins.formatting.prettierd,
|
nls.builtins.formatting.fish_indent,
|
||||||
|
nls.builtins.diagnostics.fish,
|
||||||
nls.builtins.formatting.stylua,
|
nls.builtins.formatting.stylua,
|
||||||
nls.builtins.diagnostics.flake8,
|
nls.builtins.formatting.shfmt,
|
||||||
|
-- nls.builtins.diagnostics.flake8,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
end,
|
end,
|
||||||
|
|
@ -156,21 +185,27 @@ return {
|
||||||
opts = {
|
opts = {
|
||||||
ensure_installed = {
|
ensure_installed = {
|
||||||
"stylua",
|
"stylua",
|
||||||
"shellcheck",
|
|
||||||
"shfmt",
|
"shfmt",
|
||||||
"flake8",
|
-- "flake8",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
---@param opts MasonSettings | {ensure_installed: string[]}
|
---@param opts MasonSettings | {ensure_installed: string[]}
|
||||||
config = function(plugin, opts)
|
config = function(_, opts)
|
||||||
require("mason").setup(opts)
|
require("mason").setup(opts)
|
||||||
local mr = require("mason-registry")
|
local mr = require("mason-registry")
|
||||||
for _, tool in ipairs(opts.ensure_installed) do
|
local function ensure_installed()
|
||||||
local p = mr.get_package(tool)
|
for _, tool in ipairs(opts.ensure_installed) do
|
||||||
if not p:is_installed() then
|
local p = mr.get_package(tool)
|
||||||
p:install()
|
if not p:is_installed() then
|
||||||
|
p:install()
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
if mr.refresh then
|
||||||
|
mr.refresh(ensure_installed)
|
||||||
|
else
|
||||||
|
ensure_installed()
|
||||||
|
end
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,18 +5,20 @@ M._keys = nil
|
||||||
|
|
||||||
---@return (LazyKeys|{has?:string})[]
|
---@return (LazyKeys|{has?:string})[]
|
||||||
function M.get()
|
function M.get()
|
||||||
local format = require("lazyvim.plugins.lsp.format").format
|
local format = function()
|
||||||
|
require("lazyvim.plugins.lsp.format").format({ force = true })
|
||||||
|
end
|
||||||
if not M._keys then
|
if not M._keys then
|
||||||
---@class PluginLspKeys
|
---@class PluginLspKeys
|
||||||
-- stylua: ignore
|
-- stylua: ignore
|
||||||
M._keys = {
|
M._keys = {
|
||||||
{ "<leader>cd", vim.diagnostic.open_float, desc = "Line Diagnostics" },
|
{ "<leader>cd", vim.diagnostic.open_float, desc = "Line Diagnostics" },
|
||||||
{ "<leader>cl", "<cmd>LspInfo<cr>", desc = "Lsp Info" },
|
{ "<leader>cl", "<cmd>LspInfo<cr>", desc = "Lsp Info" },
|
||||||
{ "gd", "<cmd>Telescope lsp_definitions<cr>", desc = "Goto Definition" },
|
{ "gd", "<cmd>Telescope lsp_definitions<cr>", desc = "Goto Definition", has = "definition" },
|
||||||
{ "gr", "<cmd>Telescope lsp_references<cr>", desc = "References" },
|
{ "gr", "<cmd>Telescope lsp_references<cr>", desc = "References" },
|
||||||
{ "gD", vim.lsp.buf.declaration, desc = "Goto Declaration" },
|
{ "gD", vim.lsp.buf.declaration, desc = "Goto Declaration" },
|
||||||
{ "gI", "<cmd>Telescope lsp_implementations<cr>", desc = "Goto Implementation" },
|
{ "gI", "<cmd>Telescope lsp_implementations<cr>", desc = "Goto Implementation" },
|
||||||
{ "gt", "<cmd>Telescope lsp_type_definitions<cr>", desc = "Goto Type Definition" },
|
{ "gy", "<cmd>Telescope lsp_type_definitions<cr>", desc = "Goto T[y]pe Definition" },
|
||||||
{ "K", vim.lsp.buf.hover, desc = "Hover" },
|
{ "K", vim.lsp.buf.hover, desc = "Hover" },
|
||||||
{ "gK", vim.lsp.buf.signature_help, desc = "Signature Help", has = "signatureHelp" },
|
{ "gK", vim.lsp.buf.signature_help, desc = "Signature Help", has = "signatureHelp" },
|
||||||
{ "<c-k>", vim.lsp.buf.signature_help, mode = "i", desc = "Signature Help", has = "signatureHelp" },
|
{ "<c-k>", vim.lsp.buf.signature_help, mode = "i", desc = "Signature Help", has = "signatureHelp" },
|
||||||
|
|
@ -26,16 +28,31 @@ function M.get()
|
||||||
{ "[e", M.diagnostic_goto(false, "ERROR"), desc = "Prev Error" },
|
{ "[e", M.diagnostic_goto(false, "ERROR"), desc = "Prev Error" },
|
||||||
{ "]w", M.diagnostic_goto(true, "WARN"), desc = "Next Warning" },
|
{ "]w", M.diagnostic_goto(true, "WARN"), desc = "Next Warning" },
|
||||||
{ "[w", M.diagnostic_goto(false, "WARN"), desc = "Prev Warning" },
|
{ "[w", M.diagnostic_goto(false, "WARN"), desc = "Prev Warning" },
|
||||||
{ "<leader>ca", vim.lsp.buf.code_action, desc = "Code Action", mode = { "n", "v" }, has = "codeAction" },
|
|
||||||
{ "<leader>cf", format, desc = "Format Document", has = "documentFormatting" },
|
{ "<leader>cf", format, desc = "Format Document", has = "documentFormatting" },
|
||||||
{ "<leader>cf", format, desc = "Format Range", mode = "v", has = "documentRangeFormatting" },
|
{ "<leader>cf", format, desc = "Format Range", mode = "v", has = "documentRangeFormatting" },
|
||||||
|
{ "<leader>ca", vim.lsp.buf.code_action, desc = "Code Action", mode = { "n", "v" }, has = "codeAction" },
|
||||||
|
{
|
||||||
|
"<leader>cA",
|
||||||
|
function()
|
||||||
|
vim.lsp.buf.code_action({
|
||||||
|
context = {
|
||||||
|
only = {
|
||||||
|
"source",
|
||||||
|
},
|
||||||
|
diagnostics = {},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
desc = "Source Action",
|
||||||
|
has = "codeAction",
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if require("lazyvim.util").has("inc-rename.nvim") then
|
if require("lazyvim.util").has("inc-rename.nvim") then
|
||||||
M._keys[#M._keys + 1] = {
|
M._keys[#M._keys + 1] = {
|
||||||
"<leader>cr",
|
"<leader>cr",
|
||||||
function()
|
function()
|
||||||
require("inc_rename")
|
local inc_rename = require("inc_rename")
|
||||||
return ":IncRename " .. vim.fn.expand("<cword>")
|
return ":" .. inc_rename.config.cmd_name .. " " .. vim.fn.expand("<cword>")
|
||||||
end,
|
end,
|
||||||
expr = true,
|
expr = true,
|
||||||
desc = "Rename",
|
desc = "Rename",
|
||||||
|
|
@ -66,7 +83,7 @@ function M.on_attach(client, buffer)
|
||||||
local opts = Keys.opts(keys)
|
local opts = Keys.opts(keys)
|
||||||
---@diagnostic disable-next-line: no-unknown
|
---@diagnostic disable-next-line: no-unknown
|
||||||
opts.has = nil
|
opts.has = nil
|
||||||
opts.silent = true
|
opts.silent = opts.silent ~= false
|
||||||
opts.buffer = buffer
|
opts.buffer = buffer
|
||||||
vim.keymap.set(keys.mode or "n", keys[1], keys[2], opts)
|
vim.keymap.set(keys.mode or "n", keys[1], keys[2], opts)
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ return {
|
||||||
local enabled = false
|
local enabled = false
|
||||||
if opts.textobjects then
|
if opts.textobjects then
|
||||||
for _, mod in ipairs({ "move", "select", "swap", "lsp_interop" }) do
|
for _, mod in ipairs({ "move", "select", "swap", "lsp_interop" }) do
|
||||||
if opts.textobjects[mod].enable then
|
if opts.textobjects[mod] and opts.textobjects[mod].enable then
|
||||||
enabled = true
|
enabled = true
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
|
|
@ -28,20 +28,22 @@ return {
|
||||||
},
|
},
|
||||||
keys = {
|
keys = {
|
||||||
{ "<c-space>", desc = "Increment selection" },
|
{ "<c-space>", desc = "Increment selection" },
|
||||||
{ "<bs>", desc = "Schrink selection", mode = "x" },
|
{ "<bs>", desc = "Decrement selection", mode = "x" },
|
||||||
},
|
},
|
||||||
---@type TSConfig
|
---@type TSConfig
|
||||||
opts = {
|
opts = {
|
||||||
highlight = { enable = true },
|
highlight = { enable = true },
|
||||||
indent = { enable = true, disable = { "python" } },
|
indent = { enable = true },
|
||||||
context_commentstring = { enable = true, enable_autocmd = false },
|
context_commentstring = { enable = true, enable_autocmd = false },
|
||||||
ensure_installed = {
|
ensure_installed = {
|
||||||
"bash",
|
"bash",
|
||||||
"help",
|
"c",
|
||||||
"html",
|
"html",
|
||||||
"javascript",
|
"javascript",
|
||||||
"json",
|
"json",
|
||||||
"lua",
|
"lua",
|
||||||
|
"luadoc",
|
||||||
|
"luap",
|
||||||
"markdown",
|
"markdown",
|
||||||
"markdown_inline",
|
"markdown_inline",
|
||||||
"python",
|
"python",
|
||||||
|
|
@ -50,6 +52,7 @@ return {
|
||||||
"tsx",
|
"tsx",
|
||||||
"typescript",
|
"typescript",
|
||||||
"vim",
|
"vim",
|
||||||
|
"vimdoc",
|
||||||
"yaml",
|
"yaml",
|
||||||
},
|
},
|
||||||
incremental_selection = {
|
incremental_selection = {
|
||||||
|
|
@ -64,6 +67,17 @@ return {
|
||||||
},
|
},
|
||||||
---@param opts TSConfig
|
---@param opts TSConfig
|
||||||
config = function(_, opts)
|
config = function(_, opts)
|
||||||
|
if type(opts.ensure_installed) == "table" then
|
||||||
|
---@type table<string, boolean>
|
||||||
|
local added = {}
|
||||||
|
opts.ensure_installed = vim.tbl_filter(function(lang)
|
||||||
|
if added[lang] then
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
added[lang] = true
|
||||||
|
return true
|
||||||
|
end, opts.ensure_installed)
|
||||||
|
end
|
||||||
require("nvim-treesitter.configs").setup(opts)
|
require("nvim-treesitter.configs").setup(opts)
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -83,7 +83,7 @@ return {
|
||||||
{
|
{
|
||||||
"nvim-lualine/lualine.nvim",
|
"nvim-lualine/lualine.nvim",
|
||||||
event = "VeryLazy",
|
event = "VeryLazy",
|
||||||
opts = function(plugin)
|
opts = function()
|
||||||
local icons = require("lazyvim.config").icons
|
local icons = require("lazyvim.config").icons
|
||||||
|
|
||||||
local function fg(name)
|
local function fg(name)
|
||||||
|
|
@ -98,7 +98,7 @@ return {
|
||||||
options = {
|
options = {
|
||||||
theme = "auto",
|
theme = "auto",
|
||||||
globalstatus = true,
|
globalstatus = true,
|
||||||
disabled_filetypes = { statusline = { "dashboard", "lazy", "alpha" } },
|
disabled_filetypes = { statusline = { "dashboard", "alpha" } },
|
||||||
},
|
},
|
||||||
sections = {
|
sections = {
|
||||||
lualine_a = { "mode" },
|
lualine_a = { "mode" },
|
||||||
|
|
@ -122,17 +122,23 @@ return {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
lualine_x = {
|
lualine_x = {
|
||||||
|
-- stylua: ignore
|
||||||
|
{
|
||||||
|
function() return " " .. require("dap").status() end,
|
||||||
|
cond = function () return package.loaded["dap"] and require("dap").status() ~= "" end,
|
||||||
|
color = fg("Debug"),
|
||||||
|
},
|
||||||
-- stylua: ignore
|
-- stylua: ignore
|
||||||
{
|
{
|
||||||
function() return require("noice").api.status.command.get() end,
|
function() return require("noice").api.status.command.get() end,
|
||||||
cond = function() return package.loaded["noice"] and require("noice").api.status.command.has() end,
|
cond = function() return package.loaded["noice"] and require("noice").api.status.command.has() end,
|
||||||
color = fg("Statement")
|
color = fg("Statement"),
|
||||||
},
|
},
|
||||||
-- stylua: ignore
|
-- stylua: ignore
|
||||||
{
|
{
|
||||||
function() return require("noice").api.status.mode.get() end,
|
function() return require("noice").api.status.mode.get() end,
|
||||||
cond = function() return package.loaded["noice"] and require("noice").api.status.mode.has() end,
|
cond = function() return package.loaded["noice"] and require("noice").api.status.mode.has() end,
|
||||||
color = fg("Constant") ,
|
color = fg("Constant"),
|
||||||
},
|
},
|
||||||
{ require("lazy.status").updates, cond = require("lazy.status").has_updates, color = fg("Special") },
|
{ require("lazy.status").updates, cond = require("lazy.status").has_updates, color = fg("Special") },
|
||||||
{
|
{
|
||||||
|
|
@ -154,7 +160,7 @@ return {
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
extensions = { "neo-tree" },
|
extensions = { "neo-tree", "lazy" },
|
||||||
}
|
}
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
@ -182,13 +188,15 @@ return {
|
||||||
symbol = "│",
|
symbol = "│",
|
||||||
options = { try_as_border = true },
|
options = { try_as_border = true },
|
||||||
},
|
},
|
||||||
config = function(_, opts)
|
init = function()
|
||||||
vim.api.nvim_create_autocmd("FileType", {
|
vim.api.nvim_create_autocmd("FileType", {
|
||||||
pattern = { "help", "alpha", "dashboard", "neo-tree", "Trouble", "lazy", "mason" },
|
pattern = { "help", "alpha", "dashboard", "neo-tree", "Trouble", "lazy", "mason" },
|
||||||
callback = function()
|
callback = function()
|
||||||
vim.b.miniindentscope_disable = true
|
vim.b.miniindentscope_disable = true
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
end,
|
||||||
|
config = function(_, opts)
|
||||||
require("mini.indentscope").setup(opts)
|
require("mini.indentscope").setup(opts)
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
@ -197,6 +205,17 @@ return {
|
||||||
{
|
{
|
||||||
"folke/noice.nvim",
|
"folke/noice.nvim",
|
||||||
event = "VeryLazy",
|
event = "VeryLazy",
|
||||||
|
dependencies = {
|
||||||
|
-- which key integration
|
||||||
|
{
|
||||||
|
"folke/which-key.nvim",
|
||||||
|
opts = function(_, opts)
|
||||||
|
if require("lazyvim.util").has("noice.nvim") then
|
||||||
|
opts.defaults["<leader>sn"] = { name = "+noice" }
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
},
|
||||||
opts = {
|
opts = {
|
||||||
lsp = {
|
lsp = {
|
||||||
override = {
|
override = {
|
||||||
|
|
@ -216,6 +235,7 @@ return {
|
||||||
{ "<leader>snl", function() require("noice").cmd("last") end, desc = "Noice Last Message" },
|
{ "<leader>snl", function() require("noice").cmd("last") end, desc = "Noice Last Message" },
|
||||||
{ "<leader>snh", function() require("noice").cmd("history") end, desc = "Noice History" },
|
{ "<leader>snh", function() require("noice").cmd("history") end, desc = "Noice History" },
|
||||||
{ "<leader>sna", function() require("noice").cmd("all") end, desc = "Noice All" },
|
{ "<leader>sna", function() require("noice").cmd("all") end, desc = "Noice All" },
|
||||||
|
{ "<leader>snd", function() require("noice").cmd("dismiss") end, desc = "Dismiss All" },
|
||||||
{ "<c-f>", function() if not require("noice.lsp").scroll(4) then return "<c-f>" end end, silent = true, expr = true, desc = "Scroll forward", mode = {"i", "n", "s"} },
|
{ "<c-f>", function() if not require("noice.lsp").scroll(4) then return "<c-f>" end end, silent = true, expr = true, desc = "Scroll forward", mode = {"i", "n", "s"} },
|
||||||
{ "<c-b>", function() if not require("noice.lsp").scroll(-4) then return "<c-b>" end end, silent = true, expr = true, desc = "Scroll backward", mode = {"i", "n", "s"}},
|
{ "<c-b>", function() if not require("noice.lsp").scroll(-4) then return "<c-b>" end end, silent = true, expr = true, desc = "Scroll backward", mode = {"i", "n", "s"}},
|
||||||
},
|
},
|
||||||
|
|
@ -238,23 +258,23 @@ return {
|
||||||
|
|
||||||
dashboard.section.header.val = vim.split(logo, "\n")
|
dashboard.section.header.val = vim.split(logo, "\n")
|
||||||
dashboard.section.buttons.val = {
|
dashboard.section.buttons.val = {
|
||||||
dashboard.button("f", " " .. " Find file", ":Telescope find_files <CR>"),
|
dashboard.button("f", " " .. " Find file", ":Telescope find_files <CR>"),
|
||||||
dashboard.button("n", " " .. " New file", ":ene <BAR> startinsert <CR>"),
|
dashboard.button("n", " " .. " New file", ":ene <BAR> startinsert <CR>"),
|
||||||
dashboard.button("r", " " .. " Recent files", ":Telescope oldfiles <CR>"),
|
dashboard.button("r", " " .. " Recent files", ":Telescope oldfiles <CR>"),
|
||||||
dashboard.button("p", " " .. " Projects", ":Telescope projects <CR>"),
|
dashboard.button("p", " " .. " Projects", ":Telescope projects <CR>"),
|
||||||
dashboard.button("g", " " .. " Find text", ":Telescope live_grep <CR>"),
|
dashboard.button("g", " " .. " Find text", ":Telescope live_grep <CR>"),
|
||||||
dashboard.button("c", " " .. " Config", ":e $MYVIMRC <CR>"),
|
dashboard.button("c", " " .. " Config", ":e $MYVIMRC <CR>"),
|
||||||
dashboard.button("s", "勒" .. " Restore Session", [[:lua require("persistence").load() <cr>]]),
|
dashboard.button("s", " " .. " Restore Session", [[:lua require("persistence").load() <cr>]]),
|
||||||
dashboard.button("l", "鈴" .. " Lazy", ":Lazy<CR>"),
|
dashboard.button("l", " " .. " Lazy", ":Lazy<CR>"),
|
||||||
dashboard.button("q", " " .. " Quit", ":qa<CR>"),
|
dashboard.button("q", " " .. " Quit", ":qa<CR>"),
|
||||||
}
|
}
|
||||||
for _, button in ipairs(dashboard.section.buttons.val) do
|
for _, button in ipairs(dashboard.section.buttons.val) do
|
||||||
button.opts.hl = "AlphaButtons"
|
button.opts.hl = "AlphaButtons"
|
||||||
button.opts.hl_shortcut = "AlphaShortcut"
|
button.opts.hl_shortcut = "AlphaShortcut"
|
||||||
end
|
end
|
||||||
dashboard.section.footer.opts.hl = "Type"
|
|
||||||
dashboard.section.header.opts.hl = "AlphaHeader"
|
dashboard.section.header.opts.hl = "AlphaHeader"
|
||||||
dashboard.section.buttons.opts.hl = "AlphaButtons"
|
dashboard.section.buttons.opts.hl = "AlphaButtons"
|
||||||
|
dashboard.section.footer.opts.hl = "AlphaFooter"
|
||||||
dashboard.opts.layout[1].val = 8
|
dashboard.opts.layout[1].val = 8
|
||||||
return dashboard
|
return dashboard
|
||||||
end,
|
end,
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ return {
|
||||||
{
|
{
|
||||||
"folke/persistence.nvim",
|
"folke/persistence.nvim",
|
||||||
event = "BufReadPre",
|
event = "BufReadPre",
|
||||||
opts = { options = { "buffers", "curdir", "tabpages", "winsize", "help" } },
|
opts = { options = { "buffers", "curdir", "tabpages", "winsize", "help", "globals" } },
|
||||||
-- stylua: ignore
|
-- stylua: ignore
|
||||||
keys = {
|
keys = {
|
||||||
{ "<leader>qs", function() require("persistence").load() end, desc = "Restore Session" },
|
{ "<leader>qs", function() require("persistence").load() end, desc = "Restore Session" },
|
||||||
|
|
|
||||||
|
|
@ -54,6 +54,23 @@ function M.keymaps()
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
Util.walk(root .. "/lua/lazyvim/plugins/extras", function(path, name, t)
|
||||||
|
if t == "file" and name:find("%.lua$") then
|
||||||
|
local modname = path:gsub(".*/lua/", ""):gsub("/", "."):gsub("%.lua$", "")
|
||||||
|
local extra_doc = "/plugins/extras/" .. modname:gsub("lazyvim%.plugins%.extras%.", "")
|
||||||
|
local extra = require("lazy.core.plugin").Spec.new({ import = modname })
|
||||||
|
Util.foreach(extra.plugins, function(name, plugin)
|
||||||
|
group = ("[%s](%s)\nPart of [%s](%s)"):format(plugin.name, plugin.url, modname, extra_doc)
|
||||||
|
for _, key in ipairs(plugin.keys or {}) do
|
||||||
|
if type(key) == "table" and key.desc then
|
||||||
|
local desc = key.desc or ""
|
||||||
|
map(key.mode or "n", key[1], key[2], { desc = desc })
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
|
||||||
---@type string[]
|
---@type string[]
|
||||||
local lines = {}
|
local lines = {}
|
||||||
|
|
||||||
|
|
@ -256,7 +273,7 @@ function M.plugins(path)
|
||||||
|
|
||||||
local function find_plugins(node)
|
local function find_plugins(node)
|
||||||
if node:type() == "string" then
|
if node:type() == "string" then
|
||||||
local text = vim.treesitter.query.get_node_text(node, source):sub(2, -2)
|
local text = vim.treesitter.get_node_text(node, source):sub(2, -2)
|
||||||
if text:find("/") and #node:parent():field("name") == 0 then
|
if text:find("/") and #node:parent():field("name") == 0 then
|
||||||
local plugin_node = node:parent():parent()
|
local plugin_node = node:parent():parent()
|
||||||
if plugin_node:named_child(0):field("value")[1]:id() ~= node:id() then
|
if plugin_node:named_child(0):field("value")[1]:id() ~= node:id() then
|
||||||
|
|
|
||||||
|
|
@ -102,15 +102,17 @@ function M.telescope(builtin, opts)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- FIXME: create a togglable terminal
|
|
||||||
-- Opens a floating terminal (interactive by default)
|
-- Opens a floating terminal (interactive by default)
|
||||||
---@param cmd? string[]|string
|
---@param cmd? string[]|string
|
||||||
---@param opts? LazyCmdOptions|{interactive?:boolean}
|
---@param opts? LazyCmdOptions|{interactive?:boolean, esc_esc?:false}
|
||||||
function M.float_term(cmd, opts)
|
function M.float_term(cmd, opts)
|
||||||
opts = vim.tbl_deep_extend("force", {
|
opts = vim.tbl_deep_extend("force", {
|
||||||
size = { width = 0.9, height = 0.9 },
|
size = { width = 0.9, height = 0.9 },
|
||||||
}, opts or {})
|
}, opts or {})
|
||||||
require("lazy.util").float_term(cmd, opts)
|
local float = require("lazy.util").float_term(cmd, opts)
|
||||||
|
if opts.esc_esc == false then
|
||||||
|
vim.keymap.set("t", "<esc>", "<esc>", { buffer = float.buf, nowait = true })
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
---@param silent boolean?
|
---@param silent boolean?
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue