function vim.find_files_from_project_git_root() local function is_git_repo() vim.fn.system("git rev-parse --is-inside-work-tree") return vim.v.shell_error == 0 end local function is_svn_repo() vim.fn.system("svn info") return vim.v.shell_error == 0 end local function get_git_root() local dot_git_path = vim.fn.finddir(".git", ".;") return vim.fn.fnamemodify(dot_git_path, ":h") end local function get_svn_root() local dot_svn_path = vim.fn.system("svn info --show-item wc-root") return vim.trim(dot_svn_path) end local opts = {} if is_git_repo() then opts = { cwd = get_git_root(), } elseif is_svn_repo() then opts = { cwd = get_svn_root(), } end require("telescope.builtin").find_files(opts) end return { { "nvim-telescope/telescope.nvim", branch = "0.1.x", event = "VimEnter", dependencies = { "nvim-lua/plenary.nvim"}, opts = { defaults = { layout_config = { horizontal = { width = 0.9 } }, }, }, keys = { { "ff", "Telescope find_files", desc = "Find files" }, { "F", vim.find_files_from_project_git_root, desc = "Find project files" }, { "fg", require("telescope.builtin").live_grep, desc = "Find inside files" }, { "s", "Telescope spell_suggest", desc = "Spelling suggestions" }, }, } }