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

Add new Operator YankToLastCharacterOfLine #265

Closed
romgrk opened this issue May 3, 2016 · 3 comments
Closed

Add new Operator YankToLastCharacterOfLine #265

romgrk opened this issue May 3, 2016 · 3 comments

Comments

@romgrk
Copy link

romgrk commented May 3, 2016

I was about to open an issue about this and I just realized that the command doesn't even exist for YankToEndOfLine. As always. (This is such a bug in Vim)
I think it would be correct to include shift-Y as y$, it just fits so well with the other operators (C == c$, D == d$, etc)

I gist you here my implementation.

  'romgrk:yank-to-end-of-line': (event) ->
    return if (not window.vim?) # window.vim is attached in my atomrc, 
    state = window.vim.getEditorState this.getModel()
    state.operationStack.run "Yank", target: "MoveToLastCharacterOfLine"

# Though I wrote it this afternoon, might not be accurate.
# I think is doesnt preserve linewiseness.

Oh btw, have you some [n/v/i/o]map function planned to release soon? The only thing I miss from [n]vim is being able to define my keymap easily. Usually I go through obscure ways to make atom work as I want.

t9md added a commit that referenced this issue May 3, 2016
@t9md
Copy link
Owner

t9md commented May 3, 2016

For reference, if you want to extend vmp in your init.coffee.
https://github.com/t9md/atom-vim-mode-plus/wiki/Extend-vmp-in-init-file

For mapping, NO PLAN for syntax sugar.
Atom already provide scope based granular keymap, you can achieve as granular keymap as pure Vim for keymap.

@t9md t9md closed this as completed May 3, 2016
@t9md t9md changed the title Yank to last char of line not working Add new Operator YankToLastCharacterOfLine May 3, 2016
@romgrk
Copy link
Author

romgrk commented May 3, 2016

And would you accept PRs for this? IMO the Atom way feels sluggish compared to vim.
And also it avoids the need to delve in the code for people who do not develop this package… (Like a good part of the users of this package) (:
Basically what I would like to have is some function that I can call in my rc script so I don't have to declare commands for every keybinding, akin to *[nore]map. (Think about the users!)

@t9md
Copy link
Owner

t9md commented May 5, 2016

The answer for this type of question is always "depends on how PR is like", amount of complexity the PR introduces.

I basically don't want to spend my time for feature I don't use.
But I understand your point.
And I have some idea.
But it's better to treat in separate issue.

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