Skip to content
This repository has been archived by the owner on Oct 4, 2021. It is now read-only.

Implement Repeated Actions in Vi Mode #293

Closed
wants to merge 24 commits into from
Closed

Conversation

rcorre
Copy link
Contributor

@rcorre rcorre commented May 27, 2013

In Monodevelop's Vi mode, you may now prefix actions with one or more digits to allow for repeated commands.
For example, 3dd deletes three lines, 25k moves the caret up 25 lines, 3cw deletes three words and enters insert mode.
The following command types now support numbered repetition:
Basic Movement (h,j,k,l,w,b)
Delete (dd, dj, dk)
Change (cc, cj, ck)
Yank (yy, yj, yk)
Indent (<< or >>, also < or > followed by j or k)
Execute Macro (@)

rcorre added 24 commits May 24, 2013 19:24
Can delete multiple lines moving upwards or downwards.
Potential issue: Check for upward or donward movement is based
on unicode key, not action.
dj and dk actually delete an additional line.
dj deletes 2 lines, 2dj deletes 3, ect.
Conflicts:
	main/src/core/Mono.Texteditor/Mono.TextEditor.Vi/ViMode.cs
Can now yank multiple lines with commands like 3yy, 5yj, 2yk.
Bug: The caret resets to the line start after pasting a
yanked line (should reset to first non whitespace)
Adds support for indentation movement commands such as 4<j and >3k.
Macros can be repeated by preceding @ with a number.
@ghost ghost assigned mhutch May 29, 2013
@jstedfast
Copy link
Member

@mhutch could you review this?

@rcorre
Copy link
Contributor Author

rcorre commented Jun 19, 2013

I made these additions before I realized the new vi mode was in progress.
If you're committed to ditching the old vi mode, I could close it so you don't waste your time reviewing something that won't be used (I know its a pretty large pull request).
However if you think it might be useful I'll leave it up.

@mhutch
Copy link
Member

mhutch commented Jun 25, 2013

I had a quick scan and it looks good. There's one problem though - it doesn't match the MD code style. If you'd be willing to fix the style (ideally squashed/edited into each commit) I'll land it. It doesn't do any harm to have these improvements while the new mode is in progress :)

@rcorre
Copy link
Contributor Author

rcorre commented Jun 29, 2013

Just read over the coding guidelines (probably should have done that earlier...)
http://www.mono-project.com/Coding_Guidelines says to use 8 space tabs, but
http://monodevelop.com/Developers says to use 4 space tabs - do you know which it is?
Other than that, the only things I've seen that don't coincide are putting the opening bracket on the same line as a property or conditional and using a space before () or [].

I've never tried rewriting history, but I'll give it a shot. If that doesn't work out, though, would it be acceptable to just have 1 reformatting commit?

@Therzok
Copy link
Contributor

Therzok commented Jun 30, 2013

Take a look at other files and how they're written.

MD coding guidelines should be used, not the Mono ones. It explains in the 2nd link pretty clearly.

Have fun! :D

@rcorre
Copy link
Contributor Author

rcorre commented Jul 1, 2013

I reformatted the code in each commit and made a separate pull request.
If you'd rather, I could force push to my master branch to update this pull request, but I figured it would be cleaner to put in a separate request.

@wongjustin99
Copy link

Thanks for making this. I was having a hard time with MonoDevelop.

@kanonji
Copy link

kanonji commented Jun 6, 2014

Will this or #319 not merge?
I want yank multilines.

@rcorre
Copy link
Contributor Author

rcorre commented Jun 8, 2014

I made this awhile ago and I'm not really sure what the status is now. As you can see from the comments above, there was a new vi mode framework in progress at the time I made this. I'm not sure how far that has come or whether this would still merge as I haven't been using (or developing for) Monodevelop lately.

@kanonji
Copy link

kanonji commented Jun 11, 2014

Thanks for replying.

https://github.com/kanonji/monodevelop/compare/merged-293

I have tried to merge this PR on my forked repos. There are no any conflicts.
I don't think the PR is much different from when you sent the PR...
Anyway I hope this PR get merged and I would yank multilines before too long.

alextsui05 added a commit to alextsui05/VimAddin that referenced this pull request Jun 27, 2014
@mhutch
Copy link
Member

mhutch commented Jul 8, 2014

My profound apologies for being such a poor maintainer of the vi addin and letting your pull request languish so long. Unfortunately vi mode was an old side project for me and I have not had the time recently to do a proper review of the PR, let along work on it myself, and I did not want to risk regressions.

Fortunately another another contributor has factored out the vi mode into a standlone addin which can be updated independently of MD/XS, and has merged this pull request:
alextsui05/VimAddin@48570c5

The standalone vim addin is already available to be installed from the addin manager.

I think it's best if I officially deprecate the built-in vi mode in favor of the standalone addin. I'll remove it soon.

@mhutch mhutch closed this Jul 8, 2014
nosami added a commit that referenced this pull request May 23, 2016
filter completions by first character
DavidKarlas pushed a commit that referenced this pull request Mar 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants