How to insert at the very left of the line in vim? -
imagine editing code in vim, , wish comment out bar(); line:
while (foo()) { bar(); baz(); } if press i# while on line, this:
while (foo()) { #bar(); baz(); } however, our coding standards should have done this:
while (foo()) { # bar(); baz(); } i can work around pressing 0i# instead (or putting map 0i in .vimrc more permanent fix) not repeatable . repeats i rather 0i.
many other editors have options make home not "smart" , go column 0 rather trying work indentation. i've tried searching docs, have drawn blank — is there way in vim?
alternatively, there way make bound command atomic, repeating . repeats whole thing rather last command of bound sequence?
thanks
use gi instead of i.
from :help gi :
gi gi insert text in column 1 [count] times. {not in vi}
Comments
Post a Comment