by stevelosh · 15y ago · 0 comments
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.
noremap H ^
noremap L $
Stealing your K-kill idea too!To be honest I never really got around using them but it might a nice addition to my vim usage.
" 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 '#'.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.