From 685044335bbc09bb7309145b993250c7f183965a Mon Sep 17 00:00:00 2001 From: siduck76 Date: Sat, 26 Jun 2021 08:03:29 +0530 Subject: [PATCH] use fzf for telescope --- init.lua | 1 + lua/pluginList.lua | 14 +++++++++----- lua/telescope-nvim.lua | 14 +++++++++++--- 3 files changed, 21 insertions(+), 8 deletions(-) diff --git a/init.lua b/init.lua index 464c077..1245f9a 100644 --- a/init.lua +++ b/init.lua @@ -19,6 +19,7 @@ base16(base16.themes["onedark"], true) require "highlights" require("colorizer").setup() + require "mappings" require "telescope-nvim" require "file-icons" diff --git a/lua/pluginList.lua b/lua/pluginList.lua index 80538e9..b43aa31 100644 --- a/lua/pluginList.lua +++ b/lua/pluginList.lua @@ -53,8 +53,6 @@ return packer.startup( cmd = "Neoformat" } - use "nvim-lua/plenary.nvim" - -- snippet support use { "hrsh7th/vim-vsnip", @@ -72,9 +70,15 @@ return packer.startup( } use "kyazdani42/nvim-web-devicons" - use "nvim-telescope/telescope.nvim" - use "nvim-telescope/telescope-media-files.nvim" - use "nvim-lua/popup.nvim" + use { + "nvim-telescope/telescope.nvim", + requires = { + {"nvim-lua/popup.nvim"}, + {"nvim-lua/plenary.nvim"}, + {"nvim-telescope/telescope-fzf-native.nvim", run = "make"}, + {"nvim-telescope/telescope-media-files.nvim"} + } + } -- misc plugins use { diff --git a/lua/telescope-nvim.lua b/lua/telescope-nvim.lua index 58eebca..cc948ae 100644 --- a/lua/telescope-nvim.lua +++ b/lua/telescope-nvim.lua @@ -9,9 +9,9 @@ require("telescope").setup { "--column", "--smart-case" }, - prompt_position = "bottom", - prompt_prefix = " ", - selection_caret = " ", + prompt_position = "top", + prompt_prefix = "  ", + selection_caret = " ", entry_prefix = " ", initial_mode = "insert", selection_strategy = "reset", @@ -47,6 +47,13 @@ require("telescope").setup { buffer_previewer_maker = require "telescope.previewers".buffer_previewer_maker }, extensions = { + fzf = { + fuzzy = true, -- false will only do exact matching + override_generic_sorter = false, -- override the generic sorter + override_file_sorter = true, -- override the file sorter + case_mode = "smart_case" -- or "ignore_case" or "respect_case" + -- the default case_mode is "smart_case" + }, media_files = { filetypes = {"png", "webp", "jpg", "jpeg"}, find_cmd = "rg" -- find command (defaults to `fd`) @@ -54,6 +61,7 @@ require("telescope").setup { } } +require('telescope').load_extension('fzf') require("telescope").load_extension("media_files") local opt = {noremap = true, silent = true}