telescope: work around its fold issue && use "0.1.x" branch
This commit is contained in:
+4
-3
@@ -2,12 +2,13 @@
|
||||
"Comment.nvim": { "branch": "master", "commit": "a89339ffbee677ab0521a483b6dac7e2e67c907e" },
|
||||
"LuaSnip": { "branch": "master", "commit": "e77fa9ad0b1f4fc6cddf54e51047e17e90c7d7ed" },
|
||||
"better-escape.nvim": { "branch": "master", "commit": "426d29708064d5b1bfbb040424651c92af1f3f64" },
|
||||
"catppuccin": { "branch": "main", "commit": "dd176757cc745f71bd54c472a9f58d5f8a54661d" },
|
||||
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
|
||||
"cmp-cmdline": { "branch": "main", "commit": "5af1bb7d722ef8a96658f01d6eb219c4cf746b32" },
|
||||
"cmp-nvim-lsp": { "branch": "main", "commit": "0e6b2ed705ddcff9738ec4ea838141654f12eeef" },
|
||||
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
|
||||
"cmp_luasnip": { "branch": "master", "commit": "18095520391186d634a0045dacaa346291096566" },
|
||||
"friendly-snippets": { "branch": "main", "commit": "9590ff90759488674cf97fe5d5754a0733ab37bb" },
|
||||
"friendly-snippets": { "branch": "main", "commit": "631f79e346b0b3203d2ce3eae619ca8d612e5463" },
|
||||
"gitsigns.nvim": { "branch": "main", "commit": "7dfe4be94b4f84a9931098f0f0f618d055e50bd5" },
|
||||
"indent-blankline.nvim": { "branch": "master", "commit": "018bd04d80c9a73d399c1061fa0c3b14a7614399" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "903f0fe542fc35b74f3c09494f9c175346dfa76d" },
|
||||
@@ -19,11 +20,11 @@
|
||||
"nvim-cmp": { "branch": "main", "commit": "e28fb7a730b1bd425fdddfdbd3d36bb84bd77611" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "710c45bd13928c1f37ef0a714fd49b75f00d7d5e" },
|
||||
"nvim-tree.lua": { "branch": "master", "commit": "bb375fb20327c49920c41d2b51c1ce2f4fe7deb3" },
|
||||
"nvim-treesitter": { "branch": "master", "commit": "75f911d01f740385f1f60b2f73266514647913b5" },
|
||||
"nvim-treesitter": { "branch": "master", "commit": "0d7da3bd7d59ffacc2fac6a52a1ba16d820f882c" },
|
||||
"nvim-web-devicons": { "branch": "master", "commit": "4ec26d67d419c12a4abaea02f1b6c57b40c08d7e" },
|
||||
"plenary.nvim": { "branch": "master", "commit": "9ac3e9541bbabd9d73663d757e4fe48a675bb054" },
|
||||
"symbols-outline.nvim": { "branch": "master", "commit": "512791925d57a61c545bc303356e8a8f7869763c" },
|
||||
"telescope.nvim": { "branch": "master", "commit": "f2645c13205abb9ee3dbcee68416645c69b863c8" },
|
||||
"telescope.nvim": { "branch": "0.1.x", "commit": "9de317bdea2bc393074651179c4fc7f93e9b2d56" },
|
||||
"toggleterm.nvim": { "branch": "main", "commit": "68fdf851c2b7901a7065ff129b77d3483419ddce" },
|
||||
"tokyonight.nvim": { "branch": "main", "commit": "ab0ac67f4f32f44c3480f4b81ed90e11cb4f3763" }
|
||||
}
|
||||
+54
-54
@@ -1,79 +1,79 @@
|
||||
-- This functions is to fix a bug in telescope
|
||||
-- that the fold not word if open file in telescope
|
||||
-- https://github.com/nvim-telescope/telescope.nvim/issues/559#issuecomment-1221001701
|
||||
local function stopinsert(callback)
|
||||
return function(prompt_bufnr)
|
||||
vim.cmd.stopinsert()
|
||||
vim.schedule(function()
|
||||
callback(prompt_bufnr)
|
||||
end)
|
||||
end
|
||||
end
|
||||
return {
|
||||
{
|
||||
"nvim-telescope/telescope.nvim",
|
||||
dependencies = { "nvim-lua/plenary.nvim" },
|
||||
cmd = "Telescope",
|
||||
branch = "0.1.x",
|
||||
config = function()
|
||||
local actions = require("telescope.actions")
|
||||
require("telescope").setup({
|
||||
|
||||
defaults = {
|
||||
mappings = {
|
||||
i = {
|
||||
["<C-j>"] = actions.move_selection_next,
|
||||
["<C-k>"] = actions.move_selection_previous,
|
||||
["<C-f>"] = actions.preview_scrolling_down,
|
||||
["<C-b>"] = actions.preview_scrolling_up,
|
||||
["<Esc>"] = actions.close, -- As we don't use normal node in telescope
|
||||
["<CR>"] = stopinsert(actions.select_default),
|
||||
["<C-v>"] = stopinsert(actions.select_vertical),
|
||||
["<C-x>"] = stopinsert(actions.select_horizontal),
|
||||
["<C-t>"] = stopinsert(actions.select_tab),
|
||||
},
|
||||
n = {
|
||||
["<C-j>"] = actions.move_selection_next,
|
||||
["<C-k>"] = actions.move_selection_previous,
|
||||
["<C-f>"] = actions.preview_scrolling_down,
|
||||
["<C-b>"] = actions.preview_scrolling_up,
|
||||
["q"] = actions.close,
|
||||
},
|
||||
},
|
||||
},
|
||||
pickers = {
|
||||
colorscheme = {
|
||||
enable_preview = true,
|
||||
theme = "dropdown",
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
keys = {
|
||||
{
|
||||
"<Leader>ff",
|
||||
"<Cmd>Telescope find_files <CR>",
|
||||
"<Cmd>Telescope find_files<CR>",
|
||||
desc = "Find File",
|
||||
},
|
||||
{
|
||||
"<Leader>fg",
|
||||
"<Cmd>Telescope live_grep <CR>",
|
||||
"<Cmd>Telescope live_grep<CR>",
|
||||
desc = "Find Grep",
|
||||
},
|
||||
{
|
||||
"<Leader>fb",
|
||||
"<Cmd>Telescope buffers <CR>",
|
||||
"<Cmd>Telescope buffers<CR>",
|
||||
desc = "Find Buffer",
|
||||
},
|
||||
{
|
||||
"<Leader>fh",
|
||||
"<Cmd>Telescope help_tags <CR>",
|
||||
"<Cmd>Telescope help_tags<CR>",
|
||||
desc = "Find Help",
|
||||
},
|
||||
},
|
||||
opts = {
|
||||
defaults = {
|
||||
mappings = {
|
||||
i = {
|
||||
["<C-j>"] = function(...)
|
||||
return require("telescope.actions").move_selection_next(...)
|
||||
end,
|
||||
["<C-k>"] = function(...)
|
||||
return require("telescope.actions").move_selection_previous(...)
|
||||
end,
|
||||
["<C-f>"] = function(...)
|
||||
return require("telescope.actions").preview_scrolling_down(...)
|
||||
end,
|
||||
["<C-b>"] = function(...)
|
||||
return require("telescope.actions").preview_scrolling_up(...)
|
||||
end,
|
||||
},
|
||||
n = {
|
||||
["<C-j>"] = function(...)
|
||||
return require("telescope.actions").move_selection_next(...)
|
||||
end,
|
||||
["<C-k>"] = function(...)
|
||||
return require("telescope.actions").move_selection_previous(...)
|
||||
end,
|
||||
["q"] = function(...)
|
||||
return require("telescope.actions").close(...)
|
||||
end,
|
||||
["<C-f>"] = function(...)
|
||||
return require("telescope.actions").preview_scrolling_down(...)
|
||||
end,
|
||||
["<C-b>"] = function(...)
|
||||
return require("telescope.actions").preview_scrolling_up(...)
|
||||
end,
|
||||
},
|
||||
},
|
||||
-- pickers = {
|
||||
-- lsp_definitions = {
|
||||
-- theme = "get_cursor",
|
||||
-- },
|
||||
-- lsp_references = {
|
||||
-- theme = "get_cursor",
|
||||
-- },
|
||||
-- lsp_implementation = {
|
||||
-- theme = "get_cursor",
|
||||
-- },
|
||||
-- lsp_type_definitions = {
|
||||
-- theme = "get_cursor",
|
||||
-- },
|
||||
-- },
|
||||
{
|
||||
"<Leader>ft",
|
||||
"<Cmd>Telescope colorscheme<CR>",
|
||||
desc = "Find Theme",
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user