Compare commits
31 Commits
Author | SHA1 | Date | |
---|---|---|---|
5559228300 | |||
3dcc074693 | |||
58c3842faa | |||
89db0157b1 | |||
7443effe26 | |||
78298cb134 | |||
55bf4d104c | |||
c12835ab86 | |||
183fd89d76 | |||
99785ce36b | |||
bb0d4d4e7d | |||
f8982332be | |||
0c517d1f5c | |||
df6a0d3b10 | |||
7a7c024bf6 | |||
29554455aa | |||
b227d9727a | |||
b4099a6477 | |||
5a27e1def0 | |||
06e4ba2fdb | |||
23410a4594 | |||
c737f2b6c2 | |||
78354a1e5e | |||
080ea29354 | |||
3d7238f753 | |||
a43d1b79f2 | |||
bd1ba54d13 | |||
9f2010a8b9 | |||
e09423b28c | |||
2525b91313 | |||
a213da4430 |
67
CHANGELOG.md
67
CHANGELOG.md
@ -1,5 +1,72 @@
|
||||
# Changelog
|
||||
|
||||
## [3.5.0](https://github.com/LazyVim/LazyVim/compare/v3.4.0...v3.5.0) (2023-05-23)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **mini.comment:** added ts-context-commentstring back and made it work with mini.comment ([89db015](https://github.com/LazyVim/LazyVim/commit/89db0157b1621deffc83a4e00cb2be13e2827a5d))
|
||||
* **test:** added easy way to configure adapters ([7443eff](https://github.com/LazyVim/LazyVim/commit/7443effe269ad3b2d491f43439b48f1d072c9210))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **vscode:** support older Neovim versions. Fixes [#798](https://github.com/LazyVim/LazyVim/issues/798) ([3dcc074](https://github.com/LazyVim/LazyVim/commit/3dcc074693c3560982d6e500aa073140a9c5c0ed))
|
||||
|
||||
## [3.4.0](https://github.com/LazyVim/LazyVim/compare/v3.3.0...v3.4.0) (2023-05-22)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **project:** add to mini.starter ([#640](https://github.com/LazyVim/LazyVim/issues/640)) ([f898233](https://github.com/LazyVim/LazyVim/commit/f8982332be70499b74623f6ed44c1c58217eb546))
|
||||
* **tailwind:** don't enable tailwind in markdown files ([2955445](https://github.com/LazyVim/LazyVim/commit/29554455aa3e7d76377080869f0556389a05e321))
|
||||
* **tests:** added neotest ([#642](https://github.com/LazyVim/LazyVim/issues/642)) ([bb0d4d4](https://github.com/LazyVim/LazyVim/commit/bb0d4d4e7d2e0914cb2188cab7748d70b2ae5fa8))
|
||||
* **vscode:** added vscode extra with minimal functionality. Will only do something when vim.g.vscode is set ([c12835a](https://github.com/LazyVim/LazyVim/commit/c12835ab8683c68116503a1aab614e0d6ff68528))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **dap:** fix the mason-nvim-dap setting name ([#781](https://github.com/LazyVim/LazyVim/issues/781)) ([b4099a6](https://github.com/LazyVim/LazyVim/commit/b4099a64775e3e7722ebaf29612df43c46bf4f03))
|
||||
* make some extra deps optional ([183fd89](https://github.com/LazyVim/LazyVim/commit/183fd89d76b24c5e293d368a59c5db3a7c7f85d5))
|
||||
* **persistence:** dont add rtp to session ([99785ce](https://github.com/LazyVim/LazyVim/commit/99785ce36b523cca46c1f2fd6edeaf1189bcd934))
|
||||
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* **eslint:** only run EslintFixAll for the current buffer when there are diagnostics from eslint ([b227d97](https://github.com/LazyVim/LazyVim/commit/b227d9727a7ae1f0ad48504d613fb099dc9c461b))
|
||||
|
||||
## [3.3.0](https://github.com/LazyVim/LazyVim/compare/v3.2.0...v3.3.0) (2023-05-18)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **telescope:** added `<a-c>` mapping for telescope pickers to switch to cwd instead of root ([c737f2b](https://github.com/LazyVim/LazyVim/commit/c737f2b6c265d2c82cebf9f999425a2bd008e692))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **telescope:** keep current prompt when switching to hidden/no_ignore ([78354a1](https://github.com/LazyVim/LazyVim/commit/78354a1e5e88c68a9d99b72af5a0844befee419b))
|
||||
|
||||
## [3.2.0](https://github.com/LazyVim/LazyVim/compare/v3.1.0...v3.2.0) (2023-05-18)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **noice:** enable the inc_rename preset when inc_rename is availble ([a43d1b7](https://github.com/LazyVim/LazyVim/commit/a43d1b79f29deecc694bd409ab497f8a62091b11))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **mini:** lazy now supports mini plugins out of the box. no longer needed to have a custom config ([bd1ba54](https://github.com/LazyVim/LazyVim/commit/bd1ba54d1347c1f340db896f25e43c8591365512))
|
||||
|
||||
## [3.1.0](https://github.com/LazyVim/LazyVim/compare/v3.0.0...v3.1.0) (2023-05-13)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **noice:** send written notifications to the mini view instead of notify ([2525b91](https://github.com/LazyVim/LazyVim/commit/2525b913139c6ca288677126d1451b9683bbac1f))
|
||||
* **noice:** use noice's improved entry doc view for cmp ([a213da4](https://github.com/LazyVim/LazyVim/commit/a213da4430c1012bf7278080cbdc03a236e8230f))
|
||||
|
||||
## [3.0.0](https://github.com/LazyVim/LazyVim/compare/v2.13.1...v3.0.0) (2023-05-12)
|
||||
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
*LazyVim.txt* For Neovim >= 0.8.0 Last change: 2023 May 12
|
||||
*LazyVim.txt* For Neovim >= 0.8.0 Last change: 2023 May 23
|
||||
|
||||
==============================================================================
|
||||
Table of Contents *LazyVim-table-of-contents*
|
||||
|
@ -1,4 +1,4 @@
|
||||
-- This file is automatically loaded by plugins.init
|
||||
-- This file is automatically loaded by lazyvim.config.init
|
||||
|
||||
local function augroup(name)
|
||||
return vim.api.nvim_create_augroup("lazyvim_" .. name, { clear = true })
|
||||
@ -52,6 +52,7 @@ vim.api.nvim_create_autocmd("FileType", {
|
||||
"startuptime",
|
||||
"tsplayground",
|
||||
"checkhealth",
|
||||
"neotest-output",
|
||||
},
|
||||
callback = function(event)
|
||||
vim.bo[event.buf].buflisted = false
|
||||
|
@ -1,4 +1,4 @@
|
||||
-- This file is automatically loaded by lazyvim.plugins.config
|
||||
-- This file is automatically loaded by lazyvim.config.init
|
||||
|
||||
local Util = require("lazyvim.util")
|
||||
|
||||
|
@ -93,9 +93,7 @@ return {
|
||||
{
|
||||
"echasnovski/mini.pairs",
|
||||
event = "VeryLazy",
|
||||
config = function(_, opts)
|
||||
require("mini.pairs").setup(opts)
|
||||
end,
|
||||
opts = {},
|
||||
},
|
||||
|
||||
-- surround
|
||||
@ -130,18 +128,22 @@ return {
|
||||
update_n_lines = "gzn", -- Update `n_lines`
|
||||
},
|
||||
},
|
||||
config = function(_, opts)
|
||||
-- use gz mappings instead of s to prevent conflict with leap
|
||||
require("mini.surround").setup(opts)
|
||||
end,
|
||||
},
|
||||
|
||||
-- comments
|
||||
{ "JoosepAlviste/nvim-ts-context-commentstring", lazy = true },
|
||||
{
|
||||
"echasnovski/mini.comment",
|
||||
event = "VeryLazy",
|
||||
config = function(_, opts)
|
||||
local c = require("mini.comment")
|
||||
c.setup(opts)
|
||||
local H = require("lazyvim.util").get_upvalue(c.setup, "H")
|
||||
H.get_commentstring = function()
|
||||
return require("ts_context_commentstring.internal").calculate_commentstring() or vim.bo.commentstring
|
||||
end
|
||||
end,
|
||||
opts = {},
|
||||
main = "mini.comment",
|
||||
},
|
||||
|
||||
-- better text-objects
|
||||
|
@ -166,10 +166,14 @@ return {
|
||||
return require("trouble.providers.telescope").open_selected_with_trouble(...)
|
||||
end,
|
||||
["<a-i>"] = function()
|
||||
Util.telescope("find_files", { no_ignore = true })()
|
||||
local action_state = require("telescope.actions.state")
|
||||
local line = action_state.get_current_line()
|
||||
Util.telescope("find_files", { no_ignore = true, default_text = line })()
|
||||
end,
|
||||
["<a-h>"] = function()
|
||||
Util.telescope("find_files", { hidden = true })()
|
||||
local action_state = require("telescope.actions.state")
|
||||
local line = action_state.get_current_line()
|
||||
Util.telescope("find_files", { hidden = true, default_text = line })()
|
||||
end,
|
||||
["<C-Down>"] = function(...)
|
||||
return require("telescope.actions").cycle_history_next(...)
|
||||
|
@ -12,6 +12,7 @@ return {
|
||||
},
|
||||
{
|
||||
"nvim-lualine/lualine.nvim",
|
||||
optional = true,
|
||||
event = "VeryLazy",
|
||||
opts = function(_, opts)
|
||||
local Util = require("lazyvim.util")
|
||||
|
@ -37,6 +37,7 @@ return {
|
||||
-- which key integration
|
||||
{
|
||||
"folke/which-key.nvim",
|
||||
optional = true,
|
||||
opts = {
|
||||
defaults = {
|
||||
["<leader>d"] = { name = "+debug" },
|
||||
@ -53,7 +54,7 @@ return {
|
||||
opts = {
|
||||
-- Makes a best effort to setup the various debuggers with
|
||||
-- reasonable debug configurations
|
||||
automatic_setup = true,
|
||||
automatic_installation = true,
|
||||
|
||||
-- You can provide additional configuration to the handlers,
|
||||
-- see mason-nvim-dap README for more information
|
||||
|
@ -3,7 +3,18 @@ return {
|
||||
"neovim/nvim-lspconfig",
|
||||
opts = {
|
||||
servers = {
|
||||
tailwindcss = {},
|
||||
tailwindcss = {
|
||||
filetypes_exclude = { "markdown" },
|
||||
},
|
||||
},
|
||||
setup = {
|
||||
tailwindcss = function(_, opts)
|
||||
local tw = require("lspconfig.server_configurations.tailwindcss")
|
||||
--- @param ft string
|
||||
opts.filetypes = vim.tbl_filter(function(ft)
|
||||
return not vim.tbl_contains(opts.filetypes_exclude, ft)
|
||||
end, tw.default_config.filetypes)
|
||||
end,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -3,6 +3,7 @@ return {
|
||||
"neovim/nvim-lspconfig",
|
||||
-- other settings removed for brevity
|
||||
opts = {
|
||||
---@type lspconfig.options
|
||||
servers = {
|
||||
eslint = {
|
||||
settings = {
|
||||
@ -15,8 +16,12 @@ return {
|
||||
eslint = function()
|
||||
vim.api.nvim_create_autocmd("BufWritePre", {
|
||||
callback = function(event)
|
||||
if require("lspconfig.util").get_active_client_by_name(event.buf, "eslint") then
|
||||
vim.cmd("EslintFixAll")
|
||||
local client = vim.lsp.get_active_clients({ bufnr = event.buf, name = "eslint" })[1]
|
||||
if client then
|
||||
local diag = vim.diagnostic.get(event.buf, { namespace = vim.lsp.diagnostic.get_namespace(client.id) })
|
||||
if #diag > 0 then
|
||||
vim.cmd("EslintFixAll")
|
||||
end
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
60
lua/lazyvim/plugins/extras/test/core.lua
Normal file
60
lua/lazyvim/plugins/extras/test/core.lua
Normal file
@ -0,0 +1,60 @@
|
||||
return {
|
||||
{
|
||||
"folke/which-key.nvim",
|
||||
optional = true,
|
||||
opts = {
|
||||
defaults = {
|
||||
["<leader>t"] = { name = "+test" },
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"nvim-neotest/neotest",
|
||||
opts = {
|
||||
adapter_config = {
|
||||
-- ["adapter_name"] = {} -- set adapter config here
|
||||
},
|
||||
adapters = {},
|
||||
},
|
||||
config = function(_, opts)
|
||||
local neotest_ns = vim.api.nvim_create_namespace("neotest")
|
||||
vim.diagnostic.config({
|
||||
virtual_text = {
|
||||
format = function(diagnostic)
|
||||
-- Replace newline and tab characters with space for more compact diagnostics
|
||||
local message = diagnostic.message:gsub("\n", " "):gsub("\t", " "):gsub("%s+", " "):gsub("^%s+", "")
|
||||
return message
|
||||
end,
|
||||
},
|
||||
}, neotest_ns)
|
||||
|
||||
if opts.adapter_config then
|
||||
for a, adapter in ipairs(opts.adapters or {}) do
|
||||
local name = adapter.name
|
||||
if opts.adapter_config[name] then
|
||||
opts.adapters[a] = adapter(opts.adapter_config[name])
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
require("neotest").setup(opts)
|
||||
end,
|
||||
-- stylua: ignore
|
||||
keys = {
|
||||
{ "<leader>tr", function() require("neotest").run.run() end, desc = "Run Nearest" },
|
||||
{ "<leader>tR", function() require("neotest").run.run(vim.fn.expand("%")) end, desc = "Run File" },
|
||||
{ "<leader>ts", function() require("neotest").summary.toggle() end, desc = "Toggle Summary" },
|
||||
{ "<leader>to", function() require("neotest").output.open({ enter = true, auto_close = true }) end, desc = "Show Output" },
|
||||
{ "<leader>tO", function() require("neotest").output_panel.toggle() end, desc = "Toggle Output Panel" },
|
||||
{ "<leader>tS", function() require("neotest").run.stop() end, desc = "Stop" },
|
||||
},
|
||||
},
|
||||
{
|
||||
"mfussenegger/nvim-dap",
|
||||
optional = true,
|
||||
-- stylua: ignore
|
||||
keys = {
|
||||
{ "<leader>td", function() require("neotest").run.run({strategy = "dap"}) end, desc = "Debug Nearest" },
|
||||
},
|
||||
},
|
||||
}
|
@ -33,8 +33,5 @@ return {
|
||||
},
|
||||
}
|
||||
end,
|
||||
config = function(_, opts)
|
||||
require("mini.animate").setup(opts)
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
@ -20,6 +20,7 @@ return {
|
||||
|
||||
{
|
||||
"goolord/alpha-nvim",
|
||||
optional = true,
|
||||
opts = function(_, dashboard)
|
||||
local button = dashboard.button("p", " " .. " Projects", ":Telescope projects <CR>")
|
||||
button.opts.hl = "AlphaButtons"
|
||||
@ -27,4 +28,18 @@ return {
|
||||
table.insert(dashboard.section.buttons.val, 4, button)
|
||||
end,
|
||||
},
|
||||
{
|
||||
"echasnovski/mini.starter",
|
||||
optional = true,
|
||||
opts = function(_, opts)
|
||||
local items = {
|
||||
{
|
||||
name = "Projects",
|
||||
action = "Telescope projects",
|
||||
section = string.rep(" ", 22) .. "Telescope",
|
||||
},
|
||||
}
|
||||
vim.list_extend(opts.items, items)
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
56
lua/lazyvim/plugins/extras/vscode.lua
Normal file
56
lua/lazyvim/plugins/extras/vscode.lua
Normal file
@ -0,0 +1,56 @@
|
||||
if not vim.g.vscode then
|
||||
return {}
|
||||
end
|
||||
|
||||
local enabled = {
|
||||
"flit.nvim",
|
||||
"lazy.nvim",
|
||||
"leap.nvim",
|
||||
"mini.ai",
|
||||
"mini.comment",
|
||||
"mini.pairs",
|
||||
"mini.surround",
|
||||
"nvim-treesitter",
|
||||
"nvim-treesitter-textobjects",
|
||||
"vim-repeat",
|
||||
}
|
||||
|
||||
local Config = require("lazy.core.config")
|
||||
local Plugin = require("lazy.core.plugin")
|
||||
Config.options.checker.enabled = false
|
||||
Config.options.change_detection.enabled = false
|
||||
|
||||
local update_state = Plugin.update_state
|
||||
---@diagnostic disable-next-line: duplicate-set-field
|
||||
Plugin.update_state = function()
|
||||
-- Config.spec.disabled = {}
|
||||
for name, plugin in pairs(Config.plugins) do
|
||||
if not vim.tbl_contains(enabled, plugin.name) then
|
||||
Config.plugins[name] = nil
|
||||
end
|
||||
end
|
||||
update_state()
|
||||
Config.to_clean = {}
|
||||
end
|
||||
|
||||
local map = vim.keymap.set
|
||||
|
||||
map("n", "<leader><space>", "<cmd>Find<cr>")
|
||||
map("n", "<leader>/", [[<cmd>call VSCodeNotify('workbench.action.findInFiles')<cr>]])
|
||||
map("n", "<leader>ss", [[<cmd>call VSCodeNotify('workbench.action.gotoSymbol')<cr>]])
|
||||
|
||||
map("n", "<C-h>", "<C-w>h", { desc = "Go to left window", remap = true })
|
||||
map("n", "<C-j>", "<C-w>j", { desc = "Go to lower window", remap = true })
|
||||
map("n", "<C-k>", "<C-w>k", { desc = "Go to upper window", remap = true })
|
||||
map("n", "<C-l>", "<C-w>l", { desc = "Go to right window", remap = true })
|
||||
|
||||
map("n", "<leader>wd", "<C-W>c", { desc = "Delete window", remap = true })
|
||||
map("n", "<leader>-", "<C-W>s", { desc = "Split window below", remap = true })
|
||||
map("n", "<leader>|", "<C-W>v", { desc = "Split window right", remap = true })
|
||||
|
||||
return {
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = { highlight = { enable = false } },
|
||||
},
|
||||
}
|
@ -5,7 +5,7 @@ return {
|
||||
event = { "BufReadPre", "BufNewFile" },
|
||||
dependencies = {
|
||||
{ "folke/neoconf.nvim", cmd = "Neoconf", config = true },
|
||||
{ "folke/neodev.nvim", opts = { experimental = { pathStrict = true } } },
|
||||
{ "folke/neodev.nvim", opts = {} },
|
||||
"mason.nvim",
|
||||
"williamboman/mason-lspconfig.nvim",
|
||||
{
|
||||
|
@ -193,9 +193,6 @@ return {
|
||||
end,
|
||||
})
|
||||
end,
|
||||
config = function(_, opts)
|
||||
require("mini.indentscope").setup(opts)
|
||||
end,
|
||||
},
|
||||
|
||||
-- noicer ui
|
||||
@ -218,12 +215,23 @@ return {
|
||||
override = {
|
||||
["vim.lsp.util.convert_input_to_markdown_lines"] = true,
|
||||
["vim.lsp.util.stylize_markdown"] = true,
|
||||
["cmp.entry.get_documentation"] = true,
|
||||
},
|
||||
},
|
||||
routes = {
|
||||
{
|
||||
filter = {
|
||||
event = "msg_show",
|
||||
find = "%d+L, %d+B",
|
||||
},
|
||||
view = "mini",
|
||||
},
|
||||
},
|
||||
presets = {
|
||||
bottom_search = true,
|
||||
command_palette = true,
|
||||
long_message_to_split = true,
|
||||
inc_rename = true,
|
||||
},
|
||||
},
|
||||
-- stylua: ignore
|
||||
|
@ -13,7 +13,7 @@ return {
|
||||
{
|
||||
"folke/persistence.nvim",
|
||||
event = "BufReadPre",
|
||||
opts = { options = { "buffers", "curdir", "tabpages", "winsize", "help", "globals" } },
|
||||
opts = { options = { "buffers", "curdir", "tabpages", "winsize", "help", "globals", "skiprtp" } },
|
||||
-- stylua: ignore
|
||||
keys = {
|
||||
{ "<leader>qs", function() require("persistence").load() end, desc = "Restore Session" },
|
||||
|
@ -43,7 +43,7 @@ function M.keymaps()
|
||||
|
||||
group = "Plugins"
|
||||
|
||||
local core = require("lazy.core.plugin").Spec.new({ import = "lazyvim.plugins" })
|
||||
local core = require("lazy.core.plugin").Spec.new({ import = "lazyvim.plugins" }, { optional = true })
|
||||
Util.foreach(core.plugins, function(name, plugin)
|
||||
group = ("[%s](%s)"):format(plugin.name, plugin.url)
|
||||
for _, key in ipairs(plugin.keys or {}) do
|
||||
@ -58,7 +58,7 @@ function M.keymaps()
|
||||
if t == "file" and name:find("%.lua$") then
|
||||
local modname = path:gsub(".*/lua/", ""):gsub("/", "."):gsub("%.lua$", "")
|
||||
local extra_doc = "/plugins/extras/" .. modname:gsub("lazyvim%.plugins%.extras%.", "")
|
||||
local extra = require("lazy.core.plugin").Spec.new({ import = modname })
|
||||
local extra = require("lazy.core.plugin").Spec.new({ import = modname }, { optional = true })
|
||||
Util.foreach(extra.plugins, function(name, plugin)
|
||||
group = ("[%s](%s)\nPart of [%s](%s)"):format(plugin.name, plugin.url, modname, extra_doc)
|
||||
for _, key in ipairs(plugin.keys or {}) do
|
||||
@ -249,7 +249,7 @@ end
|
||||
|
||||
function M.plugins(path)
|
||||
local test = root .. "/lua/lazyvim/plugins/" .. path
|
||||
local spec = require("lazy.core.plugin").Spec.new(dofile(test))
|
||||
local spec = require("lazy.core.plugin").Spec.new(dofile(test), { optional = true })
|
||||
local source = Util.read_file(test)
|
||||
local parser = vim.treesitter.get_string_parser(source, "lua")
|
||||
|
||||
@ -306,11 +306,13 @@ function M.plugins(path)
|
||||
end
|
||||
|
||||
parser:parse()
|
||||
parser:for_each_tree(function(tree)
|
||||
local node = tree:root()
|
||||
find_plugins(node)
|
||||
-- print(vim.treesitter.query.get_node_text(node, str))
|
||||
end)
|
||||
if path ~= "extras/vscode.lua" then
|
||||
parser:for_each_tree(function(tree)
|
||||
local node = tree:root()
|
||||
find_plugins(node)
|
||||
-- print(vim.treesitter.query.get_node_text(node, str))
|
||||
end)
|
||||
end
|
||||
|
||||
---@type string[]
|
||||
local lines = {
|
||||
|
@ -27,6 +27,20 @@ function M.fg(name)
|
||||
return fg and { fg = string.format("#%06x", fg) }
|
||||
end
|
||||
|
||||
function M.get_upvalue(func, name)
|
||||
local i = 1
|
||||
while true do
|
||||
local n, v = debug.getupvalue(func, i)
|
||||
if not n then
|
||||
break
|
||||
end
|
||||
if n == name then
|
||||
return v
|
||||
end
|
||||
i = i + 1
|
||||
end
|
||||
end
|
||||
|
||||
---@param fn fun()
|
||||
function M.on_very_lazy(fn)
|
||||
vim.api.nvim_create_autocmd("User", {
|
||||
@ -105,6 +119,20 @@ function M.telescope(builtin, opts)
|
||||
builtin = "find_files"
|
||||
end
|
||||
end
|
||||
if opts.cwd and opts.cwd ~= vim.loop.cwd() then
|
||||
opts.attach_mappings = function(_, map)
|
||||
map("i", "<a-c>", function()
|
||||
local action_state = require("telescope.actions.state")
|
||||
local line = action_state.get_current_line()
|
||||
M.telescope(
|
||||
params.builtin,
|
||||
vim.tbl_deep_extend("force", {}, params.opts or {}, { cwd = false, default_text = line })
|
||||
)()
|
||||
end)
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
||||
require("telescope.builtin")[builtin](opts)
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user