shell 生产力环境恢复

2020/07/30

最近因为在安装一个 gdb 的浏览器版本时将 ubuntu16.04 本机的 Python2 环境给修改了,然后第二天早上打开我的电脑,发现启动不了,将修改的软链接给还原回来,还是不行…

借着这个"机会",我将 windows10 又重新装入我的电脑了,因为最近刚入手一个西部数据 1T 移动硬盘,买回来之后发现识别不了,它支持的平台只有 windows 和 mac,看了希捷移动硬盘介绍,也是这样。

中间省略装系统步骤…这次安装的 ubuntu 版本还是 16.04,为什么呢?因为我之前也安装了 ubuntu20.04,安装好发现 vmware 在这个版本上少了一些库,但是我有好多个虚拟机需要使用,所以最后我又换回了稳定的 ubuntu16.04。

下面是我恢复 shell 中包括 vim、tmux、zsh 等等的生产力步骤。

快捷键映射:cpas -> ctrl

安装 gnome-tweak-tool

sudo apt install gnome-tweak-tool

tmux tpm 插件管理器

tpm 的 github 仓库

git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm

安装 tmux 插件命令:prefix + I,默认prefix<ctrl>b

zsh install

sudo apt install zsh

zplug

zplug 的 github 仓库

git clone https://github.com/zplug/zplug .zplug

oh-my-zsh

oh-my-zsh 的 github 仓库

git clone https://github.com/ohmyzsh/ohmyzsh.git ~/.oh-my-zsh

oh-my-zsh 的一个插件

zsh-autosuggestions 的 github 仓库

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

zsh 命令行去掉 git 信息

一些 zsh 的 theme 的命令行中有太多信息,这会干扰自己,并且会大大增加加载时间,我将 git 信息给移除出去。

在自己的~/.zshrc找到themes关键字,然后到~/.ohmyzsh/themes下找到自己的 themes,打开,修改其中的信息,这里是直接将 git 信息删去了。

coc.nvi 环境依赖 nodejs

1. Install nodejs >= 10.12

curl -sL install-node.now.sh/lts | bash

2. yarn

按照以下步骤在 Ubuntu 16.04/18.04 系统上安装 Yarn:

步骤 1.添加 GPG 密钥

curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -

步骤 2.添加 Yarn 存储库

echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list

步骤 3.更新包列表并安装 Yarn

sudoaptTupdate+08:'00'
sudo apt install yarn

command-t 一款 vim 文件搜索插件

command-t 的 github 仓库

注:我所使用的 vim 插件管理器是vim-plug。在 vim 中执行:PlugInstall安装好command-t后,这个是时候 command-t 还是不能使用的,还需要安装一些依赖。

sudo apt install aptitude
sudo aptitude install ruby-dev

到 vim 安装的插件目录下~/.vim/plugged/command-t,如果你用插件管理器是 bundle 的话,目录则是~/.vim/bundle/command-t

cd ~/.vim/plugged/command-t
rake make

之后即可使用 command-t 进行文件搜索。