Disable text wrapping in nano

Word wrapping in nano text editor can make scripts and files fail to run/parse properly. This is especially a problem with nano in Cygwin, where a simple edit can goof up a config or script by adding unwanted newlines.

Disable text wrap in nano

add to ~/.nanorc

set nowrap

general nano setup

In general on any operating system, here is my entire ~/.nanorc:

set constantshow
set tabsize 4
set nowrap
set tabstospaces

These lines:

  • show line and column
  • make tabs into 4 spaces
  • disable wrapping

syntax highlighting

Nano syntax highlighting is enabled with include statements in ~/.nanorc.

Tags: ,


Written by Michael Hirsch, Ph.D. //