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
3287ca7386
114 changed files with 5860 additions and 1436 deletions
19
.github/labeler.yml
vendored
Normal file
19
.github/labeler.yml
vendored
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
core:
|
||||
- all:
|
||||
- changed-files:
|
||||
- any-glob-to-any-file: "lua/lazyvim/**"
|
||||
- all-globs-to-all-files: "!lua/lazyvim/plugins/**"
|
||||
|
||||
core-plugins:
|
||||
- all:
|
||||
- changed-files:
|
||||
- any-glob-to-any-file: "lua/lazyvim/plugins/**"
|
||||
- all-globs-to-all-files: "!lua/lazyvim/plugins/extras/**"
|
||||
|
||||
extras:
|
||||
- changed-files:
|
||||
- any-glob-to-any-file: "lua/lazyvim/plugins/extras/**"
|
||||
|
||||
extras-lang:
|
||||
- changed-files:
|
||||
- any-glob-to-any-file: "lua/lazyvim/plugins/extras/lang/**"
|
||||
29
.github/workflows/ci.yml
vendored
29
.github/workflows/ci.yml
vendored
|
|
@ -4,6 +4,22 @@ on:
|
|||
pull_request:
|
||||
|
||||
jobs:
|
||||
commit_msg:
|
||||
name: Conventional Commit Messages
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: webiny/action-conventional-commits@v1.3.0
|
||||
stylua:
|
||||
name: Stylua Formatting
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: JohnnyMorganz/stylua-action@v4
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
version: latest
|
||||
args: --check .
|
||||
tests:
|
||||
strategy:
|
||||
matrix:
|
||||
|
|
@ -11,7 +27,7 @@ jobs:
|
|||
os: [ubuntu-latest]
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
- name: Install Neovim
|
||||
shell: bash
|
||||
run: |
|
||||
|
|
@ -31,7 +47,7 @@ jobs:
|
|||
needs: tests
|
||||
if: ${{ github.ref == 'refs/heads/main' }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
- name: panvimdoc
|
||||
uses: kdheepak/panvimdoc@main
|
||||
with:
|
||||
|
|
@ -40,7 +56,7 @@ jobs:
|
|||
demojify: true
|
||||
treesitter: true
|
||||
- name: Push changes
|
||||
uses: stefanzweifel/git-auto-commit-action@v4
|
||||
uses: stefanzweifel/git-auto-commit-action@v5
|
||||
with:
|
||||
commit_message: "chore(build): auto-generate vimdoc"
|
||||
commit_user_name: "github-actions[bot]"
|
||||
|
|
@ -54,14 +70,11 @@ jobs:
|
|||
- tests
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: google-github-actions/release-please-action@v3
|
||||
- uses: googleapis/release-please-action@v4
|
||||
id: release
|
||||
with:
|
||||
release-type: simple
|
||||
package-name: LazyVim
|
||||
extra-files: |
|
||||
lua/lazyvim/config/init.lua
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
- name: tag stable versions
|
||||
if: ${{ steps.release.outputs.release_created }}
|
||||
run: |
|
||||
|
|
|
|||
12
.github/workflows/labeler.yml
vendored
Normal file
12
.github/workflows/labeler.yml
vendored
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
name: "Pull Request Labeler"
|
||||
on:
|
||||
- pull_request_target
|
||||
|
||||
jobs:
|
||||
labeler:
|
||||
permissions:
|
||||
contents: read
|
||||
pull-requests: write
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/labeler@v5
|
||||
27
.github/workflows/stale.yml
vendored
Normal file
27
.github/workflows/stale.yml
vendored
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
name: Close stale issues and PRs
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
schedule:
|
||||
- cron: "30 1 * * *"
|
||||
|
||||
jobs:
|
||||
stale:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/stale@v9
|
||||
with:
|
||||
operations-per-run: 300
|
||||
# default stale time
|
||||
days-before-stale: 30
|
||||
days-before-close: 7
|
||||
# never stale pull requests
|
||||
# days-before-pr-stale: -1
|
||||
days-before-pr-close: -1
|
||||
# exclude issues with certain labels
|
||||
exempt-issue-labels: pinned,wip,security,notice
|
||||
# never stale issues attached to a milestone
|
||||
# exempt-all-milestones: true
|
||||
stale-issue-message: "This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days."
|
||||
stale-pr-message: "This PR is stale because it has been open 60 days with no activity."
|
||||
close-issue-message: "This issue was closed because it has been stalled for 7 days with no activity."
|
||||
835
CHANGELOG.md
835
CHANGELOG.md
|
|
@ -1,5 +1,840 @@
|
|||
# Changelog
|
||||
|
||||
## [12.4.0](https://github.com/LazyVim/LazyVim/compare/v12.3.0...v12.4.0) (2024-06-04)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **hipatterns:** added vue/astro ([d6c59d9](https://github.com/LazyVim/LazyVim/commit/d6c59d9a411a96fab22df03368b16740ea19da04))
|
||||
* **lazydev:** new lazydev config based on trigger words ([39da851](https://github.com/LazyVim/LazyVim/commit/39da8514d32c9eba40efa045c2d12d2170e206cf))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* fixup for nvim-snippets compat on 0.9. Fixes [#3426](https://github.com/LazyVim/LazyVim/issues/3426) ([83c0c94](https://github.com/LazyVim/LazyVim/commit/83c0c9405acf4682d473188dd2ce3126c1261ea9))
|
||||
* hack for dashboard.nvim so that it shows errors when exiting ([6c3fd9f](https://github.com/LazyVim/LazyVim/commit/6c3fd9fedfa83bac9e63c04d24ff2760569b845e))
|
||||
* **hipatterns:** update mini-hipatterns.lua config to add support for heex, rust and svelte files ([#3430](https://github.com/LazyVim/LazyVim/issues/3430)) ([1731e45](https://github.com/LazyVim/LazyVim/commit/1731e455d41a9baa6c80bbc9e89e23c104479431))
|
||||
* **lazydev:** easier way of defining library plugin paths ([bb66618](https://github.com/LazyVim/LazyVim/commit/bb66618f1fc265c7a702f3d13d704ffbb1066178))
|
||||
* **luasnip:** move mappings to cmp spec so that they dont conflict with native snippets ([da7b773](https://github.com/LazyVim/LazyVim/commit/da7b7738eb84b00c949f48afabebd39266e61d75))
|
||||
* **todo-comments:** use toggle for Trouble todo commands ([#3424](https://github.com/LazyVim/LazyVim/issues/3424)) ([028d5bc](https://github.com/LazyVim/LazyVim/commit/028d5bcac5b2a9b6ceb23e2df9c92bdc7d711674))
|
||||
* **todo-comments:** use trouble filters for showing only todo/fix/fixmes ([6da95ee](https://github.com/LazyVim/LazyVim/commit/6da95ee7d35f7eab4297c2229d8d79d43f5d12bc))
|
||||
* **ui:** fix incorrect colors on change colorscheme (lualine) ([#3431](https://github.com/LazyVim/LazyVim/issues/3431)) ([4d706f1](https://github.com/LazyVim/LazyVim/commit/4d706f1bdc687f1d4d4cd962ec166c65c453633e))
|
||||
|
||||
## [12.3.0](https://github.com/LazyVim/LazyVim/compare/v12.2.0...v12.3.0) (2024-06-02)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **coding:** use `lazydev.nvim` instead of `neodev.nvim` ([5e76948](https://github.com/LazyVim/LazyVim/commit/5e76948d58d3ccae57b1cc09474a1f8b36d100ce))
|
||||
* **extras:** show extras imported in other extras ([b2858a2](https://github.com/LazyVim/LazyVim/commit/b2858a297a465546e9f34d5c3e9d42b9716048eb))
|
||||
* **extras:** split enabled in enabled plugins/languages ([45b92aa](https://github.com/LazyVim/LazyVim/commit/45b92aa381243417462fb4aac92478ce50b4e126))
|
||||
* moved neoconf.nvim to extras ([c14d21c](https://github.com/LazyVim/LazyVim/commit/c14d21ce7534ff302c1ccf0b22f46160ea98ccf1))
|
||||
* **util:** utility methods for lazy plugins ([596c439](https://github.com/LazyVim/LazyVim/commit/596c439db572c8b37c442a1f425b3f452607fd36))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **dot:** added dot to recommended ([c69553e](https://github.com/LazyVim/LazyVim/commit/c69553e1942a646917c92f3643a2ca78eeb19adf))
|
||||
* **json:** added *.json to recommended ([c98fbef](https://github.com/LazyVim/LazyVim/commit/c98fbef3b56fe6ba709254cdc90c8c46c078d555))
|
||||
* **util:** make sure doc gen works ([c33d657](https://github.com/LazyVim/LazyVim/commit/c33d6578a8b2ce03cab58d5952d717064125ef5d))
|
||||
|
||||
## [12.2.0](https://github.com/LazyVim/LazyVim/compare/v12.1.0...v12.2.0) (2024-06-01)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **astro:** added support for ts-plugin, but won't work till mason-registry PR is merged. See [#3364](https://github.com/LazyVim/LazyVim/issues/3364) ([683aaeb](https://github.com/LazyVim/LazyVim/commit/683aaeb75b46f182f2a2dca3b8416151de296626))
|
||||
* **extras:** added extra for svelte. Full support will be enabled once my mason PR gets merged ([7598a75](https://github.com/LazyVim/LazyVim/commit/7598a7503df0fd7912e81fdc9a0eb7635795605b))
|
||||
* **typescript:** add keymap for remove unused imports ([#3376](https://github.com/LazyVim/LazyVim/issues/3376)) ([0a93737](https://github.com/LazyVim/LazyVim/commit/0a9373733f79be5edb4ccb8d9268a700c1e3faad))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **aerial:** disable trouble leader-cs keymap when aerial extra is enabled ([1351503](https://github.com/LazyVim/LazyVim/commit/135150307b53a5b51f2f0c149ca7f426a67eb8f1))
|
||||
* **copilot-chat:** no need to schedule which-key keys. just use default ([6678af3](https://github.com/LazyVim/LazyVim/commit/6678af37ee3100882b4c08451fa8aaa37e37fd69))
|
||||
* **extras:** `underline = false` for setting diagnostics ([#3379](https://github.com/LazyVim/LazyVim/issues/3379)) ([060f56d](https://github.com/LazyVim/LazyVim/commit/060f56d6d429c5ee3fd35f4fa0c152f4a42781ca))
|
||||
* **health:** remove old deprecated module checks ([4e62df4](https://github.com/LazyVim/LazyVim/commit/4e62df4269a9300c17f6bf23acfcb9dd0729b6c3))
|
||||
* **lsp:** better way of extending deeply nested lists. Fixes [#3398](https://github.com/LazyVim/LazyVim/issues/3398) ([9f2cc30](https://github.com/LazyVim/LazyVim/commit/9f2cc302463e3be0ca3a42845c0fc34e49e75bca))
|
||||
* rename `+a` which-key group to `ai`. Fixes [#3392](https://github.com/LazyVim/LazyVim/issues/3392) ([a474aea](https://github.com/LazyVim/LazyVim/commit/a474aea1f9fcf0c7601914b1e53260067f621799))
|
||||
* **rust:** let rustaceans.nvim setup rust_analyzer ([#3389](https://github.com/LazyVim/LazyVim/issues/3389)) ([3fadf6a](https://github.com/LazyVim/LazyVim/commit/3fadf6af8f4adc1788fb8adec1fd9850d12feaf8))
|
||||
* **trouble:** don't enable symbols keymap when `outline.nvim` enabled ([#3408](https://github.com/LazyVim/LazyVim/issues/3408)) ([146c87c](https://github.com/LazyVim/LazyVim/commit/146c87cd786854b9225ad49ad39acbcb4b7fff0b))
|
||||
* **ui:** allow to disable the trouble lualine component with `vim.g.trouble_lualine = false` ([#3391](https://github.com/LazyVim/LazyVim/issues/3391)) ([d02b73d](https://github.com/LazyVim/LazyVim/commit/d02b73d72a85d72a57c3bcf0cfaef0cd50c81c37))
|
||||
* **ui:** remove old alpha.nvim warning ([abc6554](https://github.com/LazyVim/LazyVim/commit/abc6554e24ff97bfc630fe1d91827e02f826b1fa))
|
||||
* **util:** make sure mason is loaded when getting package paths ([a6df15a](https://github.com/LazyVim/LazyVim/commit/a6df15a63fdeaf25895fb2d97910e3e099a95d0c))
|
||||
* **vue:** correctly add plugins. See [#3401](https://github.com/LazyVim/LazyVim/issues/3401) ([e7430b0](https://github.com/LazyVim/LazyVim/commit/e7430b0776c13e9ab3f42a1b9aee84561bd07c0a))
|
||||
|
||||
## [12.1.0](https://github.com/LazyVim/LazyVim/compare/v12.0.0...v12.1.0) (2024-05-30)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **copilot-chat:** add cmp integration ([2a7d163](https://github.com/LazyVim/LazyVim/commit/2a7d163a8a6de2a5ad58b240770d90e6e5947638))
|
||||
* **extras:** simple extra for astro ([e7d4b39](https://github.com/LazyVim/LazyVim/commit/e7d4b397b291ec8854673e813ae67103bc75e15d))
|
||||
* trouble v3 ([95d055d](https://github.com/LazyVim/LazyVim/commit/95d055dcf7bbad34f6b8aaf94d285314ceaf6f0c))
|
||||
* **typescript:** vtls add select ts version ([#3366](https://github.com/LazyVim/LazyVim/issues/3366)) ([b285a46](https://github.com/LazyVim/LazyVim/commit/b285a46dfcde44aa2ab4f5acbbc4a2a18cc1f16b))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **clangd:** switch source/header is now leader-ch. Fixes [#3363](https://github.com/LazyVim/LazyVim/issues/3363) ([a224ef2](https://github.com/LazyVim/LazyVim/commit/a224ef2a73dd1e8b358179aab8fa36c1b6745b26))
|
||||
* **extras:** show recommended languages above enabled plugins ([c4b7505](https://github.com/LazyVim/LazyVim/commit/c4b75059697a85c77e4d85e18e37ebb6f278cf2a))
|
||||
* remove lazygit log gl keymap when on gitui ([#3371](https://github.com/LazyVim/LazyVim/issues/3371)) ([c2ef092](https://github.com/LazyVim/LazyVim/commit/c2ef09227ee59692f931fd7d4183759d1a82ac02))
|
||||
* **root:** escape glob expressions ([7414e84](https://github.com/LazyVim/LazyVim/commit/7414e84af96941fbe74555951ca6f5a58530775d))
|
||||
* **typescript:** allow easier merging of ts plugins ([cf6775a](https://github.com/LazyVim/LazyVim/commit/cf6775a959de7df314a8db1c208daed33a70f0c4))
|
||||
* **typescript:** vtsls server expe settings ([#3372](https://github.com/LazyVim/LazyVim/issues/3372)) ([ae098d6](https://github.com/LazyVim/LazyVim/commit/ae098d67d6842ccc097f5a10616369b60dfe6701))
|
||||
|
||||
## [12.0.0](https://github.com/LazyVim/LazyVim/compare/v11.11.0...v12.0.0) (2024-05-29)
|
||||
|
||||
|
||||
### ⚠ BREAKING CHANGES
|
||||
|
||||
* **typescript:** the typescript extra now uses vtsls instead of tsserver. You may want to update your lsp settings.
|
||||
|
||||
### Features
|
||||
|
||||
* **keymaps:** new keymap to toggle mazimize of current window leader-m or leader-wm ([3ace827](https://github.com/LazyVim/LazyVim/commit/3ace8277e54370c0aa3d17e61018cf039c42d69b))
|
||||
* **lsp:** added leader-cR to rename the current file and to lsp rename operations ([b949dba](https://github.com/LazyVim/LazyVim/commit/b949dba489abae54ba28540da06f360d6fb2788d))
|
||||
* **typescript:** added `gR` to goto file references ([38b8736](https://github.com/LazyVim/LazyVim/commit/38b8736b81870a01f4464c9dd07d545ea57b95fc))
|
||||
* **typescript:** the typescript extra now uses vtsls instead of tsserver. You may want to update your lsp settings. ([fba06ce](https://github.com/LazyVim/LazyVim/commit/fba06ce9f522b91be8a342f9c028948c2733132d))
|
||||
* **vscode:** added ts-comments to allow list for vscode ([0975eeb](https://github.com/LazyVim/LazyVim/commit/0975eeb9add54b1dc65f4c3874edd8e35e527099))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **lsp:** added support for `has` as array for lsp keymaps ([01e6718](https://github.com/LazyVim/LazyVim/commit/01e6718e034d4a66bbdecef35f12c71bbde519fe))
|
||||
* **lsp:** create `gr` with `nowait=true` ([4dfd5c2](https://github.com/LazyVim/LazyVim/commit/4dfd5c2596ff427a1232e6624add093d5b4da82e))
|
||||
* **lsp:** fix LazyVim's `on_file_rename` to work according to the lsp spec ([4bbeb37](https://github.com/LazyVim/LazyVim/commit/4bbeb37a18b02fc0c1bb5050dce4358b51583968))
|
||||
* **lsp:** fix ts/deno both attaching ([f6bcf6f](https://github.com/LazyVim/LazyVim/commit/f6bcf6f12c9a9f5ac256b394155d8a9649c6beda))
|
||||
* **lsp:** remove duplicate keymap ([8047562](https://github.com/LazyVim/LazyVim/commit/804756209e314d9bd466584e75aee37912b75223))
|
||||
* **trouble_v3:** set correct lualine section background color ([a13457e](https://github.com/LazyVim/LazyVim/commit/a13457eea3edf9b409e93e0391a5c206e0260022))
|
||||
|
||||
## [11.11.0](https://github.com/LazyVim/LazyVim/compare/v11.10.0...v11.11.0) (2024-05-28)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **snippets:** try to use the snippet parse to get a preview ([eb0da3c](https://github.com/LazyVim/LazyVim/commit/eb0da3c92f2aee00ce951410ec820ce2f63490d8))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **nvim-snippets:** no longer needed to set global_snippets ([9149358](https://github.com/LazyVim/LazyVim/commit/91493588a8580cc216ee63cdc98b4462c54b45a7))
|
||||
* **snippets:** fix snippets with multiple placeholders for the same tabstop ([1b86d7b](https://github.com/LazyVim/LazyVim/commit/1b86d7b2ade1dc934165fb1de8e5a3b211bc5ee0))
|
||||
* **snippets:** show actual error for failed snippet ([425dade](https://github.com/LazyVim/LazyVim/commit/425dadef72e2af17eb45faf7bf45f7d74276ad72))
|
||||
|
||||
## [11.10.0](https://github.com/LazyVim/LazyVim/compare/v11.9.0...v11.10.0) (2024-05-28)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **keymaps:** add comment above/below current line with gco/gcO ([47a8736](https://github.com/LazyVim/LazyVim/commit/47a8736278d246769069dd1013560f1a122b0316))
|
||||
* **lang:** add R ([#3272](https://github.com/LazyVim/LazyVim/issues/3272)) ([80c9dca](https://github.com/LazyVim/LazyVim/commit/80c9dcaabe97a2e07d4fbc060820d8eb3ae6a044))
|
||||
* **lsp:** config option to exclude certain filetypes from inlay hints. Closes [#3202](https://github.com/LazyVim/LazyVim/issues/3202) ([e68ff68](https://github.com/LazyVim/LazyVim/commit/e68ff6897eb8e90ec08f7400d3271a8b4fb1da1e))
|
||||
* **scala-extra:** Use noice for progress and add minimal keybinding ([#3348](https://github.com/LazyVim/LazyVim/issues/3348)) ([de57894](https://github.com/LazyVim/LazyVim/commit/de5789415855eafa24f399ee11a5e96bee7c6f9e))
|
||||
* **snippets:** re-number tabstops for invalid snippets ([cf43748](https://github.com/LazyVim/LazyVim/commit/cf4374867d39b590f1add8c654dbb2d3578cf24f))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **copilot-chat:** enhanced chat view is now merged upstream, so update your plugins! ([08481c2](https://github.com/LazyVim/LazyVim/commit/08481c2c9272b8863611d5f3e79876674bfc570e))
|
||||
* **nvim-snippets:** also enable for tsx/jsx files ([025ba33](https://github.com/LazyVim/LazyVim/commit/025ba33dc3e7899b26233f05cb650dbecb234441))
|
||||
* **nvim-snippets:** load js snippets for ts. See [#3344](https://github.com/LazyVim/LazyVim/issues/3344) ([99f0a1c](https://github.com/LazyVim/LazyVim/commit/99f0a1cb40cbfc099503bfa05fbd6c26370cada3))
|
||||
* **nvim-snippets:** remove extra filetypes since thats no longer needed with merged PR ([a6e6d4d](https://github.com/LazyVim/LazyVim/commit/a6e6d4dabd60ab12546f56989811e58b19efb5a1))
|
||||
|
||||
## [11.9.0](https://github.com/LazyVim/LazyVim/compare/v11.8.0...v11.9.0) (2024-05-27)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **copilot-chat:** enhanced rendering of the chat window ([a23e8c1](https://github.com/LazyVim/LazyVim/commit/a23e8c15f50a176f0decf054ecbfc38c7570b9b0))
|
||||
* **copilot-chat:** make keymaps work in visual mode ([2695fc7](https://github.com/LazyVim/LazyVim/commit/2695fc7dfc9972da9c3d7e1d3b4a138f54f1dcbb))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **copilot-chat:** clear -> reset ([02b240c](https://github.com/LazyVim/LazyVim/commit/02b240cea56a5547f2b0729e09decfc228475c8b))
|
||||
* **edgy:** load edgy spec early ([163f7ea](https://github.com/LazyVim/LazyVim/commit/163f7ea3036caf48eed9e9c7b0da8680475612a7))
|
||||
* **lsp:** double check for documentHighlight. See [#3246](https://github.com/LazyVim/LazyVim/issues/3246) ([0a63734](https://github.com/LazyVim/LazyVim/commit/0a63734b783509407530eae789258fcf9a6f2219))
|
||||
* **terminal:** make `gf` behave. Fixes [#3335](https://github.com/LazyVim/LazyVim/issues/3335) ([eb1c04b](https://github.com/LazyVim/LazyVim/commit/eb1c04bd31d518377538ac228788b6a0be194c1b))
|
||||
* **typescript:** invalid value in inlayHints options ([#3331](https://github.com/LazyVim/LazyVim/issues/3331)) ([54d7cea](https://github.com/LazyVim/LazyVim/commit/54d7cea30567577bf926765e9282d7736e951941))
|
||||
|
||||
## [11.8.0](https://github.com/LazyVim/LazyVim/compare/v11.7.0...v11.8.0) (2024-05-27)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **extras:** added extra for CopilotChat.nvim ([4678552](https://github.com/LazyVim/LazyVim/commit/46785526a63b401d812de79fbbecca26414dc8e8))
|
||||
* **git:** Change Commit Log to use Lazygit ([#2959](https://github.com/LazyVim/LazyVim/issues/2959)) ([9ccdbf6](https://github.com/LazyVim/LazyVim/commit/9ccdbf644cc6f38ade7fdd7e554e8da8b38091ac))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **lang/rust:** Remove `rust-analyzer` from `nvim-lspconfig` ([#2755](https://github.com/LazyVim/LazyVim/issues/2755)) ([f48d55a](https://github.com/LazyVim/LazyVim/commit/f48d55a653cc829e7dfecc3c01bf1ccbdf337257))
|
||||
* **laygit:** normalize paths. Fixes [#3327](https://github.com/LazyVim/LazyVim/issues/3327) ([dbed614](https://github.com/LazyVim/LazyVim/commit/dbed614655fdf13436654356c0ba156d45ee7cc4))
|
||||
* **laygit:** use correct .git root for git blame ([d23e857](https://github.com/LazyVim/LazyVim/commit/d23e8572e8ccc96b686ef8187aadf56ad47edd67))
|
||||
* **rust:** show error when rust-analyzer not found ([d3500a4](https://github.com/LazyVim/LazyVim/commit/d3500a4a33ab87c6225d991302a72012c54b26fe))
|
||||
* **snippet:** always use top-level snippet session. Fixes [#3199](https://github.com/LazyVim/LazyVim/issues/3199) ([5391174](https://github.com/LazyVim/LazyVim/commit/53911748ddc7f92793c6fec6348a9cde32159ef3))
|
||||
|
||||
## [11.7.0](https://github.com/LazyVim/LazyVim/compare/v11.6.1...v11.7.0) (2024-05-26)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* lazyrc files are now a lazy.nvim feature ([3a30070](https://github.com/LazyVim/LazyVim/commit/3a30070a4cd4465699d1fdd384d95bdb9935376b))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **illuminate:** s/enabed/enabled ([#3313](https://github.com/LazyVim/LazyVim/issues/3313)) ([c9ab822](https://github.com/LazyVim/LazyVim/commit/c9ab8224f54fb6e93050fab1043b9d1efb917c23))
|
||||
* **lsp:** added a-n, a-p for document highlights and cycling. Closes [#3320](https://github.com/LazyVim/LazyVim/issues/3320) ([b3373f3](https://github.com/LazyVim/LazyVim/commit/b3373f3428f8ded19f8162a46bf9f2784299b43b))
|
||||
* **lspconfig:** make `opts` a function ([#3311](https://github.com/LazyVim/LazyVim/issues/3311)) ([7aa3706](https://github.com/LazyVim/LazyVim/commit/7aa37064a2421f044c61d4baf42f71a923fab94b))
|
||||
* **lsp:** correct previous reference keymap description ([#3314](https://github.com/LazyVim/LazyVim/issues/3314)) ([cdff9de](https://github.com/LazyVim/LazyVim/commit/cdff9de17226701f37069744a402b7afd9942f66))
|
||||
* **lsp:** properly get buffer for dynamic capabilities ([#3315](https://github.com/LazyVim/LazyVim/issues/3315)) ([07a1371](https://github.com/LazyVim/LazyVim/commit/07a137199cde87f089776b3f992bd9ed08889cac))
|
||||
|
||||
## [11.6.1](https://github.com/LazyVim/LazyVim/compare/v11.6.0...v11.6.1) (2024-05-23)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **lsp:** use proper buffer for dynamic capabilities. Fixes [#3246](https://github.com/LazyVim/LazyVim/issues/3246) ([10ed308](https://github.com/LazyVim/LazyVim/commit/10ed3082a415b525628dfaebdcd007c7e96a5b87))
|
||||
|
||||
## [11.6.0](https://github.com/LazyVim/LazyVim/compare/v11.5.0...v11.6.0) (2024-05-23)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **markdown:** add formatter for mdx ([ae6d8f1](https://github.com/LazyVim/LazyVim/commit/ae6d8f1a34fff49f9f1abf9fdd8a559c95b85cf3))
|
||||
* **markdown:** configure conform for markdown files ([#2308](https://github.com/LazyVim/LazyVim/issues/2308)) ([9eec03d](https://github.com/LazyVim/LazyVim/commit/9eec03d890f7846e6f47e12ebbe369c7177fd5f1))
|
||||
* **telescope:** add telescope jumplist keymap ([#3268](https://github.com/LazyVim/LazyVim/issues/3268)) ([79608fb](https://github.com/LazyVim/LazyVim/commit/79608fbc4fe7d5fbd2d238e8d8ebfce7d576b7c2))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **lsp:** only enableinlay hints for when buffer is an actual file. See [#3284](https://github.com/LazyVim/LazyVim/issues/3284) ([46cf534](https://github.com/LazyVim/LazyVim/commit/46cf5347b5649e856a69b9f52ccad8a671ddefc6))
|
||||
* **python:** extras.lang.python to enable venv select keys on ft ([#3280](https://github.com/LazyVim/LazyVim/issues/3280)) ([f9b3137](https://github.com/LazyVim/LazyVim/commit/f9b31372aef9f1f862bf24879ba388f0d89c2349))
|
||||
* set markdown for LICENSE file ([#3276](https://github.com/LazyVim/LazyVim/issues/3276)) ([1eea516](https://github.com/LazyVim/LazyVim/commit/1eea51606e1ec1035c440a4ca9b3eab053337a7d))
|
||||
|
||||
## [11.5.0](https://github.com/LazyVim/LazyVim/compare/v11.4.1...v11.5.0) (2024-05-21)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **comments:** use ts-comments.nvim instead of nvim-ts-context-commentstring on Neovim 0.10 ([8ba7c64](https://github.com/LazyVim/LazyVim/commit/8ba7c64a7da9e46f2ac601919508803824208935))
|
||||
* **telescope:** add quickfix and telescope keymaps ([#3077](https://github.com/LazyVim/LazyVim/issues/3077)) ([ab4e57a](https://github.com/LazyVim/LazyVim/commit/ab4e57a4bfe6107c21a25450292ef69537a2b37b))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **cmp:** fix cmp's broken snippet parsing functionality. Fixes [#3266](https://github.com/LazyVim/LazyVim/issues/3266) ([2bae438](https://github.com/LazyVim/LazyVim/commit/2bae438570aa96904836e56d8dad7f33eb3204ee))
|
||||
* **lsp:** sometimes lsp client is not fully initialized and doesnt yet have client.supports_method on 0.9.5. Fixes [#3263](https://github.com/LazyVim/LazyVim/issues/3263) ([8c94842](https://github.com/LazyVim/LazyVim/commit/8c94842b4a613995bf4c0c79febcd74c310439d0))
|
||||
* **neo-tree:** better icons for git staged/unstaged ([e46dd4e](https://github.com/LazyVim/LazyVim/commit/e46dd4e9b2ac68a5058447ef73b413605d15ae62))
|
||||
* **nvim-snippets:** enable global friendly-snippets. See [#3240](https://github.com/LazyVim/LazyVim/issues/3240) ([55b07de](https://github.com/LazyVim/LazyVim/commit/55b07dee21ee5306624e16dd90c2b3c9c0f3ddde))
|
||||
* **snippets:** fixes custom snippets. use my branch till nvim-snippets PR is merged. Fixes [#3240](https://github.com/LazyVim/LazyVim/issues/3240) ([cb1e1b9](https://github.com/LazyVim/LazyVim/commit/cb1e1b9c82b405fa277f1869cd04dcd9c4507412))
|
||||
* **snippets:** make friendly snippets a dep of nvim-snippets ([d73397c](https://github.com/LazyVim/LazyVim/commit/d73397c4aaac74d95970ac06caffa25abd7c2af4))
|
||||
* **snippets:** my nvim-snippets PR is merged, so remove work-around. That was quick :) ([027d6bc](https://github.com/LazyVim/LazyVim/commit/027d6bc2e896d453153f48a8c15db2a627698dc8))
|
||||
|
||||
## [11.4.1](https://github.com/LazyVim/LazyVim/compare/v11.4.0...v11.4.1) (2024-05-20)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **java:** properly pass settings to jdtls ([8e67bb1](https://github.com/LazyVim/LazyVim/commit/8e67bb124009e0dbf29f8e78d701d07756670278))
|
||||
|
||||
## [11.4.0](https://github.com/LazyVim/LazyVim/compare/v11.3.2...v11.4.0) (2024-05-20)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **cmp:** add missing documentation to snippets when needed ([24a2a9f](https://github.com/LazyVim/LazyVim/commit/24a2a9fb0ba60e0e7c6c8c4ee95a5db7ea0e123e))
|
||||
* **cmp:** better error handling and automatic fixing of snippets that fail to parse with native Neovim snippets ([97862f4](https://github.com/LazyVim/LazyVim/commit/97862f425997bf89f581e6aeceed9aac85d90432))
|
||||
* **cmp:** move cmp autobracket support to util class ([39f3ebc](https://github.com/LazyVim/LazyVim/commit/39f3ebcadf49b285d8ae06270ed0c2098e7f03bd))
|
||||
* **cmp:** resolve placeholders in generated missing snippet documentation ([7d72436](https://github.com/LazyVim/LazyVim/commit/7d72436193b3624a9198a5e57ec1bd7e90260c00))
|
||||
* **extras.lang:** Add kotlin ([#2890](https://github.com/LazyVim/LazyVim/issues/2890)) ([94c9f4c](https://github.com/LazyVim/LazyVim/commit/94c9f4cf379e472fbd1a342ef28687dfa418dec0))
|
||||
* **java:** enable inlay hints. Fixes [#3244](https://github.com/LazyVim/LazyVim/issues/3244) ([e5ea8ab](https://github.com/LazyVim/LazyVim/commit/e5ea8abd38c4b93edccd69c9ef4462377103a9c3))
|
||||
* **kotlin:** added recommended checks ([dd417c3](https://github.com/LazyVim/LazyVim/commit/dd417c36cd14b5b347b4f82e9e7683b085c768fb))
|
||||
* **lang:** add toml ([#3022](https://github.com/LazyVim/LazyVim/issues/3022)) ([e0c67f6](https://github.com/LazyVim/LazyVim/commit/e0c67f6776a5e6f1b72852567ce4fec16598b2da))
|
||||
* **lsp:** properly update certain Neovim functionlity based on dynamic capabilities. See [#3244](https://github.com/LazyVim/LazyVim/issues/3244). Fixes [#3246](https://github.com/LazyVim/LazyVim/issues/3246) ([20e002f](https://github.com/LazyVim/LazyVim/commit/20e002f9f0e9bfdff1ffc638987fbd46b31e5f9b))
|
||||
* **toml:** also recommend toml when theres toml files in the cwd ([c264253](https://github.com/LazyVim/LazyVim/commit/c264253d8fd4f068c7c2ddb5ea3c63596ab5d23f))
|
||||
* **vscode:** enable more compatible plugins ([#3250](https://github.com/LazyVim/LazyVim/issues/3250)) ([5726f39](https://github.com/LazyVim/LazyVim/commit/5726f3966df7c1e9b350d24aa94f621d0ea484da))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **bufferline:** unpin bufferline with 0.9.x compatibility ([#3252](https://github.com/LazyVim/LazyVim/issues/3252)) ([ea1c3ad](https://github.com/LazyVim/LazyVim/commit/ea1c3ad6b46dfaeca9ff4564499b4cdc8f839610))
|
||||
* **cmp:** no need to setup native snippets with latest cmp ([57a31c3](https://github.com/LazyVim/LazyVim/commit/57a31c3920bcb9baec9a6d3915506a638b0801b8))
|
||||
* **cmp:** use better cmp.confirm ([2961162](https://github.com/LazyVim/LazyVim/commit/2961162ebaef96e4ffbc1e6c97dba0dc32efbbb0))
|
||||
* **config:** add some extra LazyVim keys to lazy health ([76033c6](https://github.com/LazyVim/LazyVim/commit/76033c6aa92e633de968b515d3fd5f9e0447a74f))
|
||||
|
||||
## [11.3.2](https://github.com/LazyVim/LazyVim/compare/v11.3.1...v11.3.2) (2024-05-19)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **bufferline:** pin bufferline to older version on 0.9.x for now ([573aa22](https://github.com/LazyVim/LazyVim/commit/573aa226f9f9b9fb9c9886381d3fd06746b7ae6a))
|
||||
* **cmp:** only complete on `<cr>` when cmp is really visible. Dont wait till it might be visible. Faster and more correct imho ([ad22ada](https://github.com/LazyVim/LazyVim/commit/ad22adab7d446018875de2dc96168295cad9298e))
|
||||
* **git:** off-by-one issue in lazygit blame line ([#3230](https://github.com/LazyVim/LazyVim/issues/3230)) ([4208a09](https://github.com/LazyVim/LazyVim/commit/4208a09df8cd20fe491a5fdcc722c12fb07588dc))
|
||||
* **gitui:** properly delete lazygit keymap at the correct time. Fixes [#3227](https://github.com/LazyVim/LazyVim/issues/3227) ([e346d17](https://github.com/LazyVim/LazyVim/commit/e346d17812de516ad0789ede49b49a8b7ba213fe))
|
||||
* show refactored success msg ([#3233](https://github.com/LazyVim/LazyVim/issues/3233)) ([4a41012](https://github.com/LazyVim/LazyVim/commit/4a41012483e67ffe5ff65f31934ed668325ea131))
|
||||
* **yanky:** load yanky earlier to avoid losing deleted lines ([#3234](https://github.com/LazyVim/LazyVim/issues/3234)) ([93c156a](https://github.com/LazyVim/LazyVim/commit/93c156a0a54e5400436a950263dd140ca591d3e5))
|
||||
|
||||
## [11.3.1](https://github.com/LazyVim/LazyVim/compare/v11.3.0...v11.3.1) (2024-05-18)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **util:** fixup ([3a4672d](https://github.com/LazyVim/LazyVim/commit/3a4672de3f8b6410de9fbd5b7134d5108d86f46c))
|
||||
|
||||
## [11.3.0](https://github.com/LazyVim/LazyVim/compare/v11.2.0...v11.3.0) (2024-05-18)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **cmp:** create undo point right before confirming a completion ([673975e](https://github.com/LazyVim/LazyVim/commit/673975ebbe9870ded302bf3621e249bb4cd5f4f8))
|
||||
* **mini.ai:** `mini.ai` is back in core with some improved features. Removing it was a mistake. ([d8644c4](https://github.com/LazyVim/LazyVim/commit/d8644c47158fd28b88f5e3a90af6e5e6a0df2eba))
|
||||
* **util:** added Util.is_loaded ([4105c0a](https://github.com/LazyVim/LazyVim/commit/4105c0ad3a441da3a31cc7d8e53305a6117f6ee5))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **ibl:** remove ibl fix since it's been fixed upstream ([4614666](https://github.com/LazyVim/LazyVim/commit/4614666d1ee5864e95a08eb5b85808d7834ce85f))
|
||||
* **keymaps:** delete lazygit keymap when using gitui ([#2986](https://github.com/LazyVim/LazyVim/issues/2986)) ([649fa9d](https://github.com/LazyVim/LazyVim/commit/649fa9d52188e0c28733402f2f65014fa73308bc))
|
||||
* **lsp:** move next/prev reference keymaps to lsp keymaps. See [#3220](https://github.com/LazyVim/LazyVim/issues/3220) ([a4d8352](https://github.com/LazyVim/LazyVim/commit/a4d83524a7179274c17414ebeb0a4e4b8d9a8706))
|
||||
* **mini.starter:** changes based on echasnovski's recommendation ([#3223](https://github.com/LazyVim/LazyVim/issues/3223)) ([eb6c9fb](https://github.com/LazyVim/LazyVim/commit/eb6c9fb5784a8001c876203de174cd79e96bb637))
|
||||
* **plugin:** typo ([#3225](https://github.com/LazyVim/LazyVim/issues/3225)) ([96aa4b8](https://github.com/LazyVim/LazyVim/commit/96aa4b8877faa2fea30d2d4e2d3d117d9d3851f8))
|
||||
* **treesitter:** refactored treesitter code and fixed nvim-treesitter-textobjects ([fe55285](https://github.com/LazyVim/LazyVim/commit/fe552853f5c065df2d79092c0cbac6745f8ea8fc))
|
||||
|
||||
## [11.2.0](https://github.com/LazyVim/LazyVim/compare/v11.1.2...v11.2.0) (2024-05-18)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **extras:** added a recommended plugin/language section to `:LazyExtras` ([16eb3d9](https://github.com/LazyVim/LazyVim/commit/16eb3d947321992ebcddff6b997d403b41bd7411))
|
||||
* **extras:** added recommended detectors for all languages ([c292134](https://github.com/LazyVim/LazyVim/commit/c29213416b5e29fc56c465234dfd717f78a9e09f))
|
||||
* **extras:** added trouble-v3 and mini-hipatterns to recommended ([d514e2f](https://github.com/LazyVim/LazyVim/commit/d514e2fa93a449329c2de64d569846102f24de0e))
|
||||
* **extras:** tags some extras as recommended ([ef3bd3b](https://github.com/LazyVim/LazyVim/commit/ef3bd3bd027209812c41b1d772e766c0ef18c503))
|
||||
* **root:** added support for `*.xxx` root patterns ([03ea7f6](https://github.com/LazyVim/LazyVim/commit/03ea7f6f98a874e26d258dbfe5b196c2d7c6971f))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **bufferline:** force update bufferline after `BufDelete`. Closes [#3197](https://github.com/LazyVim/LazyVim/issues/3197) ([72abb89](https://github.com/LazyVim/LazyVim/commit/72abb893acc866ce574c66af7d9de861440a3a1f))
|
||||
* **comments:** better way of using ts-context-commentstring with native comments ([1d23c98](https://github.com/LazyVim/LazyVim/commit/1d23c98da138494fafdad6735d70c3d3375bb7b2))
|
||||
* **extras:** remove treesitter-rewrite extra for now ([180d951](https://github.com/LazyVim/LazyVim/commit/180d9516fd68ca8b881cf1028eeb65aa9c2e25b7))
|
||||
* **indent-blankline:** temp fix for `tbl_flatten` on `0.9.x` ([3a193d3](https://github.com/LazyVim/LazyVim/commit/3a193d3aa89c8ff0327abb3e60600eab154af93a))
|
||||
* **leap:** add label to renamed surround mappings key group ([#3211](https://github.com/LazyVim/LazyVim/issues/3211)) ([9c212d6](https://github.com/LazyVim/LazyVim/commit/9c212d655a05c42331443f5d0d6dcc982108ed0e))
|
||||
* **mini.starter:** buf_id in refresh() is not an identifier of valid … ([#3209](https://github.com/LazyVim/LazyVim/issues/3209)) ([dc66887](https://github.com/LazyVim/LazyVim/commit/dc66887b57ecdee8d33b5e07ca031288260e2971))
|
||||
* **refactoring:** add label to refactoring key group ([#3201](https://github.com/LazyVim/LazyVim/issues/3201)) ([39bec71](https://github.com/LazyVim/LazyVim/commit/39bec71ce9489eee288544dca22015147636ae4d))
|
||||
* **treesitter:** disable treesitter-rewrite extra for now. not ready yet ([87bb766](https://github.com/LazyVim/LazyVim/commit/87bb76612318f0c0b4fca675500e3afd0a9c6771))
|
||||
* **trouble-v3:** add neovim version check ([0892542](https://github.com/LazyVim/LazyVim/commit/08925421e840ac21f3feac28ee8b57319f0a4e59))
|
||||
* **util.toggle:** correctly toggle `inlay_hints` ([#3202](https://github.com/LazyVim/LazyVim/issues/3202)) ([23374f1](https://github.com/LazyVim/LazyVim/commit/23374f160a5b1b947681d55add56ab6ab15e219e))
|
||||
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* **comments:** `vim.schedule` ts-context-commentstring integration ([c653c4a](https://github.com/LazyVim/LazyVim/commit/c653c4a9a5c0a3cd5101ce86a3640ee12067ffcd))
|
||||
* **yanky:** switch to shada backend. It seems much faster than sqlite ([4348836](https://github.com/LazyVim/LazyVim/commit/434883632cd6bc884f36da0282073307d585d6a1))
|
||||
|
||||
## [11.1.2](https://github.com/LazyVim/LazyVim/compare/v11.1.1...v11.1.2) (2024-05-17)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **util:** use `bdelete` for buf remove ([19674e8](https://github.com/LazyVim/LazyVim/commit/19674e804787e205c587d153e8e9c4a3988e7f6c))
|
||||
|
||||
## [11.1.1](https://github.com/LazyVim/LazyVim/compare/v11.1.0...v11.1.1) (2024-05-17)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **bufferline:** correctly configure bufferline to use the new bufremove util ([2e1c945](https://github.com/LazyVim/LazyVim/commit/2e1c945f61821eec818a1512bc05b45366c0dfeb))
|
||||
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* **coding:** dont load `vim.snippet` early ([289c2f8](https://github.com/LazyVim/LazyVim/commit/289c2f81c43d39b31a8b46a4a84ab9feb61bb235))
|
||||
|
||||
## [11.1.0](https://github.com/LazyVim/LazyVim/compare/v11.0.1...v11.1.0) (2024-05-17)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **lsp:** document highlights now use native lsp. `vim-illuminate` is available as an extra ([cc99b21](https://github.com/LazyVim/LazyVim/commit/cc99b219ded16ec60120698d6e8f453c2f37132c))
|
||||
* **options:** new option to disable deprecation warnings. warnings will be hidden bydefault ([f8de965](https://github.com/LazyVim/LazyVim/commit/f8de965d3ec5712444a643b507bc9ddc7cb19d01))
|
||||
* **util:** `mini.bufremove` is no longer needed ([779de26](https://github.com/LazyVim/LazyVim/commit/779de263f173f7e6f181d1e8faa475be8b05167d))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* deprecation warning on diagnostic.is_disabled ([960ec80](https://github.com/LazyVim/LazyVim/commit/960ec8079bb5960a510595dff21725ff403b2753))
|
||||
* **lsp:** dont try to highlight refs for deleted buffers ([87493af](https://github.com/LazyVim/LazyVim/commit/87493af2378fac7b518fd2c4db903cd3a2c27095))
|
||||
* **treesitter-rewrite:** add missed local Config ([#3188](https://github.com/LazyVim/LazyVim/issues/3188)) ([ec673a8](https://github.com/LazyVim/LazyVim/commit/ec673a83ff387e29ca42367b3aab3c311950a024))
|
||||
* **util.lsp:** add `desc` for keymaps reference ([#3193](https://github.com/LazyVim/LazyVim/issues/3193)) ([b1ea356](https://github.com/LazyVim/LazyVim/commit/b1ea356e6c676571907ce654ec3878c530c636ad))
|
||||
|
||||
## [11.0.1](https://github.com/LazyVim/LazyVim/compare/v11.0.0...v11.0.1) (2024-05-16)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **news.md:** correct phrase to disable `inlay_hints` ([58cf6f9](https://github.com/LazyVim/LazyVim/commit/58cf6f971b78170aef5f26ccb79149213f4a692d))
|
||||
* **treesitter-rewrite:** show error in Extras only when enabled ([#3178](https://github.com/LazyVim/LazyVim/issues/3178)) ([639dfce](https://github.com/LazyVim/LazyVim/commit/639dfce0101cc6c0174e116872df91ccb30cb597))
|
||||
* **util:** get opts from parsing specs instead of plugins ([14872fa](https://github.com/LazyVim/LazyVim/commit/14872fa816fd770eba0f2b5efc69d5b29d4073fb))
|
||||
|
||||
## [11.0.0](https://github.com/LazyVim/LazyVim/compare/v10.25.0...v11.0.0) (2024-05-16)
|
||||
|
||||
|
||||
### ⚠ BREAKING CHANGES
|
||||
|
||||
* **util:** move `vim-startuptime` to an extra
|
||||
* **coding:** move `mini.ai` to an extra
|
||||
* **mini.surround:** move `mini.surround` to an extra
|
||||
* **ui:** move `mini.indentscope` to an extra
|
||||
* **ui:** moved treesitter-context to an extra. No longer a core plugin
|
||||
* **coding:** native snippets are now the default on Neovim 0.10. Install the luasnip extra to get luasnip back
|
||||
* **coding:** use native comments on 0.10, with support for ts_context_commentstring
|
||||
|
||||
### Features
|
||||
|
||||
* **coding:** move `mini.ai` to an extra ([4f4911f](https://github.com/LazyVim/LazyVim/commit/4f4911ff95bc35438a2b8dd2d058b15f105f2ff1))
|
||||
* **coding:** native snippets are now the default on Neovim 0.10. Install the luasnip extra to get luasnip back ([3c4ebd5](https://github.com/LazyVim/LazyVim/commit/3c4ebd522e7c475cfedcee5dfa7a008e798c404c))
|
||||
* **coding:** use native comments on 0.10, with support for ts_context_commentstring ([d999be7](https://github.com/LazyVim/LazyVim/commit/d999be7401783e0f3a610319fa1b327d38fa3e52))
|
||||
* **extras:** added extra for the `nvim-treesitter` rewrite. Some plugins are not compatible and will be disabled. ([2008146](https://github.com/LazyVim/LazyVim/commit/20081460b65bc7a117933b0dcebbcaa4dcb82b23))
|
||||
* **keymaps:** added leader-uI to open InspectTree ([3b74ef7](https://github.com/LazyVim/LazyVim/commit/3b74ef793fb7cd8964231393a57b9e3c846b7d1e))
|
||||
* **lsp:** enable inlay hints by default on Neovim 0.10 ([960e958](https://github.com/LazyVim/LazyVim/commit/960e958548adce7d96ff2e0c014ce2249897125e))
|
||||
* **mini.surround:** move `mini.surround` to an extra ([e37a699](https://github.com/LazyVim/LazyVim/commit/e37a699096ccb209c1babc29c1d5eeeab74102a1))
|
||||
* **ui:** move `mini.indentscope` to an extra ([69e6daa](https://github.com/LazyVim/LazyVim/commit/69e6daae2ccb4b7b7180e439c1b05d72d3c64e11))
|
||||
* **ui:** moved treesitter-context to an extra. No longer a core plugin ([03704e2](https://github.com/LazyVim/LazyVim/commit/03704e22998be9db17f114acc4060d714fe652fb))
|
||||
* **util:** move `vim-startuptime` to an extra ([66dc9c0](https://github.com/LazyVim/LazyVim/commit/66dc9c09d6356ddc7e5870a4aa74824d3623d315))
|
||||
* **util:** set_upvalue ([f02507b](https://github.com/LazyVim/LazyVim/commit/f02507b1598379250baab293c423f79c393e28e5))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **cmp:** never auto bracket for snippets and correct prev char check. Fixes [#2949](https://github.com/LazyVim/LazyVim/issues/2949) ([6e7ba50](https://github.com/LazyVim/LazyVim/commit/6e7ba50141b1cda415c9391fd345a1e428bad9b6))
|
||||
* **dap:** add debugger to filetypes mapping for launch.json ([#3165](https://github.com/LazyVim/LazyVim/issues/3165)) ([183d6ee](https://github.com/LazyVim/LazyVim/commit/183d6eea606556c8bd7f80a70660c54670e04649))
|
||||
* **dap:** use jsonc support from plenary. Same as the code from neoconf. Fixes [#3174](https://github.com/LazyVim/LazyVim/issues/3174) ([8dae76c](https://github.com/LazyVim/LazyVim/commit/8dae76c1fd6fb90199b56cda8b6ec21576d02eb5))
|
||||
* **health:** add warning when not using 0.10.0 ([9fe8b15](https://github.com/LazyVim/LazyVim/commit/9fe8b15928077cb0c20aeea111b42f9698c78330))
|
||||
* **treesitter-rewrite:** disable vim-illuminate ([b739eb3](https://github.com/LazyVim/LazyVim/commit/b739eb35033acaf20423920d103d5ad3e8350f23))
|
||||
|
||||
## [10.25.0](https://github.com/LazyVim/LazyVim/compare/v10.24.0...v10.25.0) (2024-05-15)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **extras:** add refactoring.nvim ([#3040](https://github.com/LazyVim/LazyVim/issues/3040)) ([73de8dd](https://github.com/LazyVim/LazyVim/commit/73de8dde2bb513337426d5ead862e4fc6dbb8fdf))
|
||||
* **lua_ls:** configure default lua_ls inlay hint settings ([91ead22](https://github.com/LazyVim/LazyVim/commit/91ead221167a722a8dd8651cb5c53bf5db4d1b4d))
|
||||
* **lua:** added `LazyVim` as a treesitter builtin ([a97fa3b](https://github.com/LazyVim/LazyVim/commit/a97fa3b7563eb2c5305c8f32461bb150d17e45ae))
|
||||
* **noice:** added keymap `<leader>snt` to show Noice messages in telescope. Fixes [#1306](https://github.com/LazyVim/LazyVim/issues/1306) ([914ca4a](https://github.com/LazyVim/LazyVim/commit/914ca4a455169916da4614d76c15d1d1bf22e9bc))
|
||||
* **omnisharp:** support neotest dotnet ([#3051](https://github.com/LazyVim/LazyVim/issues/3051)) ([a8659d0](https://github.com/LazyVim/LazyVim/commit/a8659d02b954ca320088aab48aad8a95b3bbb86c))
|
||||
* **snippet:** add friendly-snippets to native extra ([#2944](https://github.com/LazyVim/LazyVim/issues/2944)) ([12a48b8](https://github.com/LazyVim/LazyVim/commit/12a48b8ce1521fcac01b89099a4ca8bbc3547769))
|
||||
* **terraform:** ensure tflint is installed ([#2336](https://github.com/LazyVim/LazyVim/issues/2336)) ([16e6c86](https://github.com/LazyVim/LazyVim/commit/16e6c86b2778ba35696de5067ff033cc5bdbe6db))
|
||||
* **typescript:** configure inlayHint ([#2995](https://github.com/LazyVim/LazyVim/issues/2995)) ([2c86da7](https://github.com/LazyVim/LazyVim/commit/2c86da7c2df61c23366e4073312ab12fa6d7e424))
|
||||
* **vue:** add Vue.js support to LazyVim ([#3094](https://github.com/LazyVim/LazyVim/issues/3094)) ([f449025](https://github.com/LazyVim/LazyVim/commit/f4490252fb2262208923ba197eb521732a602ac1))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **ansible:** ansiblels not loading, keymap desc. ([#2739](https://github.com/LazyVim/LazyVim/issues/2739)) ([abb1ff0](https://github.com/LazyVim/LazyVim/commit/abb1ff0d600b3446b612390f0482cf92bdc84ab0))
|
||||
* **autocmds:** remove query from q-to-quit autocmd ([#2838](https://github.com/LazyVim/LazyVim/issues/2838)) ([9337db1](https://github.com/LazyVim/LazyVim/commit/9337db17c2f6082e10c97456185d8ba3fa473769))
|
||||
* **clangd:** update the attribute name for process ID ([#3047](https://github.com/LazyVim/LazyVim/issues/3047)) ([3c04789](https://github.com/LazyVim/LazyVim/commit/3c04789ef15bba15e8c0c71ef31db38c76b2ad67))
|
||||
* **cmp:** dont add autobrackets if prev char is a bracket. Closes [#2949](https://github.com/LazyVim/LazyVim/issues/2949) ([c70a78e](https://github.com/LazyVim/LazyVim/commit/c70a78e63137ec48e1c78b23413332716f572590))
|
||||
* **dap:** load vscode launch files with jsonc parser ([#1839](https://github.com/LazyVim/LazyVim/issues/1839)) ([543dead](https://github.com/LazyVim/LazyVim/commit/543dead590a949255fbbada9e1775c31ad654682))
|
||||
* **dial:** Fix dial commands in Visual line+block ([#2933](https://github.com/LazyVim/LazyVim/issues/2933)) ([1df3c5d](https://github.com/LazyVim/LazyVim/commit/1df3c5d70b2265f8582b0ed414f085e9066960da))
|
||||
* **dot:** remove `.env` => `sh` since this is already the default ([a0afe8f](https://github.com/LazyVim/LazyVim/commit/a0afe8fef9dc76b469a78435cdd3f2c5ee01f282))
|
||||
* **dot:** use syntax `sh` for dotenv files. Closes [#3145](https://github.com/LazyVim/LazyVim/issues/3145) ([42010d1](https://github.com/LazyVim/LazyVim/commit/42010d1dfbb0ba9c74c1ec0c93c5c9db21ebee47))
|
||||
* **extras.lang.typescript:** support `node` debug type along with `pwa-node` ([#2983](https://github.com/LazyVim/LazyVim/issues/2983)) ([d36e3a5](https://github.com/LazyVim/LazyVim/commit/d36e3a5c73c07f54b31c4ec5334f68ed5492123e))
|
||||
* **fzf-native:** try rebuilding fzf-native when needed. Fixes [#2464](https://github.com/LazyVim/LazyVim/issues/2464) ([39901c1](https://github.com/LazyVim/LazyVim/commit/39901c1f00eca36beb211978164744ae41be7781))
|
||||
* **gitsigns:** update deprecated hunk nav mappings ([#2935](https://github.com/LazyVim/LazyVim/issues/2935)) ([fc5ee49](https://github.com/LazyVim/LazyVim/commit/fc5ee49495093fe8e63b1648f81af371c2930129))
|
||||
* **keymaps:** better up/down keymaps description ([#1909](https://github.com/LazyVim/LazyVim/issues/1909)) ([36802fe](https://github.com/LazyVim/LazyVim/commit/36802fea198f536ac20c0e2514fc4f54cee2904b))
|
||||
* **lazyfile:** exclude `filetypedetect` from skips ([#3004](https://github.com/LazyVim/LazyVim/issues/3004)) ([c54eeb5](https://github.com/LazyVim/LazyVim/commit/c54eeb53905e8da27814f52eaf1ad63aeff4cbe4))
|
||||
* **lsp:** check if `diagnostics.signs` is disabled by user ([#2897](https://github.com/LazyVim/LazyVim/issues/2897)) ([6a25450](https://github.com/LazyVim/LazyVim/commit/6a2545025eb6fcc78998b8a4c6d121729980925b))
|
||||
* **pretty_path:** properly escape `%` characters ([e89653f](https://github.com/LazyVim/LazyVim/commit/e89653f4107724f53964a379337947490117a7dc))
|
||||
* **rust:** update creates.nvim src option to completion ([#3149](https://github.com/LazyVim/LazyVim/issues/3149)) ([8087283](https://github.com/LazyVim/LazyVim/commit/8087283fea62e5673764dfa13906eadb24110622))
|
||||
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* **startup:** render a file opened from the cmdline as soon as possible and get rid of lazy_file logic ([965a469](https://github.com/LazyVim/LazyVim/commit/965a469ca8cb1d58b49c4e5d8b85430e8c6c0a25))
|
||||
* **treesitter:** dont let nvim-treesitter-textobjects stall loading treesitter ([8301096](https://github.com/LazyVim/LazyVim/commit/8301096c31f9855c74d5b732367b679bc8721b5e))
|
||||
* **treesitter:** load treesitter early during startup when opening a file from the cmdline ([b29d169](https://github.com/LazyVim/LazyVim/commit/b29d169afb7560ed4a9276e4379e28ffaed1a171))
|
||||
* **yanky:** `schedule_wrap` sqlite push to history to prevent blocking Neovim on copy/paste ([9047d04](https://github.com/LazyVim/LazyVim/commit/9047d041a8296e34ed7236e5344f5b927cd28f8b))
|
||||
* **yanky:** remove performance optim for sqlite since it has been merged upstream ([f25ac50](https://github.com/LazyVim/LazyVim/commit/f25ac504b896a522c645d456766adac2afa28801))
|
||||
|
||||
## [10.24.0](https://github.com/LazyVim/LazyVim/compare/v10.23.0...v10.24.0) (2024-05-12)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **mason-lspconfig:** allow `opts.ensure_installed` to be taken into account ([#3134](https://github.com/LazyVim/LazyVim/issues/3134)) ([8968c9e](https://github.com/LazyVim/LazyVim/commit/8968c9e9ea76f3a7616d9e249a3c9307a75fffad))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **neo-tree:** correctly set up `cwd` ([#3097](https://github.com/LazyVim/LazyVim/issues/3097)) ([30ce84f](https://github.com/LazyVim/LazyVim/commit/30ce84f7a7fb4e88b47ddf2f569b2ea9b7d56717))
|
||||
* **ui:** don't lazy-load dashboard-nvim ([#3107](https://github.com/LazyVim/LazyVim/issues/3107)) ([30c9e47](https://github.com/LazyVim/LazyVim/commit/30c9e4718a127f7d5a32f11c4d8dbba6b01f9858))
|
||||
|
||||
## [10.23.0](https://github.com/LazyVim/LazyVim/compare/v10.22.0...v10.23.0) (2024-05-03)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **lualine:** make path trimming configurable by user ([#3062](https://github.com/LazyVim/LazyVim/issues/3062)) ([b8475f5](https://github.com/LazyVim/LazyVim/commit/b8475f51949acf195729a1c4d057a06208a9add9))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **dot:** can't match kitty conf file ([#3042](https://github.com/LazyVim/LazyVim/issues/3042)) ([5fb4cf0](https://github.com/LazyVim/LazyVim/commit/5fb4cf0d365b65cb9b7afa8be047973b5fc1747a))
|
||||
* **dot:** install when list is empty ([#3052](https://github.com/LazyVim/LazyVim/issues/3052)) ([3086bf0](https://github.com/LazyVim/LazyVim/commit/3086bf03e96bfc0048e5b27f8d65a9170bca3f67))
|
||||
* **extras:** Rust-Analyzer cargo option ([#3061](https://github.com/LazyVim/LazyVim/issues/3061)) ([a96348d](https://github.com/LazyVim/LazyVim/commit/a96348d7b076819f7580ea0c0ce467630bfc7cc5))
|
||||
* **native_snippets:** Fix native_snippets for `vim.snippet api` changes ([#3083](https://github.com/LazyVim/LazyVim/issues/3083)) ([6004e8d](https://github.com/LazyVim/LazyVim/commit/6004e8d4f60549bd2c5d6f3187a28d72b21e3261))
|
||||
* **python:** make both `ruff` and `ruff_lsp` available to user ([#3060](https://github.com/LazyVim/LazyVim/issues/3060)) ([34183a2](https://github.com/LazyVim/LazyVim/commit/34183a2759828001b08679659f7d5170d7ec367e))
|
||||
|
||||
## [10.22.0](https://github.com/LazyVim/LazyVim/compare/v10.21.1...v10.22.0) (2024-04-22)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **dot:** add bashls and shellcheck ([#2879](https://github.com/LazyVim/LazyVim/issues/2879)) ([97480dc](https://github.com/LazyVim/LazyVim/commit/97480dc5d2dbb717b45a351e0b04835f138a9094))
|
||||
* **dot:** add more filetypes ([#2987](https://github.com/LazyVim/LazyVim/issues/2987)) ([15b09e8](https://github.com/LazyVim/LazyVim/commit/15b09e800ba7fb0c9ca8270a77e71083396e9db1))
|
||||
* **git:** `<leader>gb` for Git Blame Line ([9e3af10](https://github.com/LazyVim/LazyVim/commit/9e3af1070fc1932da322105708ebb32a2cd9572b))
|
||||
* **python:** use new `ruff` instead of `ruff_lsp` ([#3016](https://github.com/LazyVim/LazyVim/issues/3016)) ([cd04b58](https://github.com/LazyVim/LazyVim/commit/cd04b58fe3f7299fbca75e7eb47287617ac23fcf))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **edgy:** proper way of opening neo-tree. Fixes [#2984](https://github.com/LazyVim/LazyVim/issues/2984) ([6fdbc62](https://github.com/LazyVim/LazyVim/commit/6fdbc623e0a59220e754800df3b86788eca0813d))
|
||||
* **harpoon:** harpoon2 deprecated message ([#2920](https://github.com/LazyVim/LazyVim/issues/2920)) ([79fed97](https://github.com/LazyVim/LazyVim/commit/79fed97f2357b2969cb23d106137978ca7cdffb4))
|
||||
* **harpoon:** optimizes harpoon keys ([#2877](https://github.com/LazyVim/LazyVim/issues/2877)) ([50b7f42](https://github.com/LazyVim/LazyVim/commit/50b7f426f287ecfc542dd9c197e430b0aca8af04))
|
||||
* **mini.pairs:** better default for ```` ([32eacde](https://github.com/LazyVim/LazyVim/commit/32eacde793fddcca0bcfbbd494b6aa8b2c870d0f))
|
||||
* **toggle:** use new `inlay_hint.enable()` signature ([#3013](https://github.com/LazyVim/LazyVim/issues/3013)) ([5f92dc5](https://github.com/LazyVim/LazyVim/commit/5f92dc5304b99a3e76dca878d9b47557fb64f384))
|
||||
* **trouble_v3:** keymap `previous` is deprecated, use `prev` instead ([#2968](https://github.com/LazyVim/LazyVim/issues/2968)) ([0fa6360](https://github.com/LazyVim/LazyVim/commit/0fa63603afcb9b478c49a54d94314d20af00ae95))
|
||||
* **trouble_v3:** show error only when `trouble_v3` is enabled ([#2989](https://github.com/LazyVim/LazyVim/issues/2989)) ([ceb4855](https://github.com/LazyVim/LazyVim/commit/ceb4855b434c8e7095bbf47cfc3b3647532d6a2c))
|
||||
* **trouble-v3:** fix telescope integration ([9da13ef](https://github.com/LazyVim/LazyVim/commit/9da13ef7e8a0b6c07e8e35f7c93dc77f3408d38b))
|
||||
|
||||
## [10.21.1](https://github.com/LazyVim/LazyVim/compare/v10.21.0...v10.21.1) (2024-03-29)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **lsp:** better support for diagnostics icons on Neovim nightly/stable ([aaa10e7](https://github.com/LazyVim/LazyVim/commit/aaa10e717dbe76c5b6b0ab302698f1d151863dc6))
|
||||
* **lsp:** dont define diagnostics signs on >= 0.10.0 ([64f8614](https://github.com/LazyVim/LazyVim/commit/64f86147f9f4c67548185798f755c80e03c2098a))
|
||||
* merge conflict ([349ae03](https://github.com/LazyVim/LazyVim/commit/349ae03f0997d20aa6b4a23315e62dfeab77d559))
|
||||
* **native_snippets:** don't try to enable native snippets on Neovim < 0.10.0 and show warning ([f308867](https://github.com/LazyVim/LazyVim/commit/f3088675703986b6d37061ebcf0a417c132fd45f))
|
||||
|
||||
## [10.21.0](https://github.com/LazyVim/LazyVim/compare/v10.20.1...v10.21.0) (2024-03-29)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **trouble:** added `<leader>cS` to open a trouble list of all references / definitions / ... of the item under the cursor ([7544675](https://github.com/LazyVim/LazyVim/commit/754467525b420c85150f13b2cd9e280570c7556c))
|
||||
* **trouble:** enabled edgy ([80a8b18](https://github.com/LazyVim/LazyVim/commit/80a8b18be6577dcea35748eb563ebef7cf1b3c15))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **mini.move:** default mini.move setup already maps the correct keys ([3166236](https://github.com/LazyVim/LazyVim/commit/3166236ff88a13e7e5b7579ae780b682f2356d62))
|
||||
* **tex:** don't override conceallevel for tex. Not sure why that was added ([914f26d](https://github.com/LazyVim/LazyVim/commit/914f26d04e6b9a61f7d4fc80ad433d75dac3f14b))
|
||||
|
||||
## [10.20.1](https://github.com/LazyVim/LazyVim/compare/v10.20.0...v10.20.1) (2024-03-28)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **trouble-v3:** use the filtered symbols list for lualine ([4ca0bf6](https://github.com/LazyVim/LazyVim/commit/4ca0bf69dd1e4a359af6894490f794bd5fc12cf0))
|
||||
|
||||
## [10.20.0](https://github.com/LazyVim/LazyVim/compare/v10.19.0...v10.20.0) (2024-03-28)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **cmp:** added option `auto_brackets` that adds brackets to functions/methods in configured filetypes ([bf8ce80](https://github.com/LazyVim/LazyVim/commit/bf8ce8076e283ecabce6b2f2a04995b3deeeb593))
|
||||
* **extras:** added extra for mini.diff ([e29c7ac](https://github.com/LazyVim/LazyVim/commit/e29c7acd2d149da8166f2f44c920cc7d5c89971a))
|
||||
* **extras:** added extra for the `trouble.nvim` v3 beta ([bb6aa98](https://github.com/LazyVim/LazyVim/commit/bb6aa98cbfe0547150be89dc42f35e3b3eef8b5d))
|
||||
* **extras:** use mini.move instead of native move ([#2865](https://github.com/LazyVim/LazyVim/issues/2865)) ([8f1fb60](https://github.com/LazyVim/LazyVim/commit/8f1fb60f0a78cb2e83b485e1f946822812c5ff50))
|
||||
* **python:** enable auto_brackets for python, since pyright and basedpyright dont support this natively ([d95c2ba](https://github.com/LazyVim/LazyVim/commit/d95c2ba1dc75307b154c870aa808f322debc6070))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **config:** type filter was broken for telescope symbols ([e3075b0](https://github.com/LazyVim/LazyVim/commit/e3075b05ef9646e07639ae896bd8896f68ad5d5f))
|
||||
* **nvim-lint:** don't duplicate linters. Fixes [#2852](https://github.com/LazyVim/LazyVim/issues/2852) ([cfbd358](https://github.com/LazyVim/LazyVim/commit/cfbd3582736286433ee5532e1ea3a8d05a1e2649))
|
||||
* **statuscolumn:** right align signs when virtnum > 0 ([a786c47](https://github.com/LazyVim/LazyVim/commit/a786c471df5c048690618b6ff17fa2bc9648891d))
|
||||
* **trouble:** show message if use hasnt updated with Lazy yet after enabling the extra ([9a2f773](https://github.com/LazyVim/LazyVim/commit/9a2f7730907fd9124ec536f8dc2ad0a253f18f36))
|
||||
|
||||
## [10.19.0](https://github.com/LazyVim/LazyVim/compare/v10.18.0...v10.19.0) (2024-03-27)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **lazygit:** allow customizing the lazygit theme. Check the code to change the hl group mapping. Fixes [#2846](https://github.com/LazyVim/LazyVim/issues/2846) ([bb1480a](https://github.com/LazyVim/LazyVim/commit/bb1480a6b9ca9e524450192423eac88ba2a32e18))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **autocmds:** auto create directory on windows for uris. Fixes [#2442](https://github.com/LazyVim/LazyVim/issues/2442) ([7d570fa](https://github.com/LazyVim/LazyVim/commit/7d570fad7949288711c6238468add594963cabaa))
|
||||
* **keymaps:** update all keymap descriptions to be Title Case ([#2844](https://github.com/LazyVim/LazyVim/issues/2844)) ([eb9f9a8](https://github.com/LazyVim/LazyVim/commit/eb9f9a8862983abe1c7dd51f5f6bf2bd6978346f))
|
||||
* **lazygit:** error handling for getting lazygit's config path ([ce5917a](https://github.com/LazyVim/LazyVim/commit/ce5917a58965b47ed09462ddb5d160dee2b130ae))
|
||||
* **lazygit:** use `Visual` instead of `CursorLine` for selected line. Fixes [#2846](https://github.com/LazyVim/LazyVim/issues/2846) ([6ed771d](https://github.com/LazyVim/LazyVim/commit/6ed771de9dd3b14de78e83ed1c62b4f4fcee3c03))
|
||||
* **python-semshi:** better highlights ([#2839](https://github.com/LazyVim/LazyVim/issues/2839)) ([d945137](https://github.com/LazyVim/LazyVim/commit/d945137a323c6c0200af50444981c7d05ed93f3f))
|
||||
|
||||
## [10.18.0](https://github.com/LazyVim/LazyVim/compare/v10.17.3...v10.18.0) (2024-03-26)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **extras:** add dial extra ([#2798](https://github.com/LazyVim/LazyVim/issues/2798)) ([76b037d](https://github.com/LazyVim/LazyVim/commit/76b037dcc1105f23b92fe6211d747f97705413fa))
|
||||
* **lazygit:** configure lazygit nvim-remote as editor and enable nerdfont icons ([426cd3e](https://github.com/LazyVim/LazyVim/commit/426cd3ed91b90e5304802904d14dc3826da317c9))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **terminal:** dont use backdrop for edgy terminal windows ([fd0677f](https://github.com/LazyVim/LazyVim/commit/fd0677fb9a512c4a4a6bae534a018f361a9bfe30))
|
||||
|
||||
## [10.17.3](https://github.com/LazyVim/LazyVim/compare/v10.17.2...v10.17.3) (2024-03-26)
|
||||
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* **notify:** disable animation notifications. too big impact on performance for too little benefit ([f3655c3](https://github.com/LazyVim/LazyVim/commit/f3655c33a3239b67ce9c5e5a8cc384691fd8126c))
|
||||
|
||||
## [10.17.2](https://github.com/LazyVim/LazyVim/compare/v10.17.1...v10.17.2) (2024-03-26)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **lazygit:** dont error when setting ansi color fails. Fixes [#2829](https://github.com/LazyVim/LazyVim/issues/2829) ([a26ca7b](https://github.com/LazyVim/LazyVim/commit/a26ca7bf56790f6bc35134a5037df0405437a1be))
|
||||
|
||||
## [10.17.1](https://github.com/LazyVim/LazyVim/compare/v10.17.0...v10.17.1) (2024-03-26)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **lazygit:** allow overriding default terminal options ([bfe8c60](https://github.com/LazyVim/LazyVim/commit/bfe8c608a33255511fa3e79bf77fd7257022a525))
|
||||
|
||||
## [10.17.0](https://github.com/LazyVim/LazyVim/compare/v10.16.0...v10.17.0) (2024-03-26)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **lazygit:** lazygit now automatically uses colors from your Neovim colorscheme ([7d0dbc6](https://github.com/LazyVim/LazyVim/commit/7d0dbc6dedc2d6cb4c3bc77fa296dc07ce5927c9))
|
||||
* **neo-tree:** add mapping "O" to open with system default ([#2758](https://github.com/LazyVim/LazyVim/issues/2758)) ([b74ef23](https://github.com/LazyVim/LazyVim/commit/b74ef23a27dc4efc1cf76f14eb5ecced963d694d))
|
||||
* **options:** Disable foldtext for nightly ([#2447](https://github.com/LazyVim/LazyVim/issues/2447)) ([7ab6285](https://github.com/LazyVim/LazyVim/commit/7ab628501150b6dbaa6daae4a8ac7b864318677f))
|
||||
* **python:** allow configuring other python lsp servers than pyright, basedpyright ([3e5a5dd](https://github.com/LazyVim/LazyVim/commit/3e5a5dd621438cff4dbe29df227585b46ede7e44))
|
||||
* **util:** added util function to get a fg/bg color from the active colorscheme ([c00e3aa](https://github.com/LazyVim/LazyVim/commit/c00e3aa6b1d053e5bea7bfdfbfd3b5aedb6cb5be))
|
||||
|
||||
## [10.16.0](https://github.com/LazyVim/LazyVim/compare/v10.15.0...v10.16.0) (2024-03-22)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* added LazyVim global. Will refactor specs later to use that ([6e57e86](https://github.com/LazyVim/LazyVim/commit/6e57e86c9952986a0e90055e13aa86dcde5e478e))
|
||||
* **lazyterm:** optional shell setup, mainly for pwsh. Fixes [#2151](https://github.com/LazyVim/LazyVim/issues/2151) ([3d4ab4e](https://github.com/LazyVim/LazyVim/commit/3d4ab4eb2634c9280676a7efdfb2753e5b2f8536))
|
||||
* **telescope-fzf-native:** added support for building with cmake. Fixes [#2132](https://github.com/LazyVim/LazyVim/issues/2132) ([1c13a5c](https://github.com/LazyVim/LazyVim/commit/1c13a5c10b745f741ebbb08d3963862e9d4e307e))
|
||||
* use `vim.uv` everywhere instead of `vim.loop` ([3a87c08](https://github.com/LazyVim/LazyVim/commit/3a87c08cdadb23ae88bd6eb193e8392e986df6bb))
|
||||
* use LazyVim everywhere instead of `require("lazyvim.util")` ([7a5dbea](https://github.com/LazyVim/LazyVim/commit/7a5dbeae75b553b489af8074e9a87207edf1395c))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* add shim for vim.uv just in case someone upgrades lazyvim before lazy ([4b8fe44](https://github.com/LazyVim/LazyVim/commit/4b8fe44c08610be7a0603d84ae03ca81a98cbeee))
|
||||
* **cmake:** lazy load cmake-tools. Fixes [#2767](https://github.com/LazyVim/LazyVim/issues/2767) ([69aedc2](https://github.com/LazyVim/LazyVim/commit/69aedc265724c71711753333e3b7506fbeab78ef))
|
||||
* **format:** Don't leak bufnr into opts tables ([#2794](https://github.com/LazyVim/LazyVim/issues/2794)) ([213493e](https://github.com/LazyVim/LazyVim/commit/213493e766df7a5405050205f6050ff24e5a2d6d))
|
||||
* **java:** dont error when not using cmp. Fixes [#2038](https://github.com/LazyVim/LazyVim/issues/2038) ([8d31bf2](https://github.com/LazyVim/LazyVim/commit/8d31bf230cf9ad872ad50251d405ed628c9e69ae))
|
||||
* **python:** basedpyright is now supported by mason-lspconfig ([4187417](https://github.com/LazyVim/LazyVim/commit/4187417158a22ff80a059a73f2eddb113f59c113))
|
||||
* **util.telescope:** make `show_untracked` configurable ([#2789](https://github.com/LazyVim/LazyVim/issues/2789)) ([1661759](https://github.com/LazyVim/LazyVim/commit/1661759d3358dbaa4be834f0022d53071b6fb21c))
|
||||
|
||||
## [10.15.0](https://github.com/LazyVim/LazyVim/compare/v10.14.0...v10.15.0) (2024-03-20)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **python:** added option to configure basedpyright as lsp. Check the python extra docs. Fixes [#2787](https://github.com/LazyVim/LazyVim/issues/2787) ([f055265](https://github.com/LazyVim/LazyVim/commit/f055265bff24f047320bca1a402ab55a32b35111))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **lsp:** dont auto install disabled lsp servers ([fa0e538](https://github.com/LazyVim/LazyVim/commit/fa0e538838f2bd3b429a98a6d676dacb7b0916af))
|
||||
|
||||
## [10.14.0](https://github.com/LazyVim/LazyVim/compare/v10.13.0...v10.14.0) (2024-03-19)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **lualine:** add `modified_sign` to `pretty_path` ([#2754](https://github.com/LazyVim/LazyVim/issues/2754)) ([ed44b24](https://github.com/LazyVim/LazyVim/commit/ed44b246b443939ca7755bef1522c68df94c2a76))
|
||||
* **mini.ai:** add more objects d,e,g,u,U ([#2769](https://github.com/LazyVim/LazyVim/issues/2769)) ([f655139](https://github.com/LazyVim/LazyVim/commit/f65513928127ec4e2e4187af36ec49255bd0f5fb))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **extras:** accept symlinks in User `extras` directory ([#2745](https://github.com/LazyVim/LazyVim/issues/2745)) ([6a37171](https://github.com/LazyVim/LazyVim/commit/6a37171df6391482a3440cf607c173525bc875ba))
|
||||
* **format:** format injected langs does not wait 300ms ([#2737](https://github.com/LazyVim/LazyVim/issues/2737)) ([52ee7ef](https://github.com/LazyVim/LazyVim/commit/52ee7ef6962f499114f8e91230ef5558444e3a0c))
|
||||
* **git:** use compatible function for windows and linux ([#2740](https://github.com/LazyVim/LazyVim/issues/2740)) ([42a7e79](https://github.com/LazyVim/LazyVim/commit/42a7e79d5a09936ee521cab29d601d336c396c18))
|
||||
* **lazygit:** make sure we start lazygit in a valid git root ([d8d380a](https://github.com/LazyVim/LazyVim/commit/d8d380a60e7dc396fcf2fee90ace77760585d685))
|
||||
* **neotest:** add required nvim-nio to test and dap extra (neotest and nvim-dap-ui respectively) ([#2763](https://github.com/LazyVim/LazyVim/issues/2763)) ([393a9c7](https://github.com/LazyVim/LazyVim/commit/393a9c7c7ab2c37a69a9b5da609c27fa2fd3816c))
|
||||
|
||||
## [10.13.0](https://github.com/LazyVim/LazyVim/compare/v10.12.1...v10.13.0) (2024-03-14)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **git:** add <leader>gf for lazygit commit history on current file ([#2728](https://github.com/LazyVim/LazyVim/issues/2728)) ([0ec7a90](https://github.com/LazyVim/LazyVim/commit/0ec7a9040b60943597649940619f23bfa4b46990))
|
||||
* **lualine:** add more hl options to pretty_path ([#2687](https://github.com/LazyVim/LazyVim/issues/2687)) ([d3761ed](https://github.com/LazyVim/LazyVim/commit/d3761eded733b5f00e1ee14fef3fb2ce0dfb7dd0))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **conform:** make `lsp_fallback` option user configurable ([#2616](https://github.com/LazyVim/LazyVim/issues/2616)) ([afca0b7](https://github.com/LazyVim/LazyVim/commit/afca0b7876abf9022ee0754270f603e981ea42a5))
|
||||
* **markdown:** disable headlines.nvim bullets for now ([843032e](https://github.com/LazyVim/LazyVim/commit/843032ef1c751abf732b6f1d989584c199f049fb))
|
||||
* **markdown:** disable headlines.nvim in insert mode. Fixes [#2717](https://github.com/LazyVim/LazyVim/issues/2717) ([0ba731a](https://github.com/LazyVim/LazyVim/commit/0ba731a87977e98f2420e2c6d2c4cabbcedaff60))
|
||||
* **mini.files:** description for `g.` keybinding in mini.files ([#2693](https://github.com/LazyVim/LazyVim/issues/2693)) ([9915234](https://github.com/LazyVim/LazyVim/commit/991523431ff779b3bfe8ae133fa8109d8950d361))
|
||||
* **options:** dont set clipboard in an SSH session, so that OSC52 can be enabled (when supported) ([1c9f416](https://github.com/LazyVim/LazyVim/commit/1c9f4160a22dbdca2db36169460fcf28641607e7))
|
||||
* **rust:** don't overwrite `vim.g.rustaceanvim` if it is defined ([#2720](https://github.com/LazyVim/LazyVim/issues/2720)) ([2a666ac](https://github.com/LazyVim/LazyVim/commit/2a666ac5f2d91f0a1f1b711281dd72725f9759a1))
|
||||
* **terraform-extra:** Drop unnecessary commentstring config for terraform ([#2680](https://github.com/LazyVim/LazyVim/issues/2680)) ([b12e742](https://github.com/LazyVim/LazyVim/commit/b12e7424580d4b524755eec33006d4517fa3182e))
|
||||
* **which-key:** add group description for folds ([#2496](https://github.com/LazyVim/LazyVim/issues/2496)) ([623297e](https://github.com/LazyVim/LazyVim/commit/623297efa688283b54f1b9ad169feca69aaaae67))
|
||||
|
||||
## [10.12.1](https://github.com/LazyVim/LazyVim/compare/v10.12.0...v10.12.1) (2024-03-08)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **extras:** automatically rename extra symbols-outline => outline. Fixes [#2675](https://github.com/LazyVim/LazyVim/issues/2675) ([ee2e876](https://github.com/LazyVim/LazyVim/commit/ee2e876252c82458d47617b6d87d827ea442ddcd))
|
||||
* **extras:** prevent duplicate extra imports ([935bc22](https://github.com/LazyVim/LazyVim/commit/935bc2283f9968a8fb1fc2466a14618a838cb904))
|
||||
* **haskell:** Make Haskell-snippets lazy load for performance ([#2676](https://github.com/LazyVim/LazyVim/issues/2676)) ([04bc571](https://github.com/LazyVim/LazyVim/commit/04bc5718a51364dddf365ba9163b2a1c7d74071d))
|
||||
* **hi-patterns:** correct regex for shorthand hex colors. See #[#2562](https://github.com/LazyVim/LazyVim/issues/2562) ([7415231](https://github.com/LazyVim/LazyVim/commit/7415231855f8173e9664c035a1a631da8c664948))
|
||||
|
||||
## [10.12.0](https://github.com/LazyVim/LazyVim/compare/v10.11.1...v10.12.0) (2024-03-07)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **lang:** replace rust-tools.nvim with rustacean.nvim [#2198](https://github.com/LazyVim/LazyVim/issues/2198) ([139c41c](https://github.com/LazyVim/LazyVim/commit/139c41c18ed7bde8dbaf5ef18afc063a96092954))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **extras:** set correct priority for outline extra. Fixes [#2666](https://github.com/LazyVim/LazyVim/issues/2666) ([4745314](https://github.com/LazyVim/LazyVim/commit/474531407454cb69f1d09e4bc1120b9571dc8697))
|
||||
|
||||
## [10.11.1](https://github.com/LazyVim/LazyVim/compare/v10.11.0...v10.11.1) (2024-03-07)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **extras:** show rename of symbols-outline => outline ([c6736ef](https://github.com/LazyVim/LazyVim/commit/c6736ef2b8962a9b0a8d5cb5916f1b11835ac090))
|
||||
|
||||
## [10.11.0](https://github.com/LazyVim/LazyVim/compare/v10.10.0...v10.11.0) (2024-03-07)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **autocmds:** added support for copy/paste through ssh. Needs Neovim >= 0.10.0 ([21ca466](https://github.com/LazyVim/LazyVim/commit/21ca466db13e68740aa3348c7406369c53062a9e))
|
||||
* **extras:** add harpoon2 ([#2455](https://github.com/LazyVim/LazyVim/issues/2455)) ([cae22ba](https://github.com/LazyVim/LazyVim/commit/cae22baf082dcf68c5a4074ca4f6534589d80f8d))
|
||||
* **extras:** Add scala support using nvim-metals ([#1347](https://github.com/LazyVim/LazyVim/issues/1347)) ([d250261](https://github.com/LazyVim/LazyVim/commit/d2502613ff0fe8116a3a8891006b1a880834be15))
|
||||
* **extras:** Enable project-specific plugin specs using local .lazy.lua ([#2115](https://github.com/LazyVim/LazyVim/issues/2115)) ([b949835](https://github.com/LazyVim/LazyVim/commit/b949835de50555b8a1c15b24361d6abb73d30808))
|
||||
* **hipatterns:** add shorthand hex color support ([#2562](https://github.com/LazyVim/LazyVim/issues/2562)) ([a8eeb1b](https://github.com/LazyVim/LazyVim/commit/a8eeb1b75d9df360f2b63f0f52708f24172990e5))
|
||||
* **java:** allow opts for setup_dap_main_class_configs() ([#2581](https://github.com/LazyVim/LazyVim/issues/2581)) ([a7c16f8](https://github.com/LazyVim/LazyVim/commit/a7c16f8efd145122869ffb272d70a1229907a823))
|
||||
* **lang:** add ansible support ([#1218](https://github.com/LazyVim/LazyVim/issues/1218)) ([b7da44c](https://github.com/LazyVim/LazyVim/commit/b7da44caaed0bf7da0fd81d56f00428ff8df59d2))
|
||||
* **lang:** add Haskell config ([#2052](https://github.com/LazyVim/LazyVim/issues/2052)) ([c6c584f](https://github.com/LazyVim/LazyVim/commit/c6c584f7c3263e685e064fb84f69e58d9b625f23))
|
||||
* **lang:** add support for helm chart templates ([#2273](https://github.com/LazyVim/LazyVim/issues/2273)) ([de01a37](https://github.com/LazyVim/LazyVim/commit/de01a37cb68c3ddfb64e9576df0878a4373a6dcb))
|
||||
* **lang:** add telescope terraform integrations ([#2235](https://github.com/LazyVim/LazyVim/issues/2235)) ([d57817d](https://github.com/LazyVim/LazyVim/commit/d57817d79b18a2e9aa39db129056be3adf3c8371))
|
||||
* **lsp:** added native codelens support. Enable in lsp settings. (disabled by default). Fixes [#2656](https://github.com/LazyVim/LazyVim/issues/2656) ([780b9bb](https://github.com/LazyVim/LazyVim/commit/780b9bb337dc57bcd7f2bf4dc8bb5be62a6ce92b))
|
||||
* **omnisharp:** add `nvim-dap` configuration ([#2532](https://github.com/LazyVim/LazyVim/issues/2532)) ([f23d3ce](https://github.com/LazyVim/LazyVim/commit/f23d3cee422a8b77572a8db6fe915d374625453f))
|
||||
* **symbols-outline:** use outline.nvim instead of symbols-outline.nvim ([#2535](https://github.com/LazyVim/LazyVim/issues/2535)) ([a48b14e](https://github.com/LazyVim/LazyVim/commit/a48b14eb3e4ff03e55796dc50e08b6c8a42cccf4))
|
||||
* **treesitter:** add xml to `ensure_installed` ([#1962](https://github.com/LazyVim/LazyVim/issues/1962)) ([1b0b899](https://github.com/LazyVim/LazyVim/commit/1b0b899ab361cdabf74395449ff3c622ef74dcb1))
|
||||
* **ui:** dashboard files searches git files if in git repo ([#2240](https://github.com/LazyVim/LazyVim/issues/2240)) ([66b3c0a](https://github.com/LazyVim/LazyVim/commit/66b3c0a19fe3024d4bf1da563f7ca5a9aff58dec))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **ansible:** incorrect key spec ([b2a0ae6](https://github.com/LazyVim/LazyVim/commit/b2a0ae6d0d03270697359399bc33418493079a3d))
|
||||
* **autocmds:** nvim already binds q to close for man-files ([#2594](https://github.com/LazyVim/LazyVim/issues/2594)) ([16d6ac2](https://github.com/LazyVim/LazyVim/commit/16d6ac234a3fa813ed920d5e3a5fb2a8e35c20d6))
|
||||
* **dot:** remove hyprlang plugin ([#2623](https://github.com/LazyVim/LazyVim/issues/2623)) ([796112e](https://github.com/LazyVim/LazyVim/commit/796112e1707ce1a693cd76a95b84dda5529fc990))
|
||||
* **go:** adding opts recursive_run ([#2520](https://github.com/LazyVim/LazyVim/issues/2520)) ([e8e7d22](https://github.com/LazyVim/LazyVim/commit/e8e7d22f56f2a2dc2ca0c28b02884c0356df2015))
|
||||
* **lang:** Change `rustacean` keymaps to `vim.keymap.set` instead of `which-key` ([#2660](https://github.com/LazyVim/LazyVim/issues/2660)) ([ed135e6](https://github.com/LazyVim/LazyVim/commit/ed135e6ffdd8dc9a43dabe62573688934e7a1bb0))
|
||||
* **neo-tree:** Add description to "Y" in Neo-Tree ([#2642](https://github.com/LazyVim/LazyVim/issues/2642)) ([1a41743](https://github.com/LazyVim/LazyVim/commit/1a417430fc388b9a0b063017188a92d8ad14534f))
|
||||
* **options:** don't lower timeoutlen when in VS Code ([#2568](https://github.com/LazyVim/LazyVim/issues/2568)) ([29ed06e](https://github.com/LazyVim/LazyVim/commit/29ed06e0007d645d7c26b22df1346150b8e28b7f))
|
||||
* **telescope:** anonymous keymap ([#1879](https://github.com/LazyVim/LazyVim/issues/1879)) ([36ae421](https://github.com/LazyVim/LazyVim/commit/36ae4213b89191e040405c5515c24d8021f277d2))
|
||||
* **telescope:** dont use git_files when .ignore or .rgignore file is present ([e7a58d9](https://github.com/LazyVim/LazyVim/commit/e7a58d94847e6f1b282a6a717794cc454fe51faa))
|
||||
* **util.ui.fg:** Add `link=false` to show effective definition ([#2542](https://github.com/LazyVim/LazyVim/issues/2542)) ([5012d7d](https://github.com/LazyVim/LazyVim/commit/5012d7d839beede3d223c361449d0d8cb00fa098))
|
||||
* **util:** clear buffer root cache when cwd change ([#2502](https://github.com/LazyVim/LazyVim/issues/2502)) ([8386d23](https://github.com/LazyVim/LazyVim/commit/8386d23c817a3e3e4ee6302bd8e2902f7e297cf5))
|
||||
* **yanky:** properly disable sqlite.lua on Windows ([#2543](https://github.com/LazyVim/LazyVim/issues/2543)) ([d9f5e6d](https://github.com/LazyVim/LazyVim/commit/d9f5e6db165167c80fe80ede68b0e1815a81cc43))
|
||||
|
||||
## [10.10.0](https://github.com/LazyVim/LazyVim/compare/v10.9.1...v10.10.0) (2024-01-23)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* added `LazyHealth` that loads all plugins and runs `:checkhealth` ([d928739](https://github.com/LazyVim/LazyVim/commit/d9287391b7ca7153320d4654e148c33463eba3a6))
|
||||
* **snippets:** added extra to use native snippets instead of LuaSnip. ([7f92191](https://github.com/LazyVim/LazyVim/commit/7f9219162b54a717b7da5cb543ab1e778c9a124b))
|
||||
* **telescope:** add <leader>fg for finding files using git-files ([#2353](https://github.com/LazyVim/LazyVim/issues/2353)) ([54ae77e](https://github.com/LazyVim/LazyVim/commit/54ae77e164e62ae9f45e864dfd727bfe1809a419))
|
||||
* **toggle:** use `vim.diagnostic.is_disabled` when available ([#2217](https://github.com/LazyVim/LazyVim/issues/2217)) ([93342f1](https://github.com/LazyVim/LazyVim/commit/93342f15badc6e7a3c213e27979b2ff31e0b393e))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **autocmds:** apply conceal level change to local buffer options ([#2409](https://github.com/LazyVim/LazyVim/issues/2409)) ([591f850](https://github.com/LazyVim/LazyVim/commit/591f850f8a30a08066022392fe3b23eb217dbb81))
|
||||
* **autocmds:** avoid checktime when buftype=nofile ([#2270](https://github.com/LazyVim/LazyVim/issues/2270)) ([8e2046f](https://github.com/LazyVim/LazyVim/commit/8e2046f3d02a80558802b6cbcd4c8f7d44f7b6b4))
|
||||
* **hyprlang:** use lazyvim way to install ([#2404](https://github.com/LazyVim/LazyVim/issues/2404)) ([1dffb1d](https://github.com/LazyVim/LazyVim/commit/1dffb1d853df39e2232fd39d3cf47ba3da2e8b6c))
|
||||
* **neo-tree:** better copy file name with `Y` ([eccf3b5](https://github.com/LazyVim/LazyVim/commit/eccf3b5e68035516c879b3e2b4d6bf8512c87976))
|
||||
* **options:** change default conceal level to 2 ([#2053](https://github.com/LazyVim/LazyVim/issues/2053)) ([a43d8cf](https://github.com/LazyVim/LazyVim/commit/a43d8cf35857fae4aaf1ebbd3c280cdf5b5f9d10))
|
||||
* **rust:** avoid resetting cmp group_index to 1 ([#2332](https://github.com/LazyVim/LazyVim/issues/2332)) ([f799b39](https://github.com/LazyVim/LazyVim/commit/f799b39eafedf58cdd7b123870a2c87d96eddb68))
|
||||
* **typescript:** don't hardcode values in lua table ([#2254](https://github.com/LazyVim/LazyVim/issues/2254)) ([cbd9d70](https://github.com/LazyVim/LazyVim/commit/cbd9d700dc964cf8c90759f8482911d03c72edc4))
|
||||
|
||||
## [10.9.1](https://github.com/LazyVim/LazyVim/compare/v10.9.0...v10.9.1) (2024-01-21)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* fixup for [#2137](https://github.com/LazyVim/LazyVim/issues/2137) ([fbe478a](https://github.com/LazyVim/LazyVim/commit/fbe478ae3f84ff842d18ff880af5842a50ee8e50))
|
||||
|
||||
## [10.9.0](https://github.com/LazyVim/LazyVim/compare/v10.8.2...v10.9.0) (2024-01-21)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **autocmds:** dont use conceal for json files ([23fe52a](https://github.com/LazyVim/LazyVim/commit/23fe52acd78c8e8f7c35c3ce4c1bae830adfa357))
|
||||
* **gitsigns:** update gitsigns.nvim preview command ([#2178](https://github.com/LazyVim/LazyVim/issues/2178)) ([f4ddb16](https://github.com/LazyVim/LazyVim/commit/f4ddb16b262e5ba14b417dc53bfd09d5b21f8a73))
|
||||
* **keymaps:** add function to toggle between light/dark backgrounds ([#2088](https://github.com/LazyVim/LazyVim/issues/2088)) ([fa6158a](https://github.com/LazyVim/LazyVim/commit/fa6158a59500c816b652e0fcb4c343270be54b6c))
|
||||
* **lsp:** add diagnostic signs to lsp options ([#2192](https://github.com/LazyVim/LazyVim/issues/2192)) ([33830f1](https://github.com/LazyVim/LazyVim/commit/33830f1e7d2e5a54fec676ce6e43a4a61882aaa9))
|
||||
* **neo-tree:** Adds copy file name command to Neo-Tree with 'Y' binding ([#2137](https://github.com/LazyVim/LazyVim/issues/2137)) ([5296d42](https://github.com/LazyVim/LazyVim/commit/5296d42e6ab4f6df80e801542382a3d774298364))
|
||||
* **test:** Add <leader>tl to neotest.run_last() ([#1968](https://github.com/LazyVim/LazyVim/issues/1968)) ([b71feb7](https://github.com/LazyVim/LazyVim/commit/b71feb7e45420a6e6dcac2f4491b73b70c32e5c7))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **dot:** treesitter for hypr was renamed to hyprlang ([979bb95](https://github.com/LazyVim/LazyVim/commit/979bb952a69d7dafac125da69cb27b70d5403f52))
|
||||
* **eslint:** correct working directories name ([#2071](https://github.com/LazyVim/LazyVim/issues/2071)) ([71a73e8](https://github.com/LazyVim/LazyVim/commit/71a73e8334a3692c549a09169e0f7a33923520f1))
|
||||
|
||||
## [10.8.2](https://github.com/LazyVim/LazyVim/compare/v10.8.1...v10.8.2) (2023-11-30)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **lsp:** fix inlay hints for older nightlies. See [#2007](https://github.com/LazyVim/LazyVim/issues/2007) ([8baf9b5](https://github.com/LazyVim/LazyVim/commit/8baf9b5459a903c783a1d34ad438e64036a8e15e))
|
||||
|
||||
## [10.8.1](https://github.com/LazyVim/LazyVim/compare/v10.8.0...v10.8.1) (2023-11-30)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **lsp:** detect if using nvim-0.10 and use new inlay_hint.enable method ([#2007](https://github.com/LazyVim/LazyVim/issues/2007)) ([6853b78](https://github.com/LazyVim/LazyVim/commit/6853b785d9916be6ffe4965aefd8554ed276f802))
|
||||
* **lsp:** inlay hints on stable. See [#2007](https://github.com/LazyVim/LazyVim/issues/2007) ([e229988](https://github.com/LazyVim/LazyVim/commit/e229988a98a81b000fda3aadbb4fc404aeaa599e))
|
||||
* **ui:** signcolumn signs on nightly. Fixes [#2039](https://github.com/LazyVim/LazyVim/issues/2039) ([11a8a6b](https://github.com/LazyVim/LazyVim/commit/11a8a6bea7a26ca5257fa4cbef90e0abdb22c349))
|
||||
|
||||
## [10.8.0](https://github.com/LazyVim/LazyVim/compare/v10.7.1...v10.8.0) (2023-11-04)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **catppuccin:** enable more integrations ([#1922](https://github.com/LazyVim/LazyVim/issues/1922)) ([4312e5e](https://github.com/LazyVim/LazyVim/commit/4312e5e28348560e018da4535de27dfcc675c32b))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **extras:** dont show extras that give errors (user's extras). Fixes [#1895](https://github.com/LazyVim/LazyVim/issues/1895) ([b32b4fd](https://github.com/LazyVim/LazyVim/commit/b32b4fd581018cf14bf30ae4cd8d94cd43552813))
|
||||
* **mini.indentscope:** remove duplicated filetype ([#1871](https://github.com/LazyVim/LazyVim/issues/1871)) ([09eafc6](https://github.com/LazyVim/LazyVim/commit/09eafc60eff2ba7d7b78c1717d07ce26b762a8a8))
|
||||
* **plugin:** LazyFile now properly deals with deleted buffers. Fixes [#1877](https://github.com/LazyVim/LazyVim/issues/1877) ([4558407](https://github.com/LazyVim/LazyVim/commit/4558407574d0cdbe55720ab349df201bd4d5f5de))
|
||||
* **sessions:** added folds to sessions ([e01ad51](https://github.com/LazyVim/LazyVim/commit/e01ad513aa4f50bdb385a7454c9e1ec3a0d5dc94))
|
||||
* **spectre:** don't build nvim-spectre ([3986169](https://github.com/LazyVim/LazyVim/commit/39861698235c03d30096b3fb315ce38eeaef95e2))
|
||||
|
||||
## [10.7.1](https://github.com/LazyVim/LazyVim/compare/v10.7.0...v10.7.1) (2023-10-25)
|
||||
|
||||
|
||||
|
|
|
|||
88
NEWS.md
88
NEWS.md
|
|
@ -1,7 +1,95 @@
|
|||
# What's new?
|
||||
|
||||
## 11.x
|
||||
|
||||
- **Neovim >= 0.10** now uses the much faster [lazydev.nvim](https://github.com/folke/lazydev.nvim)
|
||||
instead of `neodev.nvim`
|
||||
|
||||
- moved `neoconf.nvim` to extras. Project specific LSP settings
|
||||
can be done with a `.lazy.lua` file instead.
|
||||
|
||||
- `mini.ai` is back as a default plugin! Removing it was a mistake.
|
||||
It's a great plugin that enhances the native text objects.
|
||||
|
||||
- `:LazyExtras` now has multiple new sections:
|
||||
|
||||
- **Enabled**: extras that are currently enabled
|
||||
- **Recommended Languages**: language extras recommended for the current buffer / directory
|
||||
- **Recommended Plugins**: extras that are recommended for most users
|
||||
- **Plugins**: other plugin extras
|
||||
- **Languages**: other language extras
|
||||
|
||||
- new option `vim.g.deprecation_warnings` to disable deprecation warnings
|
||||
Defaults to `false`. To enable deprecation warnings, set it to `true` in your `options.lua`
|
||||
|
||||
- `vim-illuminate` move to extras
|
||||
Document highlights now use native lsp functionality by default
|
||||
|
||||
Since Neovim 0.10 has been released, I've been working on a new version of **LazyVim**
|
||||
that is fully compatible with all the latest Neovim features.
|
||||
|
||||
Additionally, some core plugins have been moved to extras.
|
||||
|
||||
- `native snippets` are now the default on Neovim 0.10
|
||||
Older versions of Neovim will use the new `luasnip` extra.
|
||||
|
||||
- `native comments` are now the default on Neovim 0.10
|
||||
Older versions of Neovim will use the new `mini-comment` extra.
|
||||
`nvim-ts-context-commentstring` has been integrated in the native comments.
|
||||
|
||||
- `inlay hints` have been in **LazyVim** for a while, but are now
|
||||
enabled by default. To disable them:
|
||||
|
||||
```lua
|
||||
{
|
||||
"nvim-lspconfig",
|
||||
opts = {
|
||||
inlay_hints = { enabled = false },
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
- plugins moved to extras:
|
||||
|
||||
- `mini.surround`
|
||||
- `mini.indentscope` scopes are now also highlighted with `indent-blankline`
|
||||
- `nvim-treesitter-context`
|
||||
|
||||
## 10.x
|
||||
|
||||
- added new extra for [mini.diff](https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-diff.md)
|
||||
This is a plugin similar to gitsigns but with a neat diff overlay
|
||||
that can be toggled with `<leader>go`.
|
||||
|
||||
- **trouble.nvim** has been rewritten from scratch and is now in beta.
|
||||
I've added a new extra for it (`trouble-v3`) for those of you who want to try it out.
|
||||
You can find the updated docs [here](https://github.com/folke/trouble.nvim/tree/dev)
|
||||
|
||||
- The **lazygit** integration now configures:
|
||||
|
||||
- the theme based on the colorscheme
|
||||
- nerd font icons (v3)
|
||||
- editor preset is set to `nvim-remote` for better interop with Neovim
|
||||
|
||||
- The option `vim.g.lazygit_theme` was renamed to `vim.g.lazygit_config`
|
||||
|
||||
- **lazygit** now automatically uses the colors of your current colorscheme.
|
||||
This is enabled by default. To disable, add the below to your `options.lua`:
|
||||
|
||||
```lua
|
||||
vim.g.lazygit_config = false
|
||||
```
|
||||
|
||||
- Added support for `basedpyright` to the **python** extra.
|
||||
Enable in your `options.lua` with:
|
||||
|
||||
```lua
|
||||
vim.g.lazyvim_python_lsp = "basedpyright"
|
||||
```
|
||||
|
||||
Be aware that `basedpyright` is still in development and
|
||||
may not work exactly the same as `pyright`.
|
||||
|
||||
- User extras under `lua/plugins/extras` can now also be managed
|
||||
with **LazyExtras**
|
||||
|
||||
|
|
|
|||
|
|
@ -1,138 +1,138 @@
|
|||
<div align="center">
|
||||
<img src="https://user-images.githubusercontent.com/292349/213446185-2db63fd5-8c84-459c-9f04-e286382d6e80.png">
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
|
||||
<h4 align="center">
|
||||
<a href="https://lazyvim.github.io/installation">Install</a>
|
||||
·
|
||||
<a href="https://lazyvim.github.io/configuration">Configure</a>
|
||||
·
|
||||
<a href="https://lazyvim.github.io">Docs</a>
|
||||
</h4>
|
||||
|
||||
<div align="center"><p>
|
||||
<a href="https://github.com/LazyVim/LazyVim/releases/latest">
|
||||
<img alt="Latest release" src="https://img.shields.io/github/v/release/LazyVim/LazyVim?style=for-the-badge&logo=starship&color=C9CBFF&logoColor=D9E0EE&labelColor=302D41&include_prerelease&sort=semver" />
|
||||
</a>
|
||||
<a href="https://github.com/LazyVim/LazyVim/pulse">
|
||||
<img alt="Last commit" src="https://img.shields.io/github/last-commit/LazyVim/LazyVim?style=for-the-badge&logo=starship&color=8bd5ca&logoColor=D9E0EE&labelColor=302D41"/>
|
||||
</a>
|
||||
<a href="https://github.com/LazyVim/LazyVim/blob/main/LICENSE">
|
||||
<img alt="License" src="https://img.shields.io/github/license/LazyVim/LazyVim?style=for-the-badge&logo=starship&color=ee999f&logoColor=D9E0EE&labelColor=302D41" />
|
||||
</a>
|
||||
<a href="https://github.com/LazyVim/LazyVim/stargazers">
|
||||
<img alt="Stars" src="https://img.shields.io/github/stars/LazyVim/LazyVim?style=for-the-badge&logo=starship&color=c69ff5&logoColor=D9E0EE&labelColor=302D41" />
|
||||
</a>
|
||||
<a href="https://github.com/LazyVim/LazyVim/issues">
|
||||
<img alt="Issues" src="https://img.shields.io/github/issues/LazyVim/LazyVim?style=for-the-badge&logo=bilibili&color=F5E0DC&logoColor=D9E0EE&labelColor=302D41" />
|
||||
</a>
|
||||
<a href="https://github.com/LazyVim/LazyVim">
|
||||
<img alt="Repo Size" src="https://img.shields.io/github/repo-size/LazyVim/LazyVim?color=%23DDB6F2&label=SIZE&logo=codesandbox&style=for-the-badge&logoColor=D9E0EE&labelColor=302D41" />
|
||||
</a>
|
||||
<a href="https://twitter.com/intent/follow?screen_name=folke">
|
||||
<img alt="follow on Twitter" src="https://img.shields.io/twitter/follow/folke?style=for-the-badge&logo=twitter&color=8aadf3&logoColor=D9E0EE&labelColor=302D41" />
|
||||
</a>
|
||||
</div>
|
||||
|
||||
LazyVim ist ein Neovim setup aufgebaut auf [💤 lazy.nvim](https://github.com/folke/lazy.nvim).
|
||||
Es erleichter das Anpassen und erweitern von Ihrer Konfiguration.
|
||||
Anstatt von vorne anzufangen oder eine vorgefertigte Distro zu verwenden, gibt LazyVim das beste aus
|
||||
beiden Welten - die Flexibilität Ihre Konfiguration zu verändern und einzustellen wie Sie es wollen
|
||||
und die Einfachheit von einem vorgefertigten Setup.
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
## ✨ Features
|
||||
|
||||
- 🔥 Transformiere dein Neovim in eine komplette IDE
|
||||
- 💤 Passe deine Konfiguration einfach an und erweitere diese mit [lazy.nvim](https://github.com/folke/lazy.nvim)
|
||||
- 🚀 Extrem schnell
|
||||
- 🧹 Logische Voreinstellungen für optionen, autocmds und keymaps
|
||||
- 📦 Kommt mit einem Haufen vor Konfigurierten, ready to use Plugins
|
||||
|
||||
## ⚡️ Vorraussetzungen
|
||||
|
||||
- Neovim >= **0.8.0** (gebraucht um mit **LuaJIT** zu bauen)
|
||||
- Git >= **2.19.0** (um Teil-Klone zu unterstützen)
|
||||
- eine [Nerd Font](https://www.nerdfonts.com/) **_(optional)_**
|
||||
|
||||
## 🚀 Einstieg
|
||||
|
||||
Sie können eine Startvorlage für **LazyVim** [hier](https://github.com/LazyVim/starter) finden
|
||||
|
||||
<details><summary>Versuchen Sie's mit Docker</summary>
|
||||
|
||||
```sh
|
||||
docker run -w /root -it --rm alpine:edge sh -uelic '
|
||||
apk add git lazygit neovim ripgrep alpine-sdk --update
|
||||
git clone https://github.com/LazyVim/starter ~/.config/nvim
|
||||
cd ~/.config/nvim
|
||||
nvim
|
||||
'
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
<details><summary>Installieren von <a href="https://github.com/LazyVim/starter">LazyVim Starter</a></summary>
|
||||
|
||||
- Neovim Files sichern:
|
||||
|
||||
```sh
|
||||
mv ~/.config/nvim ~/.config/nvim.bak
|
||||
mv ~/.local/share/nvim ~/.local/share/nvim.bak
|
||||
```
|
||||
|
||||
- Den Starter Klonen:
|
||||
|
||||
```sh
|
||||
git clone https://github.com/LazyVim/starter ~/.config/nvim
|
||||
```
|
||||
|
||||
- Den `.git` Folder löschen, um die Konfiguration zu einer eigenen distro hinzuzufügen:
|
||||
|
||||
```sh
|
||||
rm -rf ~/.config/nvim/.git
|
||||
```
|
||||
|
||||
- Neovim starten!
|
||||
|
||||
```sh
|
||||
nvim
|
||||
```
|
||||
|
||||
Refer to the comments in the files on how to customize **LazyVim**.
|
||||
|
||||
</details>
|
||||
|
||||
## 📂 File Structure
|
||||
|
||||
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 of default config files that will be loaded
|
||||
**_before_** your own. See [here](https://github.com/LazyVim/LazyVim/tree/main/lua/lazyvim/config)
|
||||
|
||||
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)
|
||||
|
||||
<pre>
|
||||
~/.config/nvim
|
||||
├── lua
|
||||
│ ├── config
|
||||
│ │ ├── autocmds.lua
|
||||
│ │ ├── keymaps.lua
|
||||
│ │ ├── lazy.lua
|
||||
│ │ └── options.lua
|
||||
│ └── plugins
|
||||
│ ├── spec1.lua
|
||||
│ ├── **
|
||||
│ └── spec2.lua
|
||||
└── init.toml
|
||||
</pre>
|
||||
|
||||
## ⚙️ Configuration
|
||||
|
||||
Refer to the [docs](https://lazyvim.github.io)
|
||||
<div align="center">
|
||||
<img src="https://user-images.githubusercontent.com/292349/213446185-2db63fd5-8c84-459c-9f04-e286382d6e80.png">
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
|
||||
<h4 align="center">
|
||||
<a href="https://lazyvim.github.io/installation">Installieren</a>
|
||||
·
|
||||
<a href="https://lazyvim.github.io/configuration">Konfigurieren</a>
|
||||
·
|
||||
<a href="https://lazyvim.github.io">Dokumentation</a>
|
||||
</h4>
|
||||
|
||||
<div align="center"><p>
|
||||
<a href="https://github.com/LazyVim/LazyVim/releases/latest">
|
||||
<img alt="Latest release" src="https://img.shields.io/github/v/release/LazyVim/LazyVim?style=for-the-badge&logo=starship&color=C9CBFF&logoColor=D9E0EE&labelColor=302D41&include_prerelease&sort=semver" />
|
||||
</a>
|
||||
<a href="https://github.com/LazyVim/LazyVim/pulse">
|
||||
<img alt="Last commit" src="https://img.shields.io/github/last-commit/LazyVim/LazyVim?style=for-the-badge&logo=starship&color=8bd5ca&logoColor=D9E0EE&labelColor=302D41"/>
|
||||
</a>
|
||||
<a href="https://github.com/LazyVim/LazyVim/blob/main/LICENSE">
|
||||
<img alt="License" src="https://img.shields.io/github/license/LazyVim/LazyVim?style=for-the-badge&logo=starship&color=ee999f&logoColor=D9E0EE&labelColor=302D41" />
|
||||
</a>
|
||||
<a href="https://github.com/LazyVim/LazyVim/stargazers">
|
||||
<img alt="Stars" src="https://img.shields.io/github/stars/LazyVim/LazyVim?style=for-the-badge&logo=starship&color=c69ff5&logoColor=D9E0EE&labelColor=302D41" />
|
||||
</a>
|
||||
<a href="https://github.com/LazyVim/LazyVim/issues">
|
||||
<img alt="Issues" src="https://img.shields.io/github/issues/LazyVim/LazyVim?style=for-the-badge&logo=bilibili&color=F5E0DC&logoColor=D9E0EE&labelColor=302D41" />
|
||||
</a>
|
||||
<a href="https://github.com/LazyVim/LazyVim">
|
||||
<img alt="Repo Size" src="https://img.shields.io/github/repo-size/LazyVim/LazyVim?color=%23DDB6F2&label=SIZE&logo=codesandbox&style=for-the-badge&logoColor=D9E0EE&labelColor=302D41" />
|
||||
</a>
|
||||
<a href="https://twitter.com/intent/follow?screen_name=folke">
|
||||
<img alt="follow on Twitter" src="https://img.shields.io/twitter/follow/folke?style=for-the-badge&logo=twitter&color=8aadf3&logoColor=D9E0EE&labelColor=302D41" />
|
||||
</a>
|
||||
</div>
|
||||
|
||||
LazyVim ist ein Neovim-Setup aufgebaut auf [💤 lazy.nvim](https://github.com/folke/lazy.nvim).
|
||||
Es erleichtert das Anpassen und Erweitern von Ihrer Konfiguration.
|
||||
Anstatt von vorne anzufangen oder eine vorgefertigte Distro zu verwenden, gibt LazyVim das beste aus
|
||||
beiden Welten - die Flexibilität Ihre Konfiguration zu verändern und einzustellen wie Sie es wollen
|
||||
und die Einfachheit von einem vorgefertigten Setup.
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
## ✨ Features
|
||||
|
||||
- 🔥 Transformiere dein Neovim in eine komplette IDE
|
||||
- 💤 Passe deine Konfiguration einfach an und erweitere diese mit [lazy.nvim](https://github.com/folke/lazy.nvim)
|
||||
- 🚀 Extrem schnell
|
||||
- 🧹 Logische Voreinstellungen für optionen, autocmds und keymaps
|
||||
- 📦 Kommt mit einem Haufen vorkonfigurierter, ready-to-use Plugins
|
||||
|
||||
## ⚡️ Vorraussetzungen
|
||||
|
||||
- Neovim >= **0.8.0** (gebraucht um mit **LuaJIT** zu bauen)
|
||||
- Git >= **2.19.0** (um Teil-Klone zu unterstützen)
|
||||
- eine [Nerd Font](https://www.nerdfonts.com/) **_(optional)_**
|
||||
|
||||
## 🚀 Einstieg
|
||||
|
||||
Sie können eine Startvorlage für **LazyVim** [hier](https://github.com/LazyVim/starter) finden
|
||||
|
||||
<details><summary>Versuchen Sie's mit Docker</summary>
|
||||
|
||||
```sh
|
||||
docker run -w /root -it --rm alpine:edge sh -uelic '
|
||||
apk add git lazygit neovim ripgrep alpine-sdk --update
|
||||
git clone https://github.com/LazyVim/starter ~/.config/nvim
|
||||
cd ~/.config/nvim
|
||||
nvim
|
||||
'
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
<details><summary>Installieren von <a href="https://github.com/LazyVim/starter">LazyVim Starter</a></summary>
|
||||
|
||||
- Neovim Files sichern:
|
||||
|
||||
```sh
|
||||
mv ~/.config/nvim ~/.config/nvim.bak
|
||||
mv ~/.local/share/nvim ~/.local/share/nvim.bak
|
||||
```
|
||||
|
||||
- Den Starter Klonen:
|
||||
|
||||
```sh
|
||||
git clone https://github.com/LazyVim/starter ~/.config/nvim
|
||||
```
|
||||
|
||||
- Den `.git` Folder löschen, um die Konfiguration zu einer eigenen distro hinzuzufügen:
|
||||
|
||||
```sh
|
||||
rm -rf ~/.config/nvim/.git
|
||||
```
|
||||
|
||||
- Neovim starten!
|
||||
|
||||
```sh
|
||||
nvim
|
||||
```
|
||||
|
||||
Refer to the comments in the files on how to customize **LazyVim**.
|
||||
|
||||
</details>
|
||||
|
||||
## 📂 Dateistruktur
|
||||
|
||||
Die Dateien unter `config` werden automatisch und zur richtigen Zeit geladen,
|
||||
sodass ein manuelles `require` nicht nötig ist.
|
||||
**LazyVim** bringt Konfigurationsdatein mit, die **_vor_** Ihren eigenen geladen werden -
|
||||
siehe [hier](https://github.com/LazyVim/LazyVim/tree/main/lua/lazyvim/config)
|
||||
Sie können eigene Plugins unter `lua/plugins/` hinzufügen. Alle Dateien innerhalb
|
||||
dieses Ordners werden automatisch mit [lazy.nvim](https://github.com/folke/lazy.nvim)
|
||||
geladen.
|
||||
|
||||
<pre>
|
||||
~/.config/nvim
|
||||
├── lua
|
||||
│ ├── config
|
||||
│ │ ├── autocmds.lua
|
||||
│ │ ├── keymaps.lua
|
||||
│ │ ├── lazy.lua
|
||||
│ │ └── options.lua
|
||||
│ └── plugins
|
||||
│ ├── spec1.lua
|
||||
│ ├── **
|
||||
│ └── spec2.lua
|
||||
└── init.toml
|
||||
</pre>
|
||||
|
||||
## ⚙️ Konfiguration
|
||||
|
||||
Siehe [Dokumentation](https://lazyvim.github.io).
|
||||
139
README-JP.md
Normal file
139
README-JP.md
Normal file
|
|
@ -0,0 +1,139 @@
|
|||
<div align="center">
|
||||
<img src="https://user-images.githubusercontent.com/292349/213446185-2db63fd5-8c84-459c-9f04-e286382d6e80.png">
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
|
||||
<h4 align="center">
|
||||
<a href="https://lazyvim.github.io/installation">インストール</a>
|
||||
·
|
||||
<a href="https://lazyvim.github.io/configuration">設定</a>
|
||||
·
|
||||
<a href="https://lazyvim.github.io">ドキュメント</a>
|
||||
</h4>
|
||||
|
||||
<div align="center"><p>
|
||||
<a href="https://github.com/LazyVim/LazyVim/releases/latest">
|
||||
<img alt="Latest release" src="https://img.shields.io/github/v/release/LazyVim/LazyVim?style=for-the-badge&logo=starship&color=C9CBFF&logoColor=D9E0EE&labelColor=302D41&include_prerelease&sort=semver" />
|
||||
</a>
|
||||
<a href="https://github.com/LazyVim/LazyVim/pulse">
|
||||
<img alt="Last commit" src="https://img.shields.io/github/last-commit/LazyVim/LazyVim?style=for-the-badge&logo=starship&color=8bd5ca&logoColor=D9E0EE&labelColor=302D41"/>
|
||||
</a>
|
||||
<a href="https://github.com/LazyVim/LazyVim/blob/main/LICENSE">
|
||||
<img alt="License" src="https://img.shields.io/github/license/LazyVim/LazyVim?style=for-the-badge&logo=starship&color=ee999f&logoColor=D9E0EE&labelColor=302D41" />
|
||||
</a>
|
||||
<a href="https://github.com/LazyVim/LazyVim/stargazers">
|
||||
<img alt="Stars" src="https://img.shields.io/github/stars/LazyVim/LazyVim?style=for-the-badge&logo=starship&color=c69ff5&logoColor=D9E0EE&labelColor=302D41" />
|
||||
</a>
|
||||
<a href="https://github.com/LazyVim/LazyVim/issues">
|
||||
<img alt="Issues" src="https://img.shields.io/github/issues/LazyVim/LazyVim?style=for-the-badge&logo=bilibili&color=F5E0DC&logoColor=D9E0EE&labelColor=302D41" />
|
||||
</a>
|
||||
<a href="https://github.com/LazyVim/LazyVim">
|
||||
<img alt="Repo Size" src="https://img.shields.io/github/repo-size/LazyVim/LazyVim?color=%23DDB6F2&label=SIZE&logo=codesandbox&style=for-the-badge&logoColor=D9E0EE&labelColor=302D41" />
|
||||
</a>
|
||||
<a href="https://twitter.com/intent/follow?screen_name=folke">
|
||||
<img alt="follow on Twitter" src="https://img.shields.io/twitter/follow/folke?style=for-the-badge&logo=twitter&color=8aadf3&logoColor=D9E0EE&labelColor=302D41" />
|
||||
</a>
|
||||
</div>
|
||||
|
||||
LazyVimは、設定の拡張と変更を容易にするために[💤 lazy.nvim](https://github.com/folke/lazy.nvim)によって提供されるNeovimセットアップです。
|
||||
LazyVimは、ゼロから始めるか、あらかじめ作成されたディストリビューションを使用するかの選択を迫ることなく、
|
||||
必要に応じて設定を調整する柔軟性と、事前に設定されたセットアップの利便性を両方叶える最高の世界を提供します。
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
## ✨ 機能
|
||||
|
||||
- 🔥 Neovimを本格的なIDEへと変身させます
|
||||
- 💤 [lazy.nvim](https://github.com/folke/lazy.nvim)で簡単にカスタマイズと拡張が可能
|
||||
- 🚀 驚くほどの高速さ
|
||||
- 🧹 Options, autocmds, そしてkeymapsのための合理的なデフォルト設定
|
||||
- 📦 事前に設定がされ、使用可能なプラグインが豊富についてきます
|
||||
|
||||
## ⚡️ 必要要件
|
||||
|
||||
- Neovim >= **0.9.0** (**LuaJIT**でビルドされている必要があります)
|
||||
- Git >= **2.19.0** (部分的なcloneサポートのため)
|
||||
- [Nerd Font](https://www.nerdfonts.com/) **_(任意)_**
|
||||
- `nvim-treesitter`用の**C**コンパイラ。詳細は[こちら](https://github.com/nvim-treesitter/nvim-treesitter#requirements)
|
||||
|
||||
## 🚀 Getting Started
|
||||
|
||||
**lazyvim**のスターターテンプレートは[こちら](https://github.com/lazyvim/starter)。
|
||||
|
||||
<details><summary>Dockerで試す</summary>
|
||||
|
||||
```sh
|
||||
docker run -w /root -it --rm alpine:edge sh -uelic '
|
||||
apk add git lazygit neovim ripgrep alpine-sdk --update
|
||||
git clone https://github.com/LazyVim/starter ~/.config/nvim
|
||||
cd ~/.config/nvim
|
||||
nvim
|
||||
'
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
<details><summary><a href="https://github.com/LazyVim/starter">LazyVim Starter</a>をインストール</summary>
|
||||
|
||||
- 既存のNeovimファイルのバックアップを作成します。
|
||||
|
||||
```sh
|
||||
mv ~/.config/nvim ~/.config/nvim.bak
|
||||
mv ~/.local/share/nvim ~/.local/share/nvim.bak
|
||||
```
|
||||
|
||||
- スターターをcloneします。
|
||||
|
||||
```sh
|
||||
git clone https://github.com/LazyVim/starter ~/.config/nvim
|
||||
```
|
||||
|
||||
- 後ほど自分のリポジトリに加えられるように、`.git`フォルダを削除します。
|
||||
```sh
|
||||
rm -rf ~/.config/nvim/.git
|
||||
```
|
||||
|
||||
- Neovimを起動します!
|
||||
|
||||
```sh
|
||||
nvim
|
||||
```
|
||||
|
||||
**LazyVim**をカスタマイズするために、ファイルのコメントを参照してください。
|
||||
|
||||
</details>
|
||||
|
||||
---
|
||||
|
||||
[@elijahmanor](https://github.com/elijahmanor)氏によって作成された始めるにあたっての概要動画があります。
|
||||
|
||||
[](https://www.youtube.com/watch?v=N93cTbtLCIM)
|
||||
|
||||
## 📂 ファイル構造
|
||||
|
||||
config配下にあるファイルは適切なタイミングで自動的にロードされる為、
|
||||
手動でそれらのファイルをrequireする必要はありません。
|
||||
LazyVimには、自分で設定したものより先にロードされるデフォルトの設定ファイルが付属しています。詳しくは[こちら](https://github.com/LazyVim/LazyVim/tree/main/lua/lazyvim/config)。
|
||||
カスタムプラグインをlua/plugins/の下に追加することができます。lua/plugins/配下の全てのファイルは[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>
|
||||
|
||||
## ⚙️ 設定
|
||||
|
||||
こちらの[ドキュメント](https://lazyvim.github.io)を参照してください。
|
||||
139
README-KO.md
Normal file
139
README-KO.md
Normal file
|
|
@ -0,0 +1,139 @@
|
|||
<div align="center">
|
||||
<img src="https://user-images.githubusercontent.com/292349/213446185-2db63fd5-8c84-459c-9f04-e286382d6e80.png">
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
|
||||
<h4 align="center">
|
||||
<a href="https://lazyvim.github.io/installation">설치하기</a>
|
||||
·
|
||||
<a href="https://lazyvim.github.io/configuration">설정하기</a>
|
||||
·
|
||||
<a href="https://lazyvim.github.io">문서</a>
|
||||
</h4>
|
||||
|
||||
<div align="center"><p>
|
||||
<a href="https://github.com/LazyVim/LazyVim/releases/latest">
|
||||
<img alt="최신 업데이트" 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="마지막 커밋" 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="라이센스" 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="스타" 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="이슈" 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="레파지토리 크기" 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="트위터" src="https://img.shields.io/twitter/follow/folke?style=for-the-badge&logo=twitter&color=8aadf3&logoColor=D9E0EE&labelColor=302D41" />
|
||||
</a>
|
||||
</div>
|
||||
|
||||
LazyVim은 [💤 lazy.nvim](https://github.com/folke/lazy.nvim)를 기반으로 작동하는 Neovim 셋업입니다. 더 커스터마이징 가능하고, 설정들을 바꾸는 것을 쉽게 만들기위해 시작되었죠. 그저 처음부터 모든 설정들을 만지고 시작하는 방법, 또는 이미 만들어진 배포용 설정을 사용하는 방법이 있지만, LazyVIM은 이미 잘 설정된 환경과, 필요에 따라 쉽게 바꿀 수 있는 유연성을 모두 포괄합니다. 이를 통해 훨신 쉽고 편리한, 전에는 만나보실 수 없었던 새로운 Nvim의 세계를 경험하실 수 있으실 겁니다.
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
## ✨ 기능
|
||||
|
||||
- 🔥 Neovim을 완벽한 IDE로 바꾸어보세요.
|
||||
- 💤 lazy.vim과 함께 쉽게 커스터마이징하고, 확장하세요.
|
||||
- 🚀 완전히 빠른 속도를 경험해보세요.
|
||||
- 🧹 기본적으로 만져져있는 옵션, 자동커멘드, 그리고 단축키들을 아무런 추가적인 설정없이 사용해보세요.
|
||||
- 📦 안정적이고 미리 설정되어져있는 플러그인들과 함게 코딩하세요.
|
||||
|
||||
## ⚡️ 요구사항
|
||||
|
||||
- **0.9.0**이상의 Neovim (LuaJIT과 함께 개발이 되어져있어야함니다.)
|
||||
- **2.19.0**이상의 Git (이것은 부분적인 클론기능을 지원하기 위함입니다.)
|
||||
- [Nerd Font](https://www.nerdfonts.com/) **_(옵션)_**
|
||||
- `nvim-treesitter`를 위한 **C** 컴파일러. [이 문서](https://github.com/nvim-treesitter/nvim-treesitter#requirements)를 확인해주시기바랍니다.
|
||||
|
||||
## 🚀 시작하기
|
||||
|
||||
[이 깃헙 레파지토리](https://github.com/LazyVim/starter)에서 스타터 템플릿을 찾으실 수 있습니다.
|
||||
|
||||
<details><summary>도커와 함께 시작해보기</summary>
|
||||
|
||||
```sh
|
||||
docker run -w /root -it --rm alpine:edge sh -uelic '
|
||||
apk add git lazygit neovim ripgrep alpine-sdk --update
|
||||
git clone https://github.com/LazyVim/starter ~/.config/nvim
|
||||
cd ~/.config/nvim
|
||||
nvim
|
||||
'
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
<details><summary><a href="https://github.com/LazyVim/starter">LazyVim 스타터</a>와 함께 시작해보기</summary>
|
||||
|
||||
- 현재 Neovim 파일들을 미리 백업:
|
||||
|
||||
```sh
|
||||
mv ~/.config/nvim ~/.config/nvim.bak
|
||||
mv ~/.local/share/nvim ~/.local/share/nvim.bak
|
||||
```
|
||||
|
||||
- Lazyvim 스타터 깃헙 레파지토리 복제:
|
||||
|
||||
```sh
|
||||
git clone https://github.com/LazyVim/starter ~/.config/nvim
|
||||
```
|
||||
|
||||
- 나중에 본인의 레파지토리에 저장할 경우를 대비해 .git 폴더 지우기
|
||||
|
||||
```sh
|
||||
rm -rf ~/.config/nvim/.git
|
||||
```
|
||||
|
||||
- Neovim!
|
||||
|
||||
```sh
|
||||
nvim
|
||||
```
|
||||
|
||||
LazyVim를 커스터마이징 하는 법에 대해 다룬 설명을 참조해주시기 바랍니다.
|
||||
|
||||
</details>
|
||||
|
||||
---
|
||||
|
||||
유튜브에 LazyVim시작하기에 대해 [@elijahmanor](https://github.com/elijahmanor)에 의해 만들어진 영상이 있으니, 시청해 보시는 것을 추천드립니다.
|
||||
|
||||
[](https://www.youtube.com/watch?v=N93cTbtLCIM)
|
||||
|
||||
## 📂 파일 구조
|
||||
|
||||
config 폴더 안에 있는 모든 파일들은 적절한 시간내에 자동으로 로드가 되기에, 아무 파일도 require를 하지 않아도 됩니다. **LazyVim**은 config폴더 안에 있는 모든 기본 파일들을 당신의 config 파일들 **전**에 불어옵니다. 이것에 대해서는, [이 문서](https://github.com/LazyVim/LazyVim/tree/main/lua/lazyvim/config)를 확인해 보시기 바랍니다.
|
||||
|
||||
추가적인 플러그인을 설치하시거나, 미리 설치되고 설정된 플러그인들을 또 덮어서 설정을 바꾸거나, 지우거나, 추가하고 싶으실 경우에는, 그에 해당하는 lua 파일들을 `lua/plugins` 폴더 안에 추가하시면, lazy.nvim이 자동적으로 그 파일들을 로드 할 것입니다.
|
||||
|
||||
<pre>
|
||||
~/.config/nvim
|
||||
├── lua
|
||||
│ ├── config
|
||||
│ │ ├── autocmds.lua
|
||||
│ │ ├── keymaps.lua
|
||||
│ │ ├── lazy.lua
|
||||
│ │ └── options.lua
|
||||
│ └── plugins
|
||||
│ ├── spec1.lua
|
||||
│ ├── **
|
||||
│ └── spec2.lua
|
||||
└── init.lua
|
||||
</pre>
|
||||
|
||||
## ⚙️ 설정
|
||||
|
||||
[Lazyvim 공식문서](https://lazyvim.github.io)를 확인해 주시기 바랍니다.
|
||||
|
||||
LazyVim 공식문서의 한국어 지원은 현재 번역 중에 있습니다.
|
||||
146
README-PT.md
Normal file
146
README-PT.md
Normal file
|
|
@ -0,0 +1,146 @@
|
|||
<div align="center">
|
||||
<img src="https://user-images.githubusercontent.com/292349/213446185-2db63fd5-8c84-459c-9f04-e286382d6e80.png">
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
|
||||
<h4 align="center">
|
||||
<a href="https://lazyvim.github.io/installation">Instalar</a>
|
||||
·
|
||||
<a href="https://lazyvim.github.io/configuration">Configurar</a>
|
||||
·
|
||||
<a href="https://lazyvim.github.io">Documentação</a>
|
||||
</h4>
|
||||
|
||||
<div align="center"><p>
|
||||
<a href="https://github.com/LazyVim/LazyVim/releases/latest">
|
||||
<img alt="Latest release" src="https://img.shields.io/github/v/release/LazyVim/LazyVim?style=for-the-badge&logo=starship&color=C9CBFF&logoColor=D9E0EE&labelColor=302D41&include_prerelease&sort=semver" />
|
||||
</a>
|
||||
<a href="https://github.com/LazyVim/LazyVim/pulse">
|
||||
<img alt="Last commit" src="https://img.shields.io/github/last-commit/LazyVim/LazyVim?style=for-the-badge&logo=starship&color=8bd5ca&logoColor=D9E0EE&labelColor=302D41"/>
|
||||
</a>
|
||||
<a href="https://github.com/LazyVim/LazyVim/blob/main/LICENSE">
|
||||
<img alt="License" src="https://img.shields.io/github/license/LazyVim/LazyVim?style=for-the-badge&logo=starship&color=ee999f&logoColor=D9E0EE&labelColor=302D41" />
|
||||
</a>
|
||||
<a href="https://github.com/LazyVim/LazyVim/stargazers">
|
||||
<img alt="Stars" src="https://img.shields.io/github/stars/LazyVim/LazyVim?style=for-the-badge&logo=starship&color=c69ff5&logoColor=D9E0EE&labelColor=302D41" />
|
||||
</a>
|
||||
<a href="https://github.com/LazyVim/LazyVim/issues">
|
||||
<img alt="Issues" src="https://img.shields.io/github/issues/LazyVim/LazyVim?style=for-the-badge&logo=bilibili&color=F5E0DC&logoColor=D9E0EE&labelColor=302D41" />
|
||||
</a>
|
||||
<a href="https://github.com/LazyVim/LazyVim">
|
||||
<img alt="Repo Size" src="https://img.shields.io/github/repo-size/LazyVim/LazyVim?color=%23DDB6F2&label=SIZE&logo=codesandbox&style=for-the-badge&logoColor=D9E0EE&labelColor=302D41" />
|
||||
</a>
|
||||
<a href="https://twitter.com/intent/follow?screen_name=folke">
|
||||
<img alt="follow on Twitter" src="https://img.shields.io/twitter/follow/folke?style=for-the-badge&logo=twitter&color=8aadf3&logoColor=D9E0EE&labelColor=302D41" />
|
||||
</a>
|
||||
</div>
|
||||
|
||||
LazyVim é uma configuração de Neovim potenciada por [💤 lazy.nvim](https://github.com/folke/lazy.nvim)
|
||||
para tornar fácil customizar e extender a tua configuração.
|
||||
Em vez de ter de escolher entre começar de raiz ou usar
|
||||
uma distribuição pré-feita, LazyVim oferece o melhor
|
||||
dos dois mundos - a flexibilidade de alterar a tua configuração
|
||||
como necessário, junto com a conveniência de um setup pré-configurado.
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
## ✨ Características
|
||||
|
||||
- 🔥 Transforma o teu Neovim num IDE completo.
|
||||
- 💤 Customiza e extende a tua configuração facilmente com [lazy.nvim](https://github.com/folke/lazy.nvim)
|
||||
- 🚀 Super rápido
|
||||
- 🧹 Definições comuns para options, autocms e keymaps
|
||||
- 📦 Contém uma variedade de plugins pré-configurados e preparados a usar
|
||||
|
||||
## ⚡️ Requesitos
|
||||
|
||||
- Neovim >= **0.9.0** (preciso fazer build com **LuaJIT**)
|
||||
- Git >= **2.19.0** (para suporte parcial de clones)
|
||||
- uma [Nerd Font](https://www.nerdfonts.com/) **_(opcional)_**
|
||||
- um compilador de **C** para `nvim-treesitter`. Mais informações [aqui](https://github.com/nvim-treesitter/nvim-treesitter#requirements)
|
||||
|
||||
## 🚀 Como Começar
|
||||
|
||||
Podes encontrar uma template **LazyVim** starter para começar, [aqui](https://github.com/LazyVim/starter)
|
||||
|
||||
<details><summary>Experimenta com docker</summary>
|
||||
|
||||
```sh
|
||||
docker run -w /root -it --rm alpine:edge sh -uelic '
|
||||
apk add git lazygit neovim ripgrep alpine-sdk --update
|
||||
git clone https://github.com/LazyVim/starter ~/.config/nvim
|
||||
cd ~/.config/nvim
|
||||
nvim
|
||||
'
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
<details><summary>Instala a template <a href="https://github.com/LazyVim/starter">LazyVim Starter</a></summary>
|
||||
|
||||
- Faz um backup da tua configuração atual de Neovim:
|
||||
|
||||
```sh
|
||||
mv ~/.config/nvim ~/.config/nvim.bak
|
||||
mv ~/.local/share/nvim ~/.local/share/nvim.bak
|
||||
```
|
||||
|
||||
- Clona a template
|
||||
|
||||
```sh
|
||||
git clone https://github.com/LazyVim/starter ~/.config/nvim
|
||||
```
|
||||
|
||||
- Remove o diretório `.git`, para poderes adicionar ao teu próprio repositório mais tarde
|
||||
|
||||
```sh
|
||||
rm -rf ~/.config/nvim/.git
|
||||
```
|
||||
|
||||
- Inicia o Neovim!
|
||||
|
||||
```sh
|
||||
nvim
|
||||
```
|
||||
|
||||
Consulta os comentários nos ficheiros sobre como customizar **LazyVim**.
|
||||
|
||||
</details>
|
||||
|
||||
---
|
||||
|
||||
Existe um excelente video criado por [@elijahmanor](https://github.com/elijahmanor) com um passo a passo para começar.
|
||||
|
||||
[](https://www.youtube.com/watch?v=N93cTbtLCIM)
|
||||
|
||||
## 📂 Extrutura de ficheiros
|
||||
|
||||
Os ficheiros no diretório **config** serão carregados automaticamente
|
||||
no momento apropriado, por isso não é necessário carregar os plugins manualmente.
|
||||
**LazyVim** vem com um conjunto de ficheiros
|
||||
que serão carregados **_antes_** dos teus. Lẽ mais [aqui](https://github.com/LazyVim/LazyVim/tree/main/lua/lazyvim/config)
|
||||
|
||||
Tu podes acrescentar a tua configuração em `lua/plugins`. Todos os ficheiros
|
||||
neste diretório serão carregados automaticamente por [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>
|
||||
|
||||
## ⚙️ Configuração
|
||||
|
||||
Consulta a [documentação](https://lazyvim.github.io)
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2023 October 28
|
||||
*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 June 05
|
||||
|
||||
==============================================================================
|
||||
Table of Contents *LazyVim-table-of-contents*
|
||||
|
|
@ -8,6 +8,7 @@ Table of Contents *LazyVim-table-of-contents*
|
|||
- Getting Started |LazyVim-getting-started|
|
||||
- File Structure |LazyVim-file-structure|
|
||||
- Configuration |LazyVim-configuration|
|
||||
1. Links |LazyVim-links|
|
||||
|
||||
Install
|
||||
·
|
||||
|
|
|
|||
|
|
@ -7,7 +7,11 @@ end
|
|||
-- Check if we need to reload the file when it changed
|
||||
vim.api.nvim_create_autocmd({ "FocusGained", "TermClose", "TermLeave" }, {
|
||||
group = augroup("checktime"),
|
||||
command = "checktime",
|
||||
callback = function()
|
||||
if vim.o.buftype ~= "nofile" then
|
||||
vim.cmd("checktime")
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
-- Highlight on yank
|
||||
|
|
@ -53,10 +57,8 @@ vim.api.nvim_create_autocmd("FileType", {
|
|||
"PlenaryTestPopup",
|
||||
"help",
|
||||
"lspinfo",
|
||||
"man",
|
||||
"notify",
|
||||
"qf",
|
||||
"query",
|
||||
"spectre_panel",
|
||||
"startuptime",
|
||||
"tsplayground",
|
||||
|
|
@ -71,6 +73,15 @@ vim.api.nvim_create_autocmd("FileType", {
|
|||
end,
|
||||
})
|
||||
|
||||
-- make it easier to close man-files when opened inline
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
group = augroup("man_unlisted"),
|
||||
pattern = { "man" },
|
||||
callback = function(event)
|
||||
vim.bo[event.buf].buflisted = false
|
||||
end,
|
||||
})
|
||||
|
||||
-- wrap and check for spell in text filetypes
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
group = augroup("wrap_spell"),
|
||||
|
|
@ -81,14 +92,23 @@ vim.api.nvim_create_autocmd("FileType", {
|
|||
end,
|
||||
})
|
||||
|
||||
-- Fix conceallevel for json files
|
||||
vim.api.nvim_create_autocmd({ "FileType" }, {
|
||||
group = augroup("json_conceal"),
|
||||
pattern = { "json", "jsonc", "json5" },
|
||||
callback = function()
|
||||
vim.opt_local.conceallevel = 0
|
||||
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
|
||||
if event.match:match("^%w%w+:[\\/][\\/]") then
|
||||
return
|
||||
end
|
||||
local file = vim.loop.fs_realpath(event.match) or event.match
|
||||
local file = vim.uv.fs_realpath(event.match) or event.match
|
||||
vim.fn.mkdir(vim.fn.fnamemodify(file, ":p:h"), "p")
|
||||
end,
|
||||
})
|
||||
|
|
|
|||
|
|
@ -1,9 +1,10 @@
|
|||
local Util = require("lazyvim.util")
|
||||
_G.LazyVim = require("lazyvim.util")
|
||||
|
||||
---@class LazyVimConfig: LazyVimOptions
|
||||
local M = {}
|
||||
|
||||
M.version = "10.7.1" -- x-release-please-version
|
||||
M.version = "10.21.1" -- x-release-please-version
|
||||
LazyVim.config = M
|
||||
|
||||
---@class LazyVimOptions
|
||||
local defaults = {
|
||||
|
|
@ -131,7 +132,7 @@ local defaults = {
|
|||
}
|
||||
|
||||
M.json = {
|
||||
version = 2,
|
||||
version = 6,
|
||||
data = {
|
||||
version = nil, ---@type string?
|
||||
news = {}, ---@type table<string, string>
|
||||
|
|
@ -149,7 +150,7 @@ function M.json.load()
|
|||
if ok then
|
||||
M.json.data = vim.tbl_deep_extend("force", M.json.data, json or {})
|
||||
if M.json.data.version ~= M.json.version then
|
||||
Util.json.migrate()
|
||||
LazyVim.json.migrate()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
@ -178,18 +179,30 @@ function M.setup(opts)
|
|||
end
|
||||
M.load("keymaps")
|
||||
|
||||
Util.format.setup()
|
||||
Util.news.setup()
|
||||
Util.root.setup()
|
||||
LazyVim.format.setup()
|
||||
LazyVim.news.setup()
|
||||
LazyVim.root.setup()
|
||||
|
||||
vim.api.nvim_create_user_command("LazyExtras", function()
|
||||
Util.extras.show()
|
||||
LazyVim.extras.show()
|
||||
end, { desc = "Manage LazyVim extras" })
|
||||
|
||||
vim.api.nvim_create_user_command("LazyHealth", function()
|
||||
vim.cmd([[Lazy! load all]])
|
||||
vim.cmd([[checkhealth]])
|
||||
end, { desc = "Load all plugins and run :checkhealth" })
|
||||
|
||||
local health = require("lazy.health")
|
||||
vim.list_extend(health.valid, {
|
||||
"recommended",
|
||||
"desc",
|
||||
"vscode",
|
||||
})
|
||||
end,
|
||||
})
|
||||
|
||||
Util.track("colorscheme")
|
||||
Util.try(function()
|
||||
LazyVim.track("colorscheme")
|
||||
LazyVim.try(function()
|
||||
if type(M.colorscheme) == "function" then
|
||||
M.colorscheme()
|
||||
else
|
||||
|
|
@ -198,11 +211,11 @@ function M.setup(opts)
|
|||
end, {
|
||||
msg = "Could not load your colorscheme",
|
||||
on_error = function(msg)
|
||||
Util.error(msg)
|
||||
LazyVim.error(msg)
|
||||
vim.cmd.colorscheme("habamax")
|
||||
end,
|
||||
})
|
||||
Util.track()
|
||||
LazyVim.track()
|
||||
end
|
||||
|
||||
---@param buf? number
|
||||
|
|
@ -216,6 +229,9 @@ function M.get_kind_filter(buf)
|
|||
if M.kind_filter[ft] == false then
|
||||
return
|
||||
end
|
||||
if type(M.kind_filter[ft]) == "table" then
|
||||
return M.kind_filter[ft]
|
||||
end
|
||||
---@diagnostic disable-next-line: return-type-mismatch
|
||||
return type(M.kind_filter) == "table" and type(M.kind_filter.default) == "table" and M.kind_filter.default or nil
|
||||
end
|
||||
|
|
@ -224,7 +240,7 @@ end
|
|||
function M.load(name)
|
||||
local function _load(mod)
|
||||
if require("lazy.core.cache").find(mod)[1] then
|
||||
Util.try(function()
|
||||
LazyVim.try(function()
|
||||
require(mod)
|
||||
end, { msg = "Failed loading " .. mod })
|
||||
end
|
||||
|
|
@ -254,19 +270,23 @@ function M.init()
|
|||
end
|
||||
|
||||
package.preload["lazyvim.plugins.lsp.format"] = function()
|
||||
Util.deprecate([[require("lazyvim.plugins.lsp.format")]], [[require("lazyvim.util").format]])
|
||||
return Util.format
|
||||
LazyVim.deprecate([[require("lazyvim.plugins.lsp.format")]], [[LazyVim.format]])
|
||||
return LazyVim.format
|
||||
end
|
||||
|
||||
-- delay notifications till vim.notify was replaced or after 500ms
|
||||
require("lazyvim.util").lazy_notify()
|
||||
LazyVim.lazy_notify()
|
||||
|
||||
-- load options here, before lazy init while sourcing plugin modules
|
||||
-- this is needed to make sure options will be correctly applied
|
||||
-- after installing missing plugins
|
||||
M.load("options")
|
||||
|
||||
Util.plugin.setup()
|
||||
if vim.g.deprecation_warnings == false then
|
||||
vim.deprecate = function() end
|
||||
end
|
||||
|
||||
LazyVim.plugin.setup()
|
||||
M.json.load()
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -1,46 +1,47 @@
|
|||
-- This file is automatically loaded by lazyvim.config.init
|
||||
local Util = require("lazyvim.util")
|
||||
|
||||
-- DO NOT USE THIS IN YOU OWN CONFIG!!
|
||||
-- DO NOT USE `LazyVim.safe_keymap_set` IN YOUR OWN CONFIG!!
|
||||
-- use `vim.keymap.set` instead
|
||||
local map = Util.safe_keymap_set
|
||||
local map = LazyVim.safe_keymap_set
|
||||
|
||||
-- better up/down
|
||||
map({ "n", "x" }, "j", "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true })
|
||||
map({ "n", "x" }, "<Down>", "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true })
|
||||
map({ "n", "x" }, "k", "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true })
|
||||
map({ "n", "x" }, "<Up>", "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true })
|
||||
map({ "n", "x" }, "j", "v:count == 0 ? 'gj' : 'j'", { desc = "Down", expr = true, silent = true })
|
||||
map({ "n", "x" }, "<Down>", "v:count == 0 ? 'gj' : 'j'", { desc = "Down", expr = true, silent = true })
|
||||
map({ "n", "x" }, "k", "v:count == 0 ? 'gk' : 'k'", { desc = "Up", expr = true, silent = true })
|
||||
map({ "n", "x" }, "<Up>", "v:count == 0 ? 'gk' : 'k'", { desc = "Up", expr = true, silent = true })
|
||||
|
||||
-- Move to window using the <ctrl> hjkl keys
|
||||
map("n", "<C-h>", "<C-w>h", { desc = "Go to left window", remap = true })
|
||||
map("n", "<C-j>", "<C-w>j", { desc = "Go to lower window", remap = true })
|
||||
map("n", "<C-k>", "<C-w>k", { desc = "Go to upper window", remap = true })
|
||||
map("n", "<C-l>", "<C-w>l", { desc = "Go to right window", remap = true })
|
||||
map("n", "<C-h>", "<C-w>h", { desc = "Go to Left Window", remap = true })
|
||||
map("n", "<C-j>", "<C-w>j", { desc = "Go to Lower Window", remap = true })
|
||||
map("n", "<C-k>", "<C-w>k", { desc = "Go to Upper Window", remap = true })
|
||||
map("n", "<C-l>", "<C-w>l", { desc = "Go to Right Window", remap = true })
|
||||
|
||||
-- Resize window using <ctrl> arrow keys
|
||||
map("n", "<C-Up>", "<cmd>resize +2<cr>", { desc = "Increase window height" })
|
||||
map("n", "<C-Down>", "<cmd>resize -2<cr>", { desc = "Decrease window height" })
|
||||
map("n", "<C-Left>", "<cmd>vertical resize -2<cr>", { desc = "Decrease window width" })
|
||||
map("n", "<C-Right>", "<cmd>vertical resize +2<cr>", { desc = "Increase window width" })
|
||||
map("n", "<C-Up>", "<cmd>resize +2<cr>", { desc = "Increase Window Height" })
|
||||
map("n", "<C-Down>", "<cmd>resize -2<cr>", { desc = "Decrease Window Height" })
|
||||
map("n", "<C-Left>", "<cmd>vertical resize -2<cr>", { desc = "Decrease Window Width" })
|
||||
map("n", "<C-Right>", "<cmd>vertical resize +2<cr>", { desc = "Increase Window Width" })
|
||||
|
||||
-- Move Lines
|
||||
map("n", "<A-j>", "<cmd>m .+1<cr>==", { desc = "Move down" })
|
||||
map("n", "<A-k>", "<cmd>m .-2<cr>==", { desc = "Move up" })
|
||||
map("i", "<A-j>", "<esc><cmd>m .+1<cr>==gi", { desc = "Move down" })
|
||||
map("i", "<A-k>", "<esc><cmd>m .-2<cr>==gi", { desc = "Move up" })
|
||||
map("v", "<A-j>", ":m '>+1<cr>gv=gv", { desc = "Move down" })
|
||||
map("v", "<A-k>", ":m '<-2<cr>gv=gv", { desc = "Move up" })
|
||||
map("n", "<A-j>", "<cmd>m .+1<cr>==", { desc = "Move Down" })
|
||||
map("n", "<A-k>", "<cmd>m .-2<cr>==", { desc = "Move Up" })
|
||||
map("i", "<A-j>", "<esc><cmd>m .+1<cr>==gi", { desc = "Move Down" })
|
||||
map("i", "<A-k>", "<esc><cmd>m .-2<cr>==gi", { desc = "Move Up" })
|
||||
map("v", "<A-j>", ":m '>+1<cr>gv=gv", { desc = "Move Down" })
|
||||
map("v", "<A-k>", ":m '<-2<cr>gv=gv", { desc = "Move Up" })
|
||||
|
||||
-- buffers
|
||||
map("n", "<S-h>", "<cmd>bprevious<cr>", { desc = "Prev buffer" })
|
||||
map("n", "<S-l>", "<cmd>bnext<cr>", { desc = "Next buffer" })
|
||||
map("n", "[b", "<cmd>bprevious<cr>", { desc = "Prev buffer" })
|
||||
map("n", "]b", "<cmd>bnext<cr>", { desc = "Next buffer" })
|
||||
map("n", "<S-h>", "<cmd>bprevious<cr>", { desc = "Prev Buffer" })
|
||||
map("n", "<S-l>", "<cmd>bnext<cr>", { desc = "Next Buffer" })
|
||||
map("n", "[b", "<cmd>bprevious<cr>", { desc = "Prev Buffer" })
|
||||
map("n", "]b", "<cmd>bnext<cr>", { desc = "Next Buffer" })
|
||||
map("n", "<leader>bb", "<cmd>e #<cr>", { desc = "Switch to Other Buffer" })
|
||||
map("n", "<leader>`", "<cmd>e #<cr>", { desc = "Switch to Other Buffer" })
|
||||
map("n", "<leader>bd", LazyVim.ui.bufremove, { desc = "Delete Buffer" })
|
||||
map("n", "<leader>bD", "<cmd>:bd<cr>", { desc = "Delete Buffer and Window" })
|
||||
|
||||
-- Clear search with <esc>
|
||||
map({ "i", "n" }, "<esc>", "<cmd>noh<cr><esc>", { desc = "Escape and clear hlsearch" })
|
||||
map({ "i", "n" }, "<esc>", "<cmd>noh<cr><esc>", { desc = "Escape and Clear hlsearch" })
|
||||
|
||||
-- Clear search, diff update and redraw
|
||||
-- taken from runtime/lua/_editor.lua
|
||||
|
|
@ -48,16 +49,16 @@ map(
|
|||
"n",
|
||||
"<leader>ur",
|
||||
"<Cmd>nohlsearch<Bar>diffupdate<Bar>normal! <C-L><CR>",
|
||||
{ desc = "Redraw / clear hlsearch / diff update" }
|
||||
{ desc = "Redraw / Clear hlsearch / Diff Update" }
|
||||
)
|
||||
|
||||
-- https://github.com/mhinz/vim-galore#saner-behavior-of-n-and-n
|
||||
map("n", "n", "'Nn'[v:searchforward].'zv'", { expr = true, desc = "Next search result" })
|
||||
map("x", "n", "'Nn'[v:searchforward]", { expr = true, desc = "Next search result" })
|
||||
map("o", "n", "'Nn'[v:searchforward]", { expr = true, desc = "Next search result" })
|
||||
map("n", "N", "'nN'[v:searchforward].'zv'", { expr = true, desc = "Prev search result" })
|
||||
map("x", "N", "'nN'[v:searchforward]", { expr = true, desc = "Prev search result" })
|
||||
map("o", "N", "'nN'[v:searchforward]", { expr = true, desc = "Prev search result" })
|
||||
map("n", "n", "'Nn'[v:searchforward].'zv'", { expr = true, desc = "Next Search Result" })
|
||||
map("x", "n", "'Nn'[v:searchforward]", { expr = true, desc = "Next Search Result" })
|
||||
map("o", "n", "'Nn'[v:searchforward]", { expr = true, desc = "Next Search Result" })
|
||||
map("n", "N", "'nN'[v:searchforward].'zv'", { expr = true, desc = "Prev Search Result" })
|
||||
map("x", "N", "'nN'[v:searchforward]", { expr = true, desc = "Prev Search Result" })
|
||||
map("o", "N", "'nN'[v:searchforward]", { expr = true, desc = "Prev Search Result" })
|
||||
|
||||
-- Add undo break-points
|
||||
map("i", ",", ",<c-g>u")
|
||||
|
|
@ -65,7 +66,7 @@ map("i", ".", ".<c-g>u")
|
|||
map("i", ";", ";<c-g>u")
|
||||
|
||||
-- save file
|
||||
map({ "i", "x", "n", "s" }, "<C-s>", "<cmd>w<cr><esc>", { desc = "Save file" })
|
||||
map({ "i", "x", "n", "s" }, "<C-s>", "<cmd>w<cr><esc>", { desc = "Save File" })
|
||||
|
||||
--keywordprg
|
||||
map("n", "<leader>K", "<cmd>norm! K<cr>", { desc = "Keywordprg" })
|
||||
|
|
@ -74,6 +75,10 @@ map("n", "<leader>K", "<cmd>norm! K<cr>", { desc = "Keywordprg" })
|
|||
map("v", "<", "<gv")
|
||||
map("v", ">", ">gv")
|
||||
|
||||
-- commenting
|
||||
map("n", "gco", "o<esc>Vcx<esc><cmd>normal gcc<cr>fxa<bs>", { desc = "Add Comment Below" })
|
||||
map("n", "gcO", "O<esc>Vcx<esc><cmd>normal gcc<cr>fxa<bs>", { desc = "Add Comment Above" })
|
||||
|
||||
-- lazy
|
||||
map("n", "<leader>l", "<cmd>Lazy<cr>", { desc = "Lazy" })
|
||||
|
||||
|
|
@ -83,12 +88,12 @@ map("n", "<leader>fn", "<cmd>enew<cr>", { desc = "New File" })
|
|||
map("n", "<leader>xl", "<cmd>lopen<cr>", { desc = "Location List" })
|
||||
map("n", "<leader>xq", "<cmd>copen<cr>", { desc = "Quickfix List" })
|
||||
|
||||
map("n", "[q", vim.cmd.cprev, { desc = "Previous quickfix" })
|
||||
map("n", "]q", vim.cmd.cnext, { desc = "Next quickfix" })
|
||||
map("n", "[q", vim.cmd.cprev, { desc = "Previous Quickfix" })
|
||||
map("n", "]q", vim.cmd.cnext, { desc = "Next Quickfix" })
|
||||
|
||||
-- formatting
|
||||
map({ "n", "v" }, "<leader>cf", function()
|
||||
Util.format({ force = true })
|
||||
LazyVim.format({ force = true })
|
||||
end, { desc = "Format" })
|
||||
|
||||
-- diagnostic
|
||||
|
|
@ -110,59 +115,77 @@ map("n", "[w", diagnostic_goto(false, "WARN"), { desc = "Prev Warning" })
|
|||
-- stylua: ignore start
|
||||
|
||||
-- toggle options
|
||||
map("n", "<leader>uf", function() Util.format.toggle() end, { desc = "Toggle auto format (global)" })
|
||||
map("n", "<leader>uF", function() Util.format.toggle(true) end, { desc = "Toggle auto format (buffer)" })
|
||||
map("n", "<leader>us", function() Util.toggle("spell") end, { desc = "Toggle Spelling" })
|
||||
map("n", "<leader>uw", function() Util.toggle("wrap") end, { desc = "Toggle Word Wrap" })
|
||||
map("n", "<leader>uL", function() Util.toggle("relativenumber") end, { desc = "Toggle Relative Line Numbers" })
|
||||
map("n", "<leader>ul", function() Util.toggle.number() end, { desc = "Toggle Line Numbers" })
|
||||
map("n", "<leader>ud", function() Util.toggle.diagnostics() end, { desc = "Toggle Diagnostics" })
|
||||
map("n", "<leader>uf", function() LazyVim.format.toggle() end, { desc = "Toggle Auto Format (Global)" })
|
||||
map("n", "<leader>uF", function() LazyVim.format.toggle(true) end, { desc = "Toggle Auto Format (Buffer)" })
|
||||
map("n", "<leader>us", function() LazyVim.toggle("spell") end, { desc = "Toggle Spelling" })
|
||||
map("n", "<leader>uw", function() LazyVim.toggle("wrap") end, { desc = "Toggle Word Wrap" })
|
||||
map("n", "<leader>uL", function() LazyVim.toggle("relativenumber") end, { desc = "Toggle Relative Line Numbers" })
|
||||
map("n", "<leader>ul", function() LazyVim.toggle.number() end, { desc = "Toggle Line Numbers" })
|
||||
map("n", "<leader>ud", function() LazyVim.toggle.diagnostics() end, { desc = "Toggle Diagnostics" })
|
||||
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" })
|
||||
if vim.lsp.inlay_hint then
|
||||
map("n", "<leader>uh", function() vim.lsp.inlay_hint(0, nil) end, { desc = "Toggle Inlay Hints" })
|
||||
map("n", "<leader>uc", function() LazyVim.toggle("conceallevel", false, {0, conceallevel}) end, { desc = "Toggle Conceal" })
|
||||
if vim.lsp.buf.inlay_hint or vim.lsp.inlay_hint then
|
||||
map( "n", "<leader>uh", function() LazyVim.toggle.inlay_hints() end, { desc = "Toggle Inlay Hints" })
|
||||
end
|
||||
map("n", "<leader>uT", function() if vim.b.ts_highlight then vim.treesitter.stop() else vim.treesitter.start() end end, { desc = "Toggle Treesitter Highlight" })
|
||||
map("n", "<leader>ub", function() LazyVim.toggle("background", false, {"light", "dark"}) end, { desc = "Toggle Background" })
|
||||
|
||||
-- lazygit
|
||||
map("n", "<leader>gg", function() Util.terminal({ "lazygit" }, { cwd = Util.root(), esc_esc = false, ctrl_hjkl = false }) end, { desc = "Lazygit (root dir)" })
|
||||
map("n", "<leader>gG", function() Util.terminal({ "lazygit" }, {esc_esc = false, ctrl_hjkl = false}) end, { desc = "Lazygit (cwd)" })
|
||||
map("n", "<leader>gg", function() LazyVim.lazygit( { cwd = LazyVim.root.git() }) end, { desc = "Lazygit (Root Dir)" })
|
||||
map("n", "<leader>gG", function() LazyVim.lazygit() end, { desc = "Lazygit (cwd)" })
|
||||
map("n", "<leader>gb", LazyVim.lazygit.blame_line, { desc = "Git Blame Line" })
|
||||
|
||||
map("n", "<leader>gf", function()
|
||||
local git_path = vim.api.nvim_buf_get_name(0)
|
||||
LazyVim.lazygit({args = { "-f", vim.trim(git_path) }})
|
||||
end, { desc = "Lazygit Current File History" })
|
||||
|
||||
map("n", "<leader>gl", function()
|
||||
LazyVim.lazygit({ args = { "log" }, cwd = LazyVim.root.git() })
|
||||
end, { desc = "Lazygit Log" })
|
||||
map("n", "<leader>gL", function()
|
||||
LazyVim.lazygit({ args = { "log" } })
|
||||
end, { desc = "Lazygit Log (cwd)" })
|
||||
|
||||
-- quit
|
||||
map("n", "<leader>qq", "<cmd>qa<cr>", { desc = "Quit all" })
|
||||
map("n", "<leader>qq", "<cmd>qa<cr>", { desc = "Quit All" })
|
||||
|
||||
-- highlights under cursor
|
||||
map("n", "<leader>ui", vim.show_pos, { desc = "Inspect Pos" })
|
||||
map("n", "<leader>uI", "<cmd>InspectTree<cr>", { desc = "Inspect Tree" })
|
||||
|
||||
-- LazyVim Changelog
|
||||
map("n", "<leader>L", function() Util.news.changelog() end, { desc = "LazyVim Changelog" })
|
||||
map("n", "<leader>L", function() LazyVim.news.changelog() end, { desc = "LazyVim Changelog" })
|
||||
|
||||
-- floating terminal
|
||||
local lazyterm = function() Util.terminal(nil, { cwd = Util.root() }) end
|
||||
map("n", "<leader>ft", lazyterm, { desc = "Terminal (root dir)" })
|
||||
map("n", "<leader>fT", function() Util.terminal() end, { desc = "Terminal (cwd)" })
|
||||
map("n", "<c-/>", lazyterm, { desc = "Terminal (root dir)" })
|
||||
local lazyterm = function() LazyVim.terminal(nil, { cwd = LazyVim.root() }) end
|
||||
map("n", "<leader>ft", lazyterm, { desc = "Terminal (Root Dir)" })
|
||||
map("n", "<leader>fT", function() LazyVim.terminal() end, { desc = "Terminal (cwd)" })
|
||||
map("n", "<c-/>", lazyterm, { desc = "Terminal (Root Dir)" })
|
||||
map("n", "<c-_>", lazyterm, { desc = "which_key_ignore" })
|
||||
|
||||
-- Terminal Mappings
|
||||
map("t", "<esc><esc>", "<c-\\><c-n>", { desc = "Enter Normal Mode" })
|
||||
map("t", "<C-h>", "<cmd>wincmd h<cr>", { desc = "Go to left window" })
|
||||
map("t", "<C-j>", "<cmd>wincmd j<cr>", { desc = "Go to lower window" })
|
||||
map("t", "<C-k>", "<cmd>wincmd k<cr>", { desc = "Go to upper window" })
|
||||
map("t", "<C-l>", "<cmd>wincmd l<cr>", { desc = "Go to right window" })
|
||||
map("t", "<C-h>", "<cmd>wincmd h<cr>", { desc = "Go to Left Window" })
|
||||
map("t", "<C-j>", "<cmd>wincmd j<cr>", { desc = "Go to Lower Window" })
|
||||
map("t", "<C-k>", "<cmd>wincmd k<cr>", { desc = "Go to Upper Window" })
|
||||
map("t", "<C-l>", "<cmd>wincmd l<cr>", { desc = "Go to Right Window" })
|
||||
map("t", "<C-/>", "<cmd>close<cr>", { desc = "Hide Terminal" })
|
||||
map("t", "<c-_>", "<cmd>close<cr>", { desc = "which_key_ignore" })
|
||||
|
||||
-- windows
|
||||
map("n", "<leader>ww", "<C-W>p", { desc = "Other window", remap = true })
|
||||
map("n", "<leader>wd", "<C-W>c", { desc = "Delete window", remap = true })
|
||||
map("n", "<leader>w-", "<C-W>s", { desc = "Split window below", remap = true })
|
||||
map("n", "<leader>w|", "<C-W>v", { desc = "Split window right", remap = true })
|
||||
map("n", "<leader>-", "<C-W>s", { desc = "Split window below", remap = true })
|
||||
map("n", "<leader>|", "<C-W>v", { desc = "Split window right", remap = true })
|
||||
map("n", "<leader>ww", "<C-W>p", { desc = "Other Window", remap = true })
|
||||
map("n", "<leader>wd", "<C-W>c", { desc = "Delete Window", remap = true })
|
||||
map("n", "<leader>w-", "<C-W>s", { desc = "Split Window Below", remap = true })
|
||||
map("n", "<leader>w|", "<C-W>v", { desc = "Split Window Right", remap = true })
|
||||
map("n", "<leader>-", "<C-W>s", { desc = "Split Window Below", remap = true })
|
||||
map("n", "<leader>|", "<C-W>v", { desc = "Split Window Right", remap = true })
|
||||
map("n", "<leader>wm", function() LazyVim.toggle.maximize() end, { desc = "Maximize Toggle" })
|
||||
map("n", "<leader>m", function() LazyVim.toggle.maximize() end, { desc = "Maximize Toggle" })
|
||||
|
||||
-- tabs
|
||||
map("n", "<leader><tab>l", "<cmd>tablast<cr>", { desc = "Last Tab" })
|
||||
map("n", "<leader><tab>o", "<cmd>tabonly<cr>", { desc = "Close Other Tabs" })
|
||||
map("n", "<leader><tab>f", "<cmd>tabfirst<cr>", { desc = "First Tab" })
|
||||
map("n", "<leader><tab><tab>", "<cmd>tabnew<cr>", { desc = "New Tab" })
|
||||
map("n", "<leader><tab>]", "<cmd>tabnext<cr>", { desc = "Next Tab" })
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
vim.g.mapleader = " "
|
||||
vim.g.maplocalleader = "\\"
|
||||
|
||||
-- Enable LazyVim auto format
|
||||
-- LazyVim auto format
|
||||
vim.g.autoformat = true
|
||||
|
||||
-- LazyVim root dir detection
|
||||
|
|
@ -12,15 +12,52 @@ vim.g.autoformat = true
|
|||
-- * a function with signature `function(buf) -> string|string[]`
|
||||
vim.g.root_spec = { "lsp", { ".git", "lua" }, "cwd" }
|
||||
|
||||
-- LazyVim automatically configures lazygit:
|
||||
-- * theme, based on the active colorscheme.
|
||||
-- * editorPreset to nvim-remote
|
||||
-- * enables nerd font icons
|
||||
-- Set to false to disable.
|
||||
vim.g.lazygit_config = true
|
||||
|
||||
-- Options for the LazyVim statuscolumn
|
||||
vim.g.lazyvim_statuscolumn = {
|
||||
folds_open = false, -- show fold sign when fold is open
|
||||
folds_githl = false, -- highlight fold sign with git sign color
|
||||
}
|
||||
|
||||
-- Optionally setup the terminal to use
|
||||
-- This sets `vim.o.shell` and does some additional configuration for:
|
||||
-- * pwsh
|
||||
-- * powershell
|
||||
-- LazyVim.terminal.setup("pwsh")
|
||||
|
||||
-- Hide deprecation warnings
|
||||
vim.g.deprecation_warnings = false
|
||||
|
||||
-- Show the current document symbols location from Trouble in lualine
|
||||
vim.g.trouble_lualine = true
|
||||
|
||||
local opt = vim.opt
|
||||
|
||||
opt.autowrite = true -- Enable auto write
|
||||
opt.clipboard = "unnamedplus" -- Sync with system clipboard
|
||||
-- only set clipboard if not in ssh, to make sure the OSC 52
|
||||
-- integration works automatically. Requires Neovim >= 0.10.0
|
||||
opt.clipboard = vim.env.SSH_TTY and "" or "unnamedplus" -- Sync with system clipboard
|
||||
opt.completeopt = "menu,menuone,noselect"
|
||||
opt.conceallevel = 3 -- Hide * markup for bold and italic
|
||||
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.cursorline = true -- Enable highlighting of the current line
|
||||
opt.expandtab = true -- Use spaces instead of tabs
|
||||
opt.fillchars = {
|
||||
foldopen = "",
|
||||
foldclose = "",
|
||||
fold = " ",
|
||||
foldsep = " ",
|
||||
diff = "╱",
|
||||
eob = " ",
|
||||
}
|
||||
opt.foldlevel = 99
|
||||
opt.formatexpr = "v:lua.require'lazyvim.util'.format.formatexpr()"
|
||||
opt.formatoptions = "jcroqlnt" -- tcqj
|
||||
opt.grepformat = "%f:%l:%c:%m"
|
||||
opt.grepprg = "rg --vimgrep"
|
||||
|
|
@ -47,9 +84,10 @@ opt.spelllang = { "en" }
|
|||
opt.splitbelow = true -- Put new windows below current
|
||||
opt.splitkeep = "screen"
|
||||
opt.splitright = true -- Put new windows right of current
|
||||
opt.statuscolumn = [[%!v:lua.require'lazyvim.util'.ui.statuscolumn()]]
|
||||
opt.tabstop = 2 -- Number of spaces tabs count for
|
||||
opt.termguicolors = true -- True color support
|
||||
opt.timeoutlen = 300
|
||||
opt.timeoutlen = vim.g.vscode and 1000 or 300 -- Lower than default (1000) to quickly trigger which-key
|
||||
opt.undofile = true
|
||||
opt.undolevels = 10000
|
||||
opt.updatetime = 200 -- Save swap file and trigger CursorHold
|
||||
|
|
@ -57,37 +95,16 @@ opt.virtualedit = "block" -- Allow cursor to move where there is no text in visu
|
|||
opt.wildmode = "longest:full,full" -- Command-line completion mode
|
||||
opt.winminwidth = 5 -- Minimum window width
|
||||
opt.wrap = false -- Disable line wrap
|
||||
opt.fillchars = {
|
||||
foldopen = "",
|
||||
foldclose = "",
|
||||
-- fold = "⸱",
|
||||
fold = " ",
|
||||
foldsep = " ",
|
||||
diff = "╱",
|
||||
eob = " ",
|
||||
}
|
||||
|
||||
if vim.fn.has("nvim-0.10") == 1 then
|
||||
opt.smoothscroll = true
|
||||
end
|
||||
|
||||
-- Folding
|
||||
vim.opt.foldlevel = 99
|
||||
vim.opt.foldtext = "v:lua.require'lazyvim.util'.ui.foldtext()"
|
||||
|
||||
if vim.fn.has("nvim-0.9.0") == 1 then
|
||||
vim.opt.statuscolumn = [[%!v:lua.require'lazyvim.util'.ui.statuscolumn()]]
|
||||
end
|
||||
|
||||
-- HACK: causes freezes on <= 0.9, so only enable on >= 0.10 for now
|
||||
if vim.fn.has("nvim-0.10") == 1 then
|
||||
vim.opt.foldmethod = "expr"
|
||||
vim.opt.foldexpr = "v:lua.require'lazyvim.util'.ui.foldexpr()"
|
||||
opt.foldexpr = "v:lua.require'lazyvim.util'.ui.foldexpr()"
|
||||
opt.foldmethod = "expr"
|
||||
opt.foldtext = ""
|
||||
else
|
||||
vim.opt.foldmethod = "indent"
|
||||
opt.foldmethod = "indent"
|
||||
opt.foldtext = "v:lua.require'lazyvim.util'.ui.foldtext()"
|
||||
end
|
||||
|
||||
vim.o.formatexpr = "v:lua.require'lazyvim.util'.format.formatexpr()"
|
||||
|
||||
-- Fix markdown indentation settings
|
||||
vim.g.markdown_recommended_style = 0
|
||||
|
|
|
|||
|
|
@ -10,6 +10,9 @@ function M.check()
|
|||
|
||||
if vim.fn.has("nvim-0.9.0") == 1 then
|
||||
ok("Using Neovim >= 0.9.0")
|
||||
if vim.fn.has("nvim-0.10.0") == 0 then
|
||||
warn("Use Neovim >= 0.10.0 for the best experience")
|
||||
end
|
||||
else
|
||||
error("Neovim >= 0.9.0 is required")
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
vim.uv = vim.uv or vim.loop
|
||||
|
||||
local M = {}
|
||||
|
||||
---@param opts? LazyVimConfig
|
||||
|
|
|
|||
|
|
@ -1,35 +1,5 @@
|
|||
return {
|
||||
|
||||
-- snippets
|
||||
{
|
||||
"L3MON4D3/LuaSnip",
|
||||
build = (not jit.os:find("Windows"))
|
||||
and "echo 'NOTE: jsregexp is optional, so not a big deal if it fails to build'; make install_jsregexp"
|
||||
or nil,
|
||||
dependencies = {
|
||||
"rafamadriz/friendly-snippets",
|
||||
config = function()
|
||||
require("luasnip.loaders.from_vscode").lazy_load()
|
||||
end,
|
||||
},
|
||||
opts = {
|
||||
history = true,
|
||||
delete_check_events = "TextChanged",
|
||||
},
|
||||
-- stylua: ignore
|
||||
keys = {
|
||||
{
|
||||
"<tab>",
|
||||
function()
|
||||
return require("luasnip").jumpable(1) and "<Plug>luasnip-jump-next" or "<tab>"
|
||||
end,
|
||||
expr = true, silent = true, mode = "i",
|
||||
},
|
||||
{ "<tab>", function() require("luasnip").jump(1) end, mode = "s" },
|
||||
{ "<s-tab>", function() require("luasnip").jump(-1) end, mode = { "i", "s" } },
|
||||
},
|
||||
},
|
||||
|
||||
-- auto completion
|
||||
{
|
||||
"hrsh7th/nvim-cmp",
|
||||
|
|
@ -39,21 +9,26 @@ return {
|
|||
"hrsh7th/cmp-nvim-lsp",
|
||||
"hrsh7th/cmp-buffer",
|
||||
"hrsh7th/cmp-path",
|
||||
"saadparwaiz1/cmp_luasnip",
|
||||
},
|
||||
-- Not all LSP servers add brackets when completing a function.
|
||||
-- To better deal with this, LazyVim adds a custom option to cmp,
|
||||
-- that you can configure. For example:
|
||||
--
|
||||
-- ```lua
|
||||
-- opts = {
|
||||
-- auto_brackets = { "python" }
|
||||
-- }
|
||||
-- ```
|
||||
|
||||
opts = function()
|
||||
vim.api.nvim_set_hl(0, "CmpGhostText", { link = "Comment", default = true })
|
||||
local cmp = require("cmp")
|
||||
local defaults = require("cmp.config.default")()
|
||||
return {
|
||||
auto_brackets = {}, -- configure any filetype to auto add brackets
|
||||
completion = {
|
||||
completeopt = "menu,menuone,noinsert",
|
||||
},
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
require("luasnip").lsp_expand(args.body)
|
||||
end,
|
||||
},
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
["<C-n>"] = cmp.mapping.select_next_item({ behavior = cmp.SelectBehavior.Insert }),
|
||||
["<C-p>"] = cmp.mapping.select_prev_item({ behavior = cmp.SelectBehavior.Insert }),
|
||||
|
|
@ -61,11 +36,8 @@ return {
|
|||
["<C-f>"] = cmp.mapping.scroll_docs(4),
|
||||
["<C-Space>"] = cmp.mapping.complete(),
|
||||
["<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.
|
||||
["<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.
|
||||
["<CR>"] = LazyVim.cmp.confirm(),
|
||||
["<S-CR>"] = LazyVim.cmp.confirm({ behavior = cmp.ConfirmBehavior.Replace }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
|
||||
["<C-CR>"] = function(fallback)
|
||||
cmp.abort()
|
||||
fallback()
|
||||
|
|
@ -73,7 +45,6 @@ return {
|
|||
}),
|
||||
sources = cmp.config.sources({
|
||||
{ name = "nvim_lsp" },
|
||||
{ name = "luasnip" },
|
||||
{ name = "path" },
|
||||
}, {
|
||||
{ name = "buffer" },
|
||||
|
|
@ -95,162 +66,160 @@ return {
|
|||
sorting = defaults.sorting,
|
||||
}
|
||||
end,
|
||||
---@param opts cmp.ConfigSchema
|
||||
---@param opts cmp.ConfigSchema | {auto_brackets?: string[]}
|
||||
config = function(_, opts)
|
||||
for _, source in ipairs(opts.sources) do
|
||||
source.group_index = source.group_index or 1
|
||||
end
|
||||
require("cmp").setup(opts)
|
||||
|
||||
local parse = require("cmp.utils.snippet").parse
|
||||
require("cmp.utils.snippet").parse = function(input)
|
||||
local ok, ret = pcall(parse, input)
|
||||
if ok then
|
||||
return ret
|
||||
end
|
||||
return LazyVim.cmp.snippet_preview(input)
|
||||
end
|
||||
|
||||
local cmp = require("cmp")
|
||||
cmp.setup(opts)
|
||||
cmp.event:on("confirm_done", function(event)
|
||||
if vim.tbl_contains(opts.auto_brackets or {}, vim.bo.filetype) then
|
||||
LazyVim.cmp.auto_brackets(event.entry)
|
||||
end
|
||||
end)
|
||||
cmp.event:on("menu_opened", function(event)
|
||||
LazyVim.cmp.add_missing_snippet_docs(event.window)
|
||||
end)
|
||||
end,
|
||||
},
|
||||
|
||||
-- snippets
|
||||
{
|
||||
"nvim-cmp",
|
||||
dependencies = {
|
||||
{
|
||||
"garymjr/nvim-snippets",
|
||||
opts = {
|
||||
friendly_snippets = true,
|
||||
},
|
||||
dependencies = { "rafamadriz/friendly-snippets" },
|
||||
},
|
||||
},
|
||||
opts = function(_, opts)
|
||||
opts.snippet = {
|
||||
expand = function(item)
|
||||
return LazyVim.cmp.expand(item.body)
|
||||
end,
|
||||
}
|
||||
table.insert(opts.sources, { name = "snippets" })
|
||||
end,
|
||||
keys = {
|
||||
{
|
||||
"<Tab>",
|
||||
function()
|
||||
return vim.snippet.active({ direction = 1 }) and "<cmd>lua vim.snippet.jump(1)<cr>" or "<Tab>"
|
||||
end,
|
||||
expr = true,
|
||||
silent = true,
|
||||
mode = { "i", "s" },
|
||||
},
|
||||
{
|
||||
"<S-Tab>",
|
||||
function()
|
||||
return vim.snippet.active({ direction = -1 }) and "<cmd>lua vim.snippet.jump(-1)<cr>" or "<Tab>"
|
||||
end,
|
||||
expr = true,
|
||||
silent = true,
|
||||
mode = { "i", "s" },
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
-- auto pairs
|
||||
{
|
||||
"echasnovski/mini.pairs",
|
||||
event = "VeryLazy",
|
||||
opts = {},
|
||||
opts = {
|
||||
mappings = {
|
||||
["`"] = { action = "closeopen", pair = "``", neigh_pattern = "[^\\`].", register = { cr = false } },
|
||||
},
|
||||
},
|
||||
keys = {
|
||||
{
|
||||
"<leader>up",
|
||||
function()
|
||||
local Util = require("lazy.core.util")
|
||||
vim.g.minipairs_disable = not vim.g.minipairs_disable
|
||||
if vim.g.minipairs_disable then
|
||||
Util.warn("Disabled auto pairs", { title = "Option" })
|
||||
LazyVim.warn("Disabled auto pairs", { title = "Option" })
|
||||
else
|
||||
Util.info("Enabled auto pairs", { title = "Option" })
|
||||
LazyVim.info("Enabled auto pairs", { title = "Option" })
|
||||
end
|
||||
end,
|
||||
desc = "Toggle auto pairs",
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
-- Fast and feature-rich surround actions. For text that includes
|
||||
-- surrounding characters like brackets or quotes, this allows you
|
||||
-- to select the text inside, change or modify the surrounding characters,
|
||||
-- and more.
|
||||
{
|
||||
"echasnovski/mini.surround",
|
||||
keys = function(_, keys)
|
||||
-- Populate the keys based on the user's options
|
||||
local plugin = require("lazy.core.config").spec.plugins["mini.surround"]
|
||||
local opts = require("lazy.core.plugin").values(plugin, "opts", false)
|
||||
local mappings = {
|
||||
{ opts.mappings.add, desc = "Add surrounding", mode = { "n", "v" } },
|
||||
{ opts.mappings.delete, desc = "Delete surrounding" },
|
||||
{ opts.mappings.find, desc = "Find right surrounding" },
|
||||
{ opts.mappings.find_left, desc = "Find left surrounding" },
|
||||
{ opts.mappings.highlight, desc = "Highlight surrounding" },
|
||||
{ opts.mappings.replace, desc = "Replace surrounding" },
|
||||
{ opts.mappings.update_n_lines, desc = "Update `MiniSurround.config.n_lines`" },
|
||||
}
|
||||
mappings = vim.tbl_filter(function(m)
|
||||
return m[1] and #m[1] > 0
|
||||
end, mappings)
|
||||
return vim.list_extend(mappings, keys)
|
||||
end,
|
||||
opts = {
|
||||
mappings = {
|
||||
add = "gsa", -- Add surrounding in Normal and Visual modes
|
||||
delete = "gsd", -- Delete surrounding
|
||||
find = "gsf", -- Find surrounding (to the right)
|
||||
find_left = "gsF", -- Find surrounding (to the left)
|
||||
highlight = "gsh", -- Highlight surrounding
|
||||
replace = "gsr", -- Replace surrounding
|
||||
update_n_lines = "gsn", -- Update `n_lines`
|
||||
desc = "Toggle Auto Pairs",
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
-- comments
|
||||
{
|
||||
"JoosepAlviste/nvim-ts-context-commentstring",
|
||||
lazy = true,
|
||||
opts = {
|
||||
enable_autocmd = false,
|
||||
},
|
||||
},
|
||||
{
|
||||
"echasnovski/mini.comment",
|
||||
"folke/ts-comments.nvim",
|
||||
event = "VeryLazy",
|
||||
opts = {
|
||||
options = {
|
||||
custom_commentstring = function()
|
||||
return require("ts_context_commentstring.internal").calculate_commentstring() or vim.bo.commentstring
|
||||
end,
|
||||
},
|
||||
},
|
||||
opts = {},
|
||||
},
|
||||
|
||||
-- Better text-objects
|
||||
{
|
||||
"echasnovski/mini.ai",
|
||||
-- keys = {
|
||||
-- { "a", mode = { "x", "o" } },
|
||||
-- { "i", mode = { "x", "o" } },
|
||||
-- },
|
||||
event = "VeryLazy",
|
||||
opts = function()
|
||||
LazyVim.on_load("which-key.nvim", function()
|
||||
vim.schedule(LazyVim.mini.ai_whichkey)
|
||||
end)
|
||||
local ai = require("mini.ai")
|
||||
return {
|
||||
n_lines = 500,
|
||||
custom_textobjects = {
|
||||
o = ai.gen_spec.treesitter({
|
||||
o = ai.gen_spec.treesitter({ -- code block
|
||||
a = { "@block.outer", "@conditional.outer", "@loop.outer" },
|
||||
i = { "@block.inner", "@conditional.inner", "@loop.inner" },
|
||||
}, {}),
|
||||
f = ai.gen_spec.treesitter({ a = "@function.outer", i = "@function.inner" }, {}),
|
||||
c = ai.gen_spec.treesitter({ a = "@class.outer", i = "@class.inner" }, {}),
|
||||
t = { "<([%p%w]-)%f[^<%w][^<>]->.-</%1>", "^<.->().*()</[^/]->$" },
|
||||
}),
|
||||
f = ai.gen_spec.treesitter({ a = "@function.outer", i = "@function.inner" }), -- function
|
||||
c = ai.gen_spec.treesitter({ a = "@class.outer", i = "@class.inner" }), -- class
|
||||
t = { "<([%p%w]-)%f[^<%w][^<>]->.-</%1>", "^<.->().*()</[^/]->$" }, -- tags
|
||||
d = { "%f[%d]%d+" }, -- digits
|
||||
e = { -- Word with case
|
||||
{ "%u[%l%d]+%f[^%l%d]", "%f[%S][%l%d]+%f[^%l%d]", "%f[%P][%l%d]+%f[^%l%d]", "^[%l%d]+%f[^%l%d]" },
|
||||
"^().*()$",
|
||||
},
|
||||
i = LazyVim.mini.ai_indent, -- indent
|
||||
g = LazyVim.mini.ai_buffer, -- buffer
|
||||
u = ai.gen_spec.function_call(), -- u for "Usage"
|
||||
U = ai.gen_spec.function_call({ name_pattern = "[%w_]" }), -- without dot in function name
|
||||
},
|
||||
}
|
||||
end,
|
||||
config = function(_, opts)
|
||||
require("mini.ai").setup(opts)
|
||||
-- register all text objects with which-key
|
||||
require("lazyvim.util").on_load("which-key.nvim", function()
|
||||
---@type table<string, string|table>
|
||||
local i = {
|
||||
[" "] = "Whitespace",
|
||||
['"'] = 'Balanced "',
|
||||
["'"] = "Balanced '",
|
||||
["`"] = "Balanced `",
|
||||
["("] = "Balanced (",
|
||||
[")"] = "Balanced ) including white-space",
|
||||
[">"] = "Balanced > including white-space",
|
||||
["<lt>"] = "Balanced <",
|
||||
["]"] = "Balanced ] including white-space",
|
||||
["["] = "Balanced [",
|
||||
["}"] = "Balanced } including white-space",
|
||||
["{"] = "Balanced {",
|
||||
["?"] = "User Prompt",
|
||||
_ = "Underscore",
|
||||
a = "Argument",
|
||||
b = "Balanced ), ], }",
|
||||
c = "Class",
|
||||
f = "Function",
|
||||
o = "Block, conditional, loop",
|
||||
q = "Quote `, \", '",
|
||||
t = "Tag",
|
||||
}
|
||||
local a = vim.deepcopy(i)
|
||||
for k, v in pairs(a) do
|
||||
a[k] = v:gsub(" including.*", "")
|
||||
end
|
||||
},
|
||||
|
||||
local ic = vim.deepcopy(i)
|
||||
local ac = vim.deepcopy(a)
|
||||
for key, name in pairs({ n = "Next", l = "Last" }) do
|
||||
i[key] = vim.tbl_extend("force", { name = "Inside " .. name .. " textobject" }, ic)
|
||||
a[key] = vim.tbl_extend("force", { name = "Around " .. name .. " textobject" }, ac)
|
||||
end
|
||||
require("which-key").register({
|
||||
mode = { "o", "x" },
|
||||
i = i,
|
||||
a = a,
|
||||
})
|
||||
end)
|
||||
{
|
||||
"folke/lazydev.nvim",
|
||||
ft = "lua",
|
||||
cmd = "LazyDev",
|
||||
opts = {
|
||||
library = {
|
||||
{ path = "luvit-meta/library", words = { "vim%.uv" } },
|
||||
{ path = "LazyVim", words = { "LazyVim" } },
|
||||
{ path = "lazy.nvim", words = { "LazyVim" } },
|
||||
},
|
||||
},
|
||||
},
|
||||
-- Manage libuv types with lazy. Plugin will never be loaded
|
||||
{ "Bilal2453/luvit-meta", lazy = true },
|
||||
-- Add lazydev source to cmp
|
||||
{
|
||||
"hrsh7th/nvim-cmp",
|
||||
opts = function(_, opts)
|
||||
table.insert(opts.sources, { name = "lazydev", group_index = 0 })
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,14 +14,19 @@ return {
|
|||
name = "catppuccin",
|
||||
opts = {
|
||||
integrations = {
|
||||
aerial = true,
|
||||
alpha = true,
|
||||
cmp = true,
|
||||
dashboard = true,
|
||||
flash = true,
|
||||
gitsigns = true,
|
||||
headlines = true,
|
||||
illuminate = true,
|
||||
indent_blankline = { enabled = true },
|
||||
leap = true,
|
||||
lsp_trouble = true,
|
||||
mason = true,
|
||||
markdown = true,
|
||||
mini = true,
|
||||
native_lsp = {
|
||||
enabled = true,
|
||||
|
|
@ -34,12 +39,13 @@ return {
|
|||
},
|
||||
navic = { enabled = true, custom_bg = "lualine" },
|
||||
neotest = true,
|
||||
neotree = true,
|
||||
noice = true,
|
||||
notify = true,
|
||||
neotree = true,
|
||||
semantic_tokens = true,
|
||||
telescope = true,
|
||||
treesitter = true,
|
||||
treesitter_context = true,
|
||||
which_key = true,
|
||||
},
|
||||
},
|
||||
|
|
|
|||
29
lua/lazyvim/plugins/compat/nvim-0_9.lua
Normal file
29
lua/lazyvim/plugins/compat/nvim-0_9.lua
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
-- Compatibility with Neovim 0.9
|
||||
return {
|
||||
-- Use LuaSnip instead of native snippets
|
||||
{ "garymjr/nvim-snippets", enabled = false },
|
||||
{ import = "lazyvim.plugins.extras.coding.luasnip" },
|
||||
|
||||
-- Use mini.comment instead of ts-comments
|
||||
{ "folke/ts-comments.nvim", enabled = false },
|
||||
{ import = "lazyvim.plugins.extras.coding.mini-comment" },
|
||||
|
||||
-- Use neodev-types with lazydev
|
||||
{ "folke/neodev.nvim", config = function() end },
|
||||
{
|
||||
"folke/lazydev.nvim",
|
||||
opts = function(_, opts)
|
||||
opts.library = opts.library or {}
|
||||
table.insert(opts.library, { "neodev.nvim/types/stable" })
|
||||
end,
|
||||
config = function(_, opts)
|
||||
-- force lazydev to load on Neovim 0.9
|
||||
require("lazydev.config").have_0_10 = true
|
||||
require("lazydev").setup(opts)
|
||||
end,
|
||||
},
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
dependencies = {},
|
||||
},
|
||||
}
|
||||
|
|
@ -1,4 +1,5 @@
|
|||
local Util = require("lazyvim.util")
|
||||
local have_make = vim.fn.executable("make") == 1
|
||||
local have_cmake = vim.fn.executable("cmake") == 1
|
||||
|
||||
return {
|
||||
|
||||
|
|
@ -11,44 +12,55 @@ return {
|
|||
{
|
||||
"<leader>fe",
|
||||
function()
|
||||
require("neo-tree.command").execute({ toggle = true, dir = Util.root() })
|
||||
require("neo-tree.command").execute({ toggle = true, dir = LazyVim.root() })
|
||||
end,
|
||||
desc = "Explorer NeoTree (root dir)",
|
||||
desc = "Explorer NeoTree (Root Dir)",
|
||||
},
|
||||
{
|
||||
"<leader>fE",
|
||||
function()
|
||||
require("neo-tree.command").execute({ toggle = true, dir = vim.loop.cwd() })
|
||||
require("neo-tree.command").execute({ toggle = true, dir = vim.uv.cwd() })
|
||||
end,
|
||||
desc = "Explorer NeoTree (cwd)",
|
||||
},
|
||||
{ "<leader>e", "<leader>fe", desc = "Explorer NeoTree (root dir)", remap = true },
|
||||
{ "<leader>e", "<leader>fe", desc = "Explorer NeoTree (Root Dir)", remap = true },
|
||||
{ "<leader>E", "<leader>fE", desc = "Explorer NeoTree (cwd)", remap = true },
|
||||
{
|
||||
"<leader>ge",
|
||||
function()
|
||||
require("neo-tree.command").execute({ source = "git_status", toggle = true })
|
||||
end,
|
||||
desc = "Git explorer",
|
||||
desc = "Git Explorer",
|
||||
},
|
||||
{
|
||||
"<leader>be",
|
||||
function()
|
||||
require("neo-tree.command").execute({ source = "buffers", toggle = true })
|
||||
end,
|
||||
desc = "Buffer explorer",
|
||||
desc = "Buffer Explorer",
|
||||
},
|
||||
},
|
||||
deactivate = function()
|
||||
vim.cmd([[Neotree close]])
|
||||
end,
|
||||
init = function()
|
||||
if vim.fn.argc(-1) == 1 then
|
||||
local stat = vim.loop.fs_stat(vim.fn.argv(0))
|
||||
if stat and stat.type == "directory" then
|
||||
require("neo-tree")
|
||||
end
|
||||
end
|
||||
-- FIX: use `autocmd` for lazy-loading neo-tree instead of directly requiring it,
|
||||
-- because `cwd` is not set up properly.
|
||||
vim.api.nvim_create_autocmd("BufEnter", {
|
||||
group = vim.api.nvim_create_augroup("Neotree_start_directory", { clear = true }),
|
||||
desc = "Start Neo-tree with directory",
|
||||
once = true,
|
||||
callback = function()
|
||||
if package.loaded["neo-tree"] then
|
||||
return
|
||||
else
|
||||
local stats = vim.uv.fs_stat(vim.fn.argv(0))
|
||||
if stats and stats.type == "directory" then
|
||||
require("neo-tree")
|
||||
end
|
||||
end
|
||||
end,
|
||||
})
|
||||
end,
|
||||
opts = {
|
||||
sources = { "filesystem", "buffers", "git_status", "document_symbols" },
|
||||
|
|
@ -61,6 +73,20 @@ return {
|
|||
window = {
|
||||
mappings = {
|
||||
["<space>"] = "none",
|
||||
["Y"] = {
|
||||
function(state)
|
||||
local node = state.tree:get_node()
|
||||
local path = node:get_id()
|
||||
vim.fn.setreg("+", path, "c")
|
||||
end,
|
||||
desc = "Copy Path to Clipboard",
|
||||
},
|
||||
["O"] = {
|
||||
function(state)
|
||||
require("lazy.util").open(state.tree:get_node().path, { system = true })
|
||||
end,
|
||||
desc = "Open with System Application",
|
||||
},
|
||||
},
|
||||
},
|
||||
default_component_configs = {
|
||||
|
|
@ -70,11 +96,17 @@ return {
|
|||
expander_expanded = "",
|
||||
expander_highlight = "NeoTreeExpander",
|
||||
},
|
||||
git_status = {
|
||||
symbols = {
|
||||
unstaged = "",
|
||||
staged = "",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
config = function(_, opts)
|
||||
local function on_move(data)
|
||||
Util.lsp.on_rename(data.source, data.destination)
|
||||
LazyVim.lsp.on_rename(data.source, data.destination)
|
||||
end
|
||||
|
||||
local events = require("neo-tree.events")
|
||||
|
|
@ -98,11 +130,12 @@ return {
|
|||
-- search/replace in multiple files
|
||||
{
|
||||
"nvim-pack/nvim-spectre",
|
||||
build = false,
|
||||
cmd = "Spectre",
|
||||
opts = { open_cmd = "noswapfile vnew" },
|
||||
-- stylua: ignore
|
||||
keys = {
|
||||
{ "<leader>sr", function() require("spectre").open() end, desc = "Replace in files (Spectre)" },
|
||||
{ "<leader>sr", function() require("spectre").open() end, desc = "Replace in Files (Spectre)" },
|
||||
},
|
||||
},
|
||||
|
||||
|
|
@ -117,11 +150,23 @@ return {
|
|||
dependencies = {
|
||||
{
|
||||
"nvim-telescope/telescope-fzf-native.nvim",
|
||||
build = "make",
|
||||
enabled = vim.fn.executable("make") == 1,
|
||||
config = function()
|
||||
Util.on_load("telescope.nvim", function()
|
||||
require("telescope").load_extension("fzf")
|
||||
build = have_make and "make"
|
||||
or "cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release && cmake --install build --prefix build",
|
||||
enabled = have_make or have_cmake,
|
||||
config = function(plugin)
|
||||
LazyVim.on_load("telescope.nvim", function()
|
||||
local ok, err = pcall(require("telescope").load_extension, "fzf")
|
||||
if not ok then
|
||||
local lib = plugin.dir .. "/build/libfzf." .. (LazyVim.is_win() and "dll" or "so")
|
||||
if not vim.uv.fs_stat(lib) then
|
||||
LazyVim.warn("`telescope-fzf-native.nvim` not built. Rebuilding...")
|
||||
require("lazy").build({ plugins = { plugin }, show = false }):wait(function()
|
||||
LazyVim.info("Rebuilding `telescope-fzf-native.nvim` done.\nPlease restart Neovim.")
|
||||
end)
|
||||
else
|
||||
LazyVim.error("Failed to load `telescope-fzf-native.nvim`:\n" .. err)
|
||||
end
|
||||
end
|
||||
end)
|
||||
end,
|
||||
},
|
||||
|
|
@ -132,41 +177,45 @@ return {
|
|||
"<cmd>Telescope buffers sort_mru=true sort_lastused=true<cr>",
|
||||
desc = "Switch Buffer",
|
||||
},
|
||||
{ "<leader>/", Util.telescope("live_grep"), desc = "Grep (root dir)" },
|
||||
{ "<leader>/", LazyVim.telescope("live_grep"), desc = "Grep (Root Dir)" },
|
||||
{ "<leader>:", "<cmd>Telescope command_history<cr>", desc = "Command History" },
|
||||
{ "<leader><space>", Util.telescope("files"), desc = "Find Files (root dir)" },
|
||||
{ "<leader><space>", LazyVim.telescope("files"), desc = "Find Files (Root Dir)" },
|
||||
-- find
|
||||
{ "<leader>fb", "<cmd>Telescope buffers sort_mru=true sort_lastused=true<cr>", desc = "Buffers" },
|
||||
{ "<leader>fc", Util.telescope.config_files(), desc = "Find Config File" },
|
||||
{ "<leader>ff", Util.telescope("files"), desc = "Find Files (root dir)" },
|
||||
{ "<leader>fF", Util.telescope("files", { cwd = false }), desc = "Find Files (cwd)" },
|
||||
{ "<leader>fc", LazyVim.telescope.config_files(), desc = "Find Config File" },
|
||||
{ "<leader>ff", LazyVim.telescope("files"), desc = "Find Files (Root Dir)" },
|
||||
{ "<leader>fF", LazyVim.telescope("files", { cwd = false }), desc = "Find Files (cwd)" },
|
||||
{ "<leader>fg", "<cmd>Telescope git_files<cr>", desc = "Find Files (git-files)" },
|
||||
{ "<leader>fr", "<cmd>Telescope oldfiles<cr>", desc = "Recent" },
|
||||
{ "<leader>fR", Util.telescope("oldfiles", { cwd = vim.loop.cwd() }), desc = "Recent (cwd)" },
|
||||
{ "<leader>fR", LazyVim.telescope("oldfiles", { cwd = vim.uv.cwd() }), desc = "Recent (cwd)" },
|
||||
-- git
|
||||
{ "<leader>gc", "<cmd>Telescope git_commits<CR>", desc = "commits" },
|
||||
{ "<leader>gs", "<cmd>Telescope git_status<CR>", desc = "status" },
|
||||
{ "<leader>gc", "<cmd>Telescope git_commits<CR>", desc = "Commits" },
|
||||
{ "<leader>gs", "<cmd>Telescope git_status<CR>", desc = "Status" },
|
||||
-- search
|
||||
{ '<leader>s"', "<cmd>Telescope registers<cr>", desc = "Registers" },
|
||||
{ "<leader>sa", "<cmd>Telescope autocommands<cr>", desc = "Auto Commands" },
|
||||
{ "<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 commands<cr>", desc = "Commands" },
|
||||
{ "<leader>sd", "<cmd>Telescope diagnostics bufnr=0<cr>", desc = "Document diagnostics" },
|
||||
{ "<leader>sD", "<cmd>Telescope diagnostics<cr>", desc = "Workspace diagnostics" },
|
||||
{ "<leader>sg", Util.telescope("live_grep"), desc = "Grep (root dir)" },
|
||||
{ "<leader>sG", Util.telescope("live_grep", { cwd = false }), desc = "Grep (cwd)" },
|
||||
{ "<leader>sd", "<cmd>Telescope diagnostics bufnr=0<cr>", desc = "Document Diagnostics" },
|
||||
{ "<leader>sD", "<cmd>Telescope diagnostics<cr>", desc = "Workspace Diagnostics" },
|
||||
{ "<leader>sg", LazyVim.telescope("live_grep"), desc = "Grep (Root Dir)" },
|
||||
{ "<leader>sG", LazyVim.telescope("live_grep", { cwd = false }), desc = "Grep (cwd)" },
|
||||
{ "<leader>sh", "<cmd>Telescope help_tags<cr>", desc = "Help Pages" },
|
||||
{ "<leader>sH", "<cmd>Telescope highlights<cr>", desc = "Search Highlight Groups" },
|
||||
{ "<leader>sj", "<cmd>Telescope jumplist<cr>", desc = "Jumplist" },
|
||||
{ "<leader>sk", "<cmd>Telescope keymaps<cr>", desc = "Key Maps" },
|
||||
{ "<leader>sl", "<cmd>Telescope loclist<cr>", desc = "Location List" },
|
||||
{ "<leader>sM", "<cmd>Telescope man_pages<cr>", desc = "Man Pages" },
|
||||
{ "<leader>sm", "<cmd>Telescope marks<cr>", desc = "Jump to Mark" },
|
||||
{ "<leader>so", "<cmd>Telescope vim_options<cr>", desc = "Options" },
|
||||
{ "<leader>sR", "<cmd>Telescope resume<cr>", desc = "Resume" },
|
||||
{ "<leader>sw", Util.telescope("grep_string", { word_match = "-w" }), desc = "Word (root dir)" },
|
||||
{ "<leader>sW", Util.telescope("grep_string", { cwd = false, word_match = "-w" }), desc = "Word (cwd)" },
|
||||
{ "<leader>sw", Util.telescope("grep_string"), mode = "v", desc = "Selection (root dir)" },
|
||||
{ "<leader>sW", Util.telescope("grep_string", { cwd = false }), mode = "v", desc = "Selection (cwd)" },
|
||||
{ "<leader>uC", Util.telescope("colorscheme", { enable_preview = true }), desc = "Colorscheme with preview" },
|
||||
{ "<leader>sq", "<cmd>Telescope quickfix<cr>", desc = "Quickfix List" },
|
||||
{ "<leader>sw", LazyVim.telescope("grep_string", { word_match = "-w" }), desc = "Word (Root Dir)" },
|
||||
{ "<leader>sW", LazyVim.telescope("grep_string", { cwd = false, word_match = "-w" }), desc = "Word (cwd)" },
|
||||
{ "<leader>sw", LazyVim.telescope("grep_string"), mode = "v", desc = "Selection (Root Dir)" },
|
||||
{ "<leader>sW", LazyVim.telescope("grep_string", { cwd = false }), mode = "v", desc = "Selection (cwd)" },
|
||||
{ "<leader>uC", LazyVim.telescope("colorscheme", { enable_preview = true }), desc = "Colorscheme with Preview" },
|
||||
{
|
||||
"<leader>ss",
|
||||
function()
|
||||
|
|
@ -189,21 +238,16 @@ return {
|
|||
opts = function()
|
||||
local actions = require("telescope.actions")
|
||||
|
||||
local open_with_trouble = function(...)
|
||||
return require("trouble.providers.telescope").open_with_trouble(...)
|
||||
end
|
||||
local open_selected_with_trouble = function(...)
|
||||
return require("trouble.providers.telescope").open_selected_with_trouble(...)
|
||||
end
|
||||
local open_with_trouble = require("trouble.sources.telescope").open
|
||||
local find_files_no_ignore = function()
|
||||
local action_state = require("telescope.actions.state")
|
||||
local line = action_state.get_current_line()
|
||||
Util.telescope("find_files", { no_ignore = true, default_text = line })()
|
||||
LazyVim.telescope("find_files", { no_ignore = true, default_text = line })()
|
||||
end
|
||||
local find_files_with_hidden = function()
|
||||
local action_state = require("telescope.actions.state")
|
||||
local line = action_state.get_current_line()
|
||||
Util.telescope("find_files", { hidden = true, default_text = line })()
|
||||
LazyVim.telescope("find_files", { hidden = true, default_text = line })()
|
||||
end
|
||||
|
||||
return {
|
||||
|
|
@ -226,7 +270,7 @@ return {
|
|||
mappings = {
|
||||
i = {
|
||||
["<c-t>"] = open_with_trouble,
|
||||
["<a-t>"] = open_selected_with_trouble,
|
||||
["<a-t>"] = open_with_trouble,
|
||||
["<a-i>"] = find_files_no_ignore,
|
||||
["<a-h>"] = find_files_with_hidden,
|
||||
["<C-Down>"] = actions.cycle_history_next,
|
||||
|
|
@ -267,7 +311,7 @@ return {
|
|||
"nvim-telescope/telescope.nvim",
|
||||
optional = true,
|
||||
opts = function(_, opts)
|
||||
if not Util.has("flash.nvim") then
|
||||
if not LazyVim.has("flash.nvim") then
|
||||
return
|
||||
end
|
||||
local function flash(prompt_bufnr)
|
||||
|
|
@ -305,6 +349,7 @@ return {
|
|||
mode = { "n", "v" },
|
||||
["g"] = { name = "+goto" },
|
||||
["gs"] = { name = "+surround" },
|
||||
["z"] = { name = "+fold" },
|
||||
["]"] = { name = "+next" },
|
||||
["["] = { name = "+prev" },
|
||||
["<leader><tab>"] = { name = "+tabs" },
|
||||
|
|
@ -350,14 +395,16 @@ return {
|
|||
end
|
||||
|
||||
-- stylua: ignore start
|
||||
map("n", "]h", gs.next_hunk, "Next Hunk")
|
||||
map("n", "[h", gs.prev_hunk, "Prev Hunk")
|
||||
map("n", "]h", function() gs.nav_hunk("next") end, "Next Hunk")
|
||||
map("n", "[h", function() gs.nav_hunk("prev") end, "Prev Hunk")
|
||||
map("n", "]H", function() gs.nav_hunk("last") end, "Last Hunk")
|
||||
map("n", "[H", function() gs.nav_hunk("first") end, "First Hunk")
|
||||
map({ "n", "v" }, "<leader>ghs", ":Gitsigns stage_hunk<CR>", "Stage Hunk")
|
||||
map({ "n", "v" }, "<leader>ghr", ":Gitsigns reset_hunk<CR>", "Reset Hunk")
|
||||
map("n", "<leader>ghS", gs.stage_buffer, "Stage Buffer")
|
||||
map("n", "<leader>ghu", gs.undo_stage_hunk, "Undo Stage Hunk")
|
||||
map("n", "<leader>ghR", gs.reset_buffer, "Reset Buffer")
|
||||
map("n", "<leader>ghp", gs.preview_hunk, "Preview Hunk")
|
||||
map("n", "<leader>ghp", gs.preview_hunk_inline, "Preview Hunk Inline")
|
||||
map("n", "<leader>ghb", function() gs.blame_line({ full = true }) end, "Blame Line")
|
||||
map("n", "<leader>ghd", gs.diffthis, "Diff This")
|
||||
map("n", "<leader>ghD", function() gs.diffthis("~") end, "Diff This ~")
|
||||
|
|
@ -366,89 +413,27 @@ return {
|
|||
},
|
||||
},
|
||||
|
||||
-- Automatically highlights other instances of the word under your cursor.
|
||||
-- This works with LSP, Treesitter, and regexp matching to find the other
|
||||
-- instances.
|
||||
{
|
||||
"RRethy/vim-illuminate",
|
||||
event = "LazyFile",
|
||||
opts = {
|
||||
delay = 200,
|
||||
large_file_cutoff = 2000,
|
||||
large_file_overrides = {
|
||||
providers = { "lsp" },
|
||||
},
|
||||
},
|
||||
config = function(_, opts)
|
||||
require("illuminate").configure(opts)
|
||||
|
||||
local function map(key, dir, buffer)
|
||||
vim.keymap.set("n", key, function()
|
||||
require("illuminate")["goto_" .. dir .. "_reference"](false)
|
||||
end, { desc = dir:sub(1, 1):upper() .. dir:sub(2) .. " Reference", buffer = buffer })
|
||||
end
|
||||
|
||||
map("]]", "next")
|
||||
map("[[", "prev")
|
||||
|
||||
-- also set it after loading ftplugins, since a lot overwrite [[ and ]]
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
callback = function()
|
||||
local buffer = vim.api.nvim_get_current_buf()
|
||||
map("]]", "next", buffer)
|
||||
map("[[", "prev", buffer)
|
||||
end,
|
||||
})
|
||||
end,
|
||||
keys = {
|
||||
{ "]]", desc = "Next Reference" },
|
||||
{ "[[", desc = "Prev Reference" },
|
||||
},
|
||||
},
|
||||
|
||||
-- buffer remove
|
||||
{
|
||||
"echasnovski/mini.bufremove",
|
||||
|
||||
keys = {
|
||||
{
|
||||
"<leader>bd",
|
||||
function()
|
||||
local bd = require("mini.bufremove").delete
|
||||
if vim.bo.modified then
|
||||
local choice = vim.fn.confirm(("Save changes to %q?"):format(vim.fn.bufname()), "&Yes\n&No\n&Cancel")
|
||||
if choice == 1 then -- Yes
|
||||
vim.cmd.write()
|
||||
bd(0)
|
||||
elseif choice == 2 then -- No
|
||||
bd(0, true)
|
||||
end
|
||||
else
|
||||
bd(0)
|
||||
end
|
||||
end,
|
||||
desc = "Delete Buffer",
|
||||
},
|
||||
-- stylua: ignore
|
||||
{ "<leader>bD", function() require("mini.bufremove").delete(0, true) end, desc = "Delete Buffer (Force)" },
|
||||
},
|
||||
},
|
||||
|
||||
-- better diagnostics list and others
|
||||
{
|
||||
"folke/trouble.nvim",
|
||||
cmd = { "TroubleToggle", "Trouble" },
|
||||
opts = { use_diagnostic_signs = true },
|
||||
keys = {
|
||||
{ "<leader>xx", "<cmd>TroubleToggle document_diagnostics<cr>", desc = "Document Diagnostics (Trouble)" },
|
||||
{ "<leader>xX", "<cmd>TroubleToggle workspace_diagnostics<cr>", desc = "Workspace Diagnostics (Trouble)" },
|
||||
{ "<leader>xL", "<cmd>TroubleToggle loclist<cr>", desc = "Location List (Trouble)" },
|
||||
{ "<leader>xQ", "<cmd>TroubleToggle quickfix<cr>", desc = "Quickfix List (Trouble)" },
|
||||
{ "<leader>xx", "<cmd>Trouble diagnostics toggle<cr>", desc = "Diagnostics (Trouble)" },
|
||||
{ "<leader>xX", "<cmd>Trouble diagnostics toggle filter.buf=0<cr>", desc = "Buffer Diagnostics (Trouble)" },
|
||||
{ "<leader>cs", "<cmd>Trouble symbols toggle focus=false<cr>", desc = "Symbols (Trouble)" },
|
||||
{
|
||||
"<leader>cS",
|
||||
"<cmd>Trouble lsp toggle focus=false win.position=right<cr>",
|
||||
desc = "LSP references/definitions/... (Trouble)",
|
||||
},
|
||||
{ "<leader>xL", "<cmd>Trouble loclist toggle<cr>", desc = "Location List (Trouble)" },
|
||||
{ "<leader>xQ", "<cmd>Trouble qflist toggle<cr>", desc = "Quickfix List (Trouble)" },
|
||||
{
|
||||
"[q",
|
||||
function()
|
||||
if require("trouble").is_open() then
|
||||
require("trouble").previous({ skip_groups = true, jump = true })
|
||||
require("trouble").prev({ skip_groups = true, jump = true })
|
||||
else
|
||||
local ok, err = pcall(vim.cmd.cprev)
|
||||
if not ok then
|
||||
|
|
@ -456,7 +441,7 @@ return {
|
|||
end
|
||||
end
|
||||
end,
|
||||
desc = "Previous trouble/quickfix item",
|
||||
desc = "Previous Trouble/Quickfix Item",
|
||||
},
|
||||
{
|
||||
"]q",
|
||||
|
|
@ -470,7 +455,7 @@ return {
|
|||
end
|
||||
end
|
||||
end,
|
||||
desc = "Next trouble/quickfix item",
|
||||
desc = "Next Trouble/Quickfix Item",
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
@ -484,10 +469,10 @@ return {
|
|||
config = true,
|
||||
-- stylua: ignore
|
||||
keys = {
|
||||
{ "]t", function() require("todo-comments").jump_next() end, desc = "Next todo comment" },
|
||||
{ "[t", function() require("todo-comments").jump_prev() end, desc = "Previous todo comment" },
|
||||
{ "<leader>xt", "<cmd>TodoTrouble<cr>", desc = "Todo (Trouble)" },
|
||||
{ "<leader>xT", "<cmd>TodoTrouble keywords=TODO,FIX,FIXME<cr>", desc = "Todo/Fix/Fixme (Trouble)" },
|
||||
{ "]t", function() require("todo-comments").jump_next() end, desc = "Next Todo Comment" },
|
||||
{ "[t", function() require("todo-comments").jump_prev() end, desc = "Previous Todo Comment" },
|
||||
{ "<leader>xt", "<cmd>Trouble todo toggle<cr>", desc = "Todo (Trouble)" },
|
||||
{ "<leader>xT", "<cmd>Trouble todo toggle filter = {tag = {TODO,FIX,FIXME}}<cr>", desc = "Todo/Fix/Fixme (Trouble)" },
|
||||
{ "<leader>st", "<cmd>TodoTelescope<cr>", desc = "Todo" },
|
||||
{ "<leader>sT", "<cmd>TodoTelescope keywords=TODO,FIX,FIXME<cr>", desc = "Todo/Fix/Fixme" },
|
||||
},
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ return {
|
|||
optional = true,
|
||||
event = "VeryLazy",
|
||||
opts = function(_, opts)
|
||||
table.insert(opts.sections.lualine_x, 2, require("lazyvim.util").lualine.cmp_source("codeium"))
|
||||
table.insert(opts.sections.lualine_x, 2, LazyVim.lualine.cmp_source("codeium"))
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
|
|
|||
125
lua/lazyvim/plugins/extras/coding/copilot-chat.lua
Normal file
125
lua/lazyvim/plugins/extras/coding/copilot-chat.lua
Normal file
|
|
@ -0,0 +1,125 @@
|
|||
return {
|
||||
{
|
||||
"CopilotC-Nvim/CopilotChat.nvim",
|
||||
branch = "canary",
|
||||
cmd = "CopilotChat",
|
||||
opts = function()
|
||||
local user = vim.env.USER or "User"
|
||||
user = user:sub(1, 1):upper() .. user:sub(2)
|
||||
return {
|
||||
model = "gpt-4",
|
||||
auto_insert_mode = true,
|
||||
show_help = true,
|
||||
question_header = " " .. user .. " ",
|
||||
answer_header = " Copilot ",
|
||||
window = {
|
||||
width = 0.4,
|
||||
},
|
||||
selection = function(source)
|
||||
local select = require("CopilotChat.select")
|
||||
return select.visual(source) or select.buffer(source)
|
||||
end,
|
||||
}
|
||||
end,
|
||||
keys = {
|
||||
{
|
||||
"<leader>aa",
|
||||
function()
|
||||
return require("CopilotChat").toggle()
|
||||
end,
|
||||
desc = "Toggle (CopilotChat)",
|
||||
mode = { "n", "v" },
|
||||
},
|
||||
{
|
||||
"<leader>ax",
|
||||
function()
|
||||
return require("CopilotChat").reset()
|
||||
end,
|
||||
desc = "Clear (CopilotChat)",
|
||||
mode = { "n", "v" },
|
||||
},
|
||||
{
|
||||
"<leader>aq",
|
||||
function()
|
||||
local input = vim.fn.input("Quick Chat: ")
|
||||
if input ~= "" then
|
||||
require("CopilotChat").ask(input)
|
||||
end
|
||||
end,
|
||||
desc = "Quick Chat (CopilotChat)",
|
||||
mode = { "n", "v" },
|
||||
},
|
||||
},
|
||||
config = function(_, opts)
|
||||
local chat = require("CopilotChat")
|
||||
require("CopilotChat.integrations.cmp").setup()
|
||||
|
||||
vim.api.nvim_create_autocmd("BufEnter", {
|
||||
pattern = "copilot-chat",
|
||||
callback = function()
|
||||
vim.opt_local.relativenumber = false
|
||||
vim.opt_local.number = false
|
||||
end,
|
||||
})
|
||||
|
||||
chat.setup(opts)
|
||||
end,
|
||||
},
|
||||
|
||||
{
|
||||
"folke/which-key.nvim",
|
||||
optional = true,
|
||||
opts = {
|
||||
defaults = {
|
||||
["<leader>a"] = { name = "+ai" },
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
-- Telescope integration
|
||||
{
|
||||
"nvim-telescope/telescope.nvim",
|
||||
optional = true,
|
||||
keys = {
|
||||
-- Show help actions with telescope
|
||||
{
|
||||
"<leader>ad",
|
||||
function()
|
||||
local actions = require("CopilotChat.actions")
|
||||
local help = actions.help_actions()
|
||||
if not help then
|
||||
LazyVim.warn("No diagnostics found on the current line")
|
||||
return
|
||||
end
|
||||
require("CopilotChat.integrations.telescope").pick(help)
|
||||
end,
|
||||
desc = "Diagnostic Help (CopilotChat)",
|
||||
mode = { "n", "v" },
|
||||
},
|
||||
-- Show prompts actions with telescope
|
||||
{
|
||||
"<leader>ap",
|
||||
function()
|
||||
local actions = require("CopilotChat.actions")
|
||||
require("CopilotChat.integrations.telescope").pick(actions.prompt_actions())
|
||||
end,
|
||||
desc = "Prompt Actions (CopilotChat)",
|
||||
mode = { "n", "v" },
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
-- Edgy integration
|
||||
{
|
||||
"folke/edgy.nvim",
|
||||
optional = true,
|
||||
opts = function(_, opts)
|
||||
opts.right = opts.right or {}
|
||||
table.insert(opts.right, {
|
||||
ft = "copilot-chat",
|
||||
title = "Copilot Chat",
|
||||
size = { width = 50 },
|
||||
})
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
return {
|
||||
|
||||
recommended = true,
|
||||
-- copilot
|
||||
{
|
||||
"zbirenbaum/copilot.lua",
|
||||
|
|
@ -19,12 +19,11 @@ return {
|
|||
optional = true,
|
||||
event = "VeryLazy",
|
||||
opts = function(_, opts)
|
||||
local Util = require("lazyvim.util")
|
||||
local colors = {
|
||||
[""] = Util.ui.fg("Special"),
|
||||
["Normal"] = Util.ui.fg("Special"),
|
||||
["Warning"] = Util.ui.fg("DiagnosticError"),
|
||||
["InProgress"] = Util.ui.fg("DiagnosticWarn"),
|
||||
[""] = LazyVim.ui.fg("Special"),
|
||||
["Normal"] = LazyVim.ui.fg("Special"),
|
||||
["Warning"] = LazyVim.ui.fg("DiagnosticError"),
|
||||
["InProgress"] = LazyVim.ui.fg("DiagnosticWarn"),
|
||||
}
|
||||
table.insert(opts.sections.lualine_x, 2, {
|
||||
function()
|
||||
|
|
@ -36,7 +35,7 @@ return {
|
|||
if not package.loaded["copilot"] then
|
||||
return
|
||||
end
|
||||
local ok, clients = pcall(require("lazyvim.util").lsp.get_clients, { name = "copilot", bufnr = 0 })
|
||||
local ok, clients = pcall(LazyVim.lsp.get_clients, { name = "copilot", bufnr = 0 })
|
||||
if not ok then
|
||||
return false
|
||||
end
|
||||
|
|
@ -66,7 +65,7 @@ return {
|
|||
copilot_cmp.setup(opts)
|
||||
-- attach cmp source whenever copilot attaches
|
||||
-- fixes lazy-loading issues with the copilot cmp source
|
||||
require("lazyvim.util").lsp.on_attach(function(client)
|
||||
LazyVim.lsp.on_attach(function(client)
|
||||
if client.name == "copilot" then
|
||||
copilot_cmp._on_insert_enter({})
|
||||
end
|
||||
|
|
|
|||
49
lua/lazyvim/plugins/extras/coding/luasnip.lua
Normal file
49
lua/lazyvim/plugins/extras/coding/luasnip.lua
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
return {
|
||||
{
|
||||
"L3MON4D3/LuaSnip",
|
||||
build = (not LazyVim.is_win())
|
||||
and "echo 'NOTE: jsregexp is optional, so not a big deal if it fails to build'; make install_jsregexp"
|
||||
or nil,
|
||||
dependencies = {
|
||||
{
|
||||
"rafamadriz/friendly-snippets",
|
||||
config = function()
|
||||
require("luasnip.loaders.from_vscode").lazy_load()
|
||||
end,
|
||||
},
|
||||
{
|
||||
"nvim-cmp",
|
||||
dependencies = {
|
||||
"saadparwaiz1/cmp_luasnip",
|
||||
},
|
||||
opts = function(_, opts)
|
||||
opts.snippet = {
|
||||
expand = function(args)
|
||||
require("luasnip").lsp_expand(args.body)
|
||||
end,
|
||||
}
|
||||
table.insert(opts.sources, { name = "luasnip" })
|
||||
end,
|
||||
},
|
||||
},
|
||||
opts = {
|
||||
history = true,
|
||||
delete_check_events = "TextChanged",
|
||||
},
|
||||
},
|
||||
{
|
||||
"nvim-cmp",
|
||||
-- stylua: ignore
|
||||
keys = {
|
||||
{
|
||||
"<tab>",
|
||||
function()
|
||||
return require("luasnip").jumpable(1) and "<Plug>luasnip-jump-next" or "<tab>"
|
||||
end,
|
||||
expr = true, silent = true, mode = "i",
|
||||
},
|
||||
{ "<tab>", function() require("luasnip").jump(1) end, mode = "s" },
|
||||
{ "<s-tab>", function() require("luasnip").jump(-1) end, mode = { "i", "s" } },
|
||||
},
|
||||
},
|
||||
}
|
||||
20
lua/lazyvim/plugins/extras/coding/mini-comment.lua
Normal file
20
lua/lazyvim/plugins/extras/coding/mini-comment.lua
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
return {
|
||||
{
|
||||
"echasnovski/mini.comment",
|
||||
event = "VeryLazy",
|
||||
opts = {
|
||||
options = {
|
||||
custom_commentstring = function()
|
||||
return require("ts_context_commentstring.internal").calculate_commentstring() or vim.bo.commentstring
|
||||
end,
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"JoosepAlviste/nvim-ts-context-commentstring",
|
||||
lazy = true,
|
||||
opts = {
|
||||
enable_autocmd = false,
|
||||
},
|
||||
},
|
||||
}
|
||||
36
lua/lazyvim/plugins/extras/coding/mini-surround.lua
Normal file
36
lua/lazyvim/plugins/extras/coding/mini-surround.lua
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
-- Fast and feature-rich surround actions. For text that includes
|
||||
-- surrounding characters like brackets or quotes, this allows you
|
||||
-- to select the text inside, change or modify the surrounding characters,
|
||||
-- and more.
|
||||
return {
|
||||
"echasnovski/mini.surround",
|
||||
recommended = true,
|
||||
keys = function(_, keys)
|
||||
-- Populate the keys based on the user's options
|
||||
local opts = LazyVim.opts("mini.surround")
|
||||
local mappings = {
|
||||
{ opts.mappings.add, desc = "Add Surrounding", mode = { "n", "v" } },
|
||||
{ opts.mappings.delete, desc = "Delete Surrounding" },
|
||||
{ opts.mappings.find, desc = "Find Right Surrounding" },
|
||||
{ opts.mappings.find_left, desc = "Find Left Surrounding" },
|
||||
{ opts.mappings.highlight, desc = "Highlight Surrounding" },
|
||||
{ opts.mappings.replace, desc = "Replace Surrounding" },
|
||||
{ opts.mappings.update_n_lines, desc = "Update `MiniSurround.config.n_lines`" },
|
||||
}
|
||||
mappings = vim.tbl_filter(function(m)
|
||||
return m[1] and #m[1] > 0
|
||||
end, mappings)
|
||||
return vim.list_extend(mappings, keys)
|
||||
end,
|
||||
opts = {
|
||||
mappings = {
|
||||
add = "gsa", -- Add surrounding in Normal and Visual modes
|
||||
delete = "gsd", -- Delete surrounding
|
||||
find = "gsf", -- Find surrounding (to the right)
|
||||
find_left = "gsF", -- Find surrounding (to the left)
|
||||
highlight = "gsh", -- Highlight surrounding
|
||||
replace = "gsr", -- Replace surrounding
|
||||
update_n_lines = "gsn", -- Update `n_lines`
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
@ -1,5 +1,3 @@
|
|||
local Util = require("lazyvim.util")
|
||||
|
||||
return {
|
||||
-- Tabnine cmp source
|
||||
{
|
||||
|
|
@ -8,7 +6,7 @@ return {
|
|||
{
|
||||
"tzachar/cmp-tabnine",
|
||||
build = {
|
||||
Util.is_win() and "pwsh -noni .\\install.ps1" or "./install.sh",
|
||||
LazyVim.is_win() and "pwsh -noni .\\install.ps1" or "./install.sh",
|
||||
":CmpTabnineHub",
|
||||
},
|
||||
dependencies = "hrsh7th/nvim-cmp",
|
||||
|
|
@ -30,7 +28,7 @@ return {
|
|||
priority = 100,
|
||||
})
|
||||
|
||||
opts.formatting.format = Util.inject.args(opts.formatting.format, function(entry, item)
|
||||
opts.formatting.format = LazyVim.inject.args(opts.formatting.format, function(entry, item)
|
||||
-- Hide percentage in the menu
|
||||
if entry.source.name == "cmp_tabnine" then
|
||||
item.menu = ""
|
||||
|
|
@ -45,7 +43,7 @@ return {
|
|||
event = "VeryLazy",
|
||||
opts = function(_, opts)
|
||||
local icon = require("lazyvim.config").icons.kinds.TabNine
|
||||
table.insert(opts.sections.lualine_x, 2, require("lazyvim.util").lualine.cmp_source("cmp_tabnine", icon))
|
||||
table.insert(opts.sections.lualine_x, 2, LazyVim.lualine.cmp_source("cmp_tabnine", icon))
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,32 +1,31 @@
|
|||
-- better yank/paste
|
||||
return {
|
||||
-- better yank/paste
|
||||
{
|
||||
"gbprod/yanky.nvim",
|
||||
dependencies = { { "kkharji/sqlite.lua", enabled = not jit.os:find("Windows") } },
|
||||
opts = {
|
||||
highlight = { timer = 250 },
|
||||
ring = { storage = jit.os:find("Windows") and "shada" or "sqlite" },
|
||||
},
|
||||
keys = {
|
||||
"gbprod/yanky.nvim",
|
||||
recommended = true,
|
||||
desc = "Better Yank/Paste",
|
||||
event = "LazyFile",
|
||||
opts = {
|
||||
highlight = { timer = 150 },
|
||||
},
|
||||
keys = {
|
||||
-- stylua: ignore
|
||||
{ "<leader>p", function() require("telescope").extensions.yank_history.yank_history({ }) end, desc = "Open Yank History" },
|
||||
{ "y", "<Plug>(YankyYank)", mode = { "n", "x" }, desc = "Yank text" },
|
||||
{ "p", "<Plug>(YankyPutAfter)", mode = { "n", "x" }, desc = "Put yanked text after cursor" },
|
||||
{ "P", "<Plug>(YankyPutBefore)", mode = { "n", "x" }, desc = "Put yanked text before cursor" },
|
||||
{ "gp", "<Plug>(YankyGPutAfter)", mode = { "n", "x" }, desc = "Put yanked text after selection" },
|
||||
{ "gP", "<Plug>(YankyGPutBefore)", mode = { "n", "x" }, desc = "Put yanked text before selection" },
|
||||
{ "[y", "<Plug>(YankyCycleForward)", desc = "Cycle forward through yank history" },
|
||||
{ "]y", "<Plug>(YankyCycleBackward)", desc = "Cycle backward through yank history" },
|
||||
{ "]p", "<Plug>(YankyPutIndentAfterLinewise)", desc = "Put indented after cursor (linewise)" },
|
||||
{ "[p", "<Plug>(YankyPutIndentBeforeLinewise)", desc = "Put indented before cursor (linewise)" },
|
||||
{ "]P", "<Plug>(YankyPutIndentAfterLinewise)", desc = "Put indented after cursor (linewise)" },
|
||||
{ "[P", "<Plug>(YankyPutIndentBeforeLinewise)", desc = "Put indented before cursor (linewise)" },
|
||||
{ ">p", "<Plug>(YankyPutIndentAfterShiftRight)", desc = "Put and indent right" },
|
||||
{ "<p", "<Plug>(YankyPutIndentAfterShiftLeft)", desc = "Put and indent left" },
|
||||
{ ">P", "<Plug>(YankyPutIndentBeforeShiftRight)", desc = "Put before and indent right" },
|
||||
{ "<P", "<Plug>(YankyPutIndentBeforeShiftLeft)", desc = "Put before and indent left" },
|
||||
{ "=p", "<Plug>(YankyPutAfterFilter)", desc = "Put after applying a filter" },
|
||||
{ "=P", "<Plug>(YankyPutBeforeFilter)", desc = "Put before applying a filter" },
|
||||
},
|
||||
{ "y", "<Plug>(YankyYank)", mode = { "n", "x" }, desc = "Yank Text" },
|
||||
{ "p", "<Plug>(YankyPutAfter)", mode = { "n", "x" }, desc = "Put Yanked Text After Cursor" },
|
||||
{ "P", "<Plug>(YankyPutBefore)", mode = { "n", "x" }, desc = "Put Yanked Text Before Cursor" },
|
||||
{ "gp", "<Plug>(YankyGPutAfter)", mode = { "n", "x" }, desc = "Put Yanked Text After Selection" },
|
||||
{ "gP", "<Plug>(YankyGPutBefore)", mode = { "n", "x" }, desc = "Put Yanked Text Before Selection" },
|
||||
{ "[y", "<Plug>(YankyCycleForward)", desc = "Cycle Forward Through Yank History" },
|
||||
{ "]y", "<Plug>(YankyCycleBackward)", desc = "Cycle Backward Through Yank History" },
|
||||
{ "]p", "<Plug>(YankyPutIndentAfterLinewise)", desc = "Put Indented After Cursor (Linewise)" },
|
||||
{ "[p", "<Plug>(YankyPutIndentBeforeLinewise)", desc = "Put Indented Before Cursor (Linewise)" },
|
||||
{ "]P", "<Plug>(YankyPutIndentAfterLinewise)", desc = "Put Indented After Cursor (Linewise)" },
|
||||
{ "[P", "<Plug>(YankyPutIndentBeforeLinewise)", desc = "Put Indented Before Cursor (Linewise)" },
|
||||
{ ">p", "<Plug>(YankyPutIndentAfterShiftRight)", desc = "Put and Indent Right" },
|
||||
{ "<p", "<Plug>(YankyPutIndentAfterShiftLeft)", desc = "Put and Indent Left" },
|
||||
{ ">P", "<Plug>(YankyPutIndentBeforeShiftRight)", desc = "Put Before and Indent Right" },
|
||||
{ "<P", "<Plug>(YankyPutIndentBeforeShiftLeft)", desc = "Put Before and Indent Left" },
|
||||
{ "=p", "<Plug>(YankyPutAfterFilter)", desc = "Put After Applying a Filter" },
|
||||
{ "=P", "<Plug>(YankyPutBeforeFilter)", desc = "Put Before Applying a Filter" },
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,12 +12,15 @@ end
|
|||
|
||||
return {
|
||||
"mfussenegger/nvim-dap",
|
||||
recommended = true,
|
||||
desc = "Debugging support. Requires language specific adapters to be configured. (see lang extras)",
|
||||
|
||||
dependencies = {
|
||||
|
||||
-- fancy UI for the debugger
|
||||
{
|
||||
"rcarriga/nvim-dap-ui",
|
||||
dependencies = { "nvim-neotest/nvim-nio" },
|
||||
-- stylua: ignore
|
||||
keys = {
|
||||
{ "<leader>du", function() require("dapui").toggle({ }) end, desc = "Dap UI" },
|
||||
|
|
@ -25,8 +28,6 @@ return {
|
|||
},
|
||||
opts = {},
|
||||
config = function(_, opts)
|
||||
-- setup dap config by VsCode launch.json file
|
||||
-- require("dap.ext.vscode").load_launchjs()
|
||||
local dap = require("dap")
|
||||
local dapui = require("dapui")
|
||||
dapui.setup(opts)
|
||||
|
|
@ -89,7 +90,7 @@ return {
|
|||
{ "<leader>dc", function() require("dap").continue() end, desc = "Continue" },
|
||||
{ "<leader>da", function() require("dap").continue({ before = get_args }) end, desc = "Run with Args" },
|
||||
{ "<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>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" },
|
||||
|
|
@ -114,5 +115,18 @@ return {
|
|||
{ text = sign[1], texthl = sign[2] or "DiagnosticInfo", linehl = sign[3], numhl = sign[3] }
|
||||
)
|
||||
end
|
||||
|
||||
-- setup dap config by VsCode launch.json file
|
||||
local vscode = require("dap.ext.vscode")
|
||||
local _filetypes = require("mason-nvim-dap.mappings.filetypes")
|
||||
local filetypes = vim.tbl_deep_extend("force", _filetypes, {
|
||||
["node"] = { "javascriptreact", "typescriptreact", "typescript", "javascript" },
|
||||
["pwa-node"] = { "javascriptreact", "typescriptreact", "typescript", "javascript" },
|
||||
})
|
||||
local json = require("plenary.json")
|
||||
vscode.json_decode = function(str)
|
||||
return vim.json.decode(json.json_strip_comments(str))
|
||||
end
|
||||
vscode.load_launchjs(nil, filetypes)
|
||||
end,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
local Config = require("lazyvim.config")
|
||||
local Util = require("lazyvim.util")
|
||||
|
||||
return {
|
||||
desc = "Aerial Symbol Browser",
|
||||
|
|
@ -50,12 +49,20 @@ return {
|
|||
},
|
||||
},
|
||||
|
||||
{
|
||||
"folke/trouble.nvim",
|
||||
optional = true,
|
||||
keys = {
|
||||
{ "<leader>cs", false },
|
||||
},
|
||||
},
|
||||
|
||||
-- Telescope integration
|
||||
{
|
||||
"nvim-telescope/telescope.nvim",
|
||||
optional = true,
|
||||
opts = function()
|
||||
Util.on_load("telescope.nvim", function()
|
||||
LazyVim.on_load("telescope.nvim", function()
|
||||
require("telescope").load_extension("aerial")
|
||||
end)
|
||||
end,
|
||||
|
|
@ -73,11 +80,11 @@ return {
|
|||
"folke/edgy.nvim",
|
||||
optional = true,
|
||||
opts = function(_, opts)
|
||||
local edgy_idx = Util.plugin.extra_idx("ui.edgy")
|
||||
local aerial_idx = Util.plugin.extra_idx("editor.aerial")
|
||||
local edgy_idx = LazyVim.plugin.extra_idx("ui.edgy")
|
||||
local aerial_idx = LazyVim.plugin.extra_idx("editor.aerial")
|
||||
|
||||
if edgy_idx and edgy_idx > aerial_idx then
|
||||
Util.warn("The `edgy.nvim` extra must be **imported** before the `aerial.nvim` extra to work properly.", {
|
||||
LazyVim.warn("The `edgy.nvim` extra must be **imported** before the `aerial.nvim` extra to work properly.", {
|
||||
title = "LazyVim",
|
||||
})
|
||||
end
|
||||
|
|
|
|||
175
lua/lazyvim/plugins/extras/editor/dial.lua
Normal file
175
lua/lazyvim/plugins/extras/editor/dial.lua
Normal file
|
|
@ -0,0 +1,175 @@
|
|||
local M = {}
|
||||
---@type table<string, table<string, string[]>>
|
||||
M.dials_by_ft = {}
|
||||
|
||||
---@param increment boolean
|
||||
---@param g? boolean
|
||||
function M.dial(increment, g)
|
||||
local mode = vim.fn.mode(true)
|
||||
-- Use visual commands for VISUAL 'v', VISUAL LINE 'V' and VISUAL BLOCK '\22'
|
||||
local is_visual = mode == "v" or mode == "V" or mode == "\22"
|
||||
local func = (increment and "inc" or "dec") .. (g and "_g" or "_") .. (is_visual and "visual" or "normal")
|
||||
local group = M.dials_by_ft[vim.bo.filetype] or "default"
|
||||
return require("dial.map")[func](group)
|
||||
end
|
||||
|
||||
return {
|
||||
"monaqa/dial.nvim",
|
||||
recommended = true,
|
||||
desc = "Increment and decrement numbers, dates, and more",
|
||||
-- stylua: ignore
|
||||
keys = {
|
||||
{ "<C-a>", function() return M.dial(true) end, expr = true, desc = "Increment", mode = {"n", "v"} },
|
||||
{ "<C-x>", function() return M.dial(false) end, expr = true, desc = "Decrement", mode = {"n", "v"} },
|
||||
{ "g<C-a>", function() return M.dial(true, true) end, expr = true, desc = "Increment", mode = {"n", "v"} },
|
||||
{ "g<C-x>", function() return M.dial(false, true) end, expr = true, desc = "Decrement", mode = {"n", "v"} },
|
||||
},
|
||||
opts = function()
|
||||
local augend = require("dial.augend")
|
||||
|
||||
local logical_alias = augend.constant.new({
|
||||
elements = { "&&", "||" },
|
||||
word = false,
|
||||
cyclic = true,
|
||||
})
|
||||
|
||||
local ordinal_numbers = augend.constant.new({
|
||||
-- elements through which we cycle. When we increment, we go down
|
||||
-- On decrement we go up
|
||||
elements = {
|
||||
"first",
|
||||
"second",
|
||||
"third",
|
||||
"fourth",
|
||||
"fifth",
|
||||
"sixth",
|
||||
"seventh",
|
||||
"eighth",
|
||||
"ninth",
|
||||
"tenth",
|
||||
},
|
||||
-- if true, it only matches strings with word boundary. firstDate wouldn't work for example
|
||||
word = false,
|
||||
-- do we cycle back and forth (tenth to first on increment, first to tenth on decrement).
|
||||
-- Otherwise nothing will happen when there are no further values
|
||||
cyclic = true,
|
||||
})
|
||||
|
||||
local weekdays = augend.constant.new({
|
||||
elements = {
|
||||
"Monday",
|
||||
"Tuesday",
|
||||
"Wednesday",
|
||||
"Thursday",
|
||||
"Friday",
|
||||
"Saturday",
|
||||
"Sunday",
|
||||
},
|
||||
word = true,
|
||||
cyclic = true,
|
||||
})
|
||||
|
||||
local months = augend.constant.new({
|
||||
elements = {
|
||||
"January",
|
||||
"February",
|
||||
"March",
|
||||
"April",
|
||||
"May",
|
||||
"June",
|
||||
"July",
|
||||
"August",
|
||||
"September",
|
||||
"October",
|
||||
"November",
|
||||
"December",
|
||||
},
|
||||
word = true,
|
||||
cyclic = true,
|
||||
})
|
||||
|
||||
local capitalized_boolean = augend.constant.new({
|
||||
elements = {
|
||||
"True",
|
||||
"False",
|
||||
},
|
||||
word = true,
|
||||
cyclic = true,
|
||||
})
|
||||
|
||||
return {
|
||||
dials_by_ft = {
|
||||
css = "css",
|
||||
javascript = "typescript",
|
||||
javascriptreact = "typescript",
|
||||
json = "json",
|
||||
lua = "lua",
|
||||
markdown = "markdown",
|
||||
python = "python",
|
||||
sass = "css",
|
||||
scss = "css",
|
||||
typescript = "typescript",
|
||||
typescriptreact = "typescript",
|
||||
},
|
||||
groups = {
|
||||
default = {
|
||||
augend.integer.alias.decimal, -- nonnegative decimal number (0, 1, 2, 3, ...)
|
||||
augend.integer.alias.hex, -- nonnegative hex number (0x01, 0x1a1f, etc.)
|
||||
augend.date.alias["%Y/%m/%d"], -- date (2022/02/19, etc.)
|
||||
},
|
||||
typescript = {
|
||||
augend.integer.alias.decimal, -- nonnegative and negative decimal number
|
||||
augend.constant.alias.bool, -- boolean value (true <-> false)
|
||||
logical_alias,
|
||||
augend.constant.new({ elements = { "let", "const" } }),
|
||||
ordinal_numbers,
|
||||
weekdays,
|
||||
months,
|
||||
},
|
||||
css = {
|
||||
augend.integer.alias.decimal, -- nonnegative and negative decimal number
|
||||
augend.hexcolor.new({
|
||||
case = "lower",
|
||||
}),
|
||||
augend.hexcolor.new({
|
||||
case = "upper",
|
||||
}),
|
||||
},
|
||||
markdown = {
|
||||
augend.misc.alias.markdown_header,
|
||||
ordinal_numbers,
|
||||
weekdays,
|
||||
months,
|
||||
},
|
||||
json = {
|
||||
augend.integer.alias.decimal, -- nonnegative and negative decimal number
|
||||
augend.semver.alias.semver, -- versioning (v1.1.2)
|
||||
},
|
||||
lua = {
|
||||
augend.integer.alias.decimal, -- nonnegative and negative decimal number
|
||||
augend.constant.alias.bool, -- boolean value (true <-> false)
|
||||
augend.constant.new({
|
||||
elements = { "and", "or" },
|
||||
word = true, -- if false, "sand" is incremented into "sor", "doctor" into "doctand", etc.
|
||||
cyclic = true, -- "or" is incremented into "and".
|
||||
}),
|
||||
ordinal_numbers,
|
||||
weekdays,
|
||||
months,
|
||||
},
|
||||
python = {
|
||||
augend.integer.alias.decimal, -- nonnegative and negative decimal number
|
||||
capitalized_boolean,
|
||||
logical_alias,
|
||||
ordinal_numbers,
|
||||
weekdays,
|
||||
months,
|
||||
},
|
||||
},
|
||||
}
|
||||
end,
|
||||
config = function(_, opts)
|
||||
require("dial.config").augends:register_group(opts.groups)
|
||||
M.dials_by_ft = opts.dials_by_ft
|
||||
end,
|
||||
}
|
||||
42
lua/lazyvim/plugins/extras/editor/harpoon2.lua
Normal file
42
lua/lazyvim/plugins/extras/editor/harpoon2.lua
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
return {
|
||||
"ThePrimeagen/harpoon",
|
||||
branch = "harpoon2",
|
||||
opts = {
|
||||
menu = {
|
||||
width = vim.api.nvim_win_get_width(0) - 4,
|
||||
},
|
||||
settings = {
|
||||
save_on_toggle = true,
|
||||
},
|
||||
},
|
||||
keys = function()
|
||||
local keys = {
|
||||
{
|
||||
"<leader>H",
|
||||
function()
|
||||
require("harpoon"):list():add()
|
||||
end,
|
||||
desc = "Harpoon File",
|
||||
},
|
||||
{
|
||||
"<leader>h",
|
||||
function()
|
||||
local harpoon = require("harpoon")
|
||||
harpoon.ui:toggle_quick_menu(harpoon:list())
|
||||
end,
|
||||
desc = "Harpoon Quick Menu",
|
||||
},
|
||||
}
|
||||
|
||||
for i = 1, 5 do
|
||||
table.insert(keys, {
|
||||
"<leader>" .. i,
|
||||
function()
|
||||
require("harpoon"):list():select(i)
|
||||
end,
|
||||
desc = "Harpoon to File " .. i,
|
||||
})
|
||||
end
|
||||
return keys
|
||||
end,
|
||||
}
|
||||
45
lua/lazyvim/plugins/extras/editor/illuminate.lua
Normal file
45
lua/lazyvim/plugins/extras/editor/illuminate.lua
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
-- Automatically highlights other instances of the word under your cursor.
|
||||
-- This works with LSP, Treesitter, and regexp matching to find the other
|
||||
-- instances.
|
||||
return {
|
||||
{
|
||||
"RRethy/vim-illuminate",
|
||||
event = "LazyFile",
|
||||
opts = {
|
||||
delay = 200,
|
||||
large_file_cutoff = 2000,
|
||||
large_file_overrides = {
|
||||
providers = { "lsp" },
|
||||
},
|
||||
},
|
||||
config = function(_, opts)
|
||||
require("illuminate").configure(opts)
|
||||
|
||||
local function map(key, dir, buffer)
|
||||
vim.keymap.set("n", key, function()
|
||||
require("illuminate")["goto_" .. dir .. "_reference"](false)
|
||||
end, { desc = dir:sub(1, 1):upper() .. dir:sub(2) .. " Reference", buffer = buffer })
|
||||
end
|
||||
|
||||
map("]]", "next")
|
||||
map("[[", "prev")
|
||||
|
||||
-- also set it after loading ftplugins, since a lot overwrite [[ and ]]
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
callback = function()
|
||||
local buffer = vim.api.nvim_get_current_buf()
|
||||
map("]]", "next", buffer)
|
||||
map("[[", "prev", buffer)
|
||||
end,
|
||||
})
|
||||
end,
|
||||
keys = {
|
||||
{ "]]", desc = "Next Reference" },
|
||||
{ "[[", desc = "Prev Reference" },
|
||||
},
|
||||
},
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
opts = { document_highlight = { enabled = false } },
|
||||
},
|
||||
}
|
||||
38
lua/lazyvim/plugins/extras/editor/inc-rename.lua
Normal file
38
lua/lazyvim/plugins/extras/editor/inc-rename.lua
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
return {
|
||||
|
||||
-- Rename with cmdpreview
|
||||
recommended = true,
|
||||
desc = "Incremental LSP renaming based on Neovim's command-preview feature",
|
||||
{
|
||||
"smjonas/inc-rename.nvim",
|
||||
cmd = "IncRename",
|
||||
opts = {},
|
||||
},
|
||||
|
||||
-- LSP Keymaps
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
opts = function()
|
||||
local keys = require("lazyvim.plugins.lsp.keymaps").get()
|
||||
keys[#keys + 1] = {
|
||||
"<leader>cr",
|
||||
function()
|
||||
local inc_rename = require("inc_rename")
|
||||
return ":" .. inc_rename.config.cmd_name .. " " .. vim.fn.expand("<cword>")
|
||||
end,
|
||||
expr = true,
|
||||
desc = "Rename (inc-rename.nvim)",
|
||||
has = "rename",
|
||||
}
|
||||
end,
|
||||
},
|
||||
|
||||
--- Noice integration
|
||||
{
|
||||
"folke/noice.nvim",
|
||||
optional = true,
|
||||
opts = {
|
||||
presets = { inc_rename = true },
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
@ -20,9 +20,9 @@ return {
|
|||
"ggandor/leap.nvim",
|
||||
enabled = true,
|
||||
keys = {
|
||||
{ "s", mode = { "n", "x", "o" }, desc = "Leap forward to" },
|
||||
{ "S", mode = { "n", "x", "o" }, desc = "Leap backward to" },
|
||||
{ "gs", mode = { "n", "x", "o" }, desc = "Leap from windows" },
|
||||
{ "s", mode = { "n", "x", "o" }, desc = "Leap Forward to" },
|
||||
{ "S", mode = { "n", "x", "o" }, desc = "Leap Backward to" },
|
||||
{ "gs", mode = { "n", "x", "o" }, desc = "Leap from Windows" },
|
||||
},
|
||||
config = function(_, opts)
|
||||
local leap = require("leap")
|
||||
|
|
@ -38,6 +38,7 @@ return {
|
|||
-- rename surround mappings from gs to gz to prevent conflict with leap
|
||||
{
|
||||
"echasnovski/mini.surround",
|
||||
optional = true,
|
||||
opts = {
|
||||
mappings = {
|
||||
add = "gza", -- Add surrounding in Normal and Visual modes
|
||||
|
|
@ -50,6 +51,15 @@ return {
|
|||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"folke/which-key.nvim",
|
||||
optional = true,
|
||||
opts = {
|
||||
defaults = {
|
||||
["gz"] = { name = "+surround" },
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
-- makes some plugins dot-repeatable like leap
|
||||
{ "tpope/vim-repeat", event = "VeryLazy" },
|
||||
|
|
|
|||
54
lua/lazyvim/plugins/extras/editor/mini-diff.lua
Normal file
54
lua/lazyvim/plugins/extras/editor/mini-diff.lua
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
return {
|
||||
-- disable gitsigns.nvim
|
||||
{
|
||||
"lewis6991/gitsigns.nvim",
|
||||
enabled = false,
|
||||
},
|
||||
|
||||
-- setup mini.diff
|
||||
{
|
||||
"echasnovski/mini.diff",
|
||||
event = "VeryLazy",
|
||||
keys = {
|
||||
{
|
||||
"<leader>go",
|
||||
function()
|
||||
require("mini.diff").toggle_overlay(0)
|
||||
end,
|
||||
desc = "Toggle mini.diff overlay",
|
||||
},
|
||||
},
|
||||
opts = {
|
||||
view = {
|
||||
style = "sign",
|
||||
signs = {
|
||||
add = "▎",
|
||||
change = "▎",
|
||||
delete = "",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
-- lualine integration
|
||||
{
|
||||
"nvim-lualine/lualine.nvim",
|
||||
opts = function(_, opts)
|
||||
local x = opts.sections.lualine_x
|
||||
for _, comp in ipairs(x) do
|
||||
if comp[1] == "diff" then
|
||||
comp.source = function()
|
||||
local summary = vim.b.minidiff_summary
|
||||
return summary
|
||||
and {
|
||||
added = summary.add,
|
||||
modified = summary.change,
|
||||
removed = summary.delete,
|
||||
}
|
||||
end
|
||||
break
|
||||
end
|
||||
end
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
|
@ -18,12 +18,12 @@ return {
|
|||
function()
|
||||
require("mini.files").open(vim.api.nvim_buf_get_name(0), true)
|
||||
end,
|
||||
desc = "Open mini.files (directory of current file)",
|
||||
desc = "Open mini.files (Directory of Current File)",
|
||||
},
|
||||
{
|
||||
"<leader>fM",
|
||||
function()
|
||||
require("mini.files").open(vim.loop.cwd(), true)
|
||||
require("mini.files").open(vim.uv.cwd(), true)
|
||||
end,
|
||||
desc = "Open mini.files (cwd)",
|
||||
},
|
||||
|
|
@ -50,14 +50,14 @@ return {
|
|||
callback = function(args)
|
||||
local buf_id = args.data.buf_id
|
||||
-- Tweak left-hand side of mapping to your liking
|
||||
vim.keymap.set("n", "g.", toggle_dotfiles, { buffer = buf_id })
|
||||
vim.keymap.set("n", "g.", toggle_dotfiles, { buffer = buf_id, desc = "Toggle Hidden Files" })
|
||||
end,
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd("User", {
|
||||
pattern = "MiniFilesActionRename",
|
||||
callback = function(event)
|
||||
require("lazyvim.util").lsp.on_rename(event.data.from, event.data.to)
|
||||
LazyVim.lsp.on_rename(event.data.from, event.data.to)
|
||||
end,
|
||||
})
|
||||
end,
|
||||
|
|
|
|||
7
lua/lazyvim/plugins/extras/editor/mini-move.lua
Normal file
7
lua/lazyvim/plugins/extras/editor/mini-move.lua
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
return {
|
||||
{
|
||||
"echasnovski/mini.move",
|
||||
event = "VeryLazy",
|
||||
opts = {},
|
||||
},
|
||||
}
|
||||
|
|
@ -7,7 +7,7 @@ return {
|
|||
lazy = true,
|
||||
init = function()
|
||||
vim.g.navic_silence = true
|
||||
require("lazyvim.util").lsp.on_attach(function(client, buffer)
|
||||
LazyVim.lsp.on_attach(function(client, buffer)
|
||||
if client.supports_method("textDocument/documentSymbol") then
|
||||
require("nvim-navic").attach(client, buffer)
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,13 +1,19 @@
|
|||
local Util = require("lazyvim.util")
|
||||
|
||||
return {
|
||||
-- Disable `<leader>cs` keymap so it doesn't conflict with `outline.nvim`
|
||||
{
|
||||
"simrat39/symbols-outline.nvim",
|
||||
keys = { { "<leader>cs", "<cmd>SymbolsOutline<cr>", desc = "Symbols Outline" } },
|
||||
cmd = "SymbolsOutline",
|
||||
"folke/trouble.nvim",
|
||||
optional = true,
|
||||
keys = {
|
||||
{ "<leader>cs", false },
|
||||
},
|
||||
},
|
||||
{
|
||||
"hedyhli/outline.nvim",
|
||||
keys = { { "<leader>cs", "<cmd>Outline<cr>", desc = "Toggle Outline" } },
|
||||
cmd = "Outline",
|
||||
opts = function()
|
||||
local Config = require("lazyvim.config")
|
||||
local defaults = require("symbols-outline.config").defaults
|
||||
local defaults = require("outline.config").defaults
|
||||
local opts = {
|
||||
symbols = {},
|
||||
symbol_blacklist = {},
|
||||
|
|
@ -37,24 +43,22 @@ return {
|
|||
"folke/edgy.nvim",
|
||||
optional = true,
|
||||
opts = function(_, opts)
|
||||
local edgy_idx = Util.plugin.extra_idx("ui.edgy")
|
||||
local symbols_idx = Util.plugin.extra_idx("editor.symbols-outline")
|
||||
local edgy_idx = LazyVim.plugin.extra_idx("ui.edgy")
|
||||
local symbols_idx = LazyVim.plugin.extra_idx("editor.outline")
|
||||
|
||||
if edgy_idx and edgy_idx > symbols_idx then
|
||||
Util.warn(
|
||||
"The `edgy.nvim` extra must be **imported** before the `symbols-outline.nvim` extra to work properly.",
|
||||
{
|
||||
title = "LazyVim",
|
||||
}
|
||||
LazyVim.warn(
|
||||
"The `edgy.nvim` extra must be **imported** before the `outline.nvim` extra to work properly.",
|
||||
{ title = "LazyVim" }
|
||||
)
|
||||
end
|
||||
|
||||
opts.right = opts.right or {}
|
||||
table.insert(opts.right, {
|
||||
title = "Symbols Outline",
|
||||
title = "Outline",
|
||||
ft = "Outline",
|
||||
pinned = true,
|
||||
open = "SymbolsOutline",
|
||||
open = "Outline",
|
||||
})
|
||||
end,
|
||||
},
|
||||
138
lua/lazyvim/plugins/extras/editor/refactoring.lua
Normal file
138
lua/lazyvim/plugins/extras/editor/refactoring.lua
Normal file
|
|
@ -0,0 +1,138 @@
|
|||
return {
|
||||
{
|
||||
"ThePrimeagen/refactoring.nvim",
|
||||
event = { "BufReadPre", "BufNewFile" },
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
},
|
||||
keys = {
|
||||
{
|
||||
"<leader>rs",
|
||||
function()
|
||||
require("telescope").extensions.refactoring.refactors()
|
||||
end,
|
||||
mode = "v",
|
||||
desc = "Refactor",
|
||||
},
|
||||
{
|
||||
"<leader>ri",
|
||||
function()
|
||||
require("refactoring").refactor("Inline Variable")
|
||||
end,
|
||||
mode = { "n", "v" },
|
||||
desc = "Inline Variable",
|
||||
},
|
||||
{
|
||||
"<leader>rb",
|
||||
function()
|
||||
require("refactoring").refactor("Extract Block")
|
||||
end,
|
||||
desc = "Extract Block",
|
||||
},
|
||||
{
|
||||
"<leader>rf",
|
||||
function()
|
||||
require("refactoring").refactor("Extract Block To File")
|
||||
end,
|
||||
desc = "Extract Block To File",
|
||||
},
|
||||
{
|
||||
"<leader>rP",
|
||||
function()
|
||||
require("refactoring").debug.printf({ below = false })
|
||||
end,
|
||||
desc = "Debug Print",
|
||||
},
|
||||
{
|
||||
"<leader>rp",
|
||||
function()
|
||||
require("refactoring").debug.print_var({ normal = true })
|
||||
end,
|
||||
desc = "Debug Print Variable",
|
||||
},
|
||||
{
|
||||
"<leader>rc",
|
||||
function()
|
||||
require("refactoring").debug.cleanup({})
|
||||
end,
|
||||
desc = "Debug Cleanup",
|
||||
},
|
||||
{
|
||||
"<leader>rf",
|
||||
function()
|
||||
require("refactoring").refactor("Extract Function")
|
||||
end,
|
||||
mode = "v",
|
||||
desc = "Extract Function",
|
||||
},
|
||||
{
|
||||
"<leader>rF",
|
||||
function()
|
||||
require("refactoring").refactor("Extract Function To File")
|
||||
end,
|
||||
mode = "v",
|
||||
desc = "Extract Function To File",
|
||||
},
|
||||
{
|
||||
"<leader>rx",
|
||||
function()
|
||||
require("refactoring").refactor("Extract Variable")
|
||||
end,
|
||||
mode = "v",
|
||||
desc = "Extract Variable",
|
||||
},
|
||||
{
|
||||
"<leader>rp",
|
||||
function()
|
||||
require("refactoring").debug.print_var()
|
||||
end,
|
||||
mode = "v",
|
||||
desc = "Debug Print Variable",
|
||||
},
|
||||
},
|
||||
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,
|
||||
},
|
||||
|
||||
-- which key integration
|
||||
{
|
||||
"folke/which-key.nvim",
|
||||
optional = true,
|
||||
opts = {
|
||||
defaults = {
|
||||
["<leader>r"] = { name = "+refactor" },
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
56
lua/lazyvim/plugins/extras/lang/angular.lua
Normal file
56
lua/lazyvim/plugins/extras/lang/angular.lua
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
return {
|
||||
recommended = function()
|
||||
return LazyVim.extras.wants({
|
||||
root = {
|
||||
"angular.json",
|
||||
"nx.json", --support for nx workspace
|
||||
},
|
||||
})
|
||||
end,
|
||||
|
||||
{
|
||||
"nvim-treesitter",
|
||||
opts = function(_, opts)
|
||||
if type(opts.ensure_installed) == "table" then
|
||||
vim.list_extend(opts.ensure_installed, { "angular", "scss" })
|
||||
end
|
||||
end,
|
||||
},
|
||||
|
||||
-- angularls depends on typescript
|
||||
{ import = "lazyvim.plugins.extras.lang.typescript" },
|
||||
|
||||
-- LSP Servers
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
opts = {
|
||||
servers = {
|
||||
angularls = {},
|
||||
},
|
||||
setup = {
|
||||
angularls = function()
|
||||
LazyVim.lsp.on_attach(function(client)
|
||||
if client.name == "angularls" then
|
||||
--HACK: disable angular renaming capability due to duplicate rename popping up
|
||||
client.server_capabilities.renameProvider = false
|
||||
end
|
||||
end)
|
||||
end,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
-- Configure tsserver plugin
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
opts = function(_, opts)
|
||||
LazyVim.extend(opts.servers.vtsls, "settings.vtsls.tsserver.globalPlugins", {
|
||||
{
|
||||
name = "@angular/language-server",
|
||||
location = LazyVim.get_pkg_path("angular-language-server", "/node_modules/@angular/language-server"),
|
||||
enableForWorkspaceTypeScriptVersions = false,
|
||||
},
|
||||
})
|
||||
end,
|
||||
},
|
||||
}
|
||||
46
lua/lazyvim/plugins/extras/lang/ansible.lua
Normal file
46
lua/lazyvim/plugins/extras/lang/ansible.lua
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
return {
|
||||
recommended = function()
|
||||
return LazyVim.extras.wants({
|
||||
ft = "yaml.ansible",
|
||||
root = { "ansible.cfg", ".ansible-lint" },
|
||||
})
|
||||
end,
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = function(_, opts)
|
||||
if type(opts.ensure_installed) == "table" then
|
||||
vim.list_extend(opts.ensure_installed, { "yaml" })
|
||||
end
|
||||
end,
|
||||
},
|
||||
{
|
||||
"williamboman/mason.nvim",
|
||||
opts = function(_, opts)
|
||||
opts.ensure_installed = opts.ensure_installed or {}
|
||||
-- for ansiblels validation
|
||||
vim.list_extend(opts.ensure_installed, { "ansible-lint" })
|
||||
end,
|
||||
},
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
opts = {
|
||||
servers = {
|
||||
ansiblels = {},
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"mfussenegger/nvim-ansible",
|
||||
ft = {},
|
||||
keys = {
|
||||
{
|
||||
"<leader>ta",
|
||||
function()
|
||||
require("ansible").run()
|
||||
end,
|
||||
desc = "Ansible Run Playbook/Role",
|
||||
silent = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
48
lua/lazyvim/plugins/extras/lang/astro.lua
Normal file
48
lua/lazyvim/plugins/extras/lang/astro.lua
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
return {
|
||||
recommended = function()
|
||||
return LazyVim.extras.wants({
|
||||
ft = "astro",
|
||||
root = {
|
||||
"astro.config.js",
|
||||
"astro.config.mjs",
|
||||
"astro.config.cjs",
|
||||
},
|
||||
})
|
||||
end,
|
||||
|
||||
-- depends on the typescript extra
|
||||
{ import = "lazyvim.plugins.extras.lang.typescript" },
|
||||
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = function(_, opts)
|
||||
if type(opts.ensure_installed) == "table" then
|
||||
vim.list_extend(opts.ensure_installed, { "astro" })
|
||||
end
|
||||
end,
|
||||
},
|
||||
|
||||
-- LSP Servers
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
opts = {
|
||||
servers = {
|
||||
astro = {},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
-- Configure tsserver plugin
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
opts = function(_, opts)
|
||||
LazyVim.extend(opts.servers.vtsls, "settings.vtsls.tsserver.globalPlugins", {
|
||||
{
|
||||
name = "@astrojs/ts-plugin",
|
||||
location = LazyVim.get_pkg_path("astro-language-server", "/node_modules/@astrojs/ts-plugin"),
|
||||
enableForWorkspaceTypeScriptVersions = true,
|
||||
},
|
||||
})
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
|
@ -1,4 +1,17 @@
|
|||
return {
|
||||
recommended = function()
|
||||
return LazyVim.extras.wants({
|
||||
ft = { "c", "cpp", "objc", "objcpp", "cuda", "proto" },
|
||||
root = {
|
||||
".clangd",
|
||||
".clang-tidy",
|
||||
".clang-format",
|
||||
"compile_commands.json",
|
||||
"compile_flags.txt",
|
||||
"configure.ac", -- AutoTools
|
||||
},
|
||||
})
|
||||
end,
|
||||
|
||||
-- Add C/C++ to treesitter
|
||||
{
|
||||
|
|
@ -49,7 +62,7 @@ return {
|
|||
-- Ensure mason installs the server
|
||||
clangd = {
|
||||
keys = {
|
||||
{ "<leader>cR", "<cmd>ClangdSwitchSourceHeader<cr>", desc = "Switch Source/Header (C/C++)" },
|
||||
{ "<leader>ch", "<cmd>ClangdSwitchSourceHeader<cr>", desc = "Switch Source/Header (C/C++)" },
|
||||
},
|
||||
root_dir = function(fname)
|
||||
return require("lspconfig.util").root_pattern(
|
||||
|
|
@ -85,7 +98,7 @@ return {
|
|||
},
|
||||
setup = {
|
||||
clangd = function(_, opts)
|
||||
local clangd_ext_opts = require("lazyvim.util").opts("clangd_extensions.nvim")
|
||||
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,
|
||||
|
|
@ -144,7 +157,7 @@ return {
|
|||
type = "codelldb",
|
||||
request = "attach",
|
||||
name = "Attach to process",
|
||||
processId = require("dap.utils").pick_process,
|
||||
pid = require("dap.utils").pick_process,
|
||||
cwd = "${workspaceFolder}",
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,10 @@
|
|||
return {
|
||||
recommended = function()
|
||||
return LazyVim.extras.wants({
|
||||
ft = "cmake",
|
||||
root = { "CMakePresets.json", "CTestConfig.cmake", "cmake" },
|
||||
})
|
||||
end,
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = function(_, opts)
|
||||
|
|
@ -43,7 +49,25 @@ return {
|
|||
},
|
||||
{
|
||||
"Civitasv/cmake-tools.nvim",
|
||||
lazy = true,
|
||||
init = function()
|
||||
local loaded = false
|
||||
local function check()
|
||||
local cwd = vim.uv.cwd()
|
||||
if vim.fn.filereadable(cwd .. "/CMakeLists.txt") == 1 then
|
||||
require("lazy").load({ plugins = { "cmake-tools.nvim" } })
|
||||
loaded = true
|
||||
end
|
||||
end
|
||||
check()
|
||||
vim.api.nvim_create_autocmd("DirChanged", {
|
||||
callback = function()
|
||||
if not loaded then
|
||||
check()
|
||||
end
|
||||
end,
|
||||
})
|
||||
end,
|
||||
opts = {},
|
||||
event = "LazyFile",
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,10 @@
|
|||
return {
|
||||
recommended = function()
|
||||
return LazyVim.extras.wants({
|
||||
ft = "dockerfile",
|
||||
root = { "Dockerfile", "docker-compose.yml", "compose.yml", "docker-compose.yaml", "compose.yaml" },
|
||||
})
|
||||
end,
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = function(_, opts)
|
||||
|
|
|
|||
|
|
@ -1,4 +1,10 @@
|
|||
return {
|
||||
recommended = function()
|
||||
return LazyVim.extras.wants({
|
||||
ft = { "elixir", "eelixir", "heex", "surface" },
|
||||
root = "mix.exs",
|
||||
})
|
||||
end,
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = function(_, opts)
|
||||
|
|
|
|||
|
|
@ -1,4 +1,10 @@
|
|||
return {
|
||||
recommended = function()
|
||||
return LazyVim.extras.wants({
|
||||
ft = { "go", "gomod", "gowork", "gotmpl" },
|
||||
root = { "go.work", "go.mod" },
|
||||
})
|
||||
end,
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = function(_, opts)
|
||||
|
|
@ -61,7 +67,7 @@ return {
|
|||
gopls = function(_, opts)
|
||||
-- workaround for gopls not supporting semanticTokensProvider
|
||||
-- https://github.com/golang/go/issues/54531#issuecomment-1464982242
|
||||
require("lazyvim.util").lsp.on_attach(function(client, _)
|
||||
LazyVim.lsp.on_attach(function(client, _)
|
||||
if client.name == "gopls" then
|
||||
if not client.server_capabilities.semanticTokensProvider then
|
||||
local semantic = client.config.capabilities.textDocument.semanticTokens
|
||||
|
|
@ -148,6 +154,7 @@ return {
|
|||
["neotest-go"] = {
|
||||
-- Here we can set options for neotest-go, e.g.
|
||||
-- args = { "-tags=integration" }
|
||||
recursive_run = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
|
|||
99
lua/lazyvim/plugins/extras/lang/haskell.lua
Normal file
99
lua/lazyvim/plugins/extras/lang/haskell.lua
Normal file
|
|
@ -0,0 +1,99 @@
|
|||
return {
|
||||
|
||||
-- Add Haskell to treesitter
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = function(_, opts)
|
||||
if type(opts.ensure_installed) == "table" then
|
||||
vim.list_extend(opts.ensure_installed, { "haskell" })
|
||||
end
|
||||
end,
|
||||
},
|
||||
|
||||
{
|
||||
"mrcjkb/haskell-tools.nvim",
|
||||
version = "^3",
|
||||
ft = { "haskell", "lhaskell", "cabal", "cabalproject" },
|
||||
dependencies = {
|
||||
{ "nvim-telescope/telescope.nvim", optional = true },
|
||||
},
|
||||
config = function()
|
||||
local ok, telescope = pcall(require, "telescope")
|
||||
if ok then
|
||||
telescope.load_extension("ht")
|
||||
end
|
||||
end,
|
||||
},
|
||||
|
||||
{
|
||||
"williamboman/mason.nvim",
|
||||
opts = function(_, opts)
|
||||
opts.ensure_installed = opts.ensure_installed or {}
|
||||
vim.list_extend(opts.ensure_installed, { "haskell-language-server" })
|
||||
end,
|
||||
},
|
||||
|
||||
{
|
||||
"mfussenegger/nvim-dap",
|
||||
optional = true,
|
||||
dependencies = {
|
||||
{
|
||||
"williamboman/mason.nvim",
|
||||
opts = function(_, opts)
|
||||
opts.ensure_installed = opts.ensure_installed or {}
|
||||
vim.list_extend(opts.ensure_installed, { "haskell-debug-adapter" })
|
||||
end,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
"nvim-neotest/neotest",
|
||||
optional = true,
|
||||
dependencies = {
|
||||
{ "mrcjkb/neotest-haskell" },
|
||||
},
|
||||
opts = {
|
||||
adapters = {
|
||||
["neotest-haskell"] = {},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
"mrcjkb/haskell-snippets.nvim",
|
||||
dependencies = { "L3MON4D3/LuaSnip" },
|
||||
ft = { "haskell", "lhaskell", "cabal", "cabalproject" },
|
||||
config = function()
|
||||
local haskell_snippets = require("haskell-snippets").all
|
||||
require("luasnip").add_snippets("haskell", haskell_snippets, { key = "haskell" })
|
||||
end,
|
||||
},
|
||||
|
||||
{
|
||||
"luc-tielen/telescope_hoogle",
|
||||
ft = { "haskell", "lhaskell", "cabal", "cabalproject" },
|
||||
dependencies = {
|
||||
{ "nvim-telescope/telescope.nvim" },
|
||||
},
|
||||
config = function()
|
||||
local ok, telescope = pcall(require, "telescope")
|
||||
if ok then
|
||||
telescope.load_extension("hoogle")
|
||||
end
|
||||
end,
|
||||
},
|
||||
|
||||
-- Make sure lspconfig doesn't start hls,
|
||||
-- as it conflicts with haskell-tools
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
opts = {
|
||||
setup = {
|
||||
hls = function()
|
||||
return true
|
||||
end,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
30
lua/lazyvim/plugins/extras/lang/helm.lua
Normal file
30
lua/lazyvim/plugins/extras/lang/helm.lua
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
LazyVim.lsp.on_attach(function(client, buffer)
|
||||
if client.name == "yamlls" then
|
||||
if vim.api.nvim_get_option_value("filetype", { buf = buffer }) == "helm" then
|
||||
vim.schedule(function()
|
||||
vim.cmd("LspStop ++force yamlls")
|
||||
end)
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
return {
|
||||
{ "towolf/vim-helm", ft = "helm" },
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
opts = {
|
||||
servers = {
|
||||
yamlls = {},
|
||||
helm_ls = {},
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"williamboman/mason.nvim",
|
||||
opts = function(_, opts)
|
||||
vim.list_extend(opts.ensure_installed, {
|
||||
"helm-ls",
|
||||
})
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
|
@ -1,5 +1,3 @@
|
|||
local Util = require("lazyvim.util")
|
||||
|
||||
-- This is the same as in lspconfig.server_configurations.jdtls, but avoids
|
||||
-- needing to require that when this module loads.
|
||||
local java_filetypes = { "java" }
|
||||
|
|
@ -18,6 +16,20 @@ local function extend_or_override(config, custom, ...)
|
|||
end
|
||||
|
||||
return {
|
||||
recommended = function()
|
||||
return LazyVim.extras.wants({
|
||||
ft = "java",
|
||||
root = {
|
||||
"build.gradle",
|
||||
"build.gradle.kts",
|
||||
"build.xml", -- Ant
|
||||
"pom.xml", -- Maven
|
||||
"settings.gradle", -- Gradle
|
||||
"settings.gradle.kts", -- Gradle
|
||||
},
|
||||
})
|
||||
end,
|
||||
|
||||
-- Add java to treesitter.
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
|
|
@ -104,17 +116,25 @@ return {
|
|||
|
||||
-- These depend on nvim-dap, but can additionally be disabled by setting false here.
|
||||
dap = { hotcodereplace = "auto", config_overrides = {} },
|
||||
dap_main = {},
|
||||
test = true,
|
||||
settings = {
|
||||
java = {
|
||||
inlayHints = {
|
||||
parameterNames = {
|
||||
enabled = "all",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
end,
|
||||
config = function()
|
||||
local opts = Util.opts("nvim-jdtls") or {}
|
||||
|
||||
config = function(_, opts)
|
||||
-- Find the extra bundles that should be passed on the jdtls command-line
|
||||
-- if nvim-dap is enabled with java debug/test.
|
||||
local mason_registry = require("mason-registry")
|
||||
local bundles = {} ---@type string[]
|
||||
if opts.dap and Util.has("nvim-dap") and mason_registry.is_installed("java-debug-adapter") then
|
||||
if opts.dap and LazyVim.has("nvim-dap") and mason_registry.is_installed("java-debug-adapter") then
|
||||
local java_dbg_pkg = mason_registry.get_package("java-debug-adapter")
|
||||
local java_dbg_path = java_dbg_pkg:get_install_path()
|
||||
local jar_patterns = {
|
||||
|
|
@ -145,8 +165,9 @@ return {
|
|||
init_options = {
|
||||
bundles = bundles,
|
||||
},
|
||||
settings = opts.settings,
|
||||
-- enable CMP capabilities
|
||||
capabilities = require("cmp_nvim_lsp").default_capabilities(),
|
||||
capabilities = LazyVim.has("cmp-nvim-lsp") and require("cmp_nvim_lsp").default_capabilities() or nil,
|
||||
}, opts.jdtls)
|
||||
|
||||
-- Existing server will be reused if the root_dir matches.
|
||||
|
|
@ -195,10 +216,10 @@ return {
|
|||
},
|
||||
}, { mode = "v", buffer = args.buf })
|
||||
|
||||
if opts.dap and Util.has("nvim-dap") and mason_registry.is_installed("java-debug-adapter") then
|
||||
if opts.dap and LazyVim.has("nvim-dap") and mason_registry.is_installed("java-debug-adapter") then
|
||||
-- custom init for Java debugger
|
||||
require("jdtls").setup_dap(opts.dap)
|
||||
require("jdtls.dap").setup_dap_main_class_configs()
|
||||
require("jdtls.dap").setup_dap_main_class_configs(opts.dap_main)
|
||||
|
||||
-- Java Test require Java debugger to work
|
||||
if opts.test and mason_registry.is_installed("java-test") then
|
||||
|
|
|
|||
|
|
@ -1,4 +1,10 @@
|
|||
return {
|
||||
recommended = function()
|
||||
return LazyVim.extras.wants({
|
||||
ft = { "json", "jsonc", "json5" },
|
||||
root = { "*.json" },
|
||||
})
|
||||
end,
|
||||
|
||||
-- add json to treesitter
|
||||
{
|
||||
|
|
|
|||
117
lua/lazyvim/plugins/extras/lang/kotlin.lua
Normal file
117
lua/lazyvim/plugins/extras/lang/kotlin.lua
Normal file
|
|
@ -0,0 +1,117 @@
|
|||
return {
|
||||
recommended = function()
|
||||
return LazyVim.extras.wants({
|
||||
ft = "kotlin",
|
||||
root = {
|
||||
"settings.gradle", -- Gradle (multi-project)
|
||||
"settings.gradle.kts", -- Gradle (multi-project)
|
||||
"build.xml", -- Ant
|
||||
"pom.xml", -- Maven
|
||||
"build.gradle", -- Gradle
|
||||
"build.gradle.kts", -- Gradle
|
||||
},
|
||||
})
|
||||
end,
|
||||
-- Add packages(linting, debug adapter)
|
||||
{
|
||||
"williamboman/mason.nvim",
|
||||
opts = function(_, opts)
|
||||
vim.list_extend(opts.ensure_installed or {}, { "ktlint", "kotlin-debug-adapter" })
|
||||
end,
|
||||
},
|
||||
-- Add syntax highlighting
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = function(_, opts)
|
||||
vim.list_extend(opts.ensure_installed or {}, { "kotlin" })
|
||||
end,
|
||||
},
|
||||
-- Add language server
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
opts = {
|
||||
servers = {
|
||||
kotlin_language_server = {},
|
||||
},
|
||||
},
|
||||
},
|
||||
-- Add linting as optional
|
||||
{
|
||||
"mfussenegger/nvim-lint",
|
||||
optional = true,
|
||||
dependencies = "williamboman/mason.nvim",
|
||||
opts = {
|
||||
linters_by_ft = { kotlin = { "ktlint" } },
|
||||
},
|
||||
},
|
||||
-- Add formatting as optional
|
||||
{
|
||||
"stevearc/conform.nvim",
|
||||
optional = true,
|
||||
opts = {
|
||||
formatters_by_ft = { kotlin = { "ktlint" } },
|
||||
},
|
||||
},
|
||||
-- Add formatting and linting as optional
|
||||
{
|
||||
"nvimtools/none-ls.nvim",
|
||||
optional = true,
|
||||
opts = function(_, opts)
|
||||
local nls = require("null-ls")
|
||||
opts.sources = vim.list_extend(opts.sources or {}, {
|
||||
nls.builtins.formatting.ktlint,
|
||||
nls.builtins.diagnostics.ktlint,
|
||||
})
|
||||
end,
|
||||
},
|
||||
-- Add debugger
|
||||
{
|
||||
"mfussenegger/nvim-dap",
|
||||
optional = true,
|
||||
dependencies = "williamboman/mason.nvim",
|
||||
opts = function()
|
||||
local dap = require("dap")
|
||||
if not dap.adapters.kotlin then
|
||||
require("dap").adapters.kotlin = {
|
||||
type = "executable",
|
||||
command = "kotlin-debug-adapter",
|
||||
options = { auto_continue_if_many_stopped = false },
|
||||
}
|
||||
end
|
||||
|
||||
dap.configurations.kotlin = {
|
||||
{
|
||||
type = "kotlin",
|
||||
request = "launch",
|
||||
name = "This file",
|
||||
-- may differ, when in doubt, whatever your project structure may be,
|
||||
-- it has to correspond to the class file located at `build/classes/`
|
||||
-- and of course you have to build before you debug
|
||||
mainClass = function()
|
||||
local root = vim.fs.find("src", { path = vim.uv.cwd(), upward = true, stop = vim.env.HOME })[1] or ""
|
||||
local fname = vim.api.nvim_buf_get_name(0)
|
||||
-- src/main/kotlin/websearch/Main.kt -> websearch.MainKt
|
||||
return fname:gsub(root, ""):gsub("main/kotlin/", ""):gsub(".kt", "Kt"):gsub("/", "."):sub(2, -1)
|
||||
end,
|
||||
projectRoot = "${workspaceFolder}",
|
||||
jsonLogFile = "",
|
||||
enableJsonLogging = false,
|
||||
},
|
||||
{
|
||||
-- Use this for unit tests
|
||||
-- First, run
|
||||
-- ./gradlew --info cleanTest test --debug-jvm
|
||||
-- then attach the debugger to it
|
||||
type = "kotlin",
|
||||
request = "attach",
|
||||
name = "Attach to debugging session",
|
||||
port = 5005,
|
||||
args = {},
|
||||
projectRoot = vim.fn.getcwd,
|
||||
hostName = "localhost",
|
||||
timeout = 2000,
|
||||
},
|
||||
}
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
|
@ -1,4 +1,20 @@
|
|||
return {
|
||||
recommended = function()
|
||||
return LazyVim.extras.wants({
|
||||
ft = "markdown",
|
||||
root = "README.md",
|
||||
})
|
||||
end,
|
||||
{
|
||||
"stevearc/conform.nvim",
|
||||
optional = true,
|
||||
opts = {
|
||||
formatters_by_ft = {
|
||||
["markdown"] = { { "prettierd", "prettier" }, "markdownlint", "markdown-toc" },
|
||||
["markdown.mdx"] = { { "prettierd", "prettier" }, "markdownlint", "markdown-toc" },
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = function(_, opts)
|
||||
|
|
@ -69,6 +85,8 @@ return {
|
|||
for _, ft in ipairs({ "markdown", "norg", "rmd", "org" }) do
|
||||
opts[ft] = {
|
||||
headline_highlights = {},
|
||||
-- disable bullets for now. See https://github.com/lukas-reineke/headlines.nvim/issues/66
|
||||
bullets = {},
|
||||
}
|
||||
for i = 1, 6 do
|
||||
local hl = "Headline" .. i
|
||||
|
|
|
|||
|
|
@ -1,4 +1,11 @@
|
|||
return {
|
||||
recommended = function()
|
||||
return LazyVim.extras.wants({
|
||||
ft = { "cs", "vb" },
|
||||
root = { "*.sln", "*.csproj", "omnisharp.json", "function.json" },
|
||||
})
|
||||
end,
|
||||
|
||||
{ "Hoffs/omnisharp-extended-lsp.nvim", lazy = true },
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
|
|
@ -35,8 +42,9 @@ return {
|
|||
{
|
||||
"williamboman/mason.nvim",
|
||||
opts = function(_, opts)
|
||||
opts.ensure_installed = opts.ensure_installed or {}
|
||||
table.insert(opts.ensure_installed, "csharpier")
|
||||
if type(opts.ensure_installed) == "table" then
|
||||
vim.list_extend(opts.ensure_installed, { "netcoredbg", "csharpier" })
|
||||
end
|
||||
end,
|
||||
},
|
||||
{
|
||||
|
|
@ -65,4 +73,48 @@ return {
|
|||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"mfussenegger/nvim-dap",
|
||||
optional = true,
|
||||
opts = function()
|
||||
local dap = require("dap")
|
||||
if not dap.adapters["netcoredbg"] then
|
||||
require("dap").adapters["netcoredbg"] = {
|
||||
type = "executable",
|
||||
command = vim.fn.exepath("netcoredbg"),
|
||||
args = { "--interpreter=vscode" },
|
||||
}
|
||||
end
|
||||
for _, lang in ipairs({ "cs", "fsharp", "vb" }) do
|
||||
if not dap.configurations[lang] then
|
||||
dap.configurations[lang] = {
|
||||
{
|
||||
type = "netcoredbg",
|
||||
name = "Launch file",
|
||||
request = "launch",
|
||||
---@diagnostic disable-next-line: redundant-parameter
|
||||
program = function()
|
||||
return vim.fn.input("Path to dll: ", vim.fn.getcwd() .. "/", "file")
|
||||
end,
|
||||
cwd = "${workspaceFolder}",
|
||||
},
|
||||
}
|
||||
end
|
||||
end
|
||||
end,
|
||||
},
|
||||
{
|
||||
"nvim-neotest/neotest",
|
||||
optional = true,
|
||||
dependencies = {
|
||||
"Issafalcon/neotest-dotnet",
|
||||
},
|
||||
opts = {
|
||||
adapters = {
|
||||
["neotest-dotnet"] = {
|
||||
-- Here we can set options for neotest-dotnet
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,32 +0,0 @@
|
|||
return {
|
||||
-- "numiras/semshi",
|
||||
"wookayin/semshi", -- use a maintained fork
|
||||
ft = "python",
|
||||
build = ":UpdateRemotePlugins",
|
||||
init = function()
|
||||
-- Disabled these features better provided by LSP or other more general plugins
|
||||
vim.g["semshi#error_sign"] = false
|
||||
vim.g["semshi#simplify_markup"] = false
|
||||
vim.g["semshi#mark_selected_nodes"] = false
|
||||
vim.g["semshi#update_delay_factor"] = 0.001
|
||||
|
||||
-- This autocmd must be defined in init to take effect
|
||||
vim.api.nvim_create_autocmd({ "VimEnter", "ColorScheme" }, {
|
||||
group = vim.api.nvim_create_augroup("SemanticHighlight", {}),
|
||||
callback = function()
|
||||
-- Only add style, inherit or link to the LSP's colors
|
||||
vim.cmd([[
|
||||
highlight! semshiGlobal gui=italic
|
||||
highlight! link semshiImported @none
|
||||
highlight! link semshiParameter @lsp.type.parameter
|
||||
highlight! link semshiParameterUnused DiagnosticUnnecessary
|
||||
highlight! link semshiBuiltin @function.builtin
|
||||
highlight! link semshiAttribute @field
|
||||
highlight! link semshiSelf @lsp.type.selfKeyword
|
||||
highlight! link semshiUnresolved @lsp.type.unresolvedReference
|
||||
highlight! link semshiFree @none
|
||||
]])
|
||||
end,
|
||||
})
|
||||
end,
|
||||
}
|
||||
|
|
@ -1,4 +1,27 @@
|
|||
if lazyvim_docs then
|
||||
-- LSP Server to use for Python.
|
||||
-- Set to "basedpyright" to use basedpyright instead of pyright.
|
||||
vim.g.lazyvim_python_lsp = "pyright"
|
||||
vim.g.lazyvim_python_ruff = "ruff_lsp"
|
||||
end
|
||||
|
||||
local lsp = vim.g.lazyvim_python_lsp or "pyright"
|
||||
local ruff = vim.g.lazyvim_python_ruff or "ruff_lsp"
|
||||
|
||||
return {
|
||||
recommended = function()
|
||||
return LazyVim.extras.wants({
|
||||
ft = "python",
|
||||
root = {
|
||||
"pyproject.toml",
|
||||
"setup.py",
|
||||
"setup.cfg",
|
||||
"requirements.txt",
|
||||
"Pipfile",
|
||||
"pyrightconfig.json",
|
||||
},
|
||||
})
|
||||
end,
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = function(_, opts)
|
||||
|
|
@ -11,8 +34,22 @@ return {
|
|||
"neovim/nvim-lspconfig",
|
||||
opts = {
|
||||
servers = {
|
||||
pyright = {},
|
||||
pyright = {
|
||||
enabled = lsp == "pyright",
|
||||
},
|
||||
basedpyright = {
|
||||
enabled = lsp == "basedpyright",
|
||||
},
|
||||
[lsp] = {
|
||||
enabled = true,
|
||||
},
|
||||
ruff_lsp = {
|
||||
enabled = ruff == "ruff_lsp",
|
||||
},
|
||||
ruff = {
|
||||
enabled = ruff == "ruff",
|
||||
},
|
||||
[ruff] = {
|
||||
keys = {
|
||||
{
|
||||
"<leader>co",
|
||||
|
|
@ -31,9 +68,9 @@ return {
|
|||
},
|
||||
},
|
||||
setup = {
|
||||
ruff_lsp = function()
|
||||
require("lazyvim.util").lsp.on_attach(function(client, _)
|
||||
if client.name == "ruff_lsp" then
|
||||
[ruff] = function()
|
||||
LazyVim.lsp.on_attach(function(client, _)
|
||||
if client.name == ruff then
|
||||
-- Disable hover in favor of Pyright
|
||||
client.server_capabilities.hoverProvider = false
|
||||
end
|
||||
|
|
@ -69,8 +106,7 @@ return {
|
|||
{ "<leader>dPc", function() require('dap-python').test_class() end, desc = "Debug Class", ft = "python" },
|
||||
},
|
||||
config = function()
|
||||
local path = require("mason-registry").get_package("debugpy"):get_install_path()
|
||||
require("dap-python").setup(path .. "/venv/bin/python")
|
||||
require("dap-python").setup(LazyVim.get_pkg_path("debugpy", "/venv/bin/python"))
|
||||
end,
|
||||
},
|
||||
},
|
||||
|
|
@ -78,7 +114,7 @@ return {
|
|||
"linux-cultist/venv-selector.nvim",
|
||||
cmd = "VenvSelect",
|
||||
opts = function(_, opts)
|
||||
if require("lazyvim.util").has("nvim-dap-python") then
|
||||
if LazyVim.has("nvim-dap-python") then
|
||||
opts.dap_enabled = true
|
||||
end
|
||||
return vim.tbl_deep_extend("force", opts, {
|
||||
|
|
@ -90,6 +126,13 @@ return {
|
|||
},
|
||||
})
|
||||
end,
|
||||
keys = { { "<leader>cv", "<cmd>:VenvSelect<cr>", desc = "Select VirtualEnv" } },
|
||||
keys = { { "<leader>cv", "<cmd>:VenvSelect<cr>", desc = "Select VirtualEnv", ft = "python" } },
|
||||
},
|
||||
{
|
||||
"hrsh7th/nvim-cmp",
|
||||
opts = function(_, opts)
|
||||
opts.auto_brackets = opts.auto_brackets or {}
|
||||
table.insert(opts.auto_brackets, "python")
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
|
|
|||
94
lua/lazyvim/plugins/extras/lang/r.lua
Normal file
94
lua/lazyvim/plugins/extras/lang/r.lua
Normal file
|
|
@ -0,0 +1,94 @@
|
|||
return {
|
||||
recommended = function()
|
||||
return LazyVim.extras.wants({
|
||||
ft = "r",
|
||||
root = { "*.R", "*.Rmd", "*qmd" },
|
||||
})
|
||||
end,
|
||||
{
|
||||
"R-nvim/R.nvim",
|
||||
lazy = false,
|
||||
opts = {
|
||||
-- Create a table with the options to be passed to setup()
|
||||
R_args = { "--quiet", "--no-save" },
|
||||
hook = {
|
||||
on_filetype = function()
|
||||
-- This function will be called at the FileType event
|
||||
-- of files supported by R.nvim. This is an
|
||||
-- opportunity to create mappings local to buffers.
|
||||
vim.keymap.set("n", "<Enter>", "<Plug>RDSendLine", { buffer = true })
|
||||
vim.keymap.set("v", "<Enter>", "<Plug>RSendSelection", { buffer = true })
|
||||
|
||||
-- Increase the width of which-key to handle the longer r-nvim descriptions
|
||||
local wk = require("which-key")
|
||||
-- Workaround from https://github.com/folke/which-key.nvim/issues/514#issuecomment-1987286901
|
||||
wk.register({
|
||||
["<localleader>"] = {
|
||||
a = { name = "+(a)ll", ["🚫"] = "which_key_ignore" },
|
||||
b = { name = "+(b)etween marks", ["🚫"] = "which_key_ignore" },
|
||||
c = { name = "+(c)hunks", ["🚫"] = "which_key_ignore" },
|
||||
f = { name = "+(f)unctions", ["🚫"] = "which_key_ignore" },
|
||||
g = { name = "+(g)oto", ["🚫"] = "which_key_ignore" },
|
||||
k = { name = "+(k)nit", ["🚫"] = "which_key_ignore" },
|
||||
p = { name = "+(p)aragraph", ["🚫"] = "which_key_ignore" },
|
||||
q = { name = "+(q)uarto", ["🚫"] = "which_key_ignore" },
|
||||
r = { name = "+(r) general", ["🚫"] = "which_key_ignore" },
|
||||
s = { name = "+(s)plit or (s)end", ["🚫"] = "which_key_ignore" },
|
||||
t = { name = "+(t)erminal", ["🚫"] = "which_key_ignore" },
|
||||
v = { name = "+(v)iew", ["🚫"] = "which_key_ignore" },
|
||||
},
|
||||
})
|
||||
end,
|
||||
},
|
||||
pdfviewer = "",
|
||||
},
|
||||
config = function(_, opts)
|
||||
vim.g.rout_follow_colorscheme = true
|
||||
require("r").setup(opts)
|
||||
require("r.pdf.generic").open = vim.ui.open
|
||||
end,
|
||||
},
|
||||
{
|
||||
"hrsh7th/nvim-cmp",
|
||||
optional = true,
|
||||
dependencies = { "R-nvim/cmp-r" },
|
||||
opts = function(_, opts)
|
||||
opts.sources = opts.sources or {}
|
||||
table.insert(opts.sources, { name = "cmp_r" })
|
||||
end,
|
||||
},
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = function(_, opts)
|
||||
if type(opts.ensure_installed) == "table" then
|
||||
vim.list_extend(opts.ensure_installed, { "markdown", "markdown_inline", "r", "rnoweb" })
|
||||
end
|
||||
end,
|
||||
},
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
opts = {
|
||||
servers = {
|
||||
r_language_server = {
|
||||
root_dir = function(fname)
|
||||
return require("lspconfig.util").root_pattern("DESCRIPTION", "NAMESPACE", ".Rbuildignore")(fname)
|
||||
or require("lspconfig.util").find_git_ancestor(fname)
|
||||
or vim.loop.os_homedir()
|
||||
end,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"nvim-neotest/neotest",
|
||||
optional = true,
|
||||
dependencies = {
|
||||
"shunsambongi/neotest-testthat",
|
||||
},
|
||||
opts = {
|
||||
adapters = {
|
||||
["neotest-testthat"] = {},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
@ -1,4 +1,10 @@
|
|||
return {
|
||||
recommended = function()
|
||||
return LazyVim.extras.wants({
|
||||
ft = "ruby",
|
||||
root = "Gemfile",
|
||||
})
|
||||
end,
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = function(_, opts)
|
||||
|
|
|
|||
|
|
@ -1,4 +1,10 @@
|
|||
return {
|
||||
recommended = function()
|
||||
return LazyVim.extras.wants({
|
||||
ft = "rust",
|
||||
root = { "Cargo.toml", "rust-project.json" },
|
||||
})
|
||||
end,
|
||||
|
||||
-- Extend auto completion
|
||||
{
|
||||
|
|
@ -8,7 +14,7 @@ return {
|
|||
"Saecki/crates.nvim",
|
||||
event = { "BufRead Cargo.toml" },
|
||||
opts = {
|
||||
src = {
|
||||
completion = {
|
||||
cmp = { enabled = true },
|
||||
},
|
||||
},
|
||||
|
|
@ -16,10 +22,8 @@ return {
|
|||
},
|
||||
---@param opts cmp.ConfigSchema
|
||||
opts = function(_, opts)
|
||||
local cmp = require("cmp")
|
||||
opts.sources = cmp.config.sources(vim.list_extend(opts.sources, {
|
||||
{ name = "crates" },
|
||||
}))
|
||||
opts.sources = opts.sources or {}
|
||||
table.insert(opts.sources, { name = "crates" })
|
||||
end,
|
||||
},
|
||||
|
||||
|
|
@ -27,9 +31,8 @@ return {
|
|||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = function(_, opts)
|
||||
if type(opts.ensure_installed) == "table" then
|
||||
vim.list_extend(opts.ensure_installed, { "ron", "rust", "toml" })
|
||||
end
|
||||
opts.ensure_installed = opts.ensure_installed or {}
|
||||
vim.list_extend(opts.ensure_installed, { "ron", "rust", "toml" })
|
||||
end,
|
||||
},
|
||||
|
||||
|
|
@ -38,51 +41,62 @@ return {
|
|||
"williamboman/mason.nvim",
|
||||
optional = true,
|
||||
opts = function(_, opts)
|
||||
if type(opts.ensure_installed) == "table" then
|
||||
vim.list_extend(opts.ensure_installed, { "codelldb" })
|
||||
end
|
||||
opts.ensure_installed = opts.ensure_installed or {}
|
||||
vim.list_extend(opts.ensure_installed, { "codelldb" })
|
||||
end,
|
||||
},
|
||||
|
||||
{
|
||||
"simrat39/rust-tools.nvim",
|
||||
lazy = true,
|
||||
opts = function()
|
||||
local ok, mason_registry = pcall(require, "mason-registry")
|
||||
local adapter ---@type any
|
||||
if ok then
|
||||
-- rust tools configuration for debugging support
|
||||
local codelldb = mason_registry.get_package("codelldb")
|
||||
local extension_path = codelldb:get_install_path() .. "/extension/"
|
||||
local codelldb_path = extension_path .. "adapter/codelldb"
|
||||
local liblldb_path = ""
|
||||
if vim.loop.os_uname().sysname:find("Windows") then
|
||||
liblldb_path = extension_path .. "lldb\\bin\\liblldb.dll"
|
||||
elseif vim.fn.has("mac") == 1 then
|
||||
liblldb_path = extension_path .. "lldb/lib/liblldb.dylib"
|
||||
else
|
||||
liblldb_path = extension_path .. "lldb/lib/liblldb.so"
|
||||
end
|
||||
adapter = require("rust-tools.dap").get_codelldb_adapter(codelldb_path, liblldb_path)
|
||||
"mrcjkb/rustaceanvim",
|
||||
version = "^4", -- Recommended
|
||||
ft = { "rust" },
|
||||
opts = {
|
||||
server = {
|
||||
on_attach = function(_, bufnr)
|
||||
vim.keymap.set("n", "<leader>cR", function()
|
||||
vim.cmd.RustLsp("codeAction")
|
||||
end, { desc = "Code Action", buffer = bufnr })
|
||||
vim.keymap.set("n", "<leader>dr", function()
|
||||
vim.cmd.RustLsp("debuggables")
|
||||
end, { desc = "Rust Debuggables", buffer = bufnr })
|
||||
end,
|
||||
default_settings = {
|
||||
-- rust-analyzer language server configuration
|
||||
["rust-analyzer"] = {
|
||||
cargo = {
|
||||
allFeatures = true,
|
||||
loadOutDirsFromCheck = true,
|
||||
buildScripts = {
|
||||
enable = true,
|
||||
},
|
||||
},
|
||||
-- Add clippy lints for Rust.
|
||||
checkOnSave = {
|
||||
allFeatures = true,
|
||||
command = "clippy",
|
||||
extraArgs = { "--no-deps" },
|
||||
},
|
||||
procMacro = {
|
||||
enable = true,
|
||||
ignored = {
|
||||
["async-trait"] = { "async_trait" },
|
||||
["napi-derive"] = { "napi" },
|
||||
["async-recursion"] = { "async_recursion" },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
config = function(_, opts)
|
||||
vim.g.rustaceanvim = vim.tbl_deep_extend("keep", vim.g.rustaceanvim or {}, opts or {})
|
||||
if vim.fn.executable("rust-analyzer") == 0 then
|
||||
LazyVim.error(
|
||||
"**rust-analyzer** not found in PATH, please install it.\nhttps://rust-analyzer.github.io/",
|
||||
{ title = "rustaceanvim" }
|
||||
)
|
||||
end
|
||||
return {
|
||||
dap = {
|
||||
adapter = adapter,
|
||||
},
|
||||
tools = {
|
||||
on_initialized = function()
|
||||
vim.cmd([[
|
||||
augroup RustLSP
|
||||
autocmd CursorHold *.rs silent! lua vim.lsp.buf.document_highlight()
|
||||
autocmd CursorMoved,InsertEnter *.rs silent! lua vim.lsp.buf.clear_references()
|
||||
autocmd BufEnter,CursorHold,InsertLeave *.rs silent! lua vim.lsp.codelens.refresh()
|
||||
augroup END
|
||||
]])
|
||||
end,
|
||||
},
|
||||
}
|
||||
end,
|
||||
config = function() end,
|
||||
},
|
||||
|
||||
-- Correctly setup lspconfig for Rust 🚀
|
||||
|
|
@ -90,37 +104,6 @@ return {
|
|||
"neovim/nvim-lspconfig",
|
||||
opts = {
|
||||
servers = {
|
||||
-- Ensure mason installs the server
|
||||
rust_analyzer = {
|
||||
keys = {
|
||||
{ "K", "<cmd>RustHoverActions<cr>", desc = "Hover Actions (Rust)" },
|
||||
{ "<leader>cR", "<cmd>RustCodeAction<cr>", desc = "Code Action (Rust)" },
|
||||
{ "<leader>dr", "<cmd>RustDebuggables<cr>", desc = "Run Debuggables (Rust)" },
|
||||
},
|
||||
settings = {
|
||||
["rust-analyzer"] = {
|
||||
cargo = {
|
||||
allFeatures = true,
|
||||
loadOutDirsFromCheck = true,
|
||||
runBuildScripts = true,
|
||||
},
|
||||
-- Add clippy lints for Rust.
|
||||
checkOnSave = {
|
||||
allFeatures = true,
|
||||
command = "clippy",
|
||||
extraArgs = { "--no-deps" },
|
||||
},
|
||||
procMacro = {
|
||||
enable = true,
|
||||
ignored = {
|
||||
["async-trait"] = { "async_trait" },
|
||||
["napi-derive"] = { "napi" },
|
||||
["async-recursion"] = { "async_recursion" },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
taplo = {
|
||||
keys = {
|
||||
{
|
||||
|
|
@ -137,26 +120,17 @@ return {
|
|||
},
|
||||
},
|
||||
},
|
||||
setup = {
|
||||
rust_analyzer = function(_, opts)
|
||||
local rust_tools_opts = require("lazyvim.util").opts("rust-tools.nvim")
|
||||
require("rust-tools").setup(vim.tbl_deep_extend("force", rust_tools_opts or {}, { server = opts }))
|
||||
return true
|
||||
end,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
"nvim-neotest/neotest",
|
||||
optional = true,
|
||||
dependencies = {
|
||||
"rouge8/neotest-rust",
|
||||
},
|
||||
opts = {
|
||||
adapters = {
|
||||
["neotest-rust"] = {},
|
||||
},
|
||||
},
|
||||
opts = function(_, opts)
|
||||
opts.adapters = opts.adapters or {}
|
||||
vim.list_extend(opts.adapters, {
|
||||
require("rustaceanvim.neotest"),
|
||||
})
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
|
|
|||
98
lua/lazyvim/plugins/extras/lang/scala.lua
Normal file
98
lua/lazyvim/plugins/extras/lang/scala.lua
Normal file
|
|
@ -0,0 +1,98 @@
|
|||
return {
|
||||
recommended = function()
|
||||
return LazyVim.extras.wants({
|
||||
ft = "scala",
|
||||
root = { "build.sbt", "build.sc", "build.gradle", "pom.xml" },
|
||||
})
|
||||
end,
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = function(_, opts)
|
||||
if type(opts.ensure_installed) == "table" then
|
||||
vim.list_extend(opts.ensure_installed, { "scala" })
|
||||
end
|
||||
end,
|
||||
},
|
||||
{
|
||||
"scalameta/nvim-metals",
|
||||
ft = { "scala", "sbt" },
|
||||
config = function() end,
|
||||
},
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
opts = {
|
||||
servers = {
|
||||
metals = {
|
||||
keys = {
|
||||
{
|
||||
"<leader>me",
|
||||
function()
|
||||
require("telescope").extensions.metals.commands()
|
||||
end,
|
||||
desc = "Metals commands",
|
||||
},
|
||||
{
|
||||
"<leader>mc",
|
||||
function()
|
||||
require("metals").compile_cascade()
|
||||
end,
|
||||
desc = "Metals compile cascade",
|
||||
},
|
||||
},
|
||||
init_options = {
|
||||
statusBarProvider = "off",
|
||||
},
|
||||
settings = {
|
||||
showImplicitArguments = true,
|
||||
excludedPackages = { "akka.actor.typed.javadsl", "com.github.swagger.akka.javadsl" },
|
||||
},
|
||||
},
|
||||
},
|
||||
setup = {
|
||||
metals = function(_, opts)
|
||||
local metals = require("metals")
|
||||
local metals_config = vim.tbl_deep_extend("force", metals.bare_config(), opts)
|
||||
metals_config.on_attach = LazyVim.has("nvim-dap") and metals.setup_dap or nil
|
||||
|
||||
local nvim_metals_group = vim.api.nvim_create_augroup("nvim-metals", { clear = true })
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
pattern = { "scala", "sbt" },
|
||||
callback = function()
|
||||
metals.initialize_or_attach(metals_config)
|
||||
end,
|
||||
group = nvim_metals_group,
|
||||
})
|
||||
return true
|
||||
end,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
"mfussenegger/nvim-dap",
|
||||
optional = true,
|
||||
opts = function()
|
||||
-- Debug settings
|
||||
local dap = require("dap")
|
||||
dap.configurations.scala = {
|
||||
{
|
||||
type = "scala",
|
||||
request = "launch",
|
||||
name = "RunOrTest",
|
||||
metals = {
|
||||
runType = "runOrTestFile",
|
||||
--args = { "firstArg", "secondArg", "thirdArg" }, -- here just as an example
|
||||
},
|
||||
},
|
||||
{
|
||||
type = "scala",
|
||||
request = "launch",
|
||||
name = "Test Target",
|
||||
metals = {
|
||||
runType = "testTarget",
|
||||
},
|
||||
},
|
||||
}
|
||||
end,
|
||||
},
|
||||
}
|
||||
48
lua/lazyvim/plugins/extras/lang/svelte.lua
Normal file
48
lua/lazyvim/plugins/extras/lang/svelte.lua
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
return {
|
||||
recommended = function()
|
||||
return LazyVim.extras.wants({
|
||||
ft = "svelte",
|
||||
root = {
|
||||
"svelte.config.js",
|
||||
"svelte.config.mjs",
|
||||
"svelte.config.cjs",
|
||||
},
|
||||
})
|
||||
end,
|
||||
|
||||
-- depends on the typescript extra
|
||||
{ import = "lazyvim.plugins.extras.lang.typescript" },
|
||||
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = function(_, opts)
|
||||
if type(opts.ensure_installed) == "table" then
|
||||
vim.list_extend(opts.ensure_installed, { "svelte" })
|
||||
end
|
||||
end,
|
||||
},
|
||||
|
||||
-- LSP Servers
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
opts = {
|
||||
servers = {
|
||||
svelte = {},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
-- Configure tsserver plugin
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
opts = function(_, opts)
|
||||
LazyVim.extend(opts.servers.vtsls, "settings.vtsls.tsserver.globalPlugins", {
|
||||
{
|
||||
name = "typescript-svelte-plugin",
|
||||
location = LazyVim.get_pkg_path("svelte-language-server", "/node_modules/typescript-svelte-plugin"),
|
||||
enableForWorkspaceTypeScriptVersions = true,
|
||||
},
|
||||
})
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
|
@ -1,4 +1,18 @@
|
|||
return {
|
||||
recommended = function()
|
||||
return LazyVim.extras.wants({
|
||||
root = {
|
||||
"tailwind.config.js",
|
||||
"tailwind.config.cjs",
|
||||
"tailwind.config.mjs",
|
||||
"tailwind.config.ts",
|
||||
"postcss.config.js",
|
||||
"postcss.config.cjs",
|
||||
"postcss.config.mjs",
|
||||
"postcss.config.ts",
|
||||
},
|
||||
})
|
||||
end,
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
opts = {
|
||||
|
|
|
|||
|
|
@ -1,10 +1,11 @@
|
|||
vim.api.nvim_create_autocmd("FileType", {
|
||||
pattern = { "hcl", "terraform" },
|
||||
desc = "terraform/hcl commentstring configuration",
|
||||
command = "setlocal commentstring=#\\ %s",
|
||||
})
|
||||
|
||||
return {
|
||||
recommended = function()
|
||||
return LazyVim.extras.wants({
|
||||
ft = { "terraform", "hcl" },
|
||||
root = ".terraform",
|
||||
})
|
||||
end,
|
||||
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = function(_, opts)
|
||||
|
|
@ -24,6 +25,14 @@ return {
|
|||
},
|
||||
},
|
||||
},
|
||||
-- ensure terraform tools are installed
|
||||
{
|
||||
"williamboman/mason.nvim",
|
||||
opts = function(_, opts)
|
||||
opts.ensure_installed = opts.ensure_installed or {}
|
||||
vim.list_extend(opts.ensure_installed, { "tflint" })
|
||||
end,
|
||||
},
|
||||
{
|
||||
"nvimtools/none-ls.nvim",
|
||||
optional = true,
|
||||
|
|
@ -56,4 +65,25 @@ return {
|
|||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"nvim-telescope/telescope.nvim",
|
||||
dependencies = {
|
||||
{
|
||||
"ANGkeith/telescope-terraform-doc.nvim",
|
||||
config = function()
|
||||
LazyVim.on_load("telescope.nvim", function()
|
||||
require("telescope").load_extension("terraform_doc")
|
||||
end)
|
||||
end,
|
||||
},
|
||||
{
|
||||
"cappyzawa/telescope-terraform.nvim",
|
||||
config = function()
|
||||
LazyVim.on_load("telescope.nvim", function()
|
||||
require("telescope").load_extension("terraform")
|
||||
end)
|
||||
end,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,10 @@
|
|||
return {
|
||||
recommended = function()
|
||||
return LazyVim.extras.wants({
|
||||
ft = { "tex", "plaintex", "bib" },
|
||||
root = { ".latexmkrc", ".texlabroot", "texlabroot", "Tectonic.toml" },
|
||||
})
|
||||
end,
|
||||
{
|
||||
"folke/which-key.nvim",
|
||||
optional = true,
|
||||
|
|
@ -14,7 +20,7 @@ return {
|
|||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = function(_, opts)
|
||||
if type(opts.ensure_installed) == "table" then
|
||||
vim.list_extend(opts.ensure_installed, { "bibtex", "latex" })
|
||||
vim.list_extend(opts.ensure_installed, { "bibtex" })
|
||||
end
|
||||
if type(opts.highlight.disable) == "table" then
|
||||
vim.list_extend(opts.highlight.disable, { "latex" })
|
||||
|
|
@ -28,14 +34,6 @@ return {
|
|||
"lervag/vimtex",
|
||||
lazy = false, -- lazy-loading will disable inverse search
|
||||
config = function()
|
||||
vim.api.nvim_create_autocmd({ "FileType" }, {
|
||||
group = vim.api.nvim_create_augroup("lazyvim_vimtex_conceal", { clear = true }),
|
||||
pattern = { "bib", "tex" },
|
||||
callback = function()
|
||||
vim.wo.conceallevel = 2
|
||||
end,
|
||||
})
|
||||
|
||||
vim.g.vimtex_mappings_disable = { ["n"] = { "K" } } -- disable `K` as it conflicts with LSP hover
|
||||
vim.g.vimtex_quickfix_method = vim.fn.executable("pplatex") == 1 and "pplatex" or "latexlog"
|
||||
end,
|
||||
|
|
|
|||
31
lua/lazyvim/plugins/extras/lang/toml.lua
Normal file
31
lua/lazyvim/plugins/extras/lang/toml.lua
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
return {
|
||||
recommended = function()
|
||||
return LazyVim.extras.wants({
|
||||
ft = "toml",
|
||||
root = "*.toml",
|
||||
})
|
||||
end,
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = function(_, opts)
|
||||
if type(opts.ensure_installed) == "table" then
|
||||
vim.list_extend(opts.ensure_installed, { "toml" })
|
||||
end
|
||||
end,
|
||||
},
|
||||
{
|
||||
"williamboman/mason.nvim",
|
||||
opts = function(_, opts)
|
||||
opts.ensure_installed = opts.ensure_installed or {}
|
||||
vim.list_extend(opts.ensure_installed, { "taplo" })
|
||||
end,
|
||||
},
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
opts = {
|
||||
servers = {
|
||||
taplo = {},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
@ -1,12 +1,24 @@
|
|||
return {
|
||||
recommended = function()
|
||||
return LazyVim.extras.wants({
|
||||
ft = {
|
||||
"javascript",
|
||||
"javascriptreact",
|
||||
"javascript.jsx",
|
||||
"typescript",
|
||||
"typescriptreact",
|
||||
"typescript.tsx",
|
||||
},
|
||||
root = { "tsconfig.json", "package.json", "jsconfig.json" },
|
||||
})
|
||||
end,
|
||||
|
||||
-- add typescript to treesitter
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = function(_, opts)
|
||||
if type(opts.ensure_installed) == "table" then
|
||||
vim.list_extend(opts.ensure_installed, { "typescript", "tsx" })
|
||||
end
|
||||
"yioneko/nvim-vtsls",
|
||||
lazy = true,
|
||||
opts = {},
|
||||
config = function(_, opts)
|
||||
require("vtsls").config(opts)
|
||||
end,
|
||||
},
|
||||
|
||||
|
|
@ -16,59 +28,113 @@ return {
|
|||
opts = {
|
||||
-- make sure mason installs the server
|
||||
servers = {
|
||||
---@type lspconfig.options.tsserver
|
||||
tsserver = {
|
||||
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 = {
|
||||
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()
|
||||
require("vtsls").commands.goto_source_definition(0)
|
||||
end,
|
||||
desc = "Goto Source Definition",
|
||||
},
|
||||
{
|
||||
"gR",
|
||||
function()
|
||||
require("vtsls").commands.file_references(0)
|
||||
end,
|
||||
desc = "File References",
|
||||
},
|
||||
{
|
||||
"<leader>co",
|
||||
function()
|
||||
vim.lsp.buf.code_action({
|
||||
apply = true,
|
||||
context = {
|
||||
only = { "source.organizeImports.ts" },
|
||||
diagnostics = {},
|
||||
},
|
||||
})
|
||||
require("vtsls").commands.organize_imports(0)
|
||||
end,
|
||||
desc = "Organize Imports",
|
||||
},
|
||||
{
|
||||
"<leader>cR",
|
||||
"<leader>cM",
|
||||
function()
|
||||
vim.lsp.buf.code_action({
|
||||
apply = true,
|
||||
context = {
|
||||
only = { "source.removeUnused.ts" },
|
||||
diagnostics = {},
|
||||
},
|
||||
})
|
||||
require("vtsls").commands.add_missing_imports(0)
|
||||
end,
|
||||
desc = "Remove Unused Imports",
|
||||
desc = "Add missing imports",
|
||||
},
|
||||
},
|
||||
settings = {
|
||||
typescript = {
|
||||
format = {
|
||||
indentSize = vim.o.shiftwidth,
|
||||
convertTabsToSpaces = vim.o.expandtab,
|
||||
tabSize = vim.o.tabstop,
|
||||
},
|
||||
{
|
||||
"<leader>cu",
|
||||
function()
|
||||
require("vtsls").commands.remove_unused_imports(0)
|
||||
end,
|
||||
desc = "Remove unused imports",
|
||||
},
|
||||
javascript = {
|
||||
format = {
|
||||
indentSize = vim.o.shiftwidth,
|
||||
convertTabsToSpaces = vim.o.expandtab,
|
||||
tabSize = vim.o.tabstop,
|
||||
},
|
||||
{
|
||||
"<leader>cD",
|
||||
function()
|
||||
require("vtsls").commands.fix_all(0)
|
||||
end,
|
||||
desc = "Fix all diagnostics",
|
||||
},
|
||||
completions = {
|
||||
completeFunctionCalls = true,
|
||||
{
|
||||
"<leader>cV",
|
||||
function()
|
||||
require("vtsls").commands.select_ts_version(0)
|
||||
end,
|
||||
desc = "Select TS workspace version",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
setup = {
|
||||
tsserver = function()
|
||||
-- disable tsserver
|
||||
return true
|
||||
end,
|
||||
vtsls = function(_, opts)
|
||||
-- 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,
|
||||
|
|
@ -92,13 +158,26 @@ return {
|
|||
command = "node",
|
||||
-- 💀 Make sure to update this path to point to your installation
|
||||
args = {
|
||||
require("mason-registry").get_package("js-debug-adapter"):get_install_path()
|
||||
.. "/js-debug/src/dapDebugServer.js",
|
||||
LazyVim.get_pkg_path("js-debug-adapter", "/js-debug/src/dapDebugServer.js"),
|
||||
"${port}",
|
||||
},
|
||||
},
|
||||
}
|
||||
end
|
||||
if not dap.adapters["node"] then
|
||||
dap.adapters["node"] = function(cb, config)
|
||||
if config.type == "node" then
|
||||
config.type = "pwa-node"
|
||||
end
|
||||
local nativeAdapter = dap.adapters["pwa-node"]
|
||||
if type(nativeAdapter) == "function" then
|
||||
nativeAdapter(cb, config)
|
||||
else
|
||||
cb(nativeAdapter)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
for _, language in ipairs({ "typescript", "javascript", "typescriptreact", "javascriptreact" }) do
|
||||
if not dap.configurations[language] then
|
||||
dap.configurations[language] = {
|
||||
|
|
|
|||
48
lua/lazyvim/plugins/extras/lang/vue.lua
Normal file
48
lua/lazyvim/plugins/extras/lang/vue.lua
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
return {
|
||||
recommended = function()
|
||||
return LazyVim.extras.wants({
|
||||
ft = "vue",
|
||||
root = { "vue.config.js" },
|
||||
})
|
||||
end,
|
||||
|
||||
-- depends on the typescript extra
|
||||
{ import = "lazyvim.plugins.extras.lang.typescript" },
|
||||
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = function(_, opts)
|
||||
if type(opts.ensure_installed) == "table" then
|
||||
vim.list_extend(opts.ensure_installed, { "vue" })
|
||||
end
|
||||
end,
|
||||
},
|
||||
|
||||
-- Add LSP servers
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
opts = {
|
||||
servers = {
|
||||
volar = {},
|
||||
vtsls = {},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
-- Configure tsserver plugin
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
opts = function(_, opts)
|
||||
table.insert(opts.servers.vtsls.filetypes, "vue")
|
||||
LazyVim.extend(opts.servers.vtsls, "settings.vtsls.tsserver.globalPlugins", {
|
||||
{
|
||||
name = "@vue/typescript-plugin",
|
||||
location = LazyVim.get_pkg_path("vue-language-server", "/node_modules/@vue/language-server"),
|
||||
languages = { "vue" },
|
||||
configNamespace = "typescript",
|
||||
enableForWorkspaceTypeScriptVersions = true,
|
||||
},
|
||||
})
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
|
@ -1,4 +1,9 @@
|
|||
return {
|
||||
recommended = function()
|
||||
return LazyVim.extras.wants({
|
||||
ft = "yaml",
|
||||
})
|
||||
end,
|
||||
|
||||
-- add yaml specific modules to treesitter
|
||||
{
|
||||
|
|
@ -64,7 +69,7 @@ return {
|
|||
yamlls = function()
|
||||
-- Neovim < 0.10 does not have dynamic registration for formatting
|
||||
if vim.fn.has("nvim-0.10") == 0 then
|
||||
require("lazyvim.util").lsp.on_attach(function(client, _)
|
||||
LazyVim.lsp.on_attach(function(client, _)
|
||||
if client.name == "yamlls" then
|
||||
client.server_capabilities.documentFormattingProvider = true
|
||||
end
|
||||
|
|
|
|||
|
|
@ -8,17 +8,17 @@ return {
|
|||
eslint = {
|
||||
settings = {
|
||||
-- helps eslint find the eslintrc when it's placed in a subfolder instead of the cwd root
|
||||
workingDirectory = { mode = "auto" },
|
||||
workingDirectories = { mode = "auto" },
|
||||
},
|
||||
},
|
||||
},
|
||||
setup = {
|
||||
eslint = function()
|
||||
local function get_client(buf)
|
||||
return require("lazyvim.util").lsp.get_clients({ name = "eslint", bufnr = buf })[1]
|
||||
return LazyVim.lsp.get_clients({ name = "eslint", bufnr = buf })[1]
|
||||
end
|
||||
|
||||
local formatter = require("lazyvim.util").lsp.formatter({
|
||||
local formatter = LazyVim.lsp.formatter({
|
||||
name = "eslint: lsp",
|
||||
primary = false,
|
||||
priority = 200,
|
||||
|
|
@ -44,7 +44,7 @@ return {
|
|||
end
|
||||
|
||||
-- register the formatter with LazyVim
|
||||
require("lazyvim.util").format.register(formatter)
|
||||
LazyVim.format.register(formatter)
|
||||
end,
|
||||
},
|
||||
},
|
||||
|
|
|
|||
12
lua/lazyvim/plugins/extras/lsp/neoconf.lua
Normal file
12
lua/lazyvim/plugins/extras/lsp/neoconf.lua
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
return {
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
dependencies = {
|
||||
{
|
||||
"folke/neoconf.nvim",
|
||||
cmd = "Neoconf",
|
||||
opts = {},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
@ -1,5 +1,3 @@
|
|||
local Util = require("lazyvim.util")
|
||||
|
||||
return {
|
||||
-- none-ls
|
||||
{
|
||||
|
|
@ -7,14 +5,14 @@ return {
|
|||
event = "LazyFile",
|
||||
dependencies = { "mason.nvim" },
|
||||
init = function()
|
||||
Util.on_very_lazy(function()
|
||||
LazyVim.on_very_lazy(function()
|
||||
-- register the formatter with LazyVim
|
||||
require("lazyvim.util").format.register({
|
||||
LazyVim.format.register({
|
||||
name = "none-ls.nvim",
|
||||
priority = 200, -- set higher than conform, the builtin formatter
|
||||
primary = true,
|
||||
format = function(buf)
|
||||
return Util.lsp.format({
|
||||
return LazyVim.lsp.format({
|
||||
bufnr = buf,
|
||||
filter = function(client)
|
||||
return client.name == "null-ls"
|
||||
|
|
|
|||
|
|
@ -1,4 +1,6 @@
|
|||
return {
|
||||
recommended = true,
|
||||
desc = "Neotest support. Requires language specific adapters to be configured. (see lang extras)",
|
||||
{
|
||||
"folke/which-key.nvim",
|
||||
optional = true,
|
||||
|
|
@ -10,6 +12,7 @@ return {
|
|||
},
|
||||
{
|
||||
"nvim-neotest/neotest",
|
||||
dependencies = { "nvim-neotest/nvim-nio" },
|
||||
opts = {
|
||||
-- Can be a list of adapters like what neotest expects,
|
||||
-- or a list of adapter names,
|
||||
|
|
@ -26,7 +29,7 @@ return {
|
|||
output = { open_on_run = true },
|
||||
quickfix = {
|
||||
open = function()
|
||||
if require("lazyvim.util").has("trouble.nvim") then
|
||||
if LazyVim.has("trouble.nvim") then
|
||||
require("trouble").open({ mode = "quickfix", focus = false })
|
||||
else
|
||||
vim.cmd("copen")
|
||||
|
|
@ -46,7 +49,7 @@ return {
|
|||
},
|
||||
}, neotest_ns)
|
||||
|
||||
if require("lazyvim.util").has("trouble.nvim") then
|
||||
if LazyVim.has("trouble.nvim") then
|
||||
opts.consumers = opts.consumers or {}
|
||||
-- Refresh and auto close trouble after running tests
|
||||
---@type neotest.Consumer
|
||||
|
|
@ -108,8 +111,9 @@ return {
|
|||
-- stylua: ignore
|
||||
keys = {
|
||||
{ "<leader>tt", function() require("neotest").run.run(vim.fn.expand("%")) end, desc = "Run File" },
|
||||
{ "<leader>tT", function() require("neotest").run.run(vim.loop.cwd()) end, desc = "Run All Test Files" },
|
||||
{ "<leader>tT", function() require("neotest").run.run(vim.uv.cwd()) end, desc = "Run All Test Files" },
|
||||
{ "<leader>tr", function() require("neotest").run.run() end, desc = "Run Nearest" },
|
||||
{ "<leader>tl", function() require("neotest").run.run_last() end, desc = "Run Last" },
|
||||
{ "<leader>ts", function() require("neotest").summary.toggle() end, desc = "Toggle Summary" },
|
||||
{ "<leader>to", function() require("neotest").output.open({ enter = true, auto_close = true }) end, desc = "Show Output" },
|
||||
{ "<leader>tO", function() require("neotest").output_panel.toggle() end, desc = "Toggle Output Panel" },
|
||||
|
|
|
|||
|
|
@ -40,12 +40,6 @@ return {
|
|||
end,
|
||||
},
|
||||
"Trouble",
|
||||
{
|
||||
ft = "trouble",
|
||||
filter = function(buf, win)
|
||||
return vim.api.nvim_win_get_config(win).relative == ""
|
||||
end,
|
||||
},
|
||||
{ ft = "qf", title = "QuickFix" },
|
||||
{
|
||||
ft = "help",
|
||||
|
|
@ -67,7 +61,7 @@ return {
|
|||
end,
|
||||
pinned = true,
|
||||
open = function()
|
||||
vim.api.nvim_input("<esc><space>e")
|
||||
require("neo-tree.command").execute({ dir = LazyVim.root() })
|
||||
end,
|
||||
size = { height = 0.5 },
|
||||
},
|
||||
|
|
@ -111,6 +105,19 @@ return {
|
|||
end,
|
||||
},
|
||||
}
|
||||
for _, pos in ipairs({ "top", "bottom", "left", "right" }) do
|
||||
opts[pos] = opts[pos] or {}
|
||||
table.insert(opts[pos], {
|
||||
ft = "trouble",
|
||||
filter = function(_buf, win)
|
||||
return vim.w[win].trouble
|
||||
and vim.w[win].trouble.position == pos
|
||||
and vim.w[win].trouble.type == "split"
|
||||
and vim.w[win].trouble.relative == "editor"
|
||||
and not vim.w[win].trouble_preview
|
||||
end,
|
||||
})
|
||||
end
|
||||
return opts
|
||||
end,
|
||||
},
|
||||
|
|
|
|||
|
|
@ -1,37 +1,36 @@
|
|||
-- animations
|
||||
return {
|
||||
-- animations
|
||||
{
|
||||
"echasnovski/mini.animate",
|
||||
event = "VeryLazy",
|
||||
opts = function()
|
||||
-- don't use animate when scrolling with the mouse
|
||||
local mouse_scrolled = false
|
||||
for _, scroll in ipairs({ "Up", "Down" }) do
|
||||
local key = "<ScrollWheel" .. scroll .. ">"
|
||||
vim.keymap.set({ "", "i" }, key, function()
|
||||
mouse_scrolled = true
|
||||
return key
|
||||
end, { expr = true })
|
||||
end
|
||||
"echasnovski/mini.animate",
|
||||
recommended = true,
|
||||
event = "VeryLazy",
|
||||
opts = function()
|
||||
-- don't use animate when scrolling with the mouse
|
||||
local mouse_scrolled = false
|
||||
for _, scroll in ipairs({ "Up", "Down" }) do
|
||||
local key = "<ScrollWheel" .. scroll .. ">"
|
||||
vim.keymap.set({ "", "i" }, key, function()
|
||||
mouse_scrolled = true
|
||||
return key
|
||||
end, { expr = true })
|
||||
end
|
||||
|
||||
local animate = require("mini.animate")
|
||||
return {
|
||||
resize = {
|
||||
timing = animate.gen_timing.linear({ duration = 100, unit = "total" }),
|
||||
},
|
||||
scroll = {
|
||||
timing = animate.gen_timing.linear({ duration = 150, unit = "total" }),
|
||||
subscroll = animate.gen_subscroll.equal({
|
||||
predicate = function(total_scroll)
|
||||
if mouse_scrolled then
|
||||
mouse_scrolled = false
|
||||
return false
|
||||
end
|
||||
return total_scroll > 1
|
||||
end,
|
||||
}),
|
||||
},
|
||||
}
|
||||
end,
|
||||
},
|
||||
local animate = require("mini.animate")
|
||||
return {
|
||||
resize = {
|
||||
timing = animate.gen_timing.linear({ duration = 50, unit = "total" }),
|
||||
},
|
||||
scroll = {
|
||||
timing = animate.gen_timing.linear({ duration = 150, unit = "total" }),
|
||||
subscroll = animate.gen_subscroll.equal({
|
||||
predicate = function(total_scroll)
|
||||
if mouse_scrolled then
|
||||
mouse_scrolled = false
|
||||
return false
|
||||
end
|
||||
return total_scroll > 1
|
||||
end,
|
||||
}),
|
||||
},
|
||||
}
|
||||
end,
|
||||
}
|
||||
|
|
|
|||
42
lua/lazyvim/plugins/extras/ui/mini-indentscope.lua
Normal file
42
lua/lazyvim/plugins/extras/ui/mini-indentscope.lua
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
return {
|
||||
-- Active indent guide and indent text objects. When you're browsing
|
||||
-- code, this highlights the current level of indentation, and animates
|
||||
-- the highlighting.
|
||||
{
|
||||
"echasnovski/mini.indentscope",
|
||||
version = false, -- wait till new 0.7.0 release to put it back on semver
|
||||
event = "LazyFile",
|
||||
opts = {
|
||||
-- symbol = "▏",
|
||||
symbol = "│",
|
||||
options = { try_as_border = true },
|
||||
},
|
||||
init = function()
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
pattern = {
|
||||
"help",
|
||||
"alpha",
|
||||
"dashboard",
|
||||
"neo-tree",
|
||||
"Trouble",
|
||||
"trouble",
|
||||
"lazy",
|
||||
"mason",
|
||||
"notify",
|
||||
"toggleterm",
|
||||
"lazyterm",
|
||||
},
|
||||
callback = function()
|
||||
vim.b.miniindentscope_disable = true
|
||||
end,
|
||||
})
|
||||
end,
|
||||
},
|
||||
{
|
||||
"lukas-reineke/indent-blankline.nvim",
|
||||
event = "LazyFile",
|
||||
opts = {
|
||||
scope = { enabled = false },
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
@ -63,12 +63,15 @@ return {
|
|||
|
||||
vim.api.nvim_create_autocmd("User", {
|
||||
pattern = "LazyVimStarted",
|
||||
callback = function()
|
||||
callback = function(ev)
|
||||
local stats = require("lazy").stats()
|
||||
local ms = (math.floor(stats.startuptime * 100 + 0.5) / 100)
|
||||
local pad_footer = string.rep(" ", 8)
|
||||
starter.config.footer = pad_footer .. "⚡ Neovim loaded " .. stats.count .. " plugins in " .. ms .. "ms"
|
||||
pcall(starter.refresh)
|
||||
-- INFO: based on @echasnovski's recommendation (thanks a lot!!!)
|
||||
if vim.bo[ev.buf].filetype == "starter" then
|
||||
pcall(starter.refresh)
|
||||
end
|
||||
end,
|
||||
})
|
||||
end,
|
||||
|
|
|
|||
21
lua/lazyvim/plugins/extras/ui/treesitter-context.lua
Normal file
21
lua/lazyvim/plugins/extras/ui/treesitter-context.lua
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
-- Show context of the current function
|
||||
return {
|
||||
"nvim-treesitter/nvim-treesitter-context",
|
||||
event = "LazyFile",
|
||||
opts = { mode = "cursor", max_lines = 3 },
|
||||
keys = {
|
||||
{
|
||||
"<leader>ut",
|
||||
function()
|
||||
local tsc = require("treesitter-context")
|
||||
tsc.toggle()
|
||||
if LazyVim.inject.get_upvalue(tsc.toggle, "enabled") then
|
||||
LazyVim.info("Enabled Treesitter Context", { title = "Option" })
|
||||
else
|
||||
LazyVim.warn("Disabled Treesitter Context", { title = "Option" })
|
||||
end
|
||||
end,
|
||||
desc = "Toggle Treesitter Context",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
@ -3,35 +3,27 @@ local xdg_config = vim.env.XDG_CONFIG_HOME or vim.env.HOME .. "/.config"
|
|||
|
||||
---@param path string
|
||||
local function have(path)
|
||||
return vim.loop.fs_stat(xdg_config .. "/" .. path) ~= nil
|
||||
return vim.uv.fs_stat(xdg_config .. "/" .. path) ~= nil
|
||||
end
|
||||
|
||||
return {
|
||||
|
||||
-- Add Hyprland Parser
|
||||
recommended = true,
|
||||
desc = "Language support for dotfiles",
|
||||
{
|
||||
"luckasRanarison/tree-sitter-hypr",
|
||||
enabled = function()
|
||||
return have("hypr")
|
||||
end,
|
||||
event = "BufRead */hypr/*.conf",
|
||||
build = ":TSUpdate hypr",
|
||||
config = function()
|
||||
-- Fix ft detection for hyprland
|
||||
vim.filetype.add({
|
||||
pattern = { [".*/hypr/.*%.conf"] = "hypr" },
|
||||
})
|
||||
require("nvim-treesitter.parsers").get_parser_configs().hypr = {
|
||||
install_info = {
|
||||
url = "https://github.com/luckasRanarison/tree-sitter-hypr",
|
||||
files = { "src/parser.c" },
|
||||
branch = "master",
|
||||
},
|
||||
filetype = "hypr",
|
||||
}
|
||||
"neovim/nvim-lspconfig",
|
||||
opts = {
|
||||
servers = {
|
||||
bashls = {},
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"williamboman/mason.nvim",
|
||||
opts = function(_, opts)
|
||||
opts.ensure_installed = opts.ensure_installed or {}
|
||||
vim.list_extend(opts.ensure_installed, { "shellcheck" })
|
||||
end,
|
||||
},
|
||||
|
||||
-- add some stuff to treesitter
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
|
|
@ -43,16 +35,25 @@ return {
|
|||
end
|
||||
|
||||
vim.filetype.add({
|
||||
extension = { rasi = "rasi" },
|
||||
extension = { rasi = "rasi", rofi = "rasi", wofi = "rasi" },
|
||||
filename = {
|
||||
["vifmrc"] = "vim",
|
||||
},
|
||||
pattern = {
|
||||
[".*/waybar/config"] = "jsonc",
|
||||
[".*/mako/config"] = "dosini",
|
||||
[".*/kitty/*.conf"] = "bash",
|
||||
[".*/kitty/.+%.conf"] = "bash",
|
||||
[".*/hypr/.+%.conf"] = "hyprlang",
|
||||
["%.env%.[%w_.-]+"] = "sh",
|
||||
},
|
||||
})
|
||||
|
||||
add("git_config")
|
||||
|
||||
if have("hypr") then
|
||||
add("hyprlang")
|
||||
end
|
||||
|
||||
if have("fish") then
|
||||
add("fish")
|
||||
end
|
||||
|
|
|
|||
38
lua/lazyvim/plugins/extras/util/gitui.lua
Normal file
38
lua/lazyvim/plugins/extras/util/gitui.lua
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
return {
|
||||
|
||||
-- Ensure GitUI tool is installed
|
||||
{
|
||||
"williamboman/mason.nvim",
|
||||
keys = {
|
||||
{
|
||||
"<leader>gG",
|
||||
function()
|
||||
LazyVim.terminal.open({ "gitui" }, { esc_esc = false, ctrl_hjkl = false })
|
||||
end,
|
||||
desc = "GitUi (cwd)",
|
||||
},
|
||||
{
|
||||
"<leader>gg",
|
||||
function()
|
||||
LazyVim.terminal.open({ "gitui" }, { cwd = LazyVim.root.get(), esc_esc = false, ctrl_hjkl = false })
|
||||
end,
|
||||
desc = "GitUi (Root Dir)",
|
||||
},
|
||||
},
|
||||
init = function()
|
||||
-- delete lazygit keymap for file history
|
||||
vim.api.nvim_create_autocmd("User", {
|
||||
pattern = "LazyVimKeymaps",
|
||||
once = true,
|
||||
callback = function()
|
||||
pcall(vim.keymap.del, "n", "<leader>gf")
|
||||
pcall(vim.keymap.del, "n", "<leader>gl")
|
||||
end,
|
||||
})
|
||||
end,
|
||||
opts = function(_, opts)
|
||||
opts.ensure_installed = opts.ensure_installed or {}
|
||||
vim.list_extend(opts.ensure_installed, { "gitui" })
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
|
@ -5,6 +5,8 @@ M.hl = {}
|
|||
|
||||
M.plugin = {
|
||||
"echasnovski/mini.hipatterns",
|
||||
recommended = true,
|
||||
desc = "Highlight colors in your code. Also includes Tailwind CSS support.",
|
||||
event = "LazyFile",
|
||||
opts = function()
|
||||
local hi = require("mini.hipatterns")
|
||||
|
|
@ -12,25 +14,42 @@ M.plugin = {
|
|||
-- custom LazyVim option to enable the tailwind integration
|
||||
tailwind = {
|
||||
enabled = true,
|
||||
ft = { "typescriptreact", "javascriptreact", "css", "javascript", "typescript", "html" },
|
||||
ft = {
|
||||
"astro",
|
||||
"css",
|
||||
"heex",
|
||||
"html",
|
||||
"html-eex",
|
||||
"javascript",
|
||||
"javascriptreact",
|
||||
"rust",
|
||||
"svelte",
|
||||
"typescript",
|
||||
"typescriptreact",
|
||||
"vue",
|
||||
},
|
||||
-- full: the whole css class will be highlighted
|
||||
-- compact: only the color will be highlighted
|
||||
style = "full",
|
||||
},
|
||||
highlighters = {
|
||||
hex_color = hi.gen_highlighter.hex_color({ priority = 2000 }),
|
||||
shorthand = {
|
||||
pattern = "()#%x%x%x()%f[^%x%w]",
|
||||
group = function(_, _, data)
|
||||
---@type string
|
||||
local match = data.full_match
|
||||
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
|
||||
|
||||
return MiniHipatterns.compute_hex_color_group(hex_color, "bg")
|
||||
end,
|
||||
extmark_opts = { priority = 2000 },
|
||||
},
|
||||
},
|
||||
}
|
||||
end,
|
||||
config = function(_, opts)
|
||||
-- backward compatibility
|
||||
if opts.tailwind == true then
|
||||
opts.tailwind = {
|
||||
enabled = true,
|
||||
ft = { "typescriptreact", "javascriptreact", "css", "javascript", "typescript", "html" },
|
||||
style = "full",
|
||||
}
|
||||
end
|
||||
if type(opts.tailwind) == "table" and opts.tailwind.enabled then
|
||||
-- reset hl groups when colorscheme changes
|
||||
vim.api.nvim_create_autocmd("ColorScheme", {
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ return {
|
|||
event = "VeryLazy",
|
||||
config = function(_, opts)
|
||||
require("project_nvim").setup(opts)
|
||||
require("lazyvim.util").on_load("telescope.nvim", function()
|
||||
LazyVim.on_load("telescope.nvim", function()
|
||||
require("telescope").load_extension("projects")
|
||||
end)
|
||||
end,
|
||||
|
|
|
|||
8
lua/lazyvim/plugins/extras/util/startuptime.lua
Normal file
8
lua/lazyvim/plugins/extras/util/startuptime.lua
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
-- measure startuptime
|
||||
return {
|
||||
"dstein64/vim-startuptime",
|
||||
cmd = "StartupTime",
|
||||
config = function()
|
||||
vim.g.startuptime_tries = 10
|
||||
end,
|
||||
}
|
||||
|
|
@ -3,17 +3,21 @@ if not vim.g.vscode then
|
|||
end
|
||||
|
||||
local enabled = {
|
||||
"dial.nvim",
|
||||
"flit.nvim",
|
||||
"lazy.nvim",
|
||||
"leap.nvim",
|
||||
"mini.ai",
|
||||
"mini.comment",
|
||||
"mini.move",
|
||||
"mini.pairs",
|
||||
"mini.surround",
|
||||
"nvim-treesitter",
|
||||
"nvim-treesitter-textobjects",
|
||||
"nvim-ts-context-commentstring",
|
||||
"ts-comments.nvim",
|
||||
"vim-repeat",
|
||||
"yanky.nvim",
|
||||
"LazyVim",
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
local Util = require("lazyvim.util")
|
||||
|
||||
local M = {}
|
||||
|
||||
---@param opts ConformOpts
|
||||
|
|
@ -10,14 +8,17 @@ function M.setup(_, opts)
|
|||
if formatter.extra_args then
|
||||
---@diagnostic disable-next-line: undefined-field
|
||||
formatter.prepend_args = formatter.extra_args
|
||||
Util.deprecate(("opts.formatters.%s.extra_args"):format(name), ("opts.formatters.%s.prepend_args"):format(name))
|
||||
LazyVim.deprecate(
|
||||
("opts.formatters.%s.extra_args"):format(name),
|
||||
("opts.formatters.%s.prepend_args"):format(name)
|
||||
)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
for _, key in ipairs({ "format_on_save", "format_after_save" }) do
|
||||
if opts[key] then
|
||||
Util.warn(
|
||||
LazyVim.warn(
|
||||
("Don't set `opts.%s` for `conform.nvim`.\n**LazyVim** will use the conform formatter automatically"):format(
|
||||
key
|
||||
)
|
||||
|
|
@ -39,7 +40,7 @@ return {
|
|||
{
|
||||
"<leader>cF",
|
||||
function()
|
||||
require("conform").format({ formatters = { "injected" } })
|
||||
require("conform").format({ formatters = { "injected" }, timeout_ms = 3000 })
|
||||
end,
|
||||
mode = { "n", "v" },
|
||||
desc = "Format Injected Langs",
|
||||
|
|
@ -47,16 +48,14 @@ return {
|
|||
},
|
||||
init = function()
|
||||
-- Install the conform formatter on VeryLazy
|
||||
require("lazyvim.util").on_very_lazy(function()
|
||||
require("lazyvim.util").format.register({
|
||||
LazyVim.on_very_lazy(function()
|
||||
LazyVim.format.register({
|
||||
name = "conform.nvim",
|
||||
priority = 100,
|
||||
primary = true,
|
||||
format = function(buf)
|
||||
local plugin = require("lazy.core.config").plugins["conform.nvim"]
|
||||
local Plugin = require("lazy.core.plugin")
|
||||
local opts = Plugin.values(plugin, "opts", false)
|
||||
require("conform").format(Util.merge(opts.format, { bufnr = buf }))
|
||||
local opts = LazyVim.opts("conform.nvim")
|
||||
require("conform").format(LazyVim.merge({}, opts.format, { bufnr = buf }))
|
||||
end,
|
||||
sources = function(buf)
|
||||
local ret = require("conform").list_formatters(buf)
|
||||
|
|
@ -71,7 +70,7 @@ return {
|
|||
opts = function()
|
||||
local plugin = require("lazy.core.config").plugins["conform.nvim"]
|
||||
if plugin.config ~= M.setup then
|
||||
Util.error({
|
||||
LazyVim.error({
|
||||
"Don't set `plugin.config` for `conform.nvim`.\n",
|
||||
"This will break **LazyVim** formatting.\n",
|
||||
"Please refer to the docs at https://www.lazyvim.org/plugins/formatting",
|
||||
|
|
@ -84,6 +83,7 @@ return {
|
|||
timeout_ms = 3000,
|
||||
async = false, -- not recommended to change
|
||||
quiet = false, -- not recommended to change
|
||||
lsp_fallback = true, -- not recommended to change
|
||||
},
|
||||
---@type table<string, conform.FormatterUnit[]>
|
||||
formatters_by_ft = {
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ return {
|
|||
-- ['*'] = { 'global linter' },
|
||||
-- Use the "_" filetype to run linters on filetypes that don't have other linters configured.
|
||||
-- ['_'] = { 'fallback linter' },
|
||||
-- ["*"] = { "typos" },
|
||||
},
|
||||
-- LazyVim extension to easily override linter options
|
||||
-- or add custom linters.
|
||||
|
|
@ -27,8 +28,6 @@ return {
|
|||
},
|
||||
},
|
||||
config = function(_, opts)
|
||||
local Util = require("lazyvim.util")
|
||||
|
||||
local M = {}
|
||||
|
||||
local lint = require("lint")
|
||||
|
|
@ -42,7 +41,7 @@ return {
|
|||
lint.linters_by_ft = opts.linters_by_ft
|
||||
|
||||
function M.debounce(ms, fn)
|
||||
local timer = vim.loop.new_timer()
|
||||
local timer = vim.uv.new_timer()
|
||||
return function(...)
|
||||
local argv = { ... }
|
||||
timer:start(ms, 0, function()
|
||||
|
|
@ -59,6 +58,9 @@ return {
|
|||
-- * this differs from conform.nvim which only uses the first filetype that has a formatter
|
||||
local names = lint._resolve_linter_by_ft(vim.bo.filetype)
|
||||
|
||||
-- Create a copy of the names table to avoid modifying the original.
|
||||
names = vim.list_extend({}, names)
|
||||
|
||||
-- Add fallback linters.
|
||||
if #names == 0 then
|
||||
vim.list_extend(names, lint.linters_by_ft["_"] or {})
|
||||
|
|
@ -73,7 +75,7 @@ return {
|
|||
names = vim.tbl_filter(function(name)
|
||||
local linter = lint.linters[name]
|
||||
if not linter then
|
||||
Util.warn("Linter not found: " .. name, { title = "nvim-lint" })
|
||||
LazyVim.warn("Linter not found: " .. name, { title = "nvim-lint" })
|
||||
end
|
||||
return linter and not (type(linter) == "table" and linter.condition and not linter.condition(ctx))
|
||||
end, names)
|
||||
|
|
|
|||
|
|
@ -1,128 +1,170 @@
|
|||
local Util = require("lazyvim.util")
|
||||
|
||||
return {
|
||||
-- lspconfig
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
event = "LazyFile",
|
||||
dependencies = {
|
||||
{ "folke/neoconf.nvim", cmd = "Neoconf", config = false, dependencies = { "nvim-lspconfig" } },
|
||||
{ "folke/neodev.nvim", opts = {} },
|
||||
"mason.nvim",
|
||||
"williamboman/mason-lspconfig.nvim",
|
||||
},
|
||||
---@class PluginLspOpts
|
||||
opts = {
|
||||
-- options for vim.diagnostic.config()
|
||||
diagnostics = {
|
||||
underline = true,
|
||||
update_in_insert = false,
|
||||
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",
|
||||
opts = function()
|
||||
return {
|
||||
-- options for vim.diagnostic.config()
|
||||
---@type vim.diagnostic.Opts
|
||||
diagnostics = {
|
||||
underline = true,
|
||||
update_in_insert = false,
|
||||
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,
|
||||
signs = {
|
||||
text = {
|
||||
[vim.diagnostic.severity.ERROR] = LazyVim.config.icons.diagnostics.Error,
|
||||
[vim.diagnostic.severity.WARN] = LazyVim.config.icons.diagnostics.Warn,
|
||||
[vim.diagnostic.severity.HINT] = LazyVim.config.icons.diagnostics.Hint,
|
||||
[vim.diagnostic.severity.INFO] = LazyVim.config.icons.diagnostics.Info,
|
||||
},
|
||||
},
|
||||
},
|
||||
severity_sort = true,
|
||||
},
|
||||
-- Enable this to enable the builtin LSP inlay hints on Neovim >= 0.10.0
|
||||
-- Be aware that you also will need to properly configure your LSP server to
|
||||
-- provide the inlay hints.
|
||||
inlay_hints = {
|
||||
enabled = false,
|
||||
},
|
||||
-- add any global capabilities here
|
||||
capabilities = {},
|
||||
-- options for vim.lsp.buf.format
|
||||
-- `bufnr` and `filter` is handled by the LazyVim formatter,
|
||||
-- but can be also overridden when specified
|
||||
format = {
|
||||
formatting_options = nil,
|
||||
timeout_ms = nil,
|
||||
},
|
||||
-- LSP Server Settings
|
||||
---@type lspconfig.options
|
||||
servers = {
|
||||
lua_ls = {
|
||||
-- mason = false, -- set to false if you don't want this server to be installed with mason
|
||||
-- Use this to add any additional keymaps
|
||||
-- for specific lsp servers
|
||||
---@type LazyKeysSpec[]
|
||||
-- keys = {},
|
||||
settings = {
|
||||
Lua = {
|
||||
workspace = {
|
||||
checkThirdParty = false,
|
||||
},
|
||||
completion = {
|
||||
callSnippet = "Replace",
|
||||
-- Enable this to enable the builtin LSP inlay hints on Neovim >= 0.10.0
|
||||
-- Be aware that you also will need to properly configure your LSP server to
|
||||
-- provide the inlay hints.
|
||||
inlay_hints = {
|
||||
enabled = true,
|
||||
exclude = {}, -- filetypes for which you don't want to enable inlay hints
|
||||
},
|
||||
-- Enable this to enable the builtin LSP code lenses on Neovim >= 0.10.0
|
||||
-- Be aware that you also will need to properly configure your LSP server to
|
||||
-- provide the code lenses.
|
||||
codelens = {
|
||||
enabled = false,
|
||||
},
|
||||
-- Enable lsp cursor word highlighting
|
||||
document_highlight = {
|
||||
enabled = true,
|
||||
},
|
||||
-- add any global capabilities here
|
||||
capabilities = {
|
||||
workspace = {
|
||||
fileOperations = {
|
||||
didRename = true,
|
||||
willRename = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
-- options for vim.lsp.buf.format
|
||||
-- `bufnr` and `filter` is handled by the LazyVim formatter,
|
||||
-- but can be also overridden when specified
|
||||
format = {
|
||||
formatting_options = nil,
|
||||
timeout_ms = nil,
|
||||
},
|
||||
-- LSP Server Settings
|
||||
---@type lspconfig.options
|
||||
servers = {
|
||||
lua_ls = {
|
||||
-- mason = false, -- set to false if you don't want this server to be installed with mason
|
||||
-- Use this to add any additional keymaps
|
||||
-- for specific lsp servers
|
||||
-- ---@type LazyKeysSpec[]
|
||||
-- keys = {},
|
||||
settings = {
|
||||
Lua = {
|
||||
workspace = {
|
||||
checkThirdParty = false,
|
||||
},
|
||||
codeLens = {
|
||||
enable = true,
|
||||
},
|
||||
completion = {
|
||||
callSnippet = "Replace",
|
||||
},
|
||||
doc = {
|
||||
privateName = { "^_" },
|
||||
},
|
||||
hint = {
|
||||
enable = true,
|
||||
setType = false,
|
||||
paramType = true,
|
||||
paramName = "Disable",
|
||||
semicolon = "Disable",
|
||||
arrayIndex = "Disable",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
-- you can do any additional lsp server setup here
|
||||
-- return true if you don't want this server to be setup with lspconfig
|
||||
---@type table<string, fun(server:string, opts:_.lspconfig.options):boolean?>
|
||||
setup = {
|
||||
-- example to setup with typescript.nvim
|
||||
-- tsserver = function(_, opts)
|
||||
-- require("typescript").setup({ server = opts })
|
||||
-- return true
|
||||
-- end,
|
||||
-- Specify * to use this function as a fallback for any server
|
||||
-- ["*"] = function(server, opts) end,
|
||||
},
|
||||
},
|
||||
-- you can do any additional lsp server setup here
|
||||
-- return true if you don't want this server to be setup with lspconfig
|
||||
---@type table<string, fun(server:string, opts:_.lspconfig.options):boolean?>
|
||||
setup = {
|
||||
-- example to setup with typescript.nvim
|
||||
-- tsserver = function(_, opts)
|
||||
-- require("typescript").setup({ server = opts })
|
||||
-- return true
|
||||
-- end,
|
||||
-- Specify * to use this function as a fallback for any server
|
||||
-- ["*"] = function(server, opts) end,
|
||||
},
|
||||
}
|
||||
end,
|
||||
---@param opts PluginLspOpts
|
||||
config = function(_, opts)
|
||||
if Util.has("neoconf.nvim") then
|
||||
local plugin = require("lazy.core.config").spec.plugins["neoconf.nvim"]
|
||||
require("neoconf").setup(require("lazy.core.plugin").values(plugin, "opts", false))
|
||||
end
|
||||
|
||||
-- setup autoformat
|
||||
Util.format.register(Util.lsp.formatter())
|
||||
|
||||
-- deprectaed options
|
||||
if opts.autoformat ~= nil then
|
||||
vim.g.autoformat = opts.autoformat
|
||||
Util.deprecate("nvim-lspconfig.opts.autoformat", "vim.g.autoformat")
|
||||
end
|
||||
LazyVim.format.register(LazyVim.lsp.formatter())
|
||||
|
||||
-- setup keymaps
|
||||
Util.lsp.on_attach(function(client, buffer)
|
||||
LazyVim.lsp.on_attach(function(client, buffer)
|
||||
require("lazyvim.plugins.lsp.keymaps").on_attach(client, buffer)
|
||||
end)
|
||||
|
||||
local register_capability = vim.lsp.handlers["client/registerCapability"]
|
||||
LazyVim.lsp.setup()
|
||||
LazyVim.lsp.on_dynamic_capability(require("lazyvim.plugins.lsp.keymaps").on_attach)
|
||||
|
||||
vim.lsp.handlers["client/registerCapability"] = function(err, res, ctx)
|
||||
local ret = register_capability(err, res, ctx)
|
||||
local client_id = ctx.client_id
|
||||
---@type lsp.Client
|
||||
local client = vim.lsp.get_client_by_id(client_id)
|
||||
local buffer = vim.api.nvim_get_current_buf()
|
||||
require("lazyvim.plugins.lsp.keymaps").on_attach(client, buffer)
|
||||
return ret
|
||||
end
|
||||
LazyVim.lsp.words.setup(opts.document_highlight)
|
||||
|
||||
-- diagnostics
|
||||
for name, icon in pairs(require("lazyvim.config").icons.diagnostics) do
|
||||
name = "DiagnosticSign" .. name
|
||||
vim.fn.sign_define(name, { text = icon, texthl = name, numhl = "" })
|
||||
end
|
||||
|
||||
local inlay_hint = vim.lsp.buf.inlay_hint or vim.lsp.inlay_hint
|
||||
|
||||
if opts.inlay_hints.enabled and inlay_hint then
|
||||
Util.lsp.on_attach(function(client, buffer)
|
||||
if client.supports_method("textDocument/inlayHint") then
|
||||
inlay_hint(buffer, true)
|
||||
-- diagnostics signs
|
||||
if vim.fn.has("nvim-0.10.0") == 0 then
|
||||
if type(opts.diagnostics.signs) ~= "boolean" then
|
||||
for severity, icon in pairs(opts.diagnostics.signs.text) do
|
||||
local name = vim.diagnostic.severity[severity]:lower():gsub("^%l", string.upper)
|
||||
name = "DiagnosticSign" .. name
|
||||
vim.fn.sign_define(name, { text = icon, texthl = name, numhl = "" })
|
||||
end
|
||||
end)
|
||||
end
|
||||
end
|
||||
|
||||
if vim.fn.has("nvim-0.10") == 1 then
|
||||
-- inlay hints
|
||||
if opts.inlay_hints.enabled then
|
||||
LazyVim.lsp.on_supports_method("textDocument/inlayHint", function(client, buffer)
|
||||
if
|
||||
vim.api.nvim_buf_is_valid(buffer)
|
||||
and vim.bo[buffer].buftype == ""
|
||||
and not vim.tbl_contains(opts.inlay_hints.exclude, vim.bo[buffer].filetype)
|
||||
then
|
||||
LazyVim.toggle.inlay_hints(buffer, true)
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
-- code lens
|
||||
if opts.codelens.enabled and vim.lsp.codelens then
|
||||
LazyVim.lsp.on_supports_method("textDocument/codeLens", function(client, buffer)
|
||||
vim.lsp.codelens.refresh()
|
||||
vim.api.nvim_create_autocmd({ "BufEnter", "CursorHold", "InsertLeave" }, {
|
||||
buffer = buffer,
|
||||
callback = vim.lsp.codelens.refresh,
|
||||
})
|
||||
end)
|
||||
end
|
||||
end
|
||||
|
||||
if type(opts.diagnostics.virtual_text) == "table" and opts.diagnostics.virtual_text.prefix == "icons" then
|
||||
|
|
@ -177,24 +219,36 @@ return {
|
|||
for server, server_opts in pairs(servers) do
|
||||
if server_opts then
|
||||
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
|
||||
if server_opts.mason == false or not vim.tbl_contains(all_mslp_servers, server) then
|
||||
setup(server)
|
||||
else
|
||||
ensure_installed[#ensure_installed + 1] = server
|
||||
if server_opts.enabled ~= false then
|
||||
-- run manual setup if mason=false or if this is a server that cannot be installed with mason-lspconfig
|
||||
if server_opts.mason == false or not vim.tbl_contains(all_mslp_servers, server) then
|
||||
setup(server)
|
||||
else
|
||||
ensure_installed[#ensure_installed + 1] = server
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if have_mason then
|
||||
mlsp.setup({ ensure_installed = ensure_installed, handlers = { setup } })
|
||||
mlsp.setup({
|
||||
ensure_installed = vim.tbl_deep_extend(
|
||||
"force",
|
||||
ensure_installed,
|
||||
LazyVim.opts("mason-lspconfig.nvim").ensure_installed or {}
|
||||
),
|
||||
handlers = { setup },
|
||||
})
|
||||
end
|
||||
|
||||
if Util.lsp.get_config("denols") and Util.lsp.get_config("tsserver") then
|
||||
if LazyVim.lsp.is_enabled("denols") and LazyVim.lsp.is_enabled("vtsls") then
|
||||
local is_deno = require("lspconfig.util").root_pattern("deno.json", "deno.jsonc")
|
||||
Util.lsp.disable("tsserver", is_deno)
|
||||
Util.lsp.disable("denols", function(root_dir)
|
||||
return not is_deno(root_dir)
|
||||
LazyVim.lsp.disable("vtsls", is_deno)
|
||||
LazyVim.lsp.disable("denols", function(root_dir, config)
|
||||
if not is_deno(root_dir) then
|
||||
config.settings.deno.enable = false
|
||||
end
|
||||
return false
|
||||
end)
|
||||
end
|
||||
end,
|
||||
|
|
@ -227,19 +281,15 @@ return {
|
|||
})
|
||||
end, 100)
|
||||
end)
|
||||
local function ensure_installed()
|
||||
|
||||
mr.refresh(function()
|
||||
for _, tool in ipairs(opts.ensure_installed) do
|
||||
local p = mr.get_package(tool)
|
||||
if not p:is_installed() then
|
||||
p:install()
|
||||
end
|
||||
end
|
||||
end
|
||||
if mr.refresh then
|
||||
mr.refresh(ensure_installed)
|
||||
else
|
||||
ensure_installed()
|
||||
end
|
||||
end)
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@ local M = {}
|
|||
---@type LazyKeysLspSpec[]|nil
|
||||
M._keys = nil
|
||||
|
||||
---@alias LazyKeysLspSpec LazyKeysSpec|{has?:string}
|
||||
---@alias LazyKeysLsp LazyKeys|{has?:string}
|
||||
---@alias LazyKeysLspSpec LazyKeysSpec|{has?:string|string[], cond?:fun():boolean}
|
||||
---@alias LazyKeysLsp LazyKeys|{has?:string|string[], cond?:fun():boolean}
|
||||
|
||||
---@return LazyKeysLspSpec[]
|
||||
function M.get()
|
||||
|
|
@ -15,7 +15,7 @@ function M.get()
|
|||
M._keys = {
|
||||
{ "<leader>cl", "<cmd>LspInfo<cr>", desc = "Lsp Info" },
|
||||
{ "gd", function() require("telescope.builtin").lsp_definitions({ reuse_win = true }) end, desc = "Goto Definition", has = "definition" },
|
||||
{ "gr", "<cmd>Telescope lsp_references<cr>", desc = "References" },
|
||||
{ "gr", "<cmd>Telescope lsp_references<cr>", desc = "References", nowait = true },
|
||||
{ "gD", vim.lsp.buf.declaration, desc = "Goto Declaration" },
|
||||
{ "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" },
|
||||
|
|
@ -23,6 +23,10 @@ function M.get()
|
|||
{ "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" },
|
||||
{ "<leader>ca", vim.lsp.buf.code_action, desc = "Code Action", mode = { "n", "v" }, has = "codeAction" },
|
||||
{ "<leader>cc", vim.lsp.codelens.run, desc = "Run Codelens", mode = { "n", "v" }, has = "codeLens" },
|
||||
{ "<leader>cC", vim.lsp.codelens.refresh, desc = "Refresh & Display Codelens", mode = { "n" }, has = "codeLens" },
|
||||
{ "<leader>cR", LazyVim.lsp.rename_file, desc = "Rename File", mode ={"n"}, has = { "workspace/didRenameFiles", "workspace/willRenameFiles" } },
|
||||
{ "<leader>cr", vim.lsp.buf.rename, desc = "Rename", has = "rename" },
|
||||
{
|
||||
"<leader>cA",
|
||||
function()
|
||||
|
|
@ -37,29 +41,32 @@ function M.get()
|
|||
end,
|
||||
desc = "Source Action",
|
||||
has = "codeAction",
|
||||
}
|
||||
},
|
||||
{ "]]", function() LazyVim.lsp.words.jump(vim.v.count1) end, has = "documentHighlight",
|
||||
desc = "Next Reference", cond = function() return LazyVim.lsp.words.enabled end },
|
||||
{ "[[", function() LazyVim.lsp.words.jump(-vim.v.count1) end, has = "documentHighlight",
|
||||
desc = "Prev Reference", cond = function() return LazyVim.lsp.words.enabled end },
|
||||
{ "<a-n>", function() LazyVim.lsp.words.jump(vim.v.count1, true) end, has = "documentHighlight",
|
||||
desc = "Next Reference", cond = function() return LazyVim.lsp.words.enabled end },
|
||||
{ "<a-p>", function() LazyVim.lsp.words.jump(-vim.v.count1, true) end, has = "documentHighlight",
|
||||
desc = "Prev Reference", cond = function() return LazyVim.lsp.words.enabled end },
|
||||
}
|
||||
if require("lazyvim.util").has("inc-rename.nvim") then
|
||||
M._keys[#M._keys + 1] = {
|
||||
"<leader>cr",
|
||||
function()
|
||||
local inc_rename = require("inc_rename")
|
||||
return ":" .. inc_rename.config.cmd_name .. " " .. vim.fn.expand("<cword>")
|
||||
end,
|
||||
expr = true,
|
||||
desc = "Rename",
|
||||
has = "rename",
|
||||
}
|
||||
else
|
||||
M._keys[#M._keys + 1] = { "<leader>cr", vim.lsp.buf.rename, desc = "Rename", has = "rename" }
|
||||
end
|
||||
|
||||
return M._keys
|
||||
end
|
||||
|
||||
---@param method string
|
||||
---@param method string|string[]
|
||||
function M.has(buffer, method)
|
||||
if type(method) == "table" then
|
||||
for _, m in ipairs(method) do
|
||||
if M.has(buffer, m) then
|
||||
return true
|
||||
end
|
||||
end
|
||||
return false
|
||||
end
|
||||
method = method:find("/") and method or "textDocument/" .. method
|
||||
local clients = require("lazyvim.util").lsp.get_clients({ bufnr = buffer })
|
||||
local clients = LazyVim.lsp.get_clients({ bufnr = buffer })
|
||||
for _, client in ipairs(clients) do
|
||||
if client.supports_method(method) then
|
||||
return true
|
||||
|
|
@ -68,15 +75,15 @@ function M.has(buffer, method)
|
|||
return false
|
||||
end
|
||||
|
||||
---@return (LazyKeys|{has?:string})[]
|
||||
---@return LazyKeysLsp[]
|
||||
function M.resolve(buffer)
|
||||
local Keys = require("lazy.core.handler.keys")
|
||||
if not Keys.resolve then
|
||||
return {}
|
||||
end
|
||||
local spec = M.get()
|
||||
local opts = require("lazyvim.util").opts("nvim-lspconfig")
|
||||
local clients = require("lazyvim.util").lsp.get_clients({ bufnr = buffer })
|
||||
local opts = LazyVim.opts("nvim-lspconfig")
|
||||
local clients = LazyVim.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)
|
||||
|
|
@ -89,8 +96,12 @@ function M.on_attach(_, buffer)
|
|||
local keymaps = M.resolve(buffer)
|
||||
|
||||
for _, keys in pairs(keymaps) do
|
||||
if not keys.has or M.has(buffer, keys.has) then
|
||||
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)
|
||||
opts.cond = nil
|
||||
opts.has = nil
|
||||
opts.silent = opts.silent ~= false
|
||||
opts.buffer = buffer
|
||||
|
|
|
|||
|
|
@ -7,46 +7,20 @@ return {
|
|||
version = false, -- last release is way too old and doesn't work on Windows
|
||||
build = ":TSUpdate",
|
||||
event = { "LazyFile", "VeryLazy" },
|
||||
lazy = vim.fn.argc(-1) == 0, -- load treesitter early when opening a file from the cmdline
|
||||
init = function(plugin)
|
||||
-- PERF: add nvim-treesitter queries to the rtp and it's custom query predicates early
|
||||
-- This is needed because a bunch of plugins no longer `require("nvim-treesitter")`, which
|
||||
-- no longer trigger the **nvim-treeitter** module to be loaded in time.
|
||||
-- Luckily, the only thins that those plugins need are the custom queries, which we make available
|
||||
-- no longer trigger the **nvim-treesitter** module to be loaded in time.
|
||||
-- Luckily, the only things that those plugins need are the custom queries, which we make available
|
||||
-- during startup.
|
||||
require("lazy.core.loader").add_to_rtp(plugin)
|
||||
require("nvim-treesitter.query_predicates")
|
||||
end,
|
||||
dependencies = {
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter-textobjects",
|
||||
config = function()
|
||||
-- When in diff mode, we want to use the default
|
||||
-- vim text objects c & C instead of the treesitter ones.
|
||||
local move = require("nvim-treesitter.textobjects.move") ---@type table<string,fun(...)>
|
||||
local configs = require("nvim-treesitter.configs")
|
||||
for name, fn in pairs(move) do
|
||||
if name:find("goto") == 1 then
|
||||
move[name] = function(q, ...)
|
||||
if vim.wo.diff then
|
||||
local config = configs.get_module("textobjects.move")[name] ---@type table<string,string>
|
||||
for key, query in pairs(config or {}) do
|
||||
if q == query and key:find("[%]%[][cC]") then
|
||||
vim.cmd("normal! " .. key)
|
||||
return
|
||||
end
|
||||
end
|
||||
end
|
||||
return fn(q, ...)
|
||||
end
|
||||
end
|
||||
end
|
||||
end,
|
||||
},
|
||||
},
|
||||
cmd = { "TSUpdateSync", "TSUpdate", "TSInstall" },
|
||||
keys = {
|
||||
{ "<c-space>", desc = "Increment selection" },
|
||||
{ "<bs>", desc = "Decrement selection", mode = "x" },
|
||||
{ "<c-space>", desc = "Increment Selection" },
|
||||
{ "<bs>", desc = "Decrement Selection", mode = "x" },
|
||||
},
|
||||
---@type TSConfig
|
||||
---@diagnostic disable-next-line: missing-fields
|
||||
|
|
@ -75,6 +49,7 @@ return {
|
|||
"typescript",
|
||||
"vim",
|
||||
"vimdoc",
|
||||
"xml",
|
||||
"yaml",
|
||||
},
|
||||
incremental_selection = {
|
||||
|
|
@ -99,42 +74,44 @@ return {
|
|||
---@param opts TSConfig
|
||||
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)
|
||||
opts.ensure_installed = LazyVim.dedup(opts.ensure_installed)
|
||||
end
|
||||
require("nvim-treesitter.configs").setup(opts)
|
||||
end,
|
||||
},
|
||||
|
||||
-- Show context of the current function
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter-context",
|
||||
event = "LazyFile",
|
||||
"nvim-treesitter/nvim-treesitter-textobjects",
|
||||
event = "VeryLazy",
|
||||
enabled = true,
|
||||
opts = { mode = "cursor", max_lines = 3 },
|
||||
keys = {
|
||||
{
|
||||
"<leader>ut",
|
||||
function()
|
||||
local Util = require("lazyvim.util")
|
||||
local tsc = require("treesitter-context")
|
||||
tsc.toggle()
|
||||
if Util.inject.get_upvalue(tsc.toggle, "enabled") then
|
||||
Util.info("Enabled Treesitter Context", { title = "Option" })
|
||||
else
|
||||
Util.warn("Disabled Treesitter Context", { title = "Option" })
|
||||
config = function()
|
||||
-- If treesitter is already loaded, we need to run config again for textobjects
|
||||
if LazyVim.is_loaded("nvim-treesitter") then
|
||||
local opts = LazyVim.opts("nvim-treesitter")
|
||||
require("nvim-treesitter.configs").setup({ textobjects = opts.textobjects })
|
||||
end
|
||||
|
||||
-- When in diff mode, we want to use the default
|
||||
-- vim text objects c & C instead of the treesitter ones.
|
||||
local move = require("nvim-treesitter.textobjects.move") ---@type table<string,fun(...)>
|
||||
local configs = require("nvim-treesitter.configs")
|
||||
for name, fn in pairs(move) do
|
||||
if name:find("goto") == 1 then
|
||||
move[name] = function(q, ...)
|
||||
if vim.wo.diff then
|
||||
local config = configs.get_module("textobjects.move")[name] ---@type table<string,string>
|
||||
for key, query in pairs(config or {}) do
|
||||
if q == query and key:find("[%]%[][cC]") then
|
||||
vim.cmd("normal! " .. key)
|
||||
return
|
||||
end
|
||||
end
|
||||
end
|
||||
return fn(q, ...)
|
||||
end
|
||||
end,
|
||||
desc = "Toggle Treesitter Context",
|
||||
},
|
||||
},
|
||||
end
|
||||
end
|
||||
end,
|
||||
},
|
||||
|
||||
-- Automatically add closing tags for HTML and JSX
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
local Util = require("lazyvim.util")
|
||||
|
||||
return {
|
||||
-- Better `vim.notify()`
|
||||
{
|
||||
|
|
@ -10,10 +8,11 @@ return {
|
|||
function()
|
||||
require("notify").dismiss({ silent = true, pending = true })
|
||||
end,
|
||||
desc = "Dismiss all Notifications",
|
||||
desc = "Dismiss All Notifications",
|
||||
},
|
||||
},
|
||||
opts = {
|
||||
stages = "static",
|
||||
timeout = 3000,
|
||||
max_height = function()
|
||||
return math.floor(vim.o.lines * 0.75)
|
||||
|
|
@ -27,8 +26,8 @@ return {
|
|||
},
|
||||
init = function()
|
||||
-- when noice is not enabled, install notify on VeryLazy
|
||||
if not Util.has("noice.nvim") then
|
||||
Util.on_very_lazy(function()
|
||||
if not LazyVim.has("noice.nvim") then
|
||||
LazyVim.on_very_lazy(function()
|
||||
vim.notify = require("notify")
|
||||
end)
|
||||
end
|
||||
|
|
@ -59,24 +58,24 @@ return {
|
|||
"akinsho/bufferline.nvim",
|
||||
event = "VeryLazy",
|
||||
keys = {
|
||||
{ "<leader>bp", "<Cmd>BufferLineTogglePin<CR>", desc = "Toggle pin" },
|
||||
{ "<leader>bP", "<Cmd>BufferLineGroupClose ungrouped<CR>", desc = "Delete non-pinned buffers" },
|
||||
{ "<leader>bo", "<Cmd>BufferLineCloseOthers<CR>", desc = "Delete other buffers" },
|
||||
{ "<leader>br", "<Cmd>BufferLineCloseRight<CR>", desc = "Delete buffers to the right" },
|
||||
{ "<leader>bl", "<Cmd>BufferLineCloseLeft<CR>", desc = "Delete buffers to the left" },
|
||||
{ "<S-h>", "<cmd>BufferLineCyclePrev<cr>", desc = "Prev buffer" },
|
||||
{ "<S-l>", "<cmd>BufferLineCycleNext<cr>", desc = "Next buffer" },
|
||||
{ "[b", "<cmd>BufferLineCyclePrev<cr>", desc = "Prev buffer" },
|
||||
{ "]b", "<cmd>BufferLineCycleNext<cr>", desc = "Next buffer" },
|
||||
{ "<leader>bp", "<Cmd>BufferLineTogglePin<CR>", desc = "Toggle Pin" },
|
||||
{ "<leader>bP", "<Cmd>BufferLineGroupClose ungrouped<CR>", desc = "Delete Non-Pinned Buffers" },
|
||||
{ "<leader>bo", "<Cmd>BufferLineCloseOthers<CR>", desc = "Delete Other Buffers" },
|
||||
{ "<leader>br", "<Cmd>BufferLineCloseRight<CR>", desc = "Delete Buffers to the Right" },
|
||||
{ "<leader>bl", "<Cmd>BufferLineCloseLeft<CR>", desc = "Delete Buffers to the Left" },
|
||||
{ "<S-h>", "<cmd>BufferLineCyclePrev<cr>", desc = "Prev Buffer" },
|
||||
{ "<S-l>", "<cmd>BufferLineCycleNext<cr>", desc = "Next Buffer" },
|
||||
{ "[b", "<cmd>BufferLineCyclePrev<cr>", desc = "Prev Buffer" },
|
||||
{ "]b", "<cmd>BufferLineCycleNext<cr>", desc = "Next Buffer" },
|
||||
{ "[B", "<cmd>BufferLineMovePrev<cr>", desc = "Move buffer prev" },
|
||||
{ "]B", "<cmd>BufferLineMoveNext<cr>", desc = "Move buffer next" },
|
||||
},
|
||||
opts = {
|
||||
options = {
|
||||
-- stylua: ignore
|
||||
close_command = function(n) require("mini.bufremove").delete(n, false) end,
|
||||
close_command = function(n) LazyVim.ui.bufremove(n) end,
|
||||
-- stylua: ignore
|
||||
right_mouse_command = function(n) require("mini.bufremove").delete(n, false) end,
|
||||
right_mouse_command = function(n) LazyVim.ui.bufremove(n) end,
|
||||
diagnostics = "nvim_lsp",
|
||||
always_show_bufferline = false,
|
||||
diagnostics_indicator = function(_, _, diag)
|
||||
|
|
@ -98,7 +97,7 @@ return {
|
|||
config = function(_, opts)
|
||||
require("bufferline").setup(opts)
|
||||
-- Fix bufferline when restoring a session
|
||||
vim.api.nvim_create_autocmd("BufAdd", {
|
||||
vim.api.nvim_create_autocmd({ "BufAdd", "BufDelete" }, {
|
||||
callback = function()
|
||||
vim.schedule(function()
|
||||
pcall(nvim_bufferline)
|
||||
|
|
@ -131,7 +130,7 @@ return {
|
|||
|
||||
vim.o.laststatus = vim.g.lualine_laststatus
|
||||
|
||||
return {
|
||||
local opts = {
|
||||
options = {
|
||||
theme = "auto",
|
||||
globalstatus = true,
|
||||
|
|
@ -142,7 +141,7 @@ return {
|
|||
lualine_b = { "branch" },
|
||||
|
||||
lualine_c = {
|
||||
Util.lualine.root_dir(),
|
||||
LazyVim.lualine.root_dir(),
|
||||
{
|
||||
"diagnostics",
|
||||
symbols = {
|
||||
|
|
@ -153,31 +152,32 @@ return {
|
|||
},
|
||||
},
|
||||
{ "filetype", icon_only = true, separator = "", padding = { left = 1, right = 0 } },
|
||||
{ Util.lualine.pretty_path() },
|
||||
{ LazyVim.lualine.pretty_path() },
|
||||
},
|
||||
lualine_x = {
|
||||
-- stylua: ignore
|
||||
{
|
||||
function() return require("noice").api.status.command.get() end,
|
||||
cond = function() return package.loaded["noice"] and require("noice").api.status.command.has() end,
|
||||
color = Util.ui.fg("Statement"),
|
||||
color = function() return LazyVim.ui.fg("Statement") end,
|
||||
},
|
||||
-- stylua: ignore
|
||||
{
|
||||
function() return require("noice").api.status.mode.get() end,
|
||||
cond = function() return package.loaded["noice"] and require("noice").api.status.mode.has() end,
|
||||
color = Util.ui.fg("Constant"),
|
||||
color = function() return LazyVim.ui.fg("Constant") end,
|
||||
},
|
||||
-- stylua: ignore
|
||||
{
|
||||
function() return " " .. require("dap").status() end,
|
||||
cond = function () return package.loaded["dap"] and require("dap").status() ~= "" end,
|
||||
color = Util.ui.fg("Debug"),
|
||||
cond = function() return package.loaded["dap"] and require("dap").status() ~= "" end,
|
||||
color = function() return LazyVim.ui.fg("Debug") end,
|
||||
},
|
||||
-- stylua: ignore
|
||||
{
|
||||
require("lazy.status").updates,
|
||||
cond = require("lazy.status").has_updates,
|
||||
color = Util.ui.fg("Special"),
|
||||
color = function() return LazyVim.ui.fg("Special") end,
|
||||
},
|
||||
{
|
||||
"diff",
|
||||
|
|
@ -210,6 +210,26 @@ return {
|
|||
},
|
||||
extensions = { "neo-tree", "lazy" },
|
||||
}
|
||||
|
||||
-- do not add trouble symbols if aerial is enabled
|
||||
if vim.g.trouble_lualine then
|
||||
local trouble = require("trouble")
|
||||
local symbols = trouble.statusline
|
||||
and trouble.statusline({
|
||||
mode = "symbols",
|
||||
groups = {},
|
||||
title = false,
|
||||
filter = { range = true },
|
||||
format = "{kind_icon}{symbol.name:Normal}",
|
||||
hl_group = "lualine_c_normal",
|
||||
})
|
||||
table.insert(opts.sections.lualine_c, {
|
||||
symbols and symbols.get,
|
||||
cond = symbols and symbols.has,
|
||||
})
|
||||
end
|
||||
|
||||
return opts
|
||||
end,
|
||||
},
|
||||
|
||||
|
|
@ -222,7 +242,7 @@ return {
|
|||
char = "│",
|
||||
tab_char = "│",
|
||||
},
|
||||
scope = { enabled = false },
|
||||
scope = { show_start = false, show_end = false },
|
||||
exclude = {
|
||||
filetypes = {
|
||||
"help",
|
||||
|
|
@ -242,45 +262,11 @@ return {
|
|||
main = "ibl",
|
||||
},
|
||||
|
||||
-- Active indent guide and indent text objects. When you're browsing
|
||||
-- code, this highlights the current level of indentation, and animates
|
||||
-- the highlighting.
|
||||
{
|
||||
"echasnovski/mini.indentscope",
|
||||
version = false, -- wait till new 0.7.0 release to put it back on semver
|
||||
event = "LazyFile",
|
||||
opts = {
|
||||
-- symbol = "▏",
|
||||
symbol = "│",
|
||||
options = { try_as_border = true },
|
||||
},
|
||||
init = function()
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
pattern = {
|
||||
"help",
|
||||
"alpha",
|
||||
"dashboard",
|
||||
"neo-tree",
|
||||
"Trouble",
|
||||
"trouble",
|
||||
"lazy",
|
||||
"mason",
|
||||
"notify",
|
||||
"toggleterm",
|
||||
"lazyterm",
|
||||
},
|
||||
callback = function()
|
||||
vim.b.miniindentscope_disable = true
|
||||
end,
|
||||
})
|
||||
end,
|
||||
},
|
||||
|
||||
-- Displays a popup with possible key bindings of the command you started typing
|
||||
{
|
||||
"folke/which-key.nvim",
|
||||
opts = function(_, opts)
|
||||
if require("lazyvim.util").has("noice.nvim") then
|
||||
if LazyVim.has("noice.nvim") then
|
||||
opts.defaults["<leader>sn"] = { name = "+noice" }
|
||||
end
|
||||
end,
|
||||
|
|
@ -315,7 +301,6 @@ return {
|
|||
bottom_search = true,
|
||||
command_palette = true,
|
||||
long_message_to_split = true,
|
||||
inc_rename = true,
|
||||
},
|
||||
},
|
||||
-- stylua: ignore
|
||||
|
|
@ -325,8 +310,9 @@ return {
|
|||
{ "<leader>snh", function() require("noice").cmd("history") end, desc = "Noice History" },
|
||||
{ "<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-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"}},
|
||||
{ "<leader>snt", function() require("noice").cmd("telescope") end, desc = "Noice Telescope" },
|
||||
{ "<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"}},
|
||||
},
|
||||
},
|
||||
|
||||
|
|
@ -336,22 +322,9 @@ return {
|
|||
-- ui components
|
||||
{ "MunifTanjim/nui.nvim", lazy = true },
|
||||
|
||||
{
|
||||
"goolord/alpha-nvim",
|
||||
optional = true,
|
||||
enabled = function()
|
||||
require("lazyvim.util").warn({
|
||||
"`dashboard.nvim` is now the default LazyVim starter plugin.",
|
||||
"",
|
||||
"To keep using `alpha.nvim`, please enable the `lazyvim.plugins.extras.ui.alpha` extra.",
|
||||
"Or to hide this message, remove the alpha spec from your config.",
|
||||
})
|
||||
return false
|
||||
end,
|
||||
},
|
||||
{
|
||||
"nvimdev/dashboard-nvim",
|
||||
event = "VimEnter",
|
||||
lazy = false, -- As https://github.com/nvimdev/dashboard-nvim/pull/450, dashboard-nvim shouldn't be lazy-loaded to properly handle stdin.
|
||||
opts = function()
|
||||
local logo = [[
|
||||
██╗ █████╗ ███████╗██╗ ██╗██╗ ██╗██╗███╗ ███╗ Z
|
||||
|
|
@ -375,15 +348,15 @@ return {
|
|||
header = vim.split(logo, "\n"),
|
||||
-- stylua: ignore
|
||||
center = {
|
||||
{ action = "Telescope find_files", desc = " Find file", icon = " ", key = "f" },
|
||||
{ action = "ene | startinsert", desc = " New file", icon = " ", key = "n" },
|
||||
{ action = "Telescope oldfiles", desc = " Recent files", icon = " ", key = "r" },
|
||||
{ action = "Telescope live_grep", desc = " Find text", icon = " ", key = "g" },
|
||||
{ action = [[lua require("lazyvim.util").telescope.config_files()()]], desc = " Config", icon = " ", key = "c" },
|
||||
{ action = 'lua require("persistence").load()', desc = " Restore Session", icon = " ", key = "s" },
|
||||
{ action = "LazyExtras", desc = " Lazy Extras", icon = " ", key = "x" },
|
||||
{ action = "Lazy", desc = " Lazy", icon = " ", key = "l" },
|
||||
{ action = "qa", desc = " Quit", icon = " ", key = "q" },
|
||||
{ action = LazyVim.telescope("files"), desc = " Find File", icon = " ", key = "f" },
|
||||
{ action = "ene | startinsert", desc = " New File", icon = " ", key = "n" },
|
||||
{ action = "Telescope oldfiles", desc = " Recent Files", icon = " ", key = "r" },
|
||||
{ action = "Telescope live_grep", desc = " Find Text", icon = " ", key = "g" },
|
||||
{ action = [[lua LazyVim.telescope.config_files()()]], desc = " Config", icon = " ", key = "c" },
|
||||
{ action = 'lua require("persistence").load()', desc = " Restore Session", icon = " ", key = "s" },
|
||||
{ action = "LazyExtras", desc = " Lazy Extras", icon = " ", key = "x" },
|
||||
{ action = "Lazy", desc = " Lazy", icon = " ", key = "l" },
|
||||
{ action = function() vim.api.nvim_input("<cmd>qa<cr>") end, desc = " Quit", icon = " ", key = "q" },
|
||||
},
|
||||
footer = function()
|
||||
local stats = require("lazy").stats()
|
||||
|
|
|
|||
|
|
@ -1,14 +1,5 @@
|
|||
return {
|
||||
|
||||
-- measure startuptime
|
||||
{
|
||||
"dstein64/vim-startuptime",
|
||||
cmd = "StartupTime",
|
||||
config = function()
|
||||
vim.g.startuptime_tries = 10
|
||||
end,
|
||||
},
|
||||
|
||||
-- Session management. This saves your session in the background,
|
||||
-- keeping track of open buffers, window arrangement, and more.
|
||||
-- You can restore sessions when returning through the dashboard.
|
||||
|
|
|
|||
|
|
@ -3,12 +3,27 @@ local Config = require("lazyvim.config")
|
|||
-- Some extras need to be loaded before others
|
||||
local prios = {
|
||||
["lazyvim.plugins.extras.editor.aerial"] = 100,
|
||||
["lazyvim.plugins.extras.editor.symbols-outline"] = 100,
|
||||
["lazyvim.plugins.extras.editor.outline"] = 100,
|
||||
["lazyvim.plugins.extras.editor.trouble-v3"] = 100,
|
||||
["lazyvim.plugins.extras.lang.typescript"] = 5,
|
||||
["lazyvim.plugins.extras.ui.edgy"] = 2,
|
||||
["lazyvim.plugins.extras.test.core"] = 1,
|
||||
["lazyvim.plugins.extras.dap.core"] = 1,
|
||||
}
|
||||
|
||||
table.sort(Config.json.data.extras, function(a, b)
|
||||
---@type string[]
|
||||
local extras = LazyVim.dedup(Config.json.data.extras)
|
||||
|
||||
local version = vim.version()
|
||||
local v = version.major .. "_" .. version.minor
|
||||
|
||||
local compat = { "0_9" }
|
||||
|
||||
if vim.tbl_contains(compat, v) then
|
||||
extras[#extras + 1] = "lazyvim.plugins.compat.nvim-" .. v
|
||||
end
|
||||
|
||||
table.sort(extras, function(a, b)
|
||||
local pa = prios[a] or 10
|
||||
local pb = prios[b] or 10
|
||||
if pa == pb then
|
||||
|
|
@ -20,4 +35,4 @@ end)
|
|||
---@param extra string
|
||||
return vim.tbl_map(function(extra)
|
||||
return { import = extra }
|
||||
end, Config.json.data.extras)
|
||||
end, extras)
|
||||
|
|
|
|||
7
lua/lazyvim/types.lua
Normal file
7
lua/lazyvim/types.lua
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
---@meta
|
||||
|
||||
---@class LazyVimGlobals
|
||||
vim.g = {}
|
||||
|
||||
_G.lazyvim_docs = true
|
||||
_G.LazyVim = require("lazyvim.util")
|
||||
126
lua/lazyvim/util/cmp.lua
Normal file
126
lua/lazyvim/util/cmp.lua
Normal file
|
|
@ -0,0 +1,126 @@
|
|||
---@class lazyvim.util.cmp
|
||||
local M = {}
|
||||
|
||||
---@alias Placeholder {n:number, text:string}
|
||||
|
||||
---@param snippet string
|
||||
---@param fn fun(placeholder:Placeholder):string
|
||||
---@return string
|
||||
function M.snippet_replace(snippet, fn)
|
||||
return snippet:gsub("%$%b{}", function(m)
|
||||
local n, name = m:match("^%${(%d+):(.+)}$")
|
||||
return n and fn({ n = n, text = name }) or m
|
||||
end) or snippet
|
||||
end
|
||||
|
||||
-- This function resolves nested placeholders in a snippet.
|
||||
---@param snippet string
|
||||
---@return string
|
||||
function M.snippet_preview(snippet)
|
||||
local ok, parsed = pcall(function()
|
||||
return vim.lsp._snippet_grammar.parse(snippet)
|
||||
end)
|
||||
return ok and tostring(parsed)
|
||||
or M.snippet_replace(snippet, function(placeholder)
|
||||
return M.snippet_preview(placeholder.text)
|
||||
end):gsub("%$0", "")
|
||||
end
|
||||
|
||||
-- This function replaces nested placeholders in a snippet with LSP placeholders.
|
||||
function M.snippet_fix(snippet)
|
||||
local texts = {} ---@type table<number, string>
|
||||
return M.snippet_replace(snippet, function(placeholder)
|
||||
texts[placeholder.n] = texts[placeholder.n] or M.snippet_preview(placeholder.text)
|
||||
return "${" .. placeholder.n .. ":" .. texts[placeholder.n] .. "}"
|
||||
end)
|
||||
end
|
||||
|
||||
---@param entry cmp.Entry
|
||||
function M.auto_brackets(entry)
|
||||
local cmp = require("cmp")
|
||||
local Kind = cmp.lsp.CompletionItemKind
|
||||
local item = entry:get_completion_item()
|
||||
if vim.tbl_contains({ Kind.Function, Kind.Method }, item.kind) then
|
||||
local cursor = vim.api.nvim_win_get_cursor(0)
|
||||
local prev_char = vim.api.nvim_buf_get_text(0, cursor[1] - 1, cursor[2], cursor[1] - 1, cursor[2] + 1, {})[1]
|
||||
if prev_char ~= "(" and prev_char ~= ")" then
|
||||
local keys = vim.api.nvim_replace_termcodes("()<left>", false, false, true)
|
||||
vim.api.nvim_feedkeys(keys, "i", true)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- This function adds missing documentation to snippets.
|
||||
-- The documentation is a preview of the snippet.
|
||||
---@param window cmp.CustomEntriesView|cmp.NativeEntriesView
|
||||
function M.add_missing_snippet_docs(window)
|
||||
local cmp = require("cmp")
|
||||
local Kind = cmp.lsp.CompletionItemKind
|
||||
local entries = window:get_entries()
|
||||
for _, entry in ipairs(entries) do
|
||||
if entry:get_kind() == Kind.Snippet then
|
||||
local item = entry:get_completion_item()
|
||||
if not item.documentation and item.insertText then
|
||||
item.documentation = {
|
||||
kind = cmp.lsp.MarkupKind.Markdown,
|
||||
value = string.format("```%s\n%s\n```", vim.bo.filetype, M.snippet_preview(item.insertText)),
|
||||
}
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- This is a better implementation of `cmp.confirm`:
|
||||
-- * check if the completion menu is visible without waiting for running sources
|
||||
-- * create an undo point before confirming
|
||||
-- This function is both faster and more reliable.
|
||||
---@param opts? {select: boolean, behavior: cmp.ConfirmBehavior}
|
||||
function M.confirm(opts)
|
||||
local cmp = require("cmp")
|
||||
opts = vim.tbl_extend("force", {
|
||||
select = true,
|
||||
behavior = cmp.ConfirmBehavior.Insert,
|
||||
}, opts or {})
|
||||
return function(fallback)
|
||||
if cmp.core.view:visible() or vim.fn.pumvisible() == 1 then
|
||||
LazyVim.create_undo()
|
||||
if cmp.confirm(opts) then
|
||||
return
|
||||
end
|
||||
end
|
||||
return fallback()
|
||||
end
|
||||
end
|
||||
|
||||
function M.expand(snippet)
|
||||
-- Native sessions don't support nested snippet sessions.
|
||||
-- Always use the top-level session.
|
||||
-- Otherwise, when on the first placeholder and selecting a new completion,
|
||||
-- the nested session will be used instead of the top-level session.
|
||||
-- See: https://github.com/LazyVim/LazyVim/issues/3199
|
||||
local session = vim.snippet.active() and vim.snippet._session or nil
|
||||
|
||||
local ok, err = pcall(vim.snippet.expand, snippet)
|
||||
if not ok then
|
||||
local fixed = M.snippet_fix(snippet)
|
||||
ok = pcall(vim.snippet.expand, fixed)
|
||||
|
||||
local msg = ok and "Failed to parse snippet,\nbut was able to fix it automatically."
|
||||
or ("Failed to parse snippet.\n" .. err)
|
||||
|
||||
LazyVim[ok and "warn" or "error"](
|
||||
([[%s
|
||||
```%s
|
||||
%s
|
||||
```]]):format(msg, vim.bo.filetype, snippet),
|
||||
{ title = "vim.snippet" }
|
||||
)
|
||||
end
|
||||
|
||||
-- Restore top-level session when needed
|
||||
if session then
|
||||
vim.snippet._session = session
|
||||
end
|
||||
end
|
||||
|
||||
return M
|
||||
|
|
@ -3,7 +3,6 @@ local Float = require("lazy.view.float")
|
|||
local LazyConfig = require("lazy.core.config")
|
||||
local Plugin = require("lazy.core.plugin")
|
||||
local Text = require("lazy.view.text")
|
||||
local Util = require("lazyvim.util")
|
||||
|
||||
---@class LazyExtraSource
|
||||
---@field name string
|
||||
|
|
@ -17,12 +16,16 @@ local Util = require("lazyvim.util")
|
|||
---@field desc? string
|
||||
---@field enabled boolean
|
||||
---@field managed boolean
|
||||
---@field recommended? boolean
|
||||
---@field imports string[]
|
||||
---@field row? number
|
||||
---@field section? string
|
||||
---@field plugins string[]
|
||||
---@field optional string[]
|
||||
|
||||
---@class lazyvim.util.extras
|
||||
local M = {}
|
||||
M.buf = 0
|
||||
|
||||
---@type LazyExtraSource[]
|
||||
M.sources = {
|
||||
|
|
@ -34,15 +37,33 @@ M.ns = vim.api.nvim_create_namespace("lazyvim.extras")
|
|||
---@type string[]
|
||||
M.state = nil
|
||||
|
||||
---@param opts {ft?: string|string[], root?: string|string[]}
|
||||
---@return boolean
|
||||
function M.wants(opts)
|
||||
if opts.ft then
|
||||
opts.ft = type(opts.ft) == "string" and { opts.ft } or opts.ft
|
||||
for _, f in ipairs(opts.ft) do
|
||||
if vim.bo[M.buf].filetype == f then
|
||||
return true
|
||||
end
|
||||
end
|
||||
end
|
||||
if opts.root then
|
||||
opts.root = type(opts.root) == "string" and { opts.root } or opts.root
|
||||
return #LazyVim.root.detectors.pattern(M.buf, opts.root) > 0
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
---@return LazyExtra[]
|
||||
function M.get()
|
||||
M.state = M.state or LazyConfig.spec.modules
|
||||
local extras = {} ---@type LazyExtra[]
|
||||
for _, source in ipairs(M.sources) do
|
||||
local root = Util.find_root(source.module)
|
||||
local root = LazyVim.find_root(source.module)
|
||||
if root then
|
||||
Util.walk(root, function(path, name, type)
|
||||
if type == "file" and name:match("%.lua$") then
|
||||
LazyVim.walk(root, function(path, name, type)
|
||||
if (type == "file" or type == "link") and name:match("%.lua$") then
|
||||
name = path:sub(#root + 2, -5):gsub("/", ".")
|
||||
local ok, extra = pcall(M.get_extra, source, source.module .. "." .. name)
|
||||
if ok then
|
||||
|
|
@ -62,7 +83,16 @@ end
|
|||
---@param source LazyExtraSource
|
||||
function M.get_extra(source, modname)
|
||||
local enabled = vim.tbl_contains(M.state, modname)
|
||||
local spec = Plugin.Spec.new({ import = modname }, { optional = true })
|
||||
local spec = Plugin.Spec.new(nil, { optional = true })
|
||||
spec:parse({ import = modname })
|
||||
local imports = vim.tbl_filter(function(x)
|
||||
return x ~= modname
|
||||
end, spec.modules)
|
||||
if #imports > 0 then
|
||||
spec = Plugin.Spec.new(nil, { optional = true })
|
||||
spec.modules = vim.deepcopy(imports)
|
||||
spec:parse({ import = modname })
|
||||
end
|
||||
local plugins = {} ---@type string[]
|
||||
local optional = {} ---@type string[]
|
||||
for _, p in pairs(spec.plugins) do
|
||||
|
|
@ -75,13 +105,21 @@ function M.get_extra(source, modname)
|
|||
table.sort(plugins)
|
||||
table.sort(optional)
|
||||
|
||||
---@type boolean|(fun():boolean?)|nil
|
||||
local recommended = require(modname).recommended or false
|
||||
if type(recommended) == "function" then
|
||||
recommended = recommended() or false
|
||||
end
|
||||
|
||||
---@type LazyExtra
|
||||
return {
|
||||
source = source,
|
||||
name = modname:sub(#source.module + 2),
|
||||
module = modname,
|
||||
enabled = enabled,
|
||||
imports = imports,
|
||||
desc = require(modname).desc,
|
||||
recommended = recommended,
|
||||
managed = vim.tbl_contains(Config.json.data.extras, modname) or not enabled,
|
||||
plugins = plugins,
|
||||
optional = optional,
|
||||
|
|
@ -98,6 +136,7 @@ local X = {}
|
|||
---@return LazyExtraView
|
||||
function X.new()
|
||||
local self = setmetatable({}, { __index = X })
|
||||
M.buf = vim.api.nvim_get_current_buf()
|
||||
self.float = Float.new({ title = "LazyVim Extras" })
|
||||
self.float:on_key("x", function()
|
||||
self:toggle()
|
||||
|
|
@ -119,7 +158,7 @@ function X:toggle()
|
|||
for _, extra in ipairs(self.extras) do
|
||||
if extra.row == pos[1] then
|
||||
if not extra.managed then
|
||||
Util.error(
|
||||
LazyVim.error(
|
||||
"Not managed by LazyExtras. Remove from your config to enable/disable here.",
|
||||
{ title = "LazyExtras" }
|
||||
)
|
||||
|
|
@ -137,8 +176,8 @@ function X:toggle()
|
|||
M.state[#M.state + 1] = extra.module
|
||||
end
|
||||
table.sort(Config.json.data.extras)
|
||||
Util.json.save()
|
||||
Util.info(
|
||||
LazyVim.json.save()
|
||||
LazyVim.info(
|
||||
"`"
|
||||
.. extra.name
|
||||
.. "`"
|
||||
|
|
@ -172,7 +211,7 @@ function X:update()
|
|||
diag.lnum = diag.row - 1
|
||||
return diag
|
||||
end, self.diag),
|
||||
{ signs = false, virtual_text = true }
|
||||
{ signs = false, virtual_text = true, underline = false }
|
||||
)
|
||||
end
|
||||
|
||||
|
|
@ -187,8 +226,21 @@ function X:render()
|
|||
:append("<x>", "LazySpecial")
|
||||
:append(" key", "LazyComment")
|
||||
:nl()
|
||||
self:section({ enabled = true, title = "Enabled" })
|
||||
self:section({ enabled = false, title = "Disabled" })
|
||||
for _, extra in ipairs(self.extras) do
|
||||
extra.section = nil
|
||||
end
|
||||
self:section({
|
||||
recommended = true,
|
||||
enabled = false,
|
||||
include = "^lang%.",
|
||||
title = "Recommended Languages",
|
||||
empty = false,
|
||||
})
|
||||
self:section({ enabled = true, exclude = "^lang%.", title = "Enabled Plugins" })
|
||||
self:section({ enabled = true, title = "Enabled Languages" })
|
||||
self:section({ recommended = true, title = "Recommended Plugins", empty = false })
|
||||
self:section({ title = "Plugins", exclude = "^lang%." })
|
||||
self:section({ title = "Languages" })
|
||||
end
|
||||
|
||||
---@param extra LazyExtra
|
||||
|
|
@ -207,9 +259,16 @@ function X:extra(extra)
|
|||
self.text:append(" " .. LazyConfig.options.ui.icons.not_loaded .. " ", hl)
|
||||
end
|
||||
self.text:append(extra.name)
|
||||
if extra.recommended then
|
||||
self.text:append(" "):append(LazyConfig.options.ui.icons.favorite or " ", "LazyCommit")
|
||||
end
|
||||
if extra.source.name ~= "LazyVim" then
|
||||
self.text:append(" "):append(LazyConfig.options.ui.icons.event .. " " .. extra.source.name, "LazyReasonEvent")
|
||||
end
|
||||
for _, import in ipairs(extra.imports) do
|
||||
import = import:gsub("^lazyvim.plugins.extras.", "")
|
||||
self.text:append(" "):append(LazyConfig.options.ui.icons.plugin .. "" .. import, "LazyReasonStart")
|
||||
end
|
||||
for _, plugin in ipairs(extra.plugins) do
|
||||
self.text:append(" "):append(LazyConfig.options.ui.icons.plugin .. "" .. plugin, "LazyReasonPlugin")
|
||||
end
|
||||
|
|
@ -222,16 +281,25 @@ function X:extra(extra)
|
|||
self.text:nl()
|
||||
end
|
||||
|
||||
---@param opts {enabled?:boolean, title?:string}
|
||||
---@param opts {enabled?:boolean, title:string, recommended?:boolean, include?:string, exclude?:string, empty?:boolean}
|
||||
function X:section(opts)
|
||||
opts = opts or {}
|
||||
---@type LazyExtra[]
|
||||
local extras = vim.tbl_filter(function(extra)
|
||||
return opts.enabled == nil or extra.enabled == opts.enabled
|
||||
return extra.section == nil
|
||||
and (opts.enabled == nil or extra.enabled == opts.enabled)
|
||||
and (opts.recommended == nil or extra.recommended == opts.recommended)
|
||||
and (opts.include == nil or extra.name:find(opts.include))
|
||||
and (opts.exclude == nil or not extra.name:find(opts.exclude))
|
||||
end, self.extras)
|
||||
|
||||
if opts.empty == false and #extras == 0 then
|
||||
return
|
||||
end
|
||||
|
||||
self.text:nl():append(opts.title .. ":", "LazyH2"):append(" (" .. #extras .. ")", "LazyComment"):nl()
|
||||
for _, extra in ipairs(extras) do
|
||||
extra.section = opts.title
|
||||
self:extra(extra)
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
local Util = require("lazyvim.util")
|
||||
|
||||
---@class lazyvim.util.format
|
||||
---@overload fun(opts?: {force?:boolean})
|
||||
local M = setmetatable({}, {
|
||||
|
|
@ -26,7 +24,7 @@ function M.register(formatter)
|
|||
end
|
||||
|
||||
function M.formatexpr()
|
||||
if Util.has("conform.nvim") then
|
||||
if LazyVim.has("conform.nvim") then
|
||||
return require("conform").formatexpr()
|
||||
end
|
||||
return vim.lsp.formatexpr({ timeout_ms = 3000 })
|
||||
|
|
@ -76,7 +74,7 @@ function M.info(buf)
|
|||
if not have then
|
||||
lines[#lines + 1] = "\n***No formatters available for this buffer.***"
|
||||
end
|
||||
Util[enabled and "info" or "warn"](
|
||||
LazyVim[enabled and "info" or "warn"](
|
||||
table.concat(lines, "\n"),
|
||||
{ title = "LazyFormat (" .. (enabled and "enabled" or "disabled") .. ")" }
|
||||
)
|
||||
|
|
@ -120,14 +118,14 @@ function M.format(opts)
|
|||
for _, formatter in ipairs(M.resolve(buf)) do
|
||||
if formatter.active then
|
||||
done = true
|
||||
Util.try(function()
|
||||
LazyVim.try(function()
|
||||
return formatter.format(buf)
|
||||
end, { msg = "Formatter `" .. formatter.name .. "` failed" })
|
||||
end
|
||||
end
|
||||
|
||||
if not done and opts and opts.force then
|
||||
Util.warn("No formatter available", { title = "LazyVim" })
|
||||
LazyVim.warn("No formatter available", { title = "LazyVim" })
|
||||
end
|
||||
end
|
||||
|
||||
|
|
@ -136,7 +134,7 @@ function M.health()
|
|||
local has_plugin = Config.spec.plugins["none-ls.nvim"]
|
||||
local has_extra = vim.tbl_contains(Config.spec.modules, "lazyvim.plugins.extras.lsp.none-ls")
|
||||
if has_plugin and not has_extra then
|
||||
Util.warn({
|
||||
LazyVim.warn({
|
||||
"`conform.nvim` and `nvim-lint` are now the default formatters and linters in LazyVim.",
|
||||
"",
|
||||
"You can use those plugins together with `none-ls.nvim`,",
|
||||
|
|
|
|||
|
|
@ -1,11 +1,13 @@
|
|||
local LazyUtil = require("lazy.core.util")
|
||||
|
||||
---@class lazyvim.util: LazyUtilCore
|
||||
---@field config LazyVimConfig
|
||||
---@field ui lazyvim.util.ui
|
||||
---@field lsp lazyvim.util.lsp
|
||||
---@field root lazyvim.util.root
|
||||
---@field telescope lazyvim.util.telescope
|
||||
---@field terminal lazyvim.util.terminal
|
||||
---@field lazygit lazyvim.util.lazygit
|
||||
---@field toggle lazyvim.util.toggle
|
||||
---@field format lazyvim.util.format
|
||||
---@field plugin lazyvim.util.plugin
|
||||
|
|
@ -14,6 +16,8 @@ local LazyUtil = require("lazy.core.util")
|
|||
---@field news lazyvim.util.news
|
||||
---@field json lazyvim.util.json
|
||||
---@field lualine lazyvim.util.lualine
|
||||
---@field mini lazyvim.util.mini
|
||||
---@field cmp lazyvim.util.cmp
|
||||
local M = {}
|
||||
|
||||
---@type table<string, string|string[]>
|
||||
|
|
@ -38,7 +42,7 @@ setmetatable(M, {
|
|||
if dep then
|
||||
local mod = type(dep) == "table" and dep[1] or dep
|
||||
local key = type(dep) == "table" and dep[2] or k
|
||||
M.deprecate([[require("lazyvim.util").]] .. k, [[require("lazyvim.util").]] .. mod .. "." .. key)
|
||||
M.deprecate([[LazyVim.]] .. k, [[LazyVim.]] .. mod .. "." .. key)
|
||||
---@diagnostic disable-next-line: no-unknown
|
||||
t[mod] = require("lazyvim.util." .. mod) -- load here to prevent loops
|
||||
return t[mod][key]
|
||||
|
|
@ -50,12 +54,25 @@ setmetatable(M, {
|
|||
})
|
||||
|
||||
function M.is_win()
|
||||
return vim.loop.os_uname().sysname:find("Windows") ~= nil
|
||||
return vim.uv.os_uname().sysname:find("Windows") ~= nil
|
||||
end
|
||||
|
||||
---@param name string
|
||||
function M.get_plugin(name)
|
||||
return require("lazy.core.config").spec.plugins[name]
|
||||
end
|
||||
|
||||
---@param name string
|
||||
---@param path string?
|
||||
function M.get_plugin_path(name, path)
|
||||
local plugin = M.get_plugin(name)
|
||||
path = path and "/" .. path or ""
|
||||
return plugin and (plugin.dir .. path)
|
||||
end
|
||||
|
||||
---@param plugin string
|
||||
function M.has(plugin)
|
||||
return require("lazy.core.config").spec.plugins[plugin] ~= nil
|
||||
return M.get_plugin(plugin) ~= nil
|
||||
end
|
||||
|
||||
---@param fn fun()
|
||||
|
|
@ -68,9 +85,30 @@ function M.on_very_lazy(fn)
|
|||
})
|
||||
end
|
||||
|
||||
--- This extends a deeply nested list with a key in a table
|
||||
--- that is a dot-separated string.
|
||||
--- The nested list will be created if it does not exist.
|
||||
---@generic T
|
||||
---@param t T[]
|
||||
---@param key string
|
||||
---@param values T[]
|
||||
---@return T[]?
|
||||
function M.extend(t, key, values)
|
||||
local keys = vim.split(key, ".", { plain = true })
|
||||
for i = 1, #keys do
|
||||
local k = keys[i]
|
||||
t[k] = t[k] or {}
|
||||
if type(t) ~= "table" then
|
||||
return
|
||||
end
|
||||
t = t[k]
|
||||
end
|
||||
return vim.list_extend(t, values)
|
||||
end
|
||||
|
||||
---@param name string
|
||||
function M.opts(name)
|
||||
local plugin = require("lazy.core.config").plugins[name]
|
||||
local plugin = require("lazy.core.config").spec.plugins[name]
|
||||
if not plugin then
|
||||
return {}
|
||||
end
|
||||
|
|
@ -97,8 +135,8 @@ function M.lazy_notify()
|
|||
local orig = vim.notify
|
||||
vim.notify = temp
|
||||
|
||||
local timer = vim.loop.new_timer()
|
||||
local check = assert(vim.loop.new_check())
|
||||
local timer = vim.uv.new_timer()
|
||||
local check = assert(vim.uv.new_check())
|
||||
|
||||
local replay = function()
|
||||
timer:stop()
|
||||
|
|
@ -124,11 +162,15 @@ function M.lazy_notify()
|
|||
timer:start(500, 0, replay)
|
||||
end
|
||||
|
||||
function M.is_loaded(name)
|
||||
local Config = require("lazy.core.config")
|
||||
return Config.plugins[name] and Config.plugins[name]._.loaded
|
||||
end
|
||||
|
||||
---@param name string
|
||||
---@param fn fun(name:string)
|
||||
function M.on_load(name, fn)
|
||||
local Config = require("lazy.core.config")
|
||||
if Config.plugins[name] and Config.plugins[name]._.loaded then
|
||||
if M.is_loaded(name) then
|
||||
fn(name)
|
||||
else
|
||||
vim.api.nvim_create_autocmd("User", {
|
||||
|
|
@ -168,4 +210,56 @@ function M.safe_keymap_set(mode, lhs, rhs, opts)
|
|||
end
|
||||
end
|
||||
|
||||
---@generic T
|
||||
---@param list T[]
|
||||
---@return T[]
|
||||
function M.dedup(list)
|
||||
local ret = {}
|
||||
local seen = {}
|
||||
for _, v in ipairs(list) do
|
||||
if not seen[v] then
|
||||
table.insert(ret, v)
|
||||
seen[v] = true
|
||||
end
|
||||
end
|
||||
return ret
|
||||
end
|
||||
|
||||
M.CREATE_UNDO = vim.api.nvim_replace_termcodes("<c-G>u", true, true, true)
|
||||
function M.create_undo()
|
||||
if vim.api.nvim_get_mode().mode == "i" then
|
||||
vim.api.nvim_feedkeys(M.CREATE_UNDO, "n", false)
|
||||
end
|
||||
end
|
||||
|
||||
--- Gets a path to a package in the Mason registry.
|
||||
--- Prefer this to `get_package`, since the package might not always be
|
||||
--- available yet and trigger errors.
|
||||
---@param pkg string
|
||||
---@param path? string
|
||||
---@param opts? { warn?: boolean }
|
||||
function M.get_pkg_path(pkg, path, opts)
|
||||
pcall(require, "mason") -- make sure Mason is loaded. Will fail when generating docs
|
||||
local root = vim.env.MASON or (vim.fn.stdpath("data") .. "/mason")
|
||||
opts = opts or {}
|
||||
opts.warn = opts.warn == nil and true or opts.warn
|
||||
path = path or ""
|
||||
local ret = root .. "/packages/" .. pkg .. "/" .. path
|
||||
if opts.warn and not vim.loop.fs_stat(ret) then
|
||||
M.warn(
|
||||
("Mason package path not found for **%s**:\n- `%s`\nYou may need to force update the package."):format(pkg, path)
|
||||
)
|
||||
end
|
||||
return ret
|
||||
end
|
||||
|
||||
--- Override the default title for notifications.
|
||||
for _, level in ipairs({ "info", "warn", "error" }) do
|
||||
M[level] = function(msg, opts)
|
||||
opts = opts or {}
|
||||
opts.title = opts.title or "LazyVim"
|
||||
return LazyUtil[level](msg, opts)
|
||||
end
|
||||
end
|
||||
|
||||
return M
|
||||
|
|
|
|||
|
|
@ -31,4 +31,20 @@ function M.get_upvalue(func, name)
|
|||
end
|
||||
end
|
||||
|
||||
function M.set_upvalue(func, name, value)
|
||||
local i = 1
|
||||
while true do
|
||||
local n = debug.getupvalue(func, i)
|
||||
if not n then
|
||||
break
|
||||
end
|
||||
if n == name then
|
||||
debug.setupvalue(func, i, value)
|
||||
return
|
||||
end
|
||||
i = i + 1
|
||||
end
|
||||
LazyVim.error("upvalue not found: " .. name)
|
||||
end
|
||||
|
||||
return M
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue