t9md / atom-vim-mode-plus

vim-mode improved
https://atom.io/packages/vim-mode-plus
MIT License
1.4k stars 111 forks source link

Is there a way to delete without register? #892

Closed czhang03 closed 6 years ago

czhang03 commented 7 years ago

Check list

Question

Typically when I use x ,d, or c, I will pip my result into black hole register (or any non-default register)

nnoremap d "_d
nnoremap dd "_dd
vnoremap d "_d
vnoremap p "_dP
nnoremap c "_c
vnoremap c "_c  

is there a way to do that in vim-mode-plus?

Sorry I am not familiar with atom or coffee script. I tried to figure it out my self, but failed...

dylnmc commented 7 years ago

similar (solved): https://github.com/t9md/atom-vim-mode-plus/issues/473

apparently, "_dd should "yank" to black hole register. I didn't thoroughly read, but you might have to prepend "_ before any 'cut' command that you want to be yanked to black hole.


edit: looks like you can specify in init.coffee:

keystroke:
    commands: [
       {
           name: "set-blackhole-register"
           keystroke: '" _' #
        }

and in keymap.cson:

'atom-text-editor.vim-mode-plus.normal-mode':
"\\": "keystroke:set-blackhole-register"

Then, according to T9:

"Then \ d d will delete line but not update your register. Since \ keystroke use blackhole register(_)."


if solved, please close.

cheers