vi mode - experimental build

2»

Comments

  • I agree that there is no "correct" behavior in this case, because vi was designed for use without a mouse or shift-arrow combinations. I experimented with both options when writing the emulator and in the end settled for it behaving like a windows editor when using mouse or windows-style shift+arrow combinations (which is also how the vi plug-in for Visual Studio Code works). I think it makes sense because the biggest use-case for the mouse and shift+arrows is not those already intimate with vi, who would instead type something like /bob, but users transitioning to vi, whose would use the mouse and shift+arrow combinations (followed by overwriting with new text) out of muscle memory. Being in that category myself, I found the other behavior so annoying that I would never attempt to transition.

    Bear in mind that visual mode works as in vim, so if you type vwy, that will yank a work.
  • Which Visual Studio vi plug-in are you using? I'm using VsVim (https://marketplace.visualstudio.com/items?itemName=JaredParMSFT.VsVim).

    As for what folks intimate with vi would do, I think the jury is out. I've been using vi since transitioning from ed in the late '70s. On a dumb terminal (emulator since no actual dumb terminals exist anymore) connected to a unix system, yes I'd type /bob. In VS, I use ReSharper's ^T navigation a lot but just as often, if I see a bit of code I want to edit I'll navigate with the mouse.

    I'll keep a more careful eye on the differences between gvim, VsVim and the LINQPad emulation. Playing some more it appears a single click navigation is the same so maybe some of my issue is caused by double clicking to select vs simple navigation.

    Thanks,
    -Vic
  • Another search issue: there is no support for escaping characters or beginning of line. I see there is a search support for end of line:

    void Main()
    {
    Console.WriteLine("Bork");
    Bork();
    }

    static void Bork()
    {
    Console.WriteLine("Bork bork");
    }
    // Define other methods and classes here

    -----
    My specific searches are (no quotes):
    "/\/\/" - find the "//" comment
    "/^static" - find the "static" at the beginning of the line
    "/e$" - finds "here"
    "/;$" - does not find ; at EOL
    "/\;$" - finds ; at EOL (so escaping works for some characters, though I can't remember ever escaping ";").
    "/\e" - doesn't find "e"

    -Vic

  • Thanks Vic, will fix for next build.
  • Ugh. Joe I was using SQL query language. Changing to C# fixes the behavior so thanks for that! :smiley:

    With that said, please consider implementing the same behavior for the closing braces, brackets, parens, etc. Thanks again.

    --Greg
  • VG
    should select the current line and all following lines, but it misses the last line of the file. Using the mouse to select text, vi thinks I'm in insert mode when I hit y for yank it instead overwrites the block with a y
  • Thanks for the heads-up. VG should now work correctly in the new beta.
  • Not sure what's going on here but this is weird. Starting with this text:

    string tsSymbol;
    double newValue;

    tsSymbol = "xxxxxxxx Index"; newValue = 157.1750;

    navigate to start of "tsSymbol =" line. Type: "f7cf;" The "7.1750;" text is deleted but the cursor is left between the remaining 1 and 5. It should be after the 5.

    Any plans to include vi editing in an upcoming release? As always, thanks for all your work on LINQPad.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!