2

After installing Oh My Zsh framework on my macOS to manage my Zsh configurations, I found that the original contents of the .zshrc file have been completely replaced with the Oh-My-Zsh configurations. There were many aliases and environment variables in the old file that I was using.

Is there a way to get those old configurations back to work with the new Oh-My-Zsh configurations?

Amr
  • 4,809
  • 6
  • 46
  • 60
  • Stack Overflow is only for questions explicitly about the practice of software development and tools exclusively for that use. Tools useful to developers and non-developers alike are a better topic for [unix.se]. – Charles Duffy Apr 12 '23 at 22:36

2 Answers2

4

When installing Oh-My-Zsh framework, it moves all contents of the existing .zshrc file into a file it creates called ~/.zshrc.pre-oh-my-zsh.

To get the contents of the .zshrc file back, open both files in the editor you prefer and copy your old configurations from ~/.zshrc.pre-oh-my-zsh file and place it in ~/.zshrc file.

To run any command, open a new terminal window so the changes take effect.

If you are using VSCode, you can use it to open both files like this:

code ~/.zshrc.pre-oh-my-zsh

code ~/.zshrc
Amr
  • 4,809
  • 6
  • 46
  • 60
1

simple command to add contents from your previous .zshrc file

cat ~/.zshrc.pre-oh-my-zsh >> ~/.zshrc && source ~/.zshrc
urvianoob
  • 93
  • 1
  • 7