News for hackers. Stuff that matters.
Re:Vim Text Objects : The Definitive Guide by stevelosh on Monday October 17, 2011 @03:40PM (#3122084)
Vim's text objects are one of the fundamental things that make using it so awesome.

I've had a bit of code in my vimrc that creates "next/previous" text objects for a while. Someone came along and helped me make it more compact a while ago, but I can't remember who.

It lets you use "din(" for "delete in next parens (on the current line)", which saves a bit of typing.

https://bitbucket.org/sjl/dotfiles/src/1b6ffba66e9f/vim/.vim...

Maybe I should turn it into a pathogen-installable plugin one of these days.

Re:Vim Text Objects : The Definitive Guide by s3graham on Monday October 17, 2011 @11:01PM (#3123663)
Ah, I've loved this for ever! I didn't know other people did that too. :)

    noremap H ^
    noremap L $
Stealing your K-kill idea too!
Re:Vim Text Objects : The Definitive Guide by rane on Tuesday October 18, 2011 @05:24AM (#3124526)
You don't find the default H/M/L that useful?

To be honest I never really got around using them but it might a nice addition to my vim usage.

Re:Vim Text Objects : The Definitive Guide by solutionyogi on Monday October 17, 2011 @07:26PM (#3122950)
Wow. That's a huge vimrc config (1350 lines!) filled with gems, I am going to go through it and steal them for my vimrc! :)
Re:Vim Text Objects : The Definitive Guide by crazydiamond on Tuesday October 18, 2011 @02:57AM (#3124188)
Not clear what this does:

    " Stop it, hash key.
    inoremap # X<BS>#
I tried it too. It's in insert mode, so it types an X, backspaces and then types a '#'.
Re:Vim Text Objects : The Definitive Guide by looklookatme on Tuesday October 18, 2011 @04:36AM (#3124414)
I've got something similar in mine; The use-case is to allow indented comments (in languages where '#' is the comment delimiter)

Normally, when using auto-indent/smart-indent, pressing '#' on a blank line will change the column to zero, deleting any existing whitespace. By typing a character and deleting it, you override this behavior, allowing you to have comments at the same indentation level as the rest of the code.

Re:Vim Text Objects : The Definitive Guide by crazydiamond on Wednesday October 19, 2011 @12:24AM (#3128688)
Steve You have a line regarding setting "fuoptions". That only works in mac_vim, so you need to put that in a condition.
Re:Vim Text Objects : The Definitive Guide by iamnearlythere on Friday October 21, 2011 @05:41AM (#3139089)
Could it be modified to just use di( or dib etc, and still not break anything essential?