Skip to content

feat(config): add editor key to override $EDITOR for e/:edit - #677

Merged
agavra merged 2 commits into
agavra:mainfrom
yuhua99:feat/config-editor
Sep 7, 2026
Merged

agavra merged 2 commits into
agavra:mainfrom
yuhua99:feat/config-editor

Conversation

@yuhua99

@yuhua99 yuhua99 commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Problem

Coming from tools like lazygit, I expected to configure the editor in config.toml.

Tuicr only reads $EDITOR, which means stuffing the environment variable through wrappers or aliases just to control which editor the e / :edit handoff opens.

Proposal

Add a top-level editor config key:

editor = "nvim"
editor = "code -w"   # args allowed; -w keeps tuicr blocking on windowed editors

When set, it overrides $EDITOR.

Implementation

  • EditorCommand::from_env takes the override as a parameter and resolves editor config key → $EDITOR → vi in a small resolve_editor helper
  • App carries editor_override from config into the editor handoff
  • docs updated: docs/CONFIG.md, docs/KEYBINDINGS.md, README.md, help popup

The e/`:edit` handoff read only $EDITOR (falling back to vi), so
pinning a specific editor required wrapping tuicr in a shell that
exports the variable. Add a top-level `editor` config key, split with
the same shlex rules as $EDITOR, consulted before it.

Wire it through App::editor_override into EditorCommand::from_env,
which now takes the override as a parameter and resolves
config > $EDITOR > vi in resolve_editor.

@agavra agavra left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @yuhua99 for the contribution! This looks good to me.

@agavra
agavra merged commit 082c808 into agavra:main Sep 7, 2026
5 checks passed
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.

2 participants