mirror of
https://github.com/LazyVim/LazyVim.git
synced 2026-07-25 14:01:06 +00:00
Merge branch 'main' into lang-ts-dap-fixes
This commit is contained in:
commit
b697442a3e
30 changed files with 510 additions and 153 deletions
10
.github/workflows/ci.yml
vendored
10
.github/workflows/ci.yml
vendored
|
|
@ -11,7 +11,7 @@ jobs:
|
||||||
os: [ubuntu-latest]
|
os: [ubuntu-latest]
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v4
|
||||||
- name: Install Neovim
|
- name: Install Neovim
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
|
|
@ -31,7 +31,7 @@ jobs:
|
||||||
needs: tests
|
needs: tests
|
||||||
if: ${{ github.ref == 'refs/heads/main' }}
|
if: ${{ github.ref == 'refs/heads/main' }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v4
|
||||||
- name: panvimdoc
|
- name: panvimdoc
|
||||||
uses: kdheepak/panvimdoc@main
|
uses: kdheepak/panvimdoc@main
|
||||||
with:
|
with:
|
||||||
|
|
@ -40,7 +40,7 @@ jobs:
|
||||||
demojify: true
|
demojify: true
|
||||||
treesitter: true
|
treesitter: true
|
||||||
- name: Push changes
|
- name: Push changes
|
||||||
uses: stefanzweifel/git-auto-commit-action@v4
|
uses: stefanzweifel/git-auto-commit-action@v5
|
||||||
with:
|
with:
|
||||||
commit_message: "chore(build): auto-generate vimdoc"
|
commit_message: "chore(build): auto-generate vimdoc"
|
||||||
commit_user_name: "github-actions[bot]"
|
commit_user_name: "github-actions[bot]"
|
||||||
|
|
@ -54,14 +54,14 @@ jobs:
|
||||||
- tests
|
- tests
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: google-github-actions/release-please-action@v3
|
- uses: google-github-actions/release-please-action@v4
|
||||||
id: release
|
id: release
|
||||||
with:
|
with:
|
||||||
release-type: simple
|
release-type: simple
|
||||||
package-name: LazyVim
|
package-name: LazyVim
|
||||||
extra-files: |
|
extra-files: |
|
||||||
lua/lazyvim/config/init.lua
|
lua/lazyvim/config/init.lua
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v4
|
||||||
- name: tag stable versions
|
- name: tag stable versions
|
||||||
if: ${{ steps.release.outputs.release_created }}
|
if: ${{ steps.release.outputs.release_created }}
|
||||||
run: |
|
run: |
|
||||||
|
|
|
||||||
51
CHANGELOG.md
51
CHANGELOG.md
|
|
@ -1,5 +1,56 @@
|
||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## [10.24.0](https://github.com/LazyVim/LazyVim/compare/v10.23.0...v10.24.0) (2024-05-12)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **mason-lspconfig:** allow `opts.ensure_installed` to be taken into account ([#3134](https://github.com/LazyVim/LazyVim/issues/3134)) ([8968c9e](https://github.com/LazyVim/LazyVim/commit/8968c9e9ea76f3a7616d9e249a3c9307a75fffad))
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **neo-tree:** correctly set up `cwd` ([#3097](https://github.com/LazyVim/LazyVim/issues/3097)) ([30ce84f](https://github.com/LazyVim/LazyVim/commit/30ce84f7a7fb4e88b47ddf2f569b2ea9b7d56717))
|
||||||
|
* **ui:** don't lazy-load dashboard-nvim ([#3107](https://github.com/LazyVim/LazyVim/issues/3107)) ([30c9e47](https://github.com/LazyVim/LazyVim/commit/30c9e4718a127f7d5a32f11c4d8dbba6b01f9858))
|
||||||
|
|
||||||
|
## [10.23.0](https://github.com/LazyVim/LazyVim/compare/v10.22.0...v10.23.0) (2024-05-03)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **lualine:** make path trimming configurable by user ([#3062](https://github.com/LazyVim/LazyVim/issues/3062)) ([b8475f5](https://github.com/LazyVim/LazyVim/commit/b8475f51949acf195729a1c4d057a06208a9add9))
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **dot:** can't match kitty conf file ([#3042](https://github.com/LazyVim/LazyVim/issues/3042)) ([5fb4cf0](https://github.com/LazyVim/LazyVim/commit/5fb4cf0d365b65cb9b7afa8be047973b5fc1747a))
|
||||||
|
* **dot:** install when list is empty ([#3052](https://github.com/LazyVim/LazyVim/issues/3052)) ([3086bf0](https://github.com/LazyVim/LazyVim/commit/3086bf03e96bfc0048e5b27f8d65a9170bca3f67))
|
||||||
|
* **extras:** Rust-Analyzer cargo option ([#3061](https://github.com/LazyVim/LazyVim/issues/3061)) ([a96348d](https://github.com/LazyVim/LazyVim/commit/a96348d7b076819f7580ea0c0ce467630bfc7cc5))
|
||||||
|
* **native_snippets:** Fix native_snippets for `vim.snippet api` changes ([#3083](https://github.com/LazyVim/LazyVim/issues/3083)) ([6004e8d](https://github.com/LazyVim/LazyVim/commit/6004e8d4f60549bd2c5d6f3187a28d72b21e3261))
|
||||||
|
* **python:** make both `ruff` and `ruff_lsp` available to user ([#3060](https://github.com/LazyVim/LazyVim/issues/3060)) ([34183a2](https://github.com/LazyVim/LazyVim/commit/34183a2759828001b08679659f7d5170d7ec367e))
|
||||||
|
|
||||||
|
## [10.22.0](https://github.com/LazyVim/LazyVim/compare/v10.21.1...v10.22.0) (2024-04-22)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **dot:** add bashls and shellcheck ([#2879](https://github.com/LazyVim/LazyVim/issues/2879)) ([97480dc](https://github.com/LazyVim/LazyVim/commit/97480dc5d2dbb717b45a351e0b04835f138a9094))
|
||||||
|
* **dot:** add more filetypes ([#2987](https://github.com/LazyVim/LazyVim/issues/2987)) ([15b09e8](https://github.com/LazyVim/LazyVim/commit/15b09e800ba7fb0c9ca8270a77e71083396e9db1))
|
||||||
|
* **git:** `<leader>gb` for Git Blame Line ([9e3af10](https://github.com/LazyVim/LazyVim/commit/9e3af1070fc1932da322105708ebb32a2cd9572b))
|
||||||
|
* **python:** use new `ruff` instead of `ruff_lsp` ([#3016](https://github.com/LazyVim/LazyVim/issues/3016)) ([cd04b58](https://github.com/LazyVim/LazyVim/commit/cd04b58fe3f7299fbca75e7eb47287617ac23fcf))
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **edgy:** proper way of opening neo-tree. Fixes [#2984](https://github.com/LazyVim/LazyVim/issues/2984) ([6fdbc62](https://github.com/LazyVim/LazyVim/commit/6fdbc623e0a59220e754800df3b86788eca0813d))
|
||||||
|
* **harpoon:** harpoon2 deprecated message ([#2920](https://github.com/LazyVim/LazyVim/issues/2920)) ([79fed97](https://github.com/LazyVim/LazyVim/commit/79fed97f2357b2969cb23d106137978ca7cdffb4))
|
||||||
|
* **harpoon:** optimizes harpoon keys ([#2877](https://github.com/LazyVim/LazyVim/issues/2877)) ([50b7f42](https://github.com/LazyVim/LazyVim/commit/50b7f426f287ecfc542dd9c197e430b0aca8af04))
|
||||||
|
* **mini.pairs:** better default for ```` ([32eacde](https://github.com/LazyVim/LazyVim/commit/32eacde793fddcca0bcfbbd494b6aa8b2c870d0f))
|
||||||
|
* **toggle:** use new `inlay_hint.enable()` signature ([#3013](https://github.com/LazyVim/LazyVim/issues/3013)) ([5f92dc5](https://github.com/LazyVim/LazyVim/commit/5f92dc5304b99a3e76dca878d9b47557fb64f384))
|
||||||
|
* **trouble_v3:** keymap `previous` is deprecated, use `prev` instead ([#2968](https://github.com/LazyVim/LazyVim/issues/2968)) ([0fa6360](https://github.com/LazyVim/LazyVim/commit/0fa63603afcb9b478c49a54d94314d20af00ae95))
|
||||||
|
* **trouble_v3:** show error only when `trouble_v3` is enabled ([#2989](https://github.com/LazyVim/LazyVim/issues/2989)) ([ceb4855](https://github.com/LazyVim/LazyVim/commit/ceb4855b434c8e7095bbf47cfc3b3647532d6a2c))
|
||||||
|
* **trouble-v3:** fix telescope integration ([9da13ef](https://github.com/LazyVim/LazyVim/commit/9da13ef7e8a0b6c07e8e35f7c93dc77f3408d38b))
|
||||||
|
|
||||||
## [10.21.1](https://github.com/LazyVim/LazyVim/compare/v10.21.0...v10.21.1) (2024-03-29)
|
## [10.21.1](https://github.com/LazyVim/LazyVim/compare/v10.21.0...v10.21.1) (2024-03-29)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 April 11
|
*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 May 15
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
Table of Contents *LazyVim-table-of-contents*
|
Table of Contents *LazyVim-table-of-contents*
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
-- This file is automatically loaded by lazyvim.config.init
|
-- This file is automatically loaded by lazyvim.config.init
|
||||||
|
|
||||||
-- DO NOT USE THIS IN YOU OWN CONFIG!!
|
-- DO NOT USE `LazyVim.safe_keymap_set` IN YOUR OWN CONFIG!!
|
||||||
-- use `vim.keymap.set` instead
|
-- use `vim.keymap.set` instead
|
||||||
local map = LazyVim.safe_keymap_set
|
local map = LazyVim.safe_keymap_set
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,6 @@
|
||||||
|
local have_make = vim.fn.executable("make") == 1
|
||||||
|
local have_cmake = vim.fn.executable("cmake") == 1
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|
||||||
-- file explorer
|
-- file explorer
|
||||||
|
|
@ -41,13 +44,24 @@ return {
|
||||||
vim.cmd([[Neotree close]])
|
vim.cmd([[Neotree close]])
|
||||||
end,
|
end,
|
||||||
init = function()
|
init = function()
|
||||||
if vim.fn.argc(-1) == 1 then
|
-- FIX: use `autocmd` for lazy-loading neo-tree instead of directly requiring it,
|
||||||
local stat = vim.uv.fs_stat(vim.fn.argv(0))
|
-- because `cwd` is not set up properly.
|
||||||
if stat and stat.type == "directory" then
|
vim.api.nvim_create_autocmd("BufEnter", {
|
||||||
|
group = vim.api.nvim_create_augroup("Neotree_start_directory", { clear = true }),
|
||||||
|
desc = "Start Neo-tree with directory",
|
||||||
|
once = true,
|
||||||
|
callback = function()
|
||||||
|
if package.loaded["neo-tree"] then
|
||||||
|
return
|
||||||
|
else
|
||||||
|
local stats = vim.uv.fs_stat(vim.fn.argv(0))
|
||||||
|
if stats and stats.type == "directory" then
|
||||||
require("neo-tree")
|
require("neo-tree")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
|
})
|
||||||
|
end,
|
||||||
opts = {
|
opts = {
|
||||||
sources = { "filesystem", "buffers", "git_status", "document_symbols" },
|
sources = { "filesystem", "buffers", "git_status", "document_symbols" },
|
||||||
open_files_do_not_replace_types = { "terminal", "Trouble", "trouble", "qf", "Outline" },
|
open_files_do_not_replace_types = { "terminal", "Trouble", "trouble", "qf", "Outline" },
|
||||||
|
|
@ -130,12 +144,23 @@ return {
|
||||||
dependencies = {
|
dependencies = {
|
||||||
{
|
{
|
||||||
"nvim-telescope/telescope-fzf-native.nvim",
|
"nvim-telescope/telescope-fzf-native.nvim",
|
||||||
build = vim.fn.executable("make") == 1 and "make"
|
build = have_make and "make"
|
||||||
or "cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release && cmake --install build --prefix build",
|
or "cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release && cmake --install build --prefix build",
|
||||||
enabled = vim.fn.executable("make") == 1 or vim.fn.executable("cmake") == 1,
|
enabled = have_make or have_cmake,
|
||||||
config = function()
|
config = function(plugin)
|
||||||
LazyVim.on_load("telescope.nvim", function()
|
LazyVim.on_load("telescope.nvim", function()
|
||||||
require("telescope").load_extension("fzf")
|
local ok, err = pcall(require("telescope").load_extension, "fzf")
|
||||||
|
if not ok then
|
||||||
|
local lib = plugin.dir .. "/build/libfzf." .. (LazyVim.is_win() and "dll" or "so")
|
||||||
|
if not vim.uv.fs_stat(lib) then
|
||||||
|
LazyVim.warn("`telescope-fzf-native.nvim` not built. Rebuilding...")
|
||||||
|
require("lazy").build({ plugins = { plugin }, show = false }):wait(function()
|
||||||
|
LazyVim.info("Rebuilding `telescope-fzf-native.nvim` done.\nPlease restart Neovim.")
|
||||||
|
end)
|
||||||
|
else
|
||||||
|
LazyVim.error("Failed to load `telescope-fzf-native.nvim`:\n" .. err)
|
||||||
|
end
|
||||||
|
end
|
||||||
end)
|
end)
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -11,18 +11,23 @@ return {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"nvim-cmp",
|
"nvim-cmp",
|
||||||
opts = {
|
dependencies = {
|
||||||
snippet = {
|
{ "rafamadriz/friendly-snippets" },
|
||||||
|
{ "garymjr/nvim-snippets", opts = { friendly_snippets = true } },
|
||||||
|
},
|
||||||
|
opts = function(_, opts)
|
||||||
|
opts.snippet = {
|
||||||
expand = function(args)
|
expand = function(args)
|
||||||
vim.snippet.expand(args.body)
|
vim.snippet.expand(args.body)
|
||||||
end,
|
end,
|
||||||
},
|
}
|
||||||
},
|
table.insert(opts.sources, { name = "snippets" })
|
||||||
|
end,
|
||||||
keys = {
|
keys = {
|
||||||
{
|
{
|
||||||
"<Tab>",
|
"<Tab>",
|
||||||
function()
|
function()
|
||||||
if vim.snippet.jumpable(1) then
|
if vim.snippet.active({ direction = 1 }) then
|
||||||
vim.schedule(function()
|
vim.schedule(function()
|
||||||
vim.snippet.jump(1)
|
vim.snippet.jump(1)
|
||||||
end)
|
end)
|
||||||
|
|
@ -47,7 +52,7 @@ return {
|
||||||
{
|
{
|
||||||
"<S-Tab>",
|
"<S-Tab>",
|
||||||
function()
|
function()
|
||||||
if vim.snippet.jumpable(-1) then
|
if vim.snippet.active({ direction = -1 }) then
|
||||||
vim.schedule(function()
|
vim.schedule(function()
|
||||||
vim.snippet.jump(-1)
|
vim.snippet.jump(-1)
|
||||||
end)
|
end)
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ return {
|
||||||
"gbprod/yanky.nvim",
|
"gbprod/yanky.nvim",
|
||||||
dependencies = not LazyVim.is_win() and { "kkharji/sqlite.lua" } or {},
|
dependencies = not LazyVim.is_win() and { "kkharji/sqlite.lua" } or {},
|
||||||
opts = {
|
opts = {
|
||||||
highlight = { timer = 250 },
|
highlight = { timer = 150 },
|
||||||
ring = { storage = LazyVim.is_win() and "shada" or "sqlite" },
|
ring = { storage = LazyVim.is_win() and "shada" or "sqlite" },
|
||||||
},
|
},
|
||||||
keys = {
|
keys = {
|
||||||
|
|
@ -28,5 +28,11 @@ return {
|
||||||
{ "=p", "<Plug>(YankyPutAfterFilter)", desc = "Put After Applying a Filter" },
|
{ "=p", "<Plug>(YankyPutAfterFilter)", desc = "Put After Applying a Filter" },
|
||||||
{ "=P", "<Plug>(YankyPutBeforeFilter)", desc = "Put Before Applying a Filter" },
|
{ "=P", "<Plug>(YankyPutBeforeFilter)", desc = "Put Before Applying a Filter" },
|
||||||
},
|
},
|
||||||
|
config = function(_, opts)
|
||||||
|
require("yanky").setup(opts)
|
||||||
|
local sqlite = require("yanky.storage.sqlite")
|
||||||
|
local push = sqlite.push
|
||||||
|
sqlite.push = vim.schedule_wrap(push)
|
||||||
|
end,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -26,8 +26,6 @@ return {
|
||||||
},
|
},
|
||||||
opts = {},
|
opts = {},
|
||||||
config = function(_, opts)
|
config = function(_, opts)
|
||||||
-- setup dap config by VsCode launch.json file
|
|
||||||
-- require("dap.ext.vscode").load_launchjs()
|
|
||||||
local dap = require("dap")
|
local dap = require("dap")
|
||||||
local dapui = require("dapui")
|
local dapui = require("dapui")
|
||||||
dapui.setup(opts)
|
dapui.setup(opts)
|
||||||
|
|
@ -81,6 +79,11 @@ return {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
-- VsCode launch.json parser
|
||||||
|
{
|
||||||
|
"folke/neoconf.nvim",
|
||||||
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
-- stylua: ignore
|
-- stylua: ignore
|
||||||
|
|
@ -115,5 +118,10 @@ return {
|
||||||
{ text = sign[1], texthl = sign[2] or "DiagnosticInfo", linehl = sign[3], numhl = sign[3] }
|
{ text = sign[1], texthl = sign[2] or "DiagnosticInfo", linehl = sign[3], numhl = sign[3] }
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- setup dap config by VsCode launch.json file
|
||||||
|
local vscode = require("dap.ext.vscode")
|
||||||
|
vscode.json_decode = require("neoconf.json.jsonc").decode_jsonc
|
||||||
|
vscode.load_launchjs()
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,9 @@ M.dials_by_ft = {}
|
||||||
---@param increment boolean
|
---@param increment boolean
|
||||||
---@param g? boolean
|
---@param g? boolean
|
||||||
function M.dial(increment, g)
|
function M.dial(increment, g)
|
||||||
local is_visual = vim.fn.mode(true):sub(1, 1) == "v"
|
local mode = vim.fn.mode(true)
|
||||||
|
-- Use visual commands for VISUAL 'v', VISUAL LINE 'V' and VISUAL BLOCK '\22'
|
||||||
|
local is_visual = mode == "v" or mode == "V" or mode == "\22"
|
||||||
local func = (increment and "inc" or "dec") .. (g and "_g" or "_") .. (is_visual and "visual" or "normal")
|
local func = (increment and "inc" or "dec") .. (g and "_g" or "_") .. (is_visual and "visual" or "normal")
|
||||||
local group = M.dials_by_ft[vim.bo.filetype] or "default"
|
local group = M.dials_by_ft[vim.bo.filetype] or "default"
|
||||||
return require("dial.map")[func](group)
|
return require("dial.map")[func](group)
|
||||||
|
|
|
||||||
|
|
@ -5,13 +5,16 @@ return {
|
||||||
menu = {
|
menu = {
|
||||||
width = vim.api.nvim_win_get_width(0) - 4,
|
width = vim.api.nvim_win_get_width(0) - 4,
|
||||||
},
|
},
|
||||||
|
settings = {
|
||||||
|
save_on_toggle = true,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
keys = function()
|
keys = function()
|
||||||
local keys = {
|
local keys = {
|
||||||
{
|
{
|
||||||
"<leader>H",
|
"<leader>H",
|
||||||
function()
|
function()
|
||||||
require("harpoon"):list():append()
|
require("harpoon"):list():add()
|
||||||
end,
|
end,
|
||||||
desc = "Harpoon File",
|
desc = "Harpoon File",
|
||||||
},
|
},
|
||||||
|
|
@ -22,7 +25,7 @@ return {
|
||||||
harpoon.ui:toggle_quick_menu(harpoon:list())
|
harpoon.ui:toggle_quick_menu(harpoon:list())
|
||||||
end,
|
end,
|
||||||
desc = "Harpoon Quick Menu",
|
desc = "Harpoon Quick Menu",
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
for i = 1, 5 do
|
for i = 1, 5 do
|
||||||
|
|
@ -35,5 +38,5 @@ return {
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
return keys
|
return keys
|
||||||
end
|
end,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
125
lua/lazyvim/plugins/extras/editor/refactoring.lua
Normal file
125
lua/lazyvim/plugins/extras/editor/refactoring.lua
Normal file
|
|
@ -0,0 +1,125 @@
|
||||||
|
return {
|
||||||
|
{
|
||||||
|
"ThePrimeagen/refactoring.nvim",
|
||||||
|
event = { "BufReadPre", "BufNewFile" },
|
||||||
|
dependencies = {
|
||||||
|
"nvim-lua/plenary.nvim",
|
||||||
|
"nvim-treesitter/nvim-treesitter",
|
||||||
|
},
|
||||||
|
keys = {
|
||||||
|
{
|
||||||
|
"<leader>rs",
|
||||||
|
function()
|
||||||
|
require("telescope").extensions.refactoring.refactors()
|
||||||
|
end,
|
||||||
|
mode = "v",
|
||||||
|
desc = "Refactor",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"<leader>ri",
|
||||||
|
function()
|
||||||
|
require("refactoring").refactor("Inline Variable")
|
||||||
|
end,
|
||||||
|
mode = { "n", "v" },
|
||||||
|
desc = "Inline Variable",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"<leader>rb",
|
||||||
|
function()
|
||||||
|
require("refactoring").refactor("Extract Block")
|
||||||
|
end,
|
||||||
|
desc = "Extract Block",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"<leader>rf",
|
||||||
|
function()
|
||||||
|
require("refactoring").refactor("Extract Block To File")
|
||||||
|
end,
|
||||||
|
desc = "Extract Block To File",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"<leader>rP",
|
||||||
|
function()
|
||||||
|
require("refactoring").debug.printf({ below = false })
|
||||||
|
end,
|
||||||
|
desc = "Debug Print",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"<leader>rp",
|
||||||
|
function()
|
||||||
|
require("refactoring").debug.print_var({ normal = true })
|
||||||
|
end,
|
||||||
|
desc = "Debug Print Variable",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"<leader>rc",
|
||||||
|
function()
|
||||||
|
require("refactoring").debug.cleanup({})
|
||||||
|
end,
|
||||||
|
desc = "Debug Cleanup",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"<leader>rf",
|
||||||
|
function()
|
||||||
|
require("refactoring").refactor("Extract Function")
|
||||||
|
end,
|
||||||
|
mode = "v",
|
||||||
|
desc = "Extract Function",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"<leader>rF",
|
||||||
|
function()
|
||||||
|
require("refactoring").refactor("Extract Function To File")
|
||||||
|
end,
|
||||||
|
mode = "v",
|
||||||
|
desc = "Extract Function To File",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"<leader>rx",
|
||||||
|
function()
|
||||||
|
require("refactoring").refactor("Extract Variable")
|
||||||
|
end,
|
||||||
|
mode = "v",
|
||||||
|
desc = "Extract Variable",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"<leader>rp",
|
||||||
|
function()
|
||||||
|
require("refactoring").debug.print_var()
|
||||||
|
end,
|
||||||
|
mode = "v",
|
||||||
|
desc = "Debug Print Variable",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
opts = {
|
||||||
|
prompt_func_return_type = {
|
||||||
|
go = false,
|
||||||
|
java = false,
|
||||||
|
cpp = false,
|
||||||
|
c = false,
|
||||||
|
h = false,
|
||||||
|
hpp = false,
|
||||||
|
cxx = false,
|
||||||
|
},
|
||||||
|
prompt_func_param_type = {
|
||||||
|
go = false,
|
||||||
|
java = false,
|
||||||
|
cpp = false,
|
||||||
|
c = false,
|
||||||
|
h = false,
|
||||||
|
hpp = false,
|
||||||
|
cxx = false,
|
||||||
|
},
|
||||||
|
printf_statements = {},
|
||||||
|
print_var_statements = {},
|
||||||
|
},
|
||||||
|
config = function(_, opts)
|
||||||
|
require("refactoring").setup(opts)
|
||||||
|
if LazyVim.has("telescope.nvim") then
|
||||||
|
LazyVim.on_load("telescope.nvim", function()
|
||||||
|
require("telescope").load_extension("refactoring")
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
local Config = require("lazyvim.config")
|
local Config = require("lazyvim.config")
|
||||||
|
|
||||||
for _, other in ipairs({ "aerial", "outline" }) do
|
if vim.tbl_contains(Config.json.data.extras, "lazyvim.plugins.extras.editor.trouble-v3") then
|
||||||
|
for _, other in ipairs({ "aerial", "outline" }) do
|
||||||
local extra = "lazyvim.plugins.extras.editor." .. other
|
local extra = "lazyvim.plugins.extras.editor." .. other
|
||||||
if vim.tbl_contains(Config.json.data.extras, extra) then
|
if vim.tbl_contains(Config.json.data.extras, extra) then
|
||||||
other = other:gsub("^%l", string.upper)
|
other = other:gsub("^%l", string.upper)
|
||||||
|
|
@ -10,6 +11,7 @@ for _, other in ipairs({ "aerial", "outline" }) do
|
||||||
"Please disable it in your config.",
|
"Please disable it in your config.",
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|
@ -27,6 +29,20 @@ return {
|
||||||
},
|
},
|
||||||
{ "<leader>xL", "<cmd>Trouble loclist toggle<cr>", desc = "Location List (Trouble)" },
|
{ "<leader>xL", "<cmd>Trouble loclist toggle<cr>", desc = "Location List (Trouble)" },
|
||||||
{ "<leader>xQ", "<cmd>Trouble qflist toggle<cr>", desc = "Quickfix List (Trouble)" },
|
{ "<leader>xQ", "<cmd>Trouble qflist toggle<cr>", desc = "Quickfix List (Trouble)" },
|
||||||
|
{
|
||||||
|
"[q",
|
||||||
|
function()
|
||||||
|
if require("trouble").is_open() then
|
||||||
|
require("trouble").prev({ skip_groups = true, jump = true })
|
||||||
|
else
|
||||||
|
local ok, err = pcall(vim.cmd.cprev)
|
||||||
|
if not ok then
|
||||||
|
vim.notify(err, vim.log.levels.ERROR)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
desc = "Previous Trouble/Quickfix Item",
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -74,4 +90,22 @@ return {
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
"nvim-telescope/telescope.nvim",
|
||||||
|
optional = true,
|
||||||
|
opts = function(_, opts)
|
||||||
|
local open_with_trouble = require("trouble.sources.telescope").open
|
||||||
|
return vim.tbl_deep_extend("force", opts, {
|
||||||
|
defaults = {
|
||||||
|
mappings = {
|
||||||
|
i = {
|
||||||
|
["<c-t>"] = open_with_trouble,
|
||||||
|
["<a-t>"] = open_with_trouble,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -25,12 +25,14 @@ return {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"mfussenegger/nvim-ansible",
|
"mfussenegger/nvim-ansible",
|
||||||
|
ft = {},
|
||||||
keys = {
|
keys = {
|
||||||
{
|
{
|
||||||
"<leader>tr",
|
"<leader>ta",
|
||||||
function()
|
function()
|
||||||
require("ansible").run()
|
require("ansible").run()
|
||||||
end,
|
end,
|
||||||
|
desc = "Ansible Run Playbook/Role",
|
||||||
silent = true,
|
silent = true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -144,7 +144,7 @@ return {
|
||||||
type = "codelldb",
|
type = "codelldb",
|
||||||
request = "attach",
|
request = "attach",
|
||||||
name = "Attach to process",
|
name = "Attach to process",
|
||||||
processId = require("dap.utils").pick_process,
|
pid = require("dap.utils").pick_process,
|
||||||
cwd = "${workspaceFolder}",
|
cwd = "${workspaceFolder}",
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -96,4 +96,18 @@ return {
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"nvim-neotest/neotest",
|
||||||
|
optional = true,
|
||||||
|
dependencies = {
|
||||||
|
"Issafalcon/neotest-dotnet",
|
||||||
|
},
|
||||||
|
opts = {
|
||||||
|
adapters = {
|
||||||
|
["neotest-dotnet"] = {
|
||||||
|
-- Here we can set options for neotest-dotnet
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,9 +2,11 @@ if lazyvim_docs then
|
||||||
-- LSP Server to use for Python.
|
-- LSP Server to use for Python.
|
||||||
-- Set to "basedpyright" to use basedpyright instead of pyright.
|
-- Set to "basedpyright" to use basedpyright instead of pyright.
|
||||||
vim.g.lazyvim_python_lsp = "pyright"
|
vim.g.lazyvim_python_lsp = "pyright"
|
||||||
|
vim.g.lazyvim_python_ruff = "ruff_lsp"
|
||||||
end
|
end
|
||||||
|
|
||||||
local lsp = vim.g.lazyvim_python_lsp or "pyright"
|
local lsp = vim.g.lazyvim_python_lsp or "pyright"
|
||||||
|
local ruff = vim.g.lazyvim_python_ruff or "ruff_lsp"
|
||||||
|
|
||||||
return {
|
return {
|
||||||
{
|
{
|
||||||
|
|
@ -29,6 +31,12 @@ return {
|
||||||
enabled = true,
|
enabled = true,
|
||||||
},
|
},
|
||||||
ruff_lsp = {
|
ruff_lsp = {
|
||||||
|
enabled = ruff == "ruff_lsp",
|
||||||
|
},
|
||||||
|
ruff = {
|
||||||
|
enabled = ruff == "ruff",
|
||||||
|
},
|
||||||
|
[ruff] = {
|
||||||
keys = {
|
keys = {
|
||||||
{
|
{
|
||||||
"<leader>co",
|
"<leader>co",
|
||||||
|
|
@ -47,9 +55,9 @@ return {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
setup = {
|
setup = {
|
||||||
ruff_lsp = function()
|
[ruff] = function()
|
||||||
LazyVim.lsp.on_attach(function(client, _)
|
LazyVim.lsp.on_attach(function(client, _)
|
||||||
if client.name == "ruff_lsp" then
|
if client.name == ruff then
|
||||||
-- Disable hover in favor of Pyright
|
-- Disable hover in favor of Pyright
|
||||||
client.server_capabilities.hoverProvider = false
|
client.server_capabilities.hoverProvider = false
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ return {
|
||||||
"Saecki/crates.nvim",
|
"Saecki/crates.nvim",
|
||||||
event = { "BufRead Cargo.toml" },
|
event = { "BufRead Cargo.toml" },
|
||||||
opts = {
|
opts = {
|
||||||
src = {
|
completion = {
|
||||||
cmp = { enabled = true },
|
cmp = { enabled = true },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
@ -60,7 +60,9 @@ return {
|
||||||
cargo = {
|
cargo = {
|
||||||
allFeatures = true,
|
allFeatures = true,
|
||||||
loadOutDirsFromCheck = true,
|
loadOutDirsFromCheck = true,
|
||||||
runBuildScripts = true,
|
buildScripts = {
|
||||||
|
enable = true,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
-- Add clippy lints for Rust.
|
-- Add clippy lints for Rust.
|
||||||
checkOnSave = {
|
checkOnSave = {
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,14 @@ return {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
-- ensure terraform tools are installed
|
||||||
|
{
|
||||||
|
"williamboman/mason.nvim",
|
||||||
|
opts = function(_, opts)
|
||||||
|
opts.ensure_installed = opts.ensure_installed or {}
|
||||||
|
vim.list_extend(opts.ensure_installed, { "tflint" })
|
||||||
|
end,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"nvimtools/none-ls.nvim",
|
"nvimtools/none-ls.nvim",
|
||||||
optional = true,
|
optional = true,
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,17 @@ local debugtypePreferred = {
|
||||||
['node'] = 'pwa-node',
|
['node'] = 'pwa-node',
|
||||||
}
|
}
|
||||||
|
|
||||||
|
local inlay_hints_settings = {
|
||||||
|
includeInlayEnumMemberValueHints = true,
|
||||||
|
includeInlayFunctionLikeReturnTypeHints = true,
|
||||||
|
includeInlayFunctionParameterTypeHints = true,
|
||||||
|
includeInlayParameterNameHints = "literal",
|
||||||
|
includeInlayParameterNameHintsWhenArgumentMatchesName = false,
|
||||||
|
includeInlayPropertyDeclarationTypeHints = true,
|
||||||
|
includeInlayVariableTypeHints = false,
|
||||||
|
includeInlayVariableTypeHintsWhenTypeMatchesName = false,
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|
||||||
-- add typescript to treesitter
|
-- add typescript to treesitter
|
||||||
|
|
@ -50,8 +61,13 @@ return {
|
||||||
desc = "Remove Unused Imports",
|
desc = "Remove Unused Imports",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
---@diagnostic disable-next-line: missing-fields
|
|
||||||
settings = {
|
settings = {
|
||||||
|
typescript = {
|
||||||
|
inlayHints = inlay_hints_settings,
|
||||||
|
},
|
||||||
|
javascript = {
|
||||||
|
inlayHints = inlay_hints_settings,
|
||||||
|
},
|
||||||
completions = {
|
completions = {
|
||||||
completeFunctionCalls = true,
|
completeFunctionCalls = true,
|
||||||
},
|
},
|
||||||
|
|
|
||||||
46
lua/lazyvim/plugins/extras/lang/vue.lua
Normal file
46
lua/lazyvim/plugins/extras/lang/vue.lua
Normal file
|
|
@ -0,0 +1,46 @@
|
||||||
|
return {
|
||||||
|
{
|
||||||
|
"nvim-treesitter/nvim-treesitter",
|
||||||
|
opts = function(_, opts)
|
||||||
|
if type(opts.ensure_installed) == "table" then
|
||||||
|
vim.list_extend(opts.ensure_installed, { "vue" })
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
"neovim/nvim-lspconfig",
|
||||||
|
opts = function(_, opts)
|
||||||
|
local vue_typescript_plugin = require("mason-registry").get_package("vue-language-server"):get_install_path()
|
||||||
|
.. "/node_modules/@vue/language-server"
|
||||||
|
.. "/node_modules/@vue/typescript-plugin"
|
||||||
|
|
||||||
|
opts.servers = vim.tbl_deep_extend("force", opts.servers, {
|
||||||
|
volar = {},
|
||||||
|
-- Volar 2.0 has discontinued their "take over mode" which in previous version provided support for typescript in vue files.
|
||||||
|
-- The new approach to get typescript support involves using the typescript language server along side volar.
|
||||||
|
tsserver = {
|
||||||
|
init_options = {
|
||||||
|
plugins = {
|
||||||
|
-- Use typescript language server along with vue typescript plugin
|
||||||
|
{
|
||||||
|
name = "@vue/typescript-plugin",
|
||||||
|
location = vue_typescript_plugin,
|
||||||
|
languages = { "javascript", "typescript", "vue" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
filetypes = {
|
||||||
|
"javascript",
|
||||||
|
"javascriptreact",
|
||||||
|
"javascript.jsx",
|
||||||
|
"typescript",
|
||||||
|
"typescriptreact",
|
||||||
|
"typescript.tsx",
|
||||||
|
"vue",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
@ -61,7 +61,7 @@ return {
|
||||||
end,
|
end,
|
||||||
pinned = true,
|
pinned = true,
|
||||||
open = function()
|
open = function()
|
||||||
vim.api.nvim_input("<esc><space>e")
|
require("neo-tree.command").execute({ dir = LazyVim.root() })
|
||||||
end,
|
end,
|
||||||
size = { height = 0.5 },
|
size = { height = 0.5 },
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -18,10 +18,8 @@ return {
|
||||||
{
|
{
|
||||||
"williamboman/mason.nvim",
|
"williamboman/mason.nvim",
|
||||||
opts = function(_, opts)
|
opts = function(_, opts)
|
||||||
vim.list_extend(opts.ensure_installed or {}, {
|
opts.ensure_installed = opts.ensure_installed or {}
|
||||||
"shfmt",
|
vim.list_extend(opts.ensure_installed, { "shellcheck" })
|
||||||
"shellcheck",
|
|
||||||
})
|
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
-- add some stuff to treesitter
|
-- add some stuff to treesitter
|
||||||
|
|
@ -35,12 +33,16 @@ return {
|
||||||
end
|
end
|
||||||
|
|
||||||
vim.filetype.add({
|
vim.filetype.add({
|
||||||
extension = { rasi = "rasi" },
|
extension = { rasi = "rasi", rofi = "rasi", wofi = "rasi" },
|
||||||
|
filename = {
|
||||||
|
["vifmrc"] = "vim",
|
||||||
|
},
|
||||||
pattern = {
|
pattern = {
|
||||||
[".*/waybar/config"] = "jsonc",
|
[".*/waybar/config"] = "jsonc",
|
||||||
[".*/mako/config"] = "dosini",
|
[".*/mako/config"] = "dosini",
|
||||||
[".*/kitty/*.conf"] = "bash",
|
[".*/kitty/.+%.conf"] = "bash",
|
||||||
[".*/hypr/.*%.conf"] = "hyprlang",
|
[".*/hypr/.+%.conf"] = "hyprlang",
|
||||||
|
["%.env%.[%w_.-]+"] = "sh",
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -75,6 +75,17 @@ return {
|
||||||
completion = {
|
completion = {
|
||||||
callSnippet = "Replace",
|
callSnippet = "Replace",
|
||||||
},
|
},
|
||||||
|
doc = {
|
||||||
|
privateName = { "^_" },
|
||||||
|
},
|
||||||
|
hint = {
|
||||||
|
enable = true,
|
||||||
|
setType = false,
|
||||||
|
paramType = true,
|
||||||
|
paramName = "Disable",
|
||||||
|
semicolon = "Disable",
|
||||||
|
arrayIndex = "Disable",
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
@ -120,12 +131,14 @@ return {
|
||||||
|
|
||||||
-- diagnostics signs
|
-- diagnostics signs
|
||||||
if vim.fn.has("nvim-0.10.0") == 0 then
|
if vim.fn.has("nvim-0.10.0") == 0 then
|
||||||
|
if type(opts.diagnostics.signs) ~= "boolean" then
|
||||||
for severity, icon in pairs(opts.diagnostics.signs.text) do
|
for severity, icon in pairs(opts.diagnostics.signs.text) do
|
||||||
local name = vim.diagnostic.severity[severity]:lower():gsub("^%l", string.upper)
|
local name = vim.diagnostic.severity[severity]:lower():gsub("^%l", string.upper)
|
||||||
name = "DiagnosticSign" .. name
|
name = "DiagnosticSign" .. name
|
||||||
vim.fn.sign_define(name, { text = icon, texthl = name, numhl = "" })
|
vim.fn.sign_define(name, { text = icon, texthl = name, numhl = "" })
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
-- inlay hints
|
-- inlay hints
|
||||||
if opts.inlay_hints.enabled then
|
if opts.inlay_hints.enabled then
|
||||||
|
|
@ -212,7 +225,14 @@ return {
|
||||||
end
|
end
|
||||||
|
|
||||||
if have_mason then
|
if have_mason then
|
||||||
mlsp.setup({ ensure_installed = ensure_installed, handlers = { setup } })
|
mlsp.setup({
|
||||||
|
ensure_installed = vim.tbl_deep_extend(
|
||||||
|
"force",
|
||||||
|
ensure_installed,
|
||||||
|
LazyVim.opts("mason-lspconfig.nvim").ensure_installed or {}
|
||||||
|
),
|
||||||
|
handlers = { setup },
|
||||||
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
if LazyVim.lsp.get_config("denols") and LazyVim.lsp.get_config("tsserver") then
|
if LazyVim.lsp.get_config("denols") and LazyVim.lsp.get_config("tsserver") then
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ return {
|
||||||
version = false, -- last release is way too old and doesn't work on Windows
|
version = false, -- last release is way too old and doesn't work on Windows
|
||||||
build = ":TSUpdate",
|
build = ":TSUpdate",
|
||||||
event = { "LazyFile", "VeryLazy" },
|
event = { "LazyFile", "VeryLazy" },
|
||||||
|
lazy = vim.fn.argc(-1) == 0, -- load treesitter early when opening a file from the cmdline
|
||||||
init = function(plugin)
|
init = function(plugin)
|
||||||
-- PERF: add nvim-treesitter queries to the rtp and it's custom query predicates early
|
-- PERF: add nvim-treesitter queries to the rtp and it's custom query predicates early
|
||||||
-- This is needed because a bunch of plugins no longer `require("nvim-treesitter")`, which
|
-- This is needed because a bunch of plugins no longer `require("nvim-treesitter")`, which
|
||||||
|
|
@ -16,33 +17,6 @@ return {
|
||||||
require("lazy.core.loader").add_to_rtp(plugin)
|
require("lazy.core.loader").add_to_rtp(plugin)
|
||||||
require("nvim-treesitter.query_predicates")
|
require("nvim-treesitter.query_predicates")
|
||||||
end,
|
end,
|
||||||
dependencies = {
|
|
||||||
{
|
|
||||||
"nvim-treesitter/nvim-treesitter-textobjects",
|
|
||||||
config = function()
|
|
||||||
-- When in diff mode, we want to use the default
|
|
||||||
-- vim text objects c & C instead of the treesitter ones.
|
|
||||||
local move = require("nvim-treesitter.textobjects.move") ---@type table<string,fun(...)>
|
|
||||||
local configs = require("nvim-treesitter.configs")
|
|
||||||
for name, fn in pairs(move) do
|
|
||||||
if name:find("goto") == 1 then
|
|
||||||
move[name] = function(q, ...)
|
|
||||||
if vim.wo.diff then
|
|
||||||
local config = configs.get_module("textobjects.move")[name] ---@type table<string,string>
|
|
||||||
for key, query in pairs(config or {}) do
|
|
||||||
if q == query and key:find("[%]%[][cC]") then
|
|
||||||
vim.cmd("normal! " .. key)
|
|
||||||
return
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
return fn(q, ...)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
cmd = { "TSUpdateSync", "TSUpdate", "TSInstall" },
|
cmd = { "TSUpdateSync", "TSUpdate", "TSInstall" },
|
||||||
keys = {
|
keys = {
|
||||||
{ "<c-space>", desc = "Increment Selection" },
|
{ "<c-space>", desc = "Increment Selection" },
|
||||||
|
|
@ -111,6 +85,36 @@ return {
|
||||||
end, opts.ensure_installed)
|
end, opts.ensure_installed)
|
||||||
end
|
end
|
||||||
require("nvim-treesitter.configs").setup(opts)
|
require("nvim-treesitter.configs").setup(opts)
|
||||||
|
vim.schedule(function()
|
||||||
|
require("lazy").load({ plugins = { "nvim-treesitter-textobjects" } })
|
||||||
|
end)
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
"nvim-treesitter/nvim-treesitter-textobjects",
|
||||||
|
lazy = true,
|
||||||
|
config = function()
|
||||||
|
-- When in diff mode, we want to use the default
|
||||||
|
-- vim text objects c & C instead of the treesitter ones.
|
||||||
|
local move = require("nvim-treesitter.textobjects.move") ---@type table<string,fun(...)>
|
||||||
|
local configs = require("nvim-treesitter.configs")
|
||||||
|
for name, fn in pairs(move) do
|
||||||
|
if name:find("goto") == 1 then
|
||||||
|
move[name] = function(q, ...)
|
||||||
|
if vim.wo.diff then
|
||||||
|
local config = configs.get_module("textobjects.move")[name] ---@type table<string,string>
|
||||||
|
for key, query in pairs(config or {}) do
|
||||||
|
if q == query and key:find("[%]%[][cC]") then
|
||||||
|
vim.cmd("normal! " .. key)
|
||||||
|
return
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return fn(q, ...)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -322,6 +322,7 @@ return {
|
||||||
{ "<leader>snh", function() require("noice").cmd("history") end, desc = "Noice History" },
|
{ "<leader>snh", function() require("noice").cmd("history") end, desc = "Noice History" },
|
||||||
{ "<leader>sna", function() require("noice").cmd("all") end, desc = "Noice All" },
|
{ "<leader>sna", function() require("noice").cmd("all") end, desc = "Noice All" },
|
||||||
{ "<leader>snd", function() require("noice").cmd("dismiss") end, desc = "Dismiss All" },
|
{ "<leader>snd", function() require("noice").cmd("dismiss") end, desc = "Dismiss All" },
|
||||||
|
{ "<leader>snt", function() require("noice").cmd("telescope") end, desc = "Noice Telescope" },
|
||||||
{ "<c-f>", function() if not require("noice.lsp").scroll(4) then return "<c-f>" end end, silent = true, expr = true, desc = "Scroll Forward", mode = {"i", "n", "s"} },
|
{ "<c-f>", function() if not require("noice.lsp").scroll(4) then return "<c-f>" end end, silent = true, expr = true, desc = "Scroll Forward", mode = {"i", "n", "s"} },
|
||||||
{ "<c-b>", function() if not require("noice.lsp").scroll(-4) then return "<c-b>" end end, silent = true, expr = true, desc = "Scroll Backward", mode = {"i", "n", "s"}},
|
{ "<c-b>", function() if not require("noice.lsp").scroll(-4) then return "<c-b>" end end, silent = true, expr = true, desc = "Scroll Backward", mode = {"i", "n", "s"}},
|
||||||
},
|
},
|
||||||
|
|
@ -346,9 +347,10 @@ return {
|
||||||
return false
|
return false
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
"nvimdev/dashboard-nvim",
|
"nvimdev/dashboard-nvim",
|
||||||
event = "VimEnter",
|
lazy = false, -- As https://github.com/nvimdev/dashboard-nvim/pull/450, dashboard-nvim shouldn't be lazy-loaded to properly handle stdin.
|
||||||
opts = function()
|
opts = function()
|
||||||
local logo = [[
|
local logo = [[
|
||||||
██╗ █████╗ ███████╗██╗ ██╗██╗ ██╗██╗███╗ ███╗ Z
|
██╗ █████╗ ███████╗██╗ ██╗██╗ ██╗██╗███╗ ███╗ Z
|
||||||
|
|
|
||||||
|
|
@ -46,6 +46,7 @@ end
|
||||||
---@param hl_group? string
|
---@param hl_group? string
|
||||||
---@return string
|
---@return string
|
||||||
function M.format(component, text, hl_group)
|
function M.format(component, text, hl_group)
|
||||||
|
text = text:gsub("%%", "%%%%")
|
||||||
if not hl_group or hl_group == "" then
|
if not hl_group or hl_group == "" then
|
||||||
return text
|
return text
|
||||||
end
|
end
|
||||||
|
|
@ -79,6 +80,7 @@ function M.pretty_path(opts)
|
||||||
directory_hl = "",
|
directory_hl = "",
|
||||||
filename_hl = "Bold",
|
filename_hl = "Bold",
|
||||||
modified_sign = "",
|
modified_sign = "",
|
||||||
|
length = 3,
|
||||||
}, opts or {})
|
}, opts or {})
|
||||||
|
|
||||||
return function(self)
|
return function(self)
|
||||||
|
|
@ -100,8 +102,10 @@ function M.pretty_path(opts)
|
||||||
local sep = package.config:sub(1, 1)
|
local sep = package.config:sub(1, 1)
|
||||||
local parts = vim.split(path, "[\\/]")
|
local parts = vim.split(path, "[\\/]")
|
||||||
|
|
||||||
if #parts > 3 then
|
if opts.length == 0 then
|
||||||
parts = { parts[1], "…", parts[#parts - 1], parts[#parts] }
|
parts = parts
|
||||||
|
elseif #parts > opts.length then
|
||||||
|
parts = { parts[1], "…", table.concat({ unpack(parts, #parts - opts.length + 2, #parts) }, sep) }
|
||||||
end
|
end
|
||||||
|
|
||||||
if opts.modified_hl and vim.bo.modified then
|
if opts.modified_hl and vim.bo.modified then
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,6 @@ local Plugin = require("lazy.core.plugin")
|
||||||
---@class lazyvim.util.plugin
|
---@class lazyvim.util.plugin
|
||||||
local M = {}
|
local M = {}
|
||||||
|
|
||||||
M.use_lazy_file = true
|
|
||||||
M.lazy_file_events = { "BufReadPost", "BufNewFile", "BufWritePre" }
|
M.lazy_file_events = { "BufReadPost", "BufNewFile", "BufWritePre" }
|
||||||
|
|
||||||
---@type table<string, string>
|
---@type table<string, string>
|
||||||
|
|
@ -55,72 +54,37 @@ function M.extra_idx(name)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Properly load file based plugins without blocking the UI
|
|
||||||
function M.lazy_file()
|
function M.lazy_file()
|
||||||
M.use_lazy_file = M.use_lazy_file and vim.fn.argc(-1) > 0
|
-- This autocmd will only trigger when a file was loaded from the cmdline.
|
||||||
|
-- It will render the file as quickly as possible.
|
||||||
|
vim.api.nvim_create_autocmd("BufReadPost", {
|
||||||
|
once = true,
|
||||||
|
callback = function(event)
|
||||||
|
-- Skip if we already entered vim
|
||||||
|
if vim.v.vim_did_enter == 1 then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Try to guess the filetype (may change later on during Neovim startup)
|
||||||
|
local ft = vim.filetype.match({ buf = event.buf })
|
||||||
|
if ft then
|
||||||
|
-- Add treesitter highlights and fallback to syntax
|
||||||
|
local lang = vim.treesitter.language.get_lang(ft)
|
||||||
|
if not (lang and pcall(vim.treesitter.start, event.buf, lang)) then
|
||||||
|
vim.bo[event.buf].syntax = ft
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Trigger early redraw
|
||||||
|
vim.cmd([[redraw]])
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
-- Add support for the LazyFile event
|
-- Add support for the LazyFile event
|
||||||
local Event = require("lazy.core.handler.event")
|
local Event = require("lazy.core.handler.event")
|
||||||
|
|
||||||
if M.use_lazy_file then
|
Event.mappings.LazyFile = { id = "LazyFile", event = M.lazy_file_events }
|
||||||
-- We'll handle delayed execution of events ourselves
|
|
||||||
Event.mappings.LazyFile = { id = "LazyFile", event = "User", pattern = "LazyFile" }
|
|
||||||
Event.mappings["User LazyFile"] = Event.mappings.LazyFile
|
Event.mappings["User LazyFile"] = Event.mappings.LazyFile
|
||||||
else
|
|
||||||
-- Don't delay execution of LazyFile events, but let lazy know about the mapping
|
|
||||||
Event.mappings.LazyFile = { id = "LazyFile", event = { "BufReadPost", "BufNewFile", "BufWritePre" } }
|
|
||||||
Event.mappings["User LazyFile"] = Event.mappings.LazyFile
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
local events = {} ---@type {event: string, buf: number, data?: any}[]
|
|
||||||
|
|
||||||
local done = false
|
|
||||||
local function load()
|
|
||||||
if #events == 0 or done then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
done = true
|
|
||||||
vim.api.nvim_del_augroup_by_name("lazy_file")
|
|
||||||
|
|
||||||
---@type table<string,string[]>
|
|
||||||
local skips = {}
|
|
||||||
for _, event in ipairs(events) do
|
|
||||||
skips[event.event] = skips[event.event] or Event.get_augroups(event.event)
|
|
||||||
end
|
|
||||||
|
|
||||||
vim.api.nvim_exec_autocmds("User", { pattern = "LazyFile", modeline = false })
|
|
||||||
for _, event in ipairs(events) do
|
|
||||||
if vim.api.nvim_buf_is_valid(event.buf) then
|
|
||||||
Event.trigger({
|
|
||||||
event = event.event,
|
|
||||||
exclude = skips[event.event],
|
|
||||||
data = event.data,
|
|
||||||
buf = event.buf,
|
|
||||||
})
|
|
||||||
if vim.bo[event.buf].filetype then
|
|
||||||
Event.trigger({
|
|
||||||
event = "FileType",
|
|
||||||
buf = event.buf,
|
|
||||||
})
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
vim.api.nvim_exec_autocmds("CursorMoved", { modeline = false })
|
|
||||||
events = {}
|
|
||||||
end
|
|
||||||
|
|
||||||
-- schedule wrap so that nested autocmds are executed
|
|
||||||
-- and the UI can continue rendering without blocking
|
|
||||||
load = vim.schedule_wrap(load)
|
|
||||||
|
|
||||||
vim.api.nvim_create_autocmd(M.lazy_file_events, {
|
|
||||||
group = vim.api.nvim_create_augroup("lazy_file", { clear = true }),
|
|
||||||
callback = function(event)
|
|
||||||
table.insert(events, event)
|
|
||||||
load()
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function M.fix_imports()
|
function M.fix_imports()
|
||||||
|
|
|
||||||
|
|
@ -142,7 +142,10 @@ function M.setup()
|
||||||
LazyVim.root.info()
|
LazyVim.root.info()
|
||||||
end, { desc = "LazyVim roots for the current buffer" })
|
end, { desc = "LazyVim roots for the current buffer" })
|
||||||
|
|
||||||
vim.api.nvim_create_autocmd({ "LspAttach", "BufWritePost", "DirChanged" }, {
|
-- FIX: doesn't properly clear cache in neo-tree `set_root` (which should happen presumably on `DirChanged`),
|
||||||
|
-- probably because the event is triggered in the neo-tree buffer, therefore add `BufEnter`
|
||||||
|
-- Maybe this is too frequent on `BufEnter` and something else should be done instead??
|
||||||
|
vim.api.nvim_create_autocmd({ "LspAttach", "BufWritePost", "DirChanged", "BufEnter" }, {
|
||||||
group = vim.api.nvim_create_augroup("lazyvim_root_cache", { clear = true }),
|
group = vim.api.nvim_create_augroup("lazyvim_root_cache", { clear = true }),
|
||||||
callback = function(event)
|
callback = function(event)
|
||||||
M.cache[event.buf] = nil
|
M.cache[event.buf] = nil
|
||||||
|
|
|
||||||
|
|
@ -67,7 +67,7 @@ function M.inlay_hints(buf, value)
|
||||||
if value == nil then
|
if value == nil then
|
||||||
value = not ih.is_enabled(buf)
|
value = not ih.is_enabled(buf)
|
||||||
end
|
end
|
||||||
ih.enable(buf, value)
|
ih.enable(value, { bufnr = buf })
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,3 +2,6 @@
|
||||||
|
|
||||||
((identifier) @namespace.builtin
|
((identifier) @namespace.builtin
|
||||||
(#eq? @namespace.builtin "vim"))
|
(#eq? @namespace.builtin "vim"))
|
||||||
|
|
||||||
|
((identifier) @namespace.builtin
|
||||||
|
(#eq? @namespace.builtin "LazyVim"))
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue