add telescope

This commit is contained in:
vincent 2022-04-30 21:29:19 +02:00
parent e69d64171a
commit f1326980aa

View File

@ -13,7 +13,33 @@ end
return require('packer').startup { return require('packer').startup {
function(use) function(use)
use {
'nvim-telescope/telescope.nvim',
requires = { {'nvim-lua/plenary.nvim'} }
}
use {
'nvim-telescope/telescope-fzf-native.nvim',
run = 'make',
config = function()
require('telescope').setup {
defaults = {
},
}
require('telescope').load_extension('fzf')
require'telescope.themes'.get_ivy()
vim.api.nvim_set_keymap("n", "<LEADER><LEADER>", ":Telescope find_files theme=get_ivy<CR>", { noremap = true })
vim.api.nvim_set_keymap("n", "<LEADER>ff", ":Telescope find_files theme=get_ivy<CR>", { noremap = true })
vim.api.nvim_set_keymap("n", "<LEADER>sp", ":Telescope live_grep theme=get_ivy<CR>", { noremap = true })
vim.api.nvim_set_keymap("n", "<LEADER>/", ":Telescope live_grep theme=get_ivy<CR>", { noremap = true })
vim.api.nvim_set_keymap("n", "<LEADER>bb", ":Telescope buffers theme=get_ivy<CR>", { noremap = true })
vim.api.nvim_set_keymap("n", "<LEADER>,", ":Telescope buffers theme=get_ivy<CR>", { noremap = true })
vim.api.nvim_set_keymap("n", "<LEADER>sb", ":Telescope current_buffer_fuzzy_find theme=get_ivy<CR>", { noremap = true })
end
}
use 'wbthomason/packer.nvim' use 'wbthomason/packer.nvim'
@ -48,20 +74,20 @@ return require('packer').startup {
} }
-- Fuzzy search -- Fuzzy search
use { -- use {
'junegunn/fzf.vim', -- 'junegunn/fzf.vim',
requires = { -- requires = {
'junegunn/fzf' -- 'junegunn/fzf'
}, -- },
config = function() -- config = function()
vim.g.fzf_buffers_jump = 1 -- vim.g.fzf_buffers_jump = 1
vim.api.nvim_set_keymap('n', '<LEADER><TAB>', ':Buffers!<CR>', {noremap = true}) -- vim.api.nvim_set_keymap('n', '<LEADER><TAB>', ':Buffers!<CR>', {noremap = true})
vim.api.nvim_set_keymap('n', '<LEADER>ff', ':Files!<CR>\'', {noremap = true}) -- vim.api.nvim_set_keymap('n', '<LEADER>ff', ':Files!<CR>\'', {noremap = true})
vim.api.nvim_set_keymap('n', '<LEADER>f.', ':Files! '..vim.fn.expand('%:p:h'), {noremap = true}) -- vim.api.nvim_set_keymap('n', '<LEADER>f.', ':Files! '..vim.fn.expand('%:p:h'), {noremap = true})
vim.api.nvim_set_keymap('n', '<LEADER>f/', ':Rg!<CR>', {noremap = true}) -- vim.api.nvim_set_keymap('n', '<LEADER>f/', ':Rg!<CR>', {noremap = true})
vim.api.nvim_set_keymap('n', '<LEADER>fg', ':GFiles!<CR>', {noremap = true}) -- vim.api.nvim_set_keymap('n', '<LEADER>fg', ':GFiles!<CR>', {noremap = true})
end -- end
} -- }
-- Show indent line -- Show indent line
use { use {