Files
dotfiles/dot_config/fish/config.fish

44 lines
1.4 KiB
Fish
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
if status is-interactive
# ========= 命令缩写(仅当目标命令存在)=========
# ls优先 eza其次 exa
if type -q eza
abbr ls eza
abbr ll eza -l
abbr la eza -a
else if type -q exa
abbr ls exa
abbr ll exa -l
abbr la exa -a
end
type -q bat; and abbr cat bat
type -q bat; and abbr cap bat -p
type -q fd; and abbr find fd
type -q rg; and abbr grep rg
type -q btop; and abbr top btop
type -q tldr; and abbr help tldr
type -q chezmoi; and abbr cz chezmoi
# ========= thefuck自动命令纠错 =========
type -q thefuck; and thefuck --alias | source
# ========= zoxide智能目录跳转 =========
# 使用 --cmd=cd让 cd 也具备 zoxide 的跳转能力(交互式对应 cdi
type -q zoxide; and zoxide init --cmd=cd fish | source
# ========= 编辑器/查看器(优先 vim否则 vi=========
# SUDO_EDITOR供 visudo / sudoedit 等使用;若仍打开 nano需在 sudoers 中加 Defaults env_keep += "SUDO_EDITOR"
if type -q vim
set -gx EDITOR vim
set -gx VISUAL vim
set -gx SUDO_EDITOR vim
else if type -q vi
set -gx EDITOR vi
set -gx VISUAL vi
set -gx SUDO_EDITOR vi
end
# ========= fastfetch启动信息显示 =========
type -q fastfetch; and fastfetch
end