Reputation: 1002
When I am programming in Vim, I would like to prevent line breaking within a string literal. In other words, with set textwidth = 80
testVariable = myFunction(a=var1, b=var2, c=var3, text="This should not break to
the next line but does", end="this should be on the
next line")
should instead wrap as follows:
testVariable = myFunction(a=var1, b=var2, c=var3, text="This should not break to the next line but does",
end="this should be on the next line")
Are there vimrc options or plugins that I can use to accomplish this? If it matters, I am programming in python.
Upvotes: 3
Views: 615
Reputation: 820
There's no built-in way to prevent wrapping in specific cases, but you can certainly make your life easier by adding set formatoptions+=b
to your vimrc. 'formatoptions'
describe how Vim formats the text. b
there means that Vim will only split lines that were shorter than 'textwidth'
to begin with.
With that, your workflow will look like this:
'textwidth'
.)Upvotes: 1