fedora zsh配置

zsh很适合当作日常使用的shell,如下是在Fedora上进行安装,配置

安装

sudo dnf install zsh

更改默认shell
chsh -s /bin/zsh

安装oh-my-zsh

官网:http://ohmyz.sh/。 安装方式任选一个即可。

Method Command
curl sh -c "$(curl -fsSL https://install.ohmyz.sh/)"
wget sh -c "$(wget -O- https://install.ohmyz.sh/)"
fetch sh -c "$(fetch -o - https://install.ohmyz.sh/)"
国内curl镜像 sh -c "$(curl -fsSL https://gitee.com/pocmon/ohmyzsh/raw/master/tools/install.sh)"
国内wget镜像 sh -c "$(wget -O- https://gitee.com/pocmon/ohmyzsh/raw/master/tools/install.sh)"

主题与插件

可以使用内置ys主题,内置主题有主题展示

或使用主题haoomz,安装命令为

bash 复制代码
wget -O $ZSH_CUSTOM/themes/haoomz.zsh-theme https://cdn.haoyep.com/gh/leegical/Blog_img/zsh/haoomz.zsh-theme

记得编辑 ~/.zshrc 文件,将 ZSH_THEME 设为 haoomz

zsh-autosuggestions

zsh-autosuggestions 是一个命令提示插件,当你输入命令时,会自动推测你可能需要输入的命令

安装方式:把插件下载到本地的 ~/.oh-my-zsh/custom/plugins 目录

命令

bash 复制代码
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions

zsh-syntax-highlighting

zsh-syntax-highlighting 是一个命令语法校验插件,在输入命令的过程中,若指令不合法,则指令显示为红色,若指令合法就会显示为绿色

bash 复制代码
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting

z和extract

oh-my-zsh 内置了 z 插件。z 是一个文件夹快捷跳转插件,对于曾经跳转过的目录,只需要输入最终目标文件夹名称,就可以快速跳转,避免再输入长串路径,提高切换文件夹的效率

oh-my-zsh 内置了 extract 插件。extract 用于解压任何压缩文件,不必根据压缩文件的后缀名来记忆压缩软件。使用 x 命令即可解压文件。

启用插件

修改~/.zshrc中插件列表为:

bash 复制代码
plugins=(git zsh-autosuggestions zsh-syntax-highlighting z extract)

shell配置代理

记录一下代理配置函数

bash 复制代码
#!/bin/bash
PROXY_PORT=7897

proxy(){
echo -e "开启系统代理...\n"
export http_proxy=http://127.0.0.1:$PROXY_PORT
export https_proxy=http://127.0.0.1:$PROXY_PORT
export all_proxy=socks5://127.0.0.1:$PROXY_PORT
}

和取消函数

bash 复制代码
unproxy(){
    echo -e "关闭系统代理...\n"
    unset http_proxy
    unset https_proxy
    unset all_proxy
}
相关推荐
Nick.Q17 小时前
vim插件的管理与离线安装
linux·编辑器·vim
头发还没掉光光19 小时前
HTTP协议从基础到实战全解析
linux·服务器·网络·c++·网络协议·http
小白同学_C19 小时前
Lab2-system calls && MIT6.1810操作系统工程【持续更新】
linux·c/c++·操作系统os
物理与数学19 小时前
linux内核 struct super_block
linux·linux内核
Getgit19 小时前
Linux 下查看 DNS 配置信息的常用命令详解
linux·运维·服务器·面试·maven
zhangrelay20 小时前
Linux(ubuntu)如何锁定cpu频率工作在最低能耗模式下
linux·笔记·学习
_OP_CHEN21 小时前
【Linux系统编程】(二十)揭秘 Linux 文件描述符:从底层原理到实战应用,一篇吃透 fd 本质!
linux·后端·操作系统·c/c++·重定向·文件描述符·linux文件
chem411121 小时前
玩客云 边缘AI模型 本地搭建部署 llama.cpp qwen
linux·人工智能·llama
一个平凡而乐于分享的小比特21 小时前
Linux内核中的BogoMIPS详解
linux·bogomips
橘颂TA21 小时前
【Linux 网络】TCP 拥塞控制与异常处理:从原理到实践的深度剖析
linux·运维·网络·tcp/ip·算法·职场和发展·结构与算法