Compare commits

..

55 Commits

Author SHA1 Message Date
Folke Lemaitre 8c3f9fd497 fix(terraform): make telescope optional 2024-06-12 23:13:18 +02:00
Folke Lemaitre f608564517 refactor: check active picker 2024-06-12 23:10:16 +02:00
Folke Lemaitre 3b0810c003 fix(fzf): path.dirname_first 2024-06-12 20:54:56 +02:00
Folke Lemaitre ef0d55e651 refactor: new formatter is merged, so removde custom :) 2024-06-12 18:20:16 +02:00
Folke Lemaitre 1f97b9d120 fix(fzf): refactor 2024-06-12 18:20:16 +02:00
Folke Lemaitre db8e0f7d35 fix(telescope): flash integration 2024-06-12 18:20:16 +02:00
Folke Lemaitre ff223e7347 fix(fzf): use custom formatter for now, since filename_search messes with searching 2024-06-12 18:20:16 +02:00
Folke Lemaitre b2b6ff0738 feat(pick): move pickers to extras telescope & fzf-lua and include telescope by default 2024-06-12 18:20:16 +02:00
Folke Lemaitre 4b9e4edbb1 fix(project): add fzf-lua integration. Fixes #3609 2024-06-12 18:18:17 +02:00
Folke Lemaitre 46eb3242d3 refactor: copilot-chat 2024-06-12 11:41:03 +02:00
Folke Lemaitre 5c876b7549 feat(fzf): disable dressing in favor of noice (vim.ui.input) and fzf-lua (vim.ui.select) 2024-06-12 11:31:25 +02:00
Folke Lemaitre 14d1ca93d0 feat(fzf): use vscode style path names formatter 2024-06-12 11:23:45 +02:00
Folke Lemaitre 52b572881b fix(lsp): add file completion to rename file 2024-06-12 10:43:01 +02:00
Folke Lemaitre 82f680ee6b feat(yanky): added fzf-lua support 2024-06-12 07:57:07 +02:00
github-actions[bot] 60a1c1979d chore(build): auto-generate vimdoc 2024-06-12 05:45:25 +00:00
Folke Lemaitre ec3dba20af feat(noice): added support for fzf-lua. Closes #3596 2024-06-12 07:44:47 +02:00
Folke Lemaitre 74cf6e4462 feat(fzf): better default window size/position 2024-06-12 00:27:23 +02:00
github-actions[bot] 128c3fcfe6 chore(main): release 12.13.0 (#3584)
🤖 I have created a release *beep* *boop*
---


##
[12.13.0](https://github.com/LazyVim/LazyVim/compare/v12.12.0...v12.13.0)
(2024-06-11)


### Features

* **copilot-chat:** use fzf-lua if enabled in extras
([#3590](https://github.com/LazyVim/LazyVim/issues/3590))
([7252474](https://github.com/LazyVim/LazyVim/commit/7252474624cda30cac399b7f419ad25665e62a8f))
* **fzf:** added ctrl-u and ctrl+d to scroll in the results list
([9f2a369](https://github.com/LazyVim/LazyVim/commit/9f2a3699a8f47467359f2c3defb3a711b32e0efb))
* **fzf:** added ctrl-x to jump with easymotion to a line, similar to
flash telescope
([1c740ce](https://github.com/LazyVim/LazyVim/commit/1c740ce3fdb5e361ec20e5e8cca5a6a79b24ed44))
* **fzf:** use delta previewer for code actions when available
([1697100](https://github.com/LazyVim/LazyVim/commit/16971006c250f11d5ee3cfc974da0c34ab159286))


### Bug Fixes

* **fzf:** action desc
([c6ddb23](https://github.com/LazyVim/LazyVim/commit/c6ddb2328d596771ee562f49462ae10dfc49321f))
* **fzf:** added action descriptions. (still doesnt work for trouble)
([19a6e2d](https://github.com/LazyVim/LazyVim/commit/19a6e2de158e63264aaa761228a1e3f9d615bd57))
* **fzf:** cleanup
([79b7c48](https://github.com/LazyVim/LazyVim/commit/79b7c489fdacd0a04e7025e72e9020c4ff595eb3))
* **fzf:** disable mini.indentscope in fzf-lua buffer
([#3592](https://github.com/LazyVim/LazyVim/issues/3592))
([0ba67c8](https://github.com/LazyVim/LazyVim/commit/0ba67c87e9054e09d562164de7ed1876587a0539))
* **fzf:** live document symbols. Fixes
[#3587](https://github.com/LazyVim/LazyVim/issues/3587)
([056042b](https://github.com/LazyVim/LazyVim/commit/056042b221c93a14c6069d4a82b7435fc9a228fd))
* **fzf:** symbols filter
([7e0ac68](https://github.com/LazyVim/LazyVim/commit/7e0ac6850b613ba8cbc179fa2f71199184504a54))
* **vue:** disable inlay hints for vue, since they seem broken
([3233385](https://github.com/LazyVim/LazyVim/commit/3233385ddb61d01f87de374c061696a374596a10))


### Reverts

* "fix(dap): set host to 127.0.0.1 instead of localhost to prevent
issues with ipv6. Fixes
[#3577](https://github.com/LazyVim/LazyVim/issues/3577)"
([a3547e4](https://github.com/LazyVim/LazyVim/commit/a3547e4b3b03e019dbe7e543104ffd1ea82fa765))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-06-11 23:50:03 +02:00
Folke Lemaitre 16971006c2 feat(fzf): use delta previewer for code actions when available 2024-06-11 23:48:16 +02:00
Folke Lemaitre 3233385ddb fix(vue): disable inlay hints for vue, since they seem broken 2024-06-11 23:21:56 +02:00
Farzad Majidfayyaz 0ba67c87e9 fix(fzf): disable mini.indentscope in fzf-lua buffer (#3592)
## What is this PR for?

If `fzf-lua` and `mini.indentscope` are enabled together, the indent
line created by `indentscope` makes the fzf window hard and confusing to
work with

<!-- Describe the big picture of your changes to communicate to the
maintainers
  why we should accept this pull request. -->

PS: also sorted the file list.

## Does this PR fix an existing issue?

I don't think there's an existing issue for this.

## Checklist

- [x] I've read the
[CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md)
guidelines.
2024-06-11 21:06:46 +02:00
Folke Lemaitre 1c740ce3fd feat(fzf): added ctrl-x to jump with easymotion to a line, similar to flash telescope 2024-06-11 19:38:48 +02:00
Folke Lemaitre 9f2a3699a8 feat(fzf): added ctrl-u and ctrl+d to scroll in the results list 2024-06-11 19:38:22 +02:00
Folke Lemaitre a3547e4b3b revert: "fix(dap): set host to 127.0.0.1 instead of localhost to prevent issues with ipv6. Fixes #3577"
This reverts commit 9b8a393edc.
2024-06-11 19:14:27 +02:00
Adam K 7252474624 feat(copilot-chat): use fzf-lua if enabled in extras (#3590)
Adds the abiltiy for fzf-lua to be used as a picker for these copilot
chat actions if it was enabled in LazyExtras

## What is this PR for?

This adds keybinds that exist currently for copilot-chat and Telescope
but with the addition of fzf-lua as an extra, I noticed we needed the
ability for the user to take advantage of them with FzfLua.

## Does this PR fix an existing issue?

No

## Checklist

- [x] I've read the
[CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md)
guidelines.
2024-06-11 17:45:25 +02:00
Folke Lemaitre 7e0ac6850b fix(fzf): symbols filter 2024-06-11 16:11:45 +02:00
Folke Lemaitre 056042b221 fix(fzf): live document symbols. Fixes #3587 2024-06-11 16:08:27 +02:00
Folke Lemaitre 79b7c489fd fix(fzf): cleanup 2024-06-11 15:47:14 +02:00
Folke Lemaitre c6ddb2328d fix(fzf): action desc 2024-06-11 14:58:35 +02:00
Folke Lemaitre 19a6e2de15 fix(fzf): added action descriptions. (still doesnt work for trouble) 2024-06-11 14:49:09 +02:00
github-actions[bot] 26e3e39f2e chore(main): release 12.12.0 (#3574)
🤖 I have created a release *beep* *boop*
---


##
[12.12.0](https://github.com/LazyVim/LazyVim/compare/v12.11.0...v12.12.0)
(2024-06-11)


### Features

* **extras:** added fzf-lua
([#3555](https://github.com/LazyVim/LazyVim/issues/3555))
([6ab4041](https://github.com/LazyVim/LazyVim/commit/6ab404134db6004aab13dcf956e200ff063b2d42))
* **fzf:** better scrollbars
([8bb6538](https://github.com/LazyVim/LazyVim/commit/8bb653876c38518e4befb496b78659e76ed7afee))
* **fzf:** ignore current line for some lsp pickers
([c481861](https://github.com/LazyVim/LazyVim/commit/c4818616d541e4456850d1982be39b8151bd0f2a))
* **fzf:** prettier document symbols
([ba3aec7](https://github.com/LazyVim/LazyVim/commit/ba3aec7b4876e36a9f9fd3cce1d204c23c0fe24f))
* **lualine:** show readonly icon
([#3567](https://github.com/LazyVim/LazyVim/issues/3567))
([21617a9](https://github.com/LazyVim/LazyVim/commit/21617a9d602f2400c8e9813490958e106cb88ca8))


### Bug Fixes

* **dap:** set host to 127.0.0.1 instead of localhost to prevent issues
with ipv6. Fixes [#3577](https://github.com/LazyVim/LazyVim/issues/3577)
([9b8a393](https://github.com/LazyVim/LazyVim/commit/9b8a393edc8b9a12a39f712163f6476c084a7f71))
* **extras.copilot-chat:** small ui fix for which-key in visual mode
([#3573](https://github.com/LazyVim/LazyVim/issues/3573))
([43afed1](https://github.com/LazyVim/LazyVim/commit/43afed121195df6591d0e941b913b98f849c8af3))
* **fzf:** lowercase symbols
([d1d24fa](https://github.com/LazyVim/LazyVim/commit/d1d24fa077add680bc532e08fd68aaa0841a14dc))
* **neo-tree:** use last window for preview
([#3560](https://github.com/LazyVim/LazyVim/issues/3560))
([caaa6c4](https://github.com/LazyVim/LazyVim/commit/caaa6c440d5c3b80c03cad1dfd93989b852bb875))
* **php:** formatting and linting
([#3540](https://github.com/LazyVim/LazyVim/issues/3540))
([f5dc867](https://github.com/LazyVim/LazyVim/commit/f5dc867ac29e31f833442006ebe3daf7540d1f69))
* **pick:** recent files in cwd. Fixes
[#3580](https://github.com/LazyVim/LazyVim/issues/3580)
([d541069](https://github.com/LazyVim/LazyVim/commit/d541069fdffcf5ffaf2a7f161fd87bb68094c8cf))
* **sql:** make sure edgebars exist. Fixes
[#3578](https://github.com/LazyVim/LazyVim/issues/3578)
([bd29f45](https://github.com/LazyVim/LazyVim/commit/bd29f4515307f59437995d5cc0ba601eb02b5baa))
* **util:** ensure unique cache keys in LazyVim.memoize
([#3576](https://github.com/LazyVim/LazyVim/issues/3576))
([3354872](https://github.com/LazyVim/LazyVim/commit/335487282a128d6df7ea021a75b31f07a2b9ccfd))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-06-11 14:35:51 +02:00
Folke Lemaitre d541069fdf fix(pick): recent files in cwd. Fixes #3580 2024-06-11 14:26:46 +02:00
Folke Lemaitre bd29f45153 fix(sql): make sure edgebars exist. Fixes #3578 2024-06-11 09:10:10 +02:00
Folke Lemaitre c4818616d5 feat(fzf): ignore current line for some lsp pickers 2024-06-11 09:05:16 +02:00
Folke Lemaitre 8bb653876c feat(fzf): better scrollbars 2024-06-11 09:04:39 +02:00
Folke Lemaitre d1d24fa077 fix(fzf): lowercase symbols 2024-06-11 07:44:32 +02:00
Folke Lemaitre ba3aec7b48 feat(fzf): prettier document symbols 2024-06-11 07:42:21 +02:00
Folke Lemaitre 638769d320 test: simple test to make sure I don't keep debug stuff around 2024-06-11 07:27:04 +02:00
Folke Lemaitre 9b8a393edc fix(dap): set host to 127.0.0.1 instead of localhost to prevent issues with ipv6. Fixes #3577 2024-06-11 06:55:16 +02:00
Folke Lemaitre 14d47f650c refactor: memoize 2024-06-11 06:51:30 +02:00
github-actions[bot] 3b447a8037 chore(build): auto-generate vimdoc 2024-06-11 04:42:12 +00:00
Aofei Sheng 335487282a fix(util): ensure unique cache keys in LazyVim.memoize (#3576)
## What is this PR for?

This PR fixes a bug in the `LazyVim.memoize` function that was causing
unexpected behavior in my configuration. The issue was discovered when
setting `vim.g.lazyvim_prettier_needs_config = true` in my
`lua/config/options.lua`, which did not work as expected.

The root cause was an issue with `LazyVim.memoize` cache key generation,
which led to `M.has_config(ctx)` always returning the same result as
`M.has_parser(ctx)`. This happened because `LazyVim.memoize` generates
cache keys based on the function parameters, and both functions were
being called with identical parameters:


https://github.com/LazyVim/LazyVim/blob/7d30360df29e0d02dd946521ff7fbfeea201b142/lua/lazyvim/plugins/extras/formatting/prettier.lua#L77-L81

By improving the cache key generation to include function information,
we can ensure unique keys for different functions even if their
parameters are identical, thereby fixing the issue.

## Does this PR fix an existing issue?

N/A

## Checklist

- [x] I've read the
[CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md)
guidelines.
2024-06-11 06:41:37 +02:00
Folke Lemaitre 7d30360df2 refactor: config = true >> opts = {} 2024-06-11 00:06:56 +02:00
Folke Lemaitre 9b5d810c05 docs: added experience to CONTRIBUTING 2024-06-10 23:26:07 +02:00
Iordanis Petkakis fe667b53c9 refactor(mini-files): mini-files (#3538)
Incorporate additional boolean logic when setting keymaps to avoid
creating `opts.mappings` table and leave that only from the user
configuration to change mappings.
2024-06-10 22:12:25 +02:00
dotfrag 21617a9d60 feat(lualine): show readonly icon (#3567)
Adds a configurable lock icon when a file is opened as read only. Mimics
`vi -R <file>` status line.
2024-06-10 22:06:09 +02:00
Muneeb Usmani f5dc867ac2 fix(php): formatting and linting (#3540)
Fixed the issue of php formatting not working in extras.lang.php
2024-06-10 22:01:24 +02:00
Folke Lemaitre 6ab404134d feat(extras): added fzf-lua (#3555)
New extra with an initial implementation of fzf-lua.

## Todo

- [x] check all places that currently depend on telescope and provide an
alternative or disable
- [x] disable telescope spec completely. (currently only removed its
keymaps)
- [x] trouble integration
- [x] https://github.com/ibhagwan/fzf-lua/issues/1241

---------

Co-authored-by: Iordanis Petkakis <12776461+dpetka2001@users.noreply.github.com>
2024-06-10 21:58:33 +02:00
Aleksey Imuzov caaa6c440d fix(neo-tree): use last window for preview (#3560)
Similar to "trouble.nvim" I want the preview to open in the last active
window. Currently the neo-tree preview opens in a floating window, which
(to me) doesn’t look very good.

What do you think about doing preview window the same everywhere
(trouble & neo-tree)?

## Before:


https://github.com/LazyVim/LazyVim/assets/3313023/7d7c21c9-158d-40ef-82f2-62e0dc795555

## After:


https://github.com/LazyVim/LazyVim/assets/3313023/bafc5bae-20cb-4dd1-8e40-1358ada573d9

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-06-10 21:41:45 +02:00
Đ - DEV 43afed1211 fix(extras.copilot-chat): small ui fix for which-key in visual mode (#3573)
## What is this PR for?
- Just a small fix for which-key in visual mode that the authors forgot
to add.
<!-- Describe the big picture of your changes to communicate to the
maintainers
  why we should accept this pull request. -->

## Does this PR fix an existing issue?
- As copilot-chat has just been added to extras so i think this is new.
<!--
  If this PR fixes any issues, please link to the issue here.
  Fixes #<issue_number>
-->

## Checklist

- [x] I've read the
[CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md)
guidelines.
2024-06-10 20:15:27 +02:00
Folke Lemaitre 4b7c389f14 docs: fix link 2024-06-10 15:09:30 +02:00
github-actions[bot] 4b1d397627 chore(build): auto-generate vimdoc 2024-06-10 13:05:24 +00:00
Folke Lemaitre 9d78a22252 docs: added contributing 2024-06-10 15:04:43 +02:00
Folke Lemaitre 65060ece67 ci: pull request template 2024-06-10 15:04:43 +02:00
github-actions[bot] d7c7548e09 chore(main): release 12.11.0 (#3536)
🤖 I have created a release *beep* *boop*
---


##
[12.11.0](https://github.com/LazyVim/LazyVim/compare/v12.10.0...v12.11.0)
(2024-06-09)


### Features

* **octo:** re-open octo windows when restoring session + cleanup
([7793942](https://github.com/LazyVim/LazyVim/commit/7793942ebafd32ef90f79e28979898f8013976ff))


### Bug Fixes

* **extra-lang-angular:** add BufNew event to attach angular treesitter
([#3522](https://github.com/LazyVim/LazyVim/issues/3522))
([fbb1276](https://github.com/LazyVim/LazyVim/commit/fbb1276ffd45683d4d64a2d99907bdbd3421c16f))
* **extras:** +prefix in which-key panel for visual mode
([#3537](https://github.com/LazyVim/LazyVim/issues/3537))
([5185404](https://github.com/LazyVim/LazyVim/commit/51854046dbb0bacf690ddc217cc76bf98c8ec1aa))
* **helm:** missing dependency
([#3546](https://github.com/LazyVim/LazyVim/issues/3546))
([02dd65c](https://github.com/LazyVim/LazyVim/commit/02dd65cdea1ae34cdf4ca00b20760dbb3cfcd72b))
* **lang:** neotest not loading rust tests
([#3544](https://github.com/LazyVim/LazyVim/issues/3544))
([0567b37](https://github.com/LazyVim/LazyVim/commit/0567b37f61d5ad997793b950c38a6c8f73de3b9b))
* **luasnip:** disable nvim-snippets when luasnip is enabled. Fixes
[#3547](https://github.com/LazyVim/LazyVim/issues/3547)
([aa059e0](https://github.com/LazyVim/LazyVim/commit/aa059e0d496e570f898644d3f18bc344ca179d38))
* **rust:** make neotest optional
([547dc76](https://github.com/LazyVim/LazyVim/commit/547dc76a12309d4dafc970ae08832140eae51cba))
* **typescript:** clean up configuration of the vscode dap extension
([#3556](https://github.com/LazyVim/LazyVim/issues/3556))
([1c46f54](https://github.com/LazyVim/LazyVim/commit/1c46f544328b084753327a81b92e2b57ab568321))
* **typescript:** implemented move to new file. Fixes
[#3534](https://github.com/LazyVim/LazyVim/issues/3534)
([d90930b](https://github.com/LazyVim/LazyVim/commit/d90930b13e4515a5f4e4f3892ac9f7c392c4f20c))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-06-09 23:19:28 +02:00
27 changed files with 698 additions and 383 deletions
+15
View File
@@ -0,0 +1,15 @@
## What is this PR for?
<!-- Describe the big picture of your changes to communicate to the maintainers
why we should accept this pull request. -->
## Does this PR fix an existing issue?
<!--
If this PR fixes any issues, please link to the issue here.
Fixes #<issue_number>
-->
## Checklist
- [ ] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines.
+68
View File
@@ -1,5 +1,73 @@
# Changelog
## [12.13.0](https://github.com/LazyVim/LazyVim/compare/v12.12.0...v12.13.0) (2024-06-11)
### Features
* **copilot-chat:** use fzf-lua if enabled in extras ([#3590](https://github.com/LazyVim/LazyVim/issues/3590)) ([7252474](https://github.com/LazyVim/LazyVim/commit/7252474624cda30cac399b7f419ad25665e62a8f))
* **fzf:** added ctrl-u and ctrl+d to scroll in the results list ([9f2a369](https://github.com/LazyVim/LazyVim/commit/9f2a3699a8f47467359f2c3defb3a711b32e0efb))
* **fzf:** added ctrl-x to jump with easymotion to a line, similar to flash telescope ([1c740ce](https://github.com/LazyVim/LazyVim/commit/1c740ce3fdb5e361ec20e5e8cca5a6a79b24ed44))
* **fzf:** use delta previewer for code actions when available ([1697100](https://github.com/LazyVim/LazyVim/commit/16971006c250f11d5ee3cfc974da0c34ab159286))
### Bug Fixes
* **fzf:** action desc ([c6ddb23](https://github.com/LazyVim/LazyVim/commit/c6ddb2328d596771ee562f49462ae10dfc49321f))
* **fzf:** added action descriptions. (still doesnt work for trouble) ([19a6e2d](https://github.com/LazyVim/LazyVim/commit/19a6e2de158e63264aaa761228a1e3f9d615bd57))
* **fzf:** cleanup ([79b7c48](https://github.com/LazyVim/LazyVim/commit/79b7c489fdacd0a04e7025e72e9020c4ff595eb3))
* **fzf:** disable mini.indentscope in fzf-lua buffer ([#3592](https://github.com/LazyVim/LazyVim/issues/3592)) ([0ba67c8](https://github.com/LazyVim/LazyVim/commit/0ba67c87e9054e09d562164de7ed1876587a0539))
* **fzf:** live document symbols. Fixes [#3587](https://github.com/LazyVim/LazyVim/issues/3587) ([056042b](https://github.com/LazyVim/LazyVim/commit/056042b221c93a14c6069d4a82b7435fc9a228fd))
* **fzf:** symbols filter ([7e0ac68](https://github.com/LazyVim/LazyVim/commit/7e0ac6850b613ba8cbc179fa2f71199184504a54))
* **vue:** disable inlay hints for vue, since they seem broken ([3233385](https://github.com/LazyVim/LazyVim/commit/3233385ddb61d01f87de374c061696a374596a10))
### Reverts
* "fix(dap): set host to 127.0.0.1 instead of localhost to prevent issues with ipv6. Fixes [#3577](https://github.com/LazyVim/LazyVim/issues/3577)" ([a3547e4](https://github.com/LazyVim/LazyVim/commit/a3547e4b3b03e019dbe7e543104ffd1ea82fa765))
## [12.12.0](https://github.com/LazyVim/LazyVim/compare/v12.11.0...v12.12.0) (2024-06-11)
### Features
* **extras:** added fzf-lua ([#3555](https://github.com/LazyVim/LazyVim/issues/3555)) ([6ab4041](https://github.com/LazyVim/LazyVim/commit/6ab404134db6004aab13dcf956e200ff063b2d42))
* **fzf:** better scrollbars ([8bb6538](https://github.com/LazyVim/LazyVim/commit/8bb653876c38518e4befb496b78659e76ed7afee))
* **fzf:** ignore current line for some lsp pickers ([c481861](https://github.com/LazyVim/LazyVim/commit/c4818616d541e4456850d1982be39b8151bd0f2a))
* **fzf:** prettier document symbols ([ba3aec7](https://github.com/LazyVim/LazyVim/commit/ba3aec7b4876e36a9f9fd3cce1d204c23c0fe24f))
* **lualine:** show readonly icon ([#3567](https://github.com/LazyVim/LazyVim/issues/3567)) ([21617a9](https://github.com/LazyVim/LazyVim/commit/21617a9d602f2400c8e9813490958e106cb88ca8))
### Bug Fixes
* **dap:** set host to 127.0.0.1 instead of localhost to prevent issues with ipv6. Fixes [#3577](https://github.com/LazyVim/LazyVim/issues/3577) ([9b8a393](https://github.com/LazyVim/LazyVim/commit/9b8a393edc8b9a12a39f712163f6476c084a7f71))
* **extras.copilot-chat:** small ui fix for which-key in visual mode ([#3573](https://github.com/LazyVim/LazyVim/issues/3573)) ([43afed1](https://github.com/LazyVim/LazyVim/commit/43afed121195df6591d0e941b913b98f849c8af3))
* **fzf:** lowercase symbols ([d1d24fa](https://github.com/LazyVim/LazyVim/commit/d1d24fa077add680bc532e08fd68aaa0841a14dc))
* **neo-tree:** use last window for preview ([#3560](https://github.com/LazyVim/LazyVim/issues/3560)) ([caaa6c4](https://github.com/LazyVim/LazyVim/commit/caaa6c440d5c3b80c03cad1dfd93989b852bb875))
* **php:** formatting and linting ([#3540](https://github.com/LazyVim/LazyVim/issues/3540)) ([f5dc867](https://github.com/LazyVim/LazyVim/commit/f5dc867ac29e31f833442006ebe3daf7540d1f69))
* **pick:** recent files in cwd. Fixes [#3580](https://github.com/LazyVim/LazyVim/issues/3580) ([d541069](https://github.com/LazyVim/LazyVim/commit/d541069fdffcf5ffaf2a7f161fd87bb68094c8cf))
* **sql:** make sure edgebars exist. Fixes [#3578](https://github.com/LazyVim/LazyVim/issues/3578) ([bd29f45](https://github.com/LazyVim/LazyVim/commit/bd29f4515307f59437995d5cc0ba601eb02b5baa))
* **util:** ensure unique cache keys in LazyVim.memoize ([#3576](https://github.com/LazyVim/LazyVim/issues/3576)) ([3354872](https://github.com/LazyVim/LazyVim/commit/335487282a128d6df7ea021a75b31f07a2b9ccfd))
## [12.11.0](https://github.com/LazyVim/LazyVim/compare/v12.10.0...v12.11.0) (2024-06-09)
### Features
* **octo:** re-open octo windows when restoring session + cleanup ([7793942](https://github.com/LazyVim/LazyVim/commit/7793942ebafd32ef90f79e28979898f8013976ff))
### Bug Fixes
* **extra-lang-angular:** add BufNew event to attach angular treesitter ([#3522](https://github.com/LazyVim/LazyVim/issues/3522)) ([fbb1276](https://github.com/LazyVim/LazyVim/commit/fbb1276ffd45683d4d64a2d99907bdbd3421c16f))
* **extras:** +prefix in which-key panel for visual mode ([#3537](https://github.com/LazyVim/LazyVim/issues/3537)) ([5185404](https://github.com/LazyVim/LazyVim/commit/51854046dbb0bacf690ddc217cc76bf98c8ec1aa))
* **helm:** missing dependency ([#3546](https://github.com/LazyVim/LazyVim/issues/3546)) ([02dd65c](https://github.com/LazyVim/LazyVim/commit/02dd65cdea1ae34cdf4ca00b20760dbb3cfcd72b))
* **lang:** neotest not loading rust tests ([#3544](https://github.com/LazyVim/LazyVim/issues/3544)) ([0567b37](https://github.com/LazyVim/LazyVim/commit/0567b37f61d5ad997793b950c38a6c8f73de3b9b))
* **luasnip:** disable nvim-snippets when luasnip is enabled. Fixes [#3547](https://github.com/LazyVim/LazyVim/issues/3547) ([aa059e0](https://github.com/LazyVim/LazyVim/commit/aa059e0d496e570f898644d3f18bc344ca179d38))
* **rust:** make neotest optional ([547dc76](https://github.com/LazyVim/LazyVim/commit/547dc76a12309d4dafc970ae08832140eae51cba))
* **typescript:** clean up configuration of the vscode dap extension ([#3556](https://github.com/LazyVim/LazyVim/issues/3556)) ([1c46f54](https://github.com/LazyVim/LazyVim/commit/1c46f544328b084753327a81b92e2b57ab568321))
* **typescript:** implemented move to new file. Fixes [#3534](https://github.com/LazyVim/LazyVim/issues/3534) ([d90930b](https://github.com/LazyVim/LazyVim/commit/d90930b13e4515a5f4e4f3892ac9f7c392c4f20c))
## [12.10.0](https://github.com/LazyVim/LazyVim/compare/v12.9.0...v12.10.0) (2024-06-07)
+31
View File
@@ -0,0 +1,31 @@
# Contributing to LazyVim
## General Guidelines
- Avoid using Vim plugins whenever possible.
- If an extra requires a Vim plugin, explain why in the PR description.
- Ensure all configurations are overridable by the user, using Lazy's specs.
- Tag specs as `optional` if they should only be enabled when the user has them installed.
- Implement proper lazy-loading for every plugin added in an extra.
- Understand how Lazy's dependencies work. For Lua dependencies, do not specify
them in the `dependencies` field. Instead, add them as a separate spec with `lazy=true`.
## Contributing an Extra Plugin
- The plugin should be well-known and require significant configuration.
- Simple specs containing just the plugin with some options will not be accepted.
## Contributing an Extra Language
- You should be familiar with the language you are adding.
- You should have experience with the language's ecosystem, including formatters,
linters, and LSP servers.
- The extra should include the setup most widely used by the community.
- Include Tree-sitter parsers that are not yet the default.
- Include the most widely used LSP server setup.
- Avoid the need for LSP wrapper packages whenever possible.
- Only add a formatter if it is typically used by the community instead of the LSP formatter.
- Only add extra linters if the community typically uses them instead of just the LSP linters.
- Every language extra requires a `recommended` section as part of the extra.
Check lspconfig server configurations for the proper filetypes and root directories.
Refer to other extras for creating the `recommended` section.
+1 -1
View File
@@ -1,4 +1,4 @@
*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 June 09
*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 June 12
==============================================================================
Table of Contents *LazyVim-table-of-contents*
+15 -183
View File
@@ -89,6 +89,7 @@ return {
end,
desc = "Open with System Application",
},
["P"] = { "toggle_preview", config = { use_float = false } },
},
},
default_component_configs = {
@@ -141,156 +142,6 @@ return {
},
},
-- Fuzzy finder.
-- The default key bindings to find files will use Telescope's
-- `find_files` or `git_files` depending on whether the
-- directory is a git repo.
{
"nvim-telescope/telescope.nvim",
cmd = "Telescope",
version = false, -- telescope did only one release, so use HEAD for now
dependencies = {
{
"nvim-telescope/telescope-fzf-native.nvim",
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,
},
},
keys = {
{
"<leader>,",
"<cmd>Telescope buffers sort_mru=true sort_lastused=true<cr>",
desc = "Switch Buffer",
},
{ "<leader>/", LazyVim.pick("live_grep"), desc = "Grep (Root Dir)" },
{ "<leader>:", "<cmd>Telescope command_history<cr>", desc = "Command History" },
{ "<leader><space>", LazyVim.pick("auto"), desc = "Find Files (Root Dir)" },
-- find
{ "<leader>fb", "<cmd>Telescope buffers sort_mru=true sort_lastused=true<cr>", desc = "Buffers" },
{ "<leader>fc", LazyVim.pick.config_files(), desc = "Find Config File" },
{ "<leader>ff", LazyVim.pick("auto"), desc = "Find Files (Root Dir)" },
{ "<leader>fF", LazyVim.pick("auto", { root = 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", LazyVim.pick("oldfiles"), desc = "Recent (cwd)" },
-- git
{ "<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", LazyVim.pick("live_grep"), desc = "Grep (Root Dir)" },
{ "<leader>sG", LazyVim.pick("live_grep", { root = false }), desc = "Grep (cwd)" },
{ "<leader>sh", "<cmd>Telescope help_tags<cr>", desc = "Help Pages" },
{ "<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>sq", "<cmd>Telescope quickfix<cr>", desc = "Quickfix List" },
{ "<leader>sw", LazyVim.pick("grep_string", { word_match = "-w" }), desc = "Word (Root Dir)" },
{ "<leader>sW", LazyVim.pick("grep_string", { root = false, word_match = "-w" }), desc = "Word (cwd)" },
{ "<leader>sw", LazyVim.pick("grep_string"), mode = "v", desc = "Selection (Root Dir)" },
{ "<leader>sW", LazyVim.pick("grep_string", { root = false }), mode = "v", desc = "Selection (cwd)" },
{ "<leader>uC", LazyVim.pick("colorscheme", { enable_preview = true }), desc = "Colorscheme with Preview" },
{
"<leader>ss",
function()
require("telescope.builtin").lsp_document_symbols({
symbols = require("lazyvim.config").get_kind_filter(),
})
end,
desc = "Goto Symbol",
},
{
"<leader>sS",
function()
require("telescope.builtin").lsp_dynamic_workspace_symbols({
symbols = require("lazyvim.config").get_kind_filter(),
})
end,
desc = "Goto Symbol (Workspace)",
},
},
opts = function()
local actions = require("telescope.actions")
local open_with_trouble = function(...)
return require("trouble.sources.telescope").open(...)
end
local find_files_no_ignore = function()
local action_state = require("telescope.actions.state")
local line = action_state.get_current_line()
LazyVim.pick("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()
LazyVim.pick("find_files", { hidden = true, default_text = line })()
end
return {
defaults = {
prompt_prefix = "",
selection_caret = "",
-- open files in the first window that is an actual file.
-- use the current window if no other window is available.
get_selection_window = function()
local wins = vim.api.nvim_list_wins()
table.insert(wins, 1, vim.api.nvim_get_current_win())
for _, win in ipairs(wins) do
local buf = vim.api.nvim_win_get_buf(win)
if vim.bo[buf].buftype == "" then
return win
end
end
return 0
end,
mappings = {
i = {
["<c-t>"] = open_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,
["<C-Up>"] = actions.cycle_history_prev,
["<C-f>"] = actions.preview_scrolling_down,
["<C-b>"] = actions.preview_scrolling_up,
},
n = {
["q"] = actions.close,
},
},
},
}
end,
},
-- Flash enhances the built-in search functionality by showing labels
-- at the end of each match, letting you quickly jump to a specific
-- location.
@@ -310,38 +161,6 @@ return {
},
},
-- Flash Telescope config
{
"nvim-telescope/telescope.nvim",
optional = true,
opts = function(_, opts)
if not LazyVim.has("flash.nvim") then
return
end
local function flash(prompt_bufnr)
require("flash").jump({
pattern = "^",
label = { after = { 0, 0 } },
search = {
mode = "search",
exclude = {
function(win)
return vim.bo[vim.api.nvim_win_get_buf(win)].filetype ~= "TelescopeResults"
end,
},
},
action = function(match)
local picker = require("telescope.actions.state").get_current_picker(prompt_bufnr)
picker:set_selection(match.pos[1] - 1)
end,
})
end
opts.defaults = vim.tbl_deep_extend("force", opts.defaults or {}, {
mappings = { n = { s = flash }, i = { ["<c-s>"] = flash } },
})
end,
},
-- which-key helps you remember key bindings by showing a popup
-- with the active keybindings of the command you started typing.
{
@@ -470,7 +289,7 @@ return {
"folke/todo-comments.nvim",
cmd = { "TodoTrouble", "TodoTelescope" },
event = "LazyFile",
config = true,
opts = {},
-- stylua: ignore
keys = {
{ "]t", function() require("todo-comments").jump_next() end, desc = "Next Todo Comment" },
@@ -481,4 +300,17 @@ return {
{ "<leader>sT", "<cmd>TodoTelescope keywords=TODO,FIX,FIXME<cr>", desc = "Todo/Fix/Fixme" },
},
},
{
import = "lazyvim.plugins.extras.editor.fzf",
enabled = function()
return LazyVim.has_extra("editor.fzf")
end,
},
{
import = "lazyvim.plugins.extras.editor.telescope",
enabled = function()
return not LazyVim.has_extra("editor.fzf")
end,
},
}
@@ -1,3 +1,19 @@
local M = {}
---@param kind string
function M.pick(kind)
return function()
local actions = require("CopilotChat.actions")
local items = actions[kind .. "_actions"]()
if not items then
LazyVim.warn("No " .. kind .. " found on the current line")
return
end
local ok = pcall(require, "fzf-lua")
require("CopilotChat.integrations." .. (ok and "fzflua" or "telescope")).pick(items)
end
end
return {
{
"CopilotC-Nvim/CopilotChat.nvim",
@@ -22,7 +38,7 @@ return {
}
end,
keys = {
{ "<leader>a", "", desc = "+ai" },
{ "<leader>a", "", desc = "+ai", mode = { "n", "v" } },
{
"<leader>aa",
function()
@@ -50,6 +66,10 @@ return {
desc = "Quick Chat (CopilotChat)",
mode = { "n", "v" },
},
-- Show help actions with telescope
{ "<leader>ad", M.pick("help"), desc = "Diagnostic Help (CopilotChat)", mode = { "n", "v" } },
-- Show prompts actions with telescope
{ "<leader>ap", M.pick("prompt"), desc = "Prompt Actions (CopilotChat)", mode = { "n", "v" } },
},
config = function(_, opts)
local chat = require("CopilotChat")
@@ -67,39 +87,6 @@ return {
end,
},
-- 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",
+11 -1
View File
@@ -8,8 +8,18 @@ return {
highlight = { timer = 150 },
},
keys = {
{
"<leader>p",
function()
if LazyVim.pick.picker.name == "telescope" then
require("telescope").extensions.yank_history.yank_history({})
else
vim.cmd([[YankyRingHistory]])
end
end,
desc = "Open Yank History",
},
-- 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" },
+86 -43
View File
@@ -1,30 +1,40 @@
---@class FzfLuaOpts: lazyvim.util.pick.Opts
---@field cmd string?
LazyVim.pick.commands = {
files = "files",
}
---@type LazyPicker
local picker = {
name = "fzf",
commands = {
files = "files",
},
---@param command string
---@param opts? FzfLuaOpts
LazyVim.pick._open = function(command, opts)
opts = opts or {}
if opts.cmd == nil and command == "git_files" and opts.show_untracked then
opts.cmd = "git ls-files --exclude-standard --cached --others"
end
return require("fzf-lua")[command](opts)
---@param command string
---@param opts? FzfLuaOpts
open = function(command, opts)
opts = opts or {}
if opts.cmd == nil and command == "git_files" and opts.show_untracked then
opts.cmd = "git ls-files --exclude-standard --cached --others"
end
return require("fzf-lua")[command](opts)
end,
}
if not LazyVim.pick.register(picker) then
return {}
end
local function symbols_filter(entry, ctx)
ctx.symbols_filter = ctx.symbols_filter or require("lazyvim.config").get_kind_filter(ctx.bufnr)
if ctx.symbols_filter == nil then
ctx.symbols_filter = require("lazyvim.config").get_kind_filter(ctx.bufnr) or false
end
if ctx.symbols_filter == false then
return true
end
return vim.tbl_contains(ctx.symbols_filter, entry.kind)
end
return {
{
"nvim-telescope/telescope.nvim",
enabled = false,
},
desc = "Awesome picker for FZF (alternative to Telescope)",
recommended = true,
{
"ibhagwan/fzf-lua",
event = "VeryLazy",
@@ -34,6 +44,9 @@ return {
-- Quickfix
config.defaults.keymap.fzf["ctrl-q"] = "select-all+accept"
config.defaults.keymap.fzf["ctrl-u"] = "half-page-up"
config.defaults.keymap.fzf["ctrl-d"] = "half-page-down"
config.defaults.keymap.fzf["ctrl-x"] = "jump"
config.defaults.keymap.builtin["<c-f>"] = "preview-page-down"
config.defaults.keymap.builtin["<c-b>"] = "preview-page-up"
@@ -49,6 +62,7 @@ return {
LazyVim.pick.open(ctx.__INFO.cmd, o)
end
config.defaults.actions.files["alt-c"] = config.defaults.actions.files["ctrl-r"]
config.set_action_helpstr(config.defaults.actions.files["ctrl-r"], "toggle-root-dir")
-- use the same prompt for all
local defaults = require("fzf-lua.profiles.default-title")
@@ -62,10 +76,41 @@ return {
end
fix(defaults)
vim.api.nvim_set_hl(0, "FzfLuaPath", { link = "Directory", default = true })
return vim.tbl_deep_extend("force", opts, defaults, {
fzf_colors = true,
fzf_opts = {
["--no-scrollbar"] = true,
},
defaults = {
-- formatter = "path.filename_first",
formatter = "path.dirname_first",
},
-- Custom LazyVim option to configure vim.ui.select
ui_select = function(fzf_opts, items)
local title = vim.trim((fzf_opts.prompt or "Select"):gsub("%s*:%s*$", ""))
local width, height ---@type number?, number?
if fzf_opts.kind ~= "codeaction" then
width, height = 0.5, math.floor(math.min(vim.o.lines * 0.8, #items + 2) + 0.5)
end
return vim.tbl_deep_extend("force", fzf_opts, {
prompt = "",
winopts = {
title = " " .. title .. " ",
title_pos = "center",
width = width,
height = height,
},
})
end,
winopts = {
width = 0.8,
height = 0.8,
row = 0.5,
col = 0.5,
preview = {
scrollchars = { "", "" },
},
},
files = {
cwd_prompt = false,
actions = {
@@ -74,29 +119,31 @@ return {
},
},
grep = {
formatter = "path.hl",
actions = {
["alt-i"] = { actions.toggle_ignore },
["alt-h"] = { actions.toggle_hidden },
},
},
formatters = {
path = {
hl = {
_to = function()
local _, escseq = require("fzf-lua.utils").ansi_from_hl("FzfLuaPath", "foo")
return [[
return function(s, _, m)
return "]] .. (escseq or "") .. [["
.. s .. m.utils.ansi_escseq.clear
end
]]
end,
},
lsp = {
symbols = {
symbol_hl = function(s)
return "TroubleIcon" .. s
end,
symbol_fmt = function(s)
return s:lower() .. "\t"
end,
child_prefix = false,
},
code_actions = {
previewer = vim.fn.executable("delta") == 1 and "codeaction_native" or nil,
},
},
})
end,
config = function(_, opts)
require("fzf-lua").setup(opts)
require("fzf-lua").register_ui_select(opts.ui_select or nil)
end,
keys = {
{ "<esc>", "<cmd>close<cr>", ft = "fzf", mode = "t", nowait = true },
{ "<c-j>", "<Down>", ft = "fzf", mode = "t", nowait = true },
@@ -116,7 +163,7 @@ return {
{ "<leader>fF", LazyVim.pick("auto", { root = false }), desc = "Find Files (cwd)" },
{ "<leader>fg", "<cmd>FzfLua git_files<cr>", desc = "Find Files (git-files)" },
{ "<leader>fr", "<cmd>FzfLua oldfiles<cr>", desc = "Recent" },
{ "<leader>fR", LazyVim.pick("oldfiles", { root = false }), desc = "Recent (cwd)" },
{ "<leader>fR", LazyVim.pick("oldfiles", { cwd = vim.uv.cwd() }), desc = "Recent (cwd)" },
-- git
{ "<leader>gc", "<cmd>FzfLua git_commits<CR>", desc = "Commits" },
{ "<leader>gs", "<cmd>FzfLua git_status<CR>", desc = "Status" },
@@ -156,7 +203,7 @@ return {
{
"<leader>sS",
function()
require("fzf-lua").lsp_dynamic_workspace_symbols({
require("fzf-lua").lsp_live_workspace_symbols({
regex_filter = symbols_filter,
})
end,
@@ -179,16 +226,12 @@ return {
"neovim/nvim-lspconfig",
opts = function()
local Keys = require("lazyvim.plugins.lsp.keymaps").get()
-- stylua: ignore
vim.list_extend(Keys, {
{
"gd",
"<cmd>FzfLua lsp_definitions jump_to_single_result=true<cr>",
desc = "Goto Definition",
has = "definition",
},
{ "gr", "<cmd>FzfLua lsp_references jump_to_single_result=true<cr>", desc = "References", nowait = true },
{ "gI", "<cmd>FzfLua lsp_implementations jump_to_single_result=true<cr>", desc = "Goto Implementation" },
{ "gy", "<cmd>FzfLua lsp_typedefs jump_to_single_result=true<cr>", desc = "Goto T[y]pe Definition" },
{ "gd", "<cmd>FzfLua lsp_definitions jump_to_single_result=true ignore_current_line=true<cr>", desc = "Goto Definition", has = "definition" },
{ "gr", "<cmd>FzfLua lsp_references jump_to_single_result=true ignore_current_line=true<cr>", desc = "References", nowait = true },
{ "gI", "<cmd>FzfLua lsp_implementations jump_to_single_result=true ignore_current_line=true<cr>", desc = "Goto Implementation" },
{ "gy", "<cmd>FzfLua lsp_typedefs jump_to_single_result=true ignore_current_line=true<cr>", desc = "Goto T[y]pe Definition" },
})
end,
},
@@ -1,14 +1,6 @@
return {
"echasnovski/mini.files",
opts = {
mappings = {
toggle_hidden = "g.",
change_cwd = "gc",
go_in_horizontal = "<C-w>s",
go_in_vertical = "<C-w>v",
go_in_horizontal_plus = "<C-w>S",
go_in_vertical_plus = "<C-w>V",
},
windows = {
preview = true,
width_focus = 30,
@@ -90,17 +82,22 @@ return {
vim.keymap.set(
"n",
opts.mappings.toggle_hidden,
opts.mappings and opts.mappings.toggle_hidden or "g.",
toggle_dotfiles,
{ buffer = buf_id, desc = "Toggle hidden files" }
)
vim.keymap.set("n", opts.mappings.change_cwd, files_set_cwd, { buffer = args.data.buf_id, desc = "Set cwd" })
vim.keymap.set(
"n",
opts.mappings and opts.mappings.change_cwd or "gc",
files_set_cwd,
{ buffer = args.data.buf_id, desc = "Set cwd" }
)
map_split(buf_id, opts.mappings.go_in_horizontal, "horizontal", false)
map_split(buf_id, opts.mappings.go_in_vertical, "vertical", false)
map_split(buf_id, opts.mappings.go_in_horizontal_plus, "horizontal", true)
map_split(buf_id, opts.mappings.go_in_vertical_plus, "vertical", true)
map_split(buf_id, opts.mappings and opts.mappings.go_in_horizontal or "<C-w>s", "horizontal", false)
map_split(buf_id, opts.mappings and opts.mappings.go_in_vertical or "<C-w>v", "vertical", false)
map_split(buf_id, opts.mappings and opts.mappings.go_in_horizontal_plus or "<C-w>S", "horizontal", true)
map_split(buf_id, opts.mappings and opts.mappings.go_in_vertical_plus or "<C-w>V", "vertical", true)
end,
})
@@ -0,0 +1,245 @@
-- TODO:
-- - [ ] remove telescope util
-- - [ ] better lsp bindings
---@type LazyPicker
local picker = {
name = "telescope",
commands = {
files = "find_files",
},
-- this will return a function that calls telescope.
-- cwd will default to lazyvim.util.get_root
-- for `files`, git_files or find_files will be chosen depending on .git
---@param builtin string
---@param opts? lazyvim.util.pick.Opts
open = function(builtin, opts)
opts = opts or {}
if opts.cwd and opts.cwd ~= vim.uv.cwd() then
local function open_cwd_dir()
local action_state = require("telescope.actions.state")
local line = action_state.get_current_line()
LazyVim.pick.open(
builtin,
vim.tbl_deep_extend("force", {}, opts or {}, {
root = false,
default_text = line,
})
)
end
---@diagnostic disable-next-line: inject-field
opts.attach_mappings = function(_, map)
-- opts.desc is overridden by telescope, until it's changed there is this fix
map("i", "<a-c>", open_cwd_dir, { desc = "Open cwd Directory" })
return true
end
end
require("telescope.builtin")[builtin](opts)
end,
}
if not LazyVim.pick.register(picker) then
return {}
end
return {
-- Fuzzy finder.
-- The default key bindings to find files will use Telescope's
-- `find_files` or `git_files` depending on whether the
-- directory is a git repo.
{
"nvim-telescope/telescope.nvim",
cmd = "Telescope",
version = false, -- telescope did only one release, so use HEAD for now
dependencies = {
{
"nvim-telescope/telescope-fzf-native.nvim",
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,
},
},
keys = {
{
"<leader>,",
"<cmd>Telescope buffers sort_mru=true sort_lastused=true<cr>",
desc = "Switch Buffer",
},
{ "<leader>/", LazyVim.pick("live_grep"), desc = "Grep (Root Dir)" },
{ "<leader>:", "<cmd>Telescope command_history<cr>", desc = "Command History" },
{ "<leader><space>", LazyVim.pick("auto"), desc = "Find Files (Root Dir)" },
-- find
{ "<leader>fb", "<cmd>Telescope buffers sort_mru=true sort_lastused=true<cr>", desc = "Buffers" },
{ "<leader>fc", LazyVim.pick.config_files(), desc = "Find Config File" },
{ "<leader>ff", LazyVim.pick("auto"), desc = "Find Files (Root Dir)" },
{ "<leader>fF", LazyVim.pick("auto", { root = 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", LazyVim.pick("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" },
-- 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", LazyVim.pick("live_grep"), desc = "Grep (Root Dir)" },
{ "<leader>sG", LazyVim.pick("live_grep", { root = false }), desc = "Grep (cwd)" },
{ "<leader>sh", "<cmd>Telescope help_tags<cr>", desc = "Help Pages" },
{ "<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>sq", "<cmd>Telescope quickfix<cr>", desc = "Quickfix List" },
{ "<leader>sw", LazyVim.pick("grep_string", { word_match = "-w" }), desc = "Word (Root Dir)" },
{ "<leader>sW", LazyVim.pick("grep_string", { root = false, word_match = "-w" }), desc = "Word (cwd)" },
{ "<leader>sw", LazyVim.pick("grep_string"), mode = "v", desc = "Selection (Root Dir)" },
{ "<leader>sW", LazyVim.pick("grep_string", { root = false }), mode = "v", desc = "Selection (cwd)" },
{ "<leader>uC", LazyVim.pick("colorscheme", { enable_preview = true }), desc = "Colorscheme with Preview" },
{
"<leader>ss",
function()
require("telescope.builtin").lsp_document_symbols({
symbols = require("lazyvim.config").get_kind_filter(),
})
end,
desc = "Goto Symbol",
},
{
"<leader>sS",
function()
require("telescope.builtin").lsp_dynamic_workspace_symbols({
symbols = require("lazyvim.config").get_kind_filter(),
})
end,
desc = "Goto Symbol (Workspace)",
},
},
opts = function()
local actions = require("telescope.actions")
local open_with_trouble = function(...)
return require("trouble.sources.telescope").open(...)
end
local find_files_no_ignore = function()
local action_state = require("telescope.actions.state")
local line = action_state.get_current_line()
LazyVim.pick("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()
LazyVim.pick("find_files", { hidden = true, default_text = line })()
end
return {
defaults = {
prompt_prefix = "",
selection_caret = "",
-- open files in the first window that is an actual file.
-- use the current window if no other window is available.
get_selection_window = function()
local wins = vim.api.nvim_list_wins()
table.insert(wins, 1, vim.api.nvim_get_current_win())
for _, win in ipairs(wins) do
local buf = vim.api.nvim_win_get_buf(win)
if vim.bo[buf].buftype == "" then
return win
end
end
return 0
end,
mappings = {
i = {
["<c-t>"] = open_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,
["<C-Up>"] = actions.cycle_history_prev,
["<C-f>"] = actions.preview_scrolling_down,
["<C-b>"] = actions.preview_scrolling_up,
},
n = {
["q"] = actions.close,
},
},
},
}
end,
},
-- Flash Telescope config
{
"nvim-telescope/telescope.nvim",
optional = true,
opts = function(_, opts)
if not LazyVim.has("flash.nvim") then
return
end
local function flash(prompt_bufnr)
require("flash").jump({
pattern = "^",
label = { after = { 0, 0 } },
search = {
mode = "search",
exclude = {
function(win)
return vim.bo[vim.api.nvim_win_get_buf(win)].filetype ~= "TelescopeResults"
end,
},
},
action = function(match)
local picker = require("telescope.actions.state").get_current_picker(prompt_bufnr)
picker:set_selection(match.pos[1] - 1)
end,
})
end
opts.defaults = vim.tbl_deep_extend("force", opts.defaults or {}, {
mappings = { n = { s = flash }, i = { ["<c-s>"] = flash } },
})
end,
},
-- better vim.ui with telescope
{
"stevearc/dressing.nvim",
lazy = true,
init = function()
---@diagnostic disable-next-line: duplicate-set-field
vim.ui.select = function(...)
require("lazy").load({ plugins = { "dressing.nvim" } })
return vim.ui.select(...)
end
---@diagnostic disable-next-line: duplicate-set-field
vim.ui.input = function(...)
require("lazy").load({ plugins = { "dressing.nvim" } })
return vim.ui.input(...)
end
end,
},
}
+1 -1
View File
@@ -121,7 +121,7 @@ return {
},
{
"leoluz/nvim-dap-go",
config = true,
opts = {},
},
},
},
+40 -1
View File
@@ -18,12 +18,23 @@ return {
},
},
{
"williamboman/mason.nvim",
opts = {
ensure_installed = {
"phpcs",
"php-cs-fixer",
},
},
},
{
"mfussenegger/nvim-dap",
optional = true,
dependencies = {
"williamboman/mason.nvim",
opts = { ensure_installed = { "php-debug-adapter" } },
opts = { ensure_installed = {
"php-debug-adapter",
} },
},
opts = function()
local dap = require("dap")
@@ -35,4 +46,32 @@ return {
}
end,
},
{
"nvimtools/none-ls.nvim",
optional = true,
opts = function(_, opts)
local nls = require("null-ls")
opts.sources = opts.sources or {}
table.insert(opts.sources, nls.builtins.formatting.phpcsfixer)
table.insert(opts.sources, nls.builtins.diagnostics.phpcs)
end,
},
{
"mfussenegger/nvim-lint",
optional = true,
opts = {
linters_by_ft = {
php = { "phpcs" },
},
},
{
"stevearc/conform.nvim",
optional = true,
opts = {
formatters_by_ft = {
php = { "php-cs-fixer" },
},
},
},
},
}
+2
View File
@@ -75,6 +75,7 @@ return {
"folke/edgy.nvim",
optional = true,
opts = function(_, opts)
opts.right = opts.right or {}
table.insert(opts.right, {
title = "Database",
ft = "dbui",
@@ -85,6 +86,7 @@ return {
end,
})
opts.bottom = opts.bottom or {}
table.insert(opts.bottom, {
title = "DB Query Result",
ft = "dbout",
+1 -1
View File
@@ -49,7 +49,7 @@ return {
{
"hrsh7th/nvim-cmp",
dependencies = {
{ "roobert/tailwindcss-colorizer-cmp.nvim", config = true },
{ "roobert/tailwindcss-colorizer-cmp.nvim", opts = {} },
},
opts = function(_, opts)
-- original LazyVim kind icon formatter
@@ -57,6 +57,7 @@ return {
},
{
"nvim-telescope/telescope.nvim",
optional = true,
dependencies = {
{
"ANGkeith/telescope-terraform-doc.nvim",
@@ -14,17 +14,18 @@ return {
init = function()
vim.api.nvim_create_autocmd("FileType", {
pattern = {
"help",
"alpha",
"dashboard",
"neo-tree",
"Trouble",
"trouble",
"fzf",
"help",
"lazy",
"lazyterm",
"mason",
"neo-tree",
"notify",
"toggleterm",
"lazyterm",
"Trouble",
"trouble",
},
callback = function()
vim.b.miniindentscope_disable = true
+50 -22
View File
@@ -1,24 +1,50 @@
return {
{
"telescope.nvim",
dependencies = {
-- project management
{
"ahmedkhalf/project.nvim",
opts = {
manual_mode = true,
},
event = "VeryLazy",
config = function(_, opts)
require("project_nvim").setup(opts)
LazyVim.on_load("telescope.nvim", function()
require("telescope").load_extension("projects")
end)
end,
keys = {
{ "<leader>fp", "<Cmd>Telescope projects<CR>", desc = "Projects" },
local pick = function()
if LazyVim.pick.picker.name == "telescope" then
return vim.cmd("Telescope projects")
elseif LazyVim.pick.picker.name == "fzf" then
local fzf_lua = require("fzf-lua")
local history = require("project_nvim.utils.history")
local results = history.get_recent_projects()
fzf_lua.fzf_exec(results, {
actions = {
["default"] = {
function(selected)
fzf_lua.files({ cwd = selected[1] })
end,
},
},
})
end
end
return {
{
"ahmedkhalf/project.nvim",
opts = {
manual_mode = true,
},
event = "VeryLazy",
config = function(_, opts)
require("project_nvim").setup(opts)
LazyVim.on_load("telescope.nvim", function()
require("telescope").load_extension("projects")
end)
end,
},
{
"telescope.nvim",
optional = true,
keys = {
{ "<leader>fp", pick, desc = "Projects" },
},
},
{
"ibhagwan/fzf-lua",
optional = true,
keys = {
{ "<leader>fp", pick, desc = "Projects" },
},
},
@@ -26,12 +52,13 @@ return {
"goolord/alpha-nvim",
optional = true,
opts = function(_, dashboard)
local button = dashboard.button("p", "" .. " Projects", ":Telescope projects <CR>")
local button = dashboard.button("p", "" .. " Projects", pick)
button.opts.hl = "AlphaButtons"
button.opts.hl_shortcut = "AlphaShortcut"
table.insert(dashboard.section.buttons.val, 4, button)
end,
},
{
"echasnovski/mini.starter",
optional = true,
@@ -39,19 +66,20 @@ return {
local items = {
{
name = "Projects",
action = "Telescope projects",
action = pick,
section = string.rep(" ", 22) .. "Telescope",
},
}
vim.list_extend(opts.items, items)
end,
},
{
"nvimdev/dashboard-nvim",
optional = true,
opts = function(_, opts)
local projects = {
action = "Telescope projects",
action = pick,
desc = " Projects",
icon = "",
key = "p",
+1 -1
View File
@@ -12,5 +12,5 @@ require("lazyvim.config").init()
return {
{ "folke/lazy.nvim", version = "*" },
{ "LazyVim/LazyVim", priority = 10000, lazy = false, config = true, cond = true, version = "*" },
{ "LazyVim/LazyVim", priority = 10000, lazy = false, opts = {}, cond = true, version = "*" },
}
+1 -1
View File
@@ -38,7 +38,7 @@ return {
-- provide the inlay hints.
inlay_hints = {
enabled = true,
exclude = {}, -- filetypes for which you don't want to enable inlay hints
exclude = { "vue" }, -- filetypes for which you don't want to enable inlay hints
},
-- Enable this to enable the builtin LSP code lenses on Neovim >= 0.10.0
-- Be aware that you also will need to properly configure your LSP server to
+1 -19
View File
@@ -34,24 +34,6 @@ return {
end,
},
-- better vim.ui
{
"stevearc/dressing.nvim",
lazy = true,
init = function()
---@diagnostic disable-next-line: duplicate-set-field
vim.ui.select = function(...)
require("lazy").load({ plugins = { "dressing.nvim" } })
return vim.ui.select(...)
end
---@diagnostic disable-next-line: duplicate-set-field
vim.ui.input = function(...)
require("lazy").load({ plugins = { "dressing.nvim" } })
return vim.ui.input(...)
end
end,
},
-- This is what powers LazyVim's fancy-looking
-- tabs, which include filetype icons and close buttons.
{
@@ -305,7 +287,7 @@ 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" },
{ "<leader>snt", function() require("noice").cmd("telescope") end, desc = "Noice Telescope" },
{ "<leader>snt", function() require("noice").cmd("pick") end, desc = "Noice Picker (Telescope/FzfLua)" },
{ "<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"}},
},
+8 -4
View File
@@ -32,6 +32,7 @@ local deprecated = {
toggle_diagnostics = { "toggle", "diagnostics" },
toggle_number = { "toggle", "number" },
fg = "ui",
telescope = "pick",
}
setmetatable(M, {
@@ -78,8 +79,10 @@ end
---@param extra string
function M.has_extra(extra)
local Config = require("lazyvim.config")
local modname = "lazyvim.plugins.extras." .. extra
return vim.tbl_contains(require("lazy.core.config").spec.modules, modname)
or vim.tbl_contains(Config.json.data.extras, modname)
end
---@param fn fun()
@@ -269,17 +272,18 @@ for _, level in ipairs({ "info", "warn", "error" }) do
end
end
local cache = {} ---@type table<string, any>
local cache = {} ---@type table<(fun()), table<string, any>>
---@generic T: fun()
---@param fn T
---@return T
function M.memoize(fn)
return function(...)
local key = vim.inspect({ ... })
if cache[key] == nil then
cache[key] = fn(...)
cache[fn] = cache[fn] or {}
if cache[fn][key] == nil then
cache[fn][key] = fn(...)
end
return cache[key]
return cache[fn][key]
end
end
+1
View File
@@ -129,6 +129,7 @@ function M.rename_file()
vim.ui.input({
prompt = "New File Name: ",
default = extra,
completion = "file",
}, function(new)
if not new or new == "" or new == extra then
return
+8 -2
View File
@@ -72,7 +72,7 @@ function M.format(component, text, hl_group)
return component:format_hl(lualine_hl_group) .. text .. component:get_default_hl()
end
---@param opts? {relative: "cwd"|"root", modified_hl: string?, directory_hl: string?, filename_hl: string?}
---@param opts? {relative: "cwd"|"root", modified_hl: string?, directory_hl: string?, filename_hl: string?, modified_sign: string?, readonly_icon: string?, length: number?}
function M.pretty_path(opts)
opts = vim.tbl_extend("force", {
relative = "cwd",
@@ -80,6 +80,7 @@ function M.pretty_path(opts)
directory_hl = "",
filename_hl = "Bold",
modified_sign = "",
readonly_icon = " 󰌾 ",
length = 3,
}, opts or {})
@@ -120,7 +121,12 @@ function M.pretty_path(opts)
dir = table.concat({ unpack(parts, 1, #parts - 1) }, sep)
dir = M.format(self, dir .. sep, opts.directory_hl)
end
return dir .. parts[#parts]
local readonly = ""
if vim.bo.readonly then
readonly = M.format(self, opts.readonly_icon, opts.modified_hl)
end
return dir .. parts[#parts] .. readonly
end
end
+31 -2
View File
@@ -12,14 +12,43 @@ local M = setmetatable({}, {
---@field buf? number
---@field show_untracked? boolean
---@class LazyPicker
---@field name string
---@field open fun(command:string, opts?:lazyvim.util.pick.Opts)
---@field commands table<string, string>
---@type LazyPicker?
M.picker = nil
---@type table<string, string>
M.commands = {
files = "find_files",
}
---@param picker LazyPicker
function M.register(picker)
-- this only happens when using :LazyExtras
-- so allow to get the full spec
if vim.v.vim_did_enter == 1 then
return true
end
if M.picker then
LazyVim.warn(
"`LazyVim.pick`: picker already set to `" .. M.picker.name .. "`,\nignoring new picker `" .. picker.name .. "`"
)
return false
end
M.picker = picker
return true
end
---@param command? string
---@param opts? lazyvim.util.pick.Opts
function M.open(command, opts)
if not M.picker then
return LazyVim.error("LazyVim.pick: picker not set")
end
command = command or "auto"
opts = opts or {}
@@ -46,8 +75,8 @@ function M.open(command, opts)
opts.show_untracked = opts.show_untracked ~= false
end
end
command = M.commands[command] or command
M._open(command, opts)
command = M.picker.commands[command] or command
M.picker.open(command, opts)
end
---@param command? string
-48
View File
@@ -1,48 +0,0 @@
---@class lazyvim.util.telescope
---@overload fun(builtin:string, opts?:lazyvim.util.pick.Opts)
local M = setmetatable({}, {
__call = function(m, ...)
return m.telescope(...)
end,
})
-- this will return a function that calls telescope.
-- cwd will default to lazyvim.util.get_root
-- for `files`, git_files or find_files will be chosen depending on .git
---@param builtin string
---@param opts? lazyvim.util.pick.Opts
function M.open(builtin, opts)
opts = opts or {}
if opts.cwd and opts.cwd ~= vim.uv.cwd() then
local function open_cwd_dir()
local action_state = require("telescope.actions.state")
local line = action_state.get_current_line()
LazyVim.pick.open(
builtin,
vim.tbl_deep_extend("force", {}, opts or {}, {
root = false,
default_text = line,
})
)
end
---@diagnostic disable-next-line: inject-field
opts.attach_mappings = function(_, map)
-- opts.desc is overridden by telescope, until it's changed there is this fix
map("i", "<a-c>", open_cwd_dir, { desc = "Open cwd Directory" })
return true
end
end
require("telescope.builtin")[builtin](opts)
end
M.telescope = function(...)
LazyVim.deprecate("LazyVim.telescope", "LazyVim.pick")
return LazyVim.pick.wrap(...)
end
function M.config_files()
return LazyVim.pick.config_files()
end
return M
+6
View File
@@ -0,0 +1,6 @@
describe("Should not have", function()
it("dd()", function()
local out = vim.fn.system([[/bin/grep --line-number -r '\\bdd(' lua]])
assert(vim.v.shell_error == 1, "Should not have dd()\n" .. out)
end)
end)
+36
View File
@@ -0,0 +1,36 @@
---@module "luassert"
local LazyVim = require("lazyvim.util")
describe("util", function()
local t = 0
local fn = function(a)
t = t + 1
return a
end
local m = LazyVim.memoize(fn)
it("should memoize a function", function()
local a = m(1)
local b = m(1)
local c = m(2)
assert.are.equal(a, b)
assert.are.equal(a, 1)
assert.are.equal(c, 2)
assert.are.equal(t, 2)
assert.are_not.equal(a, c)
end)
local f1 = LazyVim.memoize(function()
return 1
end)
local f2 = LazyVim.memoize(function()
return 2
end)
it("should memoize based on the correct key", function()
assert.are.equal(f1(), 1)
assert.are.equal(f2(), 2)
end)
end)