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

Feature Request: let an Oni2 command that sends vimscript be writable in the keybindings file #807

Closed
snoblenet opened this issue Oct 3, 2019 · 3 comments · Fixed by #2397
Labels
A-extension Area: Extension/plugin integration, vscode or VimL enhancement New feature or request

Comments

@snoblenet
Copy link

Hi. Exciting project. I was happy to buy the lifetime license to support future development.
It's not yet ready for me to use for actual work so I don't have extensive feedback but I do have two big feature requests which I'm posting in two tickets. I might note some of the glitches etc I've encountered later but I'm sure you're overwhelmed with those now.

Feature Request: let an Oni2 command that sends vimscript be writable in the keybindings file

I picture myself then doing something like this:

{
    "bindings": [
        { "key": "<⌘-`>", "command": "sendVimscript", "args": [[":bnext"]] },
        { "key": "<S-⌘-`>", "command": "sendVimscript", "args": [[":bprev"]] },
        { "key": "<⌘-W>", "command": "sendVimscript", "args": [[":q!"]] },
    ]
}
@CrossR CrossR added the enhancement New feature or request label Oct 3, 2019
@CrossR
Copy link
Member

CrossR commented Oct 3, 2019

This sounds like it goes alongside and possibly is related to the new PR: #805

I think that this further syntax / a similar syntax is potentially useful still since I think there is some keybinds that vim can not distinguish between, that we can distinguish between at the Oni2 layer. This would allow the binds that vim can't understand to be used still.

@bryphe
Copy link
Member

bryphe commented Oct 12, 2019

Sounds like a great idea to help merge the Oni2 <-> vim worlds!

How would you feel about a convention like:

{
    "bindings": [
        { "key": "<⌘-`>", "command": ":bnext" },
        { "key": "<S-⌘-`>", "command": ":bprev"},
        { "key": "<⌘-W>", "command": ":q!" },
    ]
}

where if the command starts with a :, we assume that it is a VimL command? Would that help simplify, or be confusing?

@snoblenet
Copy link
Author

Sounds good to me. And I presume the <CR> at the end of the mapping is implied without the user having to specify it specifically.

@glennsl glennsl added the A-extension Area: Extension/plugin integration, vscode or VimL label Nov 18, 2019
bryphe pushed a commit that referenced this issue Sep 7, 2020
…2397)

A simple change that allows keybindings to invoke ex commands directly, and could address quite a few of the requests in #1423. The downside of doing this instead of implementing proper commands is of course that they won't be discoverable through the command palette, but this doesn't prevent proper commands to be added either, so I think it might be a nice convenient stop-gap solution to unblock people at least.

Example:

```
  {key: "kk", command: ":split", when: "editorTextFocus"}
```

Let me know if you think this is a viable approach @bryphe, then I'll add a few integration tests before it's merged.

Fixes #807
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-extension Area: Extension/plugin integration, vscode or VimL enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants