start restructering of lazy
This commit is contained in:
161
lua/plugins/telescope.lua
Normal file
161
lua/plugins/telescope.lua
Normal file
@@ -0,0 +1,161 @@
|
||||
return {
|
||||
'nvim-telescope/telescope.nvim',
|
||||
dependencies = {
|
||||
'nvim-lua/plenary.nvim',
|
||||
'kyazdani42/nvim-web-devicons',
|
||||
{
|
||||
'nvim-telescope/telescope-fzf-native.nvim',
|
||||
'nvim-telescope/telescope-ui-select.nvim',
|
||||
build = {
|
||||
'cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release -G Ninja', -- On windows add -DCMAKE_C_FLAGS="-target x86_64-w64-mingw32"
|
||||
'cmake --build build --config Release',
|
||||
'cmake --install build --prefix build'
|
||||
},
|
||||
config = function()
|
||||
end
|
||||
},
|
||||
},
|
||||
cmd = { "Telescope" },
|
||||
keys = {
|
||||
{
|
||||
'<leader>f',
|
||||
function()
|
||||
require("telescope.builtin").find_files({ no_ignore = true })
|
||||
end,
|
||||
desc = 'Find file',
|
||||
},
|
||||
{
|
||||
'<leader>g',
|
||||
function()
|
||||
Project_files()
|
||||
end,
|
||||
desc = 'Find git files',
|
||||
},
|
||||
{
|
||||
'<leader>o',
|
||||
function()
|
||||
require("telescope.builtin").oldfiles()
|
||||
end,
|
||||
desc = 'Find old files',
|
||||
},
|
||||
{
|
||||
'<leader>h',
|
||||
function()
|
||||
require("telescope.builtin").command_history()
|
||||
end,
|
||||
desc = 'Open command history',
|
||||
},
|
||||
{
|
||||
'<leader>b',
|
||||
function()
|
||||
require("telescope.builtin").buffers()
|
||||
end,
|
||||
desc = 'Select buffer',
|
||||
},
|
||||
{
|
||||
'<leader>q',
|
||||
function()
|
||||
require("telescope.builtin").quickfix()
|
||||
end,
|
||||
desc = 'Quickfix list with telescope',
|
||||
},
|
||||
{
|
||||
'<leader>l',
|
||||
function()
|
||||
require("telescope.builtin").live_grep()
|
||||
end,
|
||||
desc = 'Search in project',
|
||||
},
|
||||
{
|
||||
'<leader>j',
|
||||
function()
|
||||
require("telescope.builtin").jumplist()
|
||||
end,
|
||||
desc = 'Open jumplist',
|
||||
},
|
||||
{
|
||||
'<c-f>',
|
||||
function()
|
||||
require("telescope.builtin").current_buffer_fuzzy_find()
|
||||
end,
|
||||
desc = 'Find in buffer',
|
||||
},
|
||||
{
|
||||
'<leader>d',
|
||||
function()
|
||||
require("telescope.builtin").grep_string()
|
||||
end,
|
||||
desc = 'Find in workspace',
|
||||
}
|
||||
},
|
||||
config = function()
|
||||
local actions = require('telescope.actions')
|
||||
|
||||
local mappingTab = {
|
||||
i = {
|
||||
['<cr>'] = actions.select_tab,
|
||||
['<C-b>'] = actions.select_default,
|
||||
},
|
||||
}
|
||||
|
||||
require('telescope').setup({
|
||||
defaults = {
|
||||
mappings = {
|
||||
i = {
|
||||
['<cr>'] = actions.select_default + actions.center,
|
||||
['<C-l>'] = actions.send_selected_to_loclist,
|
||||
['<C-q>'] = actions.smart_send_to_qflist,
|
||||
},
|
||||
},
|
||||
},
|
||||
pickers = {
|
||||
-- Your special builtin config goes in here
|
||||
buffers = {
|
||||
sort_lastused = true,
|
||||
theme = 'ivy',
|
||||
mappings = {
|
||||
i = {
|
||||
['<c-w>'] = actions.delete_buffer,
|
||||
['<cr>'] = actions.select_default,
|
||||
},
|
||||
n = {
|
||||
['<c-w>'] = actions.delete_buffer,
|
||||
},
|
||||
},
|
||||
},
|
||||
find_files = {
|
||||
theme = 'ivy',
|
||||
previewer = false,
|
||||
},
|
||||
oldfiles = {
|
||||
theme = 'ivy',
|
||||
},
|
||||
git_files = {
|
||||
theme = 'ivy',
|
||||
previewer = false,
|
||||
},
|
||||
lsp_references = {
|
||||
show_line = false;
|
||||
include_declaration = false,
|
||||
},
|
||||
lsp_dynamic_workspace_symbols = {},
|
||||
},
|
||||
extensions = {
|
||||
["ui-select"] = {
|
||||
require("telescope.themes").get_dropdown {
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
require("telescope").load_extension("ui-select")
|
||||
|
||||
Project_files = function()
|
||||
local opts = {} -- define here if you want to define something
|
||||
local ok = pcall(require "telescope.builtin".git_files, opts)
|
||||
if not ok then require "telescope.builtin".find_files(opts) end
|
||||
end
|
||||
|
||||
require('telescope').load_extension('fzf')
|
||||
end
|
||||
}
|
||||
Reference in New Issue
Block a user