kb Posted May 24 Share Posted May 24 How to display line numbering in the nano editor by default? How can I make very long text on a single line fit in the console window of the nano editor? How do I enable text selection? All of these questions will be answered in this topic. First, make sure that you have the nano editor installed. sudo apt-get install nano Next, go to the local configuration file of the nano editor on your linux system. It does not matter whether you are using a desktop or a server distribution. sudo nano ~/.nanorc In this configuration file you can customize the nano editor to suit you. My example: set linenumbers set backup set mouse set indicator set softwrap set linenumbers (Display line numbers to the left of the text area. (Any line with an anchor additionally gets a mark in the margin.)) set backup (When saving a file, create a backup file by adding a tilde (~) to the file’s name.) set mouse (Enable mouse support, if available for your system. When enabled, mouse clicks can be used to place the cursor, set the mark (with a double click), and execute shortcuts. The mouse will work in the X Window System, and on the console when gpm is running. Text can still be selected through dragging by holding down the Shift key.) set indicator (Display a "scrollbar" on the righthand side of the edit window. It shows the position of the viewport in the buffer and how much of the buffer is covered by the viewport.) set softwrap (Display lines that exceed the screen’s width over multiple screen lines. (You can make this soft-wrapping occur at whitespace instead of rudely at the screen’s edge, by using also set atblanks.)) You can find a complete list of settings at https://www.nano-editor.org/dist/latest/nanorc.5.html Note that "softwrap" does not move the line to a new one to fit your text into the console window. Everything stays on one line. Therefore, it does not build a new line. P.S. Vim is Sucks. Quote Link to comment Share on other sites More sharing options...
Recommended Posts