2010年2月10日 星期三

在bash下,目錄與檔案有顏色區別

在bash下,目錄與檔案有顏色區別

#vim ~/.bashrc
i 進入編輯模式
在最後面加上
  • alias ls='ls --color=auto'
apt-get install vim (Debian預設裝的是簡單版,所以不會有顏色)

vim /etc/vim/vimrc
  • syntax on (拿掉";")
  • set nu(顯示行數)
  • colorscheme  style_name  <--- /usr/share/vim/vim72/colors/ 有default的可以選
  • set mouse=a (support mouse)
  • 開啟時回到離開時的地方
    if has("autocmd")
    au BufReadPost * if line("'\"") > 0|if line("'\"") <= line("quot;)|exe("norm '\"")|else|exe "norm quot;|endif|endif
  • endif
改變vim Tab鍵 隔數
  • set tabstop=4  (設定tab =4空格)
個人喜歡的 style --- doriath
    " Vim color file
    " Maintainer: Alex Esplin (alex.esplin@gmail.com)
    " Last Change:
    " URL:

    set background=dark
    hi clear
    if exists("syntax_on")
    syntax reset
    endif
    let g:colors_name="doriath"

    hi Normal guifg=#d2ffc6 guibg=#0e2a1a
    hi Cursor guibg=#54ff9f guifg=#0e2a1a
    "hi CursorIM
    "hi Directory
    "hi DiffAdd
    "hi DiffChange
    "hi DiffDelete
    "hi DiffText
    "hi ErrorMsg
    hi VertSplit guibg=#c2bfa5 guifg=grey50 gui=none
    hi Folded guibg=#4e9271 guifg=#0e2a1a
    hi FoldColumn guibg=grey30 guifg=tan
    hi IncSearch guibg=khaki guifg=slategrey
    hi LineNr guifg=khaki
    hi ModeMsg guifg=goldenrod
    hi MoreMsg guifg=SeaGreen
    hi NonText guibg=LightBlue guibg=SeaGreen
    hi Question guifg=springgreen
    hi Search guibg=DarkRed guifg=DarkSeaGreen4
    hi SpecialKey guifg=yellowgreen
    hi StatusLine guibg=#c2dfa5 guifg=black gui=none
    hi StatusLineNC guibg=#c2dfa5 guifg=grey50 gui=none
    hi Title guifg=IndianRed
    hi Visual guibg=olivedrab guifg=khaki gui=none
    "hi VisualNOS
    hi WarningMsg guifg=salmon
    "hi WildMenu
    "hi Menu
    hi Scrollbar guibg=#0e2a1a
    "hi Tooltip

    " syntax highlighting groups
    hi Comment guifg=#1d96e7
    hi Constant guifg=#00ff62
    hi Identifier guifg=#28dbd2
    hi Statement guifg=#ffff5b
    hi PreProc guifg=IndianRed
    hi Type guifg=#ff3636
    hi Special guifg=navajowhite
    "hi Underlined
    hi Ignore guifg=grey40
    "hi Error
    hi Todo guifg=orangered guibg=yellow2




    各種語法的 vim color style --- 有C、Java等

    更改gnome-terminal的顏色:
    (GNOME Terminal-->Edit-->Profile Preferences-->Colors)
    • text color #D3D7CF
    • background color #2E3436
    跟doriath蠻配的

    還有很多不錯的設定
    vimrc設定教學

    沒有留言:

    張貼留言