mirror of
https://github.com/alexpasmantier/television.git
synced 2025-07-29 06:11:37 +00:00

- Allow users to specify a custom input prompt string via the `input_prompt` setting in the configuration file. - Document the new `input_prompt` option in `.config/config.toml` with a commented example. - Add a test to ensure that the input prompt is correctly loaded from the user configuration file.
265 lines
8.4 KiB
TOML
265 lines
8.4 KiB
TOML
# CONFIGURATION FILE LOCATION ON YOUR SYSTEM:
|
|
# -------------------------------------------
|
|
# Defaults:
|
|
# ---------
|
|
# Linux: `$HOME/.config/television/config.toml`
|
|
# macOS: `$HOME/.config/television/config.toml`
|
|
# Windows: `%APPDATA%\television\config.toml`
|
|
#
|
|
# XDG dirs:
|
|
# ---------
|
|
# You may use XDG_CONFIG_HOME if set on your system.
|
|
# In that case, television will expect the configuration file to be in:
|
|
# `$XDG_CONFIG_HOME/television/config.toml`
|
|
#
|
|
|
|
# General settings
|
|
# ----------------------------------------------------------------------------
|
|
tick_rate = 50
|
|
default_channel = "files"
|
|
|
|
# History settings
|
|
# ---------------
|
|
# Maximum number of entries to keep in the global history (default: 100)
|
|
# The history tracks search queries across all channels and sessions
|
|
# Set to 0 to disable history functionality entirely
|
|
history_size = 200
|
|
|
|
# Whether to use global history (default: false)
|
|
# When true: history navigation shows entries from all channels
|
|
# When false: history navigation is scoped to the current channel
|
|
global_history = false
|
|
|
|
[ui]
|
|
# Whether to use nerd font icons in the UI
|
|
# This option requires a font patched with Nerd Font in order to properly
|
|
# display glyphs (see https://www.nerdfonts.com/ for more information)
|
|
use_nerd_font_icons = false
|
|
# How much space to allocate for the UI (in percentage of the screen)
|
|
# ┌───────────────────────────────────────┐
|
|
# │ │
|
|
# │ Terminal screen │
|
|
# │ ┌─────────────────────────────┐ │
|
|
# │ │ │ │
|
|
# │ │ │ │
|
|
# │ │ │ │
|
|
# │ │ Television UI │ │
|
|
# │ │ │ │
|
|
# │ │ │ │
|
|
# │ │ │ │
|
|
# │ │ │ │
|
|
# │ └─────────────────────────────┘ │
|
|
# │ │
|
|
# │ │
|
|
# └───────────────────────────────────────┘
|
|
ui_scale = 100
|
|
|
|
# Where to place the input bar in the UI (top or bottom)
|
|
input_bar_position = "top"
|
|
# The input prompt string (defaults to ">" if not specified)
|
|
# input_prompt = ">"
|
|
# What orientation should tv be (landscape or portrait)
|
|
orientation = "landscape"
|
|
# The theme to use for the UI
|
|
# A list of builtin themes can be found in the `themes` directory of the television
|
|
# repository. You may also create your own theme by creating a new file in a `themes`
|
|
# directory in your configuration directory (see the `config.toml` location above).
|
|
theme = "default"
|
|
|
|
# Theme color overrides
|
|
# ---------------------
|
|
# You can override specific colors from the selected theme by adding them here.
|
|
# This allows you to customize the appearance without creating a full theme file.
|
|
# Colors can be specified as ANSI color names (e.g., "red", "bright-blue") or
|
|
# as hex values (e.g., "#ff0000", "#1e1e2e").
|
|
#
|
|
# Example overrides:
|
|
# [ui.theme_overrides]
|
|
# background = "#000000"
|
|
# text_fg = "#ffffff"
|
|
# selection_bg = "#444444"
|
|
# match_fg = "#ff0000"
|
|
# The default size of the preview panel (in percentage of the screen)
|
|
preview_size = 50
|
|
|
|
# UI Features
|
|
# -------------
|
|
# Each feature can have two states: enabled/disabled and visible/not visible
|
|
# - enabled: controls whether the feature is functional
|
|
# - visible: controls whether the feature is displayed (only works if enabled)
|
|
#
|
|
# You can use the old array format for backward compatibility:
|
|
# features = ["preview_panel", "status_bar", "remote_control"]
|
|
#
|
|
# Or use the new detailed format:
|
|
[ui.features]
|
|
preview_panel = { enabled = true, visible = true }
|
|
help_panel = { enabled = true, visible = false }
|
|
status_bar = { enabled = true, visible = true }
|
|
remote_control = { enabled = true, visible = false }
|
|
|
|
# Feature-specific configurations
|
|
# Each feature can have its own configuration section
|
|
[ui.status_bar]
|
|
# Status bar separators (bubble):
|
|
#separator_open = ""
|
|
#separator_close = ""
|
|
# Status bar separators (box):
|
|
separator_open = ""
|
|
separator_close = ""
|
|
|
|
[ui.preview_panel]
|
|
# Preview panel size (percentage of screen width/height)
|
|
size = 50
|
|
#header = "{}"
|
|
#footer = ""
|
|
scrollbar = true
|
|
|
|
[ui.remote_control]
|
|
# Whether to show channel descriptions in remote control mode
|
|
show_channel_descriptions = true
|
|
# Whether to sort channels alphabetically
|
|
sort_alphabetically = true
|
|
|
|
|
|
# Keybindings
|
|
# ----------------------------------------------------------------------------
|
|
#
|
|
# HARDCODED KEYBINDINGS (cannot be changed via config):
|
|
# Input field actions (always active):
|
|
# Backspace - Delete previous character
|
|
# Ctrl+w - Delete previous word
|
|
# Ctrl+u - Delete entire line
|
|
# Delete - Delete next character
|
|
# Left/Right - Move cursor left/right
|
|
# Home / Ctrl+a - Go to input start
|
|
# End / Ctrl+e - Go to input end
|
|
#
|
|
# CONFIGURABLE KEYBINDINGS (can be customized below):
|
|
# --------------------------------------------------
|
|
[keybindings]
|
|
# Application control
|
|
# ------------------
|
|
# Quit the application
|
|
quit = ["esc", "ctrl-c"]
|
|
|
|
# Navigation and selection
|
|
# -----------------------
|
|
# Scrolling through entries
|
|
select_next_entry = ["down", "ctrl-n", "ctrl-j"]
|
|
select_prev_entry = ["up", "ctrl-p", "ctrl-k"]
|
|
#select_next_page = "pagedown"
|
|
#select_prev_page = "pageup"
|
|
|
|
# History navigation
|
|
# -----------------
|
|
# Navigate through search query history
|
|
select_prev_history = "ctrl-up"
|
|
select_next_history = "ctrl-down"
|
|
|
|
# Multi-selection
|
|
# --------------
|
|
# Add entry to selection and move to the next entry
|
|
toggle_selection_down = "tab"
|
|
# Add entry to selection and move to the previous entry
|
|
toggle_selection_up = "backtab"
|
|
# Confirm selection
|
|
confirm_selection = "enter"
|
|
|
|
# Preview panel control
|
|
# --------------------
|
|
# Scrolling the preview pane
|
|
scroll_preview_half_page_down = ["pagedown", "mousescrolldown"]
|
|
scroll_preview_half_page_up = ["pageup", "mousescrollup"]
|
|
|
|
# Data operations
|
|
# --------------
|
|
# Copy the selected entry to the clipboard
|
|
copy_entry_to_clipboard = "ctrl-y"
|
|
# Reload the current source
|
|
reload_source = "ctrl-r"
|
|
# Cycle through the available sources for the current channel
|
|
cycle_sources = "ctrl-s"
|
|
|
|
# UI Features
|
|
# ----------
|
|
toggle_remote_control = "ctrl-t"
|
|
toggle_preview = "ctrl-o"
|
|
toggle_help = "ctrl-h"
|
|
toggle_status_bar = "f12"
|
|
|
|
# Shell integration
|
|
# ----------------------------------------------------------------------------
|
|
#
|
|
# The shell integration feature allows you to use television as a picker for
|
|
# your shell commands (as well as your shell history with <CTRL-R>).
|
|
# E.g. typing `git checkout <CTRL-T>` will open television with a list of
|
|
# branches to choose from.
|
|
|
|
[shell_integration]
|
|
# This specifies the default fallback channel if no other channel is matched.
|
|
fallback_channel = "files"
|
|
|
|
[shell_integration.channel_triggers]
|
|
# Add your channel triggers here. Each key is a channel that will be triggered
|
|
# by the corresponding commands.
|
|
# Example: say you want the following commands to trigger the following channels
|
|
# when pressing <CTRL-T>:
|
|
# `git checkout` should trigger the `git-branches` channel
|
|
# `ls` should trigger the `dirs` channel
|
|
# `cat` and `cp` should trigger the `files` channel
|
|
#
|
|
# You would add the following to your configuration file:
|
|
# ```
|
|
# [shell_integration.channel_triggers]
|
|
# "git-branches" = ["git checkout"]
|
|
# "dirs" = ["ls"]
|
|
# "files" = ["cat", "cp"]
|
|
# ```
|
|
"alias" = ["alias", "unalias"]
|
|
"env" = ["export", "unset"]
|
|
"dirs" = ["cd", "ls", "rmdir"]
|
|
"files" = [
|
|
"cat",
|
|
"less",
|
|
"head",
|
|
"tail",
|
|
"vim",
|
|
"nano",
|
|
"bat",
|
|
"cp",
|
|
"mv",
|
|
"rm",
|
|
"touch",
|
|
"chmod",
|
|
"chown",
|
|
"ln",
|
|
"tar",
|
|
"zip",
|
|
"unzip",
|
|
"gzip",
|
|
"gunzip",
|
|
"xz",
|
|
]
|
|
"git-diff" = ["git add", "git restore"]
|
|
"git-branch" = [
|
|
"git checkout",
|
|
"git branch",
|
|
"git merge",
|
|
"git rebase",
|
|
"git pull",
|
|
"git push",
|
|
]
|
|
"git-log" = ["git log", "git show"]
|
|
"docker-images" = ["docker run"]
|
|
"git-repos" = ["nvim", "code", "hx", "git clone"]
|
|
|
|
|
|
[shell_integration.keybindings]
|
|
# controls which key binding should trigger tv
|
|
# for shell autocomplete
|
|
"smart_autocomplete" = "ctrl-t"
|
|
# controls which keybinding should trigger tv
|
|
# for command history
|
|
"command_history" = "ctrl-r"
|