Here are some files for setting the environment of a new computer.
If any error messaage comes like Not an editor command: ^M
, use vim to open file and set the format correctly by :set fileformat=unix
.
The .vimrc
file helps to set the coding environment of VIM.
The .zshrc
file helps to set the zsh environment of ZSH.
It is assumed that the oh-my-zsh is also installed.
Install
sudo apt update
sudo apt install zsh
Check now-available shells
cat /etc/shells
Change current shell to zsh
chsh -s $(/usr/bin/zsh)
wget
sh -c "$(wget -O- https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
curl
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
Note: This runs the install.sh
in oh-my-zsh. Check all the details in oh-my-zsh
Some themes needs the Powerline fonts to appear correctly.
sudo apt-get install fonts-powerline
This uses theme agnoster
. I made some changes from default version. See ./Zsh/Ubuntu/agnoster.zsh-theme
- Add current time in RPROMPT
- Remove the machine name in PROMPT
Copy the .zsh-theme
file to ~/.oh-my-zsh/themes/
The terminal looks like this:
Some features in a theme may not be able to appear correctly in Windows. This uses theme awesomepanda
, which can work correctly in Windows. I made some changes from default version. See .Zsh/Windows/awesomepanda.zsh-theme
- Add current time in RPROMPT
- Remove the machine name in PROMPT
Copy the .zsh-theme
file to ~/.oh-my-zsh/themes/
The terminal looks like this:
GitBash
is a tool in Git for Windows. It provides a simple way to use git with Bash environment in Windows besides wsl.
Install Git for Windows and one can see GitBash in the Start Menu
The followig was referenced from this.
It is used for me to define the prompt($PS1) in GitBash
. Copy it into the /etc/profile.d
directory.
cp git-prompt.sh /etc/profile.d/git-prompt.sh
Compared with default, I delete the host machine name and add the current time. The prompt looks like this:
It is used for me to add user-defined aliases. Copy it into the home directory in GitBash.
cp .bash_profile ~/.bash_profile