Compare commits
268 Commits
Author | SHA1 | Date | |
---|---|---|---|
ce37e7f7cb | |||
1cb7ae6566 | |||
73bb4b20b6 | |||
c578be0bc1 | |||
d5bc4d58d0 | |||
836e18885c | |||
6d4caf60fc | |||
a5fe23e3f4 | |||
4d087030bd | |||
f3543d8d29 | |||
4341cdc892 | |||
178ef97804 | |||
43140c0897 | |||
a35b328978 | |||
cc747b3635 | |||
96684c696c | |||
b510209024 | |||
f53a1b7f12 | |||
b7ff5c24bd | |||
b2a18f8e0e | |||
c4de0c1d34 | |||
3db0dcc68e | |||
cc0cd8c419 | |||
a653cbc7da | |||
ce32cf66f6 | |||
3d242774d0 | |||
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 | |||
a66b44a9fe | |||
1d3d64fd1a | |||
f11890bf99 | |||
4ee6be4499 | |||
cb40a09538 | |||
0eb400908d | |||
5f432d997e | |||
944d214c26 | |||
6570a141c0 | |||
2f6c1f6083 | |||
7c7c196a78 | |||
0f5fa439e5 | |||
b4eb4e1f4a | |||
fe7003de50 | |||
e46cb62a17 | |||
27f53eaa1e | |||
917c685c1f | |||
13a4a84e34 | |||
c49b788319 | |||
327e829c15 | |||
90a92312ae | |||
3b8f6554f4 | |||
d2bd3114c0 | |||
3e257fdb88 | |||
d5a4ced75a | |||
04515b1399 | |||
b110550393 | |||
57c0c0bc9f | |||
dee5e18cf6 | |||
6e4025229d | |||
34f0e568d4 | |||
9b1767205c | |||
b6ff54bb95 | |||
74325743e7 | |||
a1c3ec4cd4 | |||
39ca76c960 | |||
627215a72b | |||
6dcd9794b1 | |||
86d4f14bc8 | |||
d67be9a9fb | |||
ead5955bef | |||
4cb12312cf | |||
746ea8f1e6 | |||
ae17b321c7 | |||
3dbace941e | |||
c012f85959 | |||
b892861bde | |||
5a0122b619 | |||
41a8f3a5fb | |||
393b7e4f46 | |||
1d2c0a5cf4 | |||
12818a6cb4 | |||
deceafc0f9 | |||
94bf4f9324 | |||
bcbab77f0c | |||
328272144c | |||
71b2690582 | |||
c8d0faf9b1 | |||
264abdf9d5 |
.github
CHANGELOG.mdNEWS.mdREADME-CN.mdREADME.mddoc
lua/lazyvim
config
plugins
coding.luacolorscheme.luainit.lua
compat
editor.luaextras
ai
coding
dap
editor
formatting
lang
angular.luaastro.luaelixir.luagit.luajava.lualean.luamarkdown.luanushell.luaocaml.luaomnisharp.luapython.luar.luarego.luaruby.luarust.luascala.luasql.luatailwind.luaterraform.luatex.luatypescript.luavue.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.37.0"
|
||||
".": "13.9.0"
|
||||
}
|
||||
|
387
CHANGELOG.md
387
CHANGELOG.md
File diff suppressed because it is too large
Load Diff
85
NEWS.md
85
NEWS.md
@ -1,7 +1,88 @@
|
||||
# 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 `ui.telescope` extra
|
||||
- [blink.cmp](https://github.com/saghm/blink.cmp) as a replacement for [nvim-cmp](https://github.com/hrsh7th/nvim-cmp)
|
||||
- to use **nvim-cmp** instead, enable the `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>z` to toggle [zen mode](https://github.com/folke/snacks.nvim/blob/main/docs/zen.md)
|
||||
- `<leader>Z` 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)
|
||||
to spice up your markdown files.
|
||||
|
||||
- [nvim-spectre](https://github.com/nvim-pack/nvim-spectre) has been removed in favor of [grug-far.nvim](https://github.com/MagicDuck/grug-far.nvim).
|
||||
**grug-far.nvim** has a great UI and feels more intuitive to use.
|
||||
|
||||
@ -24,6 +105,8 @@
|
||||
- moved `neoconf.nvim` to extras. Project specific LSP settings
|
||||
can be done with a `.lazy.lua` file instead.
|
||||
|
||||
---
|
||||
|
||||
## 11.x
|
||||
|
||||
- **Keymaps:**
|
||||
@ -83,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)
|
||||
|
47
README-CN.md
47
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,24 +46,24 @@ 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 '
|
||||
@ -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/)
|
||||
|
@ -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 July 24
|
||||
*LazyVim.txt* For Neovim Last change: 2024 December 12
|
||||
|
||||
==============================================================================
|
||||
Table of Contents *LazyVim-table-of-contents*
|
||||
@ -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,27 +55,33 @@ 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
|
||||
vim.keymap.set("n", "q", "<cmd>close<cr>", {
|
||||
buffer = event.buf,
|
||||
silent = true,
|
||||
desc = "Quit buffer",
|
||||
})
|
||||
vim.schedule(function()
|
||||
vim.keymap.set("n", "q", function()
|
||||
vim.cmd("close")
|
||||
pcall(vim.api.nvim_buf_delete, event.buf, { force = true })
|
||||
end, {
|
||||
buffer = event.buf,
|
||||
silent = true,
|
||||
desc = "Quit buffer",
|
||||
})
|
||||
end)
|
||||
end,
|
||||
})
|
||||
|
||||
@ -118,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.37.0" -- x-release-please-version
|
||||
M.version = "13.9.0" -- x-release-please-version
|
||||
LazyVim.config = M
|
||||
|
||||
---@class LazyVimOptions
|
||||
@ -88,6 +88,7 @@ local defaults = {
|
||||
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?
|
||||
|
@ -23,12 +23,12 @@ map("n", "<C-Left>", "<cmd>vertical resize -2<cr>", { desc = "Decrease Window Wi
|
||||
map("n", "<C-Right>", "<cmd>vertical resize +2<cr>", { desc = "Increase Window Width" })
|
||||
|
||||
-- Move Lines
|
||||
map("n", "<A-j>", "<cmd>m .+1<cr>==", { desc = "Move Down" })
|
||||
map("n", "<A-k>", "<cmd>m .-2<cr>==", { desc = "Move Up" })
|
||||
map("n", "<A-j>", "<cmd>execute 'move .+' . v:count1<cr>==", { desc = "Move Down" })
|
||||
map("n", "<A-k>", "<cmd>execute 'move .-' . (v:count1 + 1)<cr>==", { desc = "Move Up" })
|
||||
map("i", "<A-j>", "<esc><cmd>m .+1<cr>==gi", { desc = "Move Down" })
|
||||
map("i", "<A-k>", "<esc><cmd>m .-2<cr>==gi", { desc = "Move Up" })
|
||||
map("v", "<A-j>", ":m '>+1<cr>gv=gv", { desc = "Move Down" })
|
||||
map("v", "<A-k>", ":m '<-2<cr>gv=gv", { desc = "Move Up" })
|
||||
map("v", "<A-j>", ":<C-u>execute \"'<,'>move '>+\" . v:count1<cr>gv=gv", { desc = "Move Down" })
|
||||
map("v", "<A-k>", ":<C-u>execute \"'<,'>move '<-\" . (v:count1 + 1)<cr>gv=gv", { desc = "Move Up" })
|
||||
|
||||
-- buffers
|
||||
map("n", "<S-h>", "<cmd>bprevious<cr>", { desc = "Prev Buffer" })
|
||||
@ -37,7 +37,12 @@ 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>
|
||||
@ -115,37 +120,41 @@ 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) }})
|
||||
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 +167,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 +181,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 +192,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,34 +32,19 @@ 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.
|
||||
-- * editorPreset to nvim-remote
|
||||
-- * enables nerd font icons
|
||||
-- Set to false to disable.
|
||||
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
|
||||
-- * powershell
|
||||
-- LazyVim.terminal.setup("pwsh")
|
||||
|
||||
-- Set LSP servers to be ignored when used with `util.root.detectors.lsp`
|
||||
-- for detecting the LSP root
|
||||
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
|
||||
@ -85,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
|
||||
@ -96,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
|
||||
|
@ -1,127 +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-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",
|
||||
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
|
||||
@ -173,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
|
||||
@ -196,19 +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",
|
||||
opts = function(_, opts)
|
||||
table.insert(opts.sources, { name = "lazydev", group_index = 0 })
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
@ -44,11 +44,23 @@ return {
|
||||
noice = true,
|
||||
notify = true,
|
||||
semantic_tokens = true,
|
||||
snacks = true,
|
||||
telescope = true,
|
||||
treesitter = true,
|
||||
treesitter_context = true,
|
||||
which_key = true,
|
||||
},
|
||||
},
|
||||
specs = {
|
||||
{
|
||||
"akinsho/bufferline.nvim",
|
||||
optional = true,
|
||||
opts = function(_, opts)
|
||||
if (vim.g.colors_name or ""):find("catppuccin") then
|
||||
opts.highlights = require("catppuccin.groups.integrations.bufferline").get()
|
||||
end
|
||||
end,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
@ -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")
|
||||
@ -137,7 +137,7 @@ return {
|
||||
function()
|
||||
local grug = require("grug-far")
|
||||
local ext = vim.bo.buftype == "" and vim.fn.expand("%:e")
|
||||
grug.grug_far({
|
||||
grug.open({
|
||||
transient = true,
|
||||
prefills = {
|
||||
filesFilter = ext and ext ~= "" and "*." .. ext or nil,
|
||||
@ -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
|
||||
{
|
||||
"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,
|
||||
}
|
11
lua/lazyvim/plugins/extras/coding/copilot-chat.lua → lua/lazyvim/plugins/extras/ai/copilot-chat.lua
11
lua/lazyvim/plugins/extras/coding/copilot-chat.lua → lua/lazyvim/plugins/extras/ai/copilot-chat.lua
@ -17,24 +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 {
|
||||
model = "gpt-4",
|
||||
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 = {
|
||||
@ -67,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
|
||||
{
|
||||
"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 = {
|
||||
{
|
||||
"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,25 +1,22 @@
|
||||
return {
|
||||
-- Tabnine cmp source
|
||||
{
|
||||
"nvim-cmp",
|
||||
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,
|
||||
},
|
||||
|
||||
{
|
||||
"nvim-cmp",
|
||||
optional = true,
|
||||
dependencies = { "tzachar/cmp-tabnine" },
|
||||
---@param opts cmp.ConfigSchema
|
||||
opts = function(_, opts)
|
||||
table.insert(opts.sources, 1, {
|
||||
@ -36,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",
|
163
lua/lazyvim/plugins/extras/coding/blink.lua
Normal file
163
lua/lazyvim/plugins/extras/coding/blink.lua
Normal file
@ -0,0 +1,163 @@
|
||||
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 {
|
||||
{
|
||||
"saghen/blink.cmp",
|
||||
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",
|
||||
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 = {
|
||||
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",
|
||||
},
|
||||
completion = {
|
||||
accept = {
|
||||
-- experimental auto-brackets support
|
||||
auto_brackets = {
|
||||
enabled = true,
|
||||
},
|
||||
},
|
||||
menu = {
|
||||
draw = {
|
||||
treesitter = true,
|
||||
},
|
||||
},
|
||||
documentation = {
|
||||
auto_show = true,
|
||||
auto_show_delay_ms = 200,
|
||||
},
|
||||
ghost_text = {
|
||||
enabled = vim.g.ai_cmp,
|
||||
},
|
||||
},
|
||||
|
||||
-- experimental signature help support
|
||||
-- signature = { enabled = true },
|
||||
|
||||
sources = {
|
||||
-- adding any nvim-cmp sources here will enable them
|
||||
-- with blink.compat
|
||||
compat = {},
|
||||
default = { "lsp", "path", "snippets", "buffer" },
|
||||
},
|
||||
|
||||
keymap = {
|
||||
preset = "enter",
|
||||
["<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
|
||||
|
||||
-- TODO: remove when blink made a new release > 0.7.6
|
||||
if not vim.g.lazyvim_blink_main then
|
||||
opts.sources.completion = opts.sources.completion or {}
|
||||
opts.sources.completion.enabled_providers = enabled
|
||||
end
|
||||
|
||||
-- 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
|
||||
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
|
||||
end
|
||||
end
|
||||
|
||||
require("blink.cmp").setup(opts)
|
||||
end,
|
||||
},
|
||||
|
||||
-- add icons
|
||||
{
|
||||
"saghen/blink.cmp",
|
||||
opts = function(_, opts)
|
||||
opts.appearance = opts.appearance or {}
|
||||
opts.appearance.kind_icons = LazyVim.config.icons.kinds
|
||||
end,
|
||||
},
|
||||
|
||||
-- lazydev
|
||||
{
|
||||
"saghen/blink.cmp",
|
||||
opts = {
|
||||
sources = {
|
||||
-- add lazydev to your completion providers
|
||||
default = { "lazydev" },
|
||||
providers = {
|
||||
lazydev = {
|
||||
name = "LazyDev",
|
||||
module = "lazydev.integrations.blink",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
-- 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,83 +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,
|
||||
},
|
||||
}
|
@ -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
|
||||
{
|
||||
"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
|
||||
{
|
||||
"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,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
113
lua/lazyvim/plugins/extras/coding/nvim-cmp.lua
Normal file
113
lua/lazyvim/plugins/extras/coding/nvim-cmp.lua
Normal file
@ -0,0 +1,113 @@
|
||||
return {
|
||||
|
||||
-- Setup nvim-cmp
|
||||
{
|
||||
"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,
|
||||
["<tab>"] = function(fallback)
|
||||
return LazyVim.cmp.map({ "snippet_forward", "ai_accept" }, fallback)()
|
||||
end,
|
||||
}),
|
||||
sources = cmp.config.sources({
|
||||
{ name = "lazydev" },
|
||||
{ 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 = {
|
||||
-- only show ghost text when we show ai completions
|
||||
ghost_text = vim.g.ai_cmp and {
|
||||
hl_group = "CmpGhostText",
|
||||
} or false,
|
||||
},
|
||||
sorting = defaults.sorting,
|
||||
}
|
||||
end,
|
||||
main = "lazyvim.util.cmp",
|
||||
},
|
||||
|
||||
-- snippets
|
||||
{
|
||||
"nvim-cmp",
|
||||
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
|
||||
end,
|
||||
},
|
||||
}
|
@ -1,11 +1,17 @@
|
||||
---@param config {args?:string[]|fun():string[]?}
|
||||
---@param config {type?:string, args?:string[]|fun():string[]?}
|
||||
local function get_args(config)
|
||||
local args = type(config.args) == "function" and (config.args() or {}) or config.args or {}
|
||||
local args = type(config.args) == "function" and (config.args() or {}) or config.args or {} --[[@as string[] | string ]]
|
||||
local args_str = type(args) == "table" and table.concat(args, " ") or args --[[@as string]]
|
||||
|
||||
config = vim.deepcopy(config)
|
||||
---@cast args string[]
|
||||
config.args = function()
|
||||
local new_args = vim.fn.input("Run with args: ", table.concat(args, " ")) --[[@as string]]
|
||||
return vim.split(vim.fn.expand(new_args) --[[@as string]], " ")
|
||||
local new_args = vim.fn.expand(vim.fn.input("Run with args: ", args_str)) --[[@as string]]
|
||||
if config.type and config.type == "java" then
|
||||
---@diagnostic disable-next-line: return-type-mismatch
|
||||
return new_args
|
||||
end
|
||||
return require("dap.utils").splitstr(new_args)
|
||||
end
|
||||
return config
|
||||
end
|
||||
@ -27,10 +33,9 @@ return {
|
||||
|
||||
-- stylua: ignore
|
||||
keys = {
|
||||
{ "<leader>d", "", desc = "+debug", mode = {"n", "v"} },
|
||||
{ "<leader>dB", function() require("dap").set_breakpoint(vim.fn.input('Breakpoint condition: ')) end, desc = "Breakpoint Condition" },
|
||||
{ "<leader>db", function() require("dap").toggle_breakpoint() end, desc = "Toggle Breakpoint" },
|
||||
{ "<leader>dc", function() require("dap").continue() end, desc = "Continue" },
|
||||
{ "<leader>dc", function() require("dap").continue() end, desc = "Run/Continue" },
|
||||
{ "<leader>da", function() require("dap").continue({ before = get_args }) end, desc = "Run with Args" },
|
||||
{ "<leader>dC", function() require("dap").run_to_cursor() end, desc = "Run to Cursor" },
|
||||
{ "<leader>dg", function() require("dap").goto_() end, desc = "Go to Line (No Execute)" },
|
||||
@ -40,7 +45,7 @@ return {
|
||||
{ "<leader>dl", function() require("dap").run_last() end, desc = "Run Last" },
|
||||
{ "<leader>do", function() require("dap").step_out() end, desc = "Step Out" },
|
||||
{ "<leader>dO", function() require("dap").step_over() end, desc = "Step Over" },
|
||||
{ "<leader>dp", function() require("dap").pause() end, desc = "Pause" },
|
||||
{ "<leader>dP", function() require("dap").pause() end, desc = "Pause" },
|
||||
{ "<leader>dr", function() require("dap").repl.toggle() end, desc = "Toggle REPL" },
|
||||
{ "<leader>ds", function() require("dap").session() end, desc = "Session" },
|
||||
{ "<leader>dt", function() require("dap").terminate() end, desc = "Terminate" },
|
||||
@ -69,11 +74,6 @@ return {
|
||||
vscode.json_decode = function(str)
|
||||
return vim.json.decode(json.json_strip_comments(str))
|
||||
end
|
||||
|
||||
-- Extends dap.configurations with entries read from .vscode/launch.json
|
||||
if vim.fn.filereadable(".vscode/launch.json") then
|
||||
vscode.load_launchjs()
|
||||
end
|
||||
end,
|
||||
},
|
||||
|
||||
|
@ -98,39 +98,40 @@ return {
|
||||
return {
|
||||
dials_by_ft = {
|
||||
css = "css",
|
||||
vue = "vue",
|
||||
javascript = "typescript",
|
||||
typescript = "typescript",
|
||||
typescriptreact = "typescript",
|
||||
javascriptreact = "typescript",
|
||||
json = "json",
|
||||
lua = "lua",
|
||||
markdown = "markdown",
|
||||
python = "python",
|
||||
sass = "css",
|
||||
scss = "css",
|
||||
typescript = "typescript",
|
||||
typescriptreact = "typescript",
|
||||
yaml = "yaml",
|
||||
python = "python",
|
||||
},
|
||||
groups = {
|
||||
default = {
|
||||
augend.integer.alias.decimal, -- nonnegative decimal number (0, 1, 2, 3, ...)
|
||||
augend.integer.alias.decimal_int, -- nonnegative and negative decimal number
|
||||
augend.integer.alias.hex, -- nonnegative hex number (0x01, 0x1a1f, etc.)
|
||||
augend.date.alias["%Y/%m/%d"], -- date (2022/02/19, etc.)
|
||||
ordinal_numbers,
|
||||
weekdays,
|
||||
months,
|
||||
},
|
||||
typescript = {
|
||||
augend.integer.alias.decimal, -- nonnegative and negative decimal number
|
||||
capitalized_boolean,
|
||||
augend.constant.alias.bool, -- boolean value (true <-> false)
|
||||
logical_alias,
|
||||
},
|
||||
vue = {
|
||||
augend.constant.new({ elements = { "let", "const" } }),
|
||||
augend.hexcolor.new({ case = "lower" }),
|
||||
augend.hexcolor.new({ case = "upper" }),
|
||||
},
|
||||
typescript = {
|
||||
augend.constant.new({ elements = { "let", "const" } }),
|
||||
},
|
||||
yaml = {
|
||||
augend.integer.alias.decimal, -- nonnegative and negative decimal number
|
||||
augend.constant.alias.bool, -- boolean value (true <-> false)
|
||||
},
|
||||
css = {
|
||||
augend.integer.alias.decimal, -- nonnegative and negative decimal number
|
||||
augend.hexcolor.new({
|
||||
case = "lower",
|
||||
}),
|
||||
@ -142,12 +143,9 @@ return {
|
||||
augend.misc.alias.markdown_header,
|
||||
},
|
||||
json = {
|
||||
augend.integer.alias.decimal, -- nonnegative and negative decimal number
|
||||
augend.semver.alias.semver, -- versioning (v1.1.2)
|
||||
},
|
||||
lua = {
|
||||
augend.integer.alias.decimal, -- nonnegative and negative decimal number
|
||||
augend.constant.alias.bool, -- boolean value (true <-> false)
|
||||
augend.constant.new({
|
||||
elements = { "and", "or" },
|
||||
word = true, -- if false, "sand" is incremented into "sor", "doctor" into "doctand", etc.
|
||||
@ -155,14 +153,20 @@ return {
|
||||
}),
|
||||
},
|
||||
python = {
|
||||
augend.integer.alias.decimal, -- nonnegative and negative decimal number
|
||||
capitalized_boolean,
|
||||
logical_alias,
|
||||
augend.constant.new({
|
||||
elements = { "and", "or" },
|
||||
}),
|
||||
},
|
||||
},
|
||||
}
|
||||
end,
|
||||
config = function(_, opts)
|
||||
-- copy defaults to each group
|
||||
for name, group in pairs(opts.groups) do
|
||||
if name ~= "default" then
|
||||
vim.list_extend(group, opts.groups.default)
|
||||
end
|
||||
end
|
||||
require("dial.config").augends:register_group(opts.groups)
|
||||
vim.g.dials_by_ft = opts.dials_by_ft
|
||||
end,
|
||||
|
@ -74,18 +74,6 @@ return {
|
||||
config.defaults.actions.files["alt-c"] = config.defaults.actions.files["ctrl-r"]
|
||||
config.set_action_helpstr(config.defaults.actions.files["ctrl-r"], "toggle-root-dir")
|
||||
|
||||
-- use the same prompt for all
|
||||
local defaults = require("fzf-lua.profiles.default-title")
|
||||
local function fix(t)
|
||||
t.prompt = t.prompt ~= nil and " " or nil
|
||||
for _, v in pairs(t) do
|
||||
if type(v) == "table" then
|
||||
fix(v)
|
||||
end
|
||||
end
|
||||
end
|
||||
fix(defaults)
|
||||
|
||||
local img_previewer ---@type string[]?
|
||||
for _, v in ipairs({
|
||||
{ cmd = "ueberzug", args = {} },
|
||||
@ -98,7 +86,8 @@ return {
|
||||
end
|
||||
end
|
||||
|
||||
return vim.tbl_deep_extend("force", defaults, {
|
||||
return {
|
||||
"default-title",
|
||||
fzf_colors = true,
|
||||
fzf_opts = {
|
||||
["--no-scrollbar"] = true,
|
||||
@ -186,9 +175,24 @@ return {
|
||||
previewer = vim.fn.executable("delta") == 1 and "codeaction_native" or nil,
|
||||
},
|
||||
},
|
||||
})
|
||||
}
|
||||
end,
|
||||
config = function(_, opts)
|
||||
if opts[1] == "default-title" then
|
||||
-- use the same prompt for all pickers for profile `default-title` and
|
||||
-- profiles that use `default-title` as base profile
|
||||
local function fix(t)
|
||||
t.prompt = t.prompt ~= nil and " " or nil
|
||||
for _, v in pairs(t) do
|
||||
if type(v) == "table" then
|
||||
fix(v)
|
||||
end
|
||||
end
|
||||
return t
|
||||
end
|
||||
opts = vim.tbl_deep_extend("force", fix(require("fzf-lua.profiles.default-title")), opts)
|
||||
opts[1] = nil
|
||||
end
|
||||
require("fzf-lua").setup(opts)
|
||||
end,
|
||||
init = function()
|
||||
|
@ -15,6 +15,21 @@ return {
|
||||
config = function(_, opts)
|
||||
require("illuminate").configure(opts)
|
||||
|
||||
Snacks.toggle({
|
||||
name = "Illuminate",
|
||||
get = function()
|
||||
return not require("illuminate.engine").is_paused()
|
||||
end,
|
||||
set = function(enabled)
|
||||
local m = require("illuminate")
|
||||
if enabled then
|
||||
m.resume()
|
||||
else
|
||||
m.pause()
|
||||
end
|
||||
end,
|
||||
}):map("<leader>ux")
|
||||
|
||||
local function map(key, dir, buffer)
|
||||
vim.keymap.set("n", key, function()
|
||||
require("illuminate")["goto_" .. dir .. "_reference"](false)
|
||||
|
@ -29,6 +29,29 @@ return {
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"mini.diff",
|
||||
opts = function()
|
||||
Snacks.toggle({
|
||||
name = "Mini Diff Signs",
|
||||
get = function()
|
||||
return vim.g.minidiff_disable ~= true
|
||||
end,
|
||||
set = function(state)
|
||||
vim.g.minidiff_disable = not state
|
||||
if state then
|
||||
require("mini.diff").enable(0)
|
||||
else
|
||||
require("mini.diff").disable(0)
|
||||
end
|
||||
-- HACK: redraw to update the signs
|
||||
vim.defer_fn(function()
|
||||
vim.cmd([[redraw!]])
|
||||
end, 200)
|
||||
end,
|
||||
}):map("<leader>uG")
|
||||
end,
|
||||
},
|
||||
|
||||
-- lualine integration
|
||||
{
|
||||
|
@ -48,7 +48,7 @@ return {
|
||||
local map_split = function(buf_id, lhs, direction, close_on_file)
|
||||
local rhs = function()
|
||||
local new_target_window
|
||||
local cur_target_window = require("mini.files").get_target_window()
|
||||
local cur_target_window = require("mini.files").get_explorer_state().target_window
|
||||
if cur_target_window ~= nil then
|
||||
vim.api.nvim_win_call(cur_target_window, function()
|
||||
vim.cmd("belowright " .. direction .. " split")
|
||||
@ -104,7 +104,7 @@ return {
|
||||
vim.api.nvim_create_autocmd("User", {
|
||||
pattern = "MiniFilesActionRename",
|
||||
callback = function(event)
|
||||
LazyVim.lsp.on_rename(event.data.from, event.data.to)
|
||||
Snacks.rename.on_rename_file(event.data.from, event.data.to)
|
||||
end,
|
||||
})
|
||||
end,
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user