Remapping `d` to always delete to black-hole
See original GitHub issueI used to have the following in my .vimrc
:
" Redirect all delete-operations to black-hole
" Use 'm' ("move") for all cut-operations
nnoremap d "_d
nnoremap m d
What would be the VSCodeVim equivalent? I can’t seem to make it work, I already tried the following:
"vim.otherModesKeyBindings": [
{ "before": ["d"], "after": ["\"", "_", "d"] }
],
"vim.otherModesKeyBindingsNonRecursive": [
{ "before": ["m"], "after": ["d"] },
{ "before": ["m", "m"], "after": ["d", "d"] }
]
This makes the bindings for m
work, but breaks d
…
- Extension (VsCodeVim) version: v0.12.0
- VSCode version: 1.23.1
- OS version: Mac OS 10.13.4
Issue Analytics
- State:
- Created 5 years ago
- Comments:13 (5 by maintainers)
Top Results From Across the Web
Cut and copy : Blackhole and default register assignment
First off, I think your first mapping is unnecessary. Since the second d is in operator mode, it does not get remapped to...
Read more >Not cut the text, just delete. Config. : r/vim - Reddit
Does anyone have a vim config to delete text but NOT cut it? ie. ... remap the d command to delete to the...
Read more >In Vim is there a way to delete without putting text in the register?
To delete something without saving it in a register, you can use the "black hole register": "_d. Of course you could also use...
Read more >BS to the Black Hole - Latest Posts - Why, Scott, WHY?!?
Sometimes, I want to delete text without worrying about blowing away the unnamed register. This can be done by prefixing a normal or...
Read more >Vector Remap Language (VRL)
Parse the raw string into JSON; Reformat the time into a UNIX timestamp; Remove the username field; Convert the message to lowercase. This...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
PR is up! I found that our remapper has other issues mentioned in the PR. I don’t think any of those are regressions, so I think we can move forward with this solution.
When the PR is merged, the following vscode setting should allow e.g.
dd
anddw
to become"_dd
and"_dw
, which work correctly now with our remapper.Hey @shawnaxsom. Thank you for jumping on this. I’m one of those rare designers who fell in love with Vim because of how custom i could make it. As primarily a designer this patch was not something I could have contributed myself and it’s great to see this plugin being so well maintained.
I just wanted to say thanks. I do some open source work myself and know it can sometimes be rough dealing with issues. Know that your work helps me be more productive in the editor I prefer and I appreciate the contribution.