2012-06-29 253 views

回答

1

問法很多時候,答案是永遠「你不能」

它可以通過「虛擬線」來移動光標的「虛擬線」一包線內與gjgk,但它並沒有真正與滾動的問題幫助:Vim不是隻顯示x「虛擬線」的包裝。附件號碼:

2

在包裝去僞面向行,您可以更改:

noremap j gj 
noremap k gk 

,並添加

set scrolloff = 3 " so you always have 3 lines on bottom and top or 
set scrolloff = 999 " to have the cursor(line) always in the middle 

,和查找的位置把這個在您的.vimrc

set cursorline 
if &term =~ "xterm\\|rxvt" 
    " use a green cursor in insert mode 
    let &t_SI = "\<Esc>]12;green\x7" 
    " use an orange cursor otherwise 
    let &t_EI = "\<Esc>]12;orange\x7" 
    silent !echo -ne "\033]12;orange\007" 
    " reset cursor when vim exits 
    autocmd VimLeave * silent !echo -ne "\033]12;white\007" 
    " use \003]12;gray\007 for gnome-terminal 
endif 

它使插入模式下的光標爲綠色,否則爲橙色 - 這些是\<esc>]12;green\x7只是爲了告訴終端它應該這麼做 - 用australopithici或者其他什麼語言,因爲那是終端的年齡;-)。

,這在你.gvimrc

highlight Cursor guifg=black guibg=DarkOrange 
highlight iCursor guifg=black guibg=Green 
set guicursor=n-v-c:block-Cursor 
set guicursor+=i:ver100-iCursor 
set guicursor+=n-v-c:blinkon0 
set guicursor+=i:blinkwait0 

以及最後三行是沒有必要的,但我不喜歡閃爍

+1

PS。我想補充 - 我不喜歡包裝,限制在80個字符以下仍然是常見做法。當編程'79行發生錯誤'可能意味着第79行中的800個字符有錯誤,並且發現該錯誤不如100行字符。對於可接受的縮進,你必須修補vim - 所以你看到我不喜歡換行。 – epsilonhalbe

+0

謝謝你的回答。但即使顏色,閱讀vim仍然是一個不好的經驗。 80個字符適合編碼,但不適合正常寫作。我發現這個問題永遠無法解決。 http://stackoverflow.com/questions/8369021/in-vim-how-to-scroll-continuously-by-screen-lines-when-wrapping-is-enabled – user1490479

+0

你讀書時錯過了什麼?我非常確定它顯示了大多數提供正確字體的unicode字符。我可以改變顏色方案,所以我的眼睛不會受傷。我喜歡在vim中閱讀。 – epsilonhalbe