avatar

从零开始打造自己的linux终端环境

0x00 apt进行换源

sudo cp /etc/apt/sources.list /etc/apt/sources.list_backup #做好备份
sudo vi /etc/apt/sources.list #进行编辑
#在最前面加上
# 阿里源
deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
# 然后 esc + :wq保存退出
#更新
sudo apt-get update
sudo apt-get upgrade --fix-missing
sudo apt-get install build-essential

image-20201002215634963

速度起飞

0x01 终端配置

使用Xfce4

sudo apt-get install xfce4-terminal

然后可以使用shell启动或者在启动台里看到xfce4-terminal

可以在preference中设置color和background image

安装zsh

当然你也可以使用fish等其他shell,我个人偏好zsh

sudo apt-get install zsh
chsh -s /bin/zsh #使用zsh作为默认shell
zsh # 切换到zsh 或者这一步换为重新打开xfce4

image-20201002221346029

这就是zsh的初始界面,不要急,我们慢慢来优化

以下大部分抄袭自https://zhuanlan.zhihu.com/p/37195261

0x02 安装oh-my-zsh

sudo apt-get install git # 安装git 如果有可以忽略
sh -c "$(wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)" #安装oh-my-zsh

image-20201002221630753

开始变得好看了

#新建一个临时文件夹
cd #到home下
mkdir tmp
cd tmp
#更换字体
git clone https://github.com/powerline/fonts.git --depth=1
cd fonts
./install.sh

image-20201002222431762

更换为powerline

image-20201002222525619

# 现在仍然在 ~/tmp目录下
git clone https://github.com/fcamblor/oh-my-zsh-agnoster-fcamblor.git
cd oh-my-zsh-agnoster-fcamblor/
./install

这是安装了zsh的主题,但是别急,先安装两个插件

cd ~/.oh-my-zsh/custom/plugins/
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git # 高亮插件
git clone https://github.com/zsh-users/zsh-autosuggestions # 补全插件

然后对zshrc文件进行配置,执行vi ~/.zshrc

ZSH_THEME = "agnoster"
plugins=(git cp extract sudo z zsh-syntax-highlighting zsh-autosuggestions pip)

esc + :wq保存退出source ~/.zshrc生效

0x03 配置vim

sudo apt-get install vim #如果安装了就略过
wget https://raw.githubusercontent.com/Zrzzzz/learngit/master/tmpvim -O ~/.vimrc
vim #进入vim

esc + :PluginInstall输入plu的时候按tab可以进行补全,然后等待插件安装就行了

image-20201003001936415

按下q退出即可!

到此安装结束

文章作者: X Mεl0n
文章链接: http://www.zrzz.site/2020/10/02/%E4%BB%8E%E9%9B%B6%E5%BC%80%E5%A7%8B%E6%89%93%E9%80%A0%E8%87%AA%E5%B7%B1%E7%9A%84linux%E7%BB%88%E7%AB%AF%E7%8E%AF%E5%A2%83/
版权声明: 本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 X Mεl0n | 随手记

评论