nvim/lua/plugins/nvim-telescope.lua

59 lines
1.9 KiB
Lua
Raw Normal View History

2024-07-30 10:06:43 -07:00
return {
lazy = true,
'nvim-telescope/telescope.nvim',
tag = '0.1.4',
dependencies = { 'nvim-lua/plenary.nvim', 'nvim-telescope/telescope-media-files.nvim' },
2024-07-30 10:06:43 -07:00
config = function()
local actions = require("telescope.actions")
local keymap = vim.api.nvim_set_keymap
local canned = require("telescope._extensions.media.lib.canned")
2024-07-30 10:06:43 -07:00
require('telescope').setup({
extensions = {
media_files = {
filetypes = {"png", "webp", "jpg", "jpeg"},
find_cmd = "rg"
},
2024-07-30 10:06:43 -07:00
media = {
backend = "ueberzug",
2024-07-30 10:06:43 -07:00
}
},
defaults = {
prompt_prefix = "λ ",
selection_caret = "> ",
2024-07-30 10:06:43 -07:00
mappings = {
i = {
["<C-h>"] = actions.which_key,
["<C-k>"] = actions.move_selection_next,
["<C-j>"] = actions.move_selection_previous,
}
}
},
pickers = {
buffers = {
sort_lastused = true,
previewer = false,
layout_config = {
width = 0.3,
height = 0.4,
},
2024-07-30 10:06:43 -07:00
},
planets = {
show_pluto = true,
},
find_files = {
disable_devicons = true
},
2024-07-30 10:06:43 -07:00
},
})
keymap('n', '<leader><leader>', ':Telescope find_files<CR>', {})
keymap('n', '<leader>m', ':Telescope media<CR>', {})
keymap('n', '<leader>b', ':Telescope buffers<CR>', {})
keymap('n', '<leader>t', ':Telescope<CR>', {})
keymap('n', '<leader>g', ':Telescope live_grep<CR>', {})
require('telescope').load_extension('media_files')
2024-07-30 10:06:43 -07:00
end,
}