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

Added ability to register commands using simple strings (fixes #2806) #2807

Merged
merged 6 commits into from
Jul 10, 2018

Conversation

71
Copy link
Contributor

@71 71 commented Jul 5, 2018

What this PR does / why we need it:
Enables the syntax specified in #2806 to work.

Which issue(s) this PR fixes
#2806.

Notes:
This simply makes the "command" object in IKeyRemapping be either the old object or a string. If it's a string, we then interpret the string as { command: str; args: [] }.

@xconverge
Copy link
Member

This looks good to me, I like the simplicity to the user

I think a note in the readme as an example would be nice

]
}
]
"vim.normalModeKeyBindingsNonRecursive": [
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome! Would you mind updating the other examples to use the more simplified version?

I'd also be sure to leave examples of how to specify multiple commands and such with both notations.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you have an example of a command which also take arguments? I tried finding one to show a "complete" object but didn't succeed.

In may case I'll change the README in a way that suggests the string is the default, and then when the command takes additional arguments you can use the fully fledged object.

@71
Copy link
Contributor Author

71 commented Jul 7, 2018

Alright, I changed all the examples in the README to use that syntax, and also added a command that uses arguments to show the difference (git.clone with this repository).

@xconverge xconverge merged commit e12c6f3 into VSCodeVim:master Jul 10, 2018
@xconverge
Copy link
Member

Thanks!

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

Successfully merging this pull request may close these issues.

3 participants