This repository helps you quickly set up a clean and user-friendly terminal environment. You can install either the bash or zsh configuration, along with custom styling for tmux and vim.
For the bash setup, you can refer to the following example:
╭─[machine-name] as user in ~/ on branch (main)* (docker)
└──➤ some-command ...
If the current directory is inside a Git repository, the prompt will automatically display the branch name. If there are uncommitted changes, an asterisk (*) will appear as a warning. Additionally, if you are inside a container, the prompt will show (docker) at the end as a reminder.
Note:
- This repository does not overwrite anything in your
.bashrc. Any existing commands or configurations in your.bashrcwill still be executed as usual. This setup simply appends a script at the end to configure the prompt output.- In
.zshrc, ROS-related dependencies are automatically sourced if the environment variableROS_DISTROis set.
Append the parameters you want to use at the end of the command:
--shell <shell_type>:- Specify the shell type to install. Options are
bashorzsh. - Default is
bash.
- Specify the shell type to install. Options are
--no-sudo:- If set, the script will not use
sudofor package installations. Make sure you have already installed the required packages manually. - It is useful if you are running the script in some environments where
sudois not available, such as laboratory servers.
- If set, the script will not use
--help|-h:- Display help information for the script.
git clone https://github.com/YuZhong-Chen/.setup_env.git ~/.setup_env
~/.setup_env/install.shPlease add the following lines at the end of your Dockerfile, and make sure you have changed the user to the one you want to install the environment for.
# Install custom environment
RUN git clone https://github.com/YuZhong-Chen/.setup_env.git ~/.setup_env \
&& ~/.setup_env/install.shTo make tmux more convenient to use, I’ve customized several key bindings.
The most commonly used ones are listed below.
If the key binding you’re looking for isn’t listed here, it means I didn’t modify that particular key.
prefix: ctrl + Aprefix+arrow keys: Move between panes. (You can also click with the mouse to switch)- hold
prefix+arrow keys: Resize the current pane. prefix+Space: Automatically adjust pane sizes.prefix+-: Split the pane horizontally. (Since-resembles a horizontal line)prefix+|: Split the pane vertically. (Since|resembles a vertical line)prefix+c: Create a new window. (c for create)ctrl+d: Exit the current pane.prefix+number: Switch to a specific window. (You can also click with the mouse to switch)prefix+a: Switch to the previous window.prefix+d: Detach the session.prefix+w: List all sessions and navigate with arrow keys.mouse selection: Select and copy text.
tmux: Start a new tmux session.tmux ls: List all tmux sessions.tmux attach: Attach to the last tmux session.tmux attach -t <session_number>: Attach to a specific tmux session.tmux kill-session -t <session_number>: Kill a specific tmux session.tmux kill-server: Kill all tmux sessions.
Please make sure your terminal supports and correctly displays UTF-8 characters. If the output does not match the example, it is likely due to missing font support for certain symbols. You can resolve this by installing a font that includes these characters or by replacing unsupported symbols with alternatives.