Compare commits

...

116 Commits

Author SHA1 Message Date
8c3f9fd497 fix(terraform): make telescope optional 2024-06-12 23:13:18 +02:00
f608564517 refactor: check active picker 2024-06-12 23:10:16 +02:00
3b0810c003 fix(fzf): path.dirname_first 2024-06-12 20:54:56 +02:00
ef0d55e651 refactor: new formatter is merged, so removde custom :) 2024-06-12 18:20:16 +02:00
1f97b9d120 fix(fzf): refactor 2024-06-12 18:20:16 +02:00
db8e0f7d35 fix(telescope): flash integration 2024-06-12 18:20:16 +02:00
ff223e7347 fix(fzf): use custom formatter for now, since filename_search messes with searching 2024-06-12 18:20:16 +02:00
b2b6ff0738 feat(pick): move pickers to extras telescope & fzf-lua and include telescope by default 2024-06-12 18:20:16 +02:00
4b9e4edbb1 fix(project): add fzf-lua integration. Fixes #3609 2024-06-12 18:18:17 +02:00
46eb3242d3 refactor: copilot-chat 2024-06-12 11:41:03 +02:00
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
14d1ca93d0 feat(fzf): use vscode style path names formatter 2024-06-12 11:23:45 +02:00
52b572881b fix(lsp): add file completion to rename file 2024-06-12 10:43:01 +02:00
82f680ee6b feat(yanky): added fzf-lua support 2024-06-12 07:57:07 +02:00
60a1c1979d chore(build): auto-generate vimdoc 2024-06-12 05:45:25 +00:00
ec3dba20af feat(noice): added support for fzf-lua. Closes #3596 2024-06-12 07:44:47 +02:00
74cf6e4462 feat(fzf): better default window size/position 2024-06-12 00:27:23 +02:00
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](7252474624))
* **fzf:** added ctrl-u and ctrl+d to scroll in the results list
([9f2a369](9f2a3699a8))
* **fzf:** added ctrl-x to jump with easymotion to a line, similar to
flash telescope
([1c740ce](1c740ce3fd))
* **fzf:** use delta previewer for code actions when available
([1697100](16971006c2))


### Bug Fixes

* **fzf:** action desc
([c6ddb23](c6ddb2328d))
* **fzf:** added action descriptions. (still doesnt work for trouble)
([19a6e2d](19a6e2de15))
* **fzf:** cleanup
([79b7c48](79b7c489fd))
* **fzf:** disable mini.indentscope in fzf-lua buffer
([#3592](https://github.com/LazyVim/LazyVim/issues/3592))
([0ba67c8](0ba67c87e9))
* **fzf:** live document symbols. Fixes
[#3587](https://github.com/LazyVim/LazyVim/issues/3587)
([056042b](056042b221))
* **fzf:** symbols filter
([7e0ac68](7e0ac6850b))
* **vue:** disable inlay hints for vue, since they seem broken
([3233385](3233385ddb))


### 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](a3547e4b3b))

---
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
16971006c2 feat(fzf): use delta previewer for code actions when available 2024-06-11 23:48:16 +02:00
3233385ddb fix(vue): disable inlay hints for vue, since they seem broken 2024-06-11 23:21:56 +02:00
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
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
9f2a3699a8 feat(fzf): added ctrl-u and ctrl+d to scroll in the results list 2024-06-11 19:38:22 +02:00
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
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
7e0ac6850b fix(fzf): symbols filter 2024-06-11 16:11:45 +02:00
056042b221 fix(fzf): live document symbols. Fixes #3587 2024-06-11 16:08:27 +02:00
79b7c489fd fix(fzf): cleanup 2024-06-11 15:47:14 +02:00
c6ddb2328d fix(fzf): action desc 2024-06-11 14:58:35 +02:00
19a6e2de15 fix(fzf): added action descriptions. (still doesnt work for trouble) 2024-06-11 14:49:09 +02:00
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](6ab404134d))
* **fzf:** better scrollbars
([8bb6538](8bb653876c))
* **fzf:** ignore current line for some lsp pickers
([c481861](c4818616d5))
* **fzf:** prettier document symbols
([ba3aec7](ba3aec7b48))
* **lualine:** show readonly icon
([#3567](https://github.com/LazyVim/LazyVim/issues/3567))
([21617a9](21617a9d60))


### 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](9b8a393edc))
* **extras.copilot-chat:** small ui fix for which-key in visual mode
([#3573](https://github.com/LazyVim/LazyVim/issues/3573))
([43afed1](43afed1211))
* **fzf:** lowercase symbols
([d1d24fa](d1d24fa077))
* **neo-tree:** use last window for preview
([#3560](https://github.com/LazyVim/LazyVim/issues/3560))
([caaa6c4](caaa6c440d))
* **php:** formatting and linting
([#3540](https://github.com/LazyVim/LazyVim/issues/3540))
([f5dc867](f5dc867ac2))
* **pick:** recent files in cwd. Fixes
[#3580](https://github.com/LazyVim/LazyVim/issues/3580)
([d541069](d541069fdf))
* **sql:** make sure edgebars exist. Fixes
[#3578](https://github.com/LazyVim/LazyVim/issues/3578)
([bd29f45](bd29f45153))
* **util:** ensure unique cache keys in LazyVim.memoize
([#3576](https://github.com/LazyVim/LazyVim/issues/3576))
([3354872](335487282a))

---
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
d541069fdf fix(pick): recent files in cwd. Fixes #3580 2024-06-11 14:26:46 +02:00
bd29f45153 fix(sql): make sure edgebars exist. Fixes #3578 2024-06-11 09:10:10 +02:00
c4818616d5 feat(fzf): ignore current line for some lsp pickers 2024-06-11 09:05:16 +02:00
8bb653876c feat(fzf): better scrollbars 2024-06-11 09:04:39 +02:00
d1d24fa077 fix(fzf): lowercase symbols 2024-06-11 07:44:32 +02:00
ba3aec7b48 feat(fzf): prettier document symbols 2024-06-11 07:42:21 +02:00
638769d320 test: simple test to make sure I don't keep debug stuff around 2024-06-11 07:27:04 +02:00
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
14d47f650c refactor: memoize 2024-06-11 06:51:30 +02:00
3b447a8037 chore(build): auto-generate vimdoc 2024-06-11 04:42:12 +00:00
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:


7d30360df2/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
7d30360df2 refactor: config = true >> opts = {} 2024-06-11 00:06:56 +02:00
9b5d810c05 docs: added experience to CONTRIBUTING 2024-06-10 23:26:07 +02:00
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
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
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
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
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
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
4b7c389f14 docs: fix link 2024-06-10 15:09:30 +02:00
4b1d397627 chore(build): auto-generate vimdoc 2024-06-10 13:05:24 +00:00
9d78a22252 docs: added contributing 2024-06-10 15:04:43 +02:00
65060ece67 ci: pull request template 2024-06-10 15:04:43 +02:00
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](7793942eba))


### Bug Fixes

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

---
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
1c46f54432 fix(typescript): clean up configuration of the vscode dap extension (#3556)
`mason-nvim-dap.nvim` adds it's own adapter filetype mappings to the
vscode extension in `nvim-dap` (as of
https://github.com/jay-babu/mason-nvim-dap.nvim/pull/129)

This also moves the type mappings for the `pwa-node` and `node` adapters
to where they are defined in the typescript pack.

Now that the default internal type mappings are configured we can rely
on the automatic loading of the `.vscode/launch.json` that `nvim-dap`
does
2024-06-09 22:48:51 +02:00
7793942eba feat(octo): re-open octo windows when restoring session + cleanup 2024-06-09 11:42:58 +02:00
2848ee492b ci: link to discussions 2024-06-09 11:36:44 +02:00
547dc76a12 fix(rust): make neotest optional 2024-06-09 09:27:29 +02:00
Ian
0567b37f61 fix(lang): neotest not loading rust tests (#3544)
fixes https://github.com/LazyVim/LazyVim/issues/3543
2024-06-09 08:37:08 +02:00
aa059e0d49 fix(luasnip): disable nvim-snippets when luasnip is enabled. Fixes #3547 2024-06-09 07:37:45 +02:00
28426cc31c chore(build): auto-generate vimdoc 2024-06-09 05:34:35 +00:00
02dd65cdea fix(helm): missing dependency (#3546)
according to this comment
ab41ff551b (r142924660)
2024-06-09 07:33:59 +02:00
fbb1276ffd fix(extra-lang-angular): add BufNew event to attach angular treesitter (#3522)
## Problem

Sometimes angular treesitter didn't get started, e.g. when creating a
new file.

## Solution

- Add `BufNew` event to attach angular treesitter.
- Change `BufRead` to `BufReadPost` for better readability.

### Related Neovim docs
- [BufRead / BufReadPost
docs](https://neovim.io/doc/user/autocmd.html#BufRead)
- [BufNew](https://neovim.io/doc/user/autocmd.html#BufNew)
2024-06-08 23:57:45 +02:00
51854046db fix(extras): +prefix in which-key panel for visual mode (#3537) 2024-06-08 10:04:10 +02:00
8f7ee56dab refactor: LazyVim.lsp.on_attach 2024-06-08 08:11:30 +02:00
6098a36d92 chore(build): auto-generate vimdoc 2024-06-08 05:31:47 +00:00
d90930b13e fix(typescript): implemented move to new file. Fixes #3534 2024-06-08 07:30:49 +02:00
1394070aab docs(news): fixed versions 2024-06-08 00:11:24 +02:00
16f3ebb9f1 docs(news): added link to news 2024-06-07 23:59:07 +02:00
a5f8af912d chore(main): release 12.10.0 (#3532)
🤖 I have created a release *beep* *boop*
---


##
[12.10.0](https://github.com/LazyVim/LazyVim/compare/v12.9.0...v12.10.0)
(2024-06-07)


### Features

* **prettier:** prettier is now enabled for all supported filetypes and
no longer requires a config file by default
([7d50bf0](7d50bf0626))
* **prettier:** with the prettier & astro extra, prettier will be
enabled if the prettier-astro-plugin is available
([214f5fc](214f5fccdf))
* **svelte:** with prettier & svelte extra, prettier will be enabled
when prettier-plugin-svelte is available
([945143a](945143a34e))
* **util:** added LazyVim.has_extra
([b714f28](b714f28662))
* **util:** added LazyVim.memoize
([5a11d74](5a11d740e1))


### Bug Fixes

* **clojure:** removed rainbow delimiters and fixed some plugin setups.
Closes [#3530](https://github.com/LazyVim/LazyVim/issues/3530)
([cfa8c9f](cfa8c9fbd4))
* **cmp:** don't enable `snippets` source without `nvim-snippets`
([#3527](https://github.com/LazyVim/LazyVim/issues/3527))
([af80811](af80811be0))
* **extras:** load prettier extra before svelte/astro
([4980574](49805748d4))
* **formatting:** remove deprecation check on some options
([c16fb5d](c16fb5d49b))
* **prettier:** fixup
([ac9217b](ac9217b199))

---
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-07 23:57:13 +02:00
f202f573b4 docs: updated news 2024-06-07 23:54:57 +02:00
ac9217b199 fix(prettier): fixup 2024-06-07 23:24:01 +02:00
af80811be0 fix(cmp): don't enable snippets source without nvim-snippets (#3527)
Make it easier, so if users decide to disable `nvim-snippets`, they
don't have to remove the `snippets` source manually in their config.
2024-06-07 23:12:59 +02:00
cfa8c9fbd4 fix(clojure): removed rainbow delimiters and fixed some plugin setups. Closes #3530 2024-06-07 23:10:40 +02:00
588240ca09 style: better types for vim.api.nvim_create_autocmd 2024-06-07 23:02:47 +02:00
49805748d4 fix(extras): load prettier extra before svelte/astro 2024-06-07 23:02:47 +02:00
945143a34e feat(svelte): with prettier & svelte extra, prettier will be enabled when prettier-plugin-svelte is available 2024-06-07 23:02:47 +02:00
214f5fccdf feat(prettier): with the prettier & astro extra, prettier will be enabled if the prettier-astro-plugin is available 2024-06-07 23:02:47 +02:00
7d50bf0626 feat(prettier): prettier is now enabled for all supported filetypes and no longer requires a config file by default 2024-06-07 23:02:47 +02:00
5a11d740e1 feat(util): added LazyVim.memoize 2024-06-07 23:02:47 +02:00
b714f28662 feat(util): added LazyVim.has_extra 2024-06-07 23:02:47 +02:00
c16fb5d49b fix(formatting): remove deprecation check on some options 2024-06-07 23:02:47 +02:00
789b1b4fd4 chore(main): release 12.9.0 (#3501)
🤖 I have created a release *beep* *boop*
---


##
[12.9.0](https://github.com/LazyVim/LazyVim/compare/v12.8.0...v12.9.0)
(2024-06-07)


### Features

* **autocmd:** enable spell for typst and text file
([#3505](https://github.com/LazyVim/LazyVim/issues/3505))
([8ca7245](8ca7245129))
* **docs:** add link to LazyVim For Ambitious Developers to README
([#3504](https://github.com/LazyVim/LazyVim/issues/3504))
([2a5ab31](2a5ab3109a))
* **lang:** add clojure support
([#2179](https://github.com/LazyVim/LazyVim/issues/2179))
([913902b](913902ba36))
* **neo-tree:** added l:open and h:close_node to neo-tree. Closes
[#3293](https://github.com/LazyVim/LazyVim/issues/3293)
([dbec83d](dbec83d57a))
* **options:** when available use treesitter spell regions for spell
checking
([276b803](276b8032be))
* **sql:** add SQL extra
([#1740](https://github.com/LazyVim/LazyVim/issues/1740))
([59495c1](59495c1871))


### Bug Fixes

* **editor:** telescope init error when trouble.nvim is disabled
([#3518](https://github.com/LazyVim/LazyVim/issues/3518))
([c452fd7](c452fd730c))
* **lualine:** only show one Lualine component for symbols
([#3514](https://github.com/LazyVim/LazyVim/issues/3514))
([827aa53](827aa5380a)),
closes [#3511](https://github.com/LazyVim/LazyVim/issues/3511)
* **mini.files:** fix error about `opts.mappings`
([#3507](https://github.com/LazyVim/LazyVim/issues/3507))
([9210648](92106484ed))
* removed leader-m, since it is leading to too many issues. Still
available at leader-wm
([119dcb9](119dcb949a))

---
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-07 20:44:39 +02:00
913902ba36 feat(lang): add clojure support (#2179)
This adds support to Clojure as an extra _lang_ configuration. 
Closes https://github.com/LazyVim/LazyVim/pull/1484
@folke I read the docs and couldn't find a recommendation on _how_ to
suggest features, so I figured opening a PR should be enought. please
let me know if I should do anything else.

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Folke Lemaitre <folke.lemaitre@gmail.com>
2024-06-07 17:23:23 +02:00
2ac3f0daa1 ci: Create dependabot.yml 2024-06-07 16:27:31 +02:00
94c338765c style: fix spelling in octo keymap description (#3521) 2024-06-07 16:05:59 +02:00
c1cb4467ec style: fix some spells (#3517) 2024-06-07 13:35:25 +02:00
c452fd730c fix(editor): telescope init error when trouble.nvim is disabled (#3518)
I got this error message when opening telescope.

```
Failed to run `config` for telescope.nvim

...l/share/nvim/lazy/LazyVim/lua/lazyvim/plugins/editor.lua:241: module 'trouble.sources.telescope' not found:
^Ino field package.preload['trouble.sources.telescope']
...
```

After investigating it, the reason was I have `trouble.nvim` disabled
but the default base `opts` function is loading it.
I tried wrapping it with a function to lazy load the `trouble.nvim`
module and it worked in my local setup.
2024-06-07 13:23:04 +02:00
827aa5380a fix(lualine): only show one Lualine component for symbols (#3514)
Fixes #3511
2024-06-07 12:12:05 +02:00
119dcb949a fix: removed leader-m, since it is leading to too many issues. Still available at leader-wm 2024-06-07 10:53:56 +02:00
e1c54ac638 chore(build): auto-generate vimdoc 2024-06-07 07:04:47 +00:00
ab41ff551b refactor: use lazy's new opts_extend functionality for treesitter and mason 2024-06-07 09:03:59 +02:00
f70d350085 style: comment 2024-06-07 07:02:51 +02:00
59495c1871 feat(sql): add SQL extra (#1740)
Co-authored-by: Fredrik Averpil <fredrik.averpil@gmail.com>
Co-authored-by: Folke Lemaitre <folke.lemaitre@gmail.com>
2024-06-06 23:27:59 +02:00
8ca7245129 feat(autocmd): enable spell for typst and text file (#3505) 2024-06-06 22:38:24 +02:00
276b8032be feat(options): when available use treesitter spell regions for spell checking 2024-06-06 22:37:47 +02:00
92106484ed fix(mini.files): fix error about opts.mappings (#3507) 2024-06-06 20:52:40 +02:00
1699091d70 chore(build): auto-generate vimdoc 2024-06-06 16:54:37 +00:00
2a5ab3109a feat(docs): add link to LazyVim For Ambitious Developers to README (#3504)
As requested, here's a link to my book from the README. I'll add the
video and this link to the main page of lazyvim.org as well.
2024-06-06 18:54:02 +02:00
dbec83d57a feat(neo-tree): added l:open and h:close_node to neo-tree. Closes #3293 2024-06-06 18:05:11 +02:00
ad092e96f9 chore(main): release 12.8.0 (#3494)
🤖 I have created a release *beep* *boop*
---


##
[12.8.0](https://github.com/LazyVim/LazyVim/compare/v12.7.0...v12.8.0)
(2024-06-06)


### Features

* **options:** added linebreak=true to default options
([1f4c196](1f4c1964fd))


### Bug Fixes

* **markdown:** missing markdown-toc in mason
([#3499](https://github.com/LazyVim/LazyVim/issues/3499))
([a9aea4b](a9aea4b5a1))
* **mason-nvim-dap:** correctly configure to auto-install debug adapters
([#3493](https://github.com/LazyVim/LazyVim/issues/3493))
([86ba1bc](86ba1bc62d))
* **octo:** fixed octo's rendering of comment signs when lines are
wrapped
([81370cf](81370cf714))
* **octo:** load octo on `octo://*` events, so that those buffers work
after session restore
([e6443ad](e6443ad7dc))
* **php:** php gets recommended in every .git repo
([#3496](https://github.com/LazyVim/LazyVim/issues/3496))
([3654098](3654098520))
* **prettier:** fix prettier config detection. Closes
[#3497](https://github.com/LazyVim/LazyVim/issues/3497)
([e51199c](e51199cffa))
* **prettier:** use prettier to check if prettier should run on the file
([0255b8f](0255b8fdb1))

---
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-06 17:44:45 +02:00
0255b8fdb1 fix(prettier): use prettier to check if prettier should run on the file 2024-06-06 17:38:12 +02:00
a9aea4b5a1 fix(markdown): missing markdown-toc in mason (#3499)
missing `markdown-toc` in ensure installed for `extra/markdown`
2024-06-06 16:22:40 +02:00
e51199cffa fix(prettier): fix prettier config detection. Closes #3497 2024-06-06 16:15:39 +02:00
3654098520 fix(php): php gets recommended in every .git repo (#3496) 2024-06-06 16:07:39 +02:00
81370cf714 fix(octo): fixed octo's rendering of comment signs when lines are wrapped 2024-06-06 16:05:55 +02:00
1f4c1964fd feat(options): added linebreak=true to default options 2024-06-06 16:05:23 +02:00
e6443ad7dc fix(octo): load octo on octo://* events, so that those buffers work after session restore 2024-06-06 14:58:44 +02:00
86ba1bc62d fix(mason-nvim-dap): correctly configure to auto-install debug adapters (#3493)
Tested with `php` and `kotlin` Extras. 

`kotlin` Extra doesn't have the debug adapter in Mason
`ensure_installed` and doesn't install automatically on its own.

`php` Extra has the debug adapter defined in Mason `ensure_installed`
and does correctly install automatically. However, this should not be
needed due to `mason-nvim-dap`. If you remove [these
lines](ed93ce9c15/lua/lazyvim/plugins/extras/lang/php.lua (L26-L33)),
then the debug adapter doesn't automatically install, but it should.

With the change introduced in this PR, both Extras automatically install
the debug adapters. `kotlin` Extra doesn't need anything else and in
`php` Extra the lines I mentioned previously can be removed or not. The
point is not to remove previously Mason dependencies with debug
adapters, but to correctly configure `mason-nvim-dap`, so in future
Extras you don't have to define the debug adapter inside a Mason
dependency.
2024-06-06 14:35:59 +02:00
ed93ce9c15 chore(main): release 12.7.0 (#3490)
🤖 I have created a release *beep* *boop*
---


##
[12.7.0](https://github.com/LazyVim/LazyVim/compare/v12.6.0...v12.7.0)
(2024-06-06)


### Features

* **extras:** add thrift lang support
([#2804](https://github.com/LazyVim/LazyVim/issues/2804))
([5a19f6b](5a19f6b5fe))
* **extras:** added extra for neogen. Closes
[#2881](https://github.com/LazyVim/LazyVim/issues/2881)
([6fd2c88](6fd2c88024))
* **extras:** added gleam lang support
([#2802](https://github.com/LazyVim/LazyVim/issues/2802))
([1891b02](1891b02d9d))
* **lang:** add elm
([#3023](https://github.com/LazyVim/LazyVim/issues/3023))
([4742390](4742390960))
* **lang:** added php support
([#1450](https://github.com/LazyVim/LazyVim/issues/1450))
([32ba8ea](32ba8ea3fe))

---
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-06 13:46:20 +02:00
4742390960 feat(lang): add elm (#3023)
Adding https://elm-lang.org support.

- Adds `elm` Treesitter parsers
- Adds `elm-language-server` language server
- Adds `elm-format` formatter

## LSP Configuration

The default
[elm-language-server](https://github.com/elm-tooling/elm-language-server)
configuration matches all [currently supported features for Neovim
LSP](https://github.com/elm-tooling/elm-language-server#editor-support).

## A note on elm-test and elm-review

`elm-test` is not directly supported by [neo-test](../test/neotest) but
it's available via
[neotest-vim-test](https://github.com/nvim-neotest/neotest-vim-test).

However, it is common practice to peruse both
[elm-test](https://github.com/elm-explorations/test/) and
[elm-review](https://github.com/jfmengels/elm-review) directly via the
command line.

---------

Co-authored-by: gacallea <gacallea@users.noreply.github.com>
Co-authored-by: Folke Lemaitre <folke.lemaitre@gmail.com>
2024-06-06 13:36:02 +02:00
5a19f6b5fe feat(extras): add thrift lang support (#2804)
This PR adds support for thriftls, the first line is because thrift is
not among the neovim built-in file types.

---------

Co-authored-by: Folke Lemaitre <folke.lemaitre@gmail.com>
2024-06-06 13:30:17 +02:00
32ba8ea3fe feat(lang): added php support (#1450)
Configures tree-sitter, phpactor as LSP server and
xdebug/vscode-php-debug as DAP server.

---------

Co-authored-by: Folke Lemaitre <folke.lemaitre@gmail.com>
2024-06-06 13:26:51 +02:00
1891b02d9d feat(extras): added gleam lang support (#2802)
Added [Gleam lang](https://gleam.run/) support.

---------

Co-authored-by: Folke Lemaitre <folke.lemaitre@gmail.com>
2024-06-06 13:23:29 +02:00
6fd2c88024 feat(extras): added extra for neogen. Closes #2881 2024-06-06 13:14:04 +02:00
82 changed files with 1863 additions and 804 deletions

View File

@ -1 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: Ask a question or start a discussion
url: https://github.com/LazyVim/LazyVim/discussions
about: Use Github discussions instead

15
.github/PULL_REQUEST_TEMPLATE.md vendored Normal file
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.

11
.github/dependabot.yml vendored Normal file
View File

@ -0,0 +1,11 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
version: 2
updates:
- package-ecosystem: "github-actions" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "weekly"

View File

@ -1,5 +1,142 @@
# 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)
### Features
* **prettier:** prettier is now enabled for all supported filetypes and no longer requires a config file by default ([7d50bf0](https://github.com/LazyVim/LazyVim/commit/7d50bf0626f768b4d036b500ff204835fa405b74))
* **prettier:** with the prettier & astro extra, prettier will be enabled if the prettier-astro-plugin is available ([214f5fc](https://github.com/LazyVim/LazyVim/commit/214f5fccdf468030b05851ebfbef8394485322fb))
* **svelte:** with prettier & svelte extra, prettier will be enabled when prettier-plugin-svelte is available ([945143a](https://github.com/LazyVim/LazyVim/commit/945143a34e298541989a9f050a3fb2ced6646e9e))
* **util:** added LazyVim.has_extra ([b714f28](https://github.com/LazyVim/LazyVim/commit/b714f286623cca6e3da31df43c4cf4354a46c36d))
* **util:** added LazyVim.memoize ([5a11d74](https://github.com/LazyVim/LazyVim/commit/5a11d740e119d392858b97b69470201e66e66212))
### Bug Fixes
* **clojure:** removed rainbow delimiters and fixed some plugin setups. Closes [#3530](https://github.com/LazyVim/LazyVim/issues/3530) ([cfa8c9f](https://github.com/LazyVim/LazyVim/commit/cfa8c9fbd45a36784f76d4842bc385828214ee1c))
* **cmp:** don't enable `snippets` source without `nvim-snippets` ([#3527](https://github.com/LazyVim/LazyVim/issues/3527)) ([af80811](https://github.com/LazyVim/LazyVim/commit/af80811be01f5349544a1b21e9dd03f0e25fefca))
* **extras:** load prettier extra before svelte/astro ([4980574](https://github.com/LazyVim/LazyVim/commit/49805748d4cefc077cc0c81e864f1757198fc3f4))
* **formatting:** remove deprecation check on some options ([c16fb5d](https://github.com/LazyVim/LazyVim/commit/c16fb5d49bfe10041fb36f6ac80a755767b9e6bf))
* **prettier:** fixup ([ac9217b](https://github.com/LazyVim/LazyVim/commit/ac9217b1994ad00b488ba73021d89afac03873ee))
## [12.9.0](https://github.com/LazyVim/LazyVim/compare/v12.8.0...v12.9.0) (2024-06-07)
### Features
* **autocmd:** enable spell for typst and text file ([#3505](https://github.com/LazyVim/LazyVim/issues/3505)) ([8ca7245](https://github.com/LazyVim/LazyVim/commit/8ca72451298f60e6440ac48293052c5e82bd8ec6))
* **docs:** add link to LazyVim For Ambitious Developers to README ([#3504](https://github.com/LazyVim/LazyVim/issues/3504)) ([2a5ab31](https://github.com/LazyVim/LazyVim/commit/2a5ab3109a7e5f3ef98c2a93f24738797c6d9cc6))
* **lang:** add clojure support ([#2179](https://github.com/LazyVim/LazyVim/issues/2179)) ([913902b](https://github.com/LazyVim/LazyVim/commit/913902ba362603a4620f8981fdedac7f53816b3a))
* **neo-tree:** added l:open and h:close_node to neo-tree. Closes [#3293](https://github.com/LazyVim/LazyVim/issues/3293) ([dbec83d](https://github.com/LazyVim/LazyVim/commit/dbec83d57a1d5936ac860c37e0393a89b7cae7e9))
* **options:** when available use treesitter spell regions for spell checking ([276b803](https://github.com/LazyVim/LazyVim/commit/276b8032bedb6e1601ae85ecdfaee63217843b4f))
* **sql:** add SQL extra ([#1740](https://github.com/LazyVim/LazyVim/issues/1740)) ([59495c1](https://github.com/LazyVim/LazyVim/commit/59495c18714d8ae4c0b5f7a41dad96e39f9eb189))
### Bug Fixes
* **editor:** telescope init error when trouble.nvim is disabled ([#3518](https://github.com/LazyVim/LazyVim/issues/3518)) ([c452fd7](https://github.com/LazyVim/LazyVim/commit/c452fd730c94bfcbb5f9f4af1cae3c851f9456a3))
* **lualine:** only show one Lualine component for symbols ([#3514](https://github.com/LazyVim/LazyVim/issues/3514)) ([827aa53](https://github.com/LazyVim/LazyVim/commit/827aa5380a883e6a2a9904c253627489d43d3050)), closes [#3511](https://github.com/LazyVim/LazyVim/issues/3511)
* **mini.files:** fix error about `opts.mappings` ([#3507](https://github.com/LazyVim/LazyVim/issues/3507)) ([9210648](https://github.com/LazyVim/LazyVim/commit/92106484ed89efb364568fa27a689bd8be83d066))
* removed leader-m, since it is leading to too many issues. Still available at leader-wm ([119dcb9](https://github.com/LazyVim/LazyVim/commit/119dcb949a84d9b10a620c9ad8400c220c5e5adb))
## [12.8.0](https://github.com/LazyVim/LazyVim/compare/v12.7.0...v12.8.0) (2024-06-06)
### Features
* **options:** added linebreak=true to default options ([1f4c196](https://github.com/LazyVim/LazyVim/commit/1f4c1964fd9dda8db511bc47bc9a568a6230dff0))
### Bug Fixes
* **markdown:** missing markdown-toc in mason ([#3499](https://github.com/LazyVim/LazyVim/issues/3499)) ([a9aea4b](https://github.com/LazyVim/LazyVim/commit/a9aea4b5a14523641aceb23ba6717c07043faca1))
* **mason-nvim-dap:** correctly configure to auto-install debug adapters ([#3493](https://github.com/LazyVim/LazyVim/issues/3493)) ([86ba1bc](https://github.com/LazyVim/LazyVim/commit/86ba1bc62d4d39b1c68e267076dfc59315814048))
* **octo:** fixed octo's rendering of comment signs when lines are wrapped ([81370cf](https://github.com/LazyVim/LazyVim/commit/81370cf7145edbcb1d2ca79bf014e7342a44b106))
* **octo:** load octo on `octo://*` events, so that those buffers work after session restore ([e6443ad](https://github.com/LazyVim/LazyVim/commit/e6443ad7dcb6e3cca286aa6b94eb418e6fa15d8c))
* **php:** php gets recommended in every .git repo ([#3496](https://github.com/LazyVim/LazyVim/issues/3496)) ([3654098](https://github.com/LazyVim/LazyVim/commit/365409852080dd9565cdf1afbdf8f4b375b4f052))
* **prettier:** fix prettier config detection. Closes [#3497](https://github.com/LazyVim/LazyVim/issues/3497) ([e51199c](https://github.com/LazyVim/LazyVim/commit/e51199cffa290e0bf50a632fcc8eb1ee437801f9))
* **prettier:** use prettier to check if prettier should run on the file ([0255b8f](https://github.com/LazyVim/LazyVim/commit/0255b8fdb16e81a84d3642df96bd8d504fcb4a40))
## [12.7.0](https://github.com/LazyVim/LazyVim/compare/v12.6.0...v12.7.0) (2024-06-06)
### Features
* **extras:** add thrift lang support ([#2804](https://github.com/LazyVim/LazyVim/issues/2804)) ([5a19f6b](https://github.com/LazyVim/LazyVim/commit/5a19f6b5fe6f88804a7a80649b6587ef30dcdc85))
* **extras:** added extra for neogen. Closes [#2881](https://github.com/LazyVim/LazyVim/issues/2881) ([6fd2c88](https://github.com/LazyVim/LazyVim/commit/6fd2c88024447b7eed20ca5461be784df07a3787))
* **extras:** added gleam lang support ([#2802](https://github.com/LazyVim/LazyVim/issues/2802)) ([1891b02](https://github.com/LazyVim/LazyVim/commit/1891b02d9d50e935739fdaff6095b04a7760bf99))
* **lang:** add elm ([#3023](https://github.com/LazyVim/LazyVim/issues/3023)) ([4742390](https://github.com/LazyVim/LazyVim/commit/4742390960d6fa41ba7ea53cd3cd17a8d7f48084))
* **lang:** added php support ([#1450](https://github.com/LazyVim/LazyVim/issues/1450)) ([32ba8ea](https://github.com/LazyVim/LazyVim/commit/32ba8ea3fedb4ace60bc019fc895f4f07d0a60dc))
## [12.6.0](https://github.com/LazyVim/LazyVim/compare/v12.5.0...v12.6.0) (2024-06-06)

31
CONTRIBUTING.md Normal file
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.

27
NEWS.md
View File

@ -1,6 +1,19 @@
# What's new?
## 11.x
## 12.x
- This **news** is now also available on the website at [https://www.lazyvim.org/news](https://www.lazyvim.org/news)
- **prettier** extra now works for all prettier supported filetypes
and will be enabled for astro/svelte extra if you have a proper
config file with the correct prettier plugin
- **New Language Support:** SQL, Clojure, Thrift, Elm, Gleam, Angular,
NuShell, Svelte, Kotlin, Astro, Toml and PHP
- **New Extras:** `copilot-chat`, `git`, `octo`, `inc-rename` and `neogen`
- The **typescript** extra now uses `vtsls` instead of `tsserver`
- **Neovim >= 0.10** now uses the much faster [lazydev.nvim](https://github.com/folke/lazydev.nvim)
instead of `neodev.nvim`
@ -8,6 +21,18 @@
- moved `neoconf.nvim` to extras. Project specific LSP settings
can be done with a `.lazy.lua` file instead.
## 11.x
- **Keymaps:**
- `<leader>gB` to open the current repo in the browser
- `gco` and `gcO` to add a comment below or above the current line
- `<leader>wm` to toggle window maximize
- **lazydev.nvim:** faster alternative to `neodev.nvim`
- **Options:** Added `linebreak=true` to default options.
- `mini.ai` is back as a default plugin! Removing it was a mistake.
It's a great plugin that enhances the native text objects.

View File

@ -115,6 +115,10 @@ There's a great video created by [@elijahmanor](https://github.com/elijahmanor)
[![Watch the video](https://img.youtube.com/vi/N93cTbtLCIM/hqdefault.jpg)](https://www.youtube.com/watch?v=N93cTbtLCIM)
[@dusty-phillips](https://github.com/dusty-phillips) is working on a book called
[LazyVim for Ambitious Developers](https://lazyvim-ambitious-devs.phillips.codes)
available for free online.
## 📂 File Structure
The files under config will be automatically loaded at the appropriate time,

View File

@ -1,4 +1,4 @@
*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 June 06
*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 June 12
==============================================================================
Table of Contents *LazyVim-table-of-contents*
@ -102,6 +102,10 @@ Theres a great video created by @elijahmanor
<https://www.youtube.com/watch?v=N93cTbtLCIM>
@dusty-phillips <https://github.com/dusty-phillips> is working on a book called
LazyVim for Ambitious Developers
<https://lazyvim-ambitious-devs.phillips.codes> available for free online.
FILE STRUCTURE *LazyVim-file-structure*
@ -125,6 +129,7 @@ Refer to the docs <https://lazyvim.github.io>
2. *image*: https://user-images.githubusercontent.com/292349/213447056-92290767-ea16-430c-8727-ce994c93e9cc.png
3. *@elijahmanor*:
4. *Watch the video*: https://img.youtube.com/vi/N93cTbtLCIM/hqdefault.jpg
5. *@dusty-phillips*:
Generated by panvimdoc <https://github.com/kdheepak/panvimdoc>

View File

@ -66,6 +66,7 @@ vim.api.nvim_create_autocmd("FileType", {
"checkhealth",
"neotest-summary",
"neotest-output-panel",
"dbout",
},
callback = function(event)
vim.bo[event.buf].buflisted = false
@ -85,7 +86,7 @@ vim.api.nvim_create_autocmd("FileType", {
-- wrap and check for spell in text filetypes
vim.api.nvim_create_autocmd("FileType", {
group = augroup("wrap_spell"),
pattern = { "gitcommit", "markdown" },
pattern = { "*.txt", "*.tex", "*.typ", "gitcommit", "markdown" },
callback = function()
vim.opt_local.wrap = true
vim.opt_local.spell = true

View File

@ -182,7 +182,6 @@ 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" })

View File

@ -64,6 +64,7 @@ opt.grepprg = "rg --vimgrep"
opt.ignorecase = true -- Ignore case
opt.inccommand = "nosplit" -- preview incremental substitute
opt.laststatus = 3 -- global statusline
opt.linebreak = true -- Wrap lines at convenient points
opt.list = true -- Show some invisible characters (tabs...
opt.mouse = "a" -- Enable mouse mode
opt.number = true -- Print line number
@ -81,6 +82,7 @@ opt.signcolumn = "yes" -- Always show the signcolumn, otherwise it would shift t
opt.smartcase = true -- Don't ignore case with capitals
opt.smartindent = true -- Insert indents automatically
opt.spelllang = { "en" }
opt.spelloptions:append("noplainbuffer")
opt.splitbelow = true -- Put new windows below current
opt.splitkeep = "screen"
opt.splitright = true -- Put new windows right of current

View File

@ -19,7 +19,6 @@ return {
-- auto_brackets = { "python" }
-- }
-- ```
opts = function()
vim.api.nvim_set_hl(0, "CmpGhostText", { link = "Comment", default = true })
local cmp = require("cmp")
@ -112,7 +111,9 @@ return {
return LazyVim.cmp.expand(item.body)
end,
}
table.insert(opts.sources, { name = "snippets" })
if LazyVim.has("nvim-snippets") then
table.insert(opts.sources, { name = "snippets" })
end
end,
keys = {
{

View File

@ -72,6 +72,8 @@ return {
},
window = {
mappings = {
["l"] = "open",
["h"] = "close_node",
["<space>"] = "none",
["Y"] = {
function(state)
@ -87,6 +89,7 @@ return {
end,
desc = "Open with System Application",
},
["P"] = { "toggle_preview", config = { use_float = false } },
},
},
default_component_configs = {
@ -139,154 +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.telescope("live_grep"), desc = "Grep (Root Dir)" },
{ "<leader>:", "<cmd>Telescope command_history<cr>", desc = "Command History" },
{ "<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", 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", 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" },
-- 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.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>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()
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 = 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()
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()
LazyVim.telescope("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.
@ -306,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.
{
@ -466,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" },
@ -477,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,
},
}

View File

@ -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",

View File

@ -66,10 +66,8 @@ return {
-- attach cmp source whenever copilot attaches
-- fixes lazy-loading issues with the copilot cmp source
LazyVim.lsp.on_attach(function(client)
if client.name == "copilot" then
copilot_cmp._on_insert_enter({})
end
end)
copilot_cmp._on_insert_enter({})
end, "copilot")
end,
},
},

View File

@ -46,4 +46,8 @@ return {
{ "<s-tab>", function() require("luasnip").jump(-1) end, mode = { "i", "s" } },
},
},
{
"garymjr/nvim-snippets",
enabled = false,
},
}

View File

@ -0,0 +1,35 @@
return {
"danymat/neogen",
cmd = "Neogen",
keys = {
{
"<leader>cn",
function()
require("neogen").generate()
end,
desc = "Generate Annotations (Neogen)",
},
},
opts = function(_, opts)
if opts.snippet_engine ~= nil then
return
end
local map = {
["LuaSnip"] = "luasnip",
["nvim-snippy"] = "snippy",
["vim-vsnip"] = "vsnip",
}
for plugin, engine in pairs(map) do
if LazyVim.has(plugin) then
opts.snippet_engine = engine
return
end
end
if vim.snippet then
opts.snippet_engine = "nvim"
end
end,
}

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" },

View File

@ -11,112 +11,108 @@ local function get_args(config)
end
return {
"mfussenegger/nvim-dap",
recommended = true,
desc = "Debugging support. Requires language specific adapters to be configured. (see lang extras)",
{
"mfussenegger/nvim-dap",
recommended = true,
desc = "Debugging support. Requires language specific adapters to be configured. (see lang extras)",
dependencies = {
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" },
{ "<leader>de", function() require("dapui").eval() end, desc = "Eval", mode = {"n", "v"} },
},
opts = {},
config = function(_, opts)
local dap = require("dap")
local dapui = require("dapui")
dapui.setup(opts)
dap.listeners.after.event_initialized["dapui_config"] = function()
dapui.open({})
end
dap.listeners.before.event_terminated["dapui_config"] = function()
dapui.close({})
end
dap.listeners.before.event_exited["dapui_config"] = function()
dapui.close({})
end
end,
},
-- virtual text for the debugger
{
"theHamsta/nvim-dap-virtual-text",
opts = {},
},
-- mason.nvim integration
{
"jay-babu/mason-nvim-dap.nvim",
dependencies = "mason.nvim",
cmd = { "DapInstall", "DapUninstall" },
opts = {
-- Makes a best effort to setup the various debuggers with
-- reasonable debug configurations
automatic_installation = true,
-- You can provide additional configuration to the handlers,
-- see mason-nvim-dap README for more information
handlers = {},
-- You'll need to check that you have the required things installed
-- online, please don't ask me how to install them :)
ensure_installed = {
-- Update this to ensure that you have the debuggers for the langs you want
-- 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" },
{ "<leader>de", function() require("dapui").eval() end, desc = "Eval", mode = {"n", "v"} },
},
opts = {},
config = function(_, opts)
local dap = require("dap")
local dapui = require("dapui")
dapui.setup(opts)
dap.listeners.after.event_initialized["dapui_config"] = function()
dapui.open({})
end
dap.listeners.before.event_terminated["dapui_config"] = function()
dapui.close({})
end
dap.listeners.before.event_exited["dapui_config"] = function()
dapui.close({})
end
end,
},
-- virtual text for the debugger
{
"theHamsta/nvim-dap-virtual-text",
opts = {},
},
},
-- stylua: ignore
keys = {
{ "<leader>d", "", desc = "+debug", mode = {"n", "v"} },
{ "<leader>dB", function() require("dap").set_breakpoint(vim.fn.input('Breakpoint condition: ')) end, desc = "Breakpoint Condition" },
{ "<leader>db", function() require("dap").toggle_breakpoint() end, desc = "Toggle Breakpoint" },
{ "<leader>dc", function() require("dap").continue() end, desc = "Continue" },
{ "<leader>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>di", function() require("dap").step_into() end, desc = "Step Into" },
{ "<leader>dj", function() require("dap").down() end, desc = "Down" },
{ "<leader>dk", function() require("dap").up() end, desc = "Up" },
{ "<leader>dl", function() require("dap").run_last() end, desc = "Run Last" },
{ "<leader>do", function() require("dap").step_out() end, desc = "Step Out" },
{ "<leader>dO", function() require("dap").step_over() end, desc = "Step Over" },
{ "<leader>dp", function() require("dap").pause() end, desc = "Pause" },
{ "<leader>dr", function() require("dap").repl.toggle() end, desc = "Toggle REPL" },
{ "<leader>ds", function() require("dap").session() end, desc = "Session" },
{ "<leader>dt", function() require("dap").terminate() end, desc = "Terminate" },
{ "<leader>dw", function() require("dap.ui.widgets").hover() end, desc = "Widgets" },
},
config = function()
local Config = require("lazyvim.config")
vim.api.nvim_set_hl(0, "DapStoppedLine", { default = true, link = "Visual" })
for name, sign in pairs(Config.icons.dap) do
sign = type(sign) == "table" and sign or { sign }
vim.fn.sign_define(
"Dap" .. name,
{ text = sign[1], texthl = sign[2] or "DiagnosticInfo", linehl = sign[3], numhl = sign[3] }
)
end
-- setup dap config by VsCode launch.json file
local vscode = require("dap.ext.vscode")
local json = require("plenary.json")
vscode.json_decode = function(str)
return vim.json.decode(json.json_strip_comments(str))
end
end,
},
-- mason.nvim integration
{
"jay-babu/mason-nvim-dap.nvim",
dependencies = "mason.nvim",
cmd = { "DapInstall", "DapUninstall" },
opts = {
-- Makes a best effort to setup the various debuggers with
-- reasonable debug configurations
automatic_installation = true,
-- You can provide additional configuration to the handlers,
-- see mason-nvim-dap README for more information
handlers = {},
-- You'll need to check that you have the required things installed
-- online, please don't ask me how to install them :)
ensure_installed = {
-- Update this to ensure that you have the debuggers for the langs you want
},
},
},
-- stylua: ignore
keys = {
{ "<leader>d", "", desc = "+debug" },
{ "<leader>dB", function() require("dap").set_breakpoint(vim.fn.input('Breakpoint condition: ')) end, desc = "Breakpoint Condition" },
{ "<leader>db", function() require("dap").toggle_breakpoint() end, desc = "Toggle Breakpoint" },
{ "<leader>dc", function() require("dap").continue() end, desc = "Continue" },
{ "<leader>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>di", function() require("dap").step_into() end, desc = "Step Into" },
{ "<leader>dj", function() require("dap").down() end, desc = "Down" },
{ "<leader>dk", function() require("dap").up() end, desc = "Up" },
{ "<leader>dl", function() require("dap").run_last() end, desc = "Run Last" },
{ "<leader>do", function() require("dap").step_out() end, desc = "Step Out" },
{ "<leader>dO", function() require("dap").step_over() end, desc = "Step Over" },
{ "<leader>dp", function() require("dap").pause() end, desc = "Pause" },
{ "<leader>dr", function() require("dap").repl.toggle() end, desc = "Toggle REPL" },
{ "<leader>ds", function() require("dap").session() end, desc = "Session" },
{ "<leader>dt", function() require("dap").terminate() end, desc = "Terminate" },
{ "<leader>dw", function() require("dap.ui.widgets").hover() end, desc = "Widgets" },
},
config = function()
local Config = require("lazyvim.config")
vim.api.nvim_set_hl(0, "DapStoppedLine", { default = true, link = "Visual" })
for name, sign in pairs(Config.icons.dap) do
sign = type(sign) == "table" and sign or { sign }
vim.fn.sign_define(
"Dap" .. name,
{ text = sign[1], texthl = sign[2] or "DiagnosticInfo", linehl = sign[3], numhl = sign[3] }
)
end
-- 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,
}

View File

@ -104,27 +104,29 @@ return {
"nvim-lualine/lualine.nvim",
optional = true,
opts = function(_, opts)
table.insert(opts.sections.lualine_c, {
"aerial",
sep = " ", -- separator between symbols
sep_icon = "", -- separator between icon and symbol
if not vim.g.trouble_lualine then
table.insert(opts.sections.lualine_c, {
"aerial",
sep = " ", -- separator between symbols
sep_icon = "", -- separator between icon and symbol
-- The number of symbols to render top-down. In order to render only 'N' last
-- symbols, negative numbers may be supplied. For instance, 'depth = -1' can
-- be used in order to render only current symbol.
depth = 5,
-- The number of symbols to render top-down. In order to render only 'N' last
-- symbols, negative numbers may be supplied. For instance, 'depth = -1' can
-- be used in order to render only current symbol.
depth = 5,
-- When 'dense' mode is on, icons are not rendered near their symbols. Only
-- a single icon that represents the kind of current symbol is rendered at
-- the beginning of status line.
dense = false,
-- When 'dense' mode is on, icons are not rendered near their symbols. Only
-- a single icon that represents the kind of current symbol is rendered at
-- the beginning of status line.
dense = false,
-- The separator to be used to separate symbols in dense mode.
dense_sep = ".",
-- The separator to be used to separate symbols in dense mode.
dense_sep = ".",
-- Color the symbol icons.
colored = true,
})
-- Color the symbol icons.
colored = true,
})
end
end,
},
}

View File

@ -0,0 +1,238 @@
---@class FzfLuaOpts: lazyvim.util.pick.Opts
---@field cmd string?
---@type LazyPicker
local picker = {
name = "fzf",
commands = {
files = "files",
},
---@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)
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 {
desc = "Awesome picker for FZF (alternative to Telescope)",
recommended = true,
{
"ibhagwan/fzf-lua",
event = "VeryLazy",
opts = function(_, opts)
local config = require("fzf-lua.config")
local actions = require("fzf-lua.actions")
-- 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"
-- Trouble
config.defaults.actions.files["ctrl-t"] = require("trouble.sources.fzf").actions.open
-- Toggle root dir / cwd
config.defaults.actions.files["ctrl-r"] = function(_, ctx)
local o = vim.deepcopy(ctx.__call_opts)
o.root = o.root == false
o.cwd = nil
o.buf = ctx.__CTX.bufnr
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")
local function fix(t)
t.prompt = t.prompt ~= nil and "" or nil
for _, v in pairs(t) do
if type(v) == "table" then
fix(v)
end
end
end
fix(defaults)
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 = {
["alt-i"] = { actions.toggle_ignore },
["alt-h"] = { actions.toggle_hidden },
},
},
grep = {
actions = {
["alt-i"] = { actions.toggle_ignore },
["alt-h"] = { actions.toggle_hidden },
},
},
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 },
{ "<c-k>", "<Up>", ft = "fzf", mode = "t", nowait = true },
{
"<leader>,",
"<cmd>FzfLua buffers sort_mru=true sort_lastused=true<cr>",
desc = "Switch Buffer",
},
{ "<leader>/", LazyVim.pick("live_grep"), desc = "Grep (Root Dir)" },
{ "<leader>:", "<cmd>FzfLua command_history<cr>", desc = "Command History" },
{ "<leader><space>", LazyVim.pick("auto"), desc = "Find Files (Root Dir)" },
-- find
{ "<leader>fb", "<cmd>FzfLua 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>FzfLua git_files<cr>", desc = "Find Files (git-files)" },
{ "<leader>fr", "<cmd>FzfLua oldfiles<cr>", desc = "Recent" },
{ "<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" },
-- search
{ '<leader>s"', "<cmd>FzfLua registers<cr>", desc = "Registers" },
{ "<leader>sa", "<cmd>FzfLua autocmds<cr>", desc = "Auto Commands" },
{ "<leader>sb", "<cmd>FzfLua grep_curbuf<cr>", desc = "Buffer" },
{ "<leader>sc", "<cmd>FzfLua command_history<cr>", desc = "Command History" },
{ "<leader>sC", "<cmd>FzfLua commands<cr>", desc = "Commands" },
{ "<leader>sd", "<cmd>FzfLua diagnostics_document<cr>", desc = "Document Diagnostics" },
{ "<leader>sD", "<cmd>FzfLua diagnostics_workspace<cr>", desc = "Workspace Diagnostics" },
{ "<leader>sg", LazyVim.pick("live_grep"), desc = "Grep (Root Dir)" },
{ "<leader>sG", LazyVim.pick("live_grep", { root = false }), desc = "Grep (cwd)" },
{ "<leader>sh", "<cmd>FzfLua help_tags<cr>", desc = "Help Pages" },
{ "<leader>sH", "<cmd>FzfLua highlights<cr>", desc = "Search Highlight Groups" },
{ "<leader>sj", "<cmd>FzfLua jumps<cr>", desc = "Jumplist" },
{ "<leader>sk", "<cmd>FzfLua keymaps<cr>", desc = "Key Maps" },
{ "<leader>sl", "<cmd>FzfLua loclist<cr>", desc = "Location List" },
{ "<leader>sM", "<cmd>FzfLua man_pages<cr>", desc = "Man Pages" },
{ "<leader>sm", "<cmd>FzfLua marks<cr>", desc = "Jump to Mark" },
{ "<leader>sR", "<cmd>FzfLua resume<cr>", desc = "Resume" },
{ "<leader>sq", "<cmd>FzfLua quickfix<cr>", desc = "Quickfix List" },
{ "<leader>sw", LazyVim.pick("grep_cword"), desc = "Word (Root Dir)" },
{ "<leader>sW", LazyVim.pick("grep_cword", { root = false }), desc = "Word (cwd)" },
{ "<leader>sw", LazyVim.pick("grep_visual"), mode = "v", desc = "Selection (Root Dir)" },
{ "<leader>sW", LazyVim.pick("grep_visual", { root = false }), mode = "v", desc = "Selection (cwd)" },
{ "<leader>uC", LazyVim.pick("colorschemes"), desc = "Colorscheme with Preview" },
{
"<leader>ss",
function()
require("fzf-lua").lsp_document_symbols({
regex_filter = symbols_filter,
})
end,
desc = "Goto Symbol",
},
{
"<leader>sS",
function()
require("fzf-lua").lsp_live_workspace_symbols({
regex_filter = symbols_filter,
})
end,
desc = "Goto Symbol (Workspace)",
},
},
},
{
"folke/todo-comments.nvim",
optional = true,
-- stylua: ignore
keys = {
{ "<leader>st", function() require("todo-comments.fzf").todo() end, desc = "Todo" },
{ "<leader>sT", function () require("todo-comments.fzf").todo({ keywords = { "TODO", "FIX", "FIXME" } }) end, desc = "Todo/Fix/Fixme" },
},
},
{
"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 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,
},
}

View File

@ -82,22 +82,22 @@ return {
vim.keymap.set(
"n",
opts.mappings.toggle_hidden or "g.",
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 or "gc",
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 or "<C-w>s", "horizontal", false)
map_split(buf_id, opts.mappings.go_in_vertical or "<C-w>v", "vertical", false)
map_split(buf_id, opts.mappings.go_in_horizontal_plus or "<C-w>S", "horizontal", true)
map_split(buf_id, opts.mappings.go_in_vertical_plus or "<C-w>V", "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,
})

View File

@ -29,14 +29,16 @@ return {
"nvim-lualine/lualine.nvim",
optional = true,
opts = function(_, opts)
table.insert(opts.sections.lualine_c, {
function()
return require("nvim-navic").get_location()
end,
cond = function()
return package.loaded["nvim-navic"] and require("nvim-navic").is_available()
end,
})
if not vim.g.trouble_lualine then
table.insert(opts.sections.lualine_c, {
function()
return require("nvim-navic").get_location()
end,
cond = function()
return package.loaded["nvim-navic"] and require("nvim-navic").is_available()
end,
})
end
end,
},
}

View File

@ -7,7 +7,7 @@ return {
"nvim-treesitter/nvim-treesitter",
},
keys = {
{ "<leader>r", "", desc = "+refactor" },
{ "<leader>r", "", desc = "+refactor", mode = { "n", "v" } },
{
"<leader>rs",
function()

View File

@ -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,
},
}

View File

@ -1,23 +1,88 @@
---@diagnostic disable: inject-field
if lazyvim_docs then
-- By default, prettier will only be used for formatting
-- if a prettier configuration file is found in the project.
-- Set to `false` to always use prettier for supported filetypes.
vim.g.lazyvim_prettier_needs_config = true
-- Enable the option to require a Prettier config file
-- If no prettier config file is found, the formatter will not be used
vim.g.lazyvim_prettier_needs_config = false
end
local needs_config = vim.g.lazyvim_prettier_needs_config ~= false
---@alias ConformCtx {buf: number, filename: string, dirname: string}
local M = {}
-- local check = vim.g.lazyvim_prettier
local supported = {
"css",
"graphql",
"handlebars",
"html",
"javascript",
"javascriptreact",
"json",
"jsonc",
"less",
"markdown",
"markdown.mdx",
"scss",
"typescript",
"typescriptreact",
"vue",
"yaml",
}
local enabled = {} ---@type table<string, boolean>
--- Checks if a Prettier config file exists for the given context
---@param ctx ConformCtx
function M.has_config(ctx)
vim.fn.system({ "prettier", "--find-config-path", ctx.filename })
return vim.v.shell_error == 0
end
--- Checks if a parser can be inferred for the given context:
--- * If the filetype is in the supported list, return true
--- * Otherwise, check if a parser can be inferred
---@param ctx ConformCtx
function M.has_parser(ctx)
local ft = vim.bo[ctx.buf].filetype --[[@as string]]
-- default filetypes are always supported
if vim.tbl_contains(supported, ft) then
return true
end
-- otherwise, check if a parser can be inferred
local ret = vim.fn.system({ "prettier", "--file-info", ctx.filename })
---@type boolean, string?
local ok, parser = pcall(function()
return vim.fn.json_decode(ret).inferredParser
end)
return ok and parser and parser ~= vim.NIL
end
M.has_config = LazyVim.memoize(M.has_config)
M.has_parser = LazyVim.memoize(M.has_parser)
return {
{
"williamboman/mason.nvim",
opts = { ensure_installed = { "prettier" } },
},
-- conform
{
"stevearc/conform.nvim",
optional = true,
---@param opts ConformOpts
opts = function(_, opts)
table.insert(opts.ensure_installed, "prettier")
opts.formatters_by_ft = opts.formatters_by_ft or {}
for _, ft in ipairs(supported) do
opts.formatters_by_ft[ft] = { "prettier" }
end
opts.formatters = opts.formatters or {}
opts.formatters.prettier = {
condition = function(_, ctx)
return M.has_parser(ctx) and (vim.g.lazyvim_prettier_needs_config ~= true or M.has_config(ctx))
end,
}
end,
},
-- none-ls support
{
"nvimtools/none-ls.nvim",
optional = true,
@ -27,44 +92,4 @@ return {
table.insert(opts.sources, nls.builtins.formatting.prettier)
end,
},
{
"stevearc/conform.nvim",
optional = true,
opts = {
formatters_by_ft = {
["javascript"] = { "prettier" },
["javascriptreact"] = { "prettier" },
["typescript"] = { "prettier" },
["typescriptreact"] = { "prettier" },
["vue"] = { "prettier" },
["css"] = { "prettier" },
["scss"] = { "prettier" },
["less"] = { "prettier" },
["html"] = { "prettier" },
["json"] = { "prettier" },
["jsonc"] = { "prettier" },
["yaml"] = { "prettier" },
["markdown"] = { "prettier" },
["markdown.mdx"] = { "prettier" },
["graphql"] = { "prettier" },
["handlebars"] = { "prettier" },
["svelte"] = { "prettier" },
},
formatters = {
prettier = {
condition = function(_, ctx)
if not needs_config then
return true
end
if enabled[ctx.filename] == nil then
enabled[ctx.filename] = vim.fs.find(function(name, path)
return name:match("^%.prettierrc%.") or name:match("^prettier%.config%.")
end, { path = ctx.filename, upward = true })[1] ~= nil
end
return enabled[ctx.filename]
end,
},
},
},
},
}

View File

@ -14,7 +14,7 @@ return {
if type(opts.ensure_installed) == "table" then
vim.list_extend(opts.ensure_installed, { "angular", "scss" })
end
vim.api.nvim_create_autocmd("BufRead", {
vim.api.nvim_create_autocmd({ "BufReadPost", "BufNewFile" }, {
pattern = { "*.component.html", "*.container.html" },
callback = function()
vim.treesitter.start(nil, "angular")
@ -36,11 +36,9 @@ return {
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)
--HACK: disable angular renaming capability due to duplicate rename popping up
client.server_capabilities.renameProvider = false
end, "angularls")
end,
},
},

View File

@ -7,11 +7,7 @@ return {
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,
opts = { ensure_installed = { "ansible-lint" } },
},
{
"neovim/nvim-lspconfig",

View File

@ -15,11 +15,7 @@ return {
{
"nvim-treesitter/nvim-treesitter",
opts = function(_, opts)
if type(opts.ensure_installed) == "table" then
vim.list_extend(opts.ensure_installed, { "astro" })
end
end,
opts = { ensure_installed = { "astro" } },
},
-- LSP Servers
@ -45,4 +41,14 @@ return {
})
end,
},
{
"conform.nvim",
opts = function(_, opts)
if LazyVim.has_extra("formatting.prettier") then
opts.formatters_by_ft = opts.formatters_by_ft or {}
opts.formatters_by_ft.astro = { "prettier" }
end
end,
},
}

View File

@ -16,11 +16,7 @@ return {
-- Add C/C++ to treesitter
{
"nvim-treesitter/nvim-treesitter",
opts = function(_, opts)
if type(opts.ensure_installed) == "table" then
vim.list_extend(opts.ensure_installed, { "cpp" })
end
end,
opts = { ensure_installed = { "cpp" } },
},
{
@ -120,11 +116,7 @@ return {
-- Ensure C/C++ debugger is installed
"williamboman/mason.nvim",
optional = true,
opts = function(_, opts)
if type(opts.ensure_installed) == "table" then
vim.list_extend(opts.ensure_installed, { "codelldb" })
end
end,
opts = { ensure_installed = { "codelldb" } },
},
opts = function()
local dap = require("dap")

Some files were not shown because too many files have changed in this diff Show More