telescope
The Ultimate Fuzzy Finder for Neovim
Telescope.nvim is the fuzzy finder plugin that will supercharge your Neovim workflow. Whether you’re navigating files, searching through buffers, or quickly pulling up your command history, Telescope makes it easy, fast, and efficient.
Key Features of Telescope
-
Fuzzy Searching
Telescope’s search engine is intelligent—you don’t need to type exact matches! Just type a few letters and Telescope will fuzzily match them. ✨ It’s like magic. ✨
-
Extensible to the Max
Create custom pickers, search types, and even add your own extensions. Telescope is like a Lego set—build whatever your heart desires!
-
Neovim Integration
Seamlessly integrates with Neovim’s core features: buffers, files, commands, and more! Never leave the comfort of your editor.
-
Preview Everything
Want to see inside a file before selecting it? Telescope lets you preview the contents of search results before making a choice.
-
Performance First
Speed is key! Telescope is written in Lua, ensuring that even with large projects, it remains fast and responsive.
-
Fully Customizable UI
Telescope allows you to tweak the interface to your liking. Want a minimalist look or something with more pizzazz? You got it!
-
Keybindings Made Easy
Create custom keybindings for your favorite Telescope commands. Say goodbye to mouse fatigue and embrace the keyboard power!
Installing Telescope with Lazy.nvim
If you’re using Lazy.nvim as your plugin manager, the installation process is just as easy. Add the following to your init.lua
:
require('lazy').setup({
{
'nvim-telescope/telescope.nvim',
dependencies = { 'nvim-lua/plenary.nvim' }
}
})
After that, run :Lazy sync
to install the plugin.
Once installed, you’re ready to go!
Quickly search for files in your project directory. Telescope will do its fuzzy magic.
:Telescope find_files
Search for any string across all your files with live feedback.
:Telescope live_grep
Search through Neovim’s help documentation.
:Telescope help_tags
Extending Telescope
Telescope is highly extensible—you can add your own custom pickers, filters, and even third-party extensions.
Example: Custom Picker for Markdown Files
local actions = require('telescope.actions')
require('telescope').setup{
defaults = {
mappings = {
i = {
["<C-x>"] = actions.select_horizontal,
},
},
},
}
local function search_markdown()
require('telescope.builtin').find_files({
prompt_title = "Markdown Files",
cwd = vim.fn.getcwd(),
find_command = {'find', '.', '-type', 'f', '-name', '*.md'}
})
end
This Lua function creates a custom picker to find all .md files in your current project.
Example: Using an Extension
Telescope is like a supercharged battery that works with other extensions. Let’s use the fzf extension to make searching even faster.
require('telescope').load_extension('fzf')
Keybindings & Customization
Telescope gives you full control over keybindings and UI. Here’s how you can bind commands to the keys you like best. Keyboard power, unleashed! 🚀
Example:
vim.api.nvim_set_keymap('n', '<Leader>ff', ':Telescope find_files<CR>', { noremap = true })
vim.api.nvim_set_keymap('n', '<Leader>fg', ':Telescope live_grep<CR>', { noremap = true })
vim.api.nvim_set_keymap('n', '<Leader>fb', ':Telescope buffers<CR>', { noremap = true })
vim.api.nvim_set_keymap('n', '<Leader>fh', ':Telescope help_tags<CR>', { noremap = true })
These bindings assign Leader + ff
to find files, Leader + fg
to search for text, and more!
Extensions: Add More Power 💥
Telescope can be extended with plugins to unlock even more cool features.
-
Telescope-fzf-native
Make your searches ultra-fast with the fzf extension!
use {
'nvim-telescope/telescope-fzf-native.nvim',
run = 'make'
}
-
Telescope-emoji
Insert emojis straight into your code with this extension.
-
Telescope-project
Switch between projects like a pro. Telescope-project helps you jump to a different project’s files in seconds.
-
Sorting and Filtering Results
Want to sort files by the most recently modified? Or perhaps by file type? Telescope lets you do that:
require('telescope.builtin').find_files({
sort_lastused = true, -- Sort by last used
})