Compare commits
253 Commits
Author | SHA1 | Date | |
---|---|---|---|
8fe3b5eec8 | |||
413566af59 | |||
eead9dff84 | |||
15c81fdbb8 | |||
195a6e6114 | |||
bd6ca6bda7 | |||
c2175397a7 | |||
5de15329fb | |||
dc4345a5ee | |||
380cea97bf | |||
1efb379485 | |||
3866fbcd40 | |||
6503e59db3 | |||
5105f3c029 | |||
b07378dde4 | |||
63eab6d9a5 | |||
08a7f7e3f9 | |||
d30e9e31eb | |||
1517ec9bb4 | |||
4488cb24f7 | |||
d2ba0473f0 | |||
60b77045d5 | |||
009e3587be | |||
9a0d14dcf5 | |||
0fd7140a6d | |||
5a503c556a | |||
f3a919d23d | |||
20eff4fc3f | |||
94f6df048f | |||
29c4dea4e7 | |||
b0808cb31f | |||
a396a2462f | |||
d95e530c02 | |||
29460318f3 | |||
5b1b6b29d7 | |||
aad0edbf74 | |||
21b02f056d | |||
8b8e322b68 | |||
adf8db69ed | |||
c4b0d6d0d1 | |||
98c77f1de4 | |||
94be6fb787 | |||
a9a273d041 | |||
3a67abdf6d | |||
34d2bdcac6 | |||
bdc865b291 | |||
a8332c6d50 | |||
2acedaa3a8 | |||
54bece17b3 | |||
cded8d4d28 | |||
b3ac642317 | |||
ec92fa8558 | |||
ba632c500d | |||
303980d267 | |||
88e77b0e24 | |||
e6d6a096b3 | |||
f2e1cac965 | |||
9b973882b8 | |||
7bc8490d46 | |||
6d774ba8f2 | |||
e389a5ada9 | |||
152f9d113f | |||
2cbfb9b6b7 | |||
d904a1ef47 | |||
1a1a48497c | |||
94fdc421a1 | |||
9b07544e89 | |||
44c712aa31 | |||
ae2340f60a | |||
31af207542 | |||
69e8867a0f | |||
cee60a6d30 | |||
475e3f32b8 | |||
8c79ab601a | |||
87915a1f23 | |||
439340bd8a | |||
9ad1c49b67 | |||
e2c189e066 | |||
1519cd6da7 | |||
4b86cf9900 | |||
99c361f708 | |||
71ea193cf6 | |||
3c605f547c | |||
7ef2dfd3ba | |||
3f4b1ff003 | |||
0d71732902 | |||
2ebba15e12 | |||
d424a02554 | |||
5ddad99bac | |||
b2f750558a | |||
8a3321d827 | |||
ea794ffd94 | |||
8232651c4a | |||
83017ff28a | |||
12e37529e7 | |||
bfe29fb013 | |||
097b9e2f27 | |||
090ca75d3b | |||
efc95dc6aa | |||
f841ecf6bd | |||
4a626a8137 | |||
9ec253b9b6 | |||
d71471151b | |||
03e203bfbe | |||
0a9447c1b1 | |||
fefcda5431 | |||
0d6026a3e8 | |||
4bf3a39223 | |||
7bdc205e7d | |||
c8bd062ef8 | |||
6d42f1084d | |||
e05379babc | |||
be0cb9622d | |||
2fc7697786 | |||
275c78665e | |||
2263b94439 | |||
1847e3fb25 | |||
7bb954fd1d | |||
efcba66a22 | |||
76fbed6de5 | |||
ed10d3cf19 | |||
13dc88a317 | |||
40dba86925 | |||
66459f9361 | |||
c02275919e | |||
9eccb5d2de | |||
d5734087e4 | |||
c9102bc351 | |||
cdf3f1f2bd | |||
85e4118065 | |||
37dbb63c61 | |||
55be9a1648 | |||
30fac4206a | |||
c979225c37 | |||
eb525c680d | |||
91a3c663a7 | |||
a03f796097 | |||
5659786893 | |||
ecfaed3cc1 | |||
2c37492461 | |||
adcbfc72fd | |||
ba8f6b0215 | |||
2108028cde | |||
63150fa4c5 | |||
30f556d17a | |||
4d596cf4b4 | |||
86dc548ff9 | |||
fc2eae5faf | |||
4df9392cb8 | |||
b873f9a7e7 | |||
59615281f8 | |||
f198eef6e5 | |||
9c31004365 | |||
0bb1da6d57 | |||
2786fdb6e2 | |||
a07db1a723 | |||
0352f944c3 | |||
33557ae68b | |||
6dcf5d7159 | |||
5c5ae903c9 | |||
af9553135d | |||
704c29110d | |||
1db2af267e | |||
1c5a330b6b | |||
b8407f4b12 | |||
8235126a32 | |||
767d873f93 | |||
ffce089a9f | |||
7a1414b5e5 | |||
bb289f4345 | |||
bbd5c8a771 | |||
07a046867d | |||
ad3e2b6354 | |||
c0b623c332 | |||
deb9fd85b1 | |||
86b2c23e2a | |||
e50b43544f | |||
3ac62a4364 | |||
1d7b9a1a61 | |||
0819f9396e | |||
5e485d39b4 | |||
a7eca05609 | |||
c1e8e3c80d | |||
b98b048ec6 | |||
5df382765b | |||
ea266e7326 | |||
0137a110c1 | |||
fbf881f80b | |||
c22db72435 | |||
06071dd452 | |||
dcab30f242 | |||
17a1b846f0 | |||
86904d2fb1 | |||
309d189448 | |||
b9dae57961 | |||
24665fc736 | |||
9c9e650530 | |||
f57944f926 | |||
5b66db294f | |||
220148f47f | |||
4876d1137d | |||
94b4219327 | |||
548fddd1d5 | |||
5efb88f44a | |||
da3058a72d | |||
76168166e5 | |||
2fcd4cdc5f | |||
859646f628 | |||
64b0f0b71d | |||
f78bc3b858 | |||
2d2e425d25 | |||
fd361d07a2 | |||
8534af4a79 | |||
2d6687c646 | |||
cf86484797 | |||
c09735594a | |||
15527910c3 | |||
dfde9148ef | |||
776994a207 | |||
ee2ec7e474 | |||
4e1fd66078 | |||
b0ced339a8 | |||
b5b3122843 | |||
67ba58215b | |||
b841a1dfc3 | |||
e6f612f1cc | |||
67b216c973 | |||
d017bb861e | |||
db052ed9c0 | |||
4379fafc7b | |||
1d4157e681 | |||
aa53cd47c4 | |||
1e975be7a5 | |||
c879b397c7 | |||
37cc03948d | |||
4ff36062dd | |||
0bc09d8206 | |||
a86c25286b | |||
81a4f3f690 | |||
2f4697443c | |||
75750be1c0 | |||
73f14943ba | |||
7ebed5349d | |||
fa3739678a | |||
f4d78ac0de | |||
0403e80a8e | |||
29dab35619 | |||
a7b4c4391b | |||
ec616a3cec | |||
28da1eb073 | |||
6e1d0994d9 | |||
db8895b518 | |||
ad52bf91bc |
.github
CHANGELOG.mdNEWS.mdREADME-CN.mdREADME-DE.mdREADME-ES.mdREADME-IT.mdREADME-JP.mdREADME-KO.mdREADME-PT.mdREADME.mddoc
lua/lazyvim
config
health.luaplugins
coding.luacolorscheme.luainit.lua
compat
editor.luaextras
ai
coding
dap
editor
formatting
lang
angular.luaclangd.luaelixir.luagit.luajava.luamarkdown.luanushell.luar.luarego.luaruby.luarust.luascala.luasql.luaterraform.luatex.luatypescript.luazig.lua
linting
test
ui
alpha.luadashboard-nvim.luaedgy.luaindent-blankline.luamini-animate.luamini-indentscope.luamini-starter.luasmear-cursor.luatreesitter-context.lua
util
vscode.lualsp
ui.luautil.luaxtras.luautil
tests/util
2
.github/.release-please-manifest.json
vendored
2
.github/.release-please-manifest.json
vendored
@ -1,3 +1,3 @@
|
||||
{
|
||||
".": "12.43.0"
|
||||
".": "14.3.0"
|
||||
}
|
||||
|
406
CHANGELOG.md
406
CHANGELOG.md
File diff suppressed because it is too large
Load Diff
82
NEWS.md
82
NEWS.md
@ -1,5 +1,83 @@
|
||||
# What's new?
|
||||
|
||||
## 14.x
|
||||
|
||||
Big new release with a lot of changes and improvements!
|
||||
Two new plugins have been added, and a lot of plugins have been replaced.
|
||||
With these changes, default **LazyVim** is now just `34` plugins.
|
||||
|
||||
### Added Plugins
|
||||
|
||||
- [fzf-lua](https://github.com/ibhagwan/fzf-lua) as a replacement for [telescope.nvim](https://github.com/nvim-telescope/telescope.nvim)
|
||||
- to use **telescope.nvim** instead, enable the `editor.telescope` extra
|
||||
- [blink.cmp](https://github.com/saghen/blink.cmp) as a replacement for [nvim-cmp](https://github.com/hrsh7th/nvim-cmp)
|
||||
- to use **nvim-cmp** instead, enable the `coding.nvim-cmp` extra
|
||||
|
||||
### Removed Plugins
|
||||
|
||||
- [dressing.nvim](https://github.com/stevearc/dressing.nvim) (replaced with [fzf-lua](https://github.com/ibhagwan/fzf-lua) and [snacks.input](https://github.com/folke/snacks.nvim))
|
||||
- [telescope-fzf-native.nvim](https://github.com/nvim-telescope/telescope-fzf-native.nvim) (replaced with [fzf-lua](https://github.com/ibhagwan/fzf-lua))
|
||||
- [telescope.nvim](https://github.com/nvim-telescope/telescope.nvim) (replaced with [fzf-lua](https://github.com/ibhagwan/fzf-lua))
|
||||
- [indent-blankline.nvim](https://github.com/lukas-reineke/indent-blankline.nvim) (replaced with [snacks.indent](https://github.com/Folke/snacks.nvim))
|
||||
- to use **indent-blankline.nvim** instead, enable the `indent-blankline` extra
|
||||
- [nvim-cmp](https://github.com/hrsh7th/nvim-cmp) (replaced with [blink](https://github.com/Saghen/blink.cmp))
|
||||
- [nvim-snippets](https://github.com/hrsh7th/vim-vsnip) (replaced with [blink](https://github.com/Saghen/blink.cmp))
|
||||
- [cmp-buffer](https://github.com/hrsh7th/cmp-buffer) (replaced with [blink](https://github.com/Saghen/blink.cmp))
|
||||
- [cmp-nvim-lsp](https://github.com/hrsh7th/cmp-nvim-lsp) (replaced with [blink](https://github.com/Saghen/blink.cmp))
|
||||
- [cmp-path](https://github.com/hrsh7th/cmp-path) (replaced with [blink](https://github.com/Saghen/blink.cmp))
|
||||
|
||||
### Changes
|
||||
|
||||
- added [`snacks.input`](https://github.com/folke/snacks.nvim/blob/main/docs/input.md)
|
||||
- added [`snacks.scroll`](https://github.com/folke/snacks.nvim/blob/main/docs/scroll.md)
|
||||
- added [`snacks.indent`](https://github.com/folke/snacks.nvim/blob/main/docs/indent.md)
|
||||
- added [`snacks.scope`](https://github.com/folke/snacks.nvim/blob/main/docs/scope.md)
|
||||
- added [`snacks.dim`](https://github.com/folke/snacks.nvim/blob/main/docs/dim.md)
|
||||
- added [`snacks.zen`](https://github.com/folke/snacks.nvim/blob/main/docs/zen.md)
|
||||
- changed default [`which-key`](https://github.com/folke/which-key.nvim) preset to `helix`
|
||||
- drop `LazyVim.ui.fg` in favor of [`Snacks.util.color`](https://github.com/folke/snacks.nvim/blob/main/docs/util.md)
|
||||
|
||||
To disable **all animations**, add the following to your `options.lua`:
|
||||
|
||||
```lua
|
||||
vim.g.snacks_animate = false
|
||||
```
|
||||
|
||||
### Keymaps
|
||||
|
||||
- `<leader>uz` to toggle [zen mode](https://github.com/folke/snacks.nvim/blob/main/docs/zen.md)
|
||||
- `<leader>uZ` & `<leader>wm` to toggle [zoom mode](https://github.com/folke/snacks.nvim/blob/main/docs/zen.md)
|
||||
- `<leader>uD` to toggle [dimming](https://github.com/folke/snacks.nvim/blob/main/docs/dim.md)
|
||||
- `<leader>ua` to toggle [animations](https://github.com/folke/snacks.nvim/blob/main/docs/animate.md)
|
||||
- `<leader>uS` to toggle [scroll](https://github.com/folke/snacks.nvim/blob/main/docs/scroll.md)
|
||||
- `<leader>ug` to toggle [indent guides](https://github.com/folke/snacks.nvim/blob/main/docs/indent.md)
|
||||
- [`snacks.profiler`](https://github.com/folke/snacks.nvim/blob/main/docs/profiler.md) keymaps under `<leader>dp`
|
||||
|
||||
---
|
||||
|
||||
## 13.x
|
||||
|
||||
- **LazyVim** now uses `Snacks.dashboard` as the default dashboard.
|
||||
Check the [docs](https://github.com/folke/snacks.nvim/blob/main/docs/dashboard.md),
|
||||
for more information and examples.
|
||||
|
||||
- A new [dashboard-nvim](https://github.com/nvimdev/dashboard-nvim) extra
|
||||
is available for those who prefer the old dashboard.
|
||||
|
||||
- Big new release with a lot of changes and improvements!
|
||||
|
||||
- The biggest change is the move of a bunch of core features to
|
||||
[snacks.nvim](https://github.com/folke/snacks.nvim) and fully
|
||||
integrating it into **LazyVim**.
|
||||
|
||||
- I highly suggest having a look at the **snacks.nvim** documentation
|
||||
to see all the new features and improvements. Most important changes:
|
||||
- `Snacks.notifier` for notifications instead of `nvim-notify`
|
||||
- `Snacks.terminal` is similar to `lazyterm`, but has more features
|
||||
and creates bottom splits by default (similar to the `edgy` integrating)
|
||||
|
||||
---
|
||||
|
||||
## 12.x
|
||||
|
||||
- **Markdown Extra**: [headlines.nvim](https://github.com/lukas-reineke/headlines.nvim) has been removed in favor of [markdown.nvim](https://github.com/MeanderingProgrammer/markdown.nvim)
|
||||
@ -27,6 +105,8 @@
|
||||
- moved `neoconf.nvim` to extras. Project specific LSP settings
|
||||
can be done with a `.lazy.lua` file instead.
|
||||
|
||||
---
|
||||
|
||||
## 11.x
|
||||
|
||||
- **Keymaps:**
|
||||
@ -86,6 +166,8 @@ Additionally, some core plugins have been moved to extras.
|
||||
- `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)
|
||||
|
49
README-CN.md
49
README-CN.md
@ -36,9 +36,9 @@
|
||||
</a>
|
||||
</div>
|
||||
|
||||
LazyVim 是由 [💤 lazy.nvim](https://github.com/folke/lazy.nvim) 驱动的一套 Neovim 配置,可以轻松自定义和扩展您的配置。
|
||||
不必在从头开始或使用预制发行版之间做选择,
|
||||
LazyVim 提供了两全其美的方式 - 根据需要调整配置的灵活性,以及默认预配置的便利性。
|
||||
LazyVim 是一个基于 [💤 lazy.nvim](https://github.com/folke/lazy.nvim) 的 Neovim 配置方案,让定制和扩展变得简单直观。
|
||||
您不必再在“从零配置”和“使用预制发行版”之间做选择,LazyVim
|
||||
提供了一个两全其美的方式——既可以享受默认配置带来的便利,又能根据个人需求来灵活调整各项设置。
|
||||
|
||||

|
||||
|
||||
@ -46,28 +46,28 @@ LazyVim 提供了两全其美的方式 - 根据需要调整配置的灵活性,
|
||||
|
||||
## ✨ 特性
|
||||
|
||||
- 🔥 将你的 Neovim 变成一个成熟的 IDE
|
||||
- 💤 使用 [lazy.nvim](https://github.com/folke/lazy.nvim) 轻松自定义和扩展您的配置
|
||||
- 🔥 将你的 Neovim 打造为一个功能完备的 IDE
|
||||
- 💤 使用 [lazy.nvim](https://github.com/folke/lazy.nvim) 轻松自定义和扩展您的设置
|
||||
- 🚀 快如闪电
|
||||
- 🧹 选项、自动命令和键盘映射的合理预设
|
||||
- 📦 预配置了大量插件,随时可用
|
||||
- 📦 内置大量精心优化的预配置插件,开箱即用
|
||||
|
||||
## ⚡️ 要求
|
||||
## ⚡️ 环境要求
|
||||
|
||||
- Neovim >= **0.9.0** (需要用 **LuaJIT** 构建)
|
||||
- Git >= **2.19.0** (用于部分克隆支持)
|
||||
- 一个 [Nerd Font](https://www.nerdfonts.com/) 字体 **_(可选)_**
|
||||
- 一个用于 `nvim-treesitter` 的 **C** 编译器。看 [这里](https://github.com/nvim-treesitter/nvim-treesitter#requirements)
|
||||
|
||||
## 🚀 入门
|
||||
## 🚀 开始使用
|
||||
|
||||
您可以在 [此处](https://github.com/LazyVim/starter) 找到 **LazyVim** 的入门模板
|
||||
您可以在 [此处](https://github.com/LazyVim/starter) 找到 **LazyVim** 的初始模板
|
||||
|
||||
<details><summary>在 Docker 中尝试</summary>
|
||||
<details><summary>在 Docker 中尝鲜</summary>
|
||||
|
||||
```sh
|
||||
docker run -w /root -it --rm alpine:edge sh -uelic '
|
||||
apk add git lazygit neovim ripgrep alpine-sdk --update
|
||||
apk add git lazygit fzf curl neovim ripgrep alpine-sdk --update
|
||||
git clone https://github.com/LazyVim/starter ~/.config/nvim
|
||||
cd ~/.config/nvim
|
||||
nvim
|
||||
@ -91,7 +91,7 @@ docker run -w /root -it --rm alpine:edge sh -uelic '
|
||||
git clone https://github.com/LazyVim/starter ~/.config/nvim
|
||||
```
|
||||
|
||||
- 删除 `.git` 文件夹,以便稍后将其添加到您自己的存储库
|
||||
- 删除 `.git` 文件夹,以便稍后将其添加到您自己的仓库
|
||||
|
||||
```sh
|
||||
rm -rf ~/.config/nvim/.git
|
||||
@ -109,22 +109,23 @@ docker run -w /root -it --rm alpine:edge sh -uelic '
|
||||
|
||||
---
|
||||
|
||||
[@elijahmanor](https://github.com/elijahmanor) 制作了一段很棒的视频,其中包含入门演练。
|
||||
[@elijahmanor](https://github.com/elijahmanor) 制作了一个很棒的视频,可以带领你快速入门。
|
||||
|
||||
[](https://www.youtube.com/watch?v=N93cTbtLCIM)
|
||||
[](https://www.youtube.com/watch?v=N93cTbtLCIM)
|
||||
|
||||
[@dusty-phillips](https://github.com/dusty-phillips) 正在编写一本名为
|
||||
[LazyVim for Ambitious Developers](https://lazyvim-ambitious-devs.phillips.codes)
|
||||
的书,该书可在线免费获得。
|
||||
[@dusty-phillips](https://github.com/dusty-phillips) 为 LazyVim 编写了一本全面的书籍
|
||||
[《LazyVim for Ambitious Developers》](https://lazyvim-ambitious-devs.phillips.codes)
|
||||
,可在线上免费阅读。
|
||||
|
||||
## 📂 文件结构
|
||||
|
||||
config 下的文件会在适当的时候自动加载,所以你不需要手动引入这些文件。
|
||||
**LazyVim** 带有一组默认配置文件,这些文件将在您的配置**之前**加载。
|
||||
看[这里](https://github.com/LazyVim/LazyVim/tree/main/lua/lazyvim/config)
|
||||
config 下的文件会在适当的时候被自动加载,所以你不需要手动引入这些文件。
|
||||
|
||||
您可以在 `lua/plugins/` 下添加自定义插件配置(specs)。
|
||||
[lazy.nvim](https://github.com/folke/lazy.nvim) 会自动加载这些文件。
|
||||
**LazyVim** 带有一组默认配置文件,这些文件会在您的配置**之前**被加载。
|
||||
请看[这里](https://github.com/LazyVim/LazyVim/tree/main/lua/lazyvim/config)
|
||||
|
||||
您可以在 `lua/plugins/` 下添加自定义插件配置。
|
||||
[lazy.nvim](https://github.com/folke/lazy.nvim) 会自动加载此目录中的全部文件。
|
||||
|
||||
<pre>
|
||||
~/.config/nvim
|
||||
@ -141,6 +142,6 @@ config 下的文件会在适当的时候自动加载,所以你不需要手动
|
||||
└── init.lua
|
||||
</pre>
|
||||
|
||||
## ⚙️ Configuration
|
||||
## ⚙️ 设置
|
||||
|
||||
参考[文档](https://lazyvim.github.io/)
|
||||
请参阅[官方文档](https://lazyvim.github.io/)
|
||||
|
@ -68,7 +68,7 @@ Sie können eine Startvorlage für **LazyVim** [hier](https://github.com/LazyVim
|
||||
|
||||
```sh
|
||||
docker run -w /root -it --rm alpine:edge sh -uelic '
|
||||
apk add git lazygit neovim ripgrep alpine-sdk --update
|
||||
apk add git lazygit fzf curl neovim ripgrep alpine-sdk --update
|
||||
git clone https://github.com/LazyVim/starter ~/.config/nvim
|
||||
cd ~/.config/nvim
|
||||
nvim
|
||||
|
145
README-ES.md
Normal file
145
README-ES.md
Normal file
@ -0,0 +1,145 @@
|
||||
<div align="center">
|
||||
<img src="https://user-images.githubusercontent.com/292349/213446185-2db63fd5-8c84-459c-9f04-e286382d6e80.png">
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
|
||||
<h4 align="center">
|
||||
<a href="https://lazyvim.github.io/installation">Instalar</a>
|
||||
·
|
||||
<a href="https://lazyvim.github.io/configuration">Configurar</a>
|
||||
·
|
||||
<a href="https://lazyvim.github.io">Documentación</a>
|
||||
</h4>
|
||||
|
||||
<div align="center"><p>
|
||||
<a href="https://github.com/LazyVim/LazyVim/releases/latest">
|
||||
<img alt="Última versión" 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="Último 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="Licencia" 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="Estrellas" 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="Problemas" 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="Tamaño del repositorio" 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="seguir en Twitter" src="https://img.shields.io/twitter/follow/folke?style=for-the-badge&logo=twitter&color=8aadf3&logoColor=D9E0EE&labelColor=302D41" />
|
||||
</a>
|
||||
</div>
|
||||
|
||||
LazyVim es una configuración de Neovim impulsada por [💤 lazy.nvim](https://github.com/folke/lazy.nvim) que facilita la personalización y extensión de tu configuración. En lugar de tener que elegir entre comenzar desde cero o usar una distribución predefinida, LazyVim ofrece lo mejor de ambos mundos: la flexibilidad para ajustar tu configuración según sea necesario, junto con la conveniencia de una configuración preconfigurada.
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
## ✨ Características
|
||||
|
||||
- 🔥 Convierte tu Neovim en un IDE completo
|
||||
- 💤 Personaliza y extiende fácilmente tu configuración con [lazy.nvim](https://github.com/folke/lazy.nvim)
|
||||
- 🚀 Extremadamente rápido
|
||||
- 🧹 Ajustes predeterminados sensatos para opciones, autocmds y combinaciones de teclas
|
||||
- 📦 Viene con una gran cantidad de plugins preconfigurados y listos para usar
|
||||
|
||||
## ⚡️ Requisitos
|
||||
|
||||
- Neovim >= **0.9.0** (debe ser compilado con **LuaJIT**)
|
||||
- Git >= **2.19.0** (para soporte de clones parciales)
|
||||
- una [Fuente Nerd](https://www.nerdfonts.com/) **_(opcional)_**
|
||||
- un compilador **C** para `nvim-treesitter`. Consulta [aquí](https://github.com/nvim-treesitter/nvim-treesitter#requirements)
|
||||
|
||||
## 🚀 Empezando
|
||||
|
||||
Puedes encontrar una plantilla de inicio para **LazyVim** [aquí](https://github.com/LazyVim/starter)
|
||||
|
||||
<details><summary>Probarlo con Docker</summary>
|
||||
|
||||
```sh
|
||||
docker run -w /root -it --rm alpine:edge sh -uelic '
|
||||
apk add git lazygit fzf curl neovim ripgrep alpine-sdk --update
|
||||
git clone https://github.com/LazyVim/starter ~/.config/nvim
|
||||
cd ~/.config/nvim
|
||||
nvim
|
||||
'
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
<details><summary>Instalar el <a href="https://github.com/LazyVim/starter">LazyVim Starter</a></summary>
|
||||
|
||||
- Haz una copia de seguridad de tus archivos actuales de Neovim:
|
||||
|
||||
```sh
|
||||
mv ~/.config/nvim ~/.config/nvim.bak
|
||||
mv ~/.local/share/nvim ~/.local/share/nvim.bak
|
||||
```
|
||||
|
||||
- Clona el starter
|
||||
|
||||
```sh
|
||||
git clone https://github.com/LazyVim/starter ~/.config/nvim
|
||||
```
|
||||
|
||||
- Elimina la carpeta `.git`, para que puedas agregarla a tu propio repositorio más tarde
|
||||
|
||||
```sh
|
||||
rm -rf ~/.config/nvim/.git
|
||||
```
|
||||
|
||||
- ¡Inicia Neovim!
|
||||
|
||||
```sh
|
||||
nvim
|
||||
```
|
||||
|
||||
Consulta los comentarios en los archivos sobre cómo personalizar **LazyVim**.
|
||||
|
||||
</details>
|
||||
|
||||
---
|
||||
|
||||
Hay un excelente video creado por [@elijahmanor](https://github.com/elijahmanor) con una guía para empezar.
|
||||
|
||||
[](https://www.youtube.com/watch?v=N93cTbtLCIM)
|
||||
|
||||
[@dusty-phillips](https://github.com/dusty-phillips) escribió un libro completo llamado
|
||||
[LazyVim para Desarrolladores Ambiciosos](https://lazyvim-ambitious-devs.phillips.codes)
|
||||
disponible de forma gratuita en línea.
|
||||
|
||||
## 📂 Estructura de Archivos
|
||||
|
||||
Los archivos dentro de la configuración se cargarán automáticamente en el momento adecuado,
|
||||
por lo que no necesitas requerir esos archivos manualmente.
|
||||
**LazyVim** viene con un conjunto de archivos de configuración predeterminados que se cargarán
|
||||
**_antes_** que los tuyos. Consulta [aquí](https://github.com/LazyVim/LazyVim/tree/main/lua/lazyvim/config)
|
||||
|
||||
Puedes agregar tus especificaciones de plugins personalizadas en `lua/plugins/`. Todos los archivos allí
|
||||
serán cargados automáticamente por [lazy.nvim](https://github.com/folke/lazy.nvim)
|
||||
|
||||
<pre>
|
||||
~/.config/nvim
|
||||
├── lua
|
||||
│ ├── config
|
||||
│ │ ├── autocmds.lua
|
||||
│ │ ├── keymaps.lua
|
||||
│ │ ├── lazy.lua
|
||||
│ │ └── options.lua
|
||||
│ └── plugins
|
||||
│ ├── spec1.lua
|
||||
│ ├── **
|
||||
│ └── spec2.lua
|
||||
└── init.lua
|
||||
</pre>
|
||||
|
||||
## ⚙️ Configuración
|
||||
|
||||
Consulta la [documentación](https://lazyvim.github.io)
|
150
README-IT.md
Normal file
150
README-IT.md
Normal file
@ -0,0 +1,150 @@
|
||||
<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">Installazione</a>
|
||||
·
|
||||
<a href="https://lazyvim.github.io/configuration">Configurazione</a>
|
||||
·
|
||||
<a href="https://lazyvim.github.io">Documentazione</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 è una configurazione di Neovim basata su [💤 lazy.nvim](https://github.com/folke/lazy.nvim)
|
||||
che rende semplice personalizzare ed estendere la tua configurazione.
|
||||
Piuttosto che dover scegliere tra partire da zero o utilizzare una
|
||||
distribuzione preconfigurata, LazyVim offre il meglio di entrambi i mondi:
|
||||
la flessibilità di modificare la tua configurazione come necessario,
|
||||
insieme alla comodità di un setup preconfigurato.
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
## ✨ Caratteristiche
|
||||
|
||||
- 🔥 Trasforma il tuo Neovim in un IDE completo
|
||||
- 💤 Personalizza ed estendi facilmente la tua configurazione con [lazy.nvim](https://github.com/folke/lazy.nvim)
|
||||
- 🚀 Estremamente veloce
|
||||
- 🧹 Impostazioni di default ottimizzate per opzioni, AutoCmd e scorciatoie da tastiera
|
||||
- 📦 Distribuito con una vasta gamma di plugin preconfigurati e pronti all'uso
|
||||
|
||||
## ⚡️ Requisiti
|
||||
|
||||
- Neovim >= **0.9.0** (deve essere compilato con **LuaJIT**)
|
||||
- Git >= **2.19.0** (per supportare cloni parziali)
|
||||
- a [Nerd Font](https://www.nerdfonts.com/) **_(opzionale)_**
|
||||
- un compilatore **C** per `nvim-treesitter`. Leggi [qui](https://github.com/nvim-treesitter/nvim-treesitter#requirements)
|
||||
|
||||
## 🚀 Per iniziare
|
||||
|
||||
Puoi trovare un template per **LazyVim** [qui](https://github.com/LazyVim/starter)
|
||||
|
||||
<details><summary>Provalo con Docker</summary>
|
||||
|
||||
```sh
|
||||
docker run -w /root -it --rm alpine:edge sh -uelic '
|
||||
apk add git lazygit fzf curl neovim ripgrep alpine-sdk --update
|
||||
git clone https://github.com/LazyVim/starter ~/.config/nvim
|
||||
cd ~/.config/nvim
|
||||
nvim
|
||||
'
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
<details><summary>Installa il <a href="https://github.com/LazyVim/starter">LazyVim Starter</a></summary>
|
||||
|
||||
- Fai un backup dei tuoi file di Neovim attuali:
|
||||
|
||||
```sh
|
||||
mv ~/.config/nvim ~/.config/nvim.bak
|
||||
mv ~/.local/share/nvim ~/.local/share/nvim.bak
|
||||
```
|
||||
|
||||
- Clona lo Starter
|
||||
|
||||
```sh
|
||||
git clone https://github.com/LazyVim/starter ~/.config/nvim
|
||||
```
|
||||
|
||||
- Rimuovi la cartella `.git`, così puoi aggiungerla al tuo repo in seguito
|
||||
|
||||
```sh
|
||||
rm -rf ~/.config/nvim/.git
|
||||
```
|
||||
|
||||
- Avvia Neovim!
|
||||
|
||||
```sh
|
||||
nvim
|
||||
```
|
||||
|
||||
Consulta i commenti nei file su come personalizzare **LazyVim**.
|
||||
|
||||
</details>
|
||||
|
||||
---
|
||||
|
||||
Qui un video creato da [@elijahmanor](https://github.com/elijahmanor) con una guida per iniziare.
|
||||
|
||||
[](https://www.youtube.com/watch?v=N93cTbtLCIM)
|
||||
|
||||
[@dusty-phillips](https://github.com/dusty-phillips) ha scritto un libro comprensivo chiamato
|
||||
[LazyVim per Sviluppatori Ambiziosi](https://lazyvim-ambitious-devs.phillips.codes)
|
||||
che è disponibile gratuitamente online.
|
||||
|
||||
## 📂 Struttura dei file
|
||||
|
||||
I file presenti nella configurazione verranno caricati automaticamente al momento
|
||||
più opportuno, quindi non è necessario richiamare manualmente quei file.
|
||||
**LazyVim** ha un set di configurazioni predefinite che verranno caricate
|
||||
prima delle tue. Vedi [qui](https://github.com/LazyVim/LazyVim/tree/main/lua/lazyvim/config)
|
||||
|
||||
Puoi aggiungere i tuoi plugin personalizzati sotto `lua/plugins/`. Tutti
|
||||
i file presenti verranno automaticamente caricati da [lazy.nvim](https://github.com/folke/lazy.nvim)
|
||||
|
||||
<pre>
|
||||
~/.config/nvim
|
||||
├── lua
|
||||
│ ├── config
|
||||
│ │ ├── autocmds.lua
|
||||
│ │ ├── keymaps.lua
|
||||
│ │ ├── lazy.lua
|
||||
│ │ └── options.lua
|
||||
│ └── plugins
|
||||
│ ├── spec1.lua
|
||||
│ ├── **
|
||||
│ └── spec2.lua
|
||||
└── init.lua
|
||||
</pre>
|
||||
|
||||
## ⚙️ Configurazione
|
||||
|
||||
Consulta la [documentazione](https://lazyvim.github.io)
|
@ -67,7 +67,7 @@ LazyVimは、ゼロから始めるか、あらかじめ作成されたディス
|
||||
|
||||
```sh
|
||||
docker run -w /root -it --rm alpine:edge sh -uelic '
|
||||
apk add git lazygit neovim ripgrep alpine-sdk --update
|
||||
apk add git lazygit fzf curl neovim ripgrep alpine-sdk --update
|
||||
git clone https://github.com/LazyVim/starter ~/.config/nvim
|
||||
cd ~/.config/nvim
|
||||
nvim
|
||||
|
@ -65,7 +65,7 @@ LazyVim은 [💤 lazy.nvim](https://github.com/folke/lazy.nvim)를 기반으로
|
||||
|
||||
```sh
|
||||
docker run -w /root -it --rm alpine:edge sh -uelic '
|
||||
apk add git lazygit neovim ripgrep alpine-sdk --update
|
||||
apk add git lazygit fzf curl neovim ripgrep alpine-sdk --update
|
||||
git clone https://github.com/LazyVim/starter ~/.config/nvim
|
||||
cd ~/.config/nvim
|
||||
nvim
|
||||
|
@ -70,7 +70,7 @@ Podes encontrar uma template **LazyVim** starter para começar, [aqui](https://g
|
||||
|
||||
```sh
|
||||
docker run -w /root -it --rm alpine:edge sh -uelic '
|
||||
apk add git lazygit neovim ripgrep alpine-sdk --update
|
||||
apk add git lazygit fzf curl neovim ripgrep alpine-sdk --update
|
||||
git clone https://github.com/LazyVim/starter ~/.config/nvim
|
||||
cd ~/.config/nvim
|
||||
nvim
|
||||
|
@ -69,7 +69,7 @@ You can find a starter template for **LazyVim** [here](https://github.com/LazyVi
|
||||
|
||||
```sh
|
||||
docker run -w /root -it --rm alpine:edge sh -uelic '
|
||||
apk add git lazygit neovim ripgrep alpine-sdk --update
|
||||
apk add git lazygit fzf curl neovim ripgrep alpine-sdk --update
|
||||
git clone https://github.com/LazyVim/starter ~/.config/nvim
|
||||
cd ~/.config/nvim
|
||||
nvim
|
||||
@ -115,7 +115,7 @@ There's a great video created by [@elijahmanor](https://github.com/elijahmanor)
|
||||
|
||||
[](https://www.youtube.com/watch?v=N93cTbtLCIM)
|
||||
|
||||
[@dusty-phillips](https://github.com/dusty-phillips) is working on a book called
|
||||
[@dusty-phillips](https://github.com/dusty-phillips) wrote a comprehensive book called
|
||||
[LazyVim for Ambitious Developers](https://lazyvim-ambitious-devs.phillips.codes)
|
||||
available for free online.
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
*LazyVim.txt* For Neovim Last change: 2024 November 02
|
||||
*LazyVim.txt* For Neovim Last change: 2024 December 15
|
||||
|
||||
==============================================================================
|
||||
Table of Contents *LazyVim-table-of-contents*
|
||||
@ -68,7 +68,7 @@ Try it with Docker ~
|
||||
|
||||
>sh
|
||||
docker run -w /root -it --rm alpine:edge sh -uelic '
|
||||
apk add git lazygit neovim ripgrep alpine-sdk --update
|
||||
apk add git lazygit fzf curl neovim ripgrep alpine-sdk --update
|
||||
git clone https://github.com/LazyVim/starter ~/.config/nvim
|
||||
cd ~/.config/nvim
|
||||
nvim
|
||||
@ -102,8 +102,8 @@ There’s 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
|
||||
@dusty-phillips <https://github.com/dusty-phillips> wrote a comprehensive book
|
||||
called LazyVim for Ambitious Developers
|
||||
<https://lazyvim-ambitious-devs.phillips.codes> available for free online.
|
||||
|
||||
|
||||
|
@ -18,7 +18,7 @@ vim.api.nvim_create_autocmd({ "FocusGained", "TermClose", "TermLeave" }, {
|
||||
vim.api.nvim_create_autocmd("TextYankPost", {
|
||||
group = augroup("highlight_yank"),
|
||||
callback = function()
|
||||
vim.highlight.on_yank()
|
||||
(vim.hl or vim.highlight).on_yank()
|
||||
end,
|
||||
})
|
||||
|
||||
@ -55,20 +55,20 @@ vim.api.nvim_create_autocmd("FileType", {
|
||||
group = augroup("close_with_q"),
|
||||
pattern = {
|
||||
"PlenaryTestPopup",
|
||||
"checkhealth",
|
||||
"dbout",
|
||||
"gitsigns-blame",
|
||||
"grug-far",
|
||||
"help",
|
||||
"lspinfo",
|
||||
"neotest-output",
|
||||
"neotest-output-panel",
|
||||
"neotest-summary",
|
||||
"notify",
|
||||
"qf",
|
||||
"spectre_panel",
|
||||
"startuptime",
|
||||
"tsplayground",
|
||||
"neotest-output",
|
||||
"checkhealth",
|
||||
"neotest-summary",
|
||||
"neotest-output-panel",
|
||||
"dbout",
|
||||
"gitsigns-blame",
|
||||
},
|
||||
callback = function(event)
|
||||
vim.bo[event.buf].buflisted = false
|
||||
@ -124,29 +124,3 @@ vim.api.nvim_create_autocmd({ "BufWritePre" }, {
|
||||
vim.fn.mkdir(vim.fn.fnamemodify(file, ":p:h"), "p")
|
||||
end,
|
||||
})
|
||||
|
||||
vim.filetype.add({
|
||||
pattern = {
|
||||
[".*"] = {
|
||||
function(path, buf)
|
||||
return vim.bo[buf]
|
||||
and vim.bo[buf].filetype ~= "bigfile"
|
||||
and path
|
||||
and vim.fn.getfsize(path) > vim.g.bigfile_size
|
||||
and "bigfile"
|
||||
or nil
|
||||
end,
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd({ "FileType" }, {
|
||||
group = augroup("bigfile"),
|
||||
pattern = "bigfile",
|
||||
callback = function(ev)
|
||||
vim.b.minianimate_disable = true
|
||||
vim.schedule(function()
|
||||
vim.bo[ev.buf].syntax = vim.filetype.match({ buf = ev.buf }) or ""
|
||||
end)
|
||||
end,
|
||||
})
|
||||
|
@ -3,7 +3,7 @@ _G.LazyVim = require("lazyvim.util")
|
||||
---@class LazyVimConfig: LazyVimOptions
|
||||
local M = {}
|
||||
|
||||
M.version = "12.43.0" -- x-release-please-version
|
||||
M.version = "14.3.0" -- x-release-please-version
|
||||
LazyVim.config = M
|
||||
|
||||
---@class LazyVimOptions
|
||||
@ -85,9 +85,10 @@ local defaults = {
|
||||
Package = " ",
|
||||
Property = " ",
|
||||
Reference = " ",
|
||||
Snippet = " ",
|
||||
Snippet = " ",
|
||||
String = " ",
|
||||
Struct = " ",
|
||||
Supermaven = " ",
|
||||
TabNine = " ",
|
||||
Text = " ",
|
||||
TypeParameter = " ",
|
||||
@ -135,7 +136,7 @@ local defaults = {
|
||||
}
|
||||
|
||||
M.json = {
|
||||
version = 6,
|
||||
version = 7,
|
||||
path = vim.g.lazyvim_json or vim.fn.stdpath("config") .. "/lazyvim.json",
|
||||
data = {
|
||||
version = nil, ---@type string?
|
||||
|
@ -4,6 +4,14 @@
|
||||
-- use `vim.keymap.set` instead
|
||||
local map = LazyVim.safe_keymap_set
|
||||
|
||||
-- Clear search and stop snippet on escape
|
||||
Snacks.util.on_key("<esc>", function()
|
||||
vim.cmd("noh")
|
||||
if vim.snippet then
|
||||
vim.snippet.stop()
|
||||
end
|
||||
end)
|
||||
|
||||
-- better up/down
|
||||
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 })
|
||||
@ -37,12 +45,14 @@ 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", function()
|
||||
Snacks.bufdelete()
|
||||
end, { desc = "Delete Buffer" })
|
||||
map("n", "<leader>bo", function()
|
||||
Snacks.bufdelete.other()
|
||||
end, { desc = "Delete Other Buffers" })
|
||||
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" })
|
||||
|
||||
-- Clear search, diff update and redraw
|
||||
-- taken from runtime/lua/_editor.lua
|
||||
map(
|
||||
@ -115,37 +125,42 @@ map("n", "[w", diagnostic_goto(false, "WARN"), { desc = "Prev Warning" })
|
||||
-- stylua: ignore start
|
||||
|
||||
-- toggle options
|
||||
LazyVim.toggle.map("<leader>uf", LazyVim.toggle.format())
|
||||
LazyVim.toggle.map("<leader>uF", LazyVim.toggle.format(true))
|
||||
LazyVim.toggle.map("<leader>us", LazyVim.toggle("spell", { name = "Spelling" }))
|
||||
LazyVim.toggle.map("<leader>uw", LazyVim.toggle("wrap", { name = "Wrap" }))
|
||||
LazyVim.toggle.map("<leader>uL", LazyVim.toggle("relativenumber", { name = "Relative Number" }))
|
||||
LazyVim.toggle.map("<leader>ud", LazyVim.toggle.diagnostics)
|
||||
LazyVim.toggle.map("<leader>ul", LazyVim.toggle.number)
|
||||
LazyVim.toggle.map( "<leader>uc", LazyVim.toggle("conceallevel", { values = { 0, vim.o.conceallevel > 0 and vim.o.conceallevel or 2 } }))
|
||||
LazyVim.toggle.map("<leader>uT", LazyVim.toggle.treesitter)
|
||||
LazyVim.toggle.map("<leader>ub", LazyVim.toggle("background", { values = { "light", "dark" }, name = "Background" }))
|
||||
LazyVim.format.snacks_toggle():map("<leader>uf")
|
||||
LazyVim.format.snacks_toggle(true):map("<leader>uF")
|
||||
Snacks.toggle.option("spell", { name = "Spelling" }):map("<leader>us")
|
||||
Snacks.toggle.option("wrap", { name = "Wrap" }):map("<leader>uw")
|
||||
Snacks.toggle.option("relativenumber", { name = "Relative Number" }):map("<leader>uL")
|
||||
Snacks.toggle.diagnostics():map("<leader>ud")
|
||||
Snacks.toggle.line_number():map("<leader>ul")
|
||||
Snacks.toggle.option("conceallevel", { off = 0, on = vim.o.conceallevel > 0 and vim.o.conceallevel or 2, name = "Conceal Level" }):map("<leader>uc")
|
||||
Snacks.toggle.option("showtabline", { off = 0, on = vim.o.showtabline > 0 and vim.o.showtabline or 2, name = "Tabline" }):map("<leader>uA")
|
||||
Snacks.toggle.treesitter():map("<leader>uT")
|
||||
Snacks.toggle.option("background", { off = "light", on = "dark" , name = "Dark Background" }):map("<leader>ub")
|
||||
Snacks.toggle.dim():map("<leader>uD")
|
||||
Snacks.toggle.animate():map("<leader>ua")
|
||||
Snacks.toggle.indent():map("<leader>ug")
|
||||
Snacks.toggle.scroll():map("<leader>uS")
|
||||
Snacks.toggle.profiler():map("<leader>dpp")
|
||||
Snacks.toggle.profiler_highlights():map("<leader>dph")
|
||||
|
||||
if vim.lsp.inlay_hint then
|
||||
LazyVim.toggle.map("<leader>uh", LazyVim.toggle.inlay_hints)
|
||||
Snacks.toggle.inlay_hints():map("<leader>uh")
|
||||
end
|
||||
|
||||
-- lazygit
|
||||
map("n", "<leader>gg", function() LazyVim.lazygit( { cwd = LazyVim.root.git() }) end, { desc = "Lazygit (Root Dir)" })
|
||||
map("n", "<leader>gG", function() LazyVim.lazygit() end, { desc = "Lazygit (cwd)" })
|
||||
map("n", "<leader>gb", LazyVim.lazygit.blame_line, { desc = "Git Blame Line" })
|
||||
map("n", "<leader>gB", LazyVim.lazygit.browse, { desc = "Git Browse" })
|
||||
if vim.fn.executable("lazygit") == 1 then
|
||||
map("n", "<leader>gg", function() Snacks.lazygit( { cwd = LazyVim.root.git() }) end, { desc = "Lazygit (Root Dir)" })
|
||||
map("n", "<leader>gG", function() Snacks.lazygit() end, { desc = "Lazygit (cwd)" })
|
||||
map("n", "<leader>gf", function() Snacks.lazygit.log_file() end, { desc = "Lazygit Current File History" })
|
||||
map("n", "<leader>gl", function() Snacks.lazygit.log({ cwd = LazyVim.root.git() }) end, { desc = "Lazygit Log" })
|
||||
map("n", "<leader>gL", function() Snacks.lazygit.log() end, { desc = "Lazygit Log (cwd)" })
|
||||
end
|
||||
|
||||
map("n", "<leader>gf", function()
|
||||
local git_path = vim.api.nvim_buf_get_name(0)
|
||||
LazyVim.lazygit({args = { "-f", vim.trim(git_path) }, cwd = LazyVim.root.git()})
|
||||
end, { desc = "Lazygit Current File History" })
|
||||
|
||||
map("n", "<leader>gl", function()
|
||||
LazyVim.lazygit({ args = { "log" }, cwd = LazyVim.root.git() })
|
||||
end, { desc = "Lazygit Log" })
|
||||
map("n", "<leader>gL", function()
|
||||
LazyVim.lazygit({ args = { "log" } })
|
||||
end, { desc = "Lazygit Log (cwd)" })
|
||||
map("n", "<leader>gb", function() Snacks.git.blame_line() end, { desc = "Git Blame Line" })
|
||||
map({ "n", "x" }, "<leader>gB", function() Snacks.gitbrowse() end, { desc = "Git Browse (open)" })
|
||||
map({"n", "x" }, "<leader>gY", function()
|
||||
Snacks.gitbrowse({ open = function(url) vim.fn.setreg("+", url) end, notify = false })
|
||||
end, { desc = "Git Browse (copy)" })
|
||||
|
||||
-- quit
|
||||
map("n", "<leader>qq", "<cmd>qa<cr>", { desc = "Quit All" })
|
||||
@ -158,18 +173,12 @@ map("n", "<leader>uI", "<cmd>InspectTree<cr>", { desc = "Inspect Tree" })
|
||||
map("n", "<leader>L", function() LazyVim.news.changelog() end, { desc = "LazyVim Changelog" })
|
||||
|
||||
-- floating terminal
|
||||
local lazyterm = function() LazyVim.terminal(nil, { cwd = LazyVim.root() }) end
|
||||
map("n", "<leader>ft", lazyterm, { desc = "Terminal (Root Dir)" })
|
||||
map("n", "<leader>fT", function() LazyVim.terminal() end, { desc = "Terminal (cwd)" })
|
||||
map("n", "<c-/>", lazyterm, { desc = "Terminal (Root Dir)" })
|
||||
map("n", "<c-_>", lazyterm, { desc = "which_key_ignore" })
|
||||
map("n", "<leader>fT", function() Snacks.terminal() end, { desc = "Terminal (cwd)" })
|
||||
map("n", "<leader>ft", function() Snacks.terminal(nil, { cwd = LazyVim.root() }) end, { desc = "Terminal (Root Dir)" })
|
||||
map("n", "<c-/>", function() Snacks.terminal(nil, { cwd = LazyVim.root() }) end, { desc = "Terminal (Root Dir)" })
|
||||
map("n", "<c-_>", function() Snacks.terminal(nil, { cwd = LazyVim.root() }) end, { desc = "which_key_ignore" })
|
||||
|
||||
-- Terminal Mappings
|
||||
map("t", "<esc><esc>", "<c-\\><c-n>", { desc = "Enter Normal Mode" })
|
||||
map("t", "<C-h>", "<cmd>wincmd h<cr>", { desc = "Go to Left Window" })
|
||||
map("t", "<C-j>", "<cmd>wincmd j<cr>", { desc = "Go to Lower Window" })
|
||||
map("t", "<C-k>", "<cmd>wincmd k<cr>", { desc = "Go to Upper Window" })
|
||||
map("t", "<C-l>", "<cmd>wincmd l<cr>", { desc = "Go to Right Window" })
|
||||
map("t", "<C-/>", "<cmd>close<cr>", { desc = "Hide Terminal" })
|
||||
map("t", "<c-_>", "<cmd>close<cr>", { desc = "which_key_ignore" })
|
||||
|
||||
@ -178,7 +187,8 @@ map("n", "<leader>w", "<c-w>", { desc = "Windows", 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>wd", "<C-W>c", { desc = "Delete Window", remap = true })
|
||||
LazyVim.toggle.map("<leader>wm", LazyVim.toggle.maximize)
|
||||
Snacks.toggle.zoom():map("<leader>wm"):map("<leader>uZ")
|
||||
Snacks.toggle.zen():map("<leader>uz")
|
||||
|
||||
-- tabs
|
||||
map("n", "<leader><tab>l", "<cmd>tablast<cr>", { desc = "Last Tab" })
|
||||
@ -188,3 +198,13 @@ map("n", "<leader><tab><tab>", "<cmd>tabnew<cr>", { desc = "New Tab" })
|
||||
map("n", "<leader><tab>]", "<cmd>tabnext<cr>", { desc = "Next Tab" })
|
||||
map("n", "<leader><tab>d", "<cmd>tabclose<cr>", { desc = "Close Tab" })
|
||||
map("n", "<leader><tab>[", "<cmd>tabprevious<cr>", { desc = "Previous Tab" })
|
||||
|
||||
-- native snippets. only needed on < 0.11, as 0.11 creates these by default
|
||||
if vim.fn.has("nvim-0.11") == 0 then
|
||||
map("s", "<Tab>", function()
|
||||
return vim.snippet.active({ direction = 1 }) and "<cmd>lua vim.snippet.jump(1)<cr>" or "<Tab>"
|
||||
end, { expr = true, desc = "Jump Next" })
|
||||
map({ "i", "s" }, "<S-Tab>", function()
|
||||
return vim.snippet.active({ direction = -1 }) and "<cmd>lua vim.snippet.jump(-1)<cr>" or "<S-Tab>"
|
||||
end, { expr = true, desc = "Jump Previous" })
|
||||
end
|
||||
|
@ -5,12 +5,26 @@ vim.g.maplocalleader = "\\"
|
||||
-- LazyVim auto format
|
||||
vim.g.autoformat = true
|
||||
|
||||
-- Snacks animations
|
||||
-- Set to `false` to globally disable all snacks animations
|
||||
vim.g.snacks_animate = true
|
||||
|
||||
-- LazyVim picker to use.
|
||||
-- Can be one of: telescope, fzf
|
||||
-- Leave it to "auto" to automatically use the picker
|
||||
-- enabled with `:LazyExtras`
|
||||
vim.g.lazyvim_picker = "auto"
|
||||
|
||||
-- LazyVim completion engine to use.
|
||||
-- Can be one of: nvim-cmp, blink.cmp
|
||||
-- Leave it to "auto" to automatically use the completion engine
|
||||
-- enabled with `:LazyExtras`
|
||||
vim.g.lazyvim_cmp = "auto"
|
||||
|
||||
-- if the completion engine supports the AI source,
|
||||
-- use that instead of inline suggestions
|
||||
vim.g.ai_cmp = true
|
||||
|
||||
-- LazyVim root dir detection
|
||||
-- Each entry can be:
|
||||
-- * the name of a detector function like `lsp` or `cwd`
|
||||
@ -18,22 +32,6 @@ vim.g.lazyvim_picker = "auto"
|
||||
-- * a function with signature `function(buf) -> string|string[]`
|
||||
vim.g.root_spec = { "lsp", { ".git", "lua" }, "cwd" }
|
||||
|
||||
-- LazyVim automatically configures lazygit:
|
||||
-- * theme, based on the active colorscheme.
|
||||
-- * editPreset to nvim-remote
|
||||
-- * enables nerd font icons
|
||||
-- Set to false to disable.
|
||||
-- Set the options you want to override in `~/.config/lazygit/custom.yml`
|
||||
-- WARN: on Windows you might want to set `editPreset: "nvim"` due to
|
||||
-- this issue https://github.com/jesseduffield/lazygit/issues/3467
|
||||
vim.g.lazygit_config = true
|
||||
|
||||
-- Options for the LazyVim statuscolumn
|
||||
vim.g.lazyvim_statuscolumn = {
|
||||
folds_open = false, -- show fold sign when fold is open
|
||||
folds_githl = false, -- highlight fold sign with git sign color
|
||||
}
|
||||
|
||||
-- Optionally setup the terminal to use
|
||||
-- This sets `vim.o.shell` and does some additional configuration for:
|
||||
-- * pwsh
|
||||
@ -47,12 +45,6 @@ vim.g.root_lsp_ignore = { "copilot" }
|
||||
-- Hide deprecation warnings
|
||||
vim.g.deprecation_warnings = false
|
||||
|
||||
-- Set filetype to `bigfile` for files larger than 1.5 MB
|
||||
-- Only vim syntax will be enabled (with the correct filetype)
|
||||
-- LSP, treesitter and other ft plugins will be disabled.
|
||||
-- mini.animate will also be disabled.
|
||||
vim.g.bigfile_size = 1024 * 1024 * 1.5 -- 1.5 MB
|
||||
|
||||
-- Show the current document symbols location from Trouble in lualine
|
||||
-- You can disable this for a buffer by setting `vim.b.trouble_lualine = false`
|
||||
vim.g.trouble_lualine = true
|
||||
@ -92,6 +84,7 @@ opt.number = true -- Print line number
|
||||
opt.pumblend = 10 -- Popup blend
|
||||
opt.pumheight = 10 -- Maximum number of entries in a popup
|
||||
opt.relativenumber = true -- Relative line numbers
|
||||
opt.ruler = false -- Disable the default ruler
|
||||
opt.scrolloff = 4 -- Lines of context
|
||||
opt.sessionoptions = { "buffers", "curdir", "tabpages", "winsize", "help", "globals", "skiprtp", "folds" }
|
||||
opt.shiftround = true -- Round indent
|
||||
@ -103,11 +96,10 @@ 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
|
||||
opt.statuscolumn = [[%!v:lua.require'lazyvim.util'.ui.statuscolumn()]]
|
||||
opt.statuscolumn = [[%!v:lua.require'snacks.statuscolumn'.get()]]
|
||||
opt.tabstop = 2 -- Number of spaces tabs count for
|
||||
opt.termguicolors = true -- True color support
|
||||
opt.timeoutlen = vim.g.vscode and 1000 or 300 -- Lower than default (1000) to quickly trigger which-key
|
||||
|
@ -17,7 +17,7 @@ function M.check()
|
||||
error("Neovim >= 0.9.0 is required")
|
||||
end
|
||||
|
||||
for _, cmd in ipairs({ "git", "rg", { "fd", "fdfind" }, "lazygit" }) do
|
||||
for _, cmd in ipairs({ "git", "rg", { "fd", "fdfind" }, "lazygit", "fzf", "curl" }) do
|
||||
local name = type(cmd) == "string" and cmd or vim.inspect(cmd)
|
||||
local commands = type(cmd) == "string" and { cmd } or cmd
|
||||
---@cast commands string[]
|
||||
|
@ -1,130 +1,15 @@
|
||||
return {
|
||||
|
||||
-- auto completion
|
||||
{
|
||||
"hrsh7th/nvim-cmp",
|
||||
version = false, -- last release is way too old
|
||||
event = "InsertEnter",
|
||||
dependencies = {
|
||||
"hrsh7th/cmp-nvim-lsp",
|
||||
"hrsh7th/cmp-buffer",
|
||||
"hrsh7th/cmp-path",
|
||||
},
|
||||
-- Not all LSP servers add brackets when completing a function.
|
||||
-- To better deal with this, LazyVim adds a custom option to cmp,
|
||||
-- that you can configure. For example:
|
||||
--
|
||||
-- ```lua
|
||||
-- opts = {
|
||||
-- auto_brackets = { "python" }
|
||||
-- }
|
||||
-- ```
|
||||
opts = function()
|
||||
vim.api.nvim_set_hl(0, "CmpGhostText", { link = "Comment", default = true })
|
||||
local cmp = require("cmp")
|
||||
local defaults = require("cmp.config.default")()
|
||||
local auto_select = true
|
||||
return {
|
||||
auto_brackets = {}, -- configure any filetype to auto add brackets
|
||||
completion = {
|
||||
completeopt = "menu,menuone,noinsert" .. (auto_select and "" or ",noselect"),
|
||||
},
|
||||
preselect = auto_select and cmp.PreselectMode.Item or cmp.PreselectMode.None,
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
["<C-b>"] = cmp.mapping.scroll_docs(-4),
|
||||
["<C-f>"] = cmp.mapping.scroll_docs(4),
|
||||
["<C-n>"] = cmp.mapping.select_next_item({ behavior = cmp.SelectBehavior.Insert }),
|
||||
["<C-p>"] = cmp.mapping.select_prev_item({ behavior = cmp.SelectBehavior.Insert }),
|
||||
["<C-Space>"] = cmp.mapping.complete(),
|
||||
["<CR>"] = LazyVim.cmp.confirm({ select = auto_select }),
|
||||
["<C-y>"] = LazyVim.cmp.confirm({ select = true }),
|
||||
["<S-CR>"] = LazyVim.cmp.confirm({ behavior = cmp.ConfirmBehavior.Replace }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
|
||||
["<C-CR>"] = function(fallback)
|
||||
cmp.abort()
|
||||
fallback()
|
||||
end,
|
||||
}),
|
||||
sources = cmp.config.sources({
|
||||
{ name = "nvim_lsp" },
|
||||
{ name = "path" },
|
||||
}, {
|
||||
{ name = "buffer" },
|
||||
}),
|
||||
formatting = {
|
||||
format = function(entry, item)
|
||||
local icons = LazyVim.config.icons.kinds
|
||||
if icons[item.kind] then
|
||||
item.kind = icons[item.kind] .. item.kind
|
||||
end
|
||||
|
||||
local widths = {
|
||||
abbr = vim.g.cmp_widths and vim.g.cmp_widths.abbr or 40,
|
||||
menu = vim.g.cmp_widths and vim.g.cmp_widths.menu or 30,
|
||||
}
|
||||
|
||||
for key, width in pairs(widths) do
|
||||
if item[key] and vim.fn.strdisplaywidth(item[key]) > width then
|
||||
item[key] = vim.fn.strcharpart(item[key], 0, width - 1) .. "…"
|
||||
end
|
||||
end
|
||||
|
||||
return item
|
||||
end,
|
||||
},
|
||||
experimental = {
|
||||
ghost_text = {
|
||||
hl_group = "CmpGhostText",
|
||||
},
|
||||
},
|
||||
sorting = defaults.sorting,
|
||||
}
|
||||
import = "lazyvim.plugins.extras.coding.nvim-cmp",
|
||||
enabled = function()
|
||||
return LazyVim.cmp_engine() == "nvim-cmp"
|
||||
end,
|
||||
main = "lazyvim.util.cmp",
|
||||
},
|
||||
|
||||
-- snippets
|
||||
{
|
||||
"nvim-cmp",
|
||||
optional = true,
|
||||
dependencies = {
|
||||
{
|
||||
"garymjr/nvim-snippets",
|
||||
opts = {
|
||||
friendly_snippets = true,
|
||||
},
|
||||
dependencies = { "rafamadriz/friendly-snippets" },
|
||||
},
|
||||
},
|
||||
opts = function(_, opts)
|
||||
opts.snippet = {
|
||||
expand = function(item)
|
||||
return LazyVim.cmp.expand(item.body)
|
||||
end,
|
||||
}
|
||||
if LazyVim.has("nvim-snippets") then
|
||||
table.insert(opts.sources, { name = "snippets" })
|
||||
end
|
||||
import = "lazyvim.plugins.extras.coding.blink",
|
||||
enabled = function()
|
||||
return LazyVim.cmp_engine() == "blink.cmp"
|
||||
end,
|
||||
keys = {
|
||||
{
|
||||
"<Tab>",
|
||||
function()
|
||||
return vim.snippet.active({ direction = 1 }) and "<cmd>lua vim.snippet.jump(1)<cr>" or "<Tab>"
|
||||
end,
|
||||
expr = true,
|
||||
silent = true,
|
||||
mode = { "i", "s" },
|
||||
},
|
||||
{
|
||||
"<S-Tab>",
|
||||
function()
|
||||
return vim.snippet.active({ direction = -1 }) and "<cmd>lua vim.snippet.jump(-1)<cr>" or "<S-Tab>"
|
||||
end,
|
||||
expr = true,
|
||||
silent = true,
|
||||
mode = { "i", "s" },
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
-- auto pairs
|
||||
@ -176,7 +61,6 @@ return {
|
||||
{ "%u[%l%d]+%f[^%l%d]", "%f[%S][%l%d]+%f[^%l%d]", "%f[%P][%l%d]+%f[^%l%d]", "^[%l%d]+%f[^%l%d]" },
|
||||
"^().*()$",
|
||||
},
|
||||
i = LazyVim.mini.ai_indent, -- indent
|
||||
g = LazyVim.mini.ai_buffer, -- buffer
|
||||
u = ai.gen_spec.function_call(), -- u for "Usage"
|
||||
U = ai.gen_spec.function_call({ name_pattern = "[%w_]" }), -- without dot in function name
|
||||
@ -199,20 +83,11 @@ return {
|
||||
cmd = "LazyDev",
|
||||
opts = {
|
||||
library = {
|
||||
{ path = "luvit-meta/library", words = { "vim%.uv" } },
|
||||
{ path = "${3rd}/luv/library", words = { "vim%.uv" } },
|
||||
{ path = "LazyVim", words = { "LazyVim" } },
|
||||
{ path = "snacks.nvim", words = { "Snacks" } },
|
||||
{ path = "lazy.nvim", words = { "LazyVim" } },
|
||||
},
|
||||
},
|
||||
},
|
||||
-- Manage libuv types with lazy. Plugin will never be loaded
|
||||
{ "Bilal2453/luvit-meta", lazy = true },
|
||||
-- Add lazydev source to cmp
|
||||
{
|
||||
"hrsh7th/nvim-cmp",
|
||||
optional = true,
|
||||
opts = function(_, opts)
|
||||
table.insert(opts.sources, { name = "lazydev", group_index = 0 })
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
@ -44,6 +44,7 @@ return {
|
||||
noice = true,
|
||||
notify = true,
|
||||
semantic_tokens = true,
|
||||
snacks = true,
|
||||
telescope = true,
|
||||
treesitter = true,
|
||||
treesitter_context = true,
|
||||
|
@ -4,6 +4,9 @@ return {
|
||||
{ "garymjr/nvim-snippets", enabled = false },
|
||||
{ import = "lazyvim.plugins.extras.coding.luasnip" },
|
||||
|
||||
-- Use nvim-cmp instead of blink.cmp
|
||||
{ import = "lazyvim.plugins.extras.coding.nvim-cmp" },
|
||||
|
||||
-- Use mini.comment instead of ts-comments
|
||||
{ "folke/ts-comments.nvim", enabled = false },
|
||||
{ import = "lazyvim.plugins.extras.coding.mini-comment" },
|
||||
|
@ -105,7 +105,7 @@ return {
|
||||
},
|
||||
config = function(_, opts)
|
||||
local function on_move(data)
|
||||
LazyVim.lsp.on_rename(data.source, data.destination)
|
||||
Snacks.rename.on_rename_file(data.source, data.destination)
|
||||
end
|
||||
|
||||
local events = require("neo-tree.events")
|
||||
@ -176,12 +176,15 @@ return {
|
||||
event = "VeryLazy",
|
||||
opts_extend = { "spec" },
|
||||
opts = {
|
||||
preset = "helix",
|
||||
defaults = {},
|
||||
spec = {
|
||||
{
|
||||
mode = { "n", "v" },
|
||||
{ "<leader><tab>", group = "tabs" },
|
||||
{ "<leader>c", group = "code" },
|
||||
{ "<leader>d", group = "debug" },
|
||||
{ "<leader>dp", group = "profiler" },
|
||||
{ "<leader>f", group = "file/find" },
|
||||
{ "<leader>g", group = "git" },
|
||||
{ "<leader>gh", group = "hunks" },
|
||||
@ -300,6 +303,20 @@ return {
|
||||
end,
|
||||
},
|
||||
},
|
||||
{
|
||||
"gitsigns.nvim",
|
||||
opts = function()
|
||||
Snacks.toggle({
|
||||
name = "Git Signs",
|
||||
get = function()
|
||||
return require("gitsigns.config").config.signcolumn
|
||||
end,
|
||||
set = function(state)
|
||||
require("gitsigns").toggle_signs(state)
|
||||
end,
|
||||
}):map("<leader>uG")
|
||||
end,
|
||||
},
|
||||
|
||||
-- better diagnostics list and others
|
||||
{
|
||||
|
69
lua/lazyvim/plugins/extras/ai/codeium.lua
Normal file
69
lua/lazyvim/plugins/extras/ai/codeium.lua
Normal file
@ -0,0 +1,69 @@
|
||||
return {
|
||||
|
||||
-- codeium
|
||||
{
|
||||
"Exafunction/codeium.nvim",
|
||||
cmd = "Codeium",
|
||||
build = ":Codeium Auth",
|
||||
opts = {
|
||||
enable_cmp_source = vim.g.ai_cmp,
|
||||
virtual_text = {
|
||||
enabled = not vim.g.ai_cmp,
|
||||
key_bindings = {
|
||||
accept = false, -- handled by nvim-cmp / blink.cmp
|
||||
next = "<M-]>",
|
||||
prev = "<M-[>",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
-- add ai_accept action
|
||||
{
|
||||
"Exafunction/codeium.nvim",
|
||||
opts = function()
|
||||
LazyVim.cmp.actions.ai_accept = function()
|
||||
if require("codeium.virtual_text").get_current_completion_item() then
|
||||
LazyVim.create_undo()
|
||||
vim.api.nvim_input(require("codeium.virtual_text").accept())
|
||||
return true
|
||||
end
|
||||
end
|
||||
end,
|
||||
},
|
||||
|
||||
-- codeium cmp source
|
||||
{
|
||||
"hrsh7th/nvim-cmp",
|
||||
optional = true,
|
||||
dependencies = { "codeium.nvim" },
|
||||
opts = function(_, opts)
|
||||
table.insert(opts.sources, 1, {
|
||||
name = "codeium",
|
||||
group_index = 1,
|
||||
priority = 100,
|
||||
})
|
||||
end,
|
||||
},
|
||||
|
||||
{
|
||||
"nvim-lualine/lualine.nvim",
|
||||
optional = true,
|
||||
event = "VeryLazy",
|
||||
opts = function(_, opts)
|
||||
table.insert(opts.sections.lualine_x, 2, LazyVim.lualine.cmp_source("codeium"))
|
||||
end,
|
||||
},
|
||||
|
||||
vim.g.ai_cmp and {
|
||||
"saghen/blink.cmp",
|
||||
optional = true,
|
||||
dependencies = { "codeium.nvim", "saghen/blink.compat" },
|
||||
opts = {
|
||||
sources = {
|
||||
compat = { "codeium" },
|
||||
providers = { codeium = { kind = "Codeium" } },
|
||||
},
|
||||
},
|
||||
} or nil,
|
||||
}
|
10
lua/lazyvim/plugins/extras/coding/copilot-chat.lua → lua/lazyvim/plugins/extras/ai/copilot-chat.lua
10
lua/lazyvim/plugins/extras/coding/copilot-chat.lua → lua/lazyvim/plugins/extras/ai/copilot-chat.lua
@ -17,23 +17,18 @@ end
|
||||
return {
|
||||
{
|
||||
"CopilotC-Nvim/CopilotChat.nvim",
|
||||
branch = "canary",
|
||||
branch = "main",
|
||||
cmd = "CopilotChat",
|
||||
opts = function()
|
||||
local user = vim.env.USER or "User"
|
||||
user = user:sub(1, 1):upper() .. user:sub(2)
|
||||
return {
|
||||
auto_insert_mode = true,
|
||||
show_help = true,
|
||||
question_header = " " .. user .. " ",
|
||||
answer_header = " Copilot ",
|
||||
window = {
|
||||
width = 0.4,
|
||||
},
|
||||
selection = function(source)
|
||||
local select = require("CopilotChat.select")
|
||||
return select.visual(source) or select.buffer(source)
|
||||
end,
|
||||
}
|
||||
end,
|
||||
keys = {
|
||||
@ -66,14 +61,11 @@ 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")
|
||||
require("CopilotChat.integrations.cmp").setup()
|
||||
|
||||
vim.api.nvim_create_autocmd("BufEnter", {
|
||||
pattern = "copilot-chat",
|
116
lua/lazyvim/plugins/extras/ai/copilot.lua
Normal file
116
lua/lazyvim/plugins/extras/ai/copilot.lua
Normal file
@ -0,0 +1,116 @@
|
||||
return {
|
||||
recommended = true,
|
||||
-- copilot
|
||||
{
|
||||
"zbirenbaum/copilot.lua",
|
||||
cmd = "Copilot",
|
||||
build = ":Copilot auth",
|
||||
event = "InsertEnter",
|
||||
opts = {
|
||||
suggestion = {
|
||||
enabled = not vim.g.ai_cmp,
|
||||
auto_trigger = true,
|
||||
keymap = {
|
||||
accept = false, -- handled by nvim-cmp / blink.cmp
|
||||
next = "<M-]>",
|
||||
prev = "<M-[>",
|
||||
},
|
||||
},
|
||||
panel = { enabled = false },
|
||||
filetypes = {
|
||||
markdown = true,
|
||||
help = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
-- add ai_accept action
|
||||
{
|
||||
"zbirenbaum/copilot.lua",
|
||||
opts = function()
|
||||
LazyVim.cmp.actions.ai_accept = function()
|
||||
if require("copilot.suggestion").is_visible() then
|
||||
LazyVim.create_undo()
|
||||
require("copilot.suggestion").accept()
|
||||
return true
|
||||
end
|
||||
end
|
||||
end,
|
||||
},
|
||||
|
||||
-- lualine
|
||||
{
|
||||
"nvim-lualine/lualine.nvim",
|
||||
optional = true,
|
||||
event = "VeryLazy",
|
||||
opts = function(_, opts)
|
||||
table.insert(
|
||||
opts.sections.lualine_x,
|
||||
2,
|
||||
LazyVim.lualine.status(LazyVim.config.icons.kinds.Copilot, function()
|
||||
local clients = package.loaded["copilot"] and LazyVim.lsp.get_clients({ name = "copilot", bufnr = 0 }) or {}
|
||||
if #clients > 0 then
|
||||
local status = require("copilot.api").status.data.status
|
||||
return (status == "InProgress" and "pending") or (status == "Warning" and "error") or "ok"
|
||||
end
|
||||
end)
|
||||
)
|
||||
end,
|
||||
},
|
||||
|
||||
vim.g.ai_cmp
|
||||
and {
|
||||
-- copilot cmp source
|
||||
{
|
||||
"hrsh7th/nvim-cmp",
|
||||
optional = true,
|
||||
dependencies = { -- this will only be evaluated if nvim-cmp is enabled
|
||||
{
|
||||
"zbirenbaum/copilot-cmp",
|
||||
opts = {},
|
||||
config = function(_, opts)
|
||||
local copilot_cmp = require("copilot_cmp")
|
||||
copilot_cmp.setup(opts)
|
||||
-- attach cmp source whenever copilot attaches
|
||||
-- fixes lazy-loading issues with the copilot cmp source
|
||||
LazyVim.lsp.on_attach(function()
|
||||
copilot_cmp._on_insert_enter({})
|
||||
end, "copilot")
|
||||
end,
|
||||
specs = {
|
||||
{
|
||||
"hrsh7th/nvim-cmp",
|
||||
optional = true,
|
||||
---@param opts cmp.ConfigSchema
|
||||
opts = function(_, opts)
|
||||
table.insert(opts.sources, 1, {
|
||||
name = "copilot",
|
||||
group_index = 1,
|
||||
priority = 100,
|
||||
})
|
||||
end,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"saghen/blink.cmp",
|
||||
optional = true,
|
||||
dependencies = { "giuxtaposition/blink-cmp-copilot" },
|
||||
opts = {
|
||||
sources = {
|
||||
default = { "copilot" },
|
||||
providers = {
|
||||
copilot = {
|
||||
name = "copilot",
|
||||
module = "blink-cmp-copilot",
|
||||
kind = "Copilot",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
or nil,
|
||||
}
|
85
lua/lazyvim/plugins/extras/ai/supermaven.lua
Normal file
85
lua/lazyvim/plugins/extras/ai/supermaven.lua
Normal file
@ -0,0 +1,85 @@
|
||||
return {
|
||||
{
|
||||
"supermaven-inc/supermaven-nvim",
|
||||
opts = {
|
||||
keymaps = {
|
||||
accept_suggestion = nil, -- handled by nvim-cmp / blink.cmp
|
||||
},
|
||||
disable_inline_completion = vim.g.ai_cmp,
|
||||
},
|
||||
},
|
||||
|
||||
-- add ai_accept action
|
||||
{
|
||||
"supermaven-inc/supermaven-nvim",
|
||||
opts = function()
|
||||
require("supermaven-nvim.completion_preview").suggestion_group = "SupermavenSuggestion"
|
||||
LazyVim.cmp.actions.ai_accept = function()
|
||||
local suggestion = require("supermaven-nvim.completion_preview")
|
||||
if suggestion.has_suggestion() then
|
||||
LazyVim.create_undo()
|
||||
vim.schedule(function()
|
||||
suggestion.on_accept_suggestion()
|
||||
end)
|
||||
return true
|
||||
end
|
||||
end
|
||||
end,
|
||||
},
|
||||
|
||||
-- cmp integration
|
||||
{
|
||||
"hrsh7th/nvim-cmp",
|
||||
optional = true,
|
||||
dependencies = { "supermaven-nvim" },
|
||||
opts = function(_, opts)
|
||||
if vim.g.ai_cmp then
|
||||
table.insert(opts.sources, 1, {
|
||||
name = "supermaven",
|
||||
group_index = 1,
|
||||
priority = 100,
|
||||
})
|
||||
end
|
||||
end,
|
||||
},
|
||||
|
||||
vim.g.ai_cmp and {
|
||||
"saghen/blink.cmp",
|
||||
optional = true,
|
||||
dependencies = { "supermaven-nvim", "saghen/blink.compat" },
|
||||
opts = {
|
||||
sources = {
|
||||
compat = { "supermaven" },
|
||||
providers = { supermaven = { kind = "Supermaven" } },
|
||||
},
|
||||
},
|
||||
} or nil,
|
||||
|
||||
{
|
||||
"nvim-lualine/lualine.nvim",
|
||||
optional = true,
|
||||
event = "VeryLazy",
|
||||
opts = function(_, opts)
|
||||
table.insert(opts.sections.lualine_x, 2, LazyVim.lualine.cmp_source("supermaven"))
|
||||
end,
|
||||
},
|
||||
|
||||
{
|
||||
"folke/noice.nvim",
|
||||
optional = true,
|
||||
opts = function(_, opts)
|
||||
vim.list_extend(opts.routes, {
|
||||
{
|
||||
filter = {
|
||||
event = "msg_show",
|
||||
any = {
|
||||
{ find = "Starting Supermaven" },
|
||||
{ find = "Supermaven Free Tier" },
|
||||
},
|
||||
},
|
||||
skip = true,
|
||||
},
|
||||
})
|
||||
end,
|
||||
},
|
||||
}
|
@ -1,26 +1,22 @@
|
||||
return {
|
||||
-- Tabnine cmp source
|
||||
{
|
||||
"nvim-cmp",
|
||||
optional = true,
|
||||
dependencies = {
|
||||
{
|
||||
"tzachar/cmp-tabnine",
|
||||
build = {
|
||||
LazyVim.is_win() and "pwsh -noni .\\install.ps1" or "./install.sh",
|
||||
":CmpTabnineHub",
|
||||
},
|
||||
dependencies = "hrsh7th/nvim-cmp",
|
||||
opts = {
|
||||
max_lines = 1000,
|
||||
max_num_results = 3,
|
||||
sort = true,
|
||||
},
|
||||
config = function(_, opts)
|
||||
require("cmp_tabnine.config"):setup(opts)
|
||||
end,
|
||||
},
|
||||
"tzachar/cmp-tabnine",
|
||||
build = LazyVim.is_win() and "pwsh -noni .\\install.ps1" or "./install.sh",
|
||||
opts = {
|
||||
max_lines = 1000,
|
||||
max_num_results = 3,
|
||||
sort = true,
|
||||
},
|
||||
config = function(_, opts)
|
||||
require("cmp_tabnine.config"):setup(opts)
|
||||
end,
|
||||
},
|
||||
|
||||
{
|
||||
"hrsh7th/nvim-cmp",
|
||||
optional = true,
|
||||
dependencies = { "tzachar/cmp-tabnine" },
|
||||
---@param opts cmp.ConfigSchema
|
||||
opts = function(_, opts)
|
||||
table.insert(opts.sources, 1, {
|
||||
@ -37,6 +33,19 @@ return {
|
||||
end)
|
||||
end,
|
||||
},
|
||||
|
||||
{
|
||||
"saghen/blink.cmp",
|
||||
optional = true,
|
||||
dependencies = { "tzachar/cmp-tabnine", "saghen/blink.compat" },
|
||||
opts = {
|
||||
sources = {
|
||||
compat = { "cmp_tabnine" },
|
||||
providers = { cmp_tabnine = { kind = "TabNine" } },
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
-- Show TabNine status in lualine
|
||||
{
|
||||
"nvim-lualine/lualine.nvim",
|
@ -1,73 +1,175 @@
|
||||
---@diagnostic disable: missing-fields
|
||||
if lazyvim_docs then
|
||||
-- set to `true` to follow the main branch
|
||||
-- you need to have a working rust toolchain to build the plugin
|
||||
-- in this case.
|
||||
vim.g.lazyvim_blink_main = false
|
||||
end
|
||||
|
||||
return {
|
||||
{
|
||||
"hrsh7th/nvim-cmp",
|
||||
optional = true,
|
||||
enabled = false,
|
||||
},
|
||||
{
|
||||
"saghen/blink.cmp",
|
||||
-- TODO: use release version
|
||||
-- version = "*",
|
||||
opts_extend = { "sources.completion.enabled_providers" },
|
||||
version = not vim.g.lazyvim_blink_main and "*",
|
||||
build = vim.g.lazyvim_blink_main and "cargo build --release",
|
||||
opts_extend = {
|
||||
"sources.completion.enabled_providers",
|
||||
"sources.compat",
|
||||
"sources.default",
|
||||
},
|
||||
dependencies = {
|
||||
"rafamadriz/friendly-snippets",
|
||||
-- add blink.compat to dependencies
|
||||
-- { "saghen/blink.compat", opts = {} },
|
||||
{
|
||||
"saghen/blink.compat",
|
||||
optional = true, -- make optional so it's only enabled if any extras need it
|
||||
opts = {},
|
||||
version = not vim.g.lazyvim_blink_main and "*",
|
||||
},
|
||||
},
|
||||
event = "InsertEnter",
|
||||
|
||||
---@module 'blink.cmp'
|
||||
---@type blink.cmp.Config
|
||||
opts = {
|
||||
fuzzy = {
|
||||
prebuilt_binaries = {
|
||||
download = true,
|
||||
force_version = "v0.5.0",
|
||||
},
|
||||
},
|
||||
highlight = {
|
||||
appearance = {
|
||||
-- sets the fallback highlight groups to nvim-cmp's highlight groups
|
||||
-- useful for when your theme doesn't support blink.cmp
|
||||
-- will be removed in a future release, assuming themes add support
|
||||
use_nvim_cmp_as_default = false,
|
||||
-- set to 'mono' for 'Nerd Font Mono' or 'normal' for 'Nerd Font'
|
||||
-- adjusts spacing to ensure icons are aligned
|
||||
nerd_font_variant = "mono",
|
||||
},
|
||||
-- set to 'mono' for 'Nerd Font Mono' or 'normal' for 'Nerd Font'
|
||||
-- adjusts spacing to ensure icons are aligned
|
||||
nerd_font_variant = "mono",
|
||||
windows = {
|
||||
autocomplete = {
|
||||
draw = "reversed",
|
||||
completion = {
|
||||
accept = {
|
||||
-- experimental auto-brackets support
|
||||
auto_brackets = {
|
||||
enabled = true,
|
||||
},
|
||||
},
|
||||
menu = {
|
||||
draw = {
|
||||
treesitter = { "lsp" },
|
||||
},
|
||||
},
|
||||
documentation = {
|
||||
auto_show = true,
|
||||
auto_show_delay_ms = 200,
|
||||
},
|
||||
ghost_text = {
|
||||
enabled = true,
|
||||
enabled = vim.g.ai_cmp,
|
||||
},
|
||||
},
|
||||
|
||||
-- experimental auto-brackets support
|
||||
accept = { auto_brackets = { enabled = true } },
|
||||
|
||||
-- experimental signature help support
|
||||
-- trigger = { signature_help = { enabled = true } }
|
||||
-- signature = { enabled = true },
|
||||
|
||||
sources = {
|
||||
completion = {
|
||||
-- remember to enable your providers here
|
||||
enabled_providers = { "lsp", "path", "snippets", "buffer" },
|
||||
},
|
||||
-- adding any nvim-cmp sources here will enable them
|
||||
-- with blink.compat
|
||||
compat = {},
|
||||
default = { "lsp", "path", "snippets", "buffer" },
|
||||
cmdline = {},
|
||||
},
|
||||
|
||||
keymap = {
|
||||
preset = "enter",
|
||||
["<C-y>"] = { "select_and_accept" },
|
||||
["<Tab>"] = {
|
||||
LazyVim.cmp.map({ "snippet_forward", "ai_accept" }),
|
||||
"fallback",
|
||||
},
|
||||
},
|
||||
},
|
||||
---@param opts blink.cmp.Config | { sources: { compat: string[] } }
|
||||
config = function(_, opts)
|
||||
-- setup compat sources
|
||||
local enabled = opts.sources.default
|
||||
for _, source in ipairs(opts.sources.compat or {}) do
|
||||
opts.sources.providers[source] = vim.tbl_deep_extend(
|
||||
"force",
|
||||
{ name = source, module = "blink.compat.source" },
|
||||
opts.sources.providers[source] or {}
|
||||
)
|
||||
if type(enabled) == "table" and not vim.tbl_contains(enabled, source) then
|
||||
table.insert(enabled, source)
|
||||
end
|
||||
end
|
||||
|
||||
-- fix super-tab completion
|
||||
if opts.keymap.preset == "super-tab" then
|
||||
opts.keymap["<Tab>"] = {
|
||||
function(cmp)
|
||||
if cmp.snippet_active() then
|
||||
return cmp.accept()
|
||||
else
|
||||
return cmp.select_and_accept()
|
||||
end
|
||||
end,
|
||||
LazyVim.cmp.map({ "snippet_forward", "ai_accept" }),
|
||||
"fallback",
|
||||
}
|
||||
end
|
||||
|
||||
--- NOTE: compat with latest version. Currenlty 0.7.6
|
||||
if not vim.g.lazyvim_blink_main then
|
||||
---@diagnostic disable-next-line: inject-field
|
||||
opts.sources.completion = opts.sources.completion or {}
|
||||
opts.sources.completion.enabled_providers = enabled
|
||||
if vim.tbl_get(opts, "completion", "menu", "draw", "treesitter") then
|
||||
---@diagnostic disable-next-line: assign-type-mismatch
|
||||
opts.completion.menu.draw.treesitter = true
|
||||
end
|
||||
end
|
||||
|
||||
-- Unset custom prop to pass blink.cmp validation
|
||||
opts.sources.compat = nil
|
||||
|
||||
-- check if we need to override symbol kinds
|
||||
for _, provider in pairs(opts.sources.providers or {}) do
|
||||
---@cast provider blink.cmp.SourceProviderConfig|{kind?:string}
|
||||
if provider.kind then
|
||||
local CompletionItemKind = require("blink.cmp.types").CompletionItemKind
|
||||
local kind_idx = #CompletionItemKind + 1
|
||||
|
||||
CompletionItemKind[kind_idx] = provider.kind
|
||||
---@diagnostic disable-next-line: no-unknown
|
||||
CompletionItemKind[provider.kind] = kind_idx
|
||||
|
||||
---@type fun(ctx: blink.cmp.Context, items: blink.cmp.CompletionItem[]): blink.cmp.CompletionItem[]
|
||||
local transform_items = provider.transform_items
|
||||
---@param ctx blink.cmp.Context
|
||||
---@param items blink.cmp.CompletionItem[]
|
||||
provider.transform_items = function(ctx, items)
|
||||
items = transform_items and transform_items(ctx, items) or items
|
||||
for _, item in ipairs(items) do
|
||||
item.kind = kind_idx or item.kind
|
||||
end
|
||||
return items
|
||||
end
|
||||
|
||||
-- Unset custom prop to pass blink.cmp validation
|
||||
provider.kind = nil
|
||||
end
|
||||
end
|
||||
|
||||
require("blink.cmp").setup(opts)
|
||||
end,
|
||||
},
|
||||
|
||||
-- add icons
|
||||
{
|
||||
"saghen/blink.cmp",
|
||||
opts = function(_, opts)
|
||||
opts.kind_icons = LazyVim.config.icons.kinds
|
||||
opts.appearance = opts.appearance or {}
|
||||
opts.appearance.kind_icons = vim.tbl_extend("keep", {
|
||||
Color = "██", -- Use block instead of icon for color items to make swatches more usable
|
||||
}, LazyVim.config.icons.kinds)
|
||||
end,
|
||||
},
|
||||
|
||||
@ -76,15 +178,9 @@ return {
|
||||
"saghen/blink.cmp",
|
||||
opts = {
|
||||
sources = {
|
||||
completion = {
|
||||
-- add lazydev to your completion providers
|
||||
enabled_providers = { "lazydev" },
|
||||
},
|
||||
-- add lazydev to your completion providers
|
||||
default = { "lazydev" },
|
||||
providers = {
|
||||
lsp = {
|
||||
-- dont show LuaLS require statements when lazydev has items
|
||||
fallback_for = { "lazydev" },
|
||||
},
|
||||
lazydev = {
|
||||
name = "LazyDev",
|
||||
module = "lazydev.integrations.blink",
|
||||
@ -93,4 +189,12 @@ return {
|
||||
},
|
||||
},
|
||||
},
|
||||
-- catppuccin support
|
||||
{
|
||||
"catppuccin",
|
||||
optional = true,
|
||||
opts = {
|
||||
integrations = { blink_cmp = true },
|
||||
},
|
||||
},
|
||||
}
|
||||
|
@ -1,33 +0,0 @@
|
||||
return {
|
||||
|
||||
-- codeium cmp source
|
||||
{
|
||||
"nvim-cmp",
|
||||
dependencies = {
|
||||
-- codeium
|
||||
{
|
||||
"Exafunction/codeium.nvim",
|
||||
cmd = "Codeium",
|
||||
build = ":Codeium Auth",
|
||||
opts = {},
|
||||
},
|
||||
},
|
||||
---@param opts cmp.ConfigSchema
|
||||
opts = function(_, opts)
|
||||
table.insert(opts.sources, 1, {
|
||||
name = "codeium",
|
||||
group_index = 1,
|
||||
priority = 100,
|
||||
})
|
||||
end,
|
||||
},
|
||||
|
||||
{
|
||||
"nvim-lualine/lualine.nvim",
|
||||
optional = true,
|
||||
event = "VeryLazy",
|
||||
opts = function(_, opts)
|
||||
table.insert(opts.sections.lualine_x, 2, LazyVim.lualine.cmp_source("codeium"))
|
||||
end,
|
||||
},
|
||||
}
|
@ -1,123 +0,0 @@
|
||||
return {
|
||||
recommended = true,
|
||||
-- copilot
|
||||
{
|
||||
"zbirenbaum/copilot.lua",
|
||||
cmd = "Copilot",
|
||||
build = ":Copilot auth",
|
||||
opts = {
|
||||
suggestion = { enabled = false },
|
||||
panel = { enabled = false },
|
||||
filetypes = {
|
||||
markdown = true,
|
||||
help = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"nvim-lualine/lualine.nvim",
|
||||
optional = true,
|
||||
event = "VeryLazy",
|
||||
opts = function(_, opts)
|
||||
local colors = {
|
||||
[""] = LazyVim.ui.fg("Special"),
|
||||
["Normal"] = LazyVim.ui.fg("Special"),
|
||||
["Warning"] = LazyVim.ui.fg("DiagnosticError"),
|
||||
["InProgress"] = LazyVim.ui.fg("DiagnosticWarn"),
|
||||
}
|
||||
table.insert(opts.sections.lualine_x, 2, {
|
||||
function()
|
||||
local icon = LazyVim.config.icons.kinds.Copilot
|
||||
local status = require("copilot.api").status.data
|
||||
return icon .. (status.message or "")
|
||||
end,
|
||||
cond = function()
|
||||
if not package.loaded["copilot"] then
|
||||
return
|
||||
end
|
||||
local ok, clients = pcall(LazyVim.lsp.get_clients, { name = "copilot", bufnr = 0 })
|
||||
if not ok then
|
||||
return false
|
||||
end
|
||||
return ok and #clients > 0
|
||||
end,
|
||||
color = function()
|
||||
if not package.loaded["copilot"] then
|
||||
return
|
||||
end
|
||||
local status = require("copilot.api").status.data
|
||||
return colors[status.status] or colors[""]
|
||||
end,
|
||||
})
|
||||
end,
|
||||
},
|
||||
|
||||
-- copilot cmp source
|
||||
{
|
||||
"nvim-cmp",
|
||||
dependencies = {
|
||||
{
|
||||
"zbirenbaum/copilot-cmp",
|
||||
dependencies = "copilot.lua",
|
||||
opts = {},
|
||||
config = function(_, opts)
|
||||
local copilot_cmp = require("copilot_cmp")
|
||||
copilot_cmp.setup(opts)
|
||||
-- attach cmp source whenever copilot attaches
|
||||
-- fixes lazy-loading issues with the copilot cmp source
|
||||
LazyVim.lsp.on_attach(function(client)
|
||||
copilot_cmp._on_insert_enter({})
|
||||
end, "copilot")
|
||||
end,
|
||||
},
|
||||
},
|
||||
---@param opts cmp.ConfigSchema
|
||||
opts = function(_, opts)
|
||||
table.insert(opts.sources, 1, {
|
||||
name = "copilot",
|
||||
group_index = 1,
|
||||
priority = 100,
|
||||
})
|
||||
end,
|
||||
},
|
||||
|
||||
{
|
||||
"saghen/blink.cmp",
|
||||
optional = true,
|
||||
specs = {
|
||||
{
|
||||
"zbirenbaum/copilot.lua",
|
||||
event = "InsertEnter",
|
||||
opts = {
|
||||
suggestion = {
|
||||
enabled = true,
|
||||
auto_trigger = true,
|
||||
keymap = { accept = false },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
opts = {
|
||||
windows = {
|
||||
ghost_text = {
|
||||
enabled = false,
|
||||
},
|
||||
},
|
||||
keymap = {
|
||||
["<Tab>"] = {
|
||||
function(cmp)
|
||||
if cmp.is_in_snippet() then
|
||||
return cmp.accept()
|
||||
elseif require("copilot.suggestion").is_visible() then
|
||||
require("copilot.suggestion").accept()
|
||||
else
|
||||
return cmp.select_and_accept()
|
||||
end
|
||||
end,
|
||||
"snippet_forward",
|
||||
"fallback",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
@ -1,4 +1,8 @@
|
||||
return {
|
||||
-- disable builtin snippet support
|
||||
{ "garymjr/nvim-snippets", enabled = false },
|
||||
|
||||
-- add luasnip
|
||||
{
|
||||
"L3MON4D3/LuaSnip",
|
||||
lazy = true,
|
||||
@ -10,20 +14,7 @@ return {
|
||||
"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" })
|
||||
require("luasnip.loaders.from_vscode").lazy_load({ paths = { vim.fn.stdpath("config") .. "/snippets" } })
|
||||
end,
|
||||
},
|
||||
},
|
||||
@ -32,23 +23,64 @@ return {
|
||||
delete_check_events = "TextChanged",
|
||||
},
|
||||
},
|
||||
|
||||
-- add snippet_forward action
|
||||
{
|
||||
"nvim-cmp",
|
||||
"L3MON4D3/LuaSnip",
|
||||
opts = function()
|
||||
LazyVim.cmp.actions.snippet_forward = function()
|
||||
if require("luasnip").jumpable(1) then
|
||||
require("luasnip").jump(1)
|
||||
return true
|
||||
end
|
||||
end
|
||||
end,
|
||||
},
|
||||
|
||||
-- nvim-cmp integration
|
||||
{
|
||||
"hrsh7th/nvim-cmp",
|
||||
optional = true,
|
||||
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,
|
||||
-- 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" } },
|
||||
},
|
||||
},
|
||||
|
||||
-- blink.cmp integration
|
||||
{
|
||||
"garymjr/nvim-snippets",
|
||||
enabled = false,
|
||||
"saghen/blink.cmp",
|
||||
optional = true,
|
||||
dependencies = {
|
||||
{ "saghen/blink.compat", opts = { impersonate_nvim_cmp = true } },
|
||||
{ "saadparwaiz1/cmp_luasnip" },
|
||||
},
|
||||
opts = {
|
||||
sources = { compat = { "luasnip" } },
|
||||
snippets = {
|
||||
expand = function(snippet)
|
||||
require("luasnip").lsp_expand(snippet)
|
||||
end,
|
||||
active = function(filter)
|
||||
if filter and filter.direction then
|
||||
return require("luasnip").jumpable(filter.direction)
|
||||
end
|
||||
return require("luasnip").in_snippet()
|
||||
end,
|
||||
jump = function(direction)
|
||||
require("luasnip").jump(direction)
|
||||
end,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user