× Search About Posts Code Music Links
Blank Try
experiment
lots
learn
more

Nano

Updated on
Last site update: 8 May 2024

Nano is a CLI editor like vim that comes with bash. It’s with both Linux and the git-bash program.

Nano is supposedly easier to learn than vim.

You can open or create a file using nano path/to/file and start editing.

The menu use ^G for instance where the ^ just means press Ctrl key at the same time.

Using ^x is to exit where you are. You might be prompted to save first. You may need to press it twice to say exit from help then exit the program.

To paste from outside of Nano the regular ^v works. You might need to press ^J after to sort out the line.

Nano help

Also see the official site: nano-editor.org

 1Usage: nano [OPTIONS] [[+LINE[,COLUMN]] FILE]...
 2
 3To place the cursor on a specific line of a file, put the line number with
 4a '+' before the filename.  The column number can be added after a comma.
 5When a filename is '-', nano reads data from standard input.
 6
 7 Option         Long option             Meaning
 8 -A             --smarthome             Enable smart home key
 9 -B             --backup                Save backups of existing files
10 -C <dir>       --backupdir=<dir>       Directory for saving unique backup files
11 -D             --boldtext              Use bold instead of reverse video text
12 -E             --tabstospaces          Convert typed tabs to spaces
13 -F             --multibuffer           Read a file into a new buffer by default
14 -G             --locking               Use (vim-style) lock files
15 -H             --historylog            Save & reload old search/replace strings
16 -I             --ignorercfiles         Don't look at nanorc files
17 -J <number>    --guidestripe=<number>  Show a guiding bar at this column
18 -K             --rawsequences          Fix numeric keypad key confusion problem
19 -L             --nonewlines            Don't add an automatic newline
20 -M             --trimblanks            Trim tail spaces when hard-wrapping
21 -N             --noconvert             Don't convert files from DOS/Mac format
22 -O             --bookstyle             Leading whitespace means new paragraph
23 -P             --positionlog           Save & restore position of the cursor
24 -Q <regex>     --quotestr=<regex>      Regular expression to match quoting
25 -R             --restricted            Restrict access to the filesystem
26 -S             --softwrap              Display overlong lines on multiple rows
27 -T <number>    --tabsize=<number>      Make a tab this number of columns wide
28 -U             --quickblank            Wipe status bar upon next keystroke
29 -V             --version               Print version information and exit
30 -W             --wordbounds            Detect word boundaries more accurately
31 -X <string>    --wordchars=<string>    Which other characters are word parts
32 -Y <name>      --syntax=<name>         Syntax definition to use for coloring
33 -Z             --zap                   Let Bsp and Del erase a marked region
34 -a             --atblanks              When soft-wrapping, do it at whitespace
35 -b             --breaklonglines        Automatically hard-wrap overlong lines
36 -c             --constantshow          Constantly show cursor position
37 -d             --rebinddelete          Fix Backspace/Delete confusion problem
38 -e             --emptyline             Keep the line below the title bar empty
39 -f <file>      --rcfile=<file>         Use only this file for configuring nano
40 -g             --showcursor            Show cursor in file browser & help text
41 -h             --help                  Show this help text and exit
42 -i             --autoindent            Automatically indent new lines
43 -j             --jumpyscrolling        Scroll per half-screen, not per line
44 -k             --cutfromcursor         Cut from cursor to end of line
45 -l             --linenumbers           Show line numbers in front of the text
46 -m             --mouse                 Enable the use of the mouse
47 -n             --noread                Do not read the file (only write it)
48 -o <dir>       --operatingdir=<dir>    Set operating directory
49 -p             --preserve              Preserve XON (^Q) and XOFF (^S) keys
50 -q             --indicator             Show a position+portion indicator
51 -r <number>    --fill=<number>         Set width for hard-wrap and justify
52 -s <program>   --speller=<program>     Use this alternative spell checker
53 -t             --saveonexit            Save changes on exit, don't prompt
54 -u             --unix                  Save a file by default in Unix format
55 -v             --view                  View mode (read-only)
56 -w             --nowrap                Don't hard-wrap long lines [default]
57 -x             --nohelp                Don't show the two help lines
58 -y             --afterends             Make Ctrl+Right stop at word ends
59 -%             --stateflags            Show some states on the title bar
60 -_             --minibar               Show a feedback bar at the bottom
61 -0             --zero                  Hide all bars, use whole terminal
62 -!             --magic                 Also try magic to determine syntax