Update 05.06.23
This commit is contained in:
@@ -6,7 +6,7 @@ local highlights = require "custom.highlights"
|
||||
|
||||
M.ui = {
|
||||
theme = "gatekeeper",
|
||||
theme_toggle = { "gatekeeper", "one_light" },
|
||||
theme_toggle = { "gatekeeper", "monekai" },
|
||||
|
||||
hl_override = highlights.override,
|
||||
hl_add = highlights.add,
|
||||
|
||||
@@ -8,5 +8,5 @@ M.general = {
|
||||
}
|
||||
|
||||
-- more keybinds!
|
||||
|
||||
--
|
||||
return M
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
-- Implement delta as previewer for diffs
|
||||
|
||||
local previewers = require('telescope.previewers')
|
||||
local builtin = require('telescope.builtin')
|
||||
local E = {}
|
||||
|
||||
local delta = previewers.new_termopen_previewer {
|
||||
get_command = function(entry)
|
||||
-- this is for status
|
||||
-- You can get the AM things in entry.status. So we are displaying file if entry.status == '??' or 'A '
|
||||
-- just do an if and return a different command
|
||||
if entry.status == '??' or 'A ' then
|
||||
return { 'git', '-c', 'core.pager=delta', '-c', 'delta.side-by-side=false', 'diff', entry.value }
|
||||
end
|
||||
|
||||
-- note we can't use pipes
|
||||
-- this command is for git_commits and git_bcommits
|
||||
return { 'git', '-c', 'core.pager=delta', '-c', 'delta.side-by-side=false', 'diff', entry.value .. '^!' }
|
||||
|
||||
end
|
||||
}
|
||||
|
||||
E.my_git_commits = function(opts)
|
||||
opts = opts or {}
|
||||
opts.previewer = delta
|
||||
|
||||
builtin.git_commits(opts)
|
||||
end
|
||||
|
||||
E.my_git_bcommits = function(opts)
|
||||
opts = opts or {}
|
||||
opts.previewer = delta
|
||||
|
||||
builtin.git_bcommits(opts)
|
||||
end
|
||||
|
||||
E.my_git_status = function(opts)
|
||||
opts = opts or {}
|
||||
opts.previewer = delta
|
||||
|
||||
builtin.git_status(opts)
|
||||
end
|
||||
|
||||
E.my_git_branches = function(opts)
|
||||
opts = opts or {}
|
||||
opts.previewer = delta
|
||||
|
||||
builtin.git_branches(opts)
|
||||
end
|
||||
|
||||
E.project_files = function()
|
||||
local opts = {} -- define here if you want to define something
|
||||
vim.fn.system('git rev-parse --is-inside-work-tree')
|
||||
if vim.v.shell_error == 0 then
|
||||
require"telescope.builtin".git_files(opts)
|
||||
else
|
||||
require"telescope.builtin".find_files(opts)
|
||||
end
|
||||
end
|
||||
|
||||
return E
|
||||
Reference in New Issue
Block a user