refactor: use more flexible paths (#1381)

This commit is contained in:
kylo252 2021-09-13 11:28:15 +02:00 committed by GitHub
parent 38b0c3d860
commit 8eed75d67f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 216 additions and 153 deletions

View file

@ -1,5 +1,7 @@
local M = {}
local utils = require "utils"
function M.config()
-- Define this minimal config so that it's available if telescope is not yet available.
lvim.builtin.telescope = {
@ -96,7 +98,7 @@ function M.find_lunarvim_files(opts)
},
prompt = ">> ",
prompt_title = "~ LunarVim files ~",
cwd = CONFIG_PATH,
cwd = utils.join_paths(get_runtime_dir(), "lvim"),
find_command = { "git", "ls-files" },
}
opts = vim.tbl_deep_extend("force", theme_opts, opts)
@ -111,7 +113,7 @@ function M.grep_lunarvim_files(opts)
layout_strategy = "bottom_pane",
prompt = ">> ",
prompt_title = "~ search LunarVim ~",
cwd = CONFIG_PATH,
cwd = utils.join_paths(get_runtime_dir(), "lvim"),
}
opts = vim.tbl_deep_extend("force", theme_opts, opts)
require("telescope.builtin").live_grep(opts)