Shell Environment Upgrade and Cleanup: Part 2 - Migrating from oh-my-zsh to Prezto

| Comments

My migration from oh-my-zsh to Prezto actually began quite some time ago, and I accidentally made things much more complicated than they needed to be. I was completely switched over while Prezto was still a fork of the oh-my-zsh github repository. At some point in time, Prezto was moved to its own repository.

I happened to not be paying attention at the time, and my local copy of Prezto got way out of sync. Merging was going to be quite a headache. This seemed to be the perfect time to start fresh and only move what I actually needed from the old repository to the new.

Migrating oh-my-zsh’s custom directory to Prezto

I currently have 16 scripts that were in my ~/.oh-my-zsh/custom directory. They’re mostly bite-sized, ranging in size from a single line up to a few dozen. I took the lazy way out here and created a Prezto module called custom.

Useless little screenshot of Prezto for zsh

I moved all my scripts from ~/.oh-my-zsh/custom/ to ~/.zprezto/modules/custom/scripts and created an init.zsh to loop through and sort them all.

init.zsh:

for file in /home/wonko/.zprezto/modules/wonko/scripts/*.zsh; do
  source $file
done

It is pretty simple but it is getting the job done.

Next step: Persistence of config files

I already wrote a small persistence module that I’m using but it is only just barely half-baked at this point. I have a basic persist command to automatically store files in a git repository and I have a forget command to restore them to their previous state.

They work, but their error handling still needs work. I’d hate to release this and have someone lose a file because of a stupid bug.

It also still needs a higher-level command to globally restore all the persisted data on a new system. A command to revert all persisted files back to normal files wouldn’t hurt, either.

I haven’t been working on this part at all. I got too distracted working on zsh-dwim. zsh-dwim is quite a bit more interesting and, for right now, I’m much more excited about it!

Comments