home archives github knives links
tags linux powerline zsh vim git pip
categories
only title title and content
Linux从0开始配置
2019-01-20

安装的软件

code

sudo apt install git -y
git config --global user.email "2104934038@qq.com"
git config --global credential.helper store
mkdir ~/darkin_blade && cd ~/darkin_blade
git clone https://github.com/Linux-setting/my_rc
rm -f ~/.vimrc && ln ~/darkin_blade/my_rc/vimrc ~/.vimrc
git clone https://github.com/Linux-setting/vim
mv vim ~/.vim
git clone https://github.com/Linux-setting/powerline.git
mv powerline ~/.config

sudo apt install vim-gtk3 -y
sudo apt install zsh -y
sudo apt install python3-pip -y
python3 -m pip install powerline-status
sudo apt install powerline-gitstatus -y
mkdir ~/trash && cd ~/trash
git clone https://github.com/powerline/fonts.git
cd fonts
./install.sh

cd ~/trash
sh -c "$(wget https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"
rm -f ~/.zshrc && ln ~/darkin_blade/my_rc/zshrc ~/.zshrc
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git
mv zsh-syntax-highlighting ~/.config

wget -qO - https://download.sublimetext.com/sublimehq-pub.gpg | sudo apt-key add -
sudo apt install apt-transport-https
echo "deb https://download.sublimetext.com/ apt/stable/" | sudo tee /etc/apt/sources.list.d/sublime-text.list
sudo apt update
sudo apt install sublime-text -y

sudo apt install axel -y
sudo apt install chromium-browser -y
sudo apt install exo-utils -y
sudo apt install exfat-utils -y
sudo apt install pcmanfm -y
sudo apt remove nautilus -y
sudo apt install gnome-tweaks -y
sudo apt install gparted baobab -y
sudo apt install net-tools -y
sudo apt install locate apt-file aptitude -y
sudo apt install fcitx-mozc -y
sudo apt install byzanz -y

# ubuntu 20 安装搜狗
wget -qO - 'https://keyserver.ubuntu.com/pks/lookup?&op=get&search=0x73BC8FBCF5DE40C6ADFCFFFA9C949F2093F565FF' | sudo apt-key add -
sudo apt-add-repository 'deb http://archive.ubuntukylin.com/ukui focal main'
sudo apt update
sudo apt install sogouimebs

sudo apt install npm -y
sudo npm install -g hexo
cd ~/darkin_blade
git clone https://github.com/darkin-blade/ejs_2

cd ~ && mkdir blog && cd blog
hexo init
git init && git remote add origin https://github.com/niabie/hexo_source
git fetch && git reset --hard origin/master
npm cache clean --force
sudo npm install
cd themes && ln -s ~/darkin_blade/ejs_2 ./ejs_2

cd ~ && mkdir aaaatrox && cd aaaatrox
hexo init
git init && git remote add origin https://github.com/aaaatrox/hexo_source
git fetch && git reset --hard origin/master
npm cache clean --force
sudo npm install
cd themes && ln -s ~/darkin_blade/ejs_2 ./ejs_2

sudo apt install ntpdate
sudo ntpdate time.windows.com
sudo hwclock --localtime --systohc

重要步骤

git

  1. 全局设置
git config --global user.name "Lynx" # your student ID and name
git config --global user.email "1197225628@qq.com" # your email
git config --global core.editor vim # your favorite editor
git config --global color.ui true

powerline

  1. python安装pip

菜鸟教程

curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
sudo python get-pip.py
# or
sudo apt-get install python3-pip
  1. pip安装powerline

详细

pip install powerline-status
pip3 install powerline-status
  1. pip安装powerline-gitstatus

github

sudo apt install powerline-gitstatus
# or
pip install powerline-gitstatus
pip3 install powerline-gitstatus
  1. 复制配置文件

    git clone https://github.com/Linux-setting/powerline.git
    mv powerline .config/
  2. 安装powerline字体

详细

git clone https://github.com/powerline/fonts.git
cd fonts
./install.sh
  1. 修改终端字体设置

  2. 找不到powerline-config

    1. mkdir $HOME/.local/lib/python3.6/site-packages/scripts/ if not exists
    2. Find where powerline-config locates. For example $HOME/.local/bin/powerline-config
    3. cp $HOME/.local/bin/powerline* $HOME/.local/lib/python3.6/site-packages/scripts/.
# export PATH=$PATH:$HOME/.local/bin/
# export PATH={path-to-powerline-config}:$PATH

vim

  1. install vim with clipboard
sudo apt install vim-gtk3
  1. 转移.vimrc,修改powerline相对路径

安装支持python的vim(查看vim --version),详细:

brew install vim --with-python
sudo apt install vim-gnome

如果需要使用系统剪切板功能,必须安装vim-gnome

  1. 复制插件(branch clean)
    git clone https://github.com/Linux-setting/vim.git
    mv vim .vim
  1. 修改rtp

zsh

  1. 安装zsh

  2. wget安装oh-my-zsh

    sh -c "$(wget https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)" 
  3. 转移.zshrc,修改powerline相对路径

  4. 安装zsh-syntax-highlighting

    详细

    • macOS
    brew install zsh-syntax-highlighting

    然后将source /usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh加到.zshrc

    • oh-my-zsh
     git clone https://github.com/zsh-users/zsh-syntax-highlighting.git
    mv zsh-syntax-highlighting ~/.config/zsh-syntax-highlighting

    然后将source $HOME/zsh-syntax-highlighting/zsh-syntax-highlighting.git加到.zshrc

  5. 设置zsh为默认shell

chsh -s /bin/zsh