By default, I think my vimrc setttings enable the auto-wrapping. However, sometimes, I would like to see text lines are not wrapped. Is there any command I toggle the text line wrapping enabled and disabled? This would avoid me to exit and to change settings.
Change tilde (~) color in Vim
Quicker way to enter ex mode in vim?
How do I get Vim to treat underscores in a string as a word break?
This will toggle line wrapping..
what does ^A stand for in vim
More about using ! (bang) to alter commands can be found at:.
How to “apply” backspace characters within a text file (ideally in vim)
Vim 7.2 hangs on startup, “killall vim” fixes it
What are the typical use cases for vi?
Vim: Combining autocmd?
Then map a key (such as F9) to call this function, like so:.
:function ToggleWrap() : if (&wrap == 1) : set nowrap : else : set wrap : endif :endfunction
Whenever you press F9, it should toggle your wrapping on and off..
map <F9> :call ToggleWrap()<CR> map! <F9> ^[:call ToggleWrap()<CR>
There is also the
linebreakoption that controls whether wrapped text is broken at word boundaries or not..