Open endowdly opened 6 years ago
I am not super familiar with vimL/vimscript, nor am I familiar with ts. But, I do know C#/F# and js! I am also on a temporary assignment with lots of downtime, so I'll see if I can kludge something together for the extension. I will get started with the contributing guide ;)
@endowdly Did you ever make any progress with this? I would gladly take a stab at it if someone could point me in the right direction. It would be super nice for creating redux actions with something like createStandardAction
.
@AlexPattison sadly I did not make major progress.
I did get the mechanics of the vimscript worked out, however I had a hard time figuring out the 'API' of the extension. I ran into a pretty heavy roadblock when I realized that the coerce
command would have to operate really similarly to the surround
command. The VSCodeVim guys had to do some pretty serious hacking to get that to work in an appreciable way. I was able to get the extension to recognize when we wanted to go into 'coerce' mode, so there's a small victory.
Why don't we have all tpope's plugins in here by default. He's such a legend, and seems like a no-brainer, given all the utility and demand for his plugins
@vegerot Generally because there's only so much we can do in our free time. Pull requests are always welcome.
@vegerot I think there are a couple more issues besides the lack of manpower:
Because the editor is essentially a web-page, the plugin has to do a couple things: maintain a mode state, action state, and record inputs. There's only so many combinations of states and inputs we can do at any given time, and some vim plugins just can't play together well without removing a standard movement or action. ¯\_(ツ)_/¯
That said, I do think abolish is possible to emulate (closely) in its entirety:
If I had more time!
About coerce: So, you see the problem as to get it to work in the keyspace "cr_"? We can use berknams new remapper to make this quite easy, like so:
@RegisterAction
export class ActionCoerceCamel extends ActionCoerceBase {
keys = ['<coercecamel>']; // needs to be all lower case
style: CoerceStyle = 'camel';
}
Plus, users would need one mapping per style (later, it would be nice to be able to auto create these):
nnoremap crm <coercecamel>
...
I found a very good extension that accomplishes abolish-style corrections. Interestingly enough, the author gets it done in the manner I had guessed would be the easiest to do (settings file). If there is a way (through command, like in abolish) to add this to VsVim, then there ya go.
Subvert and the coercion operators are some of my most used features in vim. I can't believe no-one has suggested it yet!?
Abolish may be a difficult thing to emulate, since it adds
iabbrev
commands to the.vimrc
. But, the subvert substitution and the coercion operations are 🔥