sh ubuntu 16.04的脚本,自动安装zsh,oh-my-zsh,tmux和powerline,以及配置powerline

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sh ubuntu 16.04的脚本,自动安装zsh,oh-my-zsh,tmux和powerline,以及配置powerline相关的知识,希望对你有一定的参考价值。

echo "--- start update ---"
sudo apt-get update
echo "--- end update ---"

echo "--- apt install zsh tmux python-pip ---"
sudo apt-get install zsh tmux python-pip
echo "--- end apt install ---"

echo "--- install oh-my-zsh ---"
sh -c "$(wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"
echo "--- end install ---"

echo "--- install powerline ---"
su -c 'pip install git+git://github.com/Lokaltog/powerline'
echo "--- end install ---"

echo "--- install powerline font ---"
wget https://github.com/Lokaltog/powerline/raw/develop/font/PowerlineSymbols.otf https://github.com/Lokaltog/powerline/raw/develop/font/10-powerline-symbols.conf
sudo mv PowerlineSymbols.otf /usr/share/fonts/
sudo fc-cache -vf
sudo mv 10-powerline-symbols.conf /etc/fonts/conf.d/
echo "--- end install powerline font ---"

echo "--- append text to vimrc ---"
sudo touch /etc/vim/vimrc
sudo cat <<EOT>> /etc/vim/vimrc
" for powerline
set rtp+=/usr/local/lib/python2.7/dist-packages/powerline/bindings/vim/

" Always show statusline
set laststatus=2

" Use 256 colours (Use this setting only if your terminal supports 256 colours)
set t_Co=256"
EOT
echo "--- finished ---"

echo "--- append text to zshrc ---"
sudo touch /etc/zsh/zshrc
sudo cat <<EOT>> /etc/zsh/zshrc
# for powerline
if [[ -r /usr/local/lib/python2.7/dist-packages/powerline/bindings/zsh/powerline.zsh ]]; then
    source /usr/local/lib/python2.7/dist-packages/powerline/bindings/zsh/powerline.zsh
fi
export TERM=xterm-256color
EOT
echo "--- finished ---"

echo "--- append text to .tmux.conf ---"
sudo touch ~/.tmux.conf
sudo cat <<EOT>> ~/.tmux.conf
source /usr/local/lib/python2.7/dist-packages/powerline/bindings/tmux/powerline.conf
set-option -g default-terminal "screen-256color"
set-option -g default-shell /bin/zsh
EOT
echo "--- finished ---"

以上是关于sh ubuntu 16.04的脚本,自动安装zsh,oh-my-zsh,tmux和powerline,以及配置powerline的主要内容,如果未能解决你的问题,请参考以下文章

sh Ubuntu 16.04的Mailcatcher安装脚本(14.04命令已注释掉)

sh Unifi Controller一键式安装脚本,适用于Ubuntu 16.04,带有Lets Encrypt

Ubuntu 16.04 163网易源设置(自动化配置脚本)

Ubuntu16.04~16.10(php7.0)网站环境一键搭建脚本

sh 在Linux下永久设置环境变量的脚本(Ubuntu 16.04及更高版本)。以sudo身份运行。

sh 安装Ubuntu 16.04 LAMP