Skip to content

Conversation

@lalvarezt
Copy link
Contributor

@lalvarezt lalvarezt commented Aug 22, 2025

📺 PR Description

This PR closes #708, see discussion for additional information

One-to-One

[metadata]
name = "git-diff2"
description = "A channel to select files from git diff commands"
requirements = ["git"]

[source]
command = "git log --graph --pretty=format:'%C(yellow)%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --color=always"
output = "{strip_ansi|split: :1}"
ansi = true

[ui]
results_max_selections = 2

[ui.preview_panel.footer]
template = "diff {strip_ansi|split: :1}..{strip_ansi|split: :1}"
mode = "one_to_one"

[preview.command]
template = "git diff --color=always {strip_ansi|split: :1}..{strip_ansi|split: :1}"
mode = "one_to_one"
shell_escaping = true
image

Concatenate

[metadata]
name = "files"
description = "A channel to select files and directories"
requirements = ["fd", "bat"]

[source]
command = ["fd -t f", "fd -t f -H"]

[source.output]
template = "{}"
mode = "concatenate"
separator = "\n"
shell_escaping = false

[ui.preview_panel.footer]
template = "{}"
mode = "concatenate"
separator = " - "
shell_escaping = false

[preview.command]
template = "bat -n --color=always {}"
# mode = "concatenate"
# separator = " "
shell_escaping = true
env = { BAT_THEME = "ansi" }

[keybindings]
shortcut = "f1"
alt-e = "actions:edit"

[actions.edit]
description = "Opens the selected entries with the default editor (falls back to vim)"
# use `mode = "fork"` if you want to return to tv afterwards
mode = "execute"

[actions.edit.command]
template = "${EDITOR:-vim} {}"
mode = "concatenate"
separator = " "
shell_escaping = true
image

Checklist

  • my commits and PR title follow the conventional commits format
  • if this is a new feature, I have added tests to consolidate the feature and prevent regressions
  • if this is a bug fix, I have added a test that reproduces the bug (if applicable)
  • I have added a reasonable amount of documentation to the code where appropriate

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant