The only configuration guide you need for shell.
-
sh -c "$(wget https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh -O -)"
-
Install Starship
Starship can be installed on Linux and macOS with one simple command:
curl -k -sS https://starship.rs/install.sh | sh
Note: Curl's verification of certificate is turned off in this command.
This command will place the Starship binary in
/usr/local/bin
by default. If you'd like to place the binary somewhere else, specify the--bin-dir
option:wget https://starship.rs/install.sh sh ./install.sh --bin-dir "your custom bin directory"
Also, remember to add the custom bin directory to your
$PATH
variable. -
Configure Starship
By default, you need to create
~/.config/starship.toml
first and put in any config you want with:vim ~/.config/starship.toml
Alternatively, you can just copy the
starship.toml
in this repository to~/.config/starship.toml
:cp starship.toml ~/.config/starship.toml
If you are using our config file, please make sure you have installed any Nerd font in your system. If not, you can download one from here.
Here is a preview of shell prompt with our configuration file:
If you use conda, you may want to disable the default conda prompt change. To do so, just run:
conda config --set changeps1 False
-
Configure zsh plugins
We use a selected minimal set of plugins for zsh. You may edit the zsh config file:
vim ~/.zshrc
and replace the default plugins
plugins=(git)
with the following:plugins=( git extract cp zsh-autosuggestions zsh-syntax-highlighting sudo tmux autojump )
Some of the plugins are not installed by default. You may want to install them first:
For
autojump
:Install it with
sudo apt install autojump
on Ubuntu orbrew install autojump
on macOS.For
zsh-autosuggestions
:Install it with
sudo apt install zsh-autosuggestions
on Ubuntu orbrew install zsh-autosuggestions
on macOS.You can also install it manually:
git clone git@github.com:zsh-users/zsh-autosuggestions.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
For
zsh-syntax-highlighting
:Install it with
sudo apt install zsh-syntax-highlighting
on Ubuntu orbrew install zsh-syntax-highlighting
on macOS.You can also install it manually:
git clone git@github.com:zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
-
Restart your shell
After all these changes, you may need to restart your shell to see the changes.
-
We provide a Monokai Pro based color scheme for JetBrains IDEs in this repository.
-
If you develop with Python, you may want to optimize your traceback output with Rich globally. To do so, you should first make sure conda is installed, and run:
conda activate "your env name" pip install rich
Next, according to the Official Documentation of Rich, you need to modify the
sitecustomize.py
file. Usually this file is located in your virtual env directory, for example,~/anaconda3/envs/base/lib/python3.11/site-packages/sitecustomize.py
. If you are not sure about where it is, run:python -c "from distutils.sysconfig import get_python_lib;print(get_python_lib())"
This prints the path of the
site-packages
directory, and you may find thesitecustomize.py
file in it. If the file does not exist, just create one.
Once you find thesitecustomize.py
file, you need to add the following code to it:try: from rich import traceback traceback.install(show_locals=True, width=10000) except ImportError: pass
It's done! Now you can enjoy the beautiful traceback output with Rich. But notice that these configurations are env-specific, so you need to repeat these steps for every virtual env you have.
-
If you are using hdfs, we recommend setting the following aliases:
alias hfs='hdfs dfs' alias hls='hdfs dfs -ls' alias hcat='hdfs dfs -cat' alias hput='hdfs dfs -put' alias hget='hdfs dfs -get' alias hrm='hdfs dfs -rm' alias hrmdir='hdfs dfs -rmdir' alias hmkdir='hdfs dfs -mkdir' alias hdu='hdfs dfs -du' alias hmv='hdfs dfs -mv' alias hcp='hdfs dfs -cp' alias htail='hdfs dfs -tail' alias hchmod='hdfs dfs -chmod' alias hchown='hdfs dfs -chown' alias hchgrp='hdfs dfs -chgrp' alias htouchz='hdfs dfs -touchz'
Copy and paste the above code to your
~/.zshrc
file, andsource ~/.zshrc
, then you can use these aliases in your shell.
-
Zsh is not installed.
When you install Oh-My-Zsh with the command provided in Install Oh-My-Zsh, you may find the following error:
Zsh is not installed. Please install zsh first.
Which means you should first install zsh with: Which means you should first install zsh with:
sudo apt install zsh # On ubuntu
or:
brew install zsh # On macOS
Then you can run the command again to install Oh-My-Zsh.
If you find this repository useful, please give us a star. Thank you!