# herdr-file-viewer example configuration # ============================================================================= # # HOW TO USE THIS FILE # # 1. Copy it into your config directory and RENAME it to `config.toml`: # # Under herdr, run `herdr plugin config-dir herdr-file-viewer` to print the # directory it belongs in. On Linux that directory is # ~/.config/herdr/plugins/config/herdr-file-viewer/ # (provided as $HERDR_PLUGIN_CONFIG_DIR), so your config file becomes: # ~/.config/herdr/plugins/config/herdr-file-viewer/config.toml # # Standalone, outside herdr: # ~/.config/herdr-file-viewer/config.toml # (or $XDG_CONFIG_HOME/herdr-file-viewer/config.toml when that is set) # # 2. Uncomment and edit the lines you want, then relaunch the viewer. # # Every setting below is COMMENTED OUT, so copying this file as-is changes nothing. # Uncomment and edit a line to change that setting; leave a key unset to keep its # built-in default. The viewer never writes this file: it is read-only input, # picked up on relaunch (there is no in-app settings editor). See what is currently # in effect any time in the `?` help overlay's Settings and Keybindings tabs. # # Precedence: a config key always wins. Two keys also fall back to an environment # variable before the built-in default (`editor` -> $EDITOR, `update_check` -> # $HERDR_FILE_VIEWER_NO_UPDATE_CHECK); every other key is config-or-default only. # A missing file is the normal case. A malformed file (bad TOML or a wrong-typed # value) is ignored whole and every key falls back to its default, flagged in the # Settings tab. # --- External programs ------------------------------------------------------- # # All command values are split into arguments the way a shell would for simple # cases (whitespace splits; double-quotes group a path that contains spaces), but # NO shell is invoked. Two different I/O contracts apply: # # * editor / open / reveal receive the target PATH appended as the final # argument (for `reveal`, the containing folder). # * markdown / diff / syntax receive the file CONTENT piped on standard input # (never as a path argument). A value you set REPLACES the whole default # command -- flags are NOT merged in -- so your command must read stdin (glow # and bat need a trailing `-`) and set its own color/format flags. The token # `{name}` is substituted with the file name (bat uses it to pick the syntax). # Editor launched by the `e` key. Precedence: this key > $EDITOR > a platform # default. Example: #editor = "code --wait" # Content-pane renderers. Defaults: glow (markdown), delta (diff), bat (syntax); # if one is not installed the pane falls back to plain text with a notice. These # examples are working commands equivalent to the defaults (note the stdin `-`); # edit them, or leave a key unset to keep the bundled default. #markdown = "glow -s dark -w 0 -" #diff = "delta" #syntax = "bat --color=always --style=numbers --paging=never --file-name={name} -" # OS hand-off commands: `O` opens the selected entry with an application, `R` # reveals it in a file manager. Defaults are the per-OS system openers # (e.g. xdg-open on Linux, `open` on macOS, explorer on Windows). #open = "xdg-open" #reveal = "nautilus" # --- Startup toggles --------------------------------------------------------- # Hide dot-prefixed (hidden) files and folders at startup. The `.` key still # toggles this at runtime. Default: #hide_dotfiles = false # Show gitignored (and git-excluded) files and folders at startup -- exactly as # if the `i` key had already been pressed once. `.git/` itself is never browsed # either way. The `i` key still toggles this at runtime. Default: #show_ignored = false # Draw a chain of single-child directories as ONE row -- `src/main/java/br/com` # instead of six rows, each indented two columns further than the last. The row # leads into the DEEPEST directory of the chain, so expand/collapse and status # act on that one; a chain stops as soon as a directory holds a file or a second # entry. Worth turning on when your paths are deeper than your pane is wide (a # Java/Maven layout, a nested monorepo). A startup setting -- no runtime key # toggles it. Default: #compact_dirs = false # Choose the automatic initial view for Git-changed files. "diff" preserves the # default diff-first behavior. "content" applies the normal file-type policy # instead: Markdown opens rendered, while source/text opens in syntax content. # Deleted paths stay diff-first because there is no on-disk content to render. # The `v` key still cycles through both diff views either way, and git status, # changed-file filters, baselines, and `D` diff presentation are unaffected. # An unrecognized value falls back to "diff". Default: #changed_file_view = "diff" # `update_check` governs release details and project spotlights. # `false` disables all remote requests and their display. When unset, # $HERDR_FILE_VIEWER_NO_UPDATE_CHECK also disables it. No separate spotlight setting. Default: #update_check = true # Annotations (`a` / `A`) live only for the session, so both quitting (`q`) and # switching worktree (`W`) destroy them. By default either confirms first, # offering to copy them to the clipboard on the way out. Set false to skip the # confirm and discard immediately. It only appears when annotations are actually # held. Default: #confirm_discard = true # How many lines the mouse wheel scrolls per event (also how many items it moves # in the file-search list, and lines in the `?` help overlay). Can be set from 1 # to 10 as a scale: 1 = slow, 3 = medium (default), 6 = fast, 10 = max speed. # Note: some terminals emit several wheel events per physical notch, so the # effective speed is this times that. Default: #scroll_lines = 3 # --- Layout ------------------------------------------------------------------ # TWO keys size the directory tree, and the SMALLER of the two wins: # # tree width shown = min( tree_width% of the pane , tree_max_cols columns ) # # >>> Gotcha: if you raise `tree_width` (say to 50) and the tree does NOT get # wider, `tree_max_cols` is the limit capping it. Raise `tree_max_cols` too, # or set it high to switch the cap off. They work together, so tune both. <<< # # Both size the split INSIDE the viewer's pane, not the herdr pane itself (the # host decides that). You can always resize live with the grow/shrink keys or by # dragging the divider; these keys only set the STARTUP value. # tree_width: the tree column's share of the pane, as a percent from 20 to 80 # (the content pane takes the rest). Default: #tree_width = 30 # tree_max_cols: a HARD CAP on the tree width, in CHARACTER COLUMNS (not a # percent). Because the smaller value wins (see above), on a wide pane this is # usually what actually governs: at the default 30 the tree never grows past 30 # columns even when `tree_width` would give it more, so it stays compact instead # of a mostly-blank column. Raise it (up to 1000, or just set it high) to let # `tree_width` take over. Default: #tree_max_cols = 30 # tree_position: which side the tree sits on, "left" (default) or "right". An # unrecognized value falls back to "left". Default: #tree_position = "left" # --- Content preview --------------------------------------------------------- # # A file is shown in FULL until it exceeds one of two caps, then the content pane # shows a truncated preview plus a "⚠ Truncated preview" notice. The caps trigger # on whichever is hit FIRST, and they also apply to a large diff. For typical # source code the LINE cap bites first; the SIZE cap mainly guards minified or # generated files (bundles, big JSON, logs) and also bounds how much is ever read # from disk. Raise them to view bigger files; very large values can make the pane # slower to render. # preview_max_lines: show at most this many lines before truncating. From 100 to # 100000. Default: #preview_max_lines = 10000 # preview_max_kib: show at most this size before truncating, in KiB (1024 = 1 MB). # From 64 to 65536 (64 MB). Default: #preview_max_kib = 1024 # --- Keybindings ------------------------------------------------------------- # # Remap any global key. Key each entry by its INTENT NAME: the stable snake_case # id of an action, shown next to every action in the `?` help overlay's # Keybindings tab (e.g. refresh, nav_up, switch_worktree). A value is a KEY SPEC: # a single string, or an array of strings. An entry REPLACES that action's # default key(s), so list every key you want it to answer to. The full list of # intent names (all 44 actions) is in docs/configuration.md (Keybindings) and the # `?` overlay's Keybindings tab. # # Bindable keys: any single printable or shifted character (`g`, `<`, `{`, `?`, and # capitals such as `W` are each their own key), plus the named keys Tab, Enter, # Esc, the four arrows, Home, End, PageUp, PageDown, Space, Backspace, Delete, # Insert, and F1 through F12 (named keys are case-insensitive). There are NO # Ctrl / Alt chords: a chord never fires an action, so combinations like Ctrl+C # always pass straight through the terminal. # # Safety: `Esc` always closes the viewer and cannot be rebound away, so a remap # can never lock you out. An unknown intent name, an unbindable key, or two # actions claiming the same key is ignored for those entries only (their defaults # are kept) and surfaced in the Keybindings tab. Only global keys are remappable; # keys handled inside a modal (the finder query, the `:` / `/` prompt, line-select # mode) keep their own keys. # #[keys] #refresh = "g" # `g` refreshes; the default `r` no longer does #nav_up = ["w", "Up"] # bind several keys at once (the default `k` is dropped) #switch_worktree = "F2" # a named key