Compare commits
67 Commits
Author | SHA1 | Date | |
---|---|---|---|
abea2807ce | |||
44cdb5eac5 | |||
0db31c2840 | |||
22c9477b96 | |||
baa9614022 | |||
b660b51718 | |||
99f30f9a37 | |||
ae054ec13c | |||
bcff5a1937 | |||
299aae3545 | |||
0b020dc37b | |||
755419f39c | |||
ddb819cb9a | |||
9c120b5ef7 | |||
d33be73b8d | |||
27eb4610bd | |||
e5200e6358 | |||
64ca399c56 | |||
dee8dc318e | |||
6d58f1dacf | |||
a981682603 | |||
bbaf47028f | |||
8ccc109e92 | |||
a9c73bc7c3 | |||
4009620651 | |||
39627cab42 | |||
1e1fc3c6a0 | |||
eaa0118dd2 | |||
272f6af842 | |||
29ba21274d | |||
a46d47653e | |||
61e3ce8cdc | |||
36774c6058 | |||
d0bc8b7dce | |||
fca09b12e8 | |||
ea21cad7ed | |||
4ba5086b3d | |||
089606b48d | |||
6d8be7ae46 | |||
79b1c92dd2 | |||
c992ebec46 | |||
37d7ccdea1 | |||
5a441f8972 | |||
3d0de235ec | |||
146bc4f172 | |||
65c70f6ad7 | |||
75d029c35b | |||
8b1e7976a0 | |||
0e33010937 | |||
2f2c7a32a4 | |||
c03b9a3ff1 | |||
e83d2c814f | |||
5818e01f27 | |||
a1820c1b42 | |||
27d3e45df6 | |||
296d79cfbc | |||
240fa7631b | |||
d1eb9c89d3 | |||
c5759a451f | |||
c998be8fa4 | |||
5f89e4a142 | |||
5e6a07200c | |||
a40f257c79 | |||
f6f8436fe8 | |||
e9358d977a | |||
e018d07cce | |||
d5a9c54faf |
160
CHANGELOG.md
160
CHANGELOG.md
@ -1,5 +1,165 @@
|
||||
# Changelog
|
||||
|
||||
## [4.27.0](https://github.com/LazyVim/LazyVim/compare/v4.26.0...v4.27.0) (2023-07-06)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **extras:** add terraform extra ([#1030](https://github.com/LazyVim/LazyVim/issues/1030)) ([0db31c2](https://github.com/LazyVim/LazyVim/commit/0db31c2840af662c856d5b9a09d87bc266e7fa40))
|
||||
* **flash:** use c-s in the cmdline to toggle flash ([22c9477](https://github.com/LazyVim/LazyVim/commit/22c9477b9642b1a8abc303ffcb44c6989c7a5ca2))
|
||||
* **lang:** add python support ([#1031](https://github.com/LazyVim/LazyVim/issues/1031)) ([44cdb5e](https://github.com/LazyVim/LazyVim/commit/44cdb5eac556733db53afeebcdc6ef91408de0c3))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **autocmds:** jump to last loc in buffer ([#1061](https://github.com/LazyVim/LazyVim/issues/1061)) ([baa9614](https://github.com/LazyVim/LazyVim/commit/baa96140227a3727b2ea2053f37aa2b7253bb45a))
|
||||
|
||||
## [4.26.0](https://github.com/LazyVim/LazyVim/compare/v4.25.1...v4.26.0) (2023-07-06)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **vscode:** easier way to enable/disable plugins ([ae054ec](https://github.com/LazyVim/LazyVim/commit/ae054ec13c987ff5ce39cfc88917f8243abae72e))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **flash:** depraction warning ([299aae3](https://github.com/LazyVim/LazyVim/commit/299aae3545aa7b7a67a6907e089d80cd63938bf6))
|
||||
* **util:** use spec to check if a plugin is enabled ([bcff5a1](https://github.com/LazyVim/LazyVim/commit/bcff5a19379e32a85049500de420aa24b271fb72))
|
||||
|
||||
## [4.25.1](https://github.com/LazyVim/LazyVim/compare/v4.25.0...v4.25.1) (2023-07-04)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* trigger ci ([755419f](https://github.com/LazyVim/LazyVim/commit/755419f39cf0ca0407a3a6a16dad35942c653572))
|
||||
|
||||
## [4.25.0](https://github.com/LazyVim/LazyVim/compare/v4.24.1...v4.25.0) (2023-07-03)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **catppuccin:** enable mason integration ([#1048](https://github.com/LazyVim/LazyVim/issues/1048)) ([27eb461](https://github.com/LazyVim/LazyVim/commit/27eb4610bd0ffd48243f793054c7c9ab5ba08cb1))
|
||||
* **lang:** add C/C++ support ([#1025](https://github.com/LazyVim/LazyVim/issues/1025)) ([e5200e6](https://github.com/LazyVim/LazyVim/commit/e5200e6358766f2ba71eb229cb335c4c811902bb))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **hipatterns:** remove assert. Fixes [#1045](https://github.com/LazyVim/LazyVim/issues/1045) ([6d58f1d](https://github.com/LazyVim/LazyVim/commit/6d58f1dacf1652ba49ff97631e59fc4ec9ee4faa))
|
||||
* leap nvim required by flit ([#1046](https://github.com/LazyVim/LazyVim/issues/1046)) ([dee8dc3](https://github.com/LazyVim/LazyVim/commit/dee8dc318efac8883fe149503ea92924ff4a4de2))
|
||||
* **lsp:** update keymaps *after* registering capabilities ([a981682](https://github.com/LazyVim/LazyVim/commit/a981682603480e34b23615433e4ebefe07276dc2))
|
||||
|
||||
## [4.24.1](https://github.com/LazyVim/LazyVim/compare/v4.24.0...v4.24.1) (2023-07-02)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **lsp:** fixup lsp keymaps ([8ccc109](https://github.com/LazyVim/LazyVim/commit/8ccc109e920bcbe041c89f7e022bbfb2dbf4a09b))
|
||||
|
||||
## [4.24.0](https://github.com/LazyVim/LazyVim/compare/v4.23.0...v4.24.0) (2023-07-02)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **lsp:** added support to lsp keymaps for dynamic capabilities ([d0bc8b7](https://github.com/LazyVim/LazyVim/commit/d0bc8b7dcea44b7bc46580ce21001c4509d046c3))
|
||||
* **lsp:** custom lsp keymaps ([61e3ce8](https://github.com/LazyVim/LazyVim/commit/61e3ce8cdc1159d59e11d92478ca76ea19e44c2a))
|
||||
* **rust:** make mason optional ([272f6af](https://github.com/LazyVim/LazyVim/commit/272f6af842eb66b6e6cbdea211b17a1196acdff5))
|
||||
* **rust:** make taplo configurable ([eaa0118](https://github.com/LazyVim/LazyVim/commit/eaa0118dd2c91911f1457ea31b976a7c8f93164a))
|
||||
* **rust:** refactor to allow easy user customization and keymaps ([a46d476](https://github.com/LazyVim/LazyVim/commit/a46d47653e092f7689203ee39c9f964b1bd2d5f4))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **go:** make settings configurable for go ([1e1fc3c](https://github.com/LazyVim/LazyVim/commit/1e1fc3c6a06fb98f305d8753939c6b871ae26e33))
|
||||
* **lsp:** resolve keymap capabilities over all buffer clients ([36774c6](https://github.com/LazyVim/LazyVim/commit/36774c605848dc3bee8b9e0e4673e684b47bd89c))
|
||||
* **rust:** remove rust-tools dep from lspconfig ([39627ca](https://github.com/LazyVim/LazyVim/commit/39627cab42cdaaab3d70c3013ce82b9caae7c623))
|
||||
* **typescript:** use new lsp keymaps config for typescript ([4009620](https://github.com/LazyVim/LazyVim/commit/4009620651c7422b3ce11484916865073e95574d))
|
||||
|
||||
## [4.23.0](https://github.com/LazyVim/LazyVim/compare/v4.22.0...v4.23.0) (2023-06-30)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **go:** add fine-tuned LSP options, add some null-ls sources ([#1024](https://github.com/LazyVim/LazyVim/issues/1024)) ([4ba5086](https://github.com/LazyVim/LazyVim/commit/4ba5086b3d9f9690e8fd7d93102db66173b02638))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **lsp:** upstream inlay_hint rename ([089606b](https://github.com/LazyVim/LazyVim/commit/089606b48dc6bb94bac36d1c30e50899a8d6f81f))
|
||||
|
||||
## [4.22.0](https://github.com/LazyVim/LazyVim/compare/v4.21.0...v4.22.0) (2023-06-30)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **rust:** rust improvements ([#1015](https://github.com/LazyVim/LazyVim/issues/1015)) ([79b1c92](https://github.com/LazyVim/LazyVim/commit/79b1c92dd22020b2a5ed1dbd6e6bb86242207785))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **lang:** indentation in rust lang extra ([#1017](https://github.com/LazyVim/LazyVim/issues/1017)) ([c992ebe](https://github.com/LazyVim/LazyVim/commit/c992ebec468b2e60f1138fd85055118016c62165))
|
||||
|
||||
## [4.21.0](https://github.com/LazyVim/LazyVim/compare/v4.20.1...v4.21.0) (2023-06-30)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **extra:** Add Elixir support and config ([#993](https://github.com/LazyVim/LazyVim/issues/993)) ([3d0de23](https://github.com/LazyVim/LazyVim/commit/3d0de235eca0ea6987947e4a7c47f1393e42dfb2))
|
||||
* **lang:** Add Rust config ([#1012](https://github.com/LazyVim/LazyVim/issues/1012)) ([5a441f8](https://github.com/LazyVim/LazyVim/commit/5a441f897247b130c1ffb78bb37fd3a16d2250de))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **autocmds:** dont jump to last loc in gitcommit buffers ([65c70f6](https://github.com/LazyVim/LazyVim/commit/65c70f6ad7e386b54d2aa6dbe137c37ee1d3cb88))
|
||||
|
||||
## [4.20.1](https://github.com/LazyVim/LazyVim/compare/v4.20.0...v4.20.1) (2023-06-29)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **catppuccin:** change nvim-tree integration to neo-tree for catppuccin/nvim plugin ([#1003](https://github.com/LazyVim/LazyVim/issues/1003)) ([2f2c7a3](https://github.com/LazyVim/LazyVim/commit/2f2c7a32a4115d06c3bb2b12e6d55f163d701bb3))
|
||||
* **yanky:** don't override c-p insert mode telescope mapping. Fixes [#1007](https://github.com/LazyVim/LazyVim/issues/1007) ([8b1e797](https://github.com/LazyVim/LazyVim/commit/8b1e7976a004d7e0cbaec37546d2889ddab48bbb))
|
||||
|
||||
## [4.20.0](https://github.com/LazyVim/LazyVim/compare/v4.19.1...v4.20.0) (2023-06-28)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **extras:** added yanky extra (yank-ring) ([a1820c1](https://github.com/LazyVim/LazyVim/commit/a1820c1b428fc7f72fc31ea8465260b1816349ab))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **yanky:** use leader-p for telescope integration ([e83d2c8](https://github.com/LazyVim/LazyVim/commit/e83d2c814f336470fa212cef2f03ceb8ac173012))
|
||||
|
||||
## [4.19.1](https://github.com/LazyVim/LazyVim/compare/v4.19.0...v4.19.1) (2023-06-27)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **flash:** don't override `R` in normal mode ([c5759a4](https://github.com/LazyVim/LazyVim/commit/c5759a451f8a5635b5c2d19c82636c8b66676a3b))
|
||||
* **mini.files:** changed some window widths ([d1eb9c8](https://github.com/LazyVim/LazyVim/commit/d1eb9c89d3d2959d6d106b0c11c12b21fb3bbf50))
|
||||
|
||||
## [4.19.0](https://github.com/LazyVim/LazyVim/compare/v4.18.0...v4.19.0) (2023-06-26)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **flash:** added treesiter search to show ts node labels around search matches ([5e6a072](https://github.com/LazyVim/LazyVim/commit/5e6a07200c0cc0a21167a341c1f29bf27dc35f02))
|
||||
|
||||
## [4.18.0](https://github.com/LazyVim/LazyVim/compare/v4.17.0...v4.18.0) (2023-06-25)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **flash:** enable flash in vscode ([f6f8436](https://github.com/LazyVim/LazyVim/commit/f6f8436fe8696a8934a28a1fd21bf28409fee7ab))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **edgy:** corrected filetype for symbols outline ([d5a9c54](https://github.com/LazyVim/LazyVim/commit/d5a9c54faf2a41355d4e2e14b050af188a49365a))
|
||||
* **keymaps:** remove redundant ':' on lazy keymap ([#977](https://github.com/LazyVim/LazyVim/issues/977)) ([e9358d9](https://github.com/LazyVim/LazyVim/commit/e9358d977a379e54d73dd29691d60f7a51ed6923))
|
||||
|
||||
## [4.17.0](https://github.com/LazyVim/LazyVim/compare/v4.16.0...v4.17.0) (2023-06-24)
|
||||
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
*LazyVim.txt* For Neovim >= 0.8.0 Last change: 2023 June 24
|
||||
*LazyVim.txt* For Neovim >= 0.8.0 Last change: 2023 July 06
|
||||
|
||||
==============================================================================
|
||||
Table of Contents *LazyVim-table-of-contents*
|
||||
|
@ -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
|
||||
|
@ -89,7 +89,7 @@ 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" })
|
||||
@ -112,8 +112,8 @@ map("n", "<leader>ul", function() Util.toggle("relativenumber", true) Util.toggl
|
||||
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.buf.inlay_hint then
|
||||
map("n", "<leader>uh", function() vim.lsp.buf.inlay_hint(0, nil) end, { desc = "Toggle Inlay Hints" })
|
||||
if vim.lsp.inlay_hint then
|
||||
map("n", "<leader>uh", function() vim.lsp.inlay_hint(0, nil) end, { desc = "Toggle Inlay Hints" })
|
||||
end
|
||||
|
||||
-- lazygit
|
||||
|
@ -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,
|
||||
},
|
||||
|
@ -20,6 +20,7 @@ return {
|
||||
illuminate = true,
|
||||
indent_blankline = { enabled = true },
|
||||
lsp_trouble = true,
|
||||
mason = true,
|
||||
mini = true,
|
||||
native_lsp = {
|
||||
enabled = true,
|
||||
@ -34,7 +35,7 @@ return {
|
||||
neotest = true,
|
||||
noice = true,
|
||||
notify = true,
|
||||
nvimtree = true,
|
||||
neotree = true,
|
||||
semantic_tokens = true,
|
||||
telescope = true,
|
||||
treesitter = true,
|
||||
|
@ -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,
|
||||
},
|
||||
}
|
||||
|
43
lua/lazyvim/plugins/extras/coding/yanky.lua
Normal file
43
lua/lazyvim/plugins/extras/coding/yanky.lua
Normal 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" },
|
||||
},
|
||||
},
|
||||
}
|
@ -4,6 +4,7 @@ return {
|
||||
{
|
||||
"folke/flash.nvim",
|
||||
event = "VeryLazy",
|
||||
vscode = true,
|
||||
---@type Flash.Config
|
||||
opts = {},
|
||||
keys = {
|
||||
@ -31,6 +32,22 @@ return {
|
||||
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",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
@ -40,7 +57,7 @@ return {
|
||||
local function flash(prompt_bufnr)
|
||||
require("flash").jump({
|
||||
pattern = "^",
|
||||
highlight = { label = { after = { 0, 0 } } },
|
||||
label = { after = { 0, 0 } },
|
||||
search = {
|
||||
mode = "search",
|
||||
exclude = {
|
||||
|
@ -3,6 +3,8 @@ return {
|
||||
opts = {
|
||||
windows = {
|
||||
preview = true,
|
||||
width_focus = 30,
|
||||
width_preview = 30,
|
||||
},
|
||||
options = {
|
||||
-- Whether to use for editing directories
|
||||
@ -30,8 +32,12 @@ return {
|
||||
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 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
|
||||
|
152
lua/lazyvim/plugins/extras/lang/clangd.lua
Normal file
152
lua/lazyvim/plugins/extras/lang/clangd.lua
Normal 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,
|
||||
},
|
||||
}
|
32
lua/lazyvim/plugins/extras/lang/elixir.lua
Normal file
32
lua/lazyvim/plugins/extras/lang/elixir.lua
Normal 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"] = {},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
@ -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,
|
||||
|
67
lua/lazyvim/plugins/extras/lang/python.lua
Normal file
67
lua/lazyvim/plugins/extras/lang/python.lua
Normal 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" } },
|
||||
},
|
||||
}
|
152
lua/lazyvim/plugins/extras/lang/rust.lua
Normal file
152
lua/lazyvim/plugins/extras/lang/rust.lua
Normal 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"] = {},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
33
lua/lazyvim/plugins/extras/lang/terraform.lua
Normal file
33
lua/lazyvim/plugins/extras/lang/terraform.lua
Normal 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,
|
||||
},
|
||||
}
|
@ -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,
|
||||
|
@ -109,7 +109,7 @@ return {
|
||||
if Util.has("symbols-outline.nvim") then
|
||||
table.insert(opts.left, {
|
||||
title = "Outline",
|
||||
ft = "outline",
|
||||
ft = "Outline",
|
||||
pinned = true,
|
||||
open = "SymbolsOutline",
|
||||
})
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -57,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 = {
|
||||
@ -92,16 +96,30 @@ 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
|
||||
|
||||
if opts.inlay_hints.enabled and vim.lsp.buf.inlay_hint then
|
||||
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
|
||||
vim.lsp.buf.inlay_hint(buffer, true)
|
||||
inlay_hint(buffer, true)
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
@ -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
|
||||
|
@ -17,7 +17,7 @@ end
|
||||
|
||||
---@param plugin string
|
||||
function M.has(plugin)
|
||||
return require("lazy.core.config").plugins[plugin] ~= nil
|
||||
return require("lazy.core.config").spec.plugins[plugin] ~= nil
|
||||
end
|
||||
|
||||
function M.fg(name)
|
||||
|
Reference in New Issue
Block a user