当前位置:网站首页>Compile and install oh my Zsh
Compile and install oh my Zsh
2022-07-01 01:32:00 【Hello_ wshuo】
1. Preface
oh-my-zsh Is based on zsh A set of beautification tools , It also provides many themes and plug-ins .github Introduce
2. What's the use

It is possible for me to view git Branches are more intuitive , In addition, its powerful completion function
Or more intuitively check whether the return value of the previous command is 0
Of course, this function is only the tip of the iceberg , There are also many functions to explore , It is not only a beautification tool, but also a sharp tool that can improve work efficiency !
3. How to install
Because it's on the company server, I don't have root Authority and sudo jurisdiction , So we can only adopt the method of compiling and installing .
oh-my-zsh rely on zsh, and zsh Depend on and depend on ncurses, So first compile and install ncurses.
3.1 Compilation and installation ncurses
Before compiling, you need to import some environment variables , The function of importing environment variables is to compile later zsh When you can find ncurses Link library
export CXXFLAGS="-fPIC"
export CFLAGS="-fPIC"
export NCURSES_HOME=$HOME/.local # Your own ncurses Catalog
export PATH=$NCURSES_HOME/bin:$PATH
export LD_LIBRARY_PATH=$NCURSES_HOME/lib:$LD_LIBRARY_PATH
export CPPFLAGS="-I$NCURSES_HOME/include" LDFLAGS="-L$NCURSES_HOME/lib"
You can write it to ~/.bashrc in , then source ~/.bashrc once .
Start downloading and compiling
wget http://ftp.gnu.org/pub/gnu/ncurses/ncurses-6.1.tar.gz # download ncurses
tar -xzvf ncurses-6.1.tar.gz # decompression
cd ncurses-6.1
./configure --prefix=$HOME/.local/ --with-shared --without-debug --enable-widec # Specify the path configure
make -j4 && make install
After successful compilation and installation, it will be in Home directory .local Under the folder ,bin Directory is the executable file ,lib Stored in the directory for zsh Use ncurses Link library of , There are also some header files in include Under the folder , It can be used for development , But none of this is necessary care.
3.2 Compilation and installation zsh
wget https://jaist.dl.sourceforge.net/project/zsh/zsh/5.9/zsh-5.9.tar.xz
tar -xvf xvf zsh-5.9.tar.xz
cd zsh-5.9
./configure --prefix=$HOME/.local/ # --prefix Is to specify the directory after compilation and installation , That is, after the final compilation is successful, it will be installed in $HOME/.local/bin Catalog
make -j4 && make install
because $HOME/.local/bin The directory defaults to PATH In the environment variables , So type zsh Can be called to the compiled zsh Of
Here we are zsh and ncurses Have been compiled and installed successfully
3.2 install oh-my-zsh
sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
Wait for the installation to succeed
This will automatically enter zsh, Next start input zsh You can enter .
4. Replace oh-my-zsh The theme
oh-my-zsh There are many themes , It can be $HOME/.oh-my-zsh/themes notice :
Its theme changes , You can modify $HOME/.zshrc The contents of the document 
For example, the theme I use here is agnoste
5. Start automatic entry zsh
It is generally used on the Internet here chsh Command to replace the default shell, But for no root jurisdiction , Or it is obviously bad for users who do not want to modify the global configuration .
So here we use modify $HOME/.bashrc file , Add... To the last line zsh That's all right. , The purpose of this file is to shell It will be automatically executed when starting , So every time ssh When the connection enters, it will automatically enter zsh
6. Other ways to install software
because apt Installing the software requires root jurisdiction , So we can use apt download deb, Then decompress deb package , Finally, the The pressurized file is put in .local Under the directory
for example install htop
apt download htop
dpkg-deb --fsys-tarfile htop_2.1.0-3_amd64.deb | tar xvf - # decompression deb
cp -r ./usr/* .local # unzipped usr All folders and files in the directory Copied to the .local Next
This installation method is suitable for less dependent software , If there are many dependencies, you need to download multiple deb package , Then move to the corresponding directory , This method is much more convenient than compiling and installing
边栏推荐
猜你喜欢

Unknown database连接数据库错误

6月第4周榜单丨飞瓜数据UP主成长排行榜(哔哩哔哩平台)发布!

Green, green the reed. dew and frost gleam.

友盟(软件异常实时监听的好帮手:Crash)接入教程(有点基础的小白最易学的教程)

【qt5-tab标签精讲】Tab标签及内容分层解析

One of the basics - overview of sta Basics

Complete software development process

1500w播放下还藏着什么热点?B站2个未来趋势你不得错过

工作6年,来盘点一下职场人混迹职场的黄金法则

What will Web3 bring in the future?
随机推荐
DC學習筆記正式篇之零——綜述與基本流程介紹
qt5-MVC:数据可视化的层次揭秘
Koa koa combine routes sub route management
StrictMode卡顿与泄漏检测-StrictMode原理(2)
编译安装oh-my-zsh
K210 site helmet
软件开发完整流程
User defined annotation implementation verification
微生物安全與健康,什麼是生物處理?
生意和投资的思考
Draw some interesting figures with flutter's canvas
The argument type 'function' can't be assigned to the parameter type 'void function()‘
短信在企业中的应用有哪些?
StrictMode分析Registion-StrictMode原理(4)
友盟(软件异常实时监听的好帮手:Crash)接入教程(有点基础的小白最易学的教程)
流批一体在京东的探索与实践
Note d'étude du DC: zéro dans le chapitre officiel - - Aperçu et introduction du processus de base
StrictMode带来的思考-StrictMode原理(5)
【多源bfs】934. Shortest Bridge
TypeError: can‘t convert cuda:0 device type tensor to numpy. Use Tensor.cpu() to copy the tensor to