随笔
主页
  • Unity
  • 前端文章

    • JavaScript
    • Vue
  • 学习笔记

    • 《JavaScript教程》笔记
    • 《JavaScript高级程序设计》笔记
    • 《ES6 教程》笔记
  • 数据库

    • Redis
  • Html 文档
  • CSS 文档
  • Vue 文档
  • TypeScript
  • Golang
  • 版本控制

    • Git 文档
    • Svn 文档
  • 技术文档

    • Markdown语法
    • GitHub技巧
    • Nodejs
  • 分类
  • 标签
  • 时间线
  • 目录结构
  • 配置和约定
  • 主题配置
  • 首页配置
  • front matter
  • 目录页配置
  • 摘要
  • 主题颜色
  • 评论栏
  • Markdown扩展
GitHub
主页
  • Unity
  • 前端文章

    • JavaScript
    • Vue
  • 学习笔记

    • 《JavaScript教程》笔记
    • 《JavaScript高级程序设计》笔记
    • 《ES6 教程》笔记
  • 数据库

    • Redis
  • Html 文档
  • CSS 文档
  • Vue 文档
  • TypeScript
  • Golang
  • 版本控制

    • Git 文档
    • Svn 文档
  • 技术文档

    • Markdown语法
    • GitHub技巧
    • Nodejs
  • 分类
  • 标签
  • 时间线
  • 目录结构
  • 配置和约定
  • 主题配置
  • 首页配置
  • front matter
  • 目录页配置
  • 摘要
  • 主题颜色
  • 评论栏
  • Markdown扩展
GitHub
  • 命令大全

  • 软件安装

    • 数据库

    • 终端

      • fish
        • Centos7
          • 添加下载链接
          • 安装
        • Ubuntu-18
          • 更新最新源
          • 安装
          • autojump安装
          • 修改启动文件配置
      • tcl
    • 软件

    • 网络

  • 网络设置

  • Linux
  • 软件安装
  • 终端
dong
2021-02-13

fish

# fish

  • 启动
fish
1
  • 退出
bash
1

# Centos7

# 添加下载链接

yum-config-manager --add-repo https://download.opensuse.org/repositories/shells:fish:release:2/CentOS_7/shells:fish:release:2.repo
1

# 安装

yum install fish
1

# Ubuntu-18

# 更新最新源

sudo apt-add-repository ppa:fish-shell/release-3
sudo apt update
1
2

# 安装

sudo apt install fish
1

# autojump安装

git clone https://github.com/wting/autojump.git
cd autojump
./install.py
1
2
3

# 修改启动文件配置

vim ~/.config/fish/config.fish
1

修改:

# 终端显示样式的配置
function fish_prompt --description 'Write out the prompt'
    if not set -q __fish_prompt_normal
        set -g __fish_prompt_normal (set_color normal)
    end

    __fish_git_prompt >/dev/null 2>&1

    if git_is_repo
        if not set -q __git_cb
            set __git_cb (set_color blue)" ("(set_color brred)(git branch | grep \* | sed 's/* //') (set_color -o bryellow)(__fish_git_prompt_informative_status)(set_color blue)")"
        end
    end


    if not set -q __fish_prompt_cwd
        set -g __fish_prompt_cwd (set_color $fish_color_cwd)
    end

    set_color 00ccff 
    date "+%m/%d %H:%M:%S"
    set_color purple
    printf '%s%s %s%s%s%s ' "$USER" "$__fish_prompt_cwd" (prompt_pwd) "$__fish_prompt_normal" $__git_cb
end



# 判断是否是git仓库的工具函数
function git_is_repo --description 'Check if directory is a repository'
  test -d .git
  or command git rev-parse --git-dir >/dev/null ^/dev/null
end

# 配置autojump
begin
    set --local AUTOJUMP_PATH $HOME/.autojump/share/autojump/autojump.fish
    if test -e $AUTOJUMP_PATH
        source $AUTOJUMP_PATH
    end
end
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#linux#软件安装
redis
tcl

← redis tcl→

Theme by Vdoing | Copyright © 2021-2023 Evan Dong MIT License | 粤ICP备2021052092号
  • 跟随系统
  • 浅色模式
  • 深色模式
  • 阅读模式
×