[英]Vim move / copy line to end of file without moving cursor?
我經常使用:.m$
移動或:.t$
將當前行復制到文件末尾。 有時,如果光標不會跳轉到文件末尾或移動/復制命令的目標位置,則會更容易。 它有選擇嗎?
嘗試這兩個映射:
"move current line to the end of buffer without moving cursor
nnoremap <leader>mv ddGp``
"copy current line to the end of buffer without moving cursor
nnoremap <leader>cp YGp``
請注意,對於move
情況,光標位置將更改為下一行的文本,因為原始文本行已經消失。 但它坐在同一條線(數字)上。
如果您要求匿名注冊( "
)不受影響,我認為我們需要為它編寫一個函數。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.