Overview
Telescope is a powerful fuzzy finder plugin that provides an intuitive interface for searching files, text, and more. It’s the primary search tool in Magictt config. Plugin: nvim-telescope/telescope.nvimFeatures
- Fuzzy file finding
- Live text search across files
- Recent files navigation
- TODO comments integration
- FZF native integration for improved performance
- Smart path display
Configuration
Telescope is configured inlua/magictt/plugins/telescope.lua:
Keybindings
Global Keymaps
These keybindings are available in normal mode:| Keymap | Command | Description |
|---|---|---|
<leader>ff | :Telescope find_files | Fuzzy find files in current working directory |
<leader>fr | :Telescope oldfiles | Fuzzy find recent files |
<leader>fs | :Telescope live_grep | Find string in current working directory |
<leader>fc | :Telescope grep_string | Find string under cursor in cwd |
<leader>ft | :TodoTelescope | Find TODO comments |
Inside Telescope (Insert Mode)
When the Telescope picker is open:| Keymap | Action | Description |
|---|---|---|
<C-k> | Move up | Navigate to previous result |
<C-j> | Move down | Navigate to next result |
<C-q> | Send to quickfix | Send selected items to quickfix list |
<Esc> | Close | Close Telescope picker |
<CR> | Select | Open selected file |
Usage Examples
Find Files
Press<leader>ff to open the file finder:
- Start typing to fuzzy search file names
- Use
<C-j>and<C-k>to navigate results - Press
<CR>to open the file
Search Text
Press<leader>fs to search for text across all files:
- Type your search query
- Results update in real-time as you type
- Navigate and open files containing matches
Find Word Under Cursor
Place cursor on a word and press<leader>fc to search for all occurrences:
Recent Files
Press<leader>fr to see recently opened files:
Find TODOs
Press<leader>ft to search for TODO comments in your codebase:
Tips and Tricks
Fuzzy Finding
Telescope uses fuzzy matching, so you don’t need to type exact names:- To find
user_controller.rb, you can typeusconoruscont - Characters can be in any position:
ucrwill matchuser_controller.rb
Smart Path Display
The configuration usespath_display = { "smart" } which:
- Truncates paths to fit the window
- Shows the most relevant parts of the path
- Prioritizes file names over directory paths
Quickfix List
Use<C-q> to send multiple results to the quickfix list:
- Use
<Tab>to select multiple items in Telescope - Press
<C-q>to send them to quickfix - Navigate with
:cnextand:cprev
Live Grep Performance
For better performance with live_grep:- Ensure you have
ripgrepinstalled on your system - The FZF native extension is automatically loaded for speed
- Type more specific queries to reduce result sets
Search in Specific Directory
You can pass a directory to Telescope commands:Advanced Usage
Custom Pickers
You can create custom keymaps for specific searches:Hidden Files
By default, Telescope respects.gitignore. To search hidden files:
Dependencies
- plenary.nvim - Required Lua library
- telescope-fzf-native.nvim - Native FZF sorter for better performance
- nvim-web-devicons - File icons in results
- todo-comments.nvim - TODO comments integration
Related Plugins
Troubleshooting
Live grep not working- Install ripgrep:
brew install ripgrep(macOS) orapt install ripgrep(Linux) - Check installation:
rg --version
- Run
:Lazy build telescope-fzf-native.nvim - Ensure you have a C compiler and make installed
- Ensure you have a Nerd Font installed and configured in your terminal
- Check that nvim-web-devicons is loaded:
:Lazy