telescope git files with fallback to local files
parent
cdbfe35a6f
commit
0eb58f5f40
@ -1,15 +1,17 @@
|
|||||||
print("Setting up colors")
|
print("Setting up colors")
|
||||||
|
|
||||||
rose_pine = packer_plugins["rose-pine"]
|
vim.cmd.colorscheme("jellybeans")
|
||||||
if rose_pine then
|
|
||||||
print("Rose Pine is known")
|
-- rose_pine = packer_plugins["rose-pine"]
|
||||||
if rose_pine.loaded then
|
-- if rose_pine then
|
||||||
print("Using Rose Pine colorscheme")
|
-- print("Rose Pine is known")
|
||||||
vim.cmd.colorscheme("rose-pine")
|
-- if rose_pine.loaded then
|
||||||
-- vim.cmd("colorscheme rose-pine")
|
-- print("Using Rose Pine colorscheme")
|
||||||
else
|
-- vim.cmd.colorscheme("rose-pine")
|
||||||
print("Rose Pine is not loaded")
|
-- -- vim.cmd("colorscheme rose-pine")
|
||||||
end
|
-- else
|
||||||
else
|
-- print("Rose Pine is not loaded")
|
||||||
print("Rose Pine is not known")
|
-- end
|
||||||
end
|
-- else
|
||||||
|
-- print("Rose Pine is not known")
|
||||||
|
-- end
|
||||||
|
@ -1,2 +1,19 @@
|
|||||||
print("After Telescope")
|
print("After Telescope")
|
||||||
|
|
||||||
|
local telescope = require('telescope')
|
||||||
local builtin = require('telescope.builtin')
|
local builtin = require('telescope.builtin')
|
||||||
|
|
||||||
|
telescope.setup({
|
||||||
|
defaults = {
|
||||||
|
file_ignore_patterns = {
|
||||||
|
"__pycache__",
|
||||||
|
},
|
||||||
|
preview = {
|
||||||
|
treesitter = {
|
||||||
|
enable = {
|
||||||
|
'python',
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
})
|
||||||
|
@ -0,0 +1,29 @@
|
|||||||
|
print("Loading up etc definitions")
|
||||||
|
local M = {}
|
||||||
|
|
||||||
|
local telescope = require("telescope.builtin")
|
||||||
|
|
||||||
|
-- cache directory checks for great speed
|
||||||
|
local is_inside_work_tree = {}
|
||||||
|
|
||||||
|
|
||||||
|
M.project_files = function()
|
||||||
|
local opts = {}
|
||||||
|
|
||||||
|
local cwd = vim.fn.getcwd()
|
||||||
|
|
||||||
|
if is_inside_work_tree[cwd] == nil then
|
||||||
|
-- The directory has not been checked
|
||||||
|
vim.fn.system("git rev-parse --is-inside-work-tree")
|
||||||
|
-- Add the result to our cache
|
||||||
|
is_inside_work_tree[cwd] = vim.v.shell_error == 0
|
||||||
|
end
|
||||||
|
|
||||||
|
if is_inside_work_tree[cwd] then
|
||||||
|
telescope.git_files(opts)
|
||||||
|
else
|
||||||
|
telescope.find_files(opts)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
return M
|
Loading…
Reference in New Issue