aboutsummaryrefslogtreecommitdiffstats
path: root/atuin-client
diff options
context:
space:
mode:
authorTobias Genannt <tobias.genannt@gmail.com>2023-10-12 23:13:50 +0200
committerGitHub <noreply@github.com>2023-10-12 22:13:50 +0100
commit20afcd2b633791c932651e04e340334dabb3ed4e (patch)
tree9e9e6a4d0dcd117bf94c943863578553e54d1223 /atuin-client
parentUpdate key-binding.md (#1291) (diff)
downloadatuin-20afcd2b633791c932651e04e340334dabb3ed4e.zip
Add commands to print the default configuration (#1241)
* Add commands to print the default configuration When updating a software I often want to compare my configuration with the configuration of the new version. To make this possible atuin can now print the default configuration. This also updates the example files with the actual values used as default in the settings.rs files. * Changed command name to 'default-config' * Fixed merge
Diffstat (limited to 'atuin-client')
-rw-r--r--atuin-client/config.toml23
-rw-r--r--atuin-client/src/settings.rs8
2 files changed, 28 insertions, 3 deletions
diff --git a/atuin-client/config.toml b/atuin-client/config.toml
index 7fd07986..d1c1081f 100644
--- a/atuin-client/config.toml
+++ b/atuin-client/config.toml
@@ -28,7 +28,7 @@
## how often to sync history. note that this is only triggered when a command
## is ran, so sync intervals may well be longer
## set it to 0 to sync after every command
-# sync_frequency = "1h"
+# sync_frequency = "10m"
## which search mode to use
## possible values: prefix, fulltext, fuzzy, skim
@@ -102,3 +102,24 @@
# cwd_filter = [
# "^/very/secret/area"
# ]
+
+## Configure the maximum height of the preview to show.
+## Useful when you have long scripts in your history that you want to distinguish
+## by more than the first few lines.
+# max_preview_height = 4
+
+## Configure whether or not to show the help row, which includes the current Atuin
+## version (and whether an update is available), a keymap hint, and the total
+## amount of commands in your history.
+# show_help = true
+
+## Invert the UI - put the search bar at the top
+# invert = false
+
+## Defaults to true. This matches history against a set of default regex, and will not save it if we get a match. Defaults include
+## 1. AWS key id
+## 2. Github pat (old and new)
+## 3. Slack oauth tokens (bot, user)
+## 4. Slack webhooks
+## 5. Stripe live/test keys
+# secrets_filter = true
diff --git a/atuin-client/src/settings.rs b/atuin-client/src/settings.rs
index e49ab0cb..15aa9e06 100644
--- a/atuin-client/src/settings.rs
+++ b/atuin-client/src/settings.rs
@@ -24,6 +24,7 @@ pub const LAST_SYNC_FILENAME: &str = "last_sync_time";
pub const LAST_VERSION_CHECK_FILENAME: &str = "last_version_check_time";
pub const LATEST_VERSION_FILENAME: &str = "latest_version";
pub const HOST_ID_FILENAME: &str = "host_id";
+static EXAMPLE_CONFIG: &str = include_str!("../config.toml");
#[derive(Clone, Debug, Deserialize, Copy, ValueEnum, PartialEq)]
pub enum SearchMode {
@@ -410,9 +411,8 @@ impl Settings {
FileFormat::Toml,
))
} else {
- let example_config = include_bytes!("../config.toml");
let mut file = File::create(config_file).wrap_err("could not create config file")?;
- file.write_all(example_config)
+ file.write_all(EXAMPLE_CONFIG.as_bytes())
.wrap_err("could not write default config file")?;
config_builder
@@ -446,6 +446,10 @@ impl Settings {
Ok(settings)
}
+
+ pub fn example_config() -> &'static str {
+ EXAMPLE_CONFIG
+ }
}
impl Default for Settings {