diff options
| author | Ellie Huxtable <ellie@elliehuxtable.com> | 2024-02-15 19:07:08 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-02-15 19:07:08 +0000 |
| commit | 20f329646894e11e47e7e516b076fa23976c0d5a (patch) | |
| tree | fc0add6e23c4a4a8fd4ae85520aafc5576848590 /atuin-config/src/shell/xonsh.rs | |
| parent | feat: add 'ignored_commands' option to stats (#1722) (diff) | |
| download | atuin-20f329646894e11e47e7e516b076fa23976c0d5a.zip | |
feat: support syncing aliases (#1721)
* feat: support syncing aliases
This is definitely not yet finished, but works for zsh right now.
TODO:
1. Support other shells
2. Cache the alias generation, so we don't have to do a bunch of work at
shell init time
* correct imports
* fix clippy errors
* fix tests
* add the other shells
* support xonsh
* add delete
* update rust, then make clippy happy once more
* omfg fmt too
Diffstat (limited to 'atuin-config/src/shell/xonsh.rs')
| -rw-r--r-- | atuin-config/src/shell/xonsh.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/atuin-config/src/shell/xonsh.rs b/atuin-config/src/shell/xonsh.rs new file mode 100644 index 00000000..8b61ff4c --- /dev/null +++ b/atuin-config/src/shell/xonsh.rs @@ -0,0 +1,12 @@ +use super::Alias; + +// Configuration for xonsh +pub fn build(aliases: &[Alias]) -> String { + let mut config = String::new(); + + for alias in aliases { + config.push_str(&format!("aliases['{}'] ='{}'\n", alias.name, alias.value)); + } + + config +} |
