Compare commits

...

129 Commits

Author SHA1 Message Date
871e7fb0db chore(main): release 6.0.0 (#1158)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-07-21 08:14:39 +02:00
fc50c055c3 feat: add a keybind to search register (#1170)
use `<leader>"` to search register through telescope
2023-07-20 23:40:23 +02:00
df0818880e fix(util): fixed line number toggling. Closes #1173 2023-07-20 23:38:43 +02:00
6323b419fd docs: Add more documentation (#1174) 2023-07-20 23:16:13 +02:00
abaa6d90e4 feat(lang): add tex support (#1156)
* feat(lang): add tex support

* Reword comments

* Remove personalise configs.

* Disable lazy-loading.

* Remove chktex in LSP server texlab.

* Update local conceallevel setup.

* Add keymap for vimtex-doc-package.

* Enable vimtex omni-completion.

* Update vimtex's keymap.

* refactor: move vimtex K to texlab

---------

Co-authored-by: Folke Lemaitre <folke.lemaitre@gmail.com>
2023-07-20 12:26:05 +02:00
f70f873355 chore(build): auto-generate vimdoc 2023-07-20 07:21:08 +00:00
258f339bcf feat(options)!: set default localleader to \ 2023-07-20 09:20:24 +02:00
4d0427e131 chore(build): auto-generate vimdoc 2023-07-19 11:14:51 +00:00
f2459bd70e docs: Improve summary documentation of deps (#1159) 2023-07-19 13:14:07 +02:00
e797e13bce docs: Update CHANGELOG.md (#1160)
availble -> available
2023-07-18 20:45:24 +02:00
489221f741 chore(build): auto-generate vimdoc 2023-07-18 06:47:32 +00:00
a28acf0ce7 feat(keymaps): added leader-K to run keywordprg 2023-07-18 08:46:52 +02:00
fb1f29c32c chore(main): release 5.1.1 (#1147)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-07-16 10:44:20 +02:00
b4b27e867c fix(mason): add MasonUpdate to build 2023-07-16 10:42:14 +02:00
f46316af00 chore(main): release 5.1.0 (#1138)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-07-16 10:38:07 +02:00
63e898599a feat(lang): add null-ls tools to mason's ensure_installed (#1133) 2023-07-16 08:47:06 +02:00
3a07bd8d2e chore(build): auto-generate vimdoc 2023-07-16 06:42:27 +00:00
69bb89184f feat(neo-tree): update to v3.x and change follow_current_file to a … (#1143)
* feat(neo-tree): update to v3.x and change `follow_current_file` to a table and enable it

* fix(neo-tree): remove nerd font v3 icons

* fix(neo-tree): remove legaccy commands

---------

Co-authored-by: Folke Lemaitre <folke.lemaitre@gmail.com>
2023-07-16 08:41:45 +02:00
0801e52118 chore(build): auto-generate vimdoc 2023-07-15 07:31:17 +00:00
1b0b6eb0e1 feat(lsp): add 'reuse_win' for reuse window in lsp definition keymap (#1131)
* feat(lsp): add 'reuse_win' for reuse window in lsp definition keymap

* fix: inline telescope require
2023-07-15 09:30:34 +02:00
8c0e39c826 chore(main): release 5.0.0 (#1108)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-07-13 08:21:44 +02:00
bb2608ecd1 chore(build): auto-generate vimdoc 2023-07-13 06:18:44 +00:00
ae759b947b feat(flash)!: Make flash.nvim the default jump plugin for LazyVim
Use the `editor.leap` extra if you rather want to use leap/flit
2023-07-13 08:18:02 +02:00
9387ab388e feat: added leader-L to show the LazyVim changelog 2023-07-13 08:18:02 +02:00
8f9f76a96f chore(main): release 4.28.1 (#1101)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-07-12 20:04:33 +02:00
9e8ce289d1 fix(neoconf): do neoconf setup in lspconfig setup. Fixes #1070 2023-07-12 20:01:43 +02:00
5204aacf8d chore(main): release 4.28.0 (#1086)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-07-12 19:48:49 +02:00
a0c2014b10 feat(lang): add docker support (#1078) 2023-07-12 17:42:05 +02:00
c882544224 docs: added c compiler to requirements (#1082)
See: 2ef0c437b2
2023-07-12 17:36:30 +02:00
e212c166b4 feat(mini.ai): decouple mini.ai from which-key. Closes #1076 2023-07-12 17:25:35 +02:00
9fd89701da feat(util): added util.on_load to execute code when a plugin loads 2023-07-12 17:25:35 +02:00
b1721bc20a chore(build): auto-generate vimdoc 2023-07-12 14:34:54 +00:00
3f68f44d72 fix(lsp-config): lsp-config error when nvim-cmp not enabled. (#1095)
* fix(lsp-config): lsp-config error when nvim-cmp not enabled.

* Update lua/lazyvim/plugins/lsp/init.lua

Co-authored-by: Jonas Holst Damtoft <Jomik@users.noreply.github.com>

---------

Co-authored-by: Jonas Holst Damtoft <Jomik@users.noreply.github.com>
2023-07-12 16:34:07 +02:00
a38bf3001d chore(build): auto-generate vimdoc 2023-07-10 15:51:36 +00:00
67d1cbfb01 feat(catppuccin): match navic bg with lualine (#1085) 2023-07-10 17:50:53 +02:00
abea2807ce chore(main): release 4.27.0 (#1069)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-07-06 20:46:37 +02:00
44cdb5eac5 feat(lang): add python support (#1031) 2023-07-06 20:43:19 +02:00
0db31c2840 feat(extras): add terraform extra (#1030) 2023-07-06 19:46:34 +02:00
22c9477b96 feat(flash): use c-s in the cmdline to toggle flash 2023-07-06 15:51:31 +02:00
baa9614022 fix(autocmds): jump to last loc in buffer (#1061)
vim.api.nvim_win_set_cursor is expecting a window handle but was being
passed the current buffer's handle instead
2023-07-06 15:43:15 +02:00
b660b51718 chore(main): release 4.26.0 (#1068)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-07-06 15:40:33 +02:00
99f30f9a37 chore(build): auto-generate vimdoc 2023-07-06 13:36:51 +00:00
ae054ec13c feat(vscode): easier way to enable/disable plugins 2023-07-06 15:36:03 +02:00
bcff5a1937 fix(util): use spec to check if a plugin is enabled 2023-07-06 15:35:34 +02:00
299aae3545 fix(flash): depraction warning 2023-07-06 15:21:45 +02:00
0b020dc37b chore(main): release 4.25.1 (#1056)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-07-04 19:08:01 +02:00
755419f39c fix: trigger ci 2023-07-04 19:06:15 +02:00
ddb819cb9a chore(build): auto-generate vimdoc 2023-07-04 06:26:34 +00:00
9c120b5ef7 Revert "fix: leap nvim required by flit (#1046)"
This reverts commit dee8dc318efac8883fe149503ea92924ff4a4de2.
2023-07-04 08:25:38 +02:00
d33be73b8d chore(main): release 4.25.0 (#1041)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-07-03 21:47:59 +02:00
27eb4610bd feat(catppuccin): enable mason integration (#1048)
Signed-off-by: David Ward <dward@redhat.com>
2023-07-03 21:45:40 +02:00
e5200e6358 feat(lang): add C/C++ support (#1025) 2023-07-03 15:48:51 +02:00
64ca399c56 chore(build): auto-generate vimdoc 2023-07-03 13:42:01 +00:00
dee8dc318e fix: leap nvim required by flit (#1046)
step to reproduce
- disable leap.nvim
- add custom config for flash (not using one from the extras)
- open file type "f", error shown "module leap is missing"

Co-authored-by: Radvil <radvil@@access-mobile.com>
2023-07-03 15:41:16 +02:00
6d58f1dacf fix(hipatterns): remove assert. Fixes #1045 2023-07-02 22:25:43 +02:00
a981682603 fix(lsp): update keymaps *after* registering capabilities 2023-07-02 17:37:13 +02:00
bbaf47028f chore(main): release 4.24.1 (#1037)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-07-02 14:44:14 +02:00
8ccc109e92 fix(lsp): fixup lsp keymaps 2023-07-02 14:34:36 +02:00
a9c73bc7c3 chore(main): release 4.24.0 (#1036)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-07-02 13:18:47 +02:00
4009620651 fix(typescript): use new lsp keymaps config for typescript 2023-07-02 13:04:49 +02:00
39627cab42 fix(rust): remove rust-tools dep from lspconfig 2023-07-02 13:02:51 +02:00
1e1fc3c6a0 fix(go): make settings configurable for go 2023-07-02 13:01:59 +02:00
eaa0118dd2 feat(rust): make taplo configurable 2023-07-02 12:58:09 +02:00
272f6af842 feat(rust): make mason optional 2023-07-02 12:58:09 +02:00
29ba21274d chore(build): auto-generate vimdoc 2023-07-02 10:48:00 +00:00
a46d47653e feat(rust): refactor to allow easy user customization and keymaps 2023-07-02 12:46:29 +02:00
61e3ce8cdc feat(lsp): custom lsp keymaps 2023-07-02 12:44:54 +02:00
36774c6058 fix(lsp): resolve keymap capabilities over all buffer clients 2023-07-02 12:43:16 +02:00
d0bc8b7dce feat(lsp): added support to lsp keymaps for dynamic capabilities 2023-07-02 12:42:35 +02:00
fca09b12e8 chore(build): auto-generate vimdoc 2023-07-01 06:53:32 +00:00
ea21cad7ed chore(main): release 4.23.0 (#1023)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-07-01 08:52:51 +02:00
4ba5086b3d feat(go): add fine-tuned LSP options, add some null-ls sources (#1024) 2023-06-30 23:14:58 +02:00
089606b48d fix(lsp): upstream inlay_hint rename 2023-06-30 20:44:39 +02:00
6d8be7ae46 chore(main): release 4.22.0 (#1019)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-06-30 16:25:13 +02:00
79b1c92dd2 feat(rust): rust improvements (#1015)
* fix(rust): move lspconfig opts to correct location

lspconfig's `opts` goes in rust-tools's `opts.server`; see
https://github.com/simrat39/rust-tools.nvim#configuration

* feat(rust): add neotest-rust

* feat(rust): allow user to extend rust-tools with `opts`

Also avoids calling rust-tools's `setup()` twice.

* style(rust): fix indentation for stylua comment
2023-06-30 16:19:00 +02:00
c992ebec46 fix(lang): indentation in rust lang extra (#1017) 2023-06-30 16:03:22 +02:00
37d7ccdea1 chore(main): release 4.21.0 (#1011)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-06-30 09:03:44 +02:00
5a441f8972 feat(lang): Add Rust config (#1012) 2023-06-30 08:55:18 +02:00
3d0de235ec feat(extra): Add Elixir support and config (#993) 2023-06-30 08:41:48 +02:00
146bc4f172 chore(build): auto-generate vimdoc 2023-06-30 06:36:06 +00:00
65c70f6ad7 fix(autocmds): dont jump to last loc in gitcommit buffers 2023-06-30 08:35:27 +02:00
75d029c35b chore(main): release 4.20.1 (#1004)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-06-29 21:07:35 +02:00
8b1e7976a0 fix(yanky): don't override c-p insert mode telescope mapping. Fixes #1007 2023-06-29 20:50:04 +02:00
0e33010937 chore(build): auto-generate vimdoc 2023-06-29 06:03:51 +00:00
2f2c7a32a4 fix(catppuccin): change nvim-tree integration to neo-tree for catppuccin/nvim plugin (#1003) 2023-06-29 08:03:05 +02:00
c03b9a3ff1 chore(main): release 4.20.0 (#996)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-06-28 13:06:32 +02:00
e83d2c814f fix(yanky): use leader-p for telescope integration 2023-06-28 12:59:08 +02:00
5818e01f27 chore(build): auto-generate vimdoc 2023-06-28 09:27:32 +00:00
a1820c1b42 feat(extras): added yanky extra (yank-ring) 2023-06-28 11:26:54 +02:00
27d3e45df6 refactor(cmp): move comparator config to cmp spec 2023-06-28 11:26:53 +02:00
296d79cfbc chore(main): release 4.19.1 (#995)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-06-28 00:07:06 +02:00
240fa7631b chore(build): auto-generate vimdoc 2023-06-27 20:03:32 +00:00
d1eb9c89d3 fix(mini.files): changed some window widths 2023-06-27 22:02:51 +02:00
c5759a451f fix(flash): don't override R in normal mode 2023-06-27 22:02:51 +02:00
c998be8fa4 chore(main): release 4.19.0 (#989)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-06-26 21:58:57 +02:00
5f89e4a142 chore(build): auto-generate vimdoc 2023-06-26 19:35:53 +00:00
5e6a07200c feat(flash): added treesiter search to show ts node labels around search matches 2023-06-26 21:35:03 +02:00
a40f257c79 chore(main): release 4.18.0 (#976)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-06-25 19:53:17 +02:00
f6f8436fe8 feat(flash): enable flash in vscode 2023-06-25 19:50:33 +02:00
e9358d977a fix(keymaps): remove redundant ':' on lazy keymap (#977) 2023-06-25 10:05:07 +02:00
e018d07cce chore(build): auto-generate vimdoc 2023-06-25 05:22:14 +00:00
d5a9c54faf fix(edgy): corrected filetype for symbols outline 2023-06-25 07:21:26 +02:00
85542df6f5 chore(main): release 4.17.0 (#970)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-06-24 13:20:16 +02:00
abfdab37ce fix(flash): possible nil for telescope integration 2023-06-24 13:17:03 +02:00
12b57235a9 feat(flash): telescope integration. Use s in normal and <c-s> in insert mode 2023-06-24 13:14:23 +02:00
1acad8be93 chore(build): auto-generate vimdoc 2023-06-24 09:09:08 +00:00
6e9b18aa93 chore(main): release 4.16.0 (#966)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-06-24 11:08:27 +02:00
c3477ed81e feat(flash): added remote flash 2023-06-23 16:02:02 +02:00
a080bc7667 feat(mini.files): "g." to toggle hidden files (#964) 2023-06-23 13:25:50 +02:00
eb7b4fc369 chore(main): release 4.15.1 (#963)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-06-23 13:25:23 +02:00
9bfe77c1de chore(build): auto-generate vimdoc 2023-06-23 11:20:51 +00:00
2ef0c437b2 docs: added c compiler to requirements 2023-06-23 13:20:03 +02:00
ed89d01113 fix(edgy): only add symbolsoutline to the sidebar if it is installed. 2023-06-22 20:53:16 +02:00
09c1bf54ea chore(main): release 4.15.0 (#962)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-06-22 16:36:36 +02:00
5299522780 feat(mini.files): added extra keymap to open mini.files in the cwd 2023-06-22 16:29:45 +02:00
9ea1f31e9d chore(main): release 4.14.0 (#961)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-06-22 16:20:24 +02:00
e624511fa2 feat(extras): added extra for mini.files 2023-06-22 16:17:54 +02:00
69bf9e7e01 style(options): update comment (#960) 2023-06-22 12:51:25 +02:00
ca1880da0a chore(main): release 4.13.1 (#959)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-06-22 12:48:15 +02:00
09fafb946a perf(treesitter): better way of loading treesitter-textobjects 2023-06-22 11:43:32 +02:00
8281bd2f63 chore(main): release 4.13.0 (#958)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-06-22 10:45:32 +02:00
aa28119aa6 feat(flash): add treesitter to normal mode as well 2023-06-22 10:37:47 +02:00
5d0e10a30a chore(build): auto-generate vimdoc 2023-06-22 08:35:06 +00:00
0b99c9f788 fix(neo-tree): updated some icons to use Nerd Fonts v3. Fixes #957 2023-06-22 10:34:28 +02:00
47111bd2db chore(main): release 4.12.0 (#954)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-06-21 11:05:28 +02:00
318a4c8304 feat: added extra for flash.nvim 2023-06-21 10:51:04 +02:00
e865b9abe1 chore(main): release 4.11.0 (#951)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-06-21 08:05:13 +02:00
31505842be chore(build): auto-generate vimdoc 2023-06-21 06:03:21 +00:00
01c7eeebd0 feat: added support for the new builtin inlay hints
Enable with:
```lua
{"neovim/nvim-lspconfig", opts = {inlay_hints = {enabled = true}}}
```
2023-06-21 08:01:59 +02:00
33 changed files with 1416 additions and 222 deletions

File diff suppressed because it is too large Load Diff

View File

@ -57,6 +57,7 @@ LazyVim 提供了两全其美的方式 - 根据需要调整配置的灵活性,
- Neovim >= **0.8.0** (需要用 **LuaJIT** 构建)
- Git >= **2.19.0** (用于部分克隆支持)
- 一个 [Nerd Font](https://www.nerdfonts.com/) 字体 **_(可选)_**
- 一个用于 `nvim-treesitter`**C** 编译器。看 [这里](https://github.com/nvim-treesitter/nvim-treesitter#requirements)
## 🚀 入门

View File

@ -59,6 +59,7 @@ to tweak your config as needed, along with the convenience of a pre-configured s
- 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 **C** compiler for `nvim-treesitter`. See [here](https://github.com/nvim-treesitter/nvim-treesitter#requirements)
## 🚀 Getting Started

View File

@ -1,4 +1,4 @@
*LazyVim.txt* For Neovim >= 0.8.0 Last change: 2023 June 19
*LazyVim.txt* For Neovim >= 0.8.0 Last change: 2023 July 20
==============================================================================
Table of Contents *LazyVim-table-of-contents*
@ -55,6 +55,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 **C** compiler for `nvim-treesitter`. See here <https://github.com/nvim-treesitter/nvim-treesitter#requirements>
GETTING STARTED *LazyVim-getting-started*

View File

@ -1,4 +1,4 @@
-- This file is automatically loaded by lazyvim.config.init
-- This file is automatically loaded by lazyvim.config.init.
local function augroup(name)
return vim.api.nvim_create_augroup("lazyvim_" .. name, { clear = true })
@ -30,8 +30,13 @@ vim.api.nvim_create_autocmd({ "VimResized" }, {
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)
local exclude = { "gitcommit" }
local buf = vim.api.nvim_get_current_buf()
if vim.tbl_contains(exclude, vim.bo[buf].filetype) then
return
end
local mark = vim.api.nvim_buf_get_mark(buf, '"')
local lcount = vim.api.nvim_buf_line_count(buf)
if mark[1] > 0 and mark[1] <= lcount then
pcall(vim.api.nvim_win_set_cursor, 0, mark)
end

View File

@ -84,12 +84,15 @@ map("i", ";", ";<c-g>u")
-- save file
map({ "i", "v", "n", "s" }, "<C-s>", "<cmd>w<cr><esc>", { desc = "Save file" })
--keywordprg
map("n", "<leader>K", "<cmd>norm! K<cr>", { desc = "Keywordprg" })
-- better indenting
map("v", "<", "<gv")
map("v", ">", ">gv")
-- lazy
map("n", "<leader>l", "<cmd>:Lazy<cr>", { desc = "Lazy" })
map("n", "<leader>l", "<cmd>Lazy<cr>", { desc = "Lazy" })
-- new file
map("n", "<leader>fn", "<cmd>enew<cr>", { desc = "New File" })
@ -108,10 +111,13 @@ end
map("n", "<leader>uf", require("lazyvim.plugins.lsp.format").toggle, { desc = "Toggle format on Save" })
map("n", "<leader>us", function() Util.toggle("spell") end, { desc = "Toggle Spelling" })
map("n", "<leader>uw", function() Util.toggle("wrap") end, { desc = "Toggle Word Wrap" })
map("n", "<leader>ul", function() Util.toggle("relativenumber", true) Util.toggle("number") end, { desc = "Toggle Line Numbers" })
map("n", "<leader>ul", function() Util.toggle_number() end, { desc = "Toggle Line Numbers" })
map("n", "<leader>ud", Util.toggle_diagnostics, { desc = "Toggle Diagnostics" })
local conceallevel = vim.o.conceallevel > 0 and vim.o.conceallevel or 3
map("n", "<leader>uc", function() Util.toggle("conceallevel", false, {0, conceallevel}) end, { desc = "Toggle Conceal" })
if vim.lsp.inlay_hint then
map("n", "<leader>uh", function() vim.lsp.inlay_hint(0, nil) end, { desc = "Toggle Inlay Hints" })
end
-- lazygit
map("n", "<leader>gg", function() Util.float_term({ "lazygit" }, { cwd = Util.get_root(), esc_esc = false, ctrl_hjkl = false }) end, { desc = "Lazygit (root dir)" })
@ -125,6 +131,9 @@ if vim.fn.has("nvim-0.9.0") == 1 then
map("n", "<leader>ui", vim.show_pos, { desc = "Inspect Pos" })
end
-- LazyVim Changelog
map("n", "<leader>L", Util.changelog, {desc = "LazyVim Changelog"})
-- floating terminal
local lazyterm = function() Util.float_term(nil, { cwd = Util.get_root() }) end
map("n", "<leader>ft", lazyterm, { desc = "Terminal (root dir)" })

View File

@ -1,6 +1,6 @@
-- This file is automatically loaded by plugins.config
-- This file is automatically loaded by plugins.core
vim.g.mapleader = " "
vim.g.maplocalleader = " "
vim.g.maplocalleader = "\\"
local opt = vim.opt

View File

@ -44,6 +44,7 @@ return {
opts = function()
vim.api.nvim_set_hl(0, "CmpGhostText", { link = "Comment", default = true })
local cmp = require("cmp")
local defaults = require("cmp.config.default")()
return {
completion = {
completeopt = "menu,menuone,noinsert",
@ -86,6 +87,7 @@ return {
hl_group = "CmpGhostText",
},
},
sorting = defaults.sorting,
}
end,
},
@ -97,7 +99,10 @@ return {
opts = {},
},
-- surround
-- Fast and feature-rich surround actions. For text that includes
-- surrounding characters like brackets or quotes, this allows you
-- to select the text inside, change or modify the surrounding characters,
-- and more.
{
"echasnovski/mini.surround",
keys = function(_, keys)
@ -145,7 +150,7 @@ return {
},
},
-- better text-objects
-- Better text-objects
{
"echasnovski/mini.ai",
-- keys = {
@ -171,7 +176,7 @@ return {
config = function(_, opts)
require("mini.ai").setup(opts)
-- register all text objects with which-key
if require("lazyvim.util").has("which-key.nvim") then
require("lazyvim.util").on_load("which-key.nvim", function()
---@type table<string, string|table>
local i = {
[" "] = "Whitespace",
@ -212,7 +217,7 @@ return {
i = i,
a = a,
})
end
end)
end,
},
}

View File

@ -20,6 +20,7 @@ return {
illuminate = true,
indent_blankline = { enabled = true },
lsp_trouble = true,
mason = true,
mini = true,
native_lsp = {
enabled = true,
@ -30,11 +31,11 @@ return {
information = { "undercurl" },
},
},
navic = { enabled = true },
navic = { enabled = true, custom_bg = "lualine" },
neotest = true,
noice = true,
notify = true,
nvimtree = true,
neotree = true,
semantic_tokens = true,
telescope = true,
treesitter = true,

View File

@ -5,6 +5,7 @@ return {
-- file explorer
{
"nvim-neo-tree/neo-tree.nvim",
branch = "v3.x",
cmd = "Neotree",
keys = {
{
@ -28,7 +29,6 @@ return {
vim.cmd([[Neotree close]])
end,
init = function()
vim.g.neo_tree_remove_legacy_commands = 1
if vim.fn.argc() == 1 then
local stat = vim.loop.fs_stat(vim.fn.argv(0))
if stat and stat.type == "directory" then
@ -41,7 +41,7 @@ return {
open_files_do_not_replace_types = { "terminal", "Trouble", "qf", "Outline" },
filesystem = {
bind_to_cwd = false,
follow_current_file = true,
follow_current_file = { enabled = true },
use_libuv_file_watcher = true,
},
window = {
@ -103,6 +103,7 @@ return {
{ "<leader>gc", "<cmd>Telescope git_commits<CR>", desc = "commits" },
{ "<leader>gs", "<cmd>Telescope git_status<CR>", desc = "status" },
-- search
{ '<leader>s"', "<cmd>Telescope registers<cr>", desc = "Registers" },
{ "<leader>sa", "<cmd>Telescope autocommands<cr>", desc = "Auto Commands" },
{ "<leader>sb", "<cmd>Telescope current_buffer_fuzzy_find<cr>", desc = "Buffer" },
{ "<leader>sc", "<cmd>Telescope command_history<cr>", desc = "Command History" },
@ -203,38 +204,83 @@ return {
},
},
-- easily jump to any location and enhanced f/t motions for Leap
{
"ggandor/flit.nvim",
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 = { labeled_modes = "nx" },
},
-- disable old installations of leap and flit. Optional so it doesn't appear under disabled plugins
{
"ggandor/leap.nvim",
enabled = function()
vim.schedule(function()
local Config = require("lazy.core.config")
if Config.spec.disabled["leap.nvim"] or Config.spec.disabled["flit.nvim"] then
require("lazy.core.util").warn(
[[`flash.nvim` is now the default **LazyVim** jump plugin.
**leap.nvim** and **flit.nvim** have been disabled.
Please remove the plugins from your config.
If you rather use leap/flit instead, you can add the leap extra:
`lazyvim.plugins.extras.editor.leap`
]],
{ title = "LazyVim" }
)
end
end)
return false
end,
optional = true,
},
{ "ggandor/flit.nvim", enabled = false, optional = true },
-- Flash enhances the built-in search functionality by showing labels
-- at the end of each match, letting you quickly jump to a specific
-- location.
{
"folke/flash.nvim",
event = "VeryLazy",
vscode = true,
---@type Flash.Config
opts = {},
-- stylua: ignore
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" },
{ "s", mode = { "n", "x", "o" }, function() require("flash").jump() end, desc = "Flash" },
{ "S", mode = { "n", "o", "x" }, function() require("flash").treesitter() end, desc = "Flash Treesitter" },
{ "r", mode = "o", function() require("flash").remote() end, desc = "Remote Flash" },
{ "R", mode = { "o", "x" }, function() require("flash").treesitter_search() end, desc = "Treesitter Search" },
{ "<c-s>", mode = { "c" }, function() require("flash").toggle() end, desc = "Toggle Flash Search" },
},
config = function(_, opts)
local leap = require("leap")
for k, v in pairs(opts) do
leap.opts[k] = v
},
-- Flash Telescope config
{
"nvim-telescope/telescope.nvim",
optional = true,
opts = function(_, opts)
if not require("lazyvim.util").has("flash.nvim") then
return
end
leap.add_default_mappings(true)
vim.keymap.del({ "x", "o" }, "x")
vim.keymap.del({ "x", "o" }, "X")
local function flash(prompt_bufnr)
require("flash").jump({
pattern = "^",
label = { after = { 0, 0 } },
search = {
mode = "search",
exclude = {
function(win)
return vim.bo[vim.api.nvim_win_get_buf(win)].filetype ~= "TelescopeResults"
end,
},
},
action = function(match)
local picker = require("telescope.actions.state").get_current_picker(prompt_bufnr)
picker:set_selection(match.pos[1] - 1)
end,
})
end
opts.defaults = vim.tbl_deep_extend("force", opts.defaults or {}, {
mappings = { n = { s = flash }, i = { ["<c-s>"] = flash } },
})
end,
},
-- which-key
-- which-key helps you remember key bindings by showing a popup
-- with the active keybindings of the command you started typing.
{
"folke/which-key.nvim",
event = "VeryLazy",
@ -266,7 +312,9 @@ return {
end,
},
-- git signs
-- git signs highlights text that has changed since the list
-- git commit, and also lets you interactively stage & unstage
-- hunks in a commit.
{
"lewis6991/gitsigns.nvim",
event = { "BufReadPre", "BufNewFile" },
@ -303,7 +351,9 @@ return {
},
},
-- references
-- Automatically highlights other instances of the word under your cursor.
-- This works with LSP, Treesitter, and regexp matching to find the other
-- instances.
{
"RRethy/vim-illuminate",
event = { "BufReadPost", "BufNewFile" },
@ -392,7 +442,8 @@ return {
},
},
-- todo comments
-- Finds and lists all of the TODO, HACK, BUG, etc comment
-- in your project and loads them into a browsable list.
{
"folke/todo-comments.nvim",
cmd = { "TodoTrouble", "TodoTelescope" },

View File

@ -70,28 +70,9 @@ return {
},
---@param opts cmp.ConfigSchema
opts = function(_, opts)
local cmp = require("cmp")
table.insert(opts.sources, 1, { name = "copilot", group_index = 2 })
opts.sorting = {
priority_weight = 2,
comparators = {
require("copilot_cmp.comparators").prioritize,
-- Below is the default comparitor list and order for nvim-cmp
cmp.config.compare.offset,
-- cmp.config.compare.scopes, --this is commented in nvim-cmp too
cmp.config.compare.exact,
cmp.config.compare.score,
cmp.config.compare.recently_used,
cmp.config.compare.locality,
cmp.config.compare.kind,
cmp.config.compare.sort_text,
cmp.config.compare.length,
cmp.config.compare.order,
},
}
opts.sorting = opts.sorting or require("cmp.config.default")().sorting
table.insert(opts.sorting.comparators, 1, require("copilot_cmp.comparators").prioritize)
end,
},
}

View File

@ -0,0 +1,43 @@
return {
-- better yank/paste
{
"gbprod/yanky.nvim",
dependencies = { { "kkharji/sqlite.lua", enabled = not jit.os:find("Windows") } },
opts = function()
local mapping = require("yanky.telescope.mapping")
local mappings = mapping.get_defaults()
mappings.i["<c-p>"] = nil
return {
highlight = { timer = 200 },
ring = { storage = jit.os:find("Windows") and "shada" or "sqlite" },
picker = {
telescope = {
use_default_mappings = false,
mappings = mappings,
},
},
}
end,
keys = {
-- stylua: ignore
{ "<leader>p", function() require("telescope").extensions.yank_history.yank_history({ }) end, desc = "Open Yank History" },
{ "y", "<Plug>(YankyYank)", mode = { "n", "x" }, desc = "Yank text" },
{ "p", "<Plug>(YankyPutAfter)", mode = { "n", "x" }, desc = "Put yanked text after cursor" },
{ "P", "<Plug>(YankyPutBefore)", mode = { "n", "x" }, desc = "Put yanked text before cursor" },
{ "gp", "<Plug>(YankyGPutAfter)", mode = { "n", "x" }, desc = "Put yanked text after selection" },
{ "gP", "<Plug>(YankyGPutBefore)", mode = { "n", "x" }, desc = "Put yanked text before selection" },
{ "[y", "<Plug>(YankyCycleForward)", desc = "Cycle forward through yank history" },
{ "]y", "<Plug>(YankyCycleBackward)", desc = "Cycle backward through yank history" },
{ "]p", "<Plug>(YankyPutIndentAfterLinewise)", desc = "Put indented after cursor (linewise)" },
{ "[p", "<Plug>(YankyPutIndentBeforeLinewise)", desc = "Put indented before cursor (linewise)" },
{ "]P", "<Plug>(YankyPutIndentAfterLinewise)", desc = "Put indented after cursor (linewise)" },
{ "[P", "<Plug>(YankyPutIndentBeforeLinewise)", desc = "Put indented before cursor (linewise)" },
{ ">p", "<Plug>(YankyPutIndentAfterShiftRight)", desc = "Put and indent right" },
{ "<p", "<Plug>(YankyPutIndentAfterShiftLeft)", desc = "Put and indent left" },
{ ">P", "<Plug>(YankyPutIndentBeforeShiftRight)", desc = "Put before and indent right" },
{ "<P", "<Plug>(YankyPutIndentBeforeShiftLeft)", desc = "Put before and indent left" },
{ "=p", "<Plug>(YankyPutAfterFilter)", desc = "Put after applying a filter" },
{ "=P", "<Plug>(YankyPutBeforeFilter)", desc = "Put before applying a filter" },
},
},
}

View File

@ -0,0 +1,6 @@
require("lazy.core.util").warn(
"`flash.nvim` is now the default jump plugin for **LazyVim**.\nPlease remove the `lazyvim.plugins.extras.editor.flash` import from your **lazy** config.",
{ title = "LazyVim" }
)
return {}

View File

@ -0,0 +1,40 @@
return {
-- disable flash
{ "folke/flash.nvim", enabled = false, optional = true },
-- easily jump to any location and enhanced f/t motions for Leap
{
"ggandor/flit.nvim",
enabled = true,
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 = { labeled_modes = "nx" },
},
{
"ggandor/leap.nvim",
enabled = true,
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,
},
-- makes some plugins dot-repeatable like leap
{ "tpope/vim-repeat", event = "VeryLazy" },
}

View File

@ -0,0 +1,57 @@
return {
"echasnovski/mini.files",
opts = {
windows = {
preview = true,
width_focus = 30,
width_preview = 30,
},
options = {
-- Whether to use for editing directories
-- Disabled by default in LazyVim because neo-tree is used for that
use_as_default_explorer = false,
},
},
keys = {
{
"<leader>fm",
function()
require("mini.files").open(vim.api.nvim_buf_get_name(0), true)
end,
desc = "Open mini.files (directory of current file)",
},
{
"<leader>fM",
function()
require("mini.files").open(vim.loop.cwd(), true)
end,
desc = "Open mini.files (cwd)",
},
},
config = function(_, opts)
require("mini.files").setup(opts)
local show_dotfiles = true
local filter_show = function(fs_entry)
return true
end
local filter_hide = function(fs_entry)
return not vim.startswith(fs_entry.name, ".")
end
local toggle_dotfiles = function()
show_dotfiles = not show_dotfiles
local new_filter = show_dotfiles and filter_show or filter_hide
require("mini.files").refresh({ content = { filter = new_filter } })
end
vim.api.nvim_create_autocmd("User", {
pattern = "MiniFilesBufferCreate",
callback = function(args)
local buf_id = args.data.buf_id
-- Tweak left-hand side of mapping to your liking
vim.keymap.set("n", "g.", toggle_dotfiles, { buffer = buf_id })
end,
})
end,
}

View File

@ -0,0 +1,152 @@
return {
-- Add C/C++ to treesitter
{
"nvim-treesitter/nvim-treesitter",
opts = function(_, opts)
if type(opts.ensure_installed) == "table" then
vim.list_extend(opts.ensure_installed, { "c", "cpp" })
end
end,
},
{
"p00f/clangd_extensions.nvim",
lazy = true,
config = function() end,
opts = {
extensions = {
inlay_hints = {
inline = false,
},
ast = {
--These require codicons (https://github.com/microsoft/vscode-codicons)
role_icons = {
type = "",
declaration = "",
expression = "",
specifier = "",
statement = "",
["template argument"] = "",
},
kind_icons = {
Compound = "",
Recovery = "",
TranslationUnit = "",
PackExpansion = "",
TemplateTypeParm = "",
TemplateTemplateParm = "",
TemplateParamObject = "",
},
},
},
},
},
-- Correctly setup lspconfig for clangd 🚀
{
"neovim/nvim-lspconfig",
opts = {
servers = {
-- Ensure mason installs the server
clangd = {
keys = {
{ "<leader>cR", "<cmd>ClangdSwitchSourceHeader<cr>", desc = "Switch Source/Header (C/C++)" },
},
root_dir = function(...)
-- using a root .clang-format or .clang-tidy file messes up projects, so remove them
return require("lspconfig.util").root_pattern(
"compile_commands.json",
"compile_flags.txt",
"configure.ac",
".git"
)(...)
end,
capabilities = {
offsetEncoding = { "utf-16" },
},
cmd = {
"clangd",
"--background-index",
"--clang-tidy",
"--header-insertion=iwyu",
"--completion-style=detailed",
"--function-arg-placeholders",
"--fallback-style=llvm",
},
init_options = {
usePlaceholders = true,
completeUnimported = true,
clangdFileStatus = true,
},
},
},
setup = {
clangd = function(_, opts)
local clangd_ext_opts = require("lazyvim.util").opts("clangd_extensions.nvim")
require("clangd_extensions").setup(vim.tbl_deep_extend("force", clangd_ext_opts or {}, { server = opts }))
return true
end,
},
},
},
{
"nvim-cmp",
opts = function(_, opts)
table.insert(opts.sorting.comparators, 1, require("clangd_extensions.cmp_scores"))
end,
},
{
"mfussenegger/nvim-dap",
optional = true,
dependencies = {
-- Ensure C/C++ debugger is installed
"williamboman/mason.nvim",
optional = true,
opts = function(_, opts)
if type(opts.ensure_installed) == "table" then
vim.list_extend(opts.ensure_installed, { "codelldb" })
end
end,
},
opts = function()
local dap = require("dap")
if not dap.adapters["codelldb"] then
require("dap").adapters["codelldb"] = {
type = "server",
host = "localhost",
port = "${port}",
executable = {
command = "codelldb",
args = {
"--port",
"${port}",
},
},
}
end
for _, lang in ipairs({ "c", "cpp" }) do
dap.configurations[lang] = {
{
type = "codelldb",
request = "launch",
name = "Launch file",
program = function()
return vim.fn.input("Path to executable: ", vim.fn.getcwd() .. "/", "file")
end,
cwd = "${workspaceFolder}",
},
{
type = "codelldb",
request = "attach",
name = "Attach to process",
processId = require("dap.utils").pick_process,
cwd = "${workspaceFolder}",
},
}
end
end,
},
}

View File

@ -0,0 +1,36 @@
return {
{
"nvim-treesitter/nvim-treesitter",
opts = function(_, opts)
if type(opts.ensure_installed) == "table" then
vim.list_extend(opts.ensure_installed, { "dockerfile" })
end
end,
},
{
"jose-elias-alvarez/null-ls.nvim",
opts = function(_, opts)
local nls = require("null-ls")
opts.sources = opts.sources or {}
vim.list_extend(opts.sources, {
nls.builtins.diagnostics.hadolint,
})
end,
dependencies = {
"mason.nvim",
opts = function(_, opts)
opts.ensure_installed = opts.ensure_installed or {}
vim.list_extend(opts.ensure_installed, { "hadolint" })
end,
},
},
{
"neovim/nvim-lspconfig",
opts = {
servers = {
dockerls = {},
docker_compose_language_service = {},
},
},
},
}

View File

@ -0,0 +1,32 @@
return {
{
"nvim-treesitter/nvim-treesitter",
opts = function(_, opts)
vim.list_extend(opts.ensure_installed, {
"elixir",
"heex",
"eex",
})
end,
},
{
"williamboman/mason.nvim",
opts = function(_, opts)
vim.list_extend(opts.ensure_installed, {
"elixir-ls",
})
end,
},
{
"nvim-neotest/neotest",
optional = true,
dependencies = {
"jfpedroza/neotest-elixir",
},
opts = {
adapters = {
["neotest-elixir"] = {},
},
},
},
}

View File

@ -17,14 +17,45 @@ return {
gopls = {
settings = {
gopls = {
gofumpt = true,
codelenses = {
gc_details = false,
generate = true,
regenerate_cgo = true,
run_govulncheck = true,
test = true,
tidy = true,
upgrade_dependency = true,
vendor = true,
},
hints = {
assignVariableTypes = true,
compositeLiteralFields = true,
compositeLiteralTypes = true,
constantValues = true,
functionTypeParameters = true,
parameterNames = true,
rangeVariableTypes = true,
},
analyses = {
fieldalignment = true,
nilness = true,
unusedparams = true,
unusedwrite = true,
useany = true,
},
usePlaceholders = true,
completeUnimported = true,
staticcheck = true,
directoryFilters = { "-.git", "-.vscode", "-.idea", "-.vscode-test", "-node_modules" },
semanticTokens = true,
},
},
},
},
setup = {
gopls = function()
-- workaround for gopls not supporting semantictokensprovider
gopls = function(_, opts)
-- workaround for gopls not supporting semanticTokensProvider
-- https://github.com/golang/go/issues/54531#issuecomment-1464982242
require("lazyvim.util").on_attach(function(client, _)
if client.name == "gopls" then
@ -46,6 +77,21 @@ return {
},
},
},
-- Ensure Go tools are installed
{
"jose-elias-alvarez/null-ls.nvim",
opts = function(_, opts)
if type(opts.sources) == "table" then
local nls = require("null-ls")
vim.list_extend(opts.sources, {
nls.builtins.code_actions.gomodifytags,
nls.builtins.code_actions.impl,
nls.builtins.formatting.gofumpt,
nls.builtins.formatting.goimports_reviser,
})
end
end,
},
{
"mfussenegger/nvim-dap",
optional = true,
@ -54,7 +100,7 @@ return {
"mason.nvim",
opts = function(_, opts)
opts.ensure_installed = opts.ensure_installed or {}
table.insert(opts.ensure_installed, "delve")
vim.list_extend(opts.ensure_installed, { "gomodifytags", "impl", "gofumpt", "goimports-reviser", "delve" })
end,
},
},

View File

@ -0,0 +1,67 @@
return {
{
"nvim-treesitter/nvim-treesitter",
opts = function(_, opts)
if type(opts.ensure_installed) == "table" then
vim.list_extend(opts.ensure_installed, { "ninja", "python", "rst", "toml" })
end
end,
},
{
"neovim/nvim-lspconfig",
opts = {
servers = {
pyright = {},
ruff_lsp = {},
},
},
setup = {
ruff_lsp = function()
require("lazyvim.util").on_attach(function(client, _)
if client.name == "ruff_lsp" then
-- Disable hover in favor of Pyright
client.server_capabilities.hoverProvider = false
end
end)
end,
},
},
{
"nvim-neotest/neotest",
optional = true,
dependencies = {
"nvim-neotest/neotest-python",
},
opts = {
adapters = {
["neotest-python"] = {
-- Here you can specify the settings for the adapter, i.e.
-- runner = "pytest",
-- python = ".venv/bin/python",
},
},
},
},
{
"mfussenegger/nvim-dap",
optional = true,
dependencies = {
"mfussenegger/nvim-dap-python",
-- stylua: ignore
keys = {
{ "<leader>dPt", function() require('dap-python').test_method() end, desc = "Debug Method" },
{ "<leader>dPc", function() require('dap-python').test_class() end, desc = "Debug Class" },
},
config = function()
local path = require("mason-registry").get_package("debugpy"):get_install_path()
require("dap-python").setup(path .. "/venv/bin/python")
end,
},
},
{
"linux-cultist/venv-selector.nvim",
cmd = "VenvSelect",
opts = {},
keys = { { "<leader>cv", "<cmd>:VenvSelect<cr>", desc = "Select VirtualEnv" } },
},
}

View File

@ -0,0 +1,152 @@
return {
-- Extend auto completion
{
"hrsh7th/nvim-cmp",
dependencies = {
{
"Saecki/crates.nvim",
event = { "BufRead Cargo.toml" },
config = true,
},
},
---@param opts cmp.ConfigSchema
opts = function(_, opts)
local cmp = require("cmp")
opts.sources = cmp.config.sources(vim.list_extend(opts.sources, {
{ name = "crates" },
}))
end,
},
-- Add Rust & related to treesitter
{
"nvim-treesitter/nvim-treesitter",
opts = function(_, opts)
if type(opts.ensure_installed) == "table" then
vim.list_extend(opts.ensure_installed, { "ron", "rust", "toml" })
end
end,
},
-- Ensure Rust debugger is installed
{
"williamboman/mason.nvim",
optional = true,
opts = function(_, opts)
if type(opts.ensure_installed) == "table" then
vim.list_extend(opts.ensure_installed, { "codelldb" })
end
end,
},
{
"simrat39/rust-tools.nvim",
lazy = true,
opts = function()
local ok, mason_registry = pcall(require, "mason-registry")
local adapter ---@type any
if ok then
-- rust tools configuration for debugging support
local codelldb = mason_registry.get_package("codelldb")
local extension_path = codelldb:get_install_path() .. "/extension/"
local codelldb_path = extension_path .. "adapter/codelldb"
local liblldb_path = vim.fn.has("mac") == 1 and extension_path .. "lldb/lib/liblldb.dylib"
or extension_path .. "lldb/lib/liblldb.so"
adapter = require("rust-tools.dap").get_codelldb_adapter(codelldb_path, liblldb_path)
end
return {
dap = {
adapter = adapter,
},
tools = {
on_initialized = function()
vim.cmd([[
augroup RustLSP
autocmd CursorHold *.rs silent! lua vim.lsp.buf.document_highlight()
autocmd CursorMoved,InsertEnter *.rs silent! lua vim.lsp.buf.clear_references()
autocmd BufEnter,CursorHold,InsertLeave *.rs silent! lua vim.lsp.codelens.refresh()
augroup END
]])
end,
},
}
end,
config = function() end,
},
-- Correctly setup lspconfig for Rust 🚀
{
"neovim/nvim-lspconfig",
opts = {
servers = {
-- Ensure mason installs the server
rust_analyzer = {
keys = {
{ "K", "<cmd>RustHoverActions<cr>", desc = "Hover Actions (Rust)" },
{ "<leader>cR", "<cmd>RustCodeAction<cr>", desc = "Code Action (Rust)" },
{ "<leader>dr", "<cmd>RustDebuggables<cr>", desc = "Run Debuggables (Rust)" },
},
settings = {
["rust-analyzer"] = {
cargo = {
allFeatures = true,
loadOutDirsFromCheck = true,
runBuildScripts = true,
},
-- Add clippy lints for Rust.
checkOnSave = {
allFeatures = true,
command = "clippy",
extraArgs = { "--no-deps" },
},
procMacro = {
enable = true,
ignored = {
["async-trait"] = { "async_trait" },
["napi-derive"] = { "napi" },
["async-recursion"] = { "async_recursion" },
},
},
},
},
},
taplo = {
keys = {
{
"K",
function()
if vim.fn.expand("%:t") == "Cargo.toml" and require("crates").popup_available() then
require("crates").show_popup()
else
vim.lsp.buf.hover()
end
end,
desc = "Show Crate Documentation",
},
},
},
},
setup = {
rust_analyzer = function(_, opts)
local rust_tools_opts = require("lazyvim.util").opts("rust-tools.nvim")
require("rust-tools").setup(vim.tbl_deep_extend("force", rust_tools_opts or {}, { server = opts }))
return true
end,
},
},
},
{
"nvim-neotest/neotest",
optional = true,
dependencies = {
"rouge8/neotest-rust",
},
opts = {
adapters = {
["neotest-rust"] = {},
},
},
},
}

View File

@ -0,0 +1,33 @@
return {
{
"nvim-treesitter/nvim-treesitter",
opts = function(_, opts)
if type(opts.ensure_installed) == "table" then
vim.list_extend(opts.ensure_installed, {
"terraform",
"hcl",
})
end
end,
},
{
"neovim/nvim-lspconfig",
opts = {
servers = {
terraformls = {},
},
},
},
{
"jose-elias-alvarez/null-ls.nvim",
opts = function(_, opts)
if type(opts.sources) == "table" then
local null_ls = require("null-ls")
vim.list_extend(opts.sources, {
null_ls.builtins.formatting.terraform_fmt,
null_ls.builtins.diagnostics.terraform_validate,
})
end
end,
},
}

View File

@ -0,0 +1,58 @@
return {
{
"folke/which-key.nvim",
optional = true,
opts = {
defaults = {
["<localLeader>l"] = { name = "+vimtex" },
},
},
},
-- Add BibTeX/LaTeX to treesitter
{
"nvim-treesitter/nvim-treesitter",
opts = function(_, opts)
if type(opts.ensure_installed) == "table" then
vim.list_extend(opts.ensure_installed, { "bibtex", "latex" })
end
if type(opts.highlight.disable) == "table" then
vim.list_extend(opts.highlight.disable, { "latex" })
else
opts.highlight.disable = { "latex" }
end
end,
},
{
"lervag/vimtex",
lazy = false, -- lazy-loading will disable inverse search
config = function()
vim.api.nvim_create_autocmd({ "FileType" }, {
group = vim.api.nvim_create_augroup("lazyvim_vimtex_conceal", { clear = true }),
pattern = { "bib", "tex" },
callback = function()
vim.wo.conceallevel = 2
end,
})
vim.g.vimtex_mappings_disable = { ["n"] = { "K" } } -- disable `K` as it conflicts with LSP hover
vim.g.vimtex_quickfix_method = vim.fn.executable("pplatex") == 1 and "pplatex" or "latexlog"
end,
},
-- Correctly setup lspconfig for LaTeX 🚀
{
"neovim/nvim-lspconfig",
optional = true,
opts = {
servers = {
texlab = {
keys = {
{ "<Leader>K", "<plug>(vimtex-doc-package)", desc = "Vimtex Docs", silent = true },
},
},
},
},
},
}

View File

@ -19,6 +19,10 @@ return {
servers = {
---@type lspconfig.options.tsserver
tsserver = {
keys = {
{ "<leader>co", "<cmd>TypescriptOrganizeImports<CR>", desc = "Organize Imports" },
{ "<leader>cR", "<cmd>TypescriptRenameFile<CR>", desc = "Rename File" },
},
settings = {
typescript = {
format = {
@ -42,14 +46,6 @@ return {
},
setup = {
tsserver = function(_, opts)
require("lazyvim.util").on_attach(function(client, buffer)
if client.name == "tsserver" then
-- stylua: ignore
vim.keymap.set("n", "<leader>co", "<cmd>TypescriptOrganizeImports<CR>", { buffer = buffer, desc = "Organize Imports" })
-- stylua: ignore
vim.keymap.set("n", "<leader>cR", "<cmd>TypescriptRenameFile<CR>", { desc = "Rename File", buffer = buffer })
end
end)
require("typescript").setup({ server = opts })
return true
end,

View File

@ -14,101 +14,108 @@ return {
-- stylua: ignore
{ "<leader>uE", function() require("edgy").select() end, desc = "Edgy Select Window" },
},
opts = {
bottom = {
{
ft = "toggleterm",
size = { height = 0.4 },
filter = function(buf, win)
return vim.api.nvim_win_get_config(win).relative == ""
opts = function()
local opts = {
bottom = {
{
ft = "toggleterm",
size = { height = 0.4 },
filter = function(buf, win)
return vim.api.nvim_win_get_config(win).relative == ""
end,
},
{
ft = "noice",
size = { height = 0.4 },
filter = function(buf, win)
return vim.api.nvim_win_get_config(win).relative == ""
end,
},
{
ft = "lazyterm",
title = "LazyTerm",
size = { height = 0.4 },
filter = function(buf)
return not vim.b[buf].lazyterm_cmd
end,
},
"Trouble",
{ ft = "qf", title = "QuickFix" },
{
ft = "help",
size = { height = 20 },
-- don't open help files in edgy that we're editing
filter = function(buf)
return vim.bo[buf].buftype == "help"
end,
},
{ ft = "spectre_panel", size = { height = 0.4 } },
{ title = "Neotest Output", ft = "neotest-output-panel", size = { height = 15 } },
},
left = {
{
title = "Neo-Tree",
ft = "neo-tree",
filter = function(buf)
return vim.b[buf].neo_tree_source == "filesystem"
end,
pinned = true,
open = function()
vim.api.nvim_input("<esc><space>e")
end,
size = { height = 0.5 },
},
{ title = "Neotest Summary", ft = "neotest-summary" },
{
title = "Neo-Tree Git",
ft = "neo-tree",
filter = function(buf)
return vim.b[buf].neo_tree_source == "git_status"
end,
pinned = true,
open = "Neotree position=right git_status",
},
{
title = "Neo-Tree Buffers",
ft = "neo-tree",
filter = function(buf)
return vim.b[buf].neo_tree_source == "buffers"
end,
pinned = true,
open = "Neotree position=top buffers",
},
"neo-tree",
},
keys = {
-- increase width
["<c-Right>"] = function(win)
win:resize("width", 2)
end,
-- decrease width
["<c-Left>"] = function(win)
win:resize("width", -2)
end,
-- increase height
["<c-Up>"] = function(win)
win:resize("height", 2)
end,
-- decrease height
["<c-Down>"] = function(win)
win:resize("height", -2)
end,
},
{
ft = "noice",
size = { height = 0.4 },
filter = function(buf, win)
return vim.api.nvim_win_get_config(win).relative == ""
end,
},
{
ft = "lazyterm",
title = "LazyTerm",
size = { height = 0.4 },
filter = function(buf)
return not vim.b[buf].lazyterm_cmd
end,
},
"Trouble",
{ ft = "qf", title = "QuickFix" },
{
ft = "help",
size = { height = 20 },
-- don't open help files in edgy that we're editing
filter = function(buf)
return vim.bo[buf].buftype == "help"
end,
},
{ ft = "spectre_panel", size = { height = 0.4 } },
{ title = "Neotest Output", ft = "neotest-output-panel", size = { height = 15 } },
},
left = {
{
title = "Neo-Tree",
ft = "neo-tree",
filter = function(buf)
return vim.b[buf].neo_tree_source == "filesystem"
end,
pinned = true,
open = function()
vim.api.nvim_input("<esc><space>e")
end,
size = { height = 0.5 },
},
{ title = "Neotest Summary", ft = "neotest-summary" },
{
title = "Neo-Tree Git",
ft = "neo-tree",
filter = function(buf)
return vim.b[buf].neo_tree_source == "git_status"
end,
pinned = true,
open = "Neotree position=right git_status",
},
{
title = "Neo-Tree Buffers",
ft = "neo-tree",
filter = function(buf)
return vim.b[buf].neo_tree_source == "buffers"
end,
pinned = true,
open = "Neotree position=top buffers",
},
{
}
local Util = require("lazyvim.util")
if Util.has("symbols-outline.nvim") then
table.insert(opts.left, {
title = "Outline",
ft = "Outline",
pinned = true,
open = "SymbolsOutline",
},
"neo-tree",
},
keys = {
-- increase width
["<c-Right>"] = function(win)
win:resize("width", 2)
end,
-- decrease width
["<c-Left>"] = function(win)
win:resize("width", -2)
end,
-- increase height
["<c-Up>"] = function(win)
win:resize("height", 2)
end,
-- decrease height
["<c-Down>"] = function(win)
win:resize("height", -2)
end,
},
},
})
end
return opts
end,
},
-- prevent neo-tree from opening files in edgy windows

View File

@ -54,7 +54,7 @@ M.plugin = {
local match = m.full_match
---@type string, number
local color, shade = match:match("[%w-]+%-([a-z%-]+)%-(%d+)")
shade = assert(tonumber(shade))
shade = tonumber(shade)
local bg = vim.tbl_get(M.colors, color, shade)
if bg then
local hl = "MiniHipatternsTailwind" .. color .. shade

View File

@ -21,23 +21,8 @@ local Config = require("lazy.core.config")
local Plugin = require("lazy.core.plugin")
Config.options.checker.enabled = false
Config.options.change_detection.enabled = false
-- HACK: disable all plugins except the ones we want
local fix_disabled = Plugin.Spec.fix_disabled
function Plugin.Spec.fix_disabled(self)
for _, plugin in pairs(self.plugins) do
if not (vim.tbl_contains(enabled, plugin.name) or plugin.vscode) then
plugin.enabled = false
end
end
fix_disabled(self)
end
-- HACK: don't clean plugins in vscode
local update_state = Plugin.update_state
function Plugin.update_state()
update_state()
Config.to_clean = {}
Config.options.defaults.cond = function(plugin)
return vim.tbl_contains(enabled, plugin.name) or plugin.vscode
end
-- Add some vscode specific keymaps

View File

@ -4,7 +4,7 @@ return {
"neovim/nvim-lspconfig",
event = { "BufReadPre", "BufNewFile" },
dependencies = {
{ "folke/neoconf.nvim", cmd = "Neoconf", config = true },
{ "folke/neoconf.nvim", cmd = "Neoconf", config = false, dependencies = { "nvim-lspconfig" } },
{ "folke/neodev.nvim", opts = {} },
"mason.nvim",
"williamboman/mason-lspconfig.nvim",
@ -31,6 +31,12 @@ return {
},
severity_sort = true,
},
-- Enable this to enable the builtin LSP inlay hints on Neovim >= 0.10.0
-- Be aware that you also will need to properly configure your LSP server to
-- provide the inlay hints.
inlay_hints = {
enabled = false,
},
-- add any global capabilities here
capabilities = {},
-- Automatically format on save
@ -51,6 +57,10 @@ return {
jsonls = {},
lua_ls = {
-- mason = false, -- set to false if you don't want this server to be installed with mason
-- Use this to add any additional keymaps
-- for specific lsp servers
---@type LazyKeys[]
-- keys = {},
settings = {
Lua = {
workspace = {
@ -79,6 +89,11 @@ return {
---@param opts PluginLspOpts
config = function(_, opts)
local Util = require("lazyvim.util")
if Util.has("neoconf.nvim") then
local plugin = require("lazy.core.config").spec.plugins["neoconf.nvim"]
require("neoconf").setup(require("lazy.core.plugin").values(plugin, "opts", false))
end
-- setup autoformat
require("lazyvim.plugins.lsp.format").setup(opts)
-- setup formatting and keymaps
@ -86,12 +101,34 @@ return {
require("lazyvim.plugins.lsp.keymaps").on_attach(client, buffer)
end)
local register_capability = vim.lsp.handlers["client/registerCapability"]
vim.lsp.handlers["client/registerCapability"] = function(err, res, ctx)
local ret = register_capability(err, res, ctx)
local client_id = ctx.client_id
---@type lsp.Client
local client = vim.lsp.get_client_by_id(client_id)
local buffer = vim.api.nvim_get_current_buf()
require("lazyvim.plugins.lsp.keymaps").on_attach(client, buffer)
return ret
end
-- diagnostics
for name, icon in pairs(require("lazyvim.config").icons.diagnostics) do
name = "DiagnosticSign" .. name
vim.fn.sign_define(name, { text = icon, texthl = name, numhl = "" })
end
local inlay_hint = vim.lsp.buf.inlay_hint or vim.lsp.inlay_hint
if opts.inlay_hints.enabled and inlay_hint then
Util.on_attach(function(client, buffer)
if client.server_capabilities.inlayHintProvider then
inlay_hint(buffer, true)
end
end)
end
if type(opts.diagnostics.virtual_text) == "table" and opts.diagnostics.virtual_text.prefix == "icons" then
opts.diagnostics.virtual_text.prefix = vim.fn.has("nvim-0.10.0") == 0 and ""
or function(diagnostic)
@ -107,11 +144,12 @@ return {
vim.diagnostic.config(vim.deepcopy(opts.diagnostics))
local servers = opts.servers
local has_cmp, cmp_nvim_lsp = pcall(require, "cmp_nvim_lsp")
local capabilities = vim.tbl_deep_extend(
"force",
{},
vim.lsp.protocol.make_client_capabilities(),
require("cmp_nvim_lsp").default_capabilities(),
has_cmp and cmp_nvim_lsp.default_capabilities() or {},
opts.capabilities or {}
)
@ -192,6 +230,7 @@ return {
"williamboman/mason.nvim",
cmd = "Mason",
keys = { { "<leader>cm", "<cmd>Mason<cr>", desc = "Mason" } },
build = ":MasonUpdate",
opts = {
ensure_installed = {
"stylua",

View File

@ -14,11 +14,11 @@ function M.get()
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" },
{ "gd", function() require("telescope.builtin").lsp_definitions({ reuse_win = true }) end, 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" },
{ "gy", "<cmd>Telescope lsp_type_definitions<cr>", desc = "Goto T[y]pe Definition" },
{ "gI", function() require("telescope.builtin").lsp_implementations({ reuse_win = true }) end, desc = "Goto Implementation" },
{ "gy", function() require("telescope.builtin").lsp_type_definitions({ reuse_win = true }) end, desc = "Goto T[y]pe 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" },
@ -28,8 +28,8 @@ function M.get()
{ "[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>cf", format, desc = "Format Document", has = "documentFormatting" },
{ "<leader>cf", format, desc = "Format Range", mode = "v", has = "documentRangeFormatting" },
{ "<leader>cf", format, desc = "Format Document", has = "formatting" },
{ "<leader>cf", format, desc = "Format Range", mode = "v", has = "rangeFormatting" },
{ "<leader>ca", vim.lsp.buf.code_action, desc = "Code Action", mode = { "n", "v" }, has = "codeAction" },
{
"<leader>cA",
@ -65,21 +65,51 @@ function M.get()
return M._keys
end
function M.on_attach(client, buffer)
---@param method string
function M.has(buffer, method)
method = method:find("/") and method or "textDocument/" .. method
local clients = vim.lsp.get_active_clients({ bufnr = buffer })
for _, client in ipairs(clients) do
if client.supports_method(method) then
return true
end
end
return false
end
function M.resolve(buffer)
local Keys = require("lazy.core.handler.keys")
local keymaps = {} ---@type table<string,LazyKeys|{has?:string}>
for _, value in ipairs(M.get()) do
local keys = Keys.parse(value)
if keys[2] == vim.NIL or keys[2] == false then
local function add(keymap)
local keys = Keys.parse(keymap)
if keys[2] == false then
keymaps[keys.id] = nil
else
keymaps[keys.id] = keys
end
end
for _, keymap in ipairs(M.get()) do
add(keymap)
end
local opts = require("lazyvim.util").opts("nvim-lspconfig")
local clients = vim.lsp.get_active_clients({ bufnr = buffer })
for _, client in ipairs(clients) do
local maps = opts.servers[client.name] and opts.servers[client.name].keys or {}
for _, keymap in ipairs(maps) do
add(keymap)
end
end
return keymaps
end
function M.on_attach(client, buffer)
local Keys = require("lazy.core.handler.keys")
local keymaps = M.resolve(buffer)
for _, keys in pairs(keymaps) do
if not keys.has or client.server_capabilities[keys.has .. "Provider"] then
if not keys.has or M.has(buffer, keys.has) then
local opts = Keys.opts(keys)
---@diagnostic disable-next-line: no-unknown
opts.has = nil

View File

@ -1,32 +1,26 @@
local load_textobjects = false
return {
-- Treesitter is a new parser generator tool that we can
-- use in Neovim to power faster and more accurate
-- syntax highlighting.
{
"nvim-treesitter/nvim-treesitter",
version = false, -- last release is way too old and doesn't work on Windows
build = ":TSUpdate",
event = { "BufReadPost", "BufNewFile" },
cmd = { "TSUpdateSync" },
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
-- disable rtp plugin, as we only need its queries for mini.ai
-- In case other textobject modules are enabled, we will load them
-- once nvim-treesitter is loaded
require("lazy.core.loader").disable_rtp_plugin("nvim-treesitter-textobjects")
load_textobjects = true
end,
},
},
cmd = { "TSUpdateSync" },
keys = {
{ "<c-space>", desc = "Increment selection" },
{ "<bs>", desc = "Decrement selection", mode = "x" },
@ -79,6 +73,21 @@ return {
end, opts.ensure_installed)
end
require("nvim-treesitter.configs").setup(opts)
if load_textobjects then
-- PERF: no need to load the plugin, if we only need its queries for mini.ai
if opts.textobjects then
for _, mod in ipairs({ "move", "select", "swap", "lsp_interop" }) do
if opts.textobjects[mod] and opts.textobjects[mod].enable then
local Loader = require("lazy.core.loader")
Loader.disabled_rtp_plugins["nvim-treesitter-textobjects"] = nil
local plugin = require("lazy.core.config").plugins["nvim-treesitter-textobjects"]
require("lazy.core.loader").source_runtime(plugin.dir, "plugin")
break
end
end
end
end
end,
},
}

Some files were not shown because too many files have changed in this diff Show More