Q&A

解決vim中文亂碼

找到etc/vim/.vimrc

編輯~/.vimrc文件,加上如下幾行:

   set fileencodings=utf-8,ucs-bom,gb18030,gbk,gb2312,cp936
   set termencoding=utf-8
   set encoding=utf-8
查看當前l(fā)inux操作系統(tǒng)
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) ?????????$
#參數(shù)解釋
\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/)
最后編輯于
?著作權歸作者所有,轉載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務。

相關閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容