vi mode - experimental build
I've just uploaded an experimental build with basic vi emulation:
X86:
http://www.linqpad.net/GetFile.aspx?preview+LINQPad5.zip
AnyCPU:
http://www.linqpad.net/GetFile.aspx?preview+LINQPad5-AnyCPU.zip
Go to Edit | Preferences > General UI to enable.
Let me know if anything important is missing - or if anything is behaving badly.
Thanks!
Joe
X86:
http://www.linqpad.net/GetFile.aspx?preview+LINQPad5.zip
AnyCPU:
http://www.linqpad.net/GetFile.aspx?preview+LINQPad5-AnyCPU.zip
Go to Edit | Preferences > General UI to enable.
Let me know if anything important is missing - or if anything is behaving badly.
Thanks!
Joe
Comments
We've asked for the basic vi commands and so far very cool!
As we start using it, we'll encounter commands that aren't implemented. how should we report these so that you can aggregate popularity?
Thanks again,
Howard
Thanks again, this has already been a huge help to me.
Some suggestions:
* it would be great to be able to move from the editor panel to the grid with CTRL-W j and back with CTRL-W k
* maybe inoremap or something like that so that we could map jj or kj or jk to exit insert mode
* enable moving around when at the grid using the same j k l h keys
Thanks again.
I can't remap J and K to scroll the results when focused because you can dump things such as textboxes that need to respond to keypresses.
I like using kj to exit insert mode. There's now an option for this.
Ran into an issue moving around with the '-' character: It won't move up over vertical white space. Within a dense block of code it navigates fine but stops at a blank line. Navigating down with '+' (something I rarely do because is easier) works fine but seems to jump over the white space to the next section.
Maybe related I also noticed that moving to the last line in the file, navigating up one line with 'k' to a blank line, then hitting '-' moves down, not up.
Click "+" to open a new tab
Click the DB name in the upper right corner
Click in the window and type "Time"
Get a System ArgumentException: The indicator is not allowed to be zero-length. This also may have occurred if you specified a TextRange that is outside the bounds of the document.
Since the window is empty, I almost certainly specified a range outside the bounds.
I'm going to have to retrain my brain to hit "a" before I start typing queries...
-Vic
I do run into one issue though. when an auto-completion popup is open during insert mode, escape will first close that popup, and only the second escape will leave insert mode.
Could you maybe provide an option to make escape leave insert mode right away?
Note that you can also use Ctrl+Enter or Shift+Enter to exit insert mode - this will work even when a popup is active.
muggle, buggle, snuggle, fuggle (a hop variety)
buggle, snuggle, fuggle (a hop variety) // cf,
snuggle, fuggle (a hop variety) // c2f,
fuggle (a hop variety) // c3f
When I try using "+" characters, things get weird: it "takes" more than I expected
Monkey++, Froggie++, j++
+, Froggie++, j++ // c1f+
+, j++ // c2f+
// c3f+ [took the whole line including the comment
Not a really big deal since it seems isolated to "+".
Thanks again. Still enjoying the heck out of vi in LINQPad.
-Vic
Regarding disabling auto-formatting, you can do this in Edit | Preferences | Advanced > Code Formatting. Turn off 'Auto format on closing brace or end block', and 'Auto format on paste'.
I've found an issue when yanking/putting substrings. When selecting a substring
in visual mode and pressing 'yp' to duplicate the content, the yanked string is
inserted on a new line below, instead of at the current cursor position.
Also, is it possible to use the windows clipboard as the yank buffer? That
would simplify copy-pasting to/from other applications.
a couple of vi sequence I use a lot and would love to see implemented:
* "[[" to move to the top and "]]" to move to the bottom or ":0" and ":$"
* "ma" then move somewhere else "mb" then "'a,'bt." to copy from marker a to b to current location and also "'a,'bm." to move the block.
Thanks Joe and Merry Christmas!
Howard
Another obscure bug but something I use often:
Cap1 = r.MonthlySum1YCap1 * 100, Targ1 = r.MonthlySum1YTarget1 * 100, Val1 = r.MonthlySum1YValue1 * 100,
Editing this line I want to change most of the "1" to "2" so I type:
"f1r2;;.;;.;;." or translated to English: find "1" in Cap1, replace with "2", find next "1" (twice to skip the 1Y) using ";", replace with 2 using "." to repeat prior command, etc.
What happens is the first one works correctly but the second and subsequent "." replaces two characters with "2" giving me the following:
Cap2 = r.MonthlySum1YCap22* 100, Targ22= r.MonthlySum1YTarget22* 100, Val22= r.MonthlySum1YValue22* 100
Thanks again. I'm loving vi in LINQPad.
-Vic
I had some text between []s, [App-Vlan-IP], I was trying to change. My cursor was located between the two p's. In Vim 5ciw would allow me to change the five words between the [...]. Issuing the command in LinqPad eats way too much yet 5dw works if the cursor is located at the A.
{ and ( seem to be no-op at this point. Also, closing }, ), ] should behave just like the opening partner...
I'm having issues with the behavior of selected text. For example if I double click on Bob below, your vi emulation is already in edit/change mode.
void Main()
{
string bob = "Bob";
Console.WriteLine("{0}", bob);
}
So if I then type "y" to yank the string "Bob" I end up editing it to "y" instead. In gVim, double click selecting something does just that: selects it. To edit, you still have to type "s" or "c" and as illustrated above, other commands like yank are available. To me this is is a more natural or expected behavior, though admittedly it's hard to argue what "natural" means with mouse inputs and an editor designed in the 1970s.
Can you consider adopting the gVim behavior?
Thanks,
-Vic