Skip to content

feat: support syncing aliases#1721

Merged
ellie merged 9 commits intomainfrom
ellie/atuin-config
Feb 15, 2024
Merged

feat: support syncing aliases#1721
ellie merged 9 commits intomainfrom
ellie/atuin-config

Conversation

@ellie
Copy link
Copy Markdown
Member

@ellie ellie commented Feb 14, 2024

atuin config alias set k kubectl

to set an alias. in this example, alias k -> kubectl

atuin config alias delete k

to delete an alias, in this example deleting the one we just set.

Aliases will be copied across shells, and across machines. All that's needed is a shell reload (in the future maybe let's remove that too)

Checks

  • I am happy for maintainers to push small adjustments to this PR, to speed up the review cycle
  • I have checked that there are no existing pull requests for the same thing

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
@ellie ellie force-pushed the ellie/atuin-config branch from 158d1a8 to d2dbc72 Compare February 14, 2024 17:11
@ellie
Copy link
Copy Markdown
Member Author

ellie commented Feb 15, 2024

Some timing - building the entire alias list from scratch took 14ms on my machine, with a few aliases set. Optimisation will still be a good thing (we're doing too much work, really), but not as critical as I thought

@ellie
Copy link
Copy Markdown
Member Author

ellie commented Feb 15, 2024

This doesn't support Nu right now, but Nu cannot directly eval output. Currently Atuin writes init to a file and nu sources that.

I'd like to make all the shells do that automatically, and update the file when required. Or at least something like it. Leave out Nu support for now

@ellie
Copy link
Copy Markdown
Member Author

ellie commented Feb 15, 2024

Pretty cool that I can just

atuin config alias set k kubectl

and then k is kubectl on every machine and every shell for me ✨

@ellie ellie marked this pull request as ready for review February 15, 2024 16:11
@ellie ellie merged commit 20f3296 into main Feb 15, 2024
@ellie ellie deleted the ellie/atuin-config branch February 15, 2024 19:07
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

Successfully merging this pull request may close these issues.

1 participant