mirror of
https://github.com/cap153/nvim.git
synced 2025-12-28 12:54:56 +08:00
first commit
This commit is contained in:
commit
6955e90e07
61 changed files with 3641 additions and 0 deletions
52
lua/lazy/plugins/telescope.lua
Normal file
52
lua/lazy/plugins/telescope.lua
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
return {
|
||||
'nvim-telescope/telescope.nvim',
|
||||
branch = '0.1.x',
|
||||
dependencies = {
|
||||
'nvim-lua/plenary.nvim',
|
||||
},
|
||||
config = function()
|
||||
local builtin = require('telescope.builtin')
|
||||
-- ctrl+t打开文件查找
|
||||
vim.keymap.set('n', '<c-t>', builtin.find_files, {})
|
||||
-- ctrl+f打开字符串查找
|
||||
vim.keymap.set('n', '<c-f>', '<cmd>lua require("telescope.builtin").grep_string({ search = vim.fn.input("Grep For > "), only_sort_text = true, })<cr>', { noremap = true })
|
||||
-- 下面的配置从cw的配置粘贴过来的,删除一部分看不懂的
|
||||
local ts = require('telescope')
|
||||
ts.setup({
|
||||
defaults = {
|
||||
vimgrep_arguments = {
|
||||
"rg",
|
||||
"--color=never",
|
||||
"--no-heading",
|
||||
"--with-filename",
|
||||
"--line-number",
|
||||
"--column",
|
||||
"--fixed-strings",
|
||||
"--smart-case",
|
||||
"--trim",
|
||||
},
|
||||
layout_config = {
|
||||
width = 0.9,
|
||||
height = 0.9,
|
||||
},
|
||||
mappings = {
|
||||
i = {
|
||||
["<C-h>"] = "which_key",
|
||||
["<C-u>"] = "move_selection_previous",
|
||||
["<C-e>"] = "move_selection_next",
|
||||
["<C-l>"] = "preview_scrolling_up",
|
||||
["<C-y>"] = "preview_scrolling_down",
|
||||
["<esc>"] = "close",
|
||||
}
|
||||
},
|
||||
color_devicons = true,
|
||||
prompt_prefix = "🔍 ",
|
||||
selection_caret = " ",
|
||||
path_display = { "truncate" },
|
||||
file_previewer = require("telescope.previewers").vim_buffer_cat.new,
|
||||
grep_previewer = require("telescope.previewers").vim_buffer_vimgrep.new,
|
||||
},
|
||||
})
|
||||
end
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue