解决vim中文乱码
找到etc/vim/.vimrc
编辑~/.vimrc文件,加上如下几行:
set fileencodings=utf-8,ucs-bom,gb18030,gbk,gb2312,cp936
set termencoding=utf-8
set encoding=utf-8
查看当前linux操作系统
root@c06a9146d955:~# uname -a
Linux c06a9146d955 4.4.0-139-generic #165-Ubuntu SMP Wed Oct 24 10:58:50 UTC 2018 x86_64 GNU/Linux
root@c06a9146d955:~# cat /etc/issue
Debian GNU/Linux 9 \n \l
自定义编辑器头
编辑./bash_profile或者/.profile文件,重新打开termial就可以看到变化
比如:
export PS1="\u🔥\w\[\033[32m\]\$(parse_git_branch)\[\033[00m\] $ "
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
export PS1="\u@\h\033[32m\]\w\[\033[33m\]\$(parse_git_branch)\[\033[00m\] ☀️✨💫🚗🚗$ "
输出结果
anna@ubuntu14~/host/workspace/alib (master) ☀️✨💫🚗🚗$
#参数解释
\d – Current date
\t – Current time
\h – Hostname
\# – Command number
\u – User name
\W – Current working directory (ie: Desktop/)
\w – Current working directory with full path (ie: /Users/Admin/Desktop/)