use fzf for telescope

This commit is contained in:
siduck76 2021-06-26 08:03:29 +05:30
parent 47e062eb73
commit 685044335b
3 changed files with 21 additions and 8 deletions

View file

@ -19,6 +19,7 @@ base16(base16.themes["onedark"], true)
require "highlights" require "highlights"
require("colorizer").setup() require("colorizer").setup()
require "mappings" require "mappings"
require "telescope-nvim" require "telescope-nvim"
require "file-icons" require "file-icons"

View file

@ -53,8 +53,6 @@ return packer.startup(
cmd = "Neoformat" cmd = "Neoformat"
} }
use "nvim-lua/plenary.nvim"
-- snippet support -- snippet support
use { use {
"hrsh7th/vim-vsnip", "hrsh7th/vim-vsnip",
@ -72,9 +70,15 @@ return packer.startup(
} }
use "kyazdani42/nvim-web-devicons" use "kyazdani42/nvim-web-devicons"
use "nvim-telescope/telescope.nvim" use {
use "nvim-telescope/telescope-media-files.nvim" "nvim-telescope/telescope.nvim",
use "nvim-lua/popup.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 -- misc plugins
use { use {

View file

@ -9,9 +9,9 @@ require("telescope").setup {
"--column", "--column",
"--smart-case" "--smart-case"
}, },
prompt_position = "bottom", prompt_position = "top",
prompt_prefix = " ", prompt_prefix = " ",
selection_caret = " ", selection_caret = " ",
entry_prefix = " ", entry_prefix = " ",
initial_mode = "insert", initial_mode = "insert",
selection_strategy = "reset", selection_strategy = "reset",
@ -47,6 +47,13 @@ require("telescope").setup {
buffer_previewer_maker = require "telescope.previewers".buffer_previewer_maker buffer_previewer_maker = require "telescope.previewers".buffer_previewer_maker
}, },
extensions = { 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 = { media_files = {
filetypes = {"png", "webp", "jpg", "jpeg"}, filetypes = {"png", "webp", "jpg", "jpeg"},
find_cmd = "rg" -- find command (defaults to `fd`) 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") require("telescope").load_extension("media_files")
local opt = {noremap = true, silent = true} local opt = {noremap = true, silent = true}