kana / vim-textobj-line

Vim plugin: Text objects for the current line
http://www.vim.org/scripts/script.php?script_id=3886
178 stars 7 forks source link

[Recommendation] Selecting entire line with `V` is far more useful. #3

Open Rybadour opened 10 years ago

Rybadour commented 10 years ago

In my opinion this plugin's al text object is only really useful when it selects the entire line and new line character. That way dal removes the line entirely.

kana commented 10 years ago

As I wrote in the document, the purpose of this text object is to select a line characterwise. I will never accept your suggestion because it is completely against the purpose.

And built-in operators can target a line linewise with dd, yy, etc. Why not use these standard key mappings?

blasco commented 5 years ago

I agree with Rybadour. My reason is consistency. I want to be able to express it just as I think (delete a line). I'm already used to dd, yy, etc. But the concept of "a line" is more general and easier to teach. My solution to this is to define 3 different modifiers:

i: The text in the line, same as in here I: The text in the line plus trailing whitespaces a: the complete line, I should end in the next line.

Another reason that I have is to be able to repeat non standard operators:

I can do 6dd to delete 6 lines, I cannot do 6(custom operator a line) because it does 6 times the same thing over the same line. With a proper "a line" object we could do for example "6gUal" to capitalize 6 lines and it should work.

I'm trying to add this functionality, what are your thoughts?

kana commented 5 years ago

@blasco Supporting count like 6dal is a completely different problem, so it’s not a valid reason to change the definition of al as I mentioned above.