
在 Atom 中編輯以下程式碼片段時,假設我的遊標位於緊接之前my_parameter
:
def a_method
first_command my_parameter
end
我想用一次按鍵來刪除所有空格但不包括任何first_command
。 Atom 中的預設行為ctrl-backspace
是不僅刪除空格,而且刪除所有first_command
. (這與 Sublime Text 等其他編輯器形成對比,後者僅刪除空格。)
實現這一目標的簡單方法是什麼?
答案1
您正在尋找的命令是delete-to-previous-word-boundary
,可從編輯 → 文字 → 刪除到上一個單字邊界。
將其新增至您的自訂鍵盤映射(編輯→鍵盤映射...)與您選擇的擊鍵。
'atom-text-editor':
'ctrl-backspace': 'editor:delete-to-previous-word-boundary'