Rust2015
V2EX  ›  macOS

安装完 oh-my-zsh 后:

  •  
  •   Rust2015 · Oct 17, 2024 · 4552 views
    This topic created in 751 days ago, the information mentioned may be changed or developed.

    原来的配置不见了,如 JDK 、MAVEN 和别名啥的不见了,找不到了

    21 replies  •  2024-10-19 12:22:03 +08:00
    luckyrayyy
    luckyrayyy
    Oct 17, 2024
    1
    原本你自己的配置的?是不是配置在.bashrc 里面了
    Rust2015
    Rust2015
    OP
    Oct 17, 2024
    2
    @luckyrayyy

    不是,.zshrc

    MacBook Pro ,CPU 是 M 系列
    wu67
    wu67
    Oct 17, 2024
    3
    反正我在服务器上装的时候, 会把我的初始配置覆盖掉.
    所以这玩意要么在最开始装系统之后立马装, 要么备份.zshrc 之后再装
    afkqwr
    afkqwr
    Oct 17, 2024
    4
    很坑,会覆盖掉,第一次装也遇到了
    Rust2015
    Rust2015
    OP
    Oct 17, 2024
    5
    @afkqwr

    你是怎么恢复的
    moudy
    moudy
    Oct 17, 2024
    6
    所以软件行为完美触发了 oh-my-zsh ??
    jokeface
    jokeface
    Oct 17, 2024
    7
    你看下家目录下是不是有个 .zshrc.bck 或者 .zshrc.old 之类的文件
    jokeface
    jokeface
    Oct 17, 2024
    8
    @jokeface .zshrc.pre-oh-my-zsh
    appreciatemp
    appreciatemp
    Oct 17, 2024
    9
    遇到过,搜索解决了,忘了怎么解决的了,配置环境变量还是什么,不过我也没装什么东西就是了,记得不是重新安装解决的
    appreciatemp
    appreciatemp
    Oct 17, 2024
    10
    @appreciatemp
    看了下配置文件 ,plugins 里把之前装过的东西放进去就好了
    # Add wisely, as too many plugins slow down shell startup.
    plugins=(
    git
    node
    nvm
    zsh-syntax-highlighting
    zsh-autosuggestions
    )
    appreciatemp
    appreciatemp
    Oct 17, 2024
    11
    @appreciatemp #10 jdk 我的没有覆盖,不知道是什么原因
    Kaiv2
    Kaiv2
    Oct 17, 2024
    12
    尝试配置到 ~/.zshenv 试试
    EchoWhale
    EchoWhale
    Oct 17, 2024 via iPhone
    13
    The old file is renamed to .zshrc.pre-oh-my-zsh, it is never deleted.
    pidan123456
    pidan123456
    Oct 17, 2024
    14
    是不是配置完以后没有刷新,source ~/.zshrc 试一下
    NotFounder
    NotFounder
    Oct 17, 2024
    15
    赶紧备份一下,cp .zshrc .zshrc.bak
    crushark
    crushark
    Oct 18, 2024 via iPhone
    16
    因为 omz 用的是 zsh 终端,原来的配置是写到默认终端配置里,例如 .bashrc ,你要重新在 .zshrc 里配置下
    guanhui07
    guanhui07
    Oct 18, 2024 via iPhone
    17
    我都定期备份
    .zshrc
    yangxiaopeipei
    yangxiaopeipei
    Oct 18, 2024
    18
    vim ~/.zshrc.pre-oh-my-zsh
    Leoking222
    Leoking222
    Oct 18, 2024
    19
    巧了,昨天我安装也是这样的,自己给覆盖了,但是配置依然是生效的,比如 jdk ,maven ,docker 别名,这些命令仍然可以使用。
    Rust2015
    Rust2015
    OP
    Oct 18, 2024 via iPhone
    20
    我是不管他们三七二十一,直接在.zshrc 中接着配置,然后 source ~/.zshrc 居然奏效
    afkqwr
    afkqwr
    Oct 19, 2024
    21
    @Rust2015 我的配置比较少手动配置回去了
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1091 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 48ms · UTC 17:01 · PVG 01:01 · LAX 09:01 · JFK 12:01
    ♥ Do have faith in what you're doing.