-
-
Save duff/615695 to your computer and use it in GitHub Desktop.
In your editor of choice, | |
Convert the following line: | |
context "when the transaction is successful", :focused => true do | |
To: | |
context "when the transaction is successful" do | |
Assume the cursor is on the comma. |
austin - excellent. I wonder if a plugin would be a good way to distribute it. Also wonder if your cool indent text object could be in a plugin to pull it out of my .vimrc.
D'oh. That's why I often use visual mode so I don't have to think. Counting words doesn't work.
I might also do:
dtd.
after I noticed I didn't actually delete to the d that I wanted. :) I love the period operator.
Jimmy - Yup. I use visual mode a bunch as well. I learned the / trick when deleting something on the same line from @spicycode. It's nice because it acts a bit like visual mode and works even if there's more than one of the thing you're looking for (since you can keep typing what you're looking at and it'll eventually be highlighted).
I haven't done much counting of things either, but I'm going to experiment with the WORD counting a bit since I haven't tried it. I'm wondering if my brain'll just know how many WORDS there are (when there's only a few).
My first pass at the text object: http://github.com/austintaylor/vim-commaobject
It handles the case you show (da,
will work anywhere between the comma, and the end), but it's still pretty easy to confuse it with nested lists. There's a list of caveats in the readme.
The indent object: http://github.com/austintaylor/vim-indentobject
NICE. Your indent object plugin helped me delete a ton of stuff. I love it.
http://github.com/duff/dot_vim_directory/commit/2cb175deaa1f6a6a10e0dad26292a0b6d4e59424
Austin - OK. The commaobject is outstanding. I just sent you a pull request.
Shadowing is only a problem for prefixes. Since text objects are always prefixed with an action, they essentially have their own key space.