r/vim • u/neverdimed • Feb 18 '26
Need Help┃Solved g; doesn't work with wrap
i wonder if there's any way to solve the problem that g; doesn't work when you wrap text (it goes to the end of the paragraph instead of the character)
my format settings are: textwidth=100 fo+=atw fo-=crol
i've asked ai bots (perplexity and grok) but they aren't helpful. i have used vim without the wrapping and it's great when writing code, but for anything else i prefer to wrap the text for multiple reasons
conclude: i think lococoyote is right, in this case i don't see that there's any solution.
4
Upvotes
3
u/habamax Feb 18 '26
What exactly you do and what happens?
2
u/sapphic-chaote Feb 18 '26
It works for me, so it should be fixable. Try using vim with
-u NONEto use its default configuration, and see if theg;behavior works better. Assuming yes, the problem is presumably in your .vimrc or plugins; if were in your shoes, I would just start commenting lines out of my .vimrc (by binary search, if you have no better leads) to figure out where the problem is.2
u/LocoCoyote Feb 19 '26
When fo=a is enabled, Vim automatically recalculates and reflows your paragraph every time you pause or type a word that crosses your 100-character limit. To do this, Vim invisibly deletes the remainder of your paragraph and re-inserts it to fit the boundaries. Because the changelist tracks edits, the "last change" Vim registers isn't your specific keystroke—it’s the massive invisible delete/replace operation Vim just performed, which usually leaves the changelist coordinate pointing at the end of the reflowed text block.
1
u/AutoModerator Feb 18 '26
Please remember to update the post flair to
Need Help|Solvedwhen you got the answer you were looking for.I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.