![如何在終端編輯器中互相替換兩行?](https://rvso.com/image/1438683/%E5%A6%82%E4%BD%95%E5%9C%A8%E7%B5%82%E7%AB%AF%E7%B7%A8%E8%BC%AF%E5%99%A8%E4%B8%AD%E4%BA%92%E7%9B%B8%E6%9B%BF%E6%8F%9B%E5%85%A9%E8%A1%8C%EF%BC%9F.png)
我有這個:
pick 887b66f add 222 Dziewiecsil to flowers new title
pick dc331cb new name of beginning commit
我想得到這個:
pick dc331cb new name of beginning commit
pick 887b66f add 222 Dziewiecsil to flowers new title
有沒有辦法使用鍵盤快捷鍵快速完成此操作?
答案1
本頁有一些如何在編輯器 vi 中交換相鄰兩行的範例:
http://vim.wikia.com/wiki/Swapping_characters,_words_and_lines
從上面的連結:
若要將目前行與下面的行交換,請點選 {esc} 並輸入:
ddp
若要將目前行與上面的行交換,請點選 {esc} 並輸入:
ddkP