# Editing long lines



## balanga (Oct 31, 2019)

I'm looking for a text editor which can handle long lines ( >200chars) but show them wrapped within the terminal window without including a continuation character when a file is saved.

Any recommendations? (Apart from vi)


----------



## obsigna (Oct 31, 2019)

editors/nano got soft wrap and hard wrap features. Soft wrap is purely visual, while hard wrap inserts a line break. Normally we want soft wrap. Both can be enabled on the fly by the key sequence ESC,S for soft wrapping and ESC,L for hard wrapping. Here key sequence means press the keys sequentially in the given order. I would have written key combination when I would have meant press the keys at the same time, like CTRL+C.

In order to have the preferred wrapping mode always on, you could place the directive set softwrap in file ~/.nanorc. Soft line wrapping in a terminal editor might be confusing, and it helps to let the editor show the line numbers. This could be achieved by adding set linenumbers to ~/.nanorc.


----------



## ralphbsz (Nov 1, 2019)

Emacs can do it to. The wrap character is only on the screen.

I actually think nearly all editors can do it.


----------



## Phishfry (Nov 1, 2019)

This soft wrap feature does seem to be missing in ee(1)
I use single line entries for my bhyve VM startup script and this can be a pain.


----------



## fluca1978 (Nov 5, 2019)

editors/emacs in my experience can handle even very big files without problems, at least showing problems with files bigger than in other editors.
And of course, provides `M-x toggle-truncate-lines` to visually switch between toggled lines or not.


----------



## diizzy (Dec 8, 2019)

Have a look at micro in `editors/micro`


----------

