Compare commits
78 Commits
Author | SHA1 | Date | |
---|---|---|---|
ab4938bc4a | |||
787ceab031 | |||
7e47f88749 | |||
59fa83653f | |||
5abb10b5ab | |||
4b37723558 | |||
588dc5dd65 | |||
70966bbc19 | |||
8a9265efed | |||
2b8b27b4a9 | |||
d97bf66eed | |||
fc765e9e3d | |||
592074ad80 | |||
bd62cbe370 | |||
befa6c67a4 | |||
079c685831 | |||
0eef2c2f29 | |||
9b175ab1bc | |||
db9a7d90d5 | |||
cccdc1cacf | |||
90c58352dd | |||
6b9f0c0c3c | |||
de6a28b781 | |||
329a2daff4 | |||
f08d004bc2 | |||
8e84dcf85c | |||
a0cf00c81b | |||
ba7942b80b | |||
9edd1a938f | |||
3d18548c0a | |||
78cb3bb66d | |||
d5a9ac0e06 | |||
94ebe25ccb | |||
eccd122e6d | |||
e33dd761b1 | |||
8b0e6ab19e | |||
27248b0193 | |||
d198a19325 | |||
b64d980bbf | |||
5d6f0d58d5 | |||
cc3070d30e | |||
e91903e810 | |||
38eb3bf115 | |||
2e18998c9e | |||
a3aeb27cbc | |||
fab6150da9 | |||
e8766c5edd | |||
5cb44bae6d | |||
543126818e | |||
57e92b04e2 | |||
31ad893788 | |||
151bf12a9f | |||
d9e95f8dcd | |||
490598b81a | |||
6669e63368 | |||
d9b1c79c3e | |||
f5d232b79c | |||
fd0a0e829d | |||
b96ea665b3 | |||
b20f016b04 | |||
24cb9a90e5 | |||
42d2411bfa | |||
ddd1fceb76 | |||
7336478d09 | |||
cb384ad69f | |||
f492daa009 | |||
225a875179 | |||
3af91550be | |||
d61e4bd553 | |||
b796b6e5a8 | |||
4df6301f1e | |||
6416761353 | |||
52b34ce3c3 | |||
79b4d67357 | |||
5f5a564a82 | |||
088914e1dd | |||
f57031db7c | |||
9131897b61 |
157
CHANGELOG.md
157
CHANGELOG.md
@ -1,5 +1,162 @@
|
||||
# Changelog
|
||||
|
||||
## [1.13.0](https://github.com/LazyVim/LazyVim/compare/v1.12.1...v1.13.0) (2023-02-28)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **keymaps:** Add previous/next trouble/quickfix item keymap `[q`, `]q` ([#299](https://github.com/LazyVim/LazyVim/issues/299)) ([59fa836](https://github.com/LazyVim/LazyVim/commit/59fa83653f3d4f1911e220c2a96a7e47878a16bc))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **git-signs:** larger icons for delete ([4b37723](https://github.com/LazyVim/LazyVim/commit/4b37723558e45f14c3e8d05fc84ad3a701b9faf0))
|
||||
* **icons:** replace obsolete Nerd icons ([#331](https://github.com/LazyVim/LazyVim/issues/331)) ([588dc5d](https://github.com/LazyVim/LazyVim/commit/588dc5dd65aa3881122aa4e59710de6722423251))
|
||||
* **lsp:** only map lsp goto definition when client has definitionProvider ([#348](https://github.com/LazyVim/LazyVim/issues/348)) ([5abb10b](https://github.com/LazyVim/LazyVim/commit/5abb10b5ab3c2c5462f699fc98f618f39543f8f4))
|
||||
* **luasnips:** make install_jsregexp ([bd62cbe](https://github.com/LazyVim/LazyVim/commit/bd62cbe370a72525a29790c710d3f213c3e184e4))
|
||||
* **mini-indentscope:** disable indentscope for filetypes during init. Fixes [#318](https://github.com/LazyVim/LazyVim/issues/318) ([d97bf66](https://github.com/LazyVim/LazyVim/commit/d97bf66eed76c91eac11c81dad69aff9f632b214))
|
||||
* **treesitter:** always install all built-in treesitter parsers to prevent queriy issues ([fc765e9](https://github.com/LazyVim/LazyVim/commit/fc765e9e3d1fe8dc9f84087a73f12a2b3bbe60c4))
|
||||
|
||||
## [1.12.1](https://github.com/LazyVim/LazyVim/compare/v1.12.0...v1.12.1) (2023-02-20)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **treesitter:** nil check [#312](https://github.com/LazyVim/LazyVim/issues/312) ([#313](https://github.com/LazyVim/LazyVim/issues/313)) ([0eef2c2](https://github.com/LazyVim/LazyVim/commit/0eef2c2f29cc95b6a3da8c9dced215acf60147dc))
|
||||
|
||||
## [1.12.0](https://github.com/LazyVim/LazyVim/compare/v1.11.0...v1.12.0) (2023-02-20)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* persist pinned tabs ([#304](https://github.com/LazyVim/LazyVim/issues/304)) ([6b9f0c0](https://github.com/LazyVim/LazyVim/commit/6b9f0c0c3c16b39a0764632402707822a084af50))
|
||||
* **telescope:** add `<leader>sS` for `:Telescope lsp_workspace_symbols` ([#309](https://github.com/LazyVim/LazyVim/issues/309)) ([cccdc1c](https://github.com/LazyVim/LazyVim/commit/cccdc1cacfa486edcaf67111aa3c6fd9a626ae1f))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **illuminate:** always set refernce keymaps on the buffer as well to properly overwrite ftplugin mappings. Fixes [#292](https://github.com/LazyVim/LazyVim/issues/292) ([a0cf00c](https://github.com/LazyVim/LazyVim/commit/a0cf00c81b3a4a352cdc26c94112d9a5827881e1))
|
||||
* **mini.surround:** don't create empty keymaps. Fixes [#296](https://github.com/LazyVim/LazyVim/issues/296) ([8e84dcf](https://github.com/LazyVim/LazyVim/commit/8e84dcf85c8a73ebcf6ade6b7b77544f468f1dfa))
|
||||
* **treesitter:** disable indent only for python right now ([de6a28b](https://github.com/LazyVim/LazyVim/commit/de6a28b781e8a06e4f70c913539c97260392131a))
|
||||
* **treesitter:** disable treesitter indent by default, since it has too many issues. See [#297](https://github.com/LazyVim/LazyVim/issues/297) ([329a2da](https://github.com/LazyVim/LazyVim/commit/329a2daff493abd2bd5c8fedbf0dfa13039d3931))
|
||||
|
||||
## [1.11.0](https://github.com/LazyVim/LazyVim/compare/v1.10.0...v1.11.0) (2023-02-17)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **telescope:** add `<leader>sR` for `:Telescope resume` ([#284](https://github.com/LazyVim/LazyVim/issues/284)) ([9edd1a9](https://github.com/LazyVim/LazyVim/commit/9edd1a938f153dfa0c31c38123eabe08d931b5b2))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **lualine:** Add a space separator between progress & location in lualine ([#285](https://github.com/LazyVim/LazyVim/issues/285)) ([78cb3bb](https://github.com/LazyVim/LazyVim/commit/78cb3bb66d45762ba85190b2901360f683a8aa95))
|
||||
|
||||
## [1.10.0](https://github.com/LazyVim/LazyVim/compare/v1.9.4...v1.10.0) (2023-02-16)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **leap:** lazy-load leap/flit and added keymaps ([eccd122](https://github.com/LazyVim/LazyVim/commit/eccd122e6dafae48bbf3c63e9fb3ae1ad4fc47a4))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **treesitter-textobjects:** only disable the textobject plugins/* files when its not enabled in the treesitter opts ([94ebe25](https://github.com/LazyVim/LazyVim/commit/94ebe25ccb296e4342586723acd1d35b8fda8f35))
|
||||
|
||||
## [1.9.4](https://github.com/LazyVim/LazyVim/compare/v1.9.3...v1.9.4) (2023-02-15)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **health:** also check for fdfind instead of just fd. Fixes [#270](https://github.com/LazyVim/LazyVim/issues/270) ([d198a19](https://github.com/LazyVim/LazyVim/commit/d198a193256429e401fbec7fa8ac7a46de06f07b))
|
||||
|
||||
## [1.9.3](https://github.com/LazyVim/LazyVim/compare/v1.9.2...v1.9.3) (2023-02-14)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **notify:** install notify when noice is not enabled ([5d6f0d5](https://github.com/LazyVim/LazyVim/commit/5d6f0d58d5daf2f87ea9f0a49170103925d1b528))
|
||||
* **which-key:** only add noice group when noice is enabled ([38eb3bf](https://github.com/LazyVim/LazyVim/commit/38eb3bf115f1b550e853a04545932fad3fbffe5b))
|
||||
|
||||
## [1.9.2](https://github.com/LazyVim/LazyVim/compare/v1.9.1...v1.9.2) (2023-02-12)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **format:** dont format if client capaibilities disabled it. [#249](https://github.com/LazyVim/LazyVim/issues/249) ([fab6150](https://github.com/LazyVim/LazyVim/commit/fab6150da919a094614752f95f5fe4e7f55832f8))
|
||||
* **format:** nil check ([a3aeb27](https://github.com/LazyVim/LazyVim/commit/a3aeb27cbc2fa1f19d525b97ebb4cc1a56c7c538))
|
||||
|
||||
## [1.9.1](https://github.com/LazyVim/LazyVim/compare/v1.9.0...v1.9.1) (2023-02-12)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **cmp:** added `<c-n>` and `<c-p>` to make it more consistent ([31ad893](https://github.com/LazyVim/LazyVim/commit/31ad893788e0d207a75feaccd61632cdd95b49a0))
|
||||
* **lsp:** temp mason fix for sumenko_lua -> lua_ls rename. See [#248](https://github.com/LazyVim/LazyVim/issues/248) ([5431268](https://github.com/LazyVim/LazyVim/commit/543126818e678509ee9e17836f0e7906146a1002))
|
||||
* **telescope:** make key bindings more consistent for telescope ([151bf12](https://github.com/LazyVim/LazyVim/commit/151bf12a9f9591bd324a359374e6c4a5fb65bbbc))
|
||||
|
||||
## [1.9.0](https://github.com/LazyVim/LazyVim/compare/v1.8.0...v1.9.0) (2023-02-11)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **config:** allow to disable loading of the default keymaps/autocmds/options. Fixes [#238](https://github.com/LazyVim/LazyVim/issues/238) ([6669e63](https://github.com/LazyVim/LazyVim/commit/6669e63368b88430ff574b8f392e8afb6cb434cb))
|
||||
|
||||
## [1.8.0](https://github.com/LazyVim/LazyVim/compare/v1.7.2...v1.8.0) (2023-02-10)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **mini.ai:** added all mini.ai text-objects to which-key ([b96ea66](https://github.com/LazyVim/LazyVim/commit/b96ea665b3056a6a4877de8e8ae6834923a2f415))
|
||||
* **telescope:** improved Telescope mappings in normal and insert mode ([#231](https://github.com/LazyVim/LazyVim/issues/231)) ([fd0a0e8](https://github.com/LazyVim/LazyVim/commit/fd0a0e829d7ea6aa8179b1d1efdf7083a4936c44))
|
||||
|
||||
## [1.7.2](https://github.com/LazyVim/LazyVim/compare/v1.7.1...v1.7.2) (2023-02-09)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **leap:** don't use the x and X mappings in visual mode ([42d2411](https://github.com/LazyVim/LazyVim/commit/42d2411bfa1d6fcc5edc20ee6dbc0dff0f0fba6e))
|
||||
|
||||
## [1.7.1](https://github.com/LazyVim/LazyVim/compare/v1.7.0...v1.7.1) (2023-02-09)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **lsp:** remove debug ([cb384ad](https://github.com/LazyVim/LazyVim/commit/cb384ad69f71e351f6441d535c7757f63a8093ba))
|
||||
|
||||
## [1.7.0](https://github.com/LazyVim/LazyVim/compare/v1.6.0...v1.7.0) (2023-02-09)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **bufferline:** added keymaps to pin and delete non-pinned buffers. See [#218](https://github.com/LazyVim/LazyVim/issues/218) ([3af9155](https://github.com/LazyVim/LazyVim/commit/3af91550be67d9699567727fffcae8aabafc0898))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **lsp:** dont use expr=true for lsp rename. Fixes [#220](https://github.com/LazyVim/LazyVim/issues/220) ([d61e4bd](https://github.com/LazyVim/LazyVim/commit/d61e4bd553b011bb9ec8e01a2f8d2590a6bc9b5e))
|
||||
|
||||
## [1.6.0](https://github.com/LazyVim/LazyVim/compare/v1.5.0...v1.6.0) (2023-02-07)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **lsp:** allow disabling autoformat for certain buffers ([52b34ce](https://github.com/LazyVim/LazyVim/commit/52b34ce3c3e486c7c3012a370651fa289e4647a0))
|
||||
|
||||
## [1.5.0](https://github.com/LazyVim/LazyVim/compare/v1.4.0...v1.5.0) (2023-02-07)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **autocmds:** add groups to autocmds ([#151](https://github.com/LazyVim/LazyVim/issues/151)) ([f57031d](https://github.com/LazyVim/LazyVim/commit/f57031db7ce12ddf21c6a51a22a9370237a729b6))
|
||||
* **trouble:** keymaps for trouble quicklist / loclist ([#171](https://github.com/LazyVim/LazyVim/issues/171)) ([088914e](https://github.com/LazyVim/LazyVim/commit/088914e1dd218f910586c83bdb72fe554c88a6da))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **plugins:** lazy-loading on BufReadPre or BufReadPost, should also use BufNewFile. Fixes [#169](https://github.com/LazyVim/LazyVim/issues/169) ([5f5a564](https://github.com/LazyVim/LazyVim/commit/5f5a564a82a8a9734012c9131f28056524366c6a))
|
||||
|
||||
## [1.4.0](https://github.com/LazyVim/LazyVim/compare/v1.3.4...v1.4.0) (2023-02-07)
|
||||
|
||||
|
||||
|
141
README-CN.md
Normal file
141
README-CN.md
Normal file
@ -0,0 +1,141 @@
|
||||
<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">安装</a>
|
||||
·
|
||||
<a href="https://lazyvim.github.io/configuration">配置</a>
|
||||
·
|
||||
<a href="https://lazyvim.github.io">文档</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 是由 [💤 lazy.nvim](https://github.com/folke/lazy.nvim) 驱动的一套 Neovim 配置,可以轻松自定义和扩展您的配置。
|
||||
不必在从头开始或使用预制发行版之间做选择,
|
||||
LazyVim 提供了两全其美的方式 - 根据需要调整配置的灵活性,以及默认预配置的便利性。
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
## ✨ 特性
|
||||
|
||||
- 🔥 将你的 Neovim 变成一个成熟的 IDE
|
||||
- 💤 使用 [lazy.nvim](https://github.com/folke/lazy.nvim) 轻松自定义和扩展您的配置
|
||||
- 🚀 快如闪电
|
||||
- 🧹 选项、自动命令和键盘映射的合理预设
|
||||
- 📦 预配置了大量插件,随时可用
|
||||
|
||||
## ⚡️ 要求
|
||||
|
||||
- Neovim >= **0.8.0** (需要用 **LuaJIT** 构建)
|
||||
- Git >= **2.19.0** (用于部分克隆支持)
|
||||
- 一个 [Nerd Font](https://www.nerdfonts.com/) 字体 **_(可选)_**
|
||||
|
||||
## 🚀 入门
|
||||
|
||||
您可以在 [此处](https://github.com/LazyVim/starter) 找到 **LazyVim** 的入门模板
|
||||
|
||||
<details><summary>在 Docker 中尝试</summary>
|
||||
|
||||
```sh
|
||||
docker run -w /root -it --rm alpine:edge sh -uelic '
|
||||
apk add git lazygit neovim ripgrep alpine-sdk --update
|
||||
git clone https://github.com/LazyVim/starter ~/.config/nvim
|
||||
cd ~/.config/nvim
|
||||
nvim
|
||||
'
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
<details><summary> 安装 <a href="https://github.com/LazyVim/starter">LazyVim Starter</a></summary>
|
||||
|
||||
- 备份您当前的 Neovim 文件
|
||||
|
||||
```sh
|
||||
mv ~/.config/nvim ~/.config/nvim.bak
|
||||
mv ~/.local/share/nvim ~/.local/share/nvim.bak
|
||||
```
|
||||
|
||||
- 克隆 starter
|
||||
|
||||
```sh
|
||||
git clone https://github.com/LazyVim/starter ~/.config/nvim
|
||||
```
|
||||
|
||||
- 删除 `.git` 文件夹,以便稍后将其添加到您自己的存储库
|
||||
|
||||
```sh
|
||||
rm -rf ~/.config/nvim/.git
|
||||
```
|
||||
|
||||
- 启动 Neovim!
|
||||
|
||||
```sh
|
||||
nvim
|
||||
```
|
||||
|
||||
请参阅文件中有关如何自定义 **LazyVim** 的注释。
|
||||
|
||||
</details>
|
||||
|
||||
---
|
||||
|
||||
[@elijahmanor](https://github.com/elijahmanor) 制作了一段很棒的视频,其中包含入门演练。
|
||||
|
||||
[](https://www.youtube.com/watch?v=N93cTbtLCIM)
|
||||
|
||||
## 📂 文件结构
|
||||
|
||||
config 下的文件会在适当的时候自动加载,所以你不需要手动引入这些文件。
|
||||
**LazyVim** 带有一组默认配置文件,这些文件将在您的配置**之前**加载。
|
||||
看[这里](https://github.com/LazyVim/LazyVim/tree/main/lua/lazyvim/config)
|
||||
|
||||
您可以在 `lua/plugins/` 下添加自定义插件配置(specs)。
|
||||
[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>
|
||||
|
||||
## ⚙️ Configuration
|
||||
|
||||
参考[文档](https://lazyvim.github.io/)
|
101
doc/LazyVim.txt
101
doc/LazyVim.txt
@ -1,4 +1,4 @@
|
||||
*LazyVim.txt* For Neovim >= 0.8.0 Last change: 2023 February 07
|
||||
*LazyVim.txt* For Neovim >= 0.8.0 Last change: 2023 February 28
|
||||
|
||||
==============================================================================
|
||||
Table of Contents *LazyVim-table-of-contents*
|
||||
@ -9,46 +9,29 @@ Table of Contents *LazyVim-table-of-contents*
|
||||
- File Structure |LazyVim-file-structure|
|
||||
- Configuration |LazyVim-configuration|
|
||||
|
||||
<img
|
||||
src="https://user-images.githubusercontent.com/292349/213446185-2db63fd5-8c84-459c-9f04-e286382d6e80.png">
|
||||
|
||||
<hr>
|
||||
|
||||
<h4 align="center">
|
||||
|
||||
<a href="https://lazyvim.github.io/installation">Install</a>
|
||||
Install
|
||||
·
|
||||
<a href="https://lazyvim.github.io/configuration">Configure</a>
|
||||
Configure
|
||||
·
|
||||
<a href="https://lazyvim.github.io">Docs</a>
|
||||
Docs
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h4>
|
||||
|
||||
<div align="center">
|
||||
|
||||
<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 is a Neovim setup powered by lazy.nvim
|
||||
<https://github.com/folke/lazy.nvim> to make it easy to customize and extend
|
||||
@ -57,15 +40,6 @@ using a pre-made distro, LazyVim offers the best of both worlds - the
|
||||
flexibility to tweak your config as needed, along with the convenience of a
|
||||
pre-configured setup.
|
||||
|
||||
<div class="figure">
|
||||
<img src="https://user-images.githubusercontent.com/292349/211285846-0b7bb3bf-0462-4029-b64c-4ee1d037fc1c.png" title="fig:"/>
|
||||
<p class="caption">image</p>
|
||||
</div>
|
||||
|
||||
<div class="figure">
|
||||
<img src="https://user-images.githubusercontent.com/292349/213447056-92290767-ea16-430c-8727-ce994c93e9cc.png" title="fig:"/>
|
||||
<p class="caption">image</p>
|
||||
</div>
|
||||
|
||||
FEATURES *LazyVim-features*
|
||||
|
||||
@ -82,7 +56,7 @@ REQUIREMENTS *LazyVim-requirements*
|
||||
|
||||
- Neovim >= **0.8.0** (needs to be built with **LuaJIT**)
|
||||
- Git >= **2.19.0** (for partial clones support)
|
||||
- a Nerd Font <https://www.nerdfonts.com/> **_(optional)_**
|
||||
- a Nerd Font <https://www.nerdfonts.com/> **(optional)**
|
||||
|
||||
|
||||
GETTING STARTED *LazyVim-getting-started*
|
||||
@ -90,7 +64,7 @@ GETTING STARTED *LazyVim-getting-started*
|
||||
You can find a starter template for **LazyVim** here
|
||||
<https://github.com/LazyVim/starter>
|
||||
|
||||
Try it with Docker
|
||||
Try it with Docker ~
|
||||
|
||||
>sh
|
||||
docker run -w /root -it --rm alpine:edge sh -uelic '
|
||||
@ -101,8 +75,7 @@ Try it with Docker
|
||||
'
|
||||
<
|
||||
|
||||
|
||||
Install the <a href="https://github.com/LazyVim/starter">LazyVim Starter</a>
|
||||
Install the LazyVim Starter ~
|
||||
|
||||
|
||||
- Make a backup of your current Neovim files:
|
||||
@ -124,44 +97,36 @@ Install the <a href="https://github.com/LazyVim/starter">LazyVim Starter</a>
|
||||
<
|
||||
Refer to the comments in the files on how to customize **LazyVim**.
|
||||
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
There’s a great video created by @elijahmanor
|
||||
<https://github.com/elijahmanor> with a walkthrough to get started.
|
||||
|
||||
There’s a great video created by elijahmano <https://github.com/elijahmanor>
|
||||
with a walkthrough to get started.
|
||||
|
||||
<img src='https://img.youtube.com/vi/N93cTbtLCIM/hqdefault.jpg' title=''/>
|
||||
<https://www.youtube.com/watch?v=N93cTbtLCIM>
|
||||
|
||||
|
||||
FILE STRUCTURE *LazyVim-file-structure*
|
||||
|
||||
The files under config will be automatically loaded at the appropriate time, so
|
||||
you don’t need to require those files manually. **LazyVim** comes with a set
|
||||
of default config files that will be loaded **_before_** your own. See here
|
||||
of default config files that will be loaded **before** your own. See here
|
||||
<https://github.com/LazyVim/LazyVim/tree/main/lua/lazyvim/config>
|
||||
|
||||
You can add your custom plugin specs under `lua/plugins/`. All files there will
|
||||
be automatically loaded by lazy.nvim <https://github.com/folke/lazy.nvim>
|
||||
|
||||
<pre>
|
||||
~/.config/nvim
|
||||
lua
|
||||
config
|
||||
autocmds.lua
|
||||
keymaps.lua
|
||||
lazy.lua
|
||||
options.lua
|
||||
plugins
|
||||
spec1.lua
|
||||
|
||||
spec2.lua
|
||||
init.lua
|
||||
</pre>
|
||||
|
||||
CONFIGURATION *LazyVim-configuration*
|
||||
|
||||
Refer to the docs <https://lazyvim.github.io>
|
||||
|
||||
==============================================================================
|
||||
1. Links *LazyVim-links*
|
||||
|
||||
1. *image*: https://user-images.githubusercontent.com/292349/211285846-0b7bb3bf-0462-4029-b64c-4ee1d037fc1c.png
|
||||
2. *image*: https://user-images.githubusercontent.com/292349/213447056-92290767-ea16-430c-8727-ce994c93e9cc.png
|
||||
3. *@elijahmanor*:
|
||||
4. *Watch the video*: https://img.youtube.com/vi/N93cTbtLCIM/hqdefault.jpg
|
||||
|
||||
Generated by panvimdoc <https://github.com/kdheepak/panvimdoc>
|
||||
|
||||
vim:tw=78:ts=8:noet:ft=help:norl:
|
||||
|
@ -1,10 +1,18 @@
|
||||
-- This file is automatically loaded by plugins.init
|
||||
|
||||
local function augroup(name)
|
||||
return vim.api.nvim_create_augroup("lazyvim_" .. name, { clear = true })
|
||||
end
|
||||
|
||||
-- Check if we need to reload the file when it changed
|
||||
vim.api.nvim_create_autocmd({ "FocusGained", "TermClose", "TermLeave" }, { command = "checktime" })
|
||||
vim.api.nvim_create_autocmd({ "FocusGained", "TermClose", "TermLeave" }, {
|
||||
group = augroup("checktime"),
|
||||
command = "checktime",
|
||||
})
|
||||
|
||||
-- Highlight on yank
|
||||
vim.api.nvim_create_autocmd("TextYankPost", {
|
||||
group = augroup("highlight_yank"),
|
||||
callback = function()
|
||||
vim.highlight.on_yank()
|
||||
end,
|
||||
@ -12,6 +20,7 @@ vim.api.nvim_create_autocmd("TextYankPost", {
|
||||
|
||||
-- resize splits if window got resized
|
||||
vim.api.nvim_create_autocmd({ "VimResized" }, {
|
||||
group = augroup("resize_splits"),
|
||||
callback = function()
|
||||
vim.cmd("tabdo wincmd =")
|
||||
end,
|
||||
@ -19,6 +28,7 @@ vim.api.nvim_create_autocmd({ "VimResized" }, {
|
||||
|
||||
-- go to last loc when opening a buffer
|
||||
vim.api.nvim_create_autocmd("BufReadPost", {
|
||||
group = augroup("last_loc"),
|
||||
callback = function()
|
||||
local mark = vim.api.nvim_buf_get_mark(0, '"')
|
||||
local lcount = vim.api.nvim_buf_line_count(0)
|
||||
@ -30,6 +40,7 @@ vim.api.nvim_create_autocmd("BufReadPost", {
|
||||
|
||||
-- close some filetypes with <q>
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
group = augroup("close_with_q"),
|
||||
pattern = {
|
||||
"qf",
|
||||
"help",
|
||||
@ -47,7 +58,9 @@ vim.api.nvim_create_autocmd("FileType", {
|
||||
end,
|
||||
})
|
||||
|
||||
-- wrap and check for spell in text filetypes
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
group = augroup("wrap_spell"),
|
||||
pattern = { "gitcommit", "markdown" },
|
||||
callback = function()
|
||||
vim.opt_local.wrap = true
|
||||
|
@ -10,6 +10,12 @@ local defaults = {
|
||||
colorscheme = function()
|
||||
require("tokyonight").load()
|
||||
end,
|
||||
-- load the default settings
|
||||
defaults = {
|
||||
autocmds = true, -- lazyvim.config.autocmds
|
||||
keymaps = true, -- lazyvim.config.keymaps
|
||||
options = true, -- lazyvim.config.options
|
||||
},
|
||||
-- icons used by other plugins
|
||||
icons = {
|
||||
diagnostics = {
|
||||
@ -120,8 +126,7 @@ end
|
||||
---@param name "autocmds" | "options" | "keymaps"
|
||||
function M.load(name)
|
||||
local Util = require("lazy.core.util")
|
||||
-- always load lazyvim, then user file
|
||||
for _, mod in ipairs({ "lazyvim.config." .. name, "config." .. name }) do
|
||||
local function _load(mod)
|
||||
Util.try(function()
|
||||
require(mod)
|
||||
end, {
|
||||
@ -134,6 +139,11 @@ function M.load(name)
|
||||
end,
|
||||
})
|
||||
end
|
||||
-- always load lazyvim, then user file
|
||||
if M.defaults[name] then
|
||||
_load("lazyvim.config." .. name)
|
||||
end
|
||||
_load("config." .. name)
|
||||
if vim.bo.filetype == "lazy" then
|
||||
-- HACK: LazyVim may have overwritten options of the Lazy ui, so reset this here
|
||||
vim.cmd([[do VimResized]])
|
||||
|
@ -64,8 +64,7 @@ map(
|
||||
{ desc = "Redraw / clear hlsearch / diff update" }
|
||||
)
|
||||
|
||||
map("n", "gw", "*N")
|
||||
map("x", "gw", "*N")
|
||||
map({ "n", "x" }, "gw", "*N", { desc = "Search word under cursor" })
|
||||
|
||||
-- https://github.com/mhinz/vim-galore#saner-behavior-of-n-and-n
|
||||
map("n", "n", "'Nn'[v:searchforward]", { expr = true, desc = "Next search result" })
|
||||
@ -93,8 +92,13 @@ map("n", "<leader>l", "<cmd>:Lazy<cr>", { desc = "Lazy" })
|
||||
-- new file
|
||||
map("n", "<leader>fn", "<cmd>enew<cr>", { desc = "New File" })
|
||||
|
||||
map("n", "<leader>xl", "<cmd>lopen<cr>", { desc = "Open Location List" })
|
||||
map("n", "<leader>xq", "<cmd>copen<cr>", { desc = "Open Quickfix List" })
|
||||
map("n", "<leader>xl", "<cmd>lopen<cr>", { desc = "Location List" })
|
||||
map("n", "<leader>xq", "<cmd>copen<cr>", { desc = "Quickfix List" })
|
||||
|
||||
if not Util.has("trouble.nvim") then
|
||||
map("n", "[q", vim.cmd.cprev, { desc = "Previous quickfix" })
|
||||
map("n", "]q", vim.cmd.cnext, { desc = "Next quickfix" })
|
||||
end
|
||||
|
||||
-- stylua: ignore start
|
||||
|
||||
|
@ -9,11 +9,23 @@ function M.check()
|
||||
vim.health.report_error("Neovim >= 0.8.0 is required")
|
||||
end
|
||||
|
||||
for _, cmd in ipairs({ "git", "rg", "fd", "lazygit" }) do
|
||||
if vim.fn.executable(cmd) == 1 then
|
||||
vim.health.report_ok(("`%s` is installed"):format(cmd))
|
||||
for _, cmd in ipairs({ "git", "rg", { "fd", "fdfind" }, "lazygit" }) do
|
||||
local name = type(cmd) == "string" and cmd or vim.inspect(cmd)
|
||||
local commands = type(cmd) == "string" and { cmd } or cmd
|
||||
---@cast commands string[]
|
||||
local found = false
|
||||
|
||||
for _, c in ipairs(commands) do
|
||||
if vim.fn.executable(c) == 1 then
|
||||
name = c
|
||||
found = true
|
||||
end
|
||||
end
|
||||
|
||||
if found then
|
||||
vim.health.report_ok(("`%s` is installed"):format(name))
|
||||
else
|
||||
vim.health.report_warn(("`%s` is not installed"):format(cmd))
|
||||
vim.health.report_warn(("`%s` is not installed"):format(name))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -3,6 +3,7 @@ return {
|
||||
-- snippets
|
||||
{
|
||||
"L3MON4D3/LuaSnip",
|
||||
build = "make install_jsregexp",
|
||||
dependencies = {
|
||||
"rafamadriz/friendly-snippets",
|
||||
config = function()
|
||||
@ -50,6 +51,8 @@ return {
|
||||
end,
|
||||
},
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
["<C-n>"] = cmp.mapping.select_next_item({ behavior = cmp.SelectBehavior.Insert }),
|
||||
["<C-p>"] = cmp.mapping.select_prev_item({ behavior = cmp.SelectBehavior.Insert }),
|
||||
["<C-b>"] = cmp.mapping.scroll_docs(-4),
|
||||
["<C-f>"] = cmp.mapping.scroll_docs(4),
|
||||
["<C-Space>"] = cmp.mapping.complete(),
|
||||
@ -105,6 +108,9 @@ return {
|
||||
{ opts.mappings.replace, desc = "Replace surrounding" },
|
||||
{ opts.mappings.update_n_lines, desc = "Update `MiniSurround.config.n_lines`" },
|
||||
}
|
||||
mappings = vim.tbl_filter(function(m)
|
||||
return m[1] and #m[1] > 0
|
||||
end, mappings)
|
||||
return vim.list_extend(mappings, keys)
|
||||
end,
|
||||
opts = {
|
||||
@ -149,15 +155,7 @@ return {
|
||||
-- { "i", mode = { "x", "o" } },
|
||||
-- },
|
||||
event = "VeryLazy",
|
||||
dependencies = {
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter-textobjects",
|
||||
init = function()
|
||||
-- no need to load the plugin, since we only need its queries
|
||||
require("lazy.core.loader").disable_rtp_plugin("nvim-treesitter-textobjects")
|
||||
end,
|
||||
},
|
||||
},
|
||||
dependencies = { "nvim-treesitter-textobjects" },
|
||||
opts = function()
|
||||
local ai = require("mini.ai")
|
||||
return {
|
||||
@ -173,8 +171,50 @@ return {
|
||||
}
|
||||
end,
|
||||
config = function(_, opts)
|
||||
local ai = require("mini.ai")
|
||||
ai.setup(opts)
|
||||
require("mini.ai").setup(opts)
|
||||
-- register all text objects with which-key
|
||||
if require("lazyvim.util").has("which-key.nvim") then
|
||||
---@type table<string, string|table>
|
||||
local i = {
|
||||
[" "] = "Whitespace",
|
||||
['"'] = 'Balanced "',
|
||||
["'"] = "Balanced '",
|
||||
["`"] = "Balanced `",
|
||||
["("] = "Balanced (",
|
||||
[")"] = "Balanced ) including white-space",
|
||||
[">"] = "Balanced > including white-space",
|
||||
["<lt>"] = "Balanced <",
|
||||
["]"] = "Balanced ] including white-space",
|
||||
["["] = "Balanced [",
|
||||
["}"] = "Balanced } including white-space",
|
||||
["{"] = "Balanced {",
|
||||
["?"] = "User Prompt",
|
||||
_ = "Underscore",
|
||||
a = "Argument",
|
||||
b = "Balanced ), ], }",
|
||||
c = "Class",
|
||||
f = "Function",
|
||||
o = "Block, conditional, loop",
|
||||
q = "Quote `, \", '",
|
||||
t = "Tag",
|
||||
}
|
||||
local a = vim.deepcopy(i)
|
||||
for k, v in pairs(a) do
|
||||
a[k] = v:gsub(" including.*", "")
|
||||
end
|
||||
|
||||
local ic = vim.deepcopy(i)
|
||||
local ac = vim.deepcopy(a)
|
||||
for key, name in pairs({ n = "Next", l = "Last" }) do
|
||||
i[key] = vim.tbl_extend("force", { name = "Inside " .. name .. " textobject" }, ic)
|
||||
a[key] = vim.tbl_extend("force", { name = "Around " .. name .. " textobject" }, ac)
|
||||
end
|
||||
require("which-key").register({
|
||||
mode = { "o", "x" },
|
||||
i = i,
|
||||
a = a,
|
||||
})
|
||||
end
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
@ -90,6 +90,7 @@ return {
|
||||
{ "<leader>sM", "<cmd>Telescope man_pages<cr>", desc = "Man Pages" },
|
||||
{ "<leader>sm", "<cmd>Telescope marks<cr>", desc = "Jump to Mark" },
|
||||
{ "<leader>so", "<cmd>Telescope vim_options<cr>", desc = "Options" },
|
||||
{ "<leader>sR", "<cmd>Telescope resume<cr>", desc = "Resume" },
|
||||
{ "<leader>sw", Util.telescope("grep_string"), desc = "Word (root dir)" },
|
||||
{ "<leader>sW", Util.telescope("grep_string", { cwd = false }), desc = "Word (cwd)" },
|
||||
{ "<leader>uC", Util.telescope("colorscheme", { enable_preview = true }), desc = "Colorscheme with preview" },
|
||||
@ -111,6 +112,24 @@ return {
|
||||
}),
|
||||
desc = "Goto Symbol",
|
||||
},
|
||||
{
|
||||
"<leader>sS",
|
||||
Util.telescope("lsp_workspace_symbols", {
|
||||
symbols = {
|
||||
"Class",
|
||||
"Function",
|
||||
"Method",
|
||||
"Constructor",
|
||||
"Interface",
|
||||
"Module",
|
||||
"Struct",
|
||||
"Trait",
|
||||
"Field",
|
||||
"Property",
|
||||
},
|
||||
}),
|
||||
desc = "Goto Symbol (Workspace)",
|
||||
},
|
||||
},
|
||||
opts = {
|
||||
defaults = {
|
||||
@ -133,6 +152,17 @@ return {
|
||||
["<C-Up>"] = function(...)
|
||||
return require("telescope.actions").cycle_history_prev(...)
|
||||
end,
|
||||
["<C-f>"] = function(...)
|
||||
return require("telescope.actions").preview_scrolling_down(...)
|
||||
end,
|
||||
["<C-b>"] = function(...)
|
||||
return require("telescope.actions").preview_scrolling_up(...)
|
||||
end,
|
||||
},
|
||||
n = {
|
||||
["q"] = function(...)
|
||||
return require("telescope.actions").close(...)
|
||||
end,
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -140,16 +170,38 @@ return {
|
||||
},
|
||||
|
||||
-- easily jump to any location and enhanced f/t motions for Leap
|
||||
{
|
||||
"echasnovski/mini.jump",
|
||||
keys = function()
|
||||
---@type LazyKeys[]
|
||||
local ret = {}
|
||||
for _, key in ipairs({ "f", "F", "t", "T" }) do
|
||||
ret[#ret + 1] = { key, mode = { "n", "x", "o" }, desc = key }
|
||||
end
|
||||
return ret
|
||||
end,
|
||||
opts = {
|
||||
delay = {
|
||||
idle_stop = 3000,
|
||||
},
|
||||
},
|
||||
main = "mini.jump",
|
||||
},
|
||||
{
|
||||
"ggandor/leap.nvim",
|
||||
event = "VeryLazy",
|
||||
dependencies = { { "ggandor/flit.nvim", opts = { labeled_modes = "nv" } } },
|
||||
keys = {
|
||||
{ "s", mode = { "n", "x", "o" }, desc = "Leap forward to" },
|
||||
{ "S", mode = { "n", "x", "o" }, desc = "Leap backward to" },
|
||||
{ "gs", mode = { "n", "x", "o" }, desc = "Leap from windows" },
|
||||
},
|
||||
config = function(_, opts)
|
||||
local leap = require("leap")
|
||||
for k, v in pairs(opts) do
|
||||
leap.opts[k] = v
|
||||
end
|
||||
leap.add_default_mappings(true)
|
||||
vim.keymap.del({ "x", "o" }, "x")
|
||||
vim.keymap.del({ "x", "o" }, "X")
|
||||
end,
|
||||
},
|
||||
|
||||
@ -163,7 +215,7 @@ return {
|
||||
config = function(_, opts)
|
||||
local wk = require("which-key")
|
||||
wk.setup(opts)
|
||||
wk.register({
|
||||
local keymaps = {
|
||||
mode = { "n", "v" },
|
||||
["g"] = { name = "+goto" },
|
||||
["gz"] = { name = "+surround" },
|
||||
@ -177,24 +229,27 @@ return {
|
||||
["<leader>gh"] = { name = "+hunks" },
|
||||
["<leader>q"] = { name = "+quit/session" },
|
||||
["<leader>s"] = { name = "+search" },
|
||||
["<leader>sn"] = { name = "+noice" },
|
||||
["<leader>u"] = { name = "+ui" },
|
||||
["<leader>w"] = { name = "+windows" },
|
||||
["<leader>x"] = { name = "+diagnostics/quickfix" },
|
||||
})
|
||||
}
|
||||
if Util.has("noice.nvim") then
|
||||
keymaps["<leader>sn"] = { name = "+noice" }
|
||||
end
|
||||
wk.register(keymaps)
|
||||
end,
|
||||
},
|
||||
|
||||
-- git signs
|
||||
{
|
||||
"lewis6991/gitsigns.nvim",
|
||||
event = "BufReadPre",
|
||||
event = { "BufReadPre", "BufNewFile" },
|
||||
opts = {
|
||||
signs = {
|
||||
add = { text = "▎" },
|
||||
change = { text = "▎" },
|
||||
delete = { text = "契" },
|
||||
topdelete = { text = "契" },
|
||||
delete = { text = "" },
|
||||
topdelete = { text = "" },
|
||||
changedelete = { text = "▎" },
|
||||
untracked = { text = "▎" },
|
||||
},
|
||||
@ -225,22 +280,32 @@ return {
|
||||
-- references
|
||||
{
|
||||
"RRethy/vim-illuminate",
|
||||
event = "BufReadPost",
|
||||
event = { "BufReadPost", "BufNewFile" },
|
||||
opts = { delay = 200 },
|
||||
config = function(_, opts)
|
||||
require("illuminate").configure(opts)
|
||||
|
||||
local function map(key, dir, buffer)
|
||||
vim.keymap.set("n", key, function()
|
||||
require("illuminate")["goto_" .. dir .. "_reference"](false)
|
||||
end, { desc = dir:sub(1, 1):upper() .. dir:sub(2) .. " Reference", buffer = buffer })
|
||||
end
|
||||
|
||||
map("]]", "next")
|
||||
map("[[", "prev")
|
||||
|
||||
-- also set it after loading ftplugins, since a lot overwrite [[ and ]]
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
callback = function()
|
||||
local buffer = vim.api.nvim_get_current_buf()
|
||||
pcall(vim.keymap.del, "n", "]]", { buffer = buffer })
|
||||
pcall(vim.keymap.del, "n", "[[", { buffer = buffer })
|
||||
map("]]", "next", buffer)
|
||||
map("[[", "prev", buffer)
|
||||
end,
|
||||
})
|
||||
end,
|
||||
-- stylua: ignore
|
||||
keys = {
|
||||
{ "]]", function() require("illuminate").goto_next_reference(false) end, desc = "Next Reference", },
|
||||
{ "[[", function() require("illuminate").goto_prev_reference(false) end, desc = "Prev Reference" },
|
||||
{ "]]", desc = "Next Reference" },
|
||||
{ "[[", desc = "Prev Reference" },
|
||||
},
|
||||
},
|
||||
|
||||
@ -262,6 +327,30 @@ return {
|
||||
keys = {
|
||||
{ "<leader>xx", "<cmd>TroubleToggle document_diagnostics<cr>", desc = "Document Diagnostics (Trouble)" },
|
||||
{ "<leader>xX", "<cmd>TroubleToggle workspace_diagnostics<cr>", desc = "Workspace Diagnostics (Trouble)" },
|
||||
{ "<leader>xL", "<cmd>TroubleToggle loclist<cr>", desc = "Location List (Trouble)" },
|
||||
{ "<leader>xQ", "<cmd>TroubleToggle quickfix<cr>", desc = "Quickfix List (Trouble)" },
|
||||
{
|
||||
"[q",
|
||||
function()
|
||||
if require("trouble").is_open() then
|
||||
require("trouble").previous({ skip_groups = true, jump = true })
|
||||
else
|
||||
vim.cmd.cprev()
|
||||
end
|
||||
end,
|
||||
desc = "Previous trouble/quickfix item",
|
||||
},
|
||||
{
|
||||
"]q",
|
||||
function()
|
||||
if require("trouble").is_open() then
|
||||
require("trouble").next({ skip_groups = true, jump = true })
|
||||
else
|
||||
vim.cmd.cnext()
|
||||
end
|
||||
end,
|
||||
desc = "Next trouble/quickfix item",
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
@ -269,7 +358,7 @@ return {
|
||||
{
|
||||
"folke/todo-comments.nvim",
|
||||
cmd = { "TodoTrouble", "TodoTelescope" },
|
||||
event = "BufReadPost",
|
||||
event = { "BufReadPost", "BufNewFile" },
|
||||
config = true,
|
||||
-- stylua: ignore
|
||||
keys = {
|
||||
|
@ -5,7 +5,12 @@ local M = {}
|
||||
M.autoformat = true
|
||||
|
||||
function M.toggle()
|
||||
M.autoformat = not M.autoformat
|
||||
if vim.b.autoformat == false then
|
||||
vim.b.autoformat = nil
|
||||
M.autoformat = true
|
||||
else
|
||||
M.autoformat = not M.autoformat
|
||||
end
|
||||
if M.autoformat then
|
||||
Util.info("Enabled format on save", { title = "Format" })
|
||||
else
|
||||
@ -15,6 +20,9 @@ end
|
||||
|
||||
function M.format()
|
||||
local buf = vim.api.nvim_get_current_buf()
|
||||
if vim.b.autoformat == false then
|
||||
return
|
||||
end
|
||||
local ft = vim.bo[buf].filetype
|
||||
local have_nls = #require("null-ls.sources").get_available(ft, "NULL_LS_FORMATTING") > 0
|
||||
|
||||
@ -30,6 +38,15 @@ function M.format()
|
||||
end
|
||||
|
||||
function M.on_attach(client, buf)
|
||||
-- dont format if client disabled it
|
||||
if
|
||||
client.config
|
||||
and client.config.capabilities
|
||||
and client.config.capabilities.documentFormattingProvider == false
|
||||
then
|
||||
return
|
||||
end
|
||||
|
||||
if client.supports_method("textDocument/formatting") then
|
||||
vim.api.nvim_create_autocmd("BufWritePre", {
|
||||
group = vim.api.nvim_create_augroup("LspFormat." .. buf, {}),
|
||||
|
@ -2,7 +2,7 @@ return {
|
||||
-- lspconfig
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
event = "BufReadPre",
|
||||
event = { "BufReadPre", "BufNewFile" },
|
||||
dependencies = {
|
||||
{ "folke/neoconf.nvim", cmd = "Neoconf", config = true },
|
||||
{ "folke/neodev.nvim", opts = { experimental = { pathStrict = true } } },
|
||||
@ -28,7 +28,7 @@ return {
|
||||
autoformat = true,
|
||||
-- options for vim.lsp.buf.format
|
||||
-- `bufnr` and `filter` is handled by the LazyVim formatter,
|
||||
-- but can be also overriden when specified
|
||||
-- but can be also overridden when specified
|
||||
format = {
|
||||
formatting_options = nil,
|
||||
timeout_ms = nil,
|
||||
@ -37,7 +37,7 @@ return {
|
||||
---@type lspconfig.options
|
||||
servers = {
|
||||
jsonls = {},
|
||||
sumneko_lua = {
|
||||
lua_ls = {
|
||||
-- mason = false, -- set to false if you don't want this server to be installed with mason
|
||||
settings = {
|
||||
Lua = {
|
||||
@ -101,6 +101,14 @@ return {
|
||||
require("lspconfig")[server].setup(server_opts)
|
||||
end
|
||||
|
||||
-- temp fix for lspconfig rename
|
||||
-- https://github.com/neovim/nvim-lspconfig/pull/2439
|
||||
local mappings = require("mason-lspconfig.mappings.server")
|
||||
if not mappings.lspconfig_to_package.lua_ls then
|
||||
mappings.lspconfig_to_package.lua_ls = "lua-language-server"
|
||||
mappings.package_to_lspconfig["lua-language-server"] = "lua_ls"
|
||||
end
|
||||
|
||||
local mlsp = require("mason-lspconfig")
|
||||
local available = mlsp.get_available_servers()
|
||||
|
||||
@ -125,7 +133,7 @@ return {
|
||||
-- formatters
|
||||
{
|
||||
"jose-elias-alvarez/null-ls.nvim",
|
||||
event = "BufReadPre",
|
||||
event = { "BufReadPre", "BufNewFile" },
|
||||
dependencies = { "mason.nvim" },
|
||||
opts = function()
|
||||
local nls = require("null-ls")
|
||||
|
@ -6,30 +6,45 @@ M._keys = nil
|
||||
---@return (LazyKeys|{has?:string})[]
|
||||
function M.get()
|
||||
local format = require("lazyvim.plugins.lsp.format").format
|
||||
if not M._keys then
|
||||
---@class PluginLspKeys
|
||||
-- stylua: ignore
|
||||
M._keys = M._keys or {
|
||||
{ "<leader>cd", vim.diagnostic.open_float, desc = "Line Diagnostics" },
|
||||
{ "<leader>cl", "<cmd>LspInfo<cr>", desc = "Lsp Info" },
|
||||
{ "gd", "<cmd>Telescope lsp_definitions<cr>", desc = "Goto Definition" },
|
||||
{ "gr", "<cmd>Telescope lsp_references<cr>", desc = "References" },
|
||||
{ "gD", vim.lsp.buf.declaration, desc = "Goto Declaration" },
|
||||
{ "gI", "<cmd>Telescope lsp_implementations<cr>", desc = "Goto Implementation" },
|
||||
{ "gt", "<cmd>Telescope lsp_type_definitions<cr>", desc = "Goto Type Definition" },
|
||||
{ "K", vim.lsp.buf.hover, desc = "Hover" },
|
||||
{ "gK", vim.lsp.buf.signature_help, desc = "Signature Help", has = "signatureHelp" },
|
||||
{ "<c-k>", vim.lsp.buf.signature_help, mode = "i", desc = "Signature Help", has = "signatureHelp" },
|
||||
{ "]d", M.diagnostic_goto(true), desc = "Next Diagnostic" },
|
||||
{ "[d", M.diagnostic_goto(false), desc = "Prev Diagnostic" },
|
||||
{ "]e", M.diagnostic_goto(true, "ERROR"), desc = "Next Error" },
|
||||
{ "[e", M.diagnostic_goto(false, "ERROR"), desc = "Prev Error" },
|
||||
{ "]w", M.diagnostic_goto(true, "WARN"), desc = "Next Warning" },
|
||||
{ "[w", M.diagnostic_goto(false, "WARN"), desc = "Prev Warning" },
|
||||
{ "<leader>ca", vim.lsp.buf.code_action, desc = "Code Action", mode = { "n", "v" }, has = "codeAction" },
|
||||
{ "<leader>cf", format, desc = "Format Document", has = "documentFormatting" },
|
||||
{ "<leader>cf", format, desc = "Format Range", mode = "v", has = "documentRangeFormatting" },
|
||||
{ "<leader>cr", M.rename, expr = true, desc = "Rename", has = "rename" },
|
||||
}
|
||||
-- stylua: ignore
|
||||
M._keys = {
|
||||
{ "<leader>cd", vim.diagnostic.open_float, desc = "Line Diagnostics" },
|
||||
{ "<leader>cl", "<cmd>LspInfo<cr>", desc = "Lsp Info" },
|
||||
{ "gd", "<cmd>Telescope lsp_definitions<cr>", desc = "Goto Definition", has = "definition" },
|
||||
{ "gr", "<cmd>Telescope lsp_references<cr>", desc = "References" },
|
||||
{ "gD", vim.lsp.buf.declaration, desc = "Goto Declaration" },
|
||||
{ "gI", "<cmd>Telescope lsp_implementations<cr>", desc = "Goto Implementation" },
|
||||
{ "gt", "<cmd>Telescope lsp_type_definitions<cr>", desc = "Goto Type Definition" },
|
||||
{ "K", vim.lsp.buf.hover, desc = "Hover" },
|
||||
{ "gK", vim.lsp.buf.signature_help, desc = "Signature Help", has = "signatureHelp" },
|
||||
{ "<c-k>", vim.lsp.buf.signature_help, mode = "i", desc = "Signature Help", has = "signatureHelp" },
|
||||
{ "]d", M.diagnostic_goto(true), desc = "Next Diagnostic" },
|
||||
{ "[d", M.diagnostic_goto(false), desc = "Prev Diagnostic" },
|
||||
{ "]e", M.diagnostic_goto(true, "ERROR"), desc = "Next Error" },
|
||||
{ "[e", M.diagnostic_goto(false, "ERROR"), desc = "Prev Error" },
|
||||
{ "]w", M.diagnostic_goto(true, "WARN"), desc = "Next Warning" },
|
||||
{ "[w", M.diagnostic_goto(false, "WARN"), desc = "Prev Warning" },
|
||||
{ "<leader>ca", vim.lsp.buf.code_action, desc = "Code Action", mode = { "n", "v" }, has = "codeAction" },
|
||||
{ "<leader>cf", format, desc = "Format Document", has = "documentFormatting" },
|
||||
{ "<leader>cf", format, desc = "Format Range", mode = "v", has = "documentRangeFormatting" },
|
||||
}
|
||||
if require("lazyvim.util").has("inc-rename.nvim") then
|
||||
M._keys[#M._keys + 1] = {
|
||||
"<leader>cr",
|
||||
function()
|
||||
require("inc_rename")
|
||||
return ":IncRename " .. vim.fn.expand("<cword>")
|
||||
end,
|
||||
expr = true,
|
||||
desc = "Rename",
|
||||
has = "rename",
|
||||
}
|
||||
else
|
||||
M._keys[#M._keys + 1] = { "<leader>cr", vim.lsp.buf.rename, desc = "Rename", has = "rename" }
|
||||
end
|
||||
end
|
||||
return M._keys
|
||||
end
|
||||
|
||||
@ -58,14 +73,6 @@ function M.on_attach(client, buffer)
|
||||
end
|
||||
end
|
||||
|
||||
function M.rename()
|
||||
if pcall(require, "inc_rename") then
|
||||
return ":IncRename " .. vim.fn.expand("<cword>")
|
||||
else
|
||||
vim.lsp.buf.rename()
|
||||
end
|
||||
end
|
||||
|
||||
function M.diagnostic_goto(next, severity)
|
||||
local go = next and vim.diagnostic.goto_next or vim.diagnostic.goto_prev
|
||||
severity = severity and vim.diagnostic.severity[severity] or nil
|
||||
|
@ -3,7 +3,29 @@ return {
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
version = false, -- last release is way too old and doesn't work on Windows
|
||||
build = ":TSUpdate",
|
||||
event = "BufReadPost",
|
||||
event = { "BufReadPost", "BufNewFile" },
|
||||
dependencies = {
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter-textobjects",
|
||||
init = function()
|
||||
-- PERF: no need to load the plugin, if we only need its queries for mini.ai
|
||||
local plugin = require("lazy.core.config").spec.plugins["nvim-treesitter"]
|
||||
local opts = require("lazy.core.plugin").values(plugin, "opts", false)
|
||||
local enabled = false
|
||||
if opts.textobjects then
|
||||
for _, mod in ipairs({ "move", "select", "swap", "lsp_interop" }) do
|
||||
if opts.textobjects[mod] and opts.textobjects[mod].enable then
|
||||
enabled = true
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
if not enabled then
|
||||
require("lazy.core.loader").disable_rtp_plugin("nvim-treesitter-textobjects")
|
||||
end
|
||||
end,
|
||||
},
|
||||
},
|
||||
keys = {
|
||||
{ "<c-space>", desc = "Increment selection" },
|
||||
{ "<bs>", desc = "Schrink selection", mode = "x" },
|
||||
@ -11,10 +33,11 @@ return {
|
||||
---@type TSConfig
|
||||
opts = {
|
||||
highlight = { enable = true },
|
||||
indent = { enable = true },
|
||||
indent = { enable = true, disable = { "python" } },
|
||||
context_commentstring = { enable = true, enable_autocmd = false },
|
||||
ensure_installed = {
|
||||
"bash",
|
||||
"c",
|
||||
"help",
|
||||
"html",
|
||||
"javascript",
|
||||
|
@ -20,6 +20,15 @@ return {
|
||||
return math.floor(vim.o.columns * 0.75)
|
||||
end,
|
||||
},
|
||||
init = function()
|
||||
-- when noice is not enabled, install notify on VeryLazy
|
||||
local Util = require("lazyvim.util")
|
||||
if not Util.has("noice.nvim") then
|
||||
Util.on_very_lazy(function()
|
||||
vim.notify = require("notify")
|
||||
end)
|
||||
end
|
||||
end,
|
||||
},
|
||||
|
||||
-- better vim.ui
|
||||
@ -44,6 +53,10 @@ return {
|
||||
{
|
||||
"akinsho/bufferline.nvim",
|
||||
event = "VeryLazy",
|
||||
keys = {
|
||||
{ "<leader>bp", "<Cmd>BufferLineTogglePin<CR>", desc = "Toggle pin" },
|
||||
{ "<leader>bP", "<Cmd>BufferLineGroupClose ungrouped<CR>", desc = "Delete non-pinned buffers" },
|
||||
},
|
||||
opts = {
|
||||
options = {
|
||||
diagnostics = "nvim_lsp",
|
||||
@ -132,7 +145,7 @@ return {
|
||||
},
|
||||
},
|
||||
lualine_y = {
|
||||
{ "progress", separator = "", padding = { left = 1, right = 0 } },
|
||||
{ "progress", separator = " ", padding = { left = 1, right = 0 } },
|
||||
{ "location", padding = { left = 0, right = 1 } },
|
||||
},
|
||||
lualine_z = {
|
||||
@ -149,7 +162,7 @@ return {
|
||||
-- indent guides for Neovim
|
||||
{
|
||||
"lukas-reineke/indent-blankline.nvim",
|
||||
event = "BufReadPost",
|
||||
event = { "BufReadPost", "BufNewFile" },
|
||||
opts = {
|
||||
-- char = "▏",
|
||||
char = "│",
|
||||
@ -163,19 +176,21 @@ return {
|
||||
{
|
||||
"echasnovski/mini.indentscope",
|
||||
version = false, -- wait till new 0.7.0 release to put it back on semver
|
||||
event = "BufReadPre",
|
||||
event = { "BufReadPre", "BufNewFile" },
|
||||
opts = {
|
||||
-- symbol = "▏",
|
||||
symbol = "│",
|
||||
options = { try_as_border = true },
|
||||
},
|
||||
config = function(_, opts)
|
||||
init = function()
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
pattern = { "help", "alpha", "dashboard", "neo-tree", "Trouble", "lazy", "mason" },
|
||||
callback = function()
|
||||
vim.b.miniindentscope_disable = true
|
||||
end,
|
||||
})
|
||||
end,
|
||||
config = function(_, opts)
|
||||
require("mini.indentscope").setup(opts)
|
||||
end,
|
||||
},
|
||||
@ -230,8 +245,8 @@ return {
|
||||
dashboard.button("r", " " .. " Recent files", ":Telescope oldfiles <CR>"),
|
||||
dashboard.button("g", " " .. " Find text", ":Telescope live_grep <CR>"),
|
||||
dashboard.button("c", " " .. " Config", ":e $MYVIMRC <CR>"),
|
||||
dashboard.button("s", "勒" .. " Restore Session", [[:lua require("persistence").load() <cr>]]),
|
||||
dashboard.button("l", "鈴" .. " Lazy", ":Lazy<CR>"),
|
||||
dashboard.button("s", " " .. " Restore Session", [[:lua require("persistence").load() <cr>]]),
|
||||
dashboard.button("l", " " .. " Lazy", ":Lazy<CR>"),
|
||||
dashboard.button("q", " " .. " Quit", ":qa<CR>"),
|
||||
}
|
||||
for _, button in ipairs(dashboard.section.buttons.val) do
|
||||
|
@ -13,7 +13,7 @@ return {
|
||||
{
|
||||
"folke/persistence.nvim",
|
||||
event = "BufReadPre",
|
||||
opts = { options = { "buffers", "curdir", "tabpages", "winsize", "help" } },
|
||||
opts = { options = { "buffers", "curdir", "tabpages", "winsize", "help", "globals" } },
|
||||
-- stylua: ignore
|
||||
keys = {
|
||||
{ "<leader>qs", function() require("persistence").load() end, desc = "Restore Session" },
|
||||
|
@ -129,13 +129,51 @@ import TabItem from '@theme/TabItem';
|
||||
return { content = table.concat(lines, "\n") }
|
||||
end
|
||||
|
||||
function M.recipes()
|
||||
local src = Util.read_file(vim.fs.normalize("~/projects/lazyvim.github.io/lua/recipes.lua"))
|
||||
local lines = vim.split(src, "\n")
|
||||
local ret = {}
|
||||
local header = {} ---@type string[]
|
||||
local block = {} ---@type string[]
|
||||
for _, line in ipairs(lines) do
|
||||
local comment = line:match("^ %-%- ?(.*)")
|
||||
if comment then
|
||||
header[#header + 1] = comment
|
||||
elseif line:find("^ {") then
|
||||
block = { "{" }
|
||||
elseif line:find("^ }") then
|
||||
block[#block + 1] = " }"
|
||||
vim.list_extend(ret, header)
|
||||
ret[#ret + 1] = "\n```lua"
|
||||
local code = Docs.fix_indent(table.concat(block, "\n"))
|
||||
ret[#ret + 1] = code
|
||||
ret[#ret + 1] = "```\n"
|
||||
header = {}
|
||||
block = {}
|
||||
else
|
||||
block[#block + 1] = line
|
||||
end
|
||||
end
|
||||
return { content = table.concat(ret, "\n") }
|
||||
end
|
||||
|
||||
function M.update2()
|
||||
local docs = vim.fs.normalize("~/projects/lazyvim.github.io/docs")
|
||||
|
||||
local config = Docs.extract("lua/lazyvim/config/init.lua", "\nlocal defaults = ({.-\n})")
|
||||
|
||||
Docs.save({
|
||||
config = config,
|
||||
}, docs .. "/configuration/index.md")
|
||||
|
||||
Docs.save({
|
||||
general = M.general(),
|
||||
}, docs .. "/configuration/general.md")
|
||||
|
||||
Docs.save({
|
||||
recipes = M.recipes(),
|
||||
}, docs .. "/configuration/recipes.md")
|
||||
|
||||
Docs.save({
|
||||
lazy = {
|
||||
content = [[```lua title="lua/config/lazy.lua"]] .. "\n" .. Util.read_file(
|
||||
|
@ -20,6 +20,16 @@ function M.has(plugin)
|
||||
return require("lazy.core.config").plugins[plugin] ~= nil
|
||||
end
|
||||
|
||||
---@param fn fun()
|
||||
function M.on_very_lazy(fn)
|
||||
vim.api.nvim_create_autocmd("User", {
|
||||
pattern = "VeryLazy",
|
||||
callback = function()
|
||||
fn()
|
||||
end,
|
||||
})
|
||||
end
|
||||
|
||||
---@param name string
|
||||
function M.opts(name)
|
||||
local plugin = require("lazy.core.config").plugins[name]
|
||||
@ -72,7 +82,7 @@ function M.get_root()
|
||||
end
|
||||
|
||||
-- this will return a function that calls telescope.
|
||||
-- cwd will defautlt to lazyvim.util.get_root
|
||||
-- cwd will default to lazyvim.util.get_root
|
||||
-- for `files`, git_files or find_files will be chosen depending on .git
|
||||
function M.telescope(builtin, opts)
|
||||
local params = { builtin = builtin, opts = opts }
|
||||
|
Reference in New Issue
Block a user