Compare commits
186 Commits
Author | SHA1 | Date | |
---|---|---|---|
91fe7ef568 | |||
46785526a6 | |||
d3500a4a33 | |||
f48d55a653 | |||
9ccdbf644c | |||
dbed614655 | |||
61dc00147b | |||
d23e8572e8 | |||
53911748dd | |||
59204df1cb | |||
3a30070a4c | |||
7aa37064a2 | |||
b3373f3428 | |||
c9ab8224f5 | |||
cdff9de172 | |||
945ee7e283 | |||
07a137199c | |||
0f6ff53ce3 | |||
10ed3082a4 | |||
c6e8c5b450 | |||
692aa08da7 | |||
46cf5347b5 | |||
f9b31372ae | |||
ad6c9bcfab | |||
31f876cc4c | |||
1eea51606e | |||
ae6d8f1a34 | |||
9eec03d890 | |||
79608fbc4f | |||
3ebe30685d | |||
e46dd4e9b2 | |||
ab4e57a4bf | |||
027d6bc2e8 | |||
cb1e1b9c82 | |||
d73397c4aa | |||
2bae438570 | |||
8ba7c64a7d | |||
55b07dee21 | |||
8c94842b4a | |||
d19a004136 | |||
6aae99e76d | |||
8e67bb1240 | |||
50626e3092 | |||
dd417c36cd | |||
94c9f4cf37 | |||
e5ea8abd38 | |||
3db94e44a0 | |||
0006fe7a3c | |||
5726f3966d | |||
130d402759 | |||
ea1c3ad6b4 | |||
ac092289f5 | |||
69751cf417 | |||
32f000754f | |||
20e002f9f0 | |||
97862f4259 | |||
7d72436193 | |||
2961162eba | |||
24a2a9fb0b | |||
39f3ebcadf | |||
57a31c3920 | |||
c264253d8f | |||
76033c6aa9 | |||
e0c67f6776 | |||
a72baa8295 | |||
573aa226f9 | |||
4a41012483 | |||
93c156a0a5 | |||
ad22adab7d | |||
4208a09df8 | |||
e346d17812 | |||
74b7c9110e | |||
22c4eadef5 | |||
b0128b60bf | |||
3a4672de3f | |||
32cdfa5e26 | |||
673975ebbe | |||
96aa4b8877 | |||
649fa9d521 | |||
4614666d1e | |||
d8644c4715 | |||
4105c0ad3a | |||
fe552853f5 | |||
4bc9389bb5 | |||
eb6c9fb578 | |||
a4d83524a7 | |||
9080959981 | |||
30b8169cb2 | |||
d514e2fa93 | |||
c29213416b | |||
03ea7f6f98 | |||
ef3bd3bd02 | |||
16eb3d9473 | |||
434883632c | |||
180d9516fd | |||
c653c4a9a5 | |||
1d23c98da1 | |||
72abb893ac | |||
3a193d3aa8 | |||
08925421e8 | |||
9c212d655a | |||
cf328429b1 | |||
dc66887b57 | |||
9176a6bc22 | |||
87bb766123 | |||
39bec71ce9 | |||
23374f160a | |||
735f5905f8 | |||
19674e8047 | |||
c8b7912eb9 | |||
2e1c945f61 | |||
289c2f81c4 | |||
6aef1989bd | |||
b1ea356e6c | |||
779de263f1 | |||
87493af237 | |||
47c90209f3 | |||
f8de965d3e | |||
cc99b219de | |||
960ec8079b | |||
03653dbe35 | |||
ec673a83ff | |||
07923f3701 | |||
639dfce010 | |||
14872fa816 | |||
76f9dbb40c | |||
58cf6f971b | |||
e7ee289c7f | |||
3b74ef793f | |||
b739eb3503 | |||
960e958548 | |||
2de7f24530 | |||
73126e30c7 | |||
20081460b6 | |||
66dc9c09d6 | |||
4f4911ff95 | |||
e37a699096 | |||
69e6daae2c | |||
03704e2299 | |||
9839f10013 | |||
3c4ebd522e | |||
d999be7401 | |||
f02507b159 | |||
9fe8b15928 | |||
8dae76c1fd | |||
2391ac0420 | |||
183d6eea60 | |||
6e7ba50141 | |||
97d7b2d262 | |||
44d51e5a65 | |||
b601ade71c | |||
f25ac504b8 | |||
c70a78e631 | |||
fc5ee49495 | |||
9337db17c2 | |||
9b7e4b7c03 | |||
36802fea19 | |||
d36e3a5c73 | |||
a8659d02b9 | |||
16e6c86b27 | |||
914ca4a455 | |||
91ead22116 | |||
2c86da7c2d | |||
543dead590 | |||
a97fa3b756 | |||
12a48b8ce1 | |||
6a2545025e | |||
1892ebad78 | |||
9047d041a8 | |||
3c04789ef1 | |||
1df3c5d70b | |||
3585d61c93 | |||
cffed60fe4 | |||
965a469ca8 | |||
b29d169afb | |||
8301096c31 | |||
39901c1f00 | |||
abb1ff0d60 | |||
c54eeb5390 | |||
36b59b2608 | |||
8087283fea | |||
73de8dde2b | |||
f4490252fb | |||
e89653f410 | |||
a0afe8fef9 | |||
42010d1dfb |
301
CHANGELOG.md
301
CHANGELOG.md
File diff suppressed because it is too large
Load Diff
49
NEWS.md
49
NEWS.md
@ -1,5 +1,54 @@
|
||||
# What's new?
|
||||
|
||||
## 11.x
|
||||
|
||||
- `mini.ai` is back as a default plugin! Removing it was a mistake.
|
||||
It's a great plugin that enhances the native text objects.
|
||||
|
||||
- `:LazyExtras` now has multiple new sections:
|
||||
|
||||
- **Enabled**: extras that are currently enabled
|
||||
- **Recommended Languages**: language extras recommended for the current buffer / directory
|
||||
- **Recommended Plugins**: extras that are recommended for most users
|
||||
- **Plugins**: other plugin extras
|
||||
- **Languages**: other language extras
|
||||
|
||||
- new option `vim.g.deprecation_warnings` to disable deprecation warnings
|
||||
Defaults to `false`. To enable deprecation warnings, set it to `true` in your `options.lua`
|
||||
|
||||
- `vim-illuminate` move to extras
|
||||
Document highlights now use native lsp functionality by default
|
||||
|
||||
Since Neovim 0.10 has been released, I've been working on a new version of **LazyVim**
|
||||
that is fully compatible with all the latest Neovim features.
|
||||
|
||||
Additionally, some core plugins have been moved to extras.
|
||||
|
||||
- `native snippets` are now the default on Neovim 0.10
|
||||
Older versions of Neovim will use the new `luasnip` extra.
|
||||
|
||||
- `native comments` are now the default on Neovim 0.10
|
||||
Older versions of Neovim will use the new `mini-comment` extra.
|
||||
`nvim-ts-context-commentstring` has been integrated in the native comments.
|
||||
|
||||
- `inlay hints` have been in **LazyVim** for a while, but are now
|
||||
enabled by default. To disable them:
|
||||
|
||||
```lua
|
||||
{
|
||||
"nvim-lspconfig",
|
||||
opts = {
|
||||
inlay_hints = { enabled = false },
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
- plugins moved to extras:
|
||||
|
||||
- `mini.surround`
|
||||
- `mini.indentscope` scopes are now also highlighted with `indent-blankline`
|
||||
- `nvim-treesitter-context`
|
||||
|
||||
## 10.x
|
||||
|
||||
- added new extra for [mini.diff](https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-diff.md)
|
||||
|
276
README-DE.md
276
README-DE.md
@ -1,138 +1,138 @@
|
||||
<div align="center">
|
||||
<img src="https://user-images.githubusercontent.com/292349/213446185-2db63fd5-8c84-459c-9f04-e286382d6e80.png">
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
|
||||
<h4 align="center">
|
||||
<a href="https://lazyvim.github.io/installation">Install</a>
|
||||
·
|
||||
<a href="https://lazyvim.github.io/configuration">Configure</a>
|
||||
·
|
||||
<a href="https://lazyvim.github.io">Docs</a>
|
||||
</h4>
|
||||
|
||||
<div align="center"><p>
|
||||
<a href="https://github.com/LazyVim/LazyVim/releases/latest">
|
||||
<img alt="Latest release" src="https://img.shields.io/github/v/release/LazyVim/LazyVim?style=for-the-badge&logo=starship&color=C9CBFF&logoColor=D9E0EE&labelColor=302D41&include_prerelease&sort=semver" />
|
||||
</a>
|
||||
<a href="https://github.com/LazyVim/LazyVim/pulse">
|
||||
<img alt="Last commit" src="https://img.shields.io/github/last-commit/LazyVim/LazyVim?style=for-the-badge&logo=starship&color=8bd5ca&logoColor=D9E0EE&labelColor=302D41"/>
|
||||
</a>
|
||||
<a href="https://github.com/LazyVim/LazyVim/blob/main/LICENSE">
|
||||
<img alt="License" src="https://img.shields.io/github/license/LazyVim/LazyVim?style=for-the-badge&logo=starship&color=ee999f&logoColor=D9E0EE&labelColor=302D41" />
|
||||
</a>
|
||||
<a href="https://github.com/LazyVim/LazyVim/stargazers">
|
||||
<img alt="Stars" src="https://img.shields.io/github/stars/LazyVim/LazyVim?style=for-the-badge&logo=starship&color=c69ff5&logoColor=D9E0EE&labelColor=302D41" />
|
||||
</a>
|
||||
<a href="https://github.com/LazyVim/LazyVim/issues">
|
||||
<img alt="Issues" src="https://img.shields.io/github/issues/LazyVim/LazyVim?style=for-the-badge&logo=bilibili&color=F5E0DC&logoColor=D9E0EE&labelColor=302D41" />
|
||||
</a>
|
||||
<a href="https://github.com/LazyVim/LazyVim">
|
||||
<img alt="Repo Size" src="https://img.shields.io/github/repo-size/LazyVim/LazyVim?color=%23DDB6F2&label=SIZE&logo=codesandbox&style=for-the-badge&logoColor=D9E0EE&labelColor=302D41" />
|
||||
</a>
|
||||
<a href="https://twitter.com/intent/follow?screen_name=folke">
|
||||
<img alt="follow on Twitter" src="https://img.shields.io/twitter/follow/folke?style=for-the-badge&logo=twitter&color=8aadf3&logoColor=D9E0EE&labelColor=302D41" />
|
||||
</a>
|
||||
</div>
|
||||
|
||||
LazyVim ist ein Neovim setup aufgebaut auf [💤 lazy.nvim](https://github.com/folke/lazy.nvim).
|
||||
Es erleichter das Anpassen und erweitern von Ihrer Konfiguration.
|
||||
Anstatt von vorne anzufangen oder eine vorgefertigte Distro zu verwenden, gibt LazyVim das beste aus
|
||||
beiden Welten - die Flexibilität Ihre Konfiguration zu verändern und einzustellen wie Sie es wollen
|
||||
und die Einfachheit von einem vorgefertigten Setup.
|
||||
|
||||

|
||||
|
||||

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

|
||||
|
||||

|
||||
|
||||
## ✨ Features
|
||||
|
||||
- 🔥 Transformiere dein Neovim in eine komplette IDE
|
||||
- 💤 Passe deine Konfiguration einfach an und erweitere diese mit [lazy.nvim](https://github.com/folke/lazy.nvim)
|
||||
- 🚀 Extrem schnell
|
||||
- 🧹 Logische Voreinstellungen für optionen, autocmds und keymaps
|
||||
- 📦 Kommt mit einem Haufen vorkonfigurierter, ready-to-use Plugins
|
||||
|
||||
## ⚡️ Vorraussetzungen
|
||||
|
||||
- Neovim >= **0.8.0** (gebraucht um mit **LuaJIT** zu bauen)
|
||||
- Git >= **2.19.0** (um Teil-Klone zu unterstützen)
|
||||
- eine [Nerd Font](https://www.nerdfonts.com/) **_(optional)_**
|
||||
|
||||
## 🚀 Einstieg
|
||||
|
||||
Sie können eine Startvorlage für **LazyVim** [hier](https://github.com/LazyVim/starter) finden
|
||||
|
||||
<details><summary>Versuchen Sie's mit Docker</summary>
|
||||
|
||||
```sh
|
||||
docker run -w /root -it --rm alpine:edge sh -uelic '
|
||||
apk add git lazygit neovim ripgrep alpine-sdk --update
|
||||
git clone https://github.com/LazyVim/starter ~/.config/nvim
|
||||
cd ~/.config/nvim
|
||||
nvim
|
||||
'
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
<details><summary>Installieren von <a href="https://github.com/LazyVim/starter">LazyVim Starter</a></summary>
|
||||
|
||||
- Neovim Files sichern:
|
||||
|
||||
```sh
|
||||
mv ~/.config/nvim ~/.config/nvim.bak
|
||||
mv ~/.local/share/nvim ~/.local/share/nvim.bak
|
||||
```
|
||||
|
||||
- Den Starter Klonen:
|
||||
|
||||
```sh
|
||||
git clone https://github.com/LazyVim/starter ~/.config/nvim
|
||||
```
|
||||
|
||||
- Den `.git` Folder löschen, um die Konfiguration zu einer eigenen distro hinzuzufügen:
|
||||
|
||||
```sh
|
||||
rm -rf ~/.config/nvim/.git
|
||||
```
|
||||
|
||||
- Neovim starten!
|
||||
|
||||
```sh
|
||||
nvim
|
||||
```
|
||||
|
||||
Refer to the comments in the files on how to customize **LazyVim**.
|
||||
|
||||
</details>
|
||||
|
||||
## 📂 Dateistruktur
|
||||
|
||||
Die Dateien unter `config` werden automatisch und zur richtigen Zeit geladen,
|
||||
sodass ein manuelles `require` nicht nötig ist.
|
||||
**LazyVim** bringt Konfigurationsdatein mit, die **_vor_** Ihren eigenen geladen werden -
|
||||
siehe [hier](https://github.com/LazyVim/LazyVim/tree/main/lua/lazyvim/config)
|
||||
Sie können eigene Plugins unter `lua/plugins/` hinzufügen. Alle Dateien innerhalb
|
||||
dieses Ordners werden automatisch mit [lazy.nvim](https://github.com/folke/lazy.nvim)
|
||||
geladen.
|
||||
|
||||
<pre>
|
||||
~/.config/nvim
|
||||
├── lua
|
||||
│ ├── config
|
||||
│ │ ├── autocmds.lua
|
||||
│ │ ├── keymaps.lua
|
||||
│ │ ├── lazy.lua
|
||||
│ │ └── options.lua
|
||||
│ └── plugins
|
||||
│ ├── spec1.lua
|
||||
│ ├── **
|
||||
│ └── spec2.lua
|
||||
└── init.toml
|
||||
</pre>
|
||||
|
||||
## ⚙️ Konfiguration
|
||||
|
||||
Siehe [Dokumentation](https://lazyvim.github.io).
|
||||
|
@ -1,4 +1,4 @@
|
||||
*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 May 12
|
||||
*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 May 27
|
||||
|
||||
==============================================================================
|
||||
Table of Contents *LazyVim-table-of-contents*
|
||||
|
@ -59,7 +59,6 @@ vim.api.nvim_create_autocmd("FileType", {
|
||||
"lspinfo",
|
||||
"notify",
|
||||
"qf",
|
||||
"query",
|
||||
"spectre_panel",
|
||||
"startuptime",
|
||||
"tsplayground",
|
||||
|
@ -132,7 +132,7 @@ local defaults = {
|
||||
}
|
||||
|
||||
M.json = {
|
||||
version = 3,
|
||||
version = 5,
|
||||
data = {
|
||||
version = nil, ---@type string?
|
||||
news = {}, ---@type table<string, string>
|
||||
@ -191,6 +191,13 @@ function M.setup(opts)
|
||||
vim.cmd([[Lazy! load all]])
|
||||
vim.cmd([[checkhealth]])
|
||||
end, { desc = "Load all plugins and run :checkhealth" })
|
||||
|
||||
local health = require("lazy.health")
|
||||
vim.list_extend(health.valid, {
|
||||
"recommended",
|
||||
"desc",
|
||||
"vscode",
|
||||
})
|
||||
end,
|
||||
})
|
||||
|
||||
@ -275,6 +282,10 @@ function M.init()
|
||||
-- after installing missing plugins
|
||||
M.load("options")
|
||||
|
||||
if vim.g.deprecation_warnings == false then
|
||||
vim.deprecate = function() end
|
||||
end
|
||||
|
||||
LazyVim.plugin.setup()
|
||||
M.json.load()
|
||||
end
|
||||
|
@ -5,10 +5,10 @@
|
||||
local map = LazyVim.safe_keymap_set
|
||||
|
||||
-- better up/down
|
||||
map({ "n", "x" }, "j", "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true })
|
||||
map({ "n", "x" }, "<Down>", "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true })
|
||||
map({ "n", "x" }, "k", "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true })
|
||||
map({ "n", "x" }, "<Up>", "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true })
|
||||
map({ "n", "x" }, "j", "v:count == 0 ? 'gj' : 'j'", { desc = "Down", expr = true, silent = true })
|
||||
map({ "n", "x" }, "<Down>", "v:count == 0 ? 'gj' : 'j'", { desc = "Down", expr = true, silent = true })
|
||||
map({ "n", "x" }, "k", "v:count == 0 ? 'gk' : 'k'", { desc = "Up", expr = true, silent = true })
|
||||
map({ "n", "x" }, "<Up>", "v:count == 0 ? 'gk' : 'k'", { desc = "Up", expr = true, silent = true })
|
||||
|
||||
-- Move to window using the <ctrl> hjkl keys
|
||||
map("n", "<C-h>", "<C-w>h", { desc = "Go to Left Window", remap = true })
|
||||
@ -37,6 +37,8 @@ map("n", "[b", "<cmd>bprevious<cr>", { desc = "Prev Buffer" })
|
||||
map("n", "]b", "<cmd>bnext<cr>", { desc = "Next Buffer" })
|
||||
map("n", "<leader>bb", "<cmd>e #<cr>", { desc = "Switch to Other Buffer" })
|
||||
map("n", "<leader>`", "<cmd>e #<cr>", { desc = "Switch to Other Buffer" })
|
||||
map("n", "<leader>bd", LazyVim.ui.bufremove, { desc = "Delete Buffer" })
|
||||
map("n", "<leader>bD", "<cmd>:bd<cr>", { desc = "Delete Buffer and Window" })
|
||||
|
||||
-- Clear search with <esc>
|
||||
map({ "i", "n" }, "<esc>", "<cmd>noh<cr><esc>", { desc = "Escape and Clear hlsearch" })
|
||||
@ -134,11 +136,16 @@ map("n", "<leader>gf", function()
|
||||
LazyVim.lazygit({args = { "-f", vim.trim(git_path) }})
|
||||
end, { desc = "Lazygit Current File History" })
|
||||
|
||||
map("n", "<leader>gl", function()
|
||||
LazyVim.lazygit({ args = { "log" } })
|
||||
end, { desc = "Lazygit Log" })
|
||||
|
||||
-- quit
|
||||
map("n", "<leader>qq", "<cmd>qa<cr>", { desc = "Quit All" })
|
||||
|
||||
-- highlights under cursor
|
||||
map("n", "<leader>ui", vim.show_pos, { desc = "Inspect Pos" })
|
||||
map("n", "<leader>uI", "<cmd>InspectTree<cr>", { desc = "Inspect Tree" })
|
||||
|
||||
-- LazyVim Changelog
|
||||
map("n", "<leader>L", function() LazyVim.news.changelog() end, { desc = "LazyVim Changelog" })
|
||||
|
@ -2,7 +2,7 @@
|
||||
vim.g.mapleader = " "
|
||||
vim.g.maplocalleader = "\\"
|
||||
|
||||
-- Enable LazyVim auto format
|
||||
-- LazyVim auto format
|
||||
vim.g.autoformat = true
|
||||
|
||||
-- LazyVim root dir detection
|
||||
@ -25,21 +25,30 @@ vim.g.lazygit_config = true
|
||||
-- * powershell
|
||||
-- LazyVim.terminal.setup("pwsh")
|
||||
|
||||
-- Hide deprecation warnings
|
||||
vim.g.deprecation_warnings = false
|
||||
|
||||
local opt = vim.opt
|
||||
|
||||
opt.autowrite = true -- Enable auto write
|
||||
|
||||
if not vim.env.SSH_TTY then
|
||||
-- only set clipboard if not in ssh, to make sure the OSC 52
|
||||
-- integration works automatically. Requires Neovim >= 0.10.0
|
||||
opt.clipboard = "unnamedplus" -- Sync with system clipboard
|
||||
end
|
||||
|
||||
-- only set clipboard if not in ssh, to make sure the OSC 52
|
||||
-- integration works automatically. Requires Neovim >= 0.10.0
|
||||
opt.clipboard = vim.env.SSH_TTY and "" or "unnamedplus" -- Sync with system clipboard
|
||||
opt.completeopt = "menu,menuone,noselect"
|
||||
opt.conceallevel = 2 -- Hide * markup for bold and italic, but not markers with substitutions
|
||||
opt.confirm = true -- Confirm to save changes before exiting modified buffer
|
||||
opt.cursorline = true -- Enable highlighting of the current line
|
||||
opt.expandtab = true -- Use spaces instead of tabs
|
||||
opt.fillchars = {
|
||||
foldopen = "",
|
||||
foldclose = "",
|
||||
fold = " ",
|
||||
foldsep = " ",
|
||||
diff = "╱",
|
||||
eob = " ",
|
||||
}
|
||||
opt.foldlevel = 99
|
||||
opt.formatexpr = "v:lua.require'lazyvim.util'.format.formatexpr()"
|
||||
opt.formatoptions = "jcroqlnt" -- tcqj
|
||||
opt.grepformat = "%f:%l:%c:%m"
|
||||
opt.grepprg = "rg --vimgrep"
|
||||
@ -66,11 +75,10 @@ opt.spelllang = { "en" }
|
||||
opt.splitbelow = true -- Put new windows below current
|
||||
opt.splitkeep = "screen"
|
||||
opt.splitright = true -- Put new windows right of current
|
||||
opt.statuscolumn = [[%!v:lua.require'lazyvim.util'.ui.statuscolumn()]]
|
||||
opt.tabstop = 2 -- Number of spaces tabs count for
|
||||
opt.termguicolors = true -- True color support
|
||||
if not vim.g.vscode then
|
||||
opt.timeoutlen = 300 -- Lower than default (1000) to quickly trigger which-key
|
||||
end
|
||||
opt.timeoutlen = vim.g.vscode and 1000 or 300 -- Lower than default (1000) to quickly trigger which-key
|
||||
opt.undofile = true
|
||||
opt.undolevels = 10000
|
||||
opt.updatetime = 200 -- Save swap file and trigger CursorHold
|
||||
@ -78,38 +86,16 @@ opt.virtualedit = "block" -- Allow cursor to move where there is no text in visu
|
||||
opt.wildmode = "longest:full,full" -- Command-line completion mode
|
||||
opt.winminwidth = 5 -- Minimum window width
|
||||
opt.wrap = false -- Disable line wrap
|
||||
opt.fillchars = {
|
||||
foldopen = "",
|
||||
foldclose = "",
|
||||
fold = " ",
|
||||
foldsep = " ",
|
||||
diff = "╱",
|
||||
eob = " ",
|
||||
}
|
||||
|
||||
if vim.fn.has("nvim-0.10") == 1 then
|
||||
opt.smoothscroll = true
|
||||
end
|
||||
|
||||
-- Folding
|
||||
vim.opt.foldlevel = 99
|
||||
|
||||
if vim.fn.has("nvim-0.9.0") == 1 then
|
||||
vim.opt.statuscolumn = [[%!v:lua.require'lazyvim.util'.ui.statuscolumn()]]
|
||||
vim.opt.foldtext = "v:lua.require'lazyvim.util'.ui.foldtext()"
|
||||
end
|
||||
|
||||
-- HACK: causes freezes on <= 0.9, so only enable on >= 0.10 for now
|
||||
if vim.fn.has("nvim-0.10") == 1 then
|
||||
vim.opt.foldmethod = "expr"
|
||||
vim.opt.foldexpr = "v:lua.require'lazyvim.util'.ui.foldexpr()"
|
||||
vim.opt.foldtext = ""
|
||||
vim.opt.fillchars = "fold: "
|
||||
opt.foldexpr = "v:lua.require'lazyvim.util'.ui.foldexpr()"
|
||||
opt.foldmethod = "expr"
|
||||
opt.foldtext = ""
|
||||
else
|
||||
vim.opt.foldmethod = "indent"
|
||||
opt.foldmethod = "indent"
|
||||
opt.foldtext = "v:lua.require'lazyvim.util'.ui.foldtext()"
|
||||
end
|
||||
|
||||
vim.o.formatexpr = "v:lua.require'lazyvim.util'.format.formatexpr()"
|
||||
|
||||
-- Fix markdown indentation settings
|
||||
vim.g.markdown_recommended_style = 0
|
||||
|
@ -10,6 +10,9 @@ function M.check()
|
||||
|
||||
if vim.fn.has("nvim-0.9.0") == 1 then
|
||||
ok("Using Neovim >= 0.9.0")
|
||||
if vim.fn.has("nvim-0.10.0") == 0 then
|
||||
warn("Use Neovim >= 0.10.0 for the best experience")
|
||||
end
|
||||
else
|
||||
error("Neovim >= 0.9.0 is required")
|
||||
end
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,3 +1,6 @@
|
||||
local have_make = vim.fn.executable("make") == 1
|
||||
local have_cmake = vim.fn.executable("cmake") == 1
|
||||
|
||||
return {
|
||||
|
||||
-- file explorer
|
||||
@ -93,6 +96,12 @@ return {
|
||||
expander_expanded = "",
|
||||
expander_highlight = "NeoTreeExpander",
|
||||
},
|
||||
git_status = {
|
||||
symbols = {
|
||||
unstaged = "",
|
||||
staged = "",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
config = function(_, opts)
|
||||
@ -141,12 +150,23 @@ return {
|
||||
dependencies = {
|
||||
{
|
||||
"nvim-telescope/telescope-fzf-native.nvim",
|
||||
build = vim.fn.executable("make") == 1 and "make"
|
||||
build = have_make and "make"
|
||||
or "cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release && cmake --install build --prefix build",
|
||||
enabled = vim.fn.executable("make") == 1 or vim.fn.executable("cmake") == 1,
|
||||
config = function()
|
||||
enabled = have_make or have_cmake,
|
||||
config = function(plugin)
|
||||
LazyVim.on_load("telescope.nvim", function()
|
||||
require("telescope").load_extension("fzf")
|
||||
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,
|
||||
},
|
||||
@ -183,11 +203,14 @@ return {
|
||||
{ "<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)" },
|
||||
@ -377,8 +400,10 @@ return {
|
||||
end
|
||||
|
||||
-- stylua: ignore start
|
||||
map("n", "]h", gs.next_hunk, "Next Hunk")
|
||||
map("n", "[h", gs.prev_hunk, "Prev Hunk")
|
||||
map("n", "]h", function() gs.nav_hunk("next") end, "Next Hunk")
|
||||
map("n", "[h", function() gs.nav_hunk("prev") end, "Prev Hunk")
|
||||
map("n", "]H", function() gs.nav_hunk("last") end, "Last Hunk")
|
||||
map("n", "[H", function() gs.nav_hunk("first") end, "First Hunk")
|
||||
map({ "n", "v" }, "<leader>ghs", ":Gitsigns stage_hunk<CR>", "Stage Hunk")
|
||||
map({ "n", "v" }, "<leader>ghr", ":Gitsigns reset_hunk<CR>", "Reset Hunk")
|
||||
map("n", "<leader>ghS", gs.stage_buffer, "Stage Buffer")
|
||||
@ -393,74 +418,6 @@ return {
|
||||
},
|
||||
},
|
||||
|
||||
-- Automatically highlights other instances of the word under your cursor.
|
||||
-- This works with LSP, Treesitter, and regexp matching to find the other
|
||||
-- instances.
|
||||
{
|
||||
"RRethy/vim-illuminate",
|
||||
event = "LazyFile",
|
||||
opts = {
|
||||
delay = 200,
|
||||
large_file_cutoff = 2000,
|
||||
large_file_overrides = {
|
||||
providers = { "lsp" },
|
||||
},
|
||||
},
|
||||
config = function(_, opts)
|
||||
require("illuminate").configure(opts)
|
||||
|
||||
local function map(key, dir, buffer)
|
||||
vim.keymap.set("n", key, function()
|
||||
require("illuminate")["goto_" .. dir .. "_reference"](false)
|
||||
end, { desc = dir:sub(1, 1):upper() .. dir:sub(2) .. " Reference", buffer = buffer })
|
||||
end
|
||||
|
||||
map("]]", "next")
|
||||
map("[[", "prev")
|
||||
|
||||
-- also set it after loading ftplugins, since a lot overwrite [[ and ]]
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
callback = function()
|
||||
local buffer = vim.api.nvim_get_current_buf()
|
||||
map("]]", "next", buffer)
|
||||
map("[[", "prev", buffer)
|
||||
end,
|
||||
})
|
||||
end,
|
||||
keys = {
|
||||
{ "]]", desc = "Next Reference" },
|
||||
{ "[[", desc = "Prev Reference" },
|
||||
},
|
||||
},
|
||||
|
||||
-- buffer remove
|
||||
{
|
||||
"echasnovski/mini.bufremove",
|
||||
|
||||
keys = {
|
||||
{
|
||||
"<leader>bd",
|
||||
function()
|
||||
local bd = require("mini.bufremove").delete
|
||||
if vim.bo.modified then
|
||||
local choice = vim.fn.confirm(("Save changes to %q?"):format(vim.fn.bufname()), "&Yes\n&No\n&Cancel")
|
||||
if choice == 1 then -- Yes
|
||||
vim.cmd.write()
|
||||
bd(0)
|
||||
elseif choice == 2 then -- No
|
||||
bd(0, true)
|
||||
end
|
||||
else
|
||||
bd(0)
|
||||
end
|
||||
end,
|
||||
desc = "Delete Buffer",
|
||||
},
|
||||
-- stylua: ignore
|
||||
{ "<leader>bD", function() require("mini.bufremove").delete(0, true) end, desc = "Delete Buffer (Force)" },
|
||||
},
|
||||
},
|
||||
|
||||
-- better diagnostics list and others
|
||||
{
|
||||
"folke/trouble.nvim",
|
||||
|
91
lua/lazyvim/plugins/extras/coding/copilot-chat.lua
Normal file
91
lua/lazyvim/plugins/extras/coding/copilot-chat.lua
Normal file
@ -0,0 +1,91 @@
|
||||
return {
|
||||
{
|
||||
"CopilotC-Nvim/CopilotChat.nvim",
|
||||
branch = "canary",
|
||||
cmd = "CopilotChat",
|
||||
opts = {
|
||||
model = "gpt-4",
|
||||
auto_insert_mode = true,
|
||||
window = {
|
||||
width = 0.4,
|
||||
},
|
||||
selection = function(source)
|
||||
local select = require("CopilotChat.select")
|
||||
return select.visual(source) or select.buffer(source)
|
||||
end,
|
||||
},
|
||||
keys = {
|
||||
{
|
||||
"<leader>aa",
|
||||
function()
|
||||
return require("CopilotChat").toggle()
|
||||
end,
|
||||
desc = "Toggle (CopilotChat)",
|
||||
},
|
||||
{
|
||||
"<leader>ax",
|
||||
function()
|
||||
return require("CopilotChat").clear()
|
||||
end,
|
||||
desc = "Clear (CopilotChat)",
|
||||
},
|
||||
{
|
||||
"<leader>aq",
|
||||
function()
|
||||
local input = vim.fn.input("Quick Chat: ")
|
||||
if input ~= "" then
|
||||
require("CopilotChat").ask(input, { selection = require("CopilotChat.select").buffer })
|
||||
end
|
||||
end,
|
||||
desc = "Quick Chat (CopilotChat)",
|
||||
},
|
||||
},
|
||||
init = function()
|
||||
LazyVim.on_load("which-key.nvim", function()
|
||||
vim.schedule(function()
|
||||
require("which-key").register({ a = { name = "+CopilotChat (AI)" } }, { prefix = "<leader>" })
|
||||
end)
|
||||
end)
|
||||
end,
|
||||
config = function(_, opts)
|
||||
vim.api.nvim_create_autocmd("BufEnter", {
|
||||
pattern = "copilot-chat",
|
||||
callback = function()
|
||||
vim.opt_local.relativenumber = false
|
||||
vim.opt_local.number = false
|
||||
end,
|
||||
})
|
||||
require("CopilotChat").setup(opts)
|
||||
end,
|
||||
},
|
||||
|
||||
{
|
||||
"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)",
|
||||
},
|
||||
-- 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)",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
return {
|
||||
|
||||
recommended = true,
|
||||
-- copilot
|
||||
{
|
||||
"zbirenbaum/copilot.lua",
|
||||
|
44
lua/lazyvim/plugins/extras/coding/luasnip.lua
Normal file
44
lua/lazyvim/plugins/extras/coding/luasnip.lua
Normal file
@ -0,0 +1,44 @@
|
||||
return {
|
||||
"L3MON4D3/LuaSnip",
|
||||
build = (not LazyVim.is_win())
|
||||
and "echo 'NOTE: jsregexp is optional, so not a big deal if it fails to build'; make install_jsregexp"
|
||||
or nil,
|
||||
dependencies = {
|
||||
{
|
||||
"rafamadriz/friendly-snippets",
|
||||
config = function()
|
||||
require("luasnip.loaders.from_vscode").lazy_load()
|
||||
end,
|
||||
},
|
||||
{
|
||||
"nvim-cmp",
|
||||
dependencies = {
|
||||
"saadparwaiz1/cmp_luasnip",
|
||||
},
|
||||
opts = function(_, opts)
|
||||
opts.snippet = {
|
||||
expand = function(args)
|
||||
require("luasnip").lsp_expand(args.body)
|
||||
end,
|
||||
}
|
||||
table.insert(opts.sources, { name = "luasnip" })
|
||||
end,
|
||||
},
|
||||
},
|
||||
opts = {
|
||||
history = true,
|
||||
delete_check_events = "TextChanged",
|
||||
},
|
||||
-- stylua: ignore
|
||||
keys = {
|
||||
{
|
||||
"<tab>",
|
||||
function()
|
||||
return require("luasnip").jumpable(1) and "<Plug>luasnip-jump-next" or "<tab>"
|
||||
end,
|
||||
expr = true, silent = true, mode = "i",
|
||||
},
|
||||
{ "<tab>", function() require("luasnip").jump(1) end, mode = "s" },
|
||||
{ "<s-tab>", function() require("luasnip").jump(-1) end, mode = { "i", "s" } },
|
||||
},
|
||||
}
|
20
lua/lazyvim/plugins/extras/coding/mini-comment.lua
Normal file
20
lua/lazyvim/plugins/extras/coding/mini-comment.lua
Normal file
@ -0,0 +1,20 @@
|
||||
return {
|
||||
{
|
||||
"echasnovski/mini.comment",
|
||||
event = "VeryLazy",
|
||||
opts = {
|
||||
options = {
|
||||
custom_commentstring = function()
|
||||
return require("ts_context_commentstring.internal").calculate_commentstring() or vim.bo.commentstring
|
||||
end,
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"JoosepAlviste/nvim-ts-context-commentstring",
|
||||
lazy = true,
|
||||
opts = {
|
||||
enable_autocmd = false,
|
||||
},
|
||||
},
|
||||
}
|
36
lua/lazyvim/plugins/extras/coding/mini-surround.lua
Normal file
36
lua/lazyvim/plugins/extras/coding/mini-surround.lua
Normal file
@ -0,0 +1,36 @@
|
||||
-- Fast and feature-rich surround actions. For text that includes
|
||||
-- surrounding characters like brackets or quotes, this allows you
|
||||
-- to select the text inside, change or modify the surrounding characters,
|
||||
-- and more.
|
||||
return {
|
||||
"echasnovski/mini.surround",
|
||||
recommended = true,
|
||||
keys = function(_, keys)
|
||||
-- Populate the keys based on the user's options
|
||||
local opts = LazyVim.opts("mini.surround")
|
||||
local mappings = {
|
||||
{ opts.mappings.add, desc = "Add Surrounding", mode = { "n", "v" } },
|
||||
{ opts.mappings.delete, desc = "Delete Surrounding" },
|
||||
{ opts.mappings.find, desc = "Find Right Surrounding" },
|
||||
{ opts.mappings.find_left, desc = "Find Left Surrounding" },
|
||||
{ opts.mappings.highlight, desc = "Highlight Surrounding" },
|
||||
{ opts.mappings.replace, desc = "Replace Surrounding" },
|
||||
{ opts.mappings.update_n_lines, desc = "Update `MiniSurround.config.n_lines`" },
|
||||
}
|
||||
mappings = vim.tbl_filter(function(m)
|
||||
return m[1] and #m[1] > 0
|
||||
end, mappings)
|
||||
return vim.list_extend(mappings, keys)
|
||||
end,
|
||||
opts = {
|
||||
mappings = {
|
||||
add = "gsa", -- Add surrounding in Normal and Visual modes
|
||||
delete = "gsd", -- Delete surrounding
|
||||
find = "gsf", -- Find surrounding (to the right)
|
||||
find_left = "gsF", -- Find surrounding (to the left)
|
||||
highlight = "gsh", -- Highlight surrounding
|
||||
replace = "gsr", -- Replace surrounding
|
||||
update_n_lines = "gsn", -- Update `n_lines`
|
||||
},
|
||||
},
|
||||
}
|
@ -1,64 +0,0 @@
|
||||
if not vim.snippet then
|
||||
LazyVim.warn("Native snippets are only supported on Neovim >= 0.10.0")
|
||||
return {}
|
||||
end
|
||||
|
||||
return {
|
||||
desc = "Use native snippets instead of LuaSnip. Only works on Neovim >= 0.10!",
|
||||
{
|
||||
"L3MON4D3/LuaSnip",
|
||||
enabled = false,
|
||||
},
|
||||
{
|
||||
"nvim-cmp",
|
||||
opts = {
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
vim.snippet.expand(args.body)
|
||||
end,
|
||||
},
|
||||
},
|
||||
keys = {
|
||||
{
|
||||
"<Tab>",
|
||||
function()
|
||||
if vim.snippet.active({ direction = 1 }) then
|
||||
vim.schedule(function()
|
||||
vim.snippet.jump(1)
|
||||
end)
|
||||
return
|
||||
end
|
||||
return "<Tab>"
|
||||
end,
|
||||
expr = true,
|
||||
silent = true,
|
||||
mode = "i",
|
||||
},
|
||||
{
|
||||
"<Tab>",
|
||||
function()
|
||||
vim.schedule(function()
|
||||
vim.snippet.jump(1)
|
||||
end)
|
||||
end,
|
||||
silent = true,
|
||||
mode = "s",
|
||||
},
|
||||
{
|
||||
"<S-Tab>",
|
||||
function()
|
||||
if vim.snippet.active({ direction = -1 }) then
|
||||
vim.schedule(function()
|
||||
vim.snippet.jump(-1)
|
||||
end)
|
||||
return
|
||||
end
|
||||
return "<S-Tab>"
|
||||
end,
|
||||
expr = true,
|
||||
silent = true,
|
||||
mode = { "i", "s" },
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
@ -1,32 +1,31 @@
|
||||
-- better yank/paste
|
||||
return {
|
||||
-- better yank/paste
|
||||
{
|
||||
"gbprod/yanky.nvim",
|
||||
dependencies = not LazyVim.is_win() and { "kkharji/sqlite.lua" } or {},
|
||||
opts = {
|
||||
highlight = { timer = 250 },
|
||||
ring = { storage = LazyVim.is_win() and "shada" or "sqlite" },
|
||||
},
|
||||
keys = {
|
||||
"gbprod/yanky.nvim",
|
||||
recommended = true,
|
||||
desc = "Better Yank/Paste",
|
||||
event = "LazyFile",
|
||||
opts = {
|
||||
highlight = { timer = 150 },
|
||||
},
|
||||
keys = {
|
||||
-- stylua: ignore
|
||||
{ "<leader>p", function() require("telescope").extensions.yank_history.yank_history({ }) end, desc = "Open Yank History" },
|
||||
{ "y", "<Plug>(YankyYank)", mode = { "n", "x" }, desc = "Yank Text" },
|
||||
{ "p", "<Plug>(YankyPutAfter)", mode = { "n", "x" }, desc = "Put Yanked Text After Cursor" },
|
||||
{ "P", "<Plug>(YankyPutBefore)", mode = { "n", "x" }, desc = "Put Yanked Text Before Cursor" },
|
||||
{ "gp", "<Plug>(YankyGPutAfter)", mode = { "n", "x" }, desc = "Put Yanked Text After Selection" },
|
||||
{ "gP", "<Plug>(YankyGPutBefore)", mode = { "n", "x" }, desc = "Put Yanked Text Before Selection" },
|
||||
{ "[y", "<Plug>(YankyCycleForward)", desc = "Cycle Forward Through Yank History" },
|
||||
{ "]y", "<Plug>(YankyCycleBackward)", desc = "Cycle Backward Through Yank History" },
|
||||
{ "]p", "<Plug>(YankyPutIndentAfterLinewise)", desc = "Put Indented After Cursor (Linewise)" },
|
||||
{ "[p", "<Plug>(YankyPutIndentBeforeLinewise)", desc = "Put Indented Before Cursor (Linewise)" },
|
||||
{ "]P", "<Plug>(YankyPutIndentAfterLinewise)", desc = "Put Indented After Cursor (Linewise)" },
|
||||
{ "[P", "<Plug>(YankyPutIndentBeforeLinewise)", desc = "Put Indented Before Cursor (Linewise)" },
|
||||
{ ">p", "<Plug>(YankyPutIndentAfterShiftRight)", desc = "Put and Indent Right" },
|
||||
{ "<p", "<Plug>(YankyPutIndentAfterShiftLeft)", desc = "Put and Indent Left" },
|
||||
{ ">P", "<Plug>(YankyPutIndentBeforeShiftRight)", desc = "Put Before and Indent Right" },
|
||||
{ "<P", "<Plug>(YankyPutIndentBeforeShiftLeft)", desc = "Put Before and Indent Left" },
|
||||
{ "=p", "<Plug>(YankyPutAfterFilter)", desc = "Put After Applying a Filter" },
|
||||
{ "=P", "<Plug>(YankyPutBeforeFilter)", desc = "Put Before Applying a Filter" },
|
||||
},
|
||||
{ "y", "<Plug>(YankyYank)", mode = { "n", "x" }, desc = "Yank Text" },
|
||||
{ "p", "<Plug>(YankyPutAfter)", mode = { "n", "x" }, desc = "Put Yanked Text After Cursor" },
|
||||
{ "P", "<Plug>(YankyPutBefore)", mode = { "n", "x" }, desc = "Put Yanked Text Before Cursor" },
|
||||
{ "gp", "<Plug>(YankyGPutAfter)", mode = { "n", "x" }, desc = "Put Yanked Text After Selection" },
|
||||
{ "gP", "<Plug>(YankyGPutBefore)", mode = { "n", "x" }, desc = "Put Yanked Text Before Selection" },
|
||||
{ "[y", "<Plug>(YankyCycleForward)", desc = "Cycle Forward Through Yank History" },
|
||||
{ "]y", "<Plug>(YankyCycleBackward)", desc = "Cycle Backward Through Yank History" },
|
||||
{ "]p", "<Plug>(YankyPutIndentAfterLinewise)", desc = "Put Indented After Cursor (Linewise)" },
|
||||
{ "[p", "<Plug>(YankyPutIndentBeforeLinewise)", desc = "Put Indented Before Cursor (Linewise)" },
|
||||
{ "]P", "<Plug>(YankyPutIndentAfterLinewise)", desc = "Put Indented After Cursor (Linewise)" },
|
||||
{ "[P", "<Plug>(YankyPutIndentBeforeLinewise)", desc = "Put Indented Before Cursor (Linewise)" },
|
||||
{ ">p", "<Plug>(YankyPutIndentAfterShiftRight)", desc = "Put and Indent Right" },
|
||||
{ "<p", "<Plug>(YankyPutIndentAfterShiftLeft)", desc = "Put and Indent Left" },
|
||||
{ ">P", "<Plug>(YankyPutIndentBeforeShiftRight)", desc = "Put Before and Indent Right" },
|
||||
{ "<P", "<Plug>(YankyPutIndentBeforeShiftLeft)", desc = "Put Before and Indent Left" },
|
||||
{ "=p", "<Plug>(YankyPutAfterFilter)", desc = "Put After Applying a Filter" },
|
||||
{ "=P", "<Plug>(YankyPutBeforeFilter)", desc = "Put Before Applying a Filter" },
|
||||
},
|
||||
}
|
||||
|
@ -12,6 +12,8 @@ end
|
||||
|
||||
return {
|
||||
"mfussenegger/nvim-dap",
|
||||
recommended = true,
|
||||
desc = "Debugging support. Requires language specific adapters to be configured. (see lang extras)",
|
||||
|
||||
dependencies = {
|
||||
|
||||
@ -26,8 +28,6 @@ return {
|
||||
},
|
||||
opts = {},
|
||||
config = function(_, opts)
|
||||
-- setup dap config by VsCode launch.json file
|
||||
-- require("dap.ext.vscode").load_launchjs()
|
||||
local dap = require("dap")
|
||||
local dapui = require("dapui")
|
||||
dapui.setup(opts)
|
||||
@ -81,6 +81,11 @@ return {
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
-- VsCode launch.json parser
|
||||
{
|
||||
"folke/neoconf.nvim",
|
||||
},
|
||||
},
|
||||
|
||||
-- stylua: ignore
|
||||
@ -115,5 +120,18 @@ return {
|
||||
{ text = sign[1], texthl = sign[2] or "DiagnosticInfo", linehl = sign[3], numhl = sign[3] }
|
||||
)
|
||||
end
|
||||
|
||||
-- setup dap config by VsCode launch.json file
|
||||
local vscode = require("dap.ext.vscode")
|
||||
local _filetypes = require("mason-nvim-dap.mappings.filetypes")
|
||||
local filetypes = vim.tbl_deep_extend("force", _filetypes, {
|
||||
["node"] = { "javascriptreact", "typescriptreact", "typescript", "javascript" },
|
||||
["pwa-node"] = { "javascriptreact", "typescriptreact", "typescript", "javascript" },
|
||||
})
|
||||
local json = require("plenary.json")
|
||||
vscode.json_decode = function(str)
|
||||
return vim.json.decode(json.json_strip_comments(str))
|
||||
end
|
||||
vscode.load_launchjs(nil, filetypes)
|
||||
end,
|
||||
}
|
||||
|
@ -5,7 +5,9 @@ M.dials_by_ft = {}
|
||||
---@param increment boolean
|
||||
---@param g? boolean
|
||||
function M.dial(increment, g)
|
||||
local is_visual = vim.fn.mode(true):sub(1, 1) == "v"
|
||||
local mode = vim.fn.mode(true)
|
||||
-- Use visual commands for VISUAL 'v', VISUAL LINE 'V' and VISUAL BLOCK '\22'
|
||||
local is_visual = mode == "v" or mode == "V" or mode == "\22"
|
||||
local func = (increment and "inc" or "dec") .. (g and "_g" or "_") .. (is_visual and "visual" or "normal")
|
||||
local group = M.dials_by_ft[vim.bo.filetype] or "default"
|
||||
return require("dial.map")[func](group)
|
||||
@ -13,6 +15,8 @@ end
|
||||
|
||||
return {
|
||||
"monaqa/dial.nvim",
|
||||
recommended = true,
|
||||
desc = "Increment and decrement numbers, dates, and more",
|
||||
-- stylua: ignore
|
||||
keys = {
|
||||
{ "<C-a>", function() return M.dial(true) end, expr = true, desc = "Increment", mode = {"n", "v"} },
|
||||
|
45
lua/lazyvim/plugins/extras/editor/illuminate.lua
Normal file
45
lua/lazyvim/plugins/extras/editor/illuminate.lua
Normal file
@ -0,0 +1,45 @@
|
||||
-- Automatically highlights other instances of the word under your cursor.
|
||||
-- This works with LSP, Treesitter, and regexp matching to find the other
|
||||
-- instances.
|
||||
return {
|
||||
{
|
||||
"RRethy/vim-illuminate",
|
||||
event = "LazyFile",
|
||||
opts = {
|
||||
delay = 200,
|
||||
large_file_cutoff = 2000,
|
||||
large_file_overrides = {
|
||||
providers = { "lsp" },
|
||||
},
|
||||
},
|
||||
config = function(_, opts)
|
||||
require("illuminate").configure(opts)
|
||||
|
||||
local function map(key, dir, buffer)
|
||||
vim.keymap.set("n", key, function()
|
||||
require("illuminate")["goto_" .. dir .. "_reference"](false)
|
||||
end, { desc = dir:sub(1, 1):upper() .. dir:sub(2) .. " Reference", buffer = buffer })
|
||||
end
|
||||
|
||||
map("]]", "next")
|
||||
map("[[", "prev")
|
||||
|
||||
-- also set it after loading ftplugins, since a lot overwrite [[ and ]]
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
callback = function()
|
||||
local buffer = vim.api.nvim_get_current_buf()
|
||||
map("]]", "next", buffer)
|
||||
map("[[", "prev", buffer)
|
||||
end,
|
||||
})
|
||||
end,
|
||||
keys = {
|
||||
{ "]]", desc = "Next Reference" },
|
||||
{ "[[", desc = "Prev Reference" },
|
||||
},
|
||||
},
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
opts = { document_highlight = { enabled = false } },
|
||||
},
|
||||
}
|
@ -38,6 +38,7 @@ return {
|
||||
-- rename surround mappings from gs to gz to prevent conflict with leap
|
||||
{
|
||||
"echasnovski/mini.surround",
|
||||
optional = true,
|
||||
opts = {
|
||||
mappings = {
|
||||
add = "gza", -- Add surrounding in Normal and Visual modes
|
||||
@ -50,6 +51,15 @@ return {
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"folke/which-key.nvim",
|
||||
optional = true,
|
||||
opts = {
|
||||
defaults = {
|
||||
["gz"] = { name = "+surround" },
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
-- makes some plugins dot-repeatable like leap
|
||||
{ "tpope/vim-repeat", event = "VeryLazy" },
|
||||
|
138
lua/lazyvim/plugins/extras/editor/refactoring.lua
Normal file
138
lua/lazyvim/plugins/extras/editor/refactoring.lua
Normal file
@ -0,0 +1,138 @@
|
||||
return {
|
||||
{
|
||||
"ThePrimeagen/refactoring.nvim",
|
||||
event = { "BufReadPre", "BufNewFile" },
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
},
|
||||
keys = {
|
||||
{
|
||||
"<leader>rs",
|
||||
function()
|
||||
require("telescope").extensions.refactoring.refactors()
|
||||
end,
|
||||
mode = "v",
|
||||
desc = "Refactor",
|
||||
},
|
||||
{
|
||||
"<leader>ri",
|
||||
function()
|
||||
require("refactoring").refactor("Inline Variable")
|
||||
end,
|
||||
mode = { "n", "v" },
|
||||
desc = "Inline Variable",
|
||||
},
|
||||
{
|
||||
"<leader>rb",
|
||||
function()
|
||||
require("refactoring").refactor("Extract Block")
|
||||
end,
|
||||
desc = "Extract Block",
|
||||
},
|
||||
{
|
||||
"<leader>rf",
|
||||
function()
|
||||
require("refactoring").refactor("Extract Block To File")
|
||||
end,
|
||||
desc = "Extract Block To File",
|
||||
},
|
||||
{
|
||||
"<leader>rP",
|
||||
function()
|
||||
require("refactoring").debug.printf({ below = false })
|
||||
end,
|
||||
desc = "Debug Print",
|
||||
},
|
||||
{
|
||||
"<leader>rp",
|
||||
function()
|
||||
require("refactoring").debug.print_var({ normal = true })
|
||||
end,
|
||||
desc = "Debug Print Variable",
|
||||
},
|
||||
{
|
||||
"<leader>rc",
|
||||
function()
|
||||
require("refactoring").debug.cleanup({})
|
||||
end,
|
||||
desc = "Debug Cleanup",
|
||||
},
|
||||
{
|
||||
"<leader>rf",
|
||||
function()
|
||||
require("refactoring").refactor("Extract Function")
|
||||
end,
|
||||
mode = "v",
|
||||
desc = "Extract Function",
|
||||
},
|
||||
{
|
||||
"<leader>rF",
|
||||
function()
|
||||
require("refactoring").refactor("Extract Function To File")
|
||||
end,
|
||||
mode = "v",
|
||||
desc = "Extract Function To File",
|
||||
},
|
||||
{
|
||||
"<leader>rx",
|
||||
function()
|
||||
require("refactoring").refactor("Extract Variable")
|
||||
end,
|
||||
mode = "v",
|
||||
desc = "Extract Variable",
|
||||
},
|
||||
{
|
||||
"<leader>rp",
|
||||
function()
|
||||
require("refactoring").debug.print_var()
|
||||
end,
|
||||
mode = "v",
|
||||
desc = "Debug Print Variable",
|
||||
},
|
||||
},
|
||||
opts = {
|
||||
prompt_func_return_type = {
|
||||
go = false,
|
||||
java = false,
|
||||
cpp = false,
|
||||
c = false,
|
||||
h = false,
|
||||
hpp = false,
|
||||
cxx = false,
|
||||
},
|
||||
prompt_func_param_type = {
|
||||
go = false,
|
||||
java = false,
|
||||
cpp = false,
|
||||
c = false,
|
||||
h = false,
|
||||
hpp = false,
|
||||
cxx = false,
|
||||
},
|
||||
printf_statements = {},
|
||||
print_var_statements = {},
|
||||
show_success_message = true, -- shows a message with information about the refactor on success
|
||||
-- i.e. [Refactor] Inlined 3 variable occurrences
|
||||
},
|
||||
config = function(_, opts)
|
||||
require("refactoring").setup(opts)
|
||||
if LazyVim.has("telescope.nvim") then
|
||||
LazyVim.on_load("telescope.nvim", function()
|
||||
require("telescope").load_extension("refactoring")
|
||||
end)
|
||||
end
|
||||
end,
|
||||
},
|
||||
|
||||
-- which key integration
|
||||
{
|
||||
"folke/which-key.nvim",
|
||||
optional = true,
|
||||
opts = {
|
||||
defaults = {
|
||||
["<leader>r"] = { name = "+refactor" },
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
@ -12,9 +12,18 @@ if vim.tbl_contains(Config.json.data.extras, "lazyvim.plugins.extras.editor.trou
|
||||
})
|
||||
end
|
||||
end
|
||||
if vim.fn.has("nvim-0.9.2") == 0 then
|
||||
LazyVim.error({
|
||||
"Trouble v3 requires Neovim >= 0.9.2",
|
||||
"Please update your Neovim version.",
|
||||
})
|
||||
return {}
|
||||
end
|
||||
end
|
||||
|
||||
return {
|
||||
desc = "Trouble rewrite including document symbols and a lualine component",
|
||||
recommended = true,
|
||||
{
|
||||
"folke/trouble.nvim",
|
||||
branch = "dev",
|
||||
|
@ -1,4 +1,10 @@
|
||||
return {
|
||||
recommended = function()
|
||||
return LazyVim.extras.wants({
|
||||
ft = "yaml.ansible",
|
||||
root = { "ansible.cfg", ".ansible-lint" },
|
||||
})
|
||||
end,
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = function(_, opts)
|
||||
@ -25,12 +31,14 @@ return {
|
||||
},
|
||||
{
|
||||
"mfussenegger/nvim-ansible",
|
||||
ft = {},
|
||||
keys = {
|
||||
{
|
||||
"<leader>tr",
|
||||
"<leader>ta",
|
||||
function()
|
||||
require("ansible").run()
|
||||
end,
|
||||
desc = "Ansible Run Playbook/Role",
|
||||
silent = true,
|
||||
},
|
||||
},
|
||||
|
@ -1,4 +1,17 @@
|
||||
return {
|
||||
recommended = function()
|
||||
return LazyVim.extras.wants({
|
||||
ft = { "c", "cpp", "objc", "objcpp", "cuda", "proto" },
|
||||
root = {
|
||||
".clangd",
|
||||
".clang-tidy",
|
||||
".clang-format",
|
||||
"compile_commands.json",
|
||||
"compile_flags.txt",
|
||||
"configure.ac", -- AutoTools
|
||||
},
|
||||
})
|
||||
end,
|
||||
|
||||
-- Add C/C++ to treesitter
|
||||
{
|
||||
@ -144,7 +157,7 @@ return {
|
||||
type = "codelldb",
|
||||
request = "attach",
|
||||
name = "Attach to process",
|
||||
processId = require("dap.utils").pick_process,
|
||||
pid = require("dap.utils").pick_process,
|
||||
cwd = "${workspaceFolder}",
|
||||
},
|
||||
}
|
||||
|
@ -1,4 +1,10 @@
|
||||
return {
|
||||
recommended = function()
|
||||
return LazyVim.extras.wants({
|
||||
ft = "cmake",
|
||||
root = { "CMakePresets.json", "CTestConfig.cmake", "cmake" },
|
||||
})
|
||||
end,
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = function(_, opts)
|
||||
|
@ -1,4 +1,10 @@
|
||||
return {
|
||||
recommended = function()
|
||||
return LazyVim.extras.wants({
|
||||
ft = "dockerfile",
|
||||
root = { "Dockerfile", "docker-compose.yml", "compose.yml", "docker-compose.yaml", "compose.yaml" },
|
||||
})
|
||||
end,
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = function(_, opts)
|
||||
|
@ -1,4 +1,10 @@
|
||||
return {
|
||||
recommended = function()
|
||||
return LazyVim.extras.wants({
|
||||
ft = { "elixir", "eelixir", "heex", "surface" },
|
||||
root = "mix.exs",
|
||||
})
|
||||
end,
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = function(_, opts)
|
||||
|
@ -1,4 +1,10 @@
|
||||
return {
|
||||
recommended = function()
|
||||
return LazyVim.extras.wants({
|
||||
ft = { "go", "gomod", "gowork", "gotmpl" },
|
||||
root = { "go.work", "go.mod" },
|
||||
})
|
||||
end,
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = function(_, opts)
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user