1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# todoke default config.
# Lives at ~/.config/todoke/todoke.toml on every platform.
# Values in double-braces are Tera template expressions.
[]
# user-defined vars go here, e.g.:
# proj_root = "/home/you/src"
# Tool-wide settings. Background auto-update behaviour:
# auto_update = "install" # off | notify | install (default: install)
# off = never check or install
# notify = check in the background, print a banner if a newer release
# exists, but don't install
# install = silently download + swap the binary in the background; the
# new version applies on the next launch (the default)
# update_interval = "24h" # throttle between background checks (humantime)
# The TODOKE_NO_AUTOUPDATE env var (set to anything but "" / "0" / "false")
# disables auto-update entirely and overrides this setting.
# [options]
# auto_update = "install"
# update_interval = "24h"
# kind = "neovim" opts into msgpack-RPC reuse of a running nvim on `listen`.
# is_windows()/is_linux()/is_mac() are todoke-provided Tera functions.
[]
= "neovim"
= "nvim"
= '{% if is_windows() %}\\.\pipe\nvim-todoke-{{ group }}{% else %}/tmp/nvim-todoke-{{ group }}.sock{% endif %}'
# git commit / rebase, AI-tool prompt temp files etc. — always a fresh
# nvim, block until it exits so the calling tool (git, gemini-cli,
# claude-code, …) reads the edited file. Gemini CLI only spawns the
# editor for prompt files when it recognises the binary as a vim-family
# name, so the gemini-edit branch only fires when todoke is invoked under
# the `todoke-vim` alias — see README. The patterns below pin the
# `claude-prompt-` / `gemini-edit-` shape to the basename so a project
# directory named `gemini-edit-clone/` doesn't accidentally route as a
# prompt file.
[[]]
= "editor-callback"
= [
# git / svn / hg commit + rebase + tag edit messages
'(?i)/(COMMIT_EDITMSG|MERGE_MSG|TAG_EDITMSG|EDIT_DESCRIPTION|git-rebase-todo|\.gitmessage|NOTES_EDITMSG|svn-commit\.tmp)$',
# Claude Code prompt temp files (basename starts with claude-prompt-)
'(?i)/claude-prompt-[^/]+$',
# Gemini CLI prompt temp files (mkdtemp `gemini-edit-XXXX/buffer.txt`)
'(?i)/gemini-edit-[^/]+/buffer\.txt$',
]
= "nvim"
= "new"
= true
# Neovim-family flags that take a spaced value on the next argv
# (`-c :set ft=md`, `-S session.vim`, `-i NONE`, `--listen /tmp/sock`, …).
# `consumes = 1` keeps the flag and its value together so they reach nvim
# intact. Must come before `any-flag` so the more-specific value-taking
# pattern wins; otherwise the trailing value would be classified as a
# separate input.
#
# `-i NONE` in particular is what Gemini CLI injects when it recognises
# the editor as vim-family — see README.
#
# Note: this binds `-i` (and other letters above) as value-taking by
# default. If you use $EDITOR=todoke with a tool that calls `-i` with
# different semantics, drop a `~/.config/todoke/todoke.toml` and tune
# this rule to taste.
[[]]
= "nvim-value-flag"
= '^(?:-[cSuUitwW]|--cmd|--startuptime|--listen|--server)$'
= true
= 1
# Catch-all for ex-editor-style argv: `+42`, lone `-`/`+` flags todoke
# wouldn't otherwise know what to do with. `to` is omitted so the flag
# rides along with whichever input rule built a batch in the same group.
[[]]
= "any-flag"
= '^[-+]'
= true
# Everything else: reuse a single long-running nvim called "default".
[[]]
= "default"
= '.*'
= "nvim"
= "default"
= "remote"
= false