Normally, In vi editor, when we write long lines. It reaches beyond the limit. To solve this , we use fold command, But fold command only work on already created file. No doubt it, wrap text upto specified width. But it effect your text. Another way to wrap text is to use :set colorcolmn=72 after ESC in vi editor. Now this command put line at 72 width, you have to press enter , when 72 limit reaches. we can say, it s manual text wrapping. But these two are not very good, Because these does not provide atomatic text wrapping in any editor. Here I provide you soltion to set automatic text wrapping. In this case, you don’t have a need to press enter after 72 limit. It will place your cursor in next line when 72 lmit reaches.
Step for automatic text wrapping:
Open ~/.vimrc file
$ gksudo gedit ~/.vimrc
Add following line in ~/.vimrc.
Close ~/.vimrc file. To check text wrap, create demo file.