I'm fairly familiar with the default bash shell shortcuts (emacs style). For example, if I want to move my cursor forward by a word I would press Alt+F (same as you would in emacs). I can get to the previous command with Ctrl+P.
Is it even possible in windows powershell to override these shortcuts? If so, does anyone know of a good way to map the default bash shell shortcut configurations to powershell (in a bash shell you can say set -o emacs
, for example)?
If it helps, I don't really care about powershell per say, I care about posh-git shell. However, git-shell inherits its properties from powershell from what I can tell.
You can do that with the PSReadLine
module which ships with PowerShell 5.0 (Windows 10).
Simply set the EditMode
option to Emacs
:
Set-PSReadLineOption -EditMode Emacs
In addition to the default Windows
mode, it also has a Vi
mode.
The project README file mentions that neither are fully implemented so don't expect full feature parity, but I can confirm that it switches tab completion to bash-style and supports the Alt+F and Ctrl+P key bindings for moving forward and jumping to the previous command respectively
(I'm not an experienced emacs user so I'm unable to tell whether this comes "close enough" to what you expect)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With