mirror of
https://github.com/martinvonz/jj.git
synced 2025-01-29 23:57:51 +00:00
cli: extract stock merge-tools config to file, embed it in binary
I think a separate .toml file is easier to maintain as the merge-tools table will grow.
This commit is contained in:
parent
7f9a0a2820
commit
0a28b2c508
2 changed files with 12 additions and 13 deletions
|
@ -75,19 +75,7 @@ fn env_base() -> config::Config {
|
||||||
fn default_mergetool_config() -> config::Config {
|
fn default_mergetool_config() -> config::Config {
|
||||||
config::Config::builder()
|
config::Config::builder()
|
||||||
.add_source(config::File::from_str(
|
.add_source(config::File::from_str(
|
||||||
r#"
|
include_str!("merge-tools.toml"),
|
||||||
[merge-tools]
|
|
||||||
meld.merge-args = ["$left", "$base", "$right",
|
|
||||||
"-o", "$output", "--auto-merge"]
|
|
||||||
kdiff3.merge-args = ["$base", "$left", "$right",
|
|
||||||
"-o", "$output", "--auto"]
|
|
||||||
vimdiff.program = "vim"
|
|
||||||
vimdiff.merge-args = ["-f", "-d", "$output", "-M",
|
|
||||||
"$left", "$base", "$right",
|
|
||||||
"-c", "wincmd J", "-c", "set modifiable",
|
|
||||||
"-c", "set write"]
|
|
||||||
vimdiff.merge-tool-edits-conflict-markers=true
|
|
||||||
"#,
|
|
||||||
config::FileFormat::Toml,
|
config::FileFormat::Toml,
|
||||||
))
|
))
|
||||||
.build()
|
.build()
|
||||||
|
|
11
src/merge-tools.toml
Normal file
11
src/merge-tools.toml
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
[merge-tools]
|
||||||
|
meld.merge-args = ["$left", "$base", "$right",
|
||||||
|
"-o", "$output", "--auto-merge"]
|
||||||
|
kdiff3.merge-args = ["$base", "$left", "$right",
|
||||||
|
"-o", "$output", "--auto"]
|
||||||
|
vimdiff.program = "vim"
|
||||||
|
vimdiff.merge-args = ["-f", "-d", "$output", "-M",
|
||||||
|
"$left", "$base", "$right",
|
||||||
|
"-c", "wincmd J", "-c", "set modifiable",
|
||||||
|
"-c", "set write"]
|
||||||
|
vimdiff.merge-tool-edits-conflict-markers=true
|
Loading…
Reference in a new issue