local M = {} local hastelescope, telescope= pcall(require, "telescope") if not hastelescope then return M end M.project_files = function() local opts = require('telescope.themes').get_ivy({}) -- define here if you want to define something opts["show_untracked"] = true opts["layout_config"] = {height=0.2} if not pcall(require"telescope.builtin".git_files, opts) then require"telescope.builtin".find_files(opts) end end M.buffers = function() local opts = require('telescope.themes').get_ivy({}) -- define here if you want to define something opts["layout_config"] = {height=0.2} require"telescope.builtin".buffers(opts) end local actions = require("telescope.actions") require("telescope").setup{ defaults = { file_ignore_patterns = { ".cache/.*", "node_modules/.*", ".git/.*", "Venv/.*", "venv/.*", "wandb/.*", "Resources/.*" }, mappings = { i = { ["jj"] = actions.close, [""] = actions.move_selection_next, [""] = actions.move_selection_previous, }, }, } } telescope.load_extension('fzf') vim.api.nvim_set_keymap("n", "", "lua require'telescope_config'.project_files()", {noremap = true, silent = true}) vim.api.nvim_set_keymap("n", "", "lua require('telescope_config').buffers()", { silent = true, noremap = true }) vim.api.nvim_set_keymap("n", "", "lua require('telescope.builtin').live_grep{ cwd = vim.fn.systemlist(\"git rev-parse --show-toplevel 2> /dev/null || pwd\")[1] }", { silent = true, noremap = true }) return M