Automatic installation and initialization of Oh-my-zsh & AutoJump zsh in bash environment

Source: Internet
Author: User

The default shell for Linux and Mac systems is bash, but the really powerful shell belongs to zsh, and full monitoring of Bash is the ultimate killer in the shell, with a lot of features that bash doesn't have, but the initial configuration of zsh is too cumbersome, the prevalence is not high, Until a guy named Robby Russell developed the OH-MY-ZSH project on GitHub, making it easier for everyone to use zsh.


Because the company's computer is windows, the next Cygwin, and installed zsh, so it is easy to maintain a lot of maintenance, and I put the AutoJump project is also integrated, and finally wrote an automatic installation of the script, can automatically install Oh-my-zsh from the current bash environment, AutoJump and initializes the zsh. Currently only supports Ubuntu, Centos, Debian.


I collect this set of ZSH profile supported plugins online (git autojump history history-substring-search systemadmin systemd), the specific use of the program can see the plug-in source code ~. oh-my-zsh/plugins/.


For autojump use, see the official documentation for AutoJump. Https://github.com/wting/autojump

History-substring-search Search History Bright is very powerful, powerful to make your tongue.

Systemadmin integrates many of the commands commonly used by SA.

Systemd for Centos7 after the Systemctl to streamline the more intelligent.


#!/bin/bash#author:shanker#set -x#set -uclearhackerecho  "" echo  "########################## ################################### "echo " # automatically to  install oh-my-zsh  and initialize it     # "echo " # intro: https:// github.com/sangrealest/shanker             # " echo  "# author: shanker<[email protected]>                          # " echo  "#############################################################" echo  "#if  [  ' id  -U '  -ne 0 ] #then #    echo  "Need root to run is,  try with sudo "#    exit 1#fifunction checkos () {     if [ -f /etc/redhat-release ]    then         os= "CentOS"     elif [ ! -z  "' cat /etc/issue |  Grep -i bian ' " ]    then        os= "Debian"     elif [ ! -z  "' cat /etc/issue | grep -i  ubuntu ' " ]    then        os=" Ubuntu "     else        echo  "not supported  os "        exit 1    fi}function  Installsoftware () {if [  "$OS"  ==  ' CentOS '  ]then    sudo yum  -y install zsh gitelse    sudo apt-get -y install  zsh gitfizshpath= "' WHICh zsh ' "}function downloadfile () {    cd ~    git  clone https://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh    git  clone https://github.com/joelthelion/autojump.git    git clone https:// Github.com/sangrealest/initzsh}function installautojump () {    cd ~/autojump     ./install.pycat >>~/.zshrc<<eof[[ -s ~/.autojump/etc/ Profile.d/autojump.sh ]] && source ~/.autojump/etc/profile.d/autojump.shautoload  -u compinit && compinit -ueof}function configzsh () {     if [ -f  ". Zsh_history"  ]    then         mv .zsh_history{.,backup}    fi    sudo  chsh -s  "$zshPath"  &nbSp;  cp ~/initzsh/zshrc ~/.zshrc}function main () { Checkosinstallsoftwaredownloadfileconfigzshinstallautojump}main

If Cygwin is using zsh, just add a line of/bin/zsh to your. BASHRC.

Effect

650) this.width=650; "src=" http://s2.51cto.com/wyfs02/M02/7A/02/wKioL1agmdPjt2SQAAItSTI7evY597.jpg "title=" 11.jpg "alt=" Wkiol1agmdpjt2sqaaitsti7evy597.jpg "/>

This article is from "Tianya Horizon" blog, please be sure to keep this source http://shanker.blog.51cto.com/1189689/1737213

Automatic installation and initialization of Oh-my-zsh & AutoJump zsh in bash environment

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.