close

1、使Terminal顯示內容依分類有不同顏色
參考網址http://kuster.pixnet.net/blog/post/27375851-%E8%AE%93ubuntu%E7%9A%84terminal%E8%89%B2%E5%BD%A9%E6%9B%B4%E8%B1%90%E5%AF%8C
說明將Ubuntu上的Terminal提示指令列,異動為有顏色

步驟
編輯 ~/.bashrc 檔

# set a fancy prompt (non-color, unless we know we "want" color)
case "$TERM" in
    xterm-color) color_prompt=yes;;
esac
後方,加上一行
color_prompt=yes


if [ "$color_prompt" = yes ]; then
    PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
else
    PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
fi
異動為
if [ "$color_prompt" = yes ]; then
    PS1='${debian_chroot:+($debian_chroot)}\[\033[01;33m\]\u\[\033[37m\]@\[\033[32m\]\h\[\033[37m\]:\[\033[31m\]\w \[\033[36m\]\$\[\033[00m\] '
else
    PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
fi 


2、使vi編輯內容有顏色區分
參考網址http://blog.longwin.com.tw/2009/03/choose-vim-color-scheme-2009/
      http://www.vim.org/scripts/script_search_results.php?keywords=&script_type=color+scheme&order_by=creation_date&direction=descending&search=search
      http://www.cyberciti.biz/faq/howto-install-full-vim-under-ubuntu-linux/ 
說明使Ubuntu上vi編輯時,有顏色之區分

步驟
A. mkdir ~/.vim/colors/
B. 下載 COLOR_SCHEME.vim
  由http://www.vim.org/scripts/script_search_results.php?keywords=&script_type=color+scheme&order_by=creation_date&direction=descending&search=search
C. mv COLOR_SCHEME.vim ~/.vim/colors/
D. vim ~/.vimrc # 加入下述內容
  set t_Co=256
  colorscheme COLOR_SCHEME
  存檔
E. 再重新進到vi時,就生效了
 (而且原本Ubuntu的vi編輯模式有點像Unix那樣,要用K、J、H、L四個鍵去上、下、左、右移動游標,導入SCHEME後就能用上、下、左、右鍵去移動了)
  萬一在進入vi時,出現E319: Sorry, the command is not available in this version: syntax on ... 錯誤訊息,則要先執行
  sudo apt-get install vim


 

 

arrow
arrow
    全站熱搜

    來自大海的心 發表在 痞客邦 留言(0) 人氣()