Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please provide configuration file example #130

Open
ivuorinen opened this issue Oct 29, 2024 · 3 comments
Open

Please provide configuration file example #130

ivuorinen opened this issue Oct 29, 2024 · 3 comments

Comments

@ivuorinen
Copy link

ivuorinen commented Oct 29, 2024

Currently there isn't an example how the .config/tms/config.toml file should be written, and what variables are available (tms config provides some hints, but creating a boilerplate would be great).

@ashwinkhode
Copy link

+1

@JulianNymark
Copy link

JulianNymark commented Nov 20, 2024

So the way that I got to the config values I was interested in (in a bit of a clunky way) was to run the tms config command (like mentioned above) with the specific config I want to set, for example tms config --excluded "node_modules", and then I can see what it outputs in its output config dir (which isn't necessarily the preferred config file either, for me it writes to ~/Library/Application\ Support/tms/config.toml, so probably the "top level config" is the fixed output destination).

But it seems the serialization pattern is to write the same strings you see in the config help output, but with underscores instead of dashes.

Thoughts: having a config file generated from the defaults would be a pretty nice way to create an example config file that never gets stale 🤔

@ethanuppal
Copy link

Thoughts: having a config file generated from the defaults would be a pretty nice way to create an example config file that never gets stale 🤔
@JulianNymark

While I agree with this sentiment, the defaults are not particularly useful. That is, the default configuration:

let mut builder = config::Config::builder();

just generates a default config::ConfigBuilder (https://docs.rs/config/0.15.4/src/config/config.rs.html#47-49), which itself only derives the default TMS Config (https://docs.rs/config/0.15.4/src/config/builder.rs.html#95):

#[derive(Default, Debug, Serialize, Deserialize, PartialEq, Eq)]
pub struct Config {
pub default_session: Option<String>,
pub display_full_path: Option<bool>,
pub search_submodules: Option<bool>,
pub recursive_submodules: Option<bool>,
pub switch_filter_unknown: Option<bool>,
pub session_sort_order: Option<SessionSortOrderConfig>,
pub excluded_dirs: Option<Vec<String>>,
pub search_paths: Option<Vec<String>>, // old format, deprecated
pub search_dirs: Option<Vec<SearchDirectory>>,
pub sessions: Option<Vec<Session>>,
pub picker_colors: Option<PickerColorConfig>,
pub shortcuts: Option<Keymap>,
pub bookmarks: Option<Vec<String>>,
pub session_configs: Option<HashMap<String, SessionConfig>>,
pub marks: Option<HashMap<String, String>>,
pub clone_repo_switch: Option<CloneRepoSwitchConfig>,
}

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

No branches or pull requests

4 participants