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

Request: Add new setting or command to use x without going to clipboard #901

Closed
calebmeyer opened this issue Oct 6, 2017 · 2 comments
Closed

Comments

@calebmeyer
Copy link

Previously, @t9md suggested that I could delete using x without going to the clipboard by extending the DeleteRight class in my init.coffee, like this:

consumeService = (packageName, providerName, fn) ->
  disposable = atom.packages.onDidActivatePackage (pack) ->
    if pack.name is packageName
      service = pack.mainModule[providerName]()
      fn(service)
      disposable.dispose()

consumeService 'vim-mode-plus', 'provideVimModePlus', (service) ->
  {Base} = service
  DeleteRight = Base.getClass('DeleteRight')
  class DeleteRightWithBackholeRegister extends DeleteRight
    @commandPrefix: 'vim-mode-plus-user'
    @registerCommand()
    execute: ->
      @vimState.register.setName('_')
      super

This has worked well for me, but it will be broken by #895. The solution is to convert to ES6 (from coffeescript) in init.js

In the meantime, I was wondering if we could enhance VMP to make this a setting instead of an extension. As a setting, it would be similar to the existing "Don't update register on change or substitute" setting.

@t9md
Copy link
Owner

t9md commented Oct 6, 2017

The JS version of above extension is almost identical to example in wiki below.

https://github.com/t9md/atom-vim-mode-plus/wiki/ExtendVimModePlusInInitFile#advanced-deletewithbackholeregister

Also here is my init.js as example.

https://github.com/t9md/dotfiles/blob/master/atom/init.js

Finally I will consider your suggestion to make this behavior configurable via setting 👍

@calebmeyer
Copy link
Author

I didn't realize this was in the wiki! Thank you so much for the link!

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

2 participants