Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Surround commands #53

Open
aioutecism opened this issue Mar 20, 2016 · 6 comments
Open

Surround commands #53

aioutecism opened this issue Mar 20, 2016 · 6 comments
Labels

Comments

@aioutecism
Copy link
Owner

Support surrounding commands like https://github.com/tpope/vim-surround.

@ghost
Copy link

ghost commented Mar 25, 2016

This should be done by first supporting custom bindings since Vim doesn't ship with this and it comes from an extension, right?

... especially since vim-surround has made some design decisions like using ys for something where yanking isn't really the point and also stuff like:

[Hello] world!

Let's make that braces and add some space (use } instead of { for no space): cs]{

{ Hello } world!

... where this special distinction between opening and closing braces is pretty un-Vim-like.

@aioutecism
Copy link
Owner Author

Yes, you're right.
However, I haven't find an easy way for users to define custom keybindings using current VSCode's APIs.
Anyway, I'm creating this issue just as a backlog.

BTW, custom mapping is issued #9.

@dagadbm
Copy link

dagadbm commented May 7, 2018

will surround ever be implemented?
if someone wanted to implement it where should that person start?

@aioutecism
Copy link
Owner Author

@dagadbm
Yes.
You can start by setting up the develop environment following guide on VSCode’s site. And get a general idea of the current implementation by reading from Dispatcher.ts.
Feel free to ask questions.

@jackfranklin
Copy link
Collaborator

@alisonatwork what do you think about supporting surround mappings? It's probably one of the things I miss the most - but also I can see the argument that it's not for a Vim emulator to implement Vim plugin settings.

I don't use all of the mappings but I miss being able to hit cs'" or cs({. And given we have them defined as text objects I don't think supporting cs is a load of work. I'm happy to take a stab at it!

WDYT?

@alisonatwork
Copy link
Collaborator

Hi @jackfranklin sorry for the slow reply. This sounds like a good idea to me! Personally i've never used this feature before, but i can see the benefit. Definitely happy to code review and merge if you can put a PR together.

One thing i am not sure about is if we should have a config option for these extensions to the standard vim command set. I don't know if we have any vim plugin behavior built into the standard code yet, but seeing as @aioutecism originally opened the ticket, i imagine they're fine with including it. If it doesn't conflict with any of the standard commands and there are people who are keen to use it, i think it's reasonable to add.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants