Fish Shell

Sunday, June 20, 2021

0. 结论

放弃了, fish 另起一套的命令导致在远程服务器上无法直接套用

1. 为啥用fish

感受一下 friendly interactive shell 有多friendly (其实是zsh用太久了, 想尝鲜, hhh

2. 安装步骤

  1. 安装fish

    brew install fish
    
  2. 修改为默认shell (参见官方文档

    1. Add the shell to /etc/shells with:
    echo /usr/local/bin/fish | sudo tee -a /etc/shells
    
    1. Change your default shell with:
    chsh -s /usr/local/bin/fish
    
    1. 重新打开shell
  3. 安装fisher

    curl -sL https://git.io/fisher | source && fisher install jorgebucaran/fisher
    
  4. 安装z-jump

    fisher install jethrokuan/z
    
  5. 安装 oh-my-fish a. [墙… ]

    curl -L https://get.oh-my.fish | fish
    

    b. [wroked]

    git clone https://github.com/oh-my-fish/oh-my-fish
    cd oh-my-fish
    bin/install --offline
    
  6. 安装皮肤 ays

    omf install ays
    

3. 进行一些常用的调整

  1. 添加自定义配置文件

    touch ~/.config/fish/config.fish
    
  2. 更换命令补全快捷键为 ctrl - j

    # ~/.config/fish/config.fish
    bind \cj accept-autosuggestion
    
  3. 添加刷新fish配置命令,通过sfish (source fish) 来刷新新增配置

    # ~/.config/fish/functions/sfish.fish
    function sfish
    source /Users/nsity/.config/fish/config.fish
    end
    
  4. 集成fd,bat

    todo

4. 体验

  1. 补全提示很美
  2. 速度好像的确比zsh快一些(不知道是不是错觉