zsh-users / zsh-autosuggestions

Fish-like autosuggestions for zsh
MIT License
30.33k stars 1.85k forks source link

Can you please describe how to import/export auto completion data #710

Closed gokceng closed 1 year ago

gokceng commented 1 year ago

Is your feature request related to a problem? Please describe.

My laptop had to be wiped and even though I backed up .zshrc & .zsh_history files, I couldn't figure out how I can make zsh-autosuggestions recognise the history. I've checked some commands in .zsh_history are not suggested when I use terminal.

Describe the solution you'd like

If you can describe how to backup / import auto suggestion data, that'd be great.

Describe alternatives you've considered

I'd be fine with any alternative as long as I can make zsh-autosuggestions process entries in .zsh_history

Additional context

ivan commented 1 year ago

zsh-autosuggestions uses the zsh history (well, except for the non-default 'Completion Suggestion Strategy'). There's no extra data.

https://github.com/zsh-users/zsh-autosuggestions/tree/master/src/strategies

ivan commented 1 year ago

Note that zsh doesn't set HISTFILE to anything by default, so zsh might just not be loading your history.

gmahe commented 9 months ago

Got HISTFILE set to ~/.zsh_custom_history and if I run the command history I get all those imported data + the new ones. Though I still won't get suggestions of the history I have imported on this machine, I only get the suggestion of the commands I have run on this new machine. Any solution?

dekadentno commented 8 months ago

I also didn't manage to restore autosuggestions on my other VM. Can anyone please write ELI5 steps to achieve this?

I'm open to develop a tool/script that will automate this if I find out how to backup/restore it.