Fish Shell用法

Le Mon 24 February 2025

Fish靓点:

  • 可观无用命令。输错的命令或不存在的命令,会显示为红色。及时反馈。
  • 识路途。好的路途带有下划线。
  • 自动现身。输入命令时,自动现身功能会出现在光标右侧,展示为灰色影子。
  • 自动现身,识路途、知选择。每种命令都有繁多的可选项,她会知道。

配置文件位于:~/.config/fish/fish.config

设置PATH变量:

set PATH "/usr/local/bin" $PATH

将 /usr/local/bin 置于 $PATH 之前。

设置首选EDITOR:

set -g -x EDITOR vim

显示仓库当前分支名称:

function git_prompt
    if git root >/dev/null 2>&1
        set_color normal
        printf ' on '
        set_color magenta
        printf '%s' (git currentbranch ^/dev/null)
        set_color normal
    end
end

function hg_prompt
    if hg root >/dev/null 2>&1
        set_color normal
        printf ' on '
        set_color magenta
        printf '%s' (hg branch ^/dev/null)
        set_color normal
    end
end

function fish_prompt
    set_color $fish_color_cwd
    printf '%s' (prompt_pwd)
    set_color normal

    git_prompt
    hg_prompt

    echo ' >: '
end

Par 纳兰风来, Catégorie : tools

Tags :

Autres articles

转Git仓库为Mercurial Hg仓库

Le Mon 24 February 2025

Mercurial软件包中已经包含了转换所需的工具。不仅可用将git仓库转换为hg仓库,还可以将 CVS, Subversion, Git, Darcs, Monotone, Bazaar, GNU Arch, Mercurial,Perforce仓库转换为hg仓库。

首先修改.hgrc文件,这个文件通常位于home目录。

[extensions]
hgext.convert=

之后施行转换。

hg convert …

Par 纳兰风来, Catégorie : tools

Lire la suite …

gwhois包在Ubuntu系统中的安装及使用

Le Mon 17 February 2025

apt update
apt install gwhois -y

用法:

gwhois DOMAIN
# gwhois devgirl.xyz
Process query: 'devgirl.xyz'


No lookup service available for your query 'devgirl.xyz'.
gwhois remarks: If this is a valid domainname or handle, please file a bug report.




-- 
  To resolve one of the above handles:   OTOH offical …

Par 纳兰风来, Catégorie : tools

Lire la suite …

whois包在Ubuntu系统中的安装及使用

Le Mon 17 February 2025

apt update
apt install whois

用法:

whois DOMAIN
# whois devgirl.xyz
Domain Name: DEVGIRL.XYZ
Registry Domain ID: D461698014-CNIC
Registrar WHOIS Server: whois.dnspod.com
Registrar URL: http://www.dnspod.cn
Updated Date: 2024-06-22T14:03:50.0Z
Creation Date: 2024-06-08T02:03:56.0Z
Registry Expiry Date: 2025 …

Par 纳兰风来, Catégorie : tools

Lire la suite …

diff文件比较工具体验

Le Mon 17 February 2025

diff是文件比较工具,可以逐行比较两个纯文本文件。

diff的输出有三种形式:

  • normal 默认输出方式
  • context 会输出修改过部分的前后文,默认是前后3行。
  • unified 合并模式,把上下文 …

Par 纳兰风来, Catégorie : tools

Lire la suite …