-
Notifications
You must be signed in to change notification settings - Fork 312
Add support for left/right navigation of entire pipeline stages #22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Emacs mode will have a binding to move to the next/previous character, e.g. Ctrl+],| would move to the next | and Alt+Ctrl+],| would move to the previous |. With this capability, I'm not sure it's worth adding something special for pipes. |
I think cmd users need bells and whistles like this but a more "Windows" friendly key-binding for this would be nice. Maybe Alt+Left/RightArrow,| |
F3/Shift+F3 roughly match Visual Studio. Give it a try and see how it feels. 933cda8 |
Cool. Thanks! BTW is there a way I can use Set-PSReadlineKeyhander and -Scriptblock to configure say a Ctrl+BackslashKey to do a F3 with arg '|' and Ctrl+Shift+BackslashKey to do a Shift+F3 with arg '|'? That would be more smooth to navigate quickly around a longer one-liner. Having to reach up to F3 and press another key combo (shift+\ for |) isn't as smooth (or quick). I know, first world problems. :-) What I have isn't working:
I assume I need to use Oem102 (backslash key which is also home to the pipe character)? What would be real slick is to have something like VS's inline find - Ctrl+F brings up a character mode (ala demo mode) to have use enter text, press F3 and Shift+F3 for forward/backward matches and then some key to dismiss the UI (esc?). :-) Keith Date: Mon, 9 Dec 2013 13:14:17 -0800 F3/Shift+F3 roughly match Visual Studio. Give it a try and see how it feels. 933cda8 — |
Hmm, thought this would get me closer but no:
|
With a trivial change to CharacterSearch, your first example will work. Until I make that change, instead of using CharacterSearch, you can combine GetBufferState and SetCursorPosition with your own string searching. I'll leave that as an exercise for the reader - it should be pretty simple. As for determining what key to use - I usually start with something like: |
Thanks. WRT string->key conversion, it would be sweet to use Demo mode to determine what argument to provide to -Chord. Date: Tue, 10 Dec 2013 21:08:49 -0800 With a trivial change to CharacterSearch, your first example will work. Until I make that change, instead of using CharacterSearch, you can combine GetBufferState and SetCursorPosition with your own string searching. I'll leave that as an exercise for the reader - it should be pretty simple. As for determining what key to use - I usually start with something like:
then type the key I want to bind - that tells me which Oem* character I need. Note that I'm investigating improving the string->key conversion because it's really too hard right now, but I have to learn more about keyboard layouts and whatnot before we'll see any changes. — |
Got this to work:
|
Now that I convinced you to write it yourself, I added support to CharacterSearch so you original example will work. c0059eb |
Cool. I look forward to the next "latest" release. |
Say I have this command with the cursor the location highlighted:
C:> Get-Process | Where Handles -gt >><< 500 | Format-Table ProcessName,Handles
We have LeftArrow/RightArrow to move a char at a time and Ctrl+Left/RightArrow to jump a word at a time. Considering the fundamental pipeline stages nature of PowerShell, it would be handy to be able to jump backward and forward through the pipeline stages using say Ctrl+Shift+Left/RightArrow. Pressing Ctrl+Shift+LeftArrow in the above example should put the cursor here:
C:> Get-Process | >>W<<here Handles -gt 500 | Format-Table ProcessName,Handles
Pressing the same key binding again would put it here:
C:> >>G<<et-Process | Where Handles -gt 500 | Format-Table ProcessName,Handles
Then pressing Ctrl+Shift+RightArrow twice would put it here:
C:> Get-Process | Where Handles -gt 500 | >>F<<ormat-Table ProcessName,Handles
The text was updated successfully, but these errors were encountered: