telescope configured
This commit is contained in:
parent
4dcee1703b
commit
c46b0db519
|
|
@ -128,9 +128,19 @@ Source of truth for the step-by-step rebuild. Keep this concise and up to date.
|
|||
- [x] Tested and validated with test-gf.php
|
||||
|
||||
## Phase 4.3 — Telescope setup
|
||||
- [ ] Add `telescope.nvim` + `telescope-fzf-native.nvim` for fuzzy finding
|
||||
- [ ] Configure basic pickers: `find_files`, `live_grep`, `buffers`, `help_tags`, `oldfiles`
|
||||
- [ ] Add sensible default keymaps
|
||||
- [x] Add `telescope.nvim` + `telescope-fzf-native.nvim` for fuzzy finding
|
||||
- [x] Configure basic pickers: `find_files`, `live_grep`, `buffers`, `help_tags`, `oldfiles`, `current_buffer_fuzzy_find`
|
||||
- [x] Add LSP pickers: `lsp_document_symbols`, `lsp_workspace_symbols`
|
||||
- [x] Keymaps configured:
|
||||
- `<leader>ff` - Find files
|
||||
- `<leader>fg` - Live grep (search text)
|
||||
- `<leader>fb` - Find buffers (with `<C-d>` to delete)
|
||||
- `<leader>fh` - Find help
|
||||
- `<leader>fr` - Recent files
|
||||
- `<leader>/` - Search current buffer
|
||||
- `<leader>fs` - Document symbols (LSP)
|
||||
- `<leader>fS` - Workspace symbols (LSP)
|
||||
- [x] Minimal UI: dropdown theme for files/buffers, no previewer for quick selection
|
||||
|
||||
## Phase 4.4 — Oil.nvim for file manipulation
|
||||
- [ ] Add `stevearc/oil.nvim` for filesystem operations (rename, create, delete, copy, move)
|
||||
|
|
|
|||
|
|
@ -0,0 +1,105 @@
|
|||
-- Telescope fuzzy finder
|
||||
return {
|
||||
{
|
||||
'nvim-telescope/telescope.nvim',
|
||||
branch = '0.1.x',
|
||||
dependencies = {
|
||||
'nvim-lua/plenary.nvim',
|
||||
{
|
||||
'nvim-telescope/telescope-fzf-native.nvim',
|
||||
build = 'make',
|
||||
cond = function()
|
||||
return vim.fn.executable('make') == 1
|
||||
end,
|
||||
},
|
||||
},
|
||||
config = function()
|
||||
local telescope = require('telescope')
|
||||
local actions = require('telescope.actions')
|
||||
|
||||
telescope.setup({
|
||||
defaults = {
|
||||
-- Minimal UI, keep it clean
|
||||
prompt_prefix = '> ',
|
||||
selection_caret = '> ',
|
||||
path_display = { 'truncate' },
|
||||
|
||||
-- Sensible default mappings
|
||||
mappings = {
|
||||
i = {
|
||||
['<C-n>'] = actions.move_selection_next,
|
||||
['<C-p>'] = actions.move_selection_previous,
|
||||
['<C-c>'] = actions.close,
|
||||
['<C-j>'] = actions.move_selection_next,
|
||||
['<C-k>'] = actions.move_selection_previous,
|
||||
['<CR>'] = actions.select_default,
|
||||
['<C-x>'] = actions.select_horizontal,
|
||||
['<C-v>'] = actions.select_vertical,
|
||||
['<C-t>'] = actions.select_tab,
|
||||
},
|
||||
n = {
|
||||
['<esc>'] = actions.close,
|
||||
['<CR>'] = actions.select_default,
|
||||
['<C-x>'] = actions.select_horizontal,
|
||||
['<C-v>'] = actions.select_vertical,
|
||||
['<C-t>'] = actions.select_tab,
|
||||
['j'] = actions.move_selection_next,
|
||||
['k'] = actions.move_selection_previous,
|
||||
},
|
||||
},
|
||||
},
|
||||
pickers = {
|
||||
-- Keep pickers minimal, use defaults
|
||||
find_files = {
|
||||
theme = 'dropdown',
|
||||
previewer = false,
|
||||
},
|
||||
buffers = {
|
||||
theme = 'dropdown',
|
||||
previewer = false,
|
||||
mappings = {
|
||||
i = {
|
||||
['<C-d>'] = actions.delete_buffer,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
extensions = {
|
||||
-- fzf-native configuration (faster sorting)
|
||||
fzf = {
|
||||
fuzzy = true,
|
||||
override_generic_sorter = true,
|
||||
override_file_sorter = true,
|
||||
case_mode = 'smart_case',
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
-- Load fzf extension if available
|
||||
pcall(telescope.load_extension, 'fzf')
|
||||
end,
|
||||
keys = {
|
||||
-- Find files in current working directory
|
||||
{ '<leader>ff', '<cmd>Telescope find_files<cr>', desc = 'Find files' },
|
||||
|
||||
-- Live grep (search text across project)
|
||||
{ '<leader>fg', '<cmd>Telescope live_grep<cr>', desc = 'Live grep' },
|
||||
|
||||
-- Search in open buffers
|
||||
{ '<leader>fb', '<cmd>Telescope buffers<cr>', desc = 'Find buffers' },
|
||||
|
||||
-- Search help tags
|
||||
{ '<leader>fh', '<cmd>Telescope help_tags<cr>', desc = 'Find help' },
|
||||
|
||||
-- Recent files
|
||||
{ '<leader>fr', '<cmd>Telescope oldfiles<cr>', desc = 'Recent files' },
|
||||
|
||||
-- Search current buffer
|
||||
{ '<leader>/', '<cmd>Telescope current_buffer_fuzzy_find<cr>', desc = 'Search buffer' },
|
||||
|
||||
-- LSP-related pickers (optional, for when LSP is active)
|
||||
{ '<leader>fs', '<cmd>Telescope lsp_document_symbols<cr>', desc = 'Document symbols' },
|
||||
{ '<leader>fS', '<cmd>Telescope lsp_dynamic_workspace_symbols<cr>', desc = 'Workspace symbols (dynamic)' },
|
||||
},
|
||||
},
|
||||
}
|
||||
Loading…
Reference in New Issue