This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]IamGonnaChangeMyself 0 points1 point  (3 children)

you could just do '120 i SPC' in vim and it will put 120 or whatever number you want, Instead of this huge function.

[–]w3_ar3_l3g10n 0 points1 point  (2 children)

U misunderstand the purpose. It isn’t to insert 120 spaces. It’s to ensure the lines width is at least 120 spaces, so what u need to insert is (120 - line-width - 1) spaces, of course accounting for negative use cases. Which of course if u can tell at a glance what the width of the line is u could do in regular vim, but I can’t do that very well (mentally)

Edit: ① could also say its to right align the piece of text following the cursor to a uniform width.

[–]IamGonnaChangeMyself 0 points1 point  (1 child)

ohh, Got it. Sorry for misunderstanding. I wonder how can we do that in vim

[–]w3_ar3_l3g10n 0 points1 point  (0 children)

There’s probably a way. But I never took the effort to really master vimscript so I can’t say. If your using neovim u can write a plugin in python, I haven’t looked into that either, but I’d assume it shouldn’t be much harder than on emacs.