Monday, 20 October 2014

Use Ctrl+Backspace to delete word in Windows command line?

How could I erase the whole word with using Ctrl-Backspace in Windows XP command line? Is it possible at all?

Ans 1 ))I think it should be better if select more Shift + Left, because it can select the backspce after/before the word. for example:
^w:: ;;Delete previous word
    Send ^+{Left}+{Left}
    Loop, 5 {
        Send {Del}
    }
Return
!d:: ;; Delete backward word
    Send ^+{Right}+{Rigt}
    Loop, 5 {
        Send {Backspace}
    }
Return

Ans 2 )) try this instead:
^BackSpace:: ;;Delete previous word
Send ^+{Left}
Loop, 500 {
    Send {Del}
}
Return
it modified the previous answer by sending 500 deletes after positioning at the previous word. 500 may be excessive, but so what.
this is for autohotkey (http://www.autohotkey.com/) and works in a cmd window, I put it in my cmd window specific section with the paste code like this:
#IfWinActive ahk_class ConsoleWindowClass
; Paste in command window
^V::
Send !{Space}ep
return

^BackSpace:: ;;Delete previous word
Send ^+{Left}
Loop, 500 {
    Send {Del}
}
Return

#IfWinActive

No comments:

Post a Comment