From 236e700bcbe465cb54b9e8a5a89db9c135e200fe Mon Sep 17 00:00:00 2001 From: Taylor Bockman Date: Tue, 11 Jul 2023 20:09:27 -0700 Subject: [PATCH] Support telescope --- README.md | 14 ++++++++++++++ lua/conf/keybinds.lua | 7 +++++++ lua/conf/plugins.lua | 2 ++ 3 files changed, 23 insertions(+) diff --git a/README.md b/README.md index 0ffbc49..64e8338 100644 --- a/README.md +++ b/README.md @@ -145,3 +145,17 @@ to activate the LSP support. [Asyncrun.vim](https://github.com/skywind3000/asyncrun.vim) is installed. You can use this to run shell commands asynchronously. To do this type `:AsyncRun `. + +### Search + +[ctrlp](https://github.com/kien/ctrlp.vim) and [telescope](https://github.com/nvim-telescope/telescope.nvim) +are installed. The hotkeys are as follows: + +``` +ff find_files +fg live_grep +fb buffers +fh help_tags + +p ctrlp search +``` diff --git a/lua/conf/keybinds.lua b/lua/conf/keybinds.lua index 08da7a6..0240b6c 100644 --- a/lua/conf/keybinds.lua +++ b/lua/conf/keybinds.lua @@ -13,6 +13,13 @@ end -- Space is the leader key when outside of insert mode. vim.g.mapleader = " " +-- Telescope +local builtin = require('telescope.builtin') +vim.keymap.set('n', 'ff', builtin.find_files, {}) +vim.keymap.set('n', 'fg', builtin.live_grep, {}) +vim.keymap.set('n', 'fb', builtin.buffers, {}) +vim.keymap.set('n', 'fh', builtin.help_tags, {}) + vim.api.nvim_set_keymap('', 't', ':NERDTreeToggle', {silent = true}) -- -r controls relative line numbering. diff --git a/lua/conf/plugins.lua b/lua/conf/plugins.lua index 4f0da84..448582c 100644 --- a/lua/conf/plugins.lua +++ b/lua/conf/plugins.lua @@ -35,6 +35,8 @@ Plug 'tpope/vim-commentary' -- Search Plug 'kien/ctrlp.vim' +Plug 'nvim-lua/plenary.nvim' +Plug('nvim-telescope/telescope.nvim', { tag = '0.1.2' }) -- Git Plug 'tpope/vim-fugitive'