当前位置:网站首页>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
边栏推荐
- [leetcode] sum of two numbers [1]
- Unknown database连接数据库错误
- Open3D 点云包围盒
- Parity linked list [two general directions of linked list operation]
- K210 access control complete
- C# 自定义并动态切换光标
- Opencv basic operation 2 realizes label2rgb and converts gray-scale images into color images
- About the general input operation mode of unity
- What are the functions of soil microorganisms in microbial detection?
- MATLAB 最远点采样(FPS改进版)
猜你喜欢

编译安装oh-my-zsh

Openmv and k210 of the f question of the 2021 video game call the openmv API for line patrol, which is completely open source.

K210 site helmet

45岁程序员告诉你:程序员为什么要跳槽,太真实...

图的连通性基础

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

Q play soft large toast to bring more comfortable sleep

关于白盒测试,这些技巧你得游刃有余~

Gin configuration file

1500w播放下还藏着什么热点?B站2个未来趋势你不得错过
随机推荐
Construction and beautification of personal blog
[network packet loss and network delay? This artifact can help you deal with everything!]
Docker deployment MySQL 8
MFC TCP通信服务端客户端Demo备忘vs2019
C# 自定义并动态切换光标
WIN11中MathType编辑中“打开数学输入面板”是灰色不可编辑
Split the linked list [take next first and then cut the linked list to prevent chain breakage]
微生物健康,食品微生物检测为什么很重要
[queue] 933 Number of Recent Calls
flutter报错 -- The argument type ‘Function‘ can‘t be assigned to the parameter type ‘void Function()?‘
System settings large page
微生物安全与健康,什么是生物处理?
短信在企业中的应用有哪些?
Zero of DC learning notes -- overview and basic process introduction
gin 配置文件
【Proteus仿真】Arduino UNO +74C922键盘解码驱动4X4矩阵键盘
【qt5-tab标签精讲】Tab标签及内容分层解析
[problem handled] -nvidia SMI command cannot obtain the GPU process number of its own container and the external GPU process number
TypeError: can‘t convert cuda:0 device type tensor to numpy. Use Tensor.cpu() to copy the tensor to
Digital IC design process summary