How to Install and Use Telescope Fuzzy Search Plugin for Neovim

In this tutorial, I will introduce you to a popular plugin for neo-vim called 'Telescope'. It has a variety of features, but I will focus on file search and live grep.

Share:

Apr 15, 2023 469 Words

Read Time: 3 Minutes

A screeshot of 'telescope' plugin's file finder feature in action in neovim.

Introduction

In this tutorial, I will introduce you to a popular plugin for nvim called telescope12. It has a variety of features, but I will focus on file search and live grep.

I will provide a brief gist to help you better understand how they work and how to use them effectively.

Global File Search with Telescope and Vim Key-Bindings

One of the most useful features of telescope is its ability to perform global file searches with the help of Vim key-bindings. This means that you can easily search for files across your entire project without leaving your editor.

To use this feature, simply type the following command:

:Telescope find_files

This will open a search window where you can enter the name of the file you want to find. You can use the arrow keys to navigate through the search results and press enter to open the selected file.

Live Grep with Telescope and Vim Key-Bindings

Another great feature of telescope is its ability to perform live grep searches. This means that you can search for a specific string within your project and see the results in real-time.

To use this feature, simply type the following command:

:Telescope live_grep

This will open a search window where you can enter the string you want to search for. You can use the arrow keys to navigate through the search results and press enter to open the selected file.

Setup and Installation

💻 I’ve setup neo-vim in my macOS machine but the process should be more or less similar for any linux based operation system.

To use telescope, you can install it as a plugin using VIM.PLUG 3. You will need to add the following code to your ~/.config/nvim/init.vim file to install it:

let mapleader=","
nnoremap <Leader>ff :Telescope find_files<CR>
nnoremap <Leader>lg :Telescope live_grep<CR>

call plug#begin()
Plug 'nvim-lua/plenary.nvim'
Plug 'nvim-telescope/telescope.nvim'
call plug#end()

Reloading and running :PlugInstall should install the telescope plugin. After installing the plugin, you can check if it works by entering the command:

:checkhealth Telescope

If the output shows that everything is installed properly, you can start using telescope by entering the commands :Telescope find_files and :Telescope live_grep.

As per above configuration, you can also use keymaps/hotkeys to do the same:

  • , + ff same as :Telescope find_files<CR>

  • , + lg same as :Telescope live_grep<CR>

✨ Keymaps or hotkeys make it super effective for a developer to spin up a file or grep finder.

📒 You might also have to install ripgrep 4 to ensure live grep feature can be used properly with telescope plugin.

Conclusion

I hope that this tutorial has been helpful in introducing you to the powerful features of telescope. With a little practice, you will be able to use it to streamline your workflow and improve your productivity.

References

Find more posts from following topics

accurate-requests
api-development
api-testing
api-testing-tools
array
automated-testing
bad-habits
base64-decoder
base64-encoder
binding
blog
blogging
bulma-css
bulma.io
button-swiftui
chatgpt
clipboard
code
code-block
code-snippet
comparison
compile
configuring-debugger-for-django-in-vs-code
configuring-launch.json-for-python-debugger
copy
copy-to-clipboard
copy-to-clipboard-neovim
css
current-date
current-time
current-timestamp
debugger-setup-in-visual-studio-code
debugging-django-app-in-visual-studio-code
debugging-python-code-in-visual-studio-code
debugging-python-programs-with-visual-studio-code
debugging-python-with-virtual-environment-in-vs-code
developer-productivity
developers
development-workflow
dom
dynamic-sitemap-in-nextjs
engineering-dashboard
flowcharts
git
git-diff
github
global-keyboard-shorcut
global-shortcut
go
go-hugo
go-programming
go-to-line
golang
golang-development
good-habits
gorilla-websocket
gpt
gpt-3.5
gpt-4
gpt-4-api
guide
gumroad
habits
habits-tracker-notion-template
hamburger-menu
hotkeys
html
hugo
ide
image
image-sharing
image-tool-for-ios
imagerenderer
include-timestamp
integrated-development-environment
ios
ios-16
ios16
javascript
keyboard-shortcut
linux
macos
map
markdown
markdown-code
mental-programming
menu
menubarextra
mermaid-syntax
mistake-tracker-notion
mobile-view
modifier
navbar
navigationlink
navigationstack
neovim
next.js
nextjs
nextjs-markdown
nextjs-sitemap
nextjs-sitemaps
nice-shot
nice-shot-pro
notion
notion-api
notion-api-python
notion-budget
notion-budget-template
notion-budget-tracker
notion-bug-report-tracker
notion-dashboard
notion-expense-manager
notion-habits
notion-habits-dashboard
notion-habits-template
notion-habits-tracker
notion-habits-tracker-template
notion-issue-tracker
notion-mistake-tracker
notion-product
notion-product-dashboard
notion-product-roadmap
notion-product-roadmap-dashboard
notion-tasks
notion-tasks-dashboard
notion-tasks-template
notion-tasks-tracker
notion-template
notionworkspaces
openai
osx
personal-ifttt-framework
photospicker
photospickeritem
phpickerfilter
postman-capabilities
postman-request
pre-request-script
product-roadmap-notion-template
product-roadmap-template
productivity
programming
python
python-api
python-debugger-tutorial-for-vs-code
python-debugging-mode-in-vs-code
python-notion-api
real-time-communication
rehype
remark
request-data
running-debugger-in-visual-studio-code
running-django-app-in-debugging-mode
running-program-in-debugging-mode-in-vs-code
running-python-code-in-debugging-mode
screenshot-app-for-ios
screenshot-app-ios
screenshot-ios
screenshot-tool-for-ios
set-current-timestamp
setting-up-debugger-in-vs-code-for-python
share-extension
sharelink
sharepreview
sharesheet
simple-websocket-server
sitemap
slice
slider
step-by-step-guide
stocks-profits-tracker
stocks-profits-tracker-template
stocks-tracker
struct
sustained-vigilance
swift
swiftui
swiftui-button
swiftui-button-action
swiftui-button-style
table-of-contents
tasks-tracker-notion-template
textfield-swiftui
timeliness
timestamp-integration
transferable
triggers-and-actions
tutorial
us-stocks
usa-stocks
useful-ios-features
using-breakpoints-in-python-debugger
using-virtual-environment-with-python-debugger
vanilla-javascript
variable
vim
visual-mode
visual-studio-code
vs-code
vscode
vscode-go-to-line
web-sockets-in-go
websocket-client
websocket-programming
websocket-server
xcode