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

Allow to rebind camelCase motion #3756

Open
ghost opened this issue May 10, 2019 · 8 comments
Open

Allow to rebind camelCase motion #3756

ghost opened this issue May 10, 2019 · 8 comments

Comments

@ghost
Copy link

ghost commented May 10, 2019

Is your feature request related to a problem? Please describe.
I use VSCodeVim in conjonction with this set of settings to replicate a spacemacs setup : https://github.com/VSpaceCode/VSpaceCode
However, the sequence <leader>+<w>, <leader>+b and <leader>+<e> are already dedicated to start some commands.

Describe the solution you'd like
A set of settings to rebind the access to these motion.

@jpoon
Copy link
Member

jpoon commented Jun 22, 2019

If you don't use camelCaseMotion you can disable it? https://github.com/VSCodeVim/Vim#camelcasemotion

@genesy
Copy link

genesy commented Jun 22, 2019

The issue is about allowing to use camelCaseMotion with other keys. How do I use camelCaseMotion if I disable it?

For my use case I want camelCaseMotion to be enabled without needing to prefix sequence with <leader> and use it for w,b, and e keys automatically.
@jpoon

@dakom
Copy link

dakom commented Aug 11, 2019

I was going to file a new issue but I think it's a dup of this... for example, instead of <operator>i<leader>w to operate on the camelCase section, I'd like it to be just <operator>w. big-W could default to non-camelCase

(e.g. if the cursor is at the beginning of the word, d-w should delete only Html in HtmlButtonElement)

@genesy
Copy link

genesy commented Aug 11, 2019 via email

@dakom
Copy link

dakom commented Aug 15, 2019

Without knowing the code base, isn't it as simple as making this array configurable?

keys = ['i', '<leader>', 'w'];

@jbriales
Copy link

I was also looking how to customize bindings for these operators. Concretely I wanted to use w instead of <leader>w, etc.
It seems remapping via settings works fine:

"vim.normalModeKeyBindingsNonRecursive": [
  {"before": ["w"], "after": ["\\", "w"]},
  {"before": ["b"], "after": ["\\", "b"]},
  {"before": ["e"], "after": ["\\", "e"]},
],
"vim.operatorPendingModeKeyBindingsNonRecursive": [
  {"before": ["i","w"], "after": ["i", "\\", "w"]},
]

@coindegen
Copy link

I was also looking how to customize bindings for these operators. Concretely I wanted to use w instead of <leader>w, etc. It seems remapping via settings works fine:

"vim.normalModeKeyBindingsNonRecursive": [
  {"before": ["w"], "after": ["\\", "w"]},
  {"before": ["b"], "after": ["\\", "b"]},
  {"before": ["e"], "after": ["\\", "e"]},
],
"vim.operatorPendingModeKeyBindingsNonRecursive": [
  {"before": ["i","w"], "after": ["i", "\\", "w"]},
]

This would work, except I already have my <leader>w rebound to this:

  "vim.normalModeKeyBindings": [
    {
      "before": ["leader", "w"],
      "commands": ["workbench.action.files.save"]
    }
  ],

Would be nice to either be able to remap these key bindings, or issue them using something like:

      "commands": [
      {
        "command": "extension.vim_CamelCaseMotion_w"
      }
    ]

@roachsinai
Copy link

commad like extension.vim_CamelCaseMotion_w +1

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

No branches or pull requests

7 participants