kitchen sink...
just gonna put the changes that I can remember making here: - replace blink with native completion (omnifunc) - remove some unneeded plugins - add a misc function for making sure complex bindings don't cause flickering - remove some stale snippets - remove folding (I don't find myself folding that often)
This commit is contained in:
@ -21,14 +21,8 @@ local function telebuilt_picker(fn)
|
||||
end
|
||||
|
||||
return { "nvim-telescope/telescope.nvim",
|
||||
disable = not vim.fn.has("nvim-0.9.0"),
|
||||
reqs = {
|
||||
{ "nvim-lua/plenary.nvim",
|
||||
-- lazy = function(load)
|
||||
-- load:cmd("PlenaryBustedDirectory")
|
||||
-- load:cmd("PlenaryBustedFile")
|
||||
-- end
|
||||
},
|
||||
"nvim-lua/plenary.nvim",
|
||||
{ "nvim-telescope/telescope-fzf-native.nvim",
|
||||
config = function()
|
||||
vim.cmd("make")
|
||||
@ -40,11 +34,8 @@ return { "nvim-telescope/telescope.nvim",
|
||||
lazy = function(load)
|
||||
load:cmd("Telescope")
|
||||
load:keymap("n", "<leader>f")
|
||||
load:keymap("n", "<leader>o")
|
||||
load:keymap("n", "<leader>s")
|
||||
load:keymap("n", "<leader>i")
|
||||
load:keymap("n", "<leader>l")
|
||||
load:keymap("n", "<leader>;")
|
||||
load:keymap("n", "<leader>tc")
|
||||
load:keymap("n", "<leader>tp")
|
||||
end,
|
||||
@ -52,35 +43,86 @@ return { "nvim-telescope/telescope.nvim",
|
||||
load = function()
|
||||
local telescope = require("telescope")
|
||||
local actions = require("telescope.actions")
|
||||
local action_state = require("telescope.actions.state")
|
||||
|
||||
local function send_limited_to_qflist_and_open(prompt_bufnr)
|
||||
local picker = action_state.get_current_picker(prompt_bufnr)
|
||||
local entries = {}
|
||||
local max_items = 100
|
||||
local count = 0
|
||||
|
||||
for entry in picker.manager:iter() do
|
||||
if count >= max_items then
|
||||
break
|
||||
end
|
||||
|
||||
local filename = entry.path or entry.filename or entry.value
|
||||
local text = entry.text or entry.value
|
||||
if not text then
|
||||
if type(entry.value) == "table" then
|
||||
text = entry.value.text
|
||||
else
|
||||
text = entry.value
|
||||
end
|
||||
end
|
||||
|
||||
local pattern
|
||||
if not entry.lnum then
|
||||
if type(entry.display) == "string" then
|
||||
pattern = entry.display
|
||||
elseif type(entry.ordinal) == "string" then
|
||||
pattern = entry.ordinal
|
||||
elseif type(text) == "string" then
|
||||
pattern = text
|
||||
else
|
||||
entry.lnum = 1
|
||||
end
|
||||
end
|
||||
|
||||
if filename then
|
||||
table.insert(entries, {
|
||||
filename = filename,
|
||||
text = text,
|
||||
lnum = entry.lnum,
|
||||
col = entry.col,
|
||||
|
||||
-- we try and put a pattern in based on the info we receive from
|
||||
-- telescope so that the qf list takes us to the correct place
|
||||
pattern = pattern
|
||||
})
|
||||
count = count + 1
|
||||
end
|
||||
end
|
||||
|
||||
if #entries > 0 then
|
||||
-- make sure errors get suppressed. I don't care
|
||||
pcall(vim.fn.setqflist, {}, " ", {
|
||||
title = "Telescope Limited Results",
|
||||
items = entries
|
||||
})
|
||||
end
|
||||
|
||||
actions.select_default(prompt_bufnr)
|
||||
end
|
||||
|
||||
telescope.setup {
|
||||
defaults = {
|
||||
borderchars = {
|
||||
prompt = { " ", " ", " ", " ", " ", " ", " ", " " },
|
||||
results = { " ", " ", " ", " ", " ", " ", " ", " " },
|
||||
preview = { " ", " ", " ", " ", " ", " ", " ", " " },
|
||||
},
|
||||
winblend = 0,
|
||||
layout_strategy = "horizontal",
|
||||
sorting_strategy = "descending",
|
||||
scroll_strategy = "limit",
|
||||
layout_config = {
|
||||
horizontal = {
|
||||
height = 20,
|
||||
prompt_position = "bottom",
|
||||
anchor = "N",
|
||||
}
|
||||
},
|
||||
layout_strategy = "bottom_pane",
|
||||
borderchars = { " ", " ", " ", " ", " ", " ", " ", " " },
|
||||
mappings = {
|
||||
i = {
|
||||
["<esc>"] = actions.close,
|
||||
["<C-j>"] = actions.move_selection_next,
|
||||
["<C-k>"] = actions.move_selection_previous,
|
||||
["<C-u>"] = actions.preview_scrolling_up,
|
||||
["<C-d>"] = actions.preview_scrolling_down,
|
||||
["<CR>"] = send_limited_to_qflist_and_open,
|
||||
}
|
||||
}
|
||||
},
|
||||
pickers = {
|
||||
colorscheme = {
|
||||
enable_preview = true
|
||||
}
|
||||
},
|
||||
extensions = {
|
||||
fzf = {}
|
||||
}
|
||||
@ -95,17 +137,10 @@ return { "nvim-telescope/telescope.nvim",
|
||||
map("n", "<leader>f", telebuilt_picker(telebuilt.find_files), {
|
||||
desc = "Find files."
|
||||
})
|
||||
map("n", "<leader>o", telebuilt.oldfiles, { desc = "Find old." })
|
||||
map("n", "<leader>s", telebuilt_picker(telebuilt.live_grep), {
|
||||
desc = "Find strings."
|
||||
})
|
||||
map("n", "<leader>i", telebuilt.help_tags, { desc = "find help tags." })
|
||||
map("n", "<leader>l", telebuilt.lsp_document_symbols, {
|
||||
desc = "Find symbols."
|
||||
})
|
||||
map("n", "<leader>;", telebuilt.lsp_workspace_symbols, {
|
||||
desc = "Find Workspace symbols."
|
||||
})
|
||||
|
||||
-- find over specific directories
|
||||
map("n", "<leader>tc", function()
|
||||
@ -116,12 +151,5 @@ return { "nvim-telescope/telescope.nvim",
|
||||
cwd = vim.fs.joinpath(vim.fn.stdpath("data"), "site/pack/deps/opt")
|
||||
}
|
||||
end, { desc = "find files in plugin directory" })
|
||||
|
||||
-- enable previewing in the default colorscheme switcher
|
||||
telebuilt.colorscheme = function()
|
||||
require("telescope.builtin.__internal").colorscheme {
|
||||
enable_preview = true
|
||||
}
|
||||
end
|
||||
end
|
||||
}
|
||||
|
Reference in New Issue
Block a user