Commit graph

140 commits

Author SHA1 Message Date
Folke Lemaitre
9c596681f6
feat(keymaps): show lang when opening treesitter inspect 2025-02-18 23:11:12 +01:00
Zhou Fang
32e575aa75
feat(keymaps): enable toggling in quickfix list and location list (#5608)
## Description

This PR addresses issue #5503 by modifying the behavior of `<leader>xq`
and `<leader>xl` so that they toggle the quickfix and location lists
rather than simply opening them.

To prevent the full Lua error stack from being printed when no list
exists prior to using `copen` or `lopen`, I've wrapped the commands in
`pcall` and used `vim.notify` to alert the user in the same manner as
before.

## Related Issue(s)

#5503

## Screenshots


https://github.com/user-attachments/assets/b22b1861-e6e5-4d8a-967e-f760cca15719

## Checklist

- [x] I've read the
[CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md)
guidelines.
2025-02-15 08:27:01 +01:00
iniw
132986a624
fix(keymaps): remove unneeded and ambiguous <leader>w keymap (#5459)
## Description

The `<leader>w` mapping, described as "Windows", was causing potentially
timeout-related bugs with many other mappings that also started with
`<leader>w`.

The problems caused by this are described in detail in issue #5456 and
in discussion #4157.

@dpetka2001 Suggested removing it as an experiment, which I tried and
found to work.

<!--
  - Fixes #5456
  - Fixes #4157
-->

## Checklist

- [X] I've read the
[CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md)
guidelines.
2025-01-28 12:42:48 +01:00
Folke Lemaitre
13044c298e
feat(extras): added extra for snacks picker (#5368)
## Description

See https://github.com/folke/snacks.nvim/pull/445

NOTE: I'm **not** going to replace `fzf-lua` anytime soon. Learned my
lessons with that one :)

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

## Related Issue(s)

<!--
  If this PR fixes any issues, please link to the issue here.
  - Fixes #<issue_number>
-->

## Screenshots

<!-- Add screenshots of the changes if applicable. -->

## Checklist

- [x] I've read the
[CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md)
guidelines.
2025-01-14 22:54:12 +01:00
Folke Lemaitre
8f113a514c
fix(keymaps): better escape 2024-12-15 18:39:48 +01:00
Folke Lemaitre
ef9102677f
feat(keymaps): unlink luasnip on esc 2024-12-15 11:46:24 +01:00
Folke Lemaitre
15c81fdbb8
feat(keymaps): stop native snippets on escape. Closes #5083 2024-12-15 08:36:21 +01:00
Valentin Degenne
6503e59db3
style(keymaps): stylua (#5006)
🧼💦🫧
2024-12-14 00:05:56 +01:00
Folke Lemaitre
a8332c6d50 feat(snacks): added profiler keymaps 2024-12-12 13:47:29 +01:00
Folke Lemaitre
2acedaa3a8 feat(zen): zoom with leader-wm and leader-uZ. zen with leader-uz 2024-12-12 13:47:29 +01:00
Folke Lemaitre
cded8d4d28 feat(snacks): added leader-uS to toggle scroll 2024-12-12 13:47:29 +01:00
Folke Lemaitre
b3ac642317 feat(snacks): added leader-ug to toggle indent guides 2024-12-12 13:47:29 +01:00
Folke Lemaitre
303980d267 feat(snacks): added leader-ua to toggle global animations 2024-12-12 13:47:29 +01:00
Folke Lemaitre
e6d6a096b3 feat(keymaps): added leader-z to toggle zen mode 2024-12-12 13:47:29 +01:00
Folke Lemaitre
f2e1cac965 feat(keymaps): added leader-Z to toggle zoom 2024-12-12 13:47:29 +01:00
Folke Lemaitre
9b973882b8 feat(keymaps): added leader-uD to toggle dim mode 2024-12-12 13:47:29 +01:00
Folke Lemaitre
e389a5ada9 feat(snacks): use Snacks.zen.zoom() instead of custom **maximize** 2024-12-12 13:47:29 +01:00
Folke Lemaitre
b2f750558a
fix(keymaps): toggle name 2024-12-05 09:52:49 +01:00
Folke Lemaitre
8232651c4a
feat(toggle): added leader-A to toggle tabline. Closes #4951 2024-12-05 09:18:16 +01:00
Sergey Kochetkov
03e203bfbe
feat(snacks): silence copy url keymap (#4939)
## Description

Silences keymap introduced in related PR
## Related PR(s)

https://github.com/LazyVim/LazyVim/pull/4870

## Checklist

- [x] I've read the
[CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md)
guidelines.
2024-12-02 20:22:55 +01:00
Ben Elan
cdf3f1f2bd
feat(snacks): add keymap to copy url from gitbrowse (#4870)
## Description

Adds a `<leader>gY` keymap that copies the URL from `Snacks.gitbrowse()`
to the clipboard.

This is a feature in other git browse plugins like `vim-rhubarb`, so
other people will probably be looking for this when migrating like I
did.

Let me know if you'd prefer a different key combination, thanks!

## Related Issue(s)

N/A

## Screenshots

N/A

## Checklist

- [x] I've read the
[CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md)
guidelines.
2024-11-25 15:00:36 +01:00
Ben Elan
2c37492461
fix(snacks): remove lazygit requirement for git browse/blame keymaps (#4869)
## Description

The Snacks keymaps for `gitbrowse()` and `git.blame_line()` were in a
conditional checking if `lazygit` is installed. But both work without
`lazygit`.

## Related Issue(s)

N/A

## Screenshots

N/A

## Checklist

- [x] I've read the
[CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md)
guidelines.
2024-11-22 12:25:33 +01:00
Iordanis Petkakis
86dc548ff9
fix(keymaps): gitbrowse also in Visual mode (#4818)
## Description
If https://github.com/folke/snacks.nvim/pull/89 gets accepted, then we
should also update the keymap for Visual mode
<!-- Describe the big picture of your changes to communicate to the
maintainers
  why we should accept this pull request. -->

## Related Issue(s)
None
<!--
  If this PR fixes any issues, please link to the issue here.
  - Fixes #<issue_number>
-->

## Screenshots

<!-- Add screenshots of the changes if applicable. -->

## Checklist

- [x] I've read the
[CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md)
guidelines.
2024-11-19 15:27:07 +01:00
Folke Lemaitre
fbf881f80b
feat(ai): better completion/suggestions of AI engines (#4752)
## Description

The whole completion / snippets / AI is very tricky:
- multiple snippet engines
- native snippets on > 0.11 set their own keymaps, but not on 0.10
- multiple completion engines, like `nvim-cmp` and `blink.cmp`
- multiple ai completion engines that have a different API
- user's preference of showing ai suggestions as completion or not
- none of the ai completion engines currently set undo points, which is
bad

Solution:
- [x] added `LazyVim.cmp.actions`, where snippet engines and ai engines
can register their action.
- [x] an action returns `true` if it succeeded, or `false|nil` otherwise
- [x] in a completion engine, we then try running multiple actions and
use the fallback if needed
- [x] so `<tab>` runs `{"snippet_forward", "ai_accept", "fallback"}`
- [x] added `vim.g.ai_cmp`. When `true` we try to integrate the AI
source in the completion engine.
- [x] when `false`, `<tab>` should be used to insert the AI suggestion
- [x] when `false`, the completion engine's ghost text is disabled
- [x] luasnip support for blink (only works with blink `main`)
- [x] create undo points when accepting AI suggestions 

## Test Matrix

| completion   | snippets     | ai          | ai_cmp | tested? |
|--------------|--------------|-------------|--------|---------|
| nvim-cmp     | native       | copilot     | true   |       |
| nvim-cmp     | native       | copilot     | false  |       |
| nvim-cmp     | native       | codeium     | true   |       |
| nvim-cmp     | native       | codeium     | false  |       |
| nvim-cmp     | luasnip      | copilot     | true   |       |
| nvim-cmp     | luasnip      | copilot     | false  |       |
| nvim-cmp     | luasnip      | codeium     | true   |       |
| nvim-cmp     | luasnip      | codeium     | false  |       |
| blink.cmp    | native       | copilot     | true   |       |
| blink.cmp    | native       | copilot     | false  |       |
| blink.cmp    | native       | codeium     | true   |       |
| blink.cmp    | native       | codeium     | false  |       |
| blink.cmp    | luasnip      | copilot     | true   |       |
| blink.cmp    | luasnip      | copilot     | false  |       |
| blink.cmp    | luasnip      | codeium     | true   |       |
| blink.cmp    | luasnip      | codeium     | false  |       |


## Related Issue(s)

- [ ] Closes #4702

## Screenshots

<!-- Add screenshots of the changes if applicable. -->

## Checklist

- [ ] I've read the
[CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md)
guidelines.
2024-11-11 10:50:57 +01:00
Folke Lemaitre
24665fc736
feat(keymaps): leader-bo to close other buffers 2024-11-09 16:13:11 +01:00
Folke Lemaitre
aa53cd47c4
feat(keymaps): only add lazygit keymaps when available. Closes #4643. Closes #4247 2024-11-07 16:21:48 +01:00
Folke Lemaitre
2f4697443c
feat(core)!: move a bunch of LazyVim features to snacks.nvim (#4706)
## Description

LazyVim comes with a bunch of smaller QoL plugin like features, but it's
not easy for non LazyVim users to use them.

That's why I started working on
[snacks.nvim](https://github.com/folke/snacks.nvim), a collection of
small QoL plugins for Neovim.

Snacks also includes a bunch of new improvements to these features.

This PR fully integrates with snacks.

## Todo

- [ ] add proper deprecations where needed
- [ ] create snacks docs
- [ ] document all the new improvements relevant to LazyVim users

## Closes

- [ ] #4492 
- [ ] #4333
- [ ] #4687

## Screenshots

<!-- Add screenshots of the changes if applicable. -->

## Checklist

- [ ] I've read the
[CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md)
guidelines.
2024-11-07 15:54:47 +01:00
Roey Darwish Dror
4ee6be4499
fix(lazygit): file history when cwd is outside the repo (#4666)
## Description

When using `<leader>gf` Lazygit is launched in the current directory
rather than the root directory.
<!-- Describe the big picture of your changes to communicate to the
maintainers
  why we should accept this pull request. -->

## Related Issue(s)

<!--
  If this PR fixes any issues, please link to the issue here.
  - Fixes #<issue_number>
-->

## Screenshots

<!-- Add screenshots of the changes if applicable. -->

## Checklist

- [x] I've read the
[CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md)
guidelines.
2024-11-01 22:47:03 +01:00
Iordanis Petkakis
b4eb4e1f4a
feat(keymaps): allow v:count1 when moving lines (#4618)
## Description
Allow user to use `v:count1` when moving lines
<!-- Describe the big picture of your changes to communicate to the
maintainers
  why we should accept this pull request. -->

## Related Issue(s)
Closes #4615.
<!--
  If this PR fixes any issues, please link to the issue here.
  - Fixes #<issue_number>
-->

## Screenshots

<!-- Add screenshots of the changes if applicable. -->

## Checklist

- [x] I've read the
[CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md)
guidelines.
2024-10-23 11:40:31 +02:00
Folke Lemaitre
391f506295
fix(keymaps): leader-wm 2024-07-24 07:03:45 +02:00
Folke Lemaitre
f0d8b8b293
fix(keymaps): leader-wd 2024-07-23 08:29:08 +02:00
Folke Lemaitre
bab54406dc
feat(keymaps): proxy leader-w to ctrl-w 2024-07-17 12:40:56 +02:00
Folke Lemaitre
78cf0320bf
feat(keymaps): dynamic which-key icons/descriptions for toggles (#4050)
## Description

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

## Related Issue(s)

- [ ] Closes #4025

## Screenshots


![image](https://github.com/user-attachments/assets/8453c23c-d560-490c-9f96-a22ea88f45fd)

## Checklist

- [ ] I've read the
[CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md)
guidelines.
2024-07-15 15:47:44 +02:00
Folke Lemaitre
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
Folke Lemaitre
c4ccd7cbce
feat(git): added leader-gB to browse remotes of the current repo 2024-06-06 10:46:56 +02:00
Kevin Traver
de9e337f0d
feat(keymaps): add keymap to close all tab pages except the current one (#2975)
* feat(keymaps): add keymap to close all tab pages except the current one

* fix: use o

---------

Co-authored-by: Folke Lemaitre <folke.lemaitre@gmail.com>
2024-06-05 16:04:17 +02:00
Folke Lemaitre
662e2ffe0f
fix(keymaps): use root dir for git log 2024-06-05 13:41:59 +02:00
Folke Lemaitre
3ace8277e5
feat(keymaps): new keymap to toggle mazimize of current window leader-m or leader-wm 2024-05-29 22:35:40 +02:00
Folke Lemaitre
47a8736278
feat(keymaps): add comment above/below current line with gco/gcO 2024-05-28 07:39:26 +02:00
George Guimarães
9ccdbf644c
feat(git): Change Commit Log to use Lazygit (#2959)
* feat(git): Change Commit Log to use Lazygit

* fix: use gl

* fix conflicts

---------

Co-authored-by: Folke Lemaitre <folke.lemaitre@gmail.com>
2024-05-27 07:53:49 +02:00
Folke Lemaitre
779de263f1
feat(util): mini.bufremove is no longer needed 2024-05-17 10:10:31 +02:00
Folke Lemaitre
3b74ef793f feat(keymaps): added leader-uI to open InspectTree 2024-05-16 21:25:51 +02:00
André Freitas
36802fea19
fix(keymaps): better up/down keymaps description (#1909) 2024-05-15 16:10:06 +02:00
Michael Butler
095bc13188
style(keymaps): clarify no to use LazyVim.safe_keymap_set #3085
* Update keymaps.lua

add more explanation about what to use

* Update keymaps.lua

* fix typo YOU => YOUR
2024-05-03 09:10:36 +02:00
Folke Lemaitre
9e3af1070f
feat(git): <leader>gb for Git Blame Line 2024-04-11 17:23:46 +02:00
Kevin Traver
eb9f9a8862
fix(keymaps): update all keymap descriptions to be Title Case (#2844) 2024-03-27 08:56:44 +01:00
Folke Lemaitre
7d0dbc6ded
feat(lazygit): lazygit now automatically uses colors from your Neovim colorscheme
Disable by setting `vim.g.lazygit_theme = false` in your `options.lua`
2024-03-26 12:43:07 +01:00
Folke Lemaitre
7a5dbeae75
feat: use LazyVim everywhere instead of require("lazyvim.util") 2024-03-22 09:15:09 +01:00
Folke Lemaitre
d8d380a60e
fix(lazygit): make sure we start lazygit in a valid git root 2024-03-18 11:23:55 +01:00
craempler
42a7e79d5a
fix(git): use compatible function for windows and linux (#2740) 2024-03-15 18:01:33 +01:00