From 1be5fe45310ee055ac54e33402f28b2f2b72d93c Mon Sep 17 00:00:00 2001 From: Johannes Stoelp Date: Fri, 17 Sep 2021 22:34:31 +0200 Subject: nvim: add telescope --- nvim.init.vim.experimental | 31 +++++++++++++++++++++++++++---- 1 file changed, 27 insertions(+), 4 deletions(-) (limited to 'nvim.init.vim.experimental') diff --git a/nvim.init.vim.experimental b/nvim.init.vim.experimental index 6872a22..2cf7af6 100644 --- a/nvim.init.vim.experimental +++ b/nvim.init.vim.experimental @@ -15,9 +15,10 @@ call plug#begin('~/.nvim/plugged') Plug 'neovim/nvim-lspconfig' Plug 'hrsh7th/nvim-compe' - " FZF. - Plug 'junegunn/fzf', { 'do': { -> fzf#install() } } - Plug 'junegunn/fzf.vim' + " Telescope. + Plug 'nvim-lua/plenary.nvim' + Plug 'nvim-telescope/telescope.nvim' + Plug 'nvim-telescope/telescope-fzf-native.nvim', { 'do': 'make' } call plug#end() " ----------------- @@ -61,7 +62,7 @@ endif " LSP & Complete. " ----------------- -set completeopt=menuone,noinsert,noselect +"set completeopt=menuone,noinsert,noselect lua << EOF local on_attach = function(_client, bufnr) @@ -124,6 +125,19 @@ vim.o.completeopt = "menuone,noselect" vim.api.nvim_set_keymap("i", "", "compe#complete()", {expr = true}) vim.api.nvim_set_keymap("i", "", "compe#confirm('')", {expr = true}) vim.api.nvim_set_keymap("i", "", "compe#close('')", {expr = true}) + +-- Telescope. +local picker_cfg = { theme = "ivy" } + +require('telescope').setup{ + pickers = { + buffers = picker_cfg, + find_files = picker_cfg, + man_pages = picker_cfg, + }, +} +-- Telescope: load fzf-native. +require('telescope').load_extension('fzf') EOF " ----------------- @@ -132,6 +146,15 @@ EOF vnoremap p "_dP +" Telescope +nnoremap fb Telescope buffers +nnoremap ff Telescope find_files +nnoremap fe Telescope file_browser +nnoremap fg Telescope live_grep +nnoremap fm Telescope man_pages sections={"2","3"} +nnoremap ft Telescope lsp_document_symbols +nnoremap fwt Telescope lsp_dynamic_workspace_symbols + " ----------------- " Autogroups. " ----------------- -- cgit v1.2.3