Fish Shell 使用笔记

  1. 安装Fish Shellhtml

    brew install fish
  2. 安装Oh My Fishgit

    curl -L https://get.oh-my.fish | fish
  3. 安装Fishergithub

    curl https://git.io/fisher --create-dirs -sLo   ~/.config/fish/functions/fisher.fish
  4. 配置 autojumpshell

    • clone autojumpcurl

      git clone https://github.com/wting/autojump.git
    • 安装 autojump 至本地 ~/.autojump 目录:编辑器

      cd autojump
      ./install.py
      • 在fish配置中打开文件~/.config/fish/config。在编辑器中查找并添加如下行:
      begin
          set --local AUTOJUMP_PATH $HOME/.autojump/share/autojump/autojump.fish
          if test -e $AUTOJUMP_PATH
              source $AUTOJUMP_PATH
          end
      end
    • 退出fish,从新开始。使用cd命令访问经常使用目录。你如今能够使用j命令跳转到这些目录:url

      exit
      j testDir
    • 跳转到当前目录的子目录:code

      jc chid_dir
      • 查看autojump历史记录中的条目统计信息:
      j -s
    • 使用finder打开目录htm

      jo dir
  5. 配置nvmblog

    • 使用fish以后,以前配置的nvm就不能用了,须要在~/.config/fish/config当中添加nvm的配 置

      begin
          set --local AUTOJUMP_PATH $HOME/.autojump/share/autojump/autojump.fish
          if test -e $AUTOJUMP_PATH
              source $AUTOJUMP_PATH
          end
          function nvm
              bass source ~/.nvm/nvm.sh --no-use ';' nvm $argv
          end
      end
  6. 默认shell切换至fish

    echo /usr/local/bin/fish | sudo tee -a /etc/shells
    chsh -s /usr/local/bin/fish
switch to fish
Fish shell 入门教程 使用版本:Autojump 22.5.1, Fish 3.0.0和Mac 10.14.2
相关文章
相关标签/搜索