mirror of
https://github.com/martinvonz/jj.git
synced 2024-11-28 00:56:57 +00:00
configs: use Notepad as default editor on Windows
This commit is contained in:
parent
32b07d6b79
commit
a367f13c72
9 changed files with 22 additions and 11 deletions
|
@ -27,6 +27,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||
|
||||
* The `push.branch-prefix` option was renamed to `git.push-branch-prefix`.
|
||||
|
||||
* The default editor on Windows is now `Notepad` instead of `pico`.
|
||||
|
||||
### New features
|
||||
|
||||
* `jj init --git-repo` now works with bare repositories.
|
||||
|
|
|
@ -433,7 +433,7 @@ struct InterdiffArgs {
|
|||
/// Update the change description or other metadata
|
||||
///
|
||||
/// Starts an editor to let you edit the description of a change. The editor
|
||||
/// will be $EDITOR, or `pico` if that's not defined.
|
||||
/// will be $EDITOR, or `pico` if that's not defined (`Notepad` on Windows).
|
||||
#[derive(clap::Args, Clone, Debug)]
|
||||
struct DescribeArgs {
|
||||
/// The revision whose description to edit
|
||||
|
|
|
@ -343,13 +343,18 @@ pub fn default_config() -> config::Config {
|
|||
config::File::from_str(include_str!($file), config::FileFormat::Toml)
|
||||
};
|
||||
}
|
||||
config::Config::builder()
|
||||
let mut builder = config::Config::builder()
|
||||
.add_source(from_toml!("config/colors.toml"))
|
||||
.add_source(from_toml!("config/merge_tools.toml"))
|
||||
.add_source(from_toml!("config/misc.toml"))
|
||||
.add_source(from_toml!("config/templates.toml"))
|
||||
.build()
|
||||
.unwrap()
|
||||
.add_source(from_toml!("config/templates.toml"));
|
||||
if cfg!(unix) {
|
||||
builder = builder.add_source(from_toml!("config/unix.toml"))
|
||||
}
|
||||
if cfg!(windows) {
|
||||
builder = builder.add_source(from_toml!("config/windows.toml"))
|
||||
}
|
||||
builder.build().unwrap()
|
||||
}
|
||||
|
||||
/// Environment variables that override config values
|
||||
|
|
|
@ -5,6 +5,5 @@
|
|||
# Placeholder: added by user
|
||||
|
||||
[ui]
|
||||
editor = "pico"
|
||||
pager = { command = ["less", "-FRX"], env = { LESSCHARSET = "utf-8" } }
|
||||
log-word-wrap = false
|
||||
|
|
2
cli/src/config/unix.toml
Normal file
2
cli/src/config/unix.toml
Normal file
|
@ -0,0 +1,2 @@
|
|||
[ui]
|
||||
editor = "pico"
|
2
cli/src/config/windows.toml
Normal file
2
cli/src/config/windows.toml
Normal file
|
@ -0,0 +1,2 @@
|
|||
[ui]
|
||||
editor = "Notepad"
|
|
@ -294,8 +294,8 @@ a `$`):
|
|||
|
||||
`$JJ_EDITOR` > `ui.editor` > `$VISUAL` > `$EDITOR`
|
||||
|
||||
Pico is the default editor in the absence of any other setting, but you could
|
||||
set it explicitly too.
|
||||
Pico is the default editor (Notepad on Windows) in the absence of any other
|
||||
setting, but you could set it explicitly too.
|
||||
|
||||
```toml
|
||||
ui.editor = "pico"
|
||||
|
|
|
@ -7,7 +7,7 @@ user.email = "YOUR_EMAIL@example.com"
|
|||
ui.color = "auto" # the default
|
||||
# ui.color = never # no color
|
||||
|
||||
ui.editor = "pico" # the default
|
||||
ui.editor = "pico" # the default on Unix
|
||||
# ui.editor = "vim"
|
||||
|
||||
ui.diff-editor = "meld" # default, requires meld to be installed
|
||||
|
|
|
@ -39,8 +39,9 @@ Now let's say we want to edit the `README` file in the repo to say "Goodbye"
|
|||
instead of "Hello". Let's start by describing the change (adding a
|
||||
commit message) so we don't forget what we're working on:
|
||||
```shell script
|
||||
# This will bring up $EDITOR (or `pico` by default). Enter something like
|
||||
# "Say goodbye" in the editor and then save the file and close the editor.
|
||||
# This will bring up $EDITOR (or `pico` or `Notepad` by default). Enter
|
||||
# something like "Say goodbye" in the editor and then save the file and close
|
||||
# the editor.
|
||||
$ jj describe
|
||||
Working copy now at: e427edcfd0ba Say goodbye
|
||||
```
|
||||
|
|
Loading…
Reference in a new issue