44 Commits
Author SHA1 Message Date
Dongbo Wang acb8ccbb17 Make Ctrl+r in Vi edit mode same as Emacs edit mode (#3148) 2022-01-11 17:13:49 -08:00
Aditya Patwardhan 6cf129ee35 Add the "Dynamic Help" feature to PSReadLine (#1777)
- Adds a way to view help on alternate screen buffer for full help and uses a Pager from `Microsoft.PowerShell.Pager`.
- Implements dynamic help for parameters by showing it below the current command line like `MenuComplete`.
2021-02-10 17:04:50 -08:00
Maxime Labelle 47fb95728c Make d0 to delete to the start of the current logical line in a multiline buffer in VI mode (#2002) 2021-02-09 21:45:37 -08:00
Maxime Labelle a45ab815a8 vi-mode: Add dgg to delete from the beginning of the buffer to the current logical line (#1752) 2020-09-10 11:45:27 -07:00
Maxime Labelle 70249682ed vi-mode: Use dk to delete the previous n logical lines and the current logical line in a multi-line buffer (#1737) 2020-08-12 12:00:22 -07:00
Maxime Labelle 1d3964160d vi-mode - Make 'dj' delete the current and next n logical lines (#1697) 2020-07-29 16:51:15 -07:00
Maxime Labelle c7ef3bd0f6 vi-mode: Add 'dG' to delete to the end of multiline buffer (#1692) 2020-07-25 11:06:54 -07:00
Maxime Labelle cd3ca2911d vi-mode: Make 'dd' deletes the logical line instead of the entire buffer (#1658) 2020-07-24 23:08:05 -07:00
Maxime Labelle 197a3fdc83 In VI mode, moving left or right should stick cursor on logical line (#1120) 2019-10-29 16:56:59 -07:00
Maxime Labelle 929f4f9bf4 Supports '_' and '$' to move to the beginning and end of the logical line in Vi mode. (#812)
Fix #795
2019-03-21 15:27:53 -07:00
Jason Shirk a7af25aa37 Stop dispatching on ConsoleKeyInfo (#831)
There are likely issues introduced by this PR,
but I'm merging for a new Beta so this code gets more testing.

* Introduce PSKeyInfo type alias
* Explicit conversions b/w ConsoleKeyInfo and PSKeyInfo
* Change tests to use actual ConsoleKeyInfo data
* Add fr-FR keyboard layout tests
* Add KeyInfo-ru-RU-windows.json (#839)

All impossible without Shift shortcuts labeled as "Investigate: true"
Alt+Spacebar tracked by windows itself

* Add KeyInfo for Polish (Programmers) layout on Windows and Linux (#870)

On Windows *Alt+Spacebar* is hijacked by Windows
On Linux any *Alt+F1-12* combination was not detected
2019-03-20 16:14:05 -07:00
Jason Shirk 3d246d935f Remove Keys.ShouldInsert (#822)
The method Keys.ShouldInsert was a misguided attempt to avoid inserting
keys where there is no binding but the key really doesn't make sense as
input.

Unfortunately it is just causing more pain and probably wasn't
addressing a serious problem, so I'm removing it.

Fix #798
2018-12-03 11:04:40 -08:00
Maxime Labelle 274381a89e Support vi mode 'G' and 'gg' movements in multi-line buffers (#793)
Fix #789
2018-11-05 12:34:17 -08:00
srdubya 91d6eeda30 Support Ctrl+u in vi insert mode (#637)
Fixes #628
2018-03-20 11:17:58 -07:00
Jason Shirk 193b4da3ac Fix cursor placement after history replacement
A fix for vi mode broke placing the cursor after recalling commands from
history.

There was also a small inconcistency in placing the cursor in vi mode
when in command mode.

Fix #592
2017-11-25 21:30:45 -08:00
Jason Shirk 3412b1a91b ShowKeyBindings and Get-PSReadlineKeyBinding improvements
Fix #114
2017-11-11 22:55:59 -08:00
srdubya 396826c648 Fix exception with UpArrow after a command line edit in vi-mode (#573)
Fix #571
2017-11-05 14:39:54 -08:00
Jason Shirk 63d2dcf6da Portable custom key bindings
Rewrote the custom key binding code to be more portable.

Some runtime checks are necessary because of impossible to reconcile
differences.

Some Win32 P/Invoke calls are still needed due to lack of information in
the ConsoleKeyInfo.

Some keys are currently not available on Linux due to a CLR bug, others
aren't available ever because terminals don't unique character sequences
for a given key press that might differ in just the Shift or Ctrl state.
2017-10-15 22:03:56 -07:00
andrewcromwell e1dcaaeded Character swapping fixes (#538)
* allow swapping at end of line
* add SwapCharacters to default emacs keybindings
* limit cursor location in SwapCharacters (vi mode)
* add SwapCharacters to insert mode vi bindings
2017-06-06 09:10:56 -07:00
srdubya 70200bb780 Fix a few VI mode issues
* Made several VI methods public (#445)
* Fixed IndexOutOfRangeException (#456)
* Add ReverseSearchHistory (Ctrl+R,Ctrl+S) in VI mode (#455)
2016-11-28 17:16:50 -08:00
Dan Thompson 51957e8516 Handle cursor size being out-of-bounds (fixes #386). (#389) 2016-05-20 10:35:30 -07:00
Jason Shirk (POWERSHELL) 6f741c5421 Startup improvements
- Delay loading resources until they are used
- Delay creating vi mode key handler tables
- Remove format.ps1xml file
2016-01-17 08:58:07 -08:00
srdubya b80ffb9b09 Addressed this feedback:
1  _normalBackground (keybindings.vi.cs) unused
2  copyright notice in *.vi.cs files?
3  ReadLine.vi.cs - InsertCharacter unreferenced
4  SearchBackward - change fn name to ViSearchHistoryBackward?
2016-01-02 08:51:06 -07:00
jason@truewheels.net 8691e88595 Initial refactor console api usage
To get the unit tests passing in VS2015, and to help w/ possible future hosts,
I've moved most of the console api usage to a class, which is then mocked
in the unit tests.
2015-12-06 09:05:37 -08:00
Eduardo Antunes C. de Sousa c1baf127bf Adding 'f', 'F', 't', 'T' movements to 'd' and 'c' command. 2015-07-30 14:51:31 -03:00
srdubya c4c396ed72 Adding documentation for 'o', 'O', and 'J''s key handling methods. 2015-06-28 10:54:03 -06:00
srdubya 8483f0e507 Adding 'o', 'O', and 'J' in Vi-Mode. 2015-06-27 13:44:56 -06:00
srdubya ab52d2b642 1st attempt at merge with #251. 2015-06-20 16:47:33 -06:00
srdubya e557b0b5b9 Adding Prompt option for ViModeIndicator. Fixing #227 - indicator returns back to None after any other set option. 2015-05-19 20:29:43 -06:00
srdubya 8a2c8a988f Added the changing of the console cursor size when in command/insert mode. Use the -ChangeCursor option to control. 2015-03-15 13:56:48 -06:00
srdubya c7ff14c80d Adding visual editing via <esc> v.
Set either the EDITOR or VISUAL environment variable to your in-console editor command of choice.  When entering visual editing mode, the shell will execute the command specified by EDITOR/VISUAL with a temporary file as the single parameter.

VISUAL has precidence over EDITOR.  Environment variable are search first in machine, then process, and finally user targets.
2015-03-08 15:42:07 -06:00
srdubya 51d14f4b37 Fixing problem with tab completion after 'c' in command mode. 2015-01-18 06:43:49 -07:00
srdubya 6838123f0e Added support for mid-chord numberic arguments. 2014-12-27 11:58:56 -07:00
srdubya 7aa550cac1 Added ctrl-D handling (accept in insert mode, exit in cmd mode). 2014-12-24 12:58:57 -07:00
srdubya 8039699367 Cleaned a couple duplicate functions. 2014-12-24 12:43:26 -07:00
srdubya 978584e174 Fixed minor formatting. Ready for Sync. 2014-12-21 16:23:45 -07:00
srdubya 13148f89f4 Fixed Delete and Change so the work for Globs. 2014-12-21 16:20:20 -07:00
srdubya 767d6d2824 Added Yank commands. 2014-12-20 11:27:18 -07:00
srdubya 3a541d9db5 Removed mode, in preparation for merge with GitHub. 2014-12-19 10:57:18 -07:00
srdubya 6005d034cd Fixed word movement for B,E,&W. 2014-12-18 09:02:14 -07:00
srdubya 9cfdfd4883 Getting ready to fix dot word movement problem. 2014-12-13 10:06:01 -07:00
srdubya 4b2acc31aa Improved Undo for 'c' commands. 2014-04-21 19:20:25 -06:00
srdubya b31b64eb83 Making UndoAll a non-VI specific key handler. 2014-04-19 19:14:56 -06:00
srdubya 4a74823983 Moving many Vi* commands to more generic names. 2014-04-19 08:59:33 -06:00