summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Stoelp <johannes.stoelp@gmail.com>2021-09-17 22:34:31 +0200
committerJohannes Stoelp <johannes.stoelp@gmail.com>2021-09-17 22:34:31 +0200
commit1be5fe45310ee055ac54e33402f28b2f2b72d93c (patch)
treed11402677586697aa3758e4c340462ea534b536e
parentd3a6faf2e4fc6e7e60ccab47f1db977fc0d4ec7e (diff)
downloaddotfiles-1be5fe45310ee055ac54e33402f28b2f2b72d93c.tar.gz
dotfiles-1be5fe45310ee055ac54e33402f28b2f2b72d93c.zip
nvim: add telescope
-rw-r--r--nvim.init.vim.experimental31
1 files changed, 27 insertions, 4 deletions
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", "<C-Space>", "compe#complete()", {expr = true})
vim.api.nvim_set_keymap("i", "<CR>", "compe#confirm('<CR>')", {expr = true})
vim.api.nvim_set_keymap("i", "<C-e>", "compe#close('<C-e>')", {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 <leader>p "_dP
+" Telescope
+nnoremap <leader>fb <cmd>Telescope buffers<cr>
+nnoremap <leader>ff <cmd>Telescope find_files<cr>
+nnoremap <leader>fe <cmd>Telescope file_browser<cr>
+nnoremap <leader>fg <cmd>Telescope live_grep<cr>
+nnoremap <leader>fm <cmd>Telescope man_pages sections={"2","3"}<cr>
+nnoremap <leader>ft <cmd>Telescope lsp_document_symbols<cr>
+nnoremap <leader>fwt <cmd>Telescope lsp_dynamic_workspace_symbols<cr>
+
" -----------------
" Autogroups.
" -----------------