2013-02-03 33 views
0

隨着nowrap和長按一行,點擊結束按鈕將光標移動到行的末尾(當然)。此外,屏幕將以光標爲中心。在vim結束時不要居中屏幕

這將光標從這裏:

cursor at right

到這裏:

cursor at left

我怎樣才能使它向右滾動只到 「行。」?因此有最後的「這是一條很長的路線」。對齊窗口的右側?

編輯:我已經知道sidescrollsidescrolloff但這些只適用於使用箭頭鍵。它不會改變結束鍵的行爲,因此不能解決我的問題。

回答

1

如果你檢查:h ze

ze   Scroll the text horizontally to position the cursor 
      at the end (right side) of the screen. This only 
      works when 'wrap' is off. {not in Vi} 

因此,如果您創建一個映射,映射$<end>$ze<end>ze,它應該如你所願的工作。

希望它有幫助。

編輯,如果你想映射就像你在插入模式想要什麼

:set sidescroll=1 
:inoremap <End> <Esc><End>zei 
+0

謝謝!有沒有什麼方法可以在插入模式下重新映射它? – Mihai

+0

@Mhaihai見EDIT – Kent