1

I am attempting to make the text editing experience in a Windows workstation I use alongside my OS X systems line up with the keybindings that Cocoa offers.

To start, how would one change mappings so that alt-backspace (in this case it's the option-back-delete key on an older MacBook Pro) deletes entire words?

I would also like to map many other keys differently, such as control-a/e to go to beginning/end of line and a number of other alterations to match it up, but I'd like to start off at the very least with the above.

ylluminate
  • 1,331

3 Answers3

4

Did you know that you can delete words by the combination Ctrl+Backspace?

Alt+Backspace is generally mapped to the "Undo" command.

If you still want to change the behavior, you can use the AutoHotKey program.

Run5k
  • 16,463
  • 24
  • 53
  • 67
0

To faster delete whole words, you can first select them by placing the cursor at the end and pressing Control + Shift + Left Arrow. Then proceed by pressing Backspace or Delete.

To map the Alt + Backspace behavior to do this, check the links given as "possible duplicates" to your question.

Marc.2377
  • 1,677
0

Because this question comes us when searching for powershell alt-backspace delete word, I'll also add an answer specific to PowerShell.

You can create or modify the file C:\Users\<your_user>\Documents\WindowsPowerShell\profile.ps1, adding the following content:

Set-PSReadLineKeyHandler -Key 'Alt+Backspace' -Function BackwardDeleteWord

You must also allow PowerShell to read this file every time you open it. You do it (once) by opening PowerShell as an administrator and running:

Set-ExecutionPolicy RemoteSigned -Scope LocalMachine

Bonus

While you're at it, you can also add a shortcut to close the window with CTRL-D, in a separate line in the same file profile.ps1:

Set-PSReadLineKeyHandler -Key 'Ctrl+d' -Function DeleteCharOrExit

You can browse all possible functions here: https://learn.microsoft.com/en-us/dotnet/api/microsoft.powershell.psconsolereadline

sp00n
  • 1
  • 1