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

(vim mode) Default register for select, delete & change #20280

Closed
1 task done
tlvenn opened this issue Nov 6, 2024 · 2 comments
Closed
1 task done

(vim mode) Default register for select, delete & change #20280

tlvenn opened this issue Nov 6, 2024 · 2 comments
Labels
feature [core label] setting Feedback for preferences, configuration, etc vim

Comments

@tlvenn
Copy link

tlvenn commented Nov 6, 2024

Check for existing issues

  • Completed

Describe the feature

Coming from neovim, I am used to https://github.com/gbprod/cutlass.nvim and the way it overrides the following keys to always use the black hole register: c, C, s, S, d, D, x, X.

It also add a proper cut operator key which is super useful.

Maybe to keep it simple, we could configure the default register used by vim operators like:

registers = {
    select = "_",
    delete = "_",
    change = "_",
  }

Environment

NA

If applicable, add mockups / screenshots to help present your vision of the feature

No response

@tlvenn tlvenn added admin read feature [core label] labels Nov 6, 2024
@JosephTLyons JosephTLyons added vim setting Feedback for preferences, configuration, etc and removed triage labels Nov 10, 2024
@ConradIrwin
Copy link
Member

@tlvenn Since #20277 you can achieve this with:

[
  {
    "context": "vim_mode == normal || vim_mode == visual",
    "bindings": {
      "c": ["workspace::SendKeystrokes", "\" _ c"],
      "shift-c": ["workspace::SendKeystrokes", "\" _ shift-c"],
      "d": ["workspace::SendKeystrokes", "\" _ d"],
      "shift-d": ["workspace::SendKeystrokes", "\" _ shift-d"],
      "s": ["workspace::SendKeystrokes", "\" _ s"],
      "shift-s": ["workspace::SendKeystrokes", "\" _ shift-s"],
      "x": ["workspace::SendKeystrokes", "\" _ x"],
      "shift-x": ["workspace::SendKeystrokes", "\" _ shift-x"]
    }
  }
]

Happy to accept PRs to add this to the documentation, but I don't think we need a different way to configure this.

@HarshNarayanJha
Copy link
Contributor

Hey @tlvenn we also have this setting in zed that allows to configure when to use system clipboard. It might be useful for you, since I was looking for the same thing.

https://zed.dev/docs/vim#changing-vim-mode-settings

"vim": {
    "use_system_clipboard": "on_yank",
  },

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature [core label] setting Feedback for preferences, configuration, etc vim
Projects
None yet
Development

No branches or pull requests

4 participants