├── .github └── workflows │ └── fetch.yml ├── .gitignore ├── AUTHORS ├── COPYING ├── COPYING.DOC ├── ChangeLog ├── ChangeLog.1999-2006 ├── ChangeLog.2007-2015 ├── IMPROVEMENTS ├── Makefile.am ├── NEWS ├── README ├── README.hacking ├── THANKS ├── TODO ├── autogen.sh ├── configure.ac ├── doc ├── .gitignore ├── Makefile.am ├── cheatsheet.html ├── faq.html ├── nano.1 ├── nano.texi ├── nanorc.5 ├── rnano.1 └── sample.nanorc.in ├── m4 ├── Makefile.am ├── ac_define_dir.m4 └── ax_check_compile_flag.m4 ├── nano-regress ├── po ├── .gitignore ├── LINGUAS ├── Makevars ├── POTFILES.in ├── bg.po ├── ca.po ├── cs.po ├── da.po ├── de.po ├── eo.po ├── es.po ├── eu.po ├── fi.po ├── fr.po ├── ga.po ├── gl.po ├── hr.po ├── hu.po ├── id.po ├── is.po ├── it.po ├── ja.po ├── ka.po ├── ko.po ├── ms.po ├── nano.pot ├── nb.po ├── nl.po ├── pl.po ├── pt.po ├── pt_BR.po ├── ro.po ├── ru.po ├── sk.po ├── sl.po ├── sq.po ├── sr.po ├── sv.po ├── tr.po ├── uk.po ├── update_linguas.sh ├── vi.po ├── zh_CN.po └── zh_TW.po ├── roll-a-release.sh ├── src ├── Makefile.am ├── browser.c ├── chars.c ├── color.c ├── cut.c ├── definitions.h ├── files.c ├── global.c ├── help.c ├── history.c ├── move.c ├── nano.c ├── prompt.c ├── prototypes.h ├── rcfile.c ├── search.c ├── text.c ├── utils.c └── winio.c └── syntax ├── Makefile.am ├── asm.nanorc ├── autoconf.nanorc ├── awk.nanorc ├── c.nanorc ├── changelog.nanorc ├── cmake.nanorc ├── css.nanorc ├── default.nanorc ├── elisp.nanorc ├── email.nanorc ├── extra ├── ada.nanorc ├── fortran.nanorc ├── haskell.nanorc ├── povray.nanorc └── spec.nanorc ├── go.nanorc ├── groff.nanorc ├── guile.nanorc ├── html.nanorc ├── java.nanorc ├── javascript.nanorc ├── json.nanorc ├── lua.nanorc ├── makefile.nanorc ├── man.nanorc ├── markdown.nanorc ├── nanohelp.nanorc ├── nanorc.nanorc ├── nftables.nanorc ├── objc.nanorc ├── ocaml.nanorc ├── patch.nanorc ├── perl.nanorc ├── php.nanorc ├── po.nanorc ├── python.nanorc ├── ruby.nanorc ├── rust.nanorc ├── sh.nanorc ├── sql.nanorc ├── tcl.nanorc ├── tex.nanorc ├── texinfo.nanorc ├── xml.nanorc └── yaml.nanorc /.github/workflows/fetch.yml: -------------------------------------------------------------------------------- 1 | name: Fetch-upstream 2 | on: 3 | schedule: 4 | - cron: '0 0 * * 1' 5 | workflow_dispatch: 6 | 7 | jobs: 8 | fetch: 9 | runs-on: ubuntu-latest 10 | steps: 11 | - uses: actions/checkout@v2 12 | with: 13 | fetch-depth: '5' 14 | 15 | - name: Fetch upstream (dirty hacks) 16 | run: | 17 | mv .github .github~ # hide it from git 18 | git reset --hard HEAD~3 19 | git pull git://git.savannah.gnu.org/nano.git 20 | mv .github~ .github 21 | 22 | - name: Commit this script 23 | run: | 24 | git add . 25 | git -c user.email='mail@beuke.org' -c user.name='Fabian Beuke' commit \ 26 | -m 'Merge pull request #9 from davidhcefx/patch-3' 27 | git push --force 28 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *~ 2 | *.bak 3 | *.o 4 | *.orig 5 | *.patch 6 | *.swp 7 | .deps 8 | .libs 9 | Makefile 10 | Makefile.in 11 | 12 | core 13 | .gdb_history 14 | .gdbinit 15 | 16 | /src/nano 17 | /src/revision.h 18 | 19 | /ABOUT-NLS 20 | /INSTALL 21 | /aclocal.m4 22 | /ar-lib 23 | /autom4te.cache 24 | /compile 25 | /config.cache 26 | /config.guess 27 | /config.h 28 | /config.h.in 29 | /config.log 30 | /config.rpath 31 | /config.status 32 | /config.sub 33 | /configure 34 | /depcomp 35 | /install-sh 36 | /intl 37 | /missing 38 | /mkinstalldirs 39 | /stamp-h1 40 | 41 | # Gettext m4 files: 42 | /m4/codeset.m4 43 | /m4/extern-inline.m4 44 | /m4/fcntl-o.m4 45 | /m4/gettext.m4 46 | /m4/glibc2.m4 47 | /m4/glibc21.m4 48 | /m4/host-cpu-c-abi.m4 49 | /m4/iconv.m4 50 | /m4/intdiv0.m4 51 | /m4/intl.m4 52 | /m4/intldir.m4 53 | /m4/intlmacosx.m4 54 | /m4/intmax.m4 55 | /m4/inttypes-pri.m4 56 | /m4/inttypes_h.m4 57 | /m4/lcmessage.m4 58 | /m4/lib-ld.m4 59 | /m4/lib-link.m4 60 | /m4/lib-prefix.m4 61 | /m4/lock.m4 62 | /m4/longlong.m4 63 | /m4/nls.m4 64 | /m4/po.m4 65 | /m4/printf-posix.m4 66 | /m4/progtest.m4 67 | /m4/size_max.m4 68 | /m4/stdint_h.m4 69 | /m4/threadlib.m4 70 | /m4/uintmax_t.m4 71 | /m4/visibility.m4 72 | /m4/wchar_t.m4 73 | /m4/wint_t.m4 74 | /m4/xsize.m4 75 | 76 | # Gnulib stuff: 77 | /gnulib/ 78 | /lib/ 79 | /m4/.gitignore 80 | /m4/gnulib-cache.m4 81 | /snippet/ 82 | -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | This file lists people who have made significant contributions to the 2 | nano editor. Please see the ChangeLog for specific changes by author. 3 | ---------------------------------------------------------------------- 4 | 5 | Chris Allegretta 6 | * Original program author and long-time maintainer. 7 | 8 | Benno Schulenberg 9 | * An array of small bug fixes, the cut-word and block-jump 10 | routines, text selection by holding Shift, macro recording 11 | and replay, extra key bindings, the --indicator, --minibar, 12 | and --zero options, and braced functions in string binds. 13 | Current maintainer. 14 | 15 | David Lawrence Ramsey 16 | * Multiple-buffer support, operating-dir option (-o), bug fixes 17 | for display routines, wrapping code, spelling fixes, parts of 18 | UTF-8 support, softwrap overhaul, constantshow mode, undoable 19 | indentations, undoable justifications, justifiable regions, 20 | and numerous other fixes. Former stable-series maintainer. 21 | 22 | Jordi Mallach 23 | * Debian package maintainer, fellow bug squasher, translator 24 | for Catalan. Former head of internationalization support. 25 | 26 | Adam Rogoyski 27 | * New write_file() function, read_file() optimization, mouse 28 | support, resize support, nohelp (-x) option, justify function, 29 | follow symlink option and bugfixes, and much more. 30 | 31 | Robert Siemborski 32 | * Miscellaneous cut, display, replace, and other bug fixes, 33 | original and new "magic line" code, read_line() function, 34 | new edit display routines. 35 | 36 | Rocco Corsi 37 | * Internal spelling code, many optimizations and bug fixes 38 | for findnextstr() and search-related functions, various 39 | display and file-handling fixes. 40 | 41 | David Benbennick 42 | * Wrap and justify bugfixes/enhancements, new color syntax 43 | code, memleak fixes, parts of the UTF-8 support, and other 44 | miscellaneous fixes. 45 | 46 | Mike Frysinger 47 | * Whitespace display mode, --enable-utf8/--disable-utf8 configure 48 | options for ncurses, many new color regexes and improvements to 49 | existing ones in syntax/*.nanorc, the move from svn to git, the 50 | conversion to gnulib, and miscellaneous bug fixes. Former 51 | Gentoo package maintainer. 52 | 53 | Mark Majeres 54 | * A functional undo/redo system, and coloring nano's interface. 55 | 56 | Mahyar Abbaspour 57 | * Improved handling of SIGWINCH. 58 | 59 | Mike Scalora 60 | * The comment/uncomment feature. 61 | 62 | Faissal Bensefia 63 | * Line numbers. 64 | 65 | Sumedh Pendurkar 66 | * The word-completion feature. 67 | 68 | Rishabh Dave 69 | * Searchable help. 70 | 71 | Marco Diego Aurélio Mesquita 72 | * Filtering text through an external command. 73 | * Placing anchors (bookmarks) and jumping to them. 74 | 75 | Brand Huntsman 76 | * The delayed parsing of syntax files. 77 | -------------------------------------------------------------------------------- /IMPROVEMENTS: -------------------------------------------------------------------------------- 1 | Improvements in GNU nano 2 | ======================== 3 | 4 | Since 8.0: 5 | - To accommodate newcomers, ^F now starts a forward search. 6 | - Option --modernbindings makes ^Q quit, ^X cut, ^C copy, ^V paste, 7 | ^Z undo, ^Y redo, ^O open a file, and ^G find again, among others. 8 | - M-Home/M-End put the cursor on the first/last row in the viewport. 9 | - With `nano filename:number` the given file will be opened with the 10 | cursor on the given line number (when 'set colonparsing' is used). 11 | - Option --listsyntaxes lists the names of available syntaxes. 12 | - Anchors are saved and restored (when --positionlog is active). 13 | - Key combos ^O^Q and ^X^Q cause an exit status of 2. 14 | 15 | Since 7.0: 16 | - String binds may contain bindable function names between braces. 17 | - Word completion looks for candidates in all open buffers. 18 | - Unicode codes can be entered without leading zeroes. 19 | 20 | Since 6.0: 21 | - Option --zero hides the interface and uses the whole terminal for editing. 22 | - Colors can be given also in #rgb hexadecimal, to select the nearest color 23 | from the 6x6x6 color-cube palette available on 256-color terminals. 24 | - Fourteen new color names are available, from rosy to crimson. 25 | 26 | Since 5.0: 27 | - A search briefly spotlights the found text, in black on yellow by default. 28 | - Option --minibar reduces the interface to a bottom bar with basic info. 29 | - The cursor skips over combining characters, deletes them together 30 | with the character they combine with, but deletes them separately. 31 | - For using libmagic the option --magic or -! or 'set magic' is required. 32 | - With --stateflags the state of some things is shown in the title bar. 33 | - M-Bsp deletes a word leftward. 34 | - With --indicator a "scrollbar" is shown, indicating position+portion. 35 | - M-Ins places an anchor, M-PgUp/M-PgDn jump to the nearest anchor. 36 | - Toggling help lines (M-X) and Refresh (^L) work nearly everywhere. 37 | - Colors can be modified with the attributes "bold," and/or "italic,". 38 | - Nine new color names: from pink and purple to orange and latte. 39 | 40 | Since 4.0: 41 | - Pasting from outside into nano suppresses auto-indentation. 42 | - Such an external paste can be undone with a single M-U. 43 | - Shift+Meta+letter key combos can be bound with 'bind Sh-M-letter ...'. 44 | - A custom nanorc file may be specified with -f / --rcfile. 45 | - What the key produces can be specified per syntax with 'tabgives'. 46 | - The ability to perform a search at startup with +/string or +?string. 47 | - Comment characters are copied when automatic hard-wrapping occurs. 48 | - The ability to both read from and write to a FIFO. 49 | - Automatic hard-wrapping is no longer the default. 50 | - Addition of --guidestripe to draw a helpful vertical bar. 51 | - Meta-Up and Meta-Down scroll the screen linewise. 52 | - Continuation is shown with a highlighted ">" instead of a plain "$". 53 | - A marked region gets justified into a single, separate paragraph. 54 | - Any number of justifications can be undone. 55 | 56 | Since 3.0: 57 | - Addition of --zap to make and obliterate marked text. 58 | - wipes next word and preceding word. 59 | - An external spell check can be undone. 60 | 61 | Since 2.9.0: 62 | - The ability to filter text through an external command. 63 | - Better detection of paragraphs, allowing a less indented beginning. 64 | - Option 'set afterends' for making Ctrl+Right stop at word ends. 65 | - A crash handler that saves changed buffers in case of a crash. 66 | - Addition of the color name "normal", meaning the default color. 67 | - A key can be bound to a string -- any mix of text and control codes. 68 | - Error messages are shown by default in bright white on red. 69 | - and can be used to indent/unindent a marked region. 70 | - Can snip trailing whitespace while typing, with 'set trimblanks'. 71 | - The ability to record and replay a series of keystrokes (a macro). 72 | - Assigned functions to ^S (save file) and ^Q (start backward search). 73 | - Indenting and unindenting have been integrated into the undo system. 74 | - Support for $XDG_CONFIG_HOME for the nanorc file, and $XDG_DATA_HOME 75 | for the history files (of search strings and cursor positions). 76 | 77 | Since 2.8.0: 78 | - ^U pastes the first line of the cutbuffer at a prompt. 79 | - Softwrapping can be done at whitespace (with --soft --atblanks). 80 | - The ^G help texts have become searchable (with ^W and M-W). 81 | - Ctrl+Home and Ctrl+End jump to start and end of file. 82 | - In softwrap mode the cursor now moves per visual row instead of 83 | per logical line, and the screen will scroll per row. 84 | 85 | Since 2.7.0: 86 | - The keystroke ^] to complete a fragment to an existing full word. 87 | - The ability to display line numbers in front of the text (M-#). 88 | 89 | Since 2.6.0: 90 | - Shift plus the cursor keys can be used for selecting text. 91 | - Ctrl+Arrow should now work also on a Linux virtual console. 92 | - Ctrl+Up and Ctrl+Down jump to previous or next block of text. 93 | - Feedback during Unicode Input (M-V followed by six digits). 94 | - The option 'wordchars' for specifying extra word characters. 95 | - Hi-bit control characters are shown in a more readable manner. 96 | - The ability to use negative numbers at the Go To Line prompt. 97 | - The ability to comment/uncomment lines with a single keystroke (M-3). 98 | - The ability to refresh the file list in the browser (^L). 99 | - The ability to abort re-searches (^C after an M-W). 100 | - Better feedback at startup when opening large or multiple files. 101 | 102 | Since 2.5.0: 103 | - The option 'justifytrim' for snipping whitespace from justified lines. 104 | - The ability to discard a buffer (^O ^Q) when --tempfile is used. 105 | - On most terminals Ctrl+Left / Ctrl+Right now work for PrevWord/NextWord. 106 | - When in the middle of a word, PrevWord now jumps to the start of this 107 | word (like Pico does) instead of to the start of the preceding word. 108 | - The ability to delete whole words with 'cutwordleft' and 'cutwordright'. 109 | - The ability to save a file without prompting for its name ('savefile'). 110 | - The ability to search backward without having to toggle the direction. 111 | 112 | Since 2.4.0: 113 | - Replacing things in a marked region now takes place in situ, in context, 114 | instead of changing the view to only the marked text. 115 | - Invalid byte sequences are properly displayed and not mistakenly found. 116 | - Resizing the window does not exit from help viewer nor file browser. 117 | 118 | Since 2.3.0: 119 | - System syntaxes can be improved upon with the 'extendsyntax' command. 120 | - Whitespace display (M-P) does not require configuration to be useful. 121 | - Undo/redo is enabled by default (M-U/M-E) and works nearly everywhere 122 | -- just not yet for justifying and indenting/unindenting. 123 | - The ability to color the title bar, the status bar and the help lines. 124 | - The ability to run a linter or formatter (^T) on the current buffer. 125 | - The ability to only write to named pipes with --noread. 126 | - Determination of the applicable syntax through libmagic -- when the 127 | file extension nor the first line give an answer. 128 | - The option 'positionlog' for saving/restoring the cursor position. 129 | - The ability to read and write vim-style lock files. 130 | 131 | Since 2.0.0: 132 | - The ability to rebind keys, via a nanorc file. 133 | - The ability to read standard input like a pager ("nano -"). 134 | - Color syntax highlighting can be set by the first line of a file. 135 | - The ability to silence nanorc error messages (-q). 136 | - Undo/redo operations (M-U/M-E, enabled with -u). 137 | - Soft wrapping of text (-$). 138 | - Better handling of backup files: if nano can't write a backup file, 139 | it won't try to write the original file afterward. 140 | - Emergency savefiles retain ownerships and permissions when possible. 141 | - Performance improvements in color syntax highlighting. 142 | 143 | Since 1.2.0: 144 | - Support for UTF-8. 145 | - Moving to a specified line and column of a file, instead of just a 146 | line (+LINE,COLUMN). 147 | - Smart home key (-A). 148 | - Creation of unique backup files in a specified directory (-C ). 149 | - Insertion of spaces instead of a tab when Tab is pressed (-E). 150 | - The long option for -K is now --rebindkeypad. 151 | - Regular expression searching can now be toggled when nano is built 152 | with --enable-tiny, so -R now means something else (see next item). 153 | - Restricted mode that provides more security than -o (-R). 154 | - Blanking of the statusbar after 1 keystroke instead of 25 (-U). 155 | - Word searches can optionally skip over punctuation (-W). 156 | - Workaround for Delete's acting like Backspace (-d). 157 | - Many more options are supported in the nanorc. 158 | - Improvements to color syntax highlighting support: case insensitive 159 | matching, the ability to include color syntaxes in separate files, 160 | the ability to specify background colors without foreground colors... 161 | - Insertion of single-byte characters via Esc Esc <000-255>. 162 | - Insertion of any character via Meta-V, "Verbatim Input". 163 | - Workaround for the "NumLock glitch". 164 | - Meta-W now repeats the last search. Wrapping is toggled via Meta-L. 165 | - Replacing and spell checking only selected text. 166 | - Indenting lines with one keystroke. 167 | - Copying text into the cutbuffer without cutting it. 168 | - Scrolling the text up and down single lines without moving the cursor. 169 | - PageUp and PageDown work more smoothly when using -S. 170 | - Scrolling the help text up and down single lines. 171 | - Cutting all text from the current position to the end of the file 172 | with one keystroke (Meta-T). 173 | - Justifying the entire file with one keystroke (Meta-J). 174 | - Justifying without removing spaces from the ends of lines. 175 | - Unjustifying after justifying and immediately resizing. 176 | - Going to the first or last line of the current paragraph. 177 | - Going to the first or last line of the file without having to go to 178 | the "Search" prompt. 179 | - Searching for filenames in the file browser. 180 | - Spaces and tabs are shown differently to make it easier to tell them apart. 181 | - Many more functions are available at the prompt: moving to the next or 182 | previous word, searching for matching brackets, "Verbatim Input"... 183 | - "To Line" (^W^T) and "Read from Command" (^R^X) return to their parent 184 | menu when their keystroke is entered again (^W^T^T and ^R^X^X). 185 | - Automatic adding of newlines to the ends of files without them can 186 | now be disabled (-L). 187 | - Converting from and to DOS/Mac file format is now toggled only at the 188 | "Write File" prompt, via Meta-D and Meta-M, and the default file format 189 | to save in is now set depending on what format the file was originally 190 | in. -D now makes nano use bold text instead of reverse video text, 191 | and Meta-D at the edit window now does a word/line/character count. 192 | -O now makes the unused second line of the screen part of the edit 193 | window, and Meta-O now toggles this behavior while editing. 194 | - Converting files that contain a mix of DOS and Mac format lines. 195 | - Automatic switching on of -N with binary files has been removed, as 196 | it causes problems with UTF-8 support. 197 | 198 | Since 1.0 199 | - Complete Pico compatibility (option --pico has been removed, 200 | and -p now means something else, see below). 201 | - Support for nanorc files. 202 | - Smooth scrolling (-S). 203 | - Jumping to the matching brace, bracket, etc. 204 | - Help for all editor features. 205 | - Color syntax highlighting support. 206 | - Quote string support, useful for mail agents, etc. (-Q). 207 | - Insertion of output of external commands. 208 | - Optional enabling of XON and XOFF control characters (-p). 209 | - Option -o (--operatingdir) implements a chroot of sorts. 210 | - Mouse support (-m) also allows clicking on shortcuts. 211 | - Option -r allows a negative argument. 212 | - Overwriting and appending or prepending to files. 213 | - Writing marked text to separate files. 214 | - Multiple file buffers (-F). 215 | - Converting from and to DOS/Mac file format (-D/-M, -N to disable). 216 | - Better control character handling. 217 | - Creation of backup files (-B). 218 | - Search/replace history (-H). 219 | 220 | Available in 1.0: 221 | - Spell checking (^T). 222 | - Justification (^J) and unjustification (^U). 223 | - Internationalization (more translations are welcome). 224 | - Help texts (^G). 225 | - Resizing in X. 226 | - On PageUp/Down, the cursor is put on the first screen line (like Pico). 227 | - Tab completion at the prompt (for filenames and ~user). 228 | - Cut-to-end-of-line option (-k). 229 | -------------------------------------------------------------------------------- /Makefile.am: -------------------------------------------------------------------------------- 1 | AUTOMAKE_OPTIONS = gnu no-dependencies 2 | 3 | SUBDIRS = doc lib m4 po src 4 | 5 | if USE_COLOR 6 | SUBDIRS += syntax 7 | endif 8 | 9 | EXTRA_DIST = IMPROVEMENTS 10 | 11 | ACLOCAL_AMFLAGS = -I m4 12 | 13 | showinfo: 14 | @ echo 15 | @ echo " The global nanorc file is: @sysconfdir@/nanorc" 16 | @ echo " Syntaxes get installed in: @PKGDATADIR@/" 17 | @ echo 18 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | 2 | GNU nano -- a simple editor, inspired by Pico 3 | 4 | Purpose 5 | 6 | Nano is a small and simple text editor for use on the terminal. 7 | It copied the interface and key bindings of the Pico editor but 8 | added several missing features: undo/redo, syntax highlighting, 9 | line numbers, softwrapping, multiple buffers, selecting text by 10 | holding Shift, search-and-replace with regular expressions, and 11 | several other conveniences. 12 | 13 | Appearance 14 | 15 | In rough ASCII graphics, this is what nano's screen looks like: 16 | 17 | ____________________________________________________________________ 18 | | GNU nano 8.6 filename Modified | 19 | -------------------------------------------------------------------- 20 | | This is the text window, displaying the contents of a 'buffer', | 21 | | the contents of the file you are editing. | 22 | | | 23 | | The top row of the screen is the 'title bar'; it shows nano's | 24 | | version, the name of the file, and whether you modified it. | 25 | | The two bottom rows display the most important shortcuts; in | 26 | | those lines ^ means Ctrl. The third row from the bottom shows | 27 | | some feedback message, or gets replaced with a prompt bar when | 28 | | you tell nano to do something that requires extra input. | 29 | | | 30 | -------------------------------------------------------------------- 31 | | [ Some status message ] | 32 | |^G Help ^O Write Out ^F Where Is ^K Cut ^T Execute | 33 | |^X Exit ^R Read File ^\ Replace ^U Paste ^J Justify | 34 | -------------------------------------------------------------------- 35 | 36 | Origin 37 | 38 | The nano project was started in 1999 because of a few "problems" 39 | with the wonderfully easy-to-use and friendly Pico text editor. 40 | 41 | First and foremost was its license: the Pine suite does not use 42 | the GPL, and (before using the Apache License) it had unclear 43 | restrictions on redistribution. Because of this, Pine and Pico 44 | were not included in many GNU/Linux distributions. Furthermore, 45 | some features (like go-to-line-number or search-and-replace) were 46 | unavailable for a long time or require a command-line flag. Yuck. 47 | 48 | Nano aimed to solve these problems by: 1) being truly free software 49 | by using the GPL, 2) emulating the functionality of Pico as closely 50 | as is reasonable, and 3) including extra functionality by default. 51 | 52 | Nowadays, nano wants to be a generally useful editor with sensible 53 | defaults (linewise scrolling, no automatic line breaking). 54 | 55 | The nano editor is an official GNU package. For more information on 56 | GNU and the Free Software Foundation, please see https://www.gnu.org/. 57 | 58 | License 59 | 60 | Nano's code and documentation are covered by the GPL version 3 or 61 | (at your option) any later version, except for two functions that 62 | were copied from busybox which are under a BSD license. Nano's 63 | documentation is additionally covered by the GNU Free Documentation 64 | License version 1.2 or (at your option) any later version. See the 65 | files COPYING and COPYING.DOC for the full text of these licenses. 66 | 67 | When in any file of this package a copyright notice mentions a 68 | year range (such as 1999-2011), it is a shorthand for a list of 69 | all the years in that interval. 70 | 71 | How to compile and install nano 72 | 73 | Download the latest nano source tarball, and then: 74 | 75 | tar -xvf nano-x.y.tar.gz 76 | cd nano-x.y 77 | ./configure 78 | make 79 | make install 80 | 81 | You will need the header files of ncurses installed for ./configure 82 | to succeed -- get them from libncurses-dev (Debian) or ncurses-devel 83 | (Fedora) or a similarly named package. Use --prefix with ./configure 84 | to override the default installation directory of /usr/local. 85 | 86 | After installation you may want to copy the doc/sample.nanorc file 87 | to your home directory, rename it to ".nanorc", and then edit it 88 | according to your taste. 89 | 90 | Web Page 91 | 92 | https://nano-editor.org/ 93 | 94 | Mailing Lists 95 | 96 | There are three nano-related mailing-lists. 97 | 98 | * is a very low traffic list used to announce 99 | new nano versions or other important info about the project. 100 | 101 | * is for those seeking to get help without 102 | wanting to hear about the technical details of its development. 103 | 104 | * is the list used by the people that make nano 105 | and a general development discussion list, with moderate traffic. 106 | 107 | To subscribe, send email to -request@gnu.org with a subject 108 | of "subscribe", where is the list you want to subscribe to. 109 | 110 | The archives of the development and help mailing lists are here: 111 | 112 | https://lists.gnu.org/archive/html/nano-devel/ 113 | https://lists.gnu.org/archive/html/help-nano/ 114 | 115 | Bug Reports 116 | 117 | If you find a bug, please file a detailed description of the problem 118 | on nano's issue tracker: https://savannah.gnu.org/bugs/?group=nano 119 | (you will need an account to be able to do so), or send an email 120 | to the nano-devel list (no need to subscribe, but mention it if 121 | you want to be CC'ed on an answer). 122 | 123 | -------------------------------------------------------------------------------- /README.hacking: -------------------------------------------------------------------------------- 1 | INSTRUCTIONS FOR COMPILING AND INSTALLING NANO FROM GIT 2 | ======================================================= 3 | 4 | The latest changes and fixes for GNU nano are available via git, but 5 | building this needs a bit more care than the official tarballs. 6 | 7 | 8 | Prerequisites 9 | ------------- 10 | 11 | To successfully compile GNU nano from git, you'll need the following: 12 | 13 | autoconf (version >= 2.69) 14 | automake (version >= 1.14) 15 | autopoint (version >= 0.20) 16 | gcc (version >= 5.0) 17 | gettext (version >= 0.20) 18 | git (version >= 2.7.4) 19 | groff (version >= 1.12) 20 | make (any version) 21 | pkg-config (version >= 0.22) 22 | texinfo (version >= 4.0) 23 | 24 | You will also need to have the header files for ncurses installed, 25 | from libncurses-dev on Debian, ncurses-devel on Fedora, or similar. 26 | 27 | These should all be available in your distro's package manager or 28 | software center, or otherwise on any GNU mirror. 29 | 30 | 31 | Clone the source 32 | ---------------- 33 | 34 | To obtain the current nano development branch (called 'master'), use the 35 | following command. It will create in your current working directory a 36 | subdirectory called 'nano' containing a copy of all of the files: 37 | 38 | $ git clone git://git.savannah.gnu.org/nano.git 39 | 40 | 41 | Generate the configure script 42 | ----------------------------- 43 | 44 | Once you have the sources in the "nano" directory, 45 | 46 | $ cd nano 47 | $ ./autogen.sh 48 | 49 | This will set up a configure script and a Makefile.in file. 50 | 51 | 52 | Configure your build 53 | -------------------- 54 | 55 | To configure your build, run the configure script from the nano source 56 | directory: 57 | 58 | $ ./configure [--add-options-here] 59 | 60 | 61 | Build and install 62 | ----------------- 63 | 64 | From the nano source directory, build the code with: 65 | 66 | $ make 67 | 68 | Then, once it's done compiling, run: 69 | 70 | $ make install 71 | 72 | which should copy various files (i.e. the nano executable, the info and 73 | man pages, and syntax highlighting pattern files) to their appropriate 74 | directories. 75 | 76 | If you're installing into the default install directory (/usr/local), 77 | you'll need to run that "make install" command with root privileges. 78 | 79 | 80 | Problems? 81 | --------- 82 | 83 | Please submit any bugs you find in the code in git via the bug tracker 84 | on Savannah (https://savannah.gnu.org/bugs/?group=nano). 85 | 86 | 87 | Contributing something 88 | ---------------------- 89 | 90 | If you have a fix for a bug, or the code for a new or improved feature, 91 | first create a branch off of master: 92 | 93 | $ git checkout -b somename 94 | 95 | Then change the code so it does what you want, and commit it together 96 | with your Sign-off: 97 | 98 | $ git commit -as 99 | 100 | In the commit message (after the one-line summary) give a rationale 101 | for the change. With your Signed-off-by you declare that the code is 102 | yours, or that you are free to reuse it, and that you submit it under 103 | the license that covers nano. Then create a patch (or patches): 104 | 105 | $ git format-patch master 106 | 107 | Send that patch (or patches) to , as an attachment 108 | or with git send-email. 109 | 110 | To keep most lines of nano's source code within a width of 80 characters, 111 | a tab size of four should be used. So in your nanorc file you may want 112 | to include 'set tabsize 4', or you could use -T4 on the command line. 113 | To make git display things as intended, you can do: 114 | 115 | $ git config --local core.pager "less -x1,5" 116 | 117 | To see all types that are used in nano's source code colorized as types, 118 | you can add these lines to your ~/.nanorc: 119 | 120 | extendsyntax c color green "\" 121 | extendsyntax c color green "\" 122 | extendsyntax c color green "\" 123 | extendsyntax c color green "\<([[:lower:]_]+(struct|type)|va_list)\>" 124 | -------------------------------------------------------------------------------- /THANKS: -------------------------------------------------------------------------------- 1 | The following people have helped GNU nano in some way or another. 2 | If we missed you here, let us know! 3 | 4 | 5 | Translations: 6 | ============ 7 | Pedro Albuquerque Portuguese 8 | Josef Andersson Swedish 9 | Mario Blättermann German 10 | Besnik Bleta Albanian 11 | Laurențiu Buzdugan Romanian 12 | Ricardo Cárdenes Medina Spanish 13 | Antonio Ceballos Spanish 14 | Wei-Lun CHAO Chinese (traditional) 15 | Seong-ho Cho Korean 16 | Yuri Chornoivan Ukrainian 17 | Marco Colombo Italian 18 | Mihai Cristescu Romanian 19 | Yavor Doganov Bulgarian 20 | Karl Eichwalder German 21 | A. Murat EREN Turkish 22 | Sveinn í Felli Icelandic 23 | Marek Felšöci Slovak 24 | Doruk Fisek Turkish 25 | Rafael Fontenelle Brazilian Portuguese 26 | Pavel Fric Czech 27 | Jorge González Spanish 28 | Jean-Philippe Guérard French 29 | Václav Haisman Czech 30 | Takeshi Hamasaki Japanese 31 | Geir Helland Norwegian Bokmål 32 | Tedi Heriyanto Indonesian 33 | Kjetil Torgrim Homme Norwegian Nynorsk 34 | Szabolcs Horvath Hungarian 35 | Jorma Karvonen Finnish 36 | Mehmet Kececi Turkish 37 | Gabor Kelemen Hungarian 38 | Kalle Kivimaa Finnish 39 | Eivind Kjørstad Norwegian Nynorsk 40 | Florian König German 41 | Klemen Košir Slovenian 42 | Wojciech Kotwica Polish 43 | Clement Laforet French 44 | Ask Hjorth Larsen Danish 45 | LI Daobing Chinese (simplified) 46 | Jordi Mallach Catalan 47 | João Victor Duarte Martins Brazilian Portuguese 48 | Pavel Maryanov Russian 49 | Daniele Medri Italian 50 | Gergely Nagy Hungarian 51 | Claudio Neves Brazilian Portuguese 52 | Kalle Olavi Niemitalo Finnish 53 | Мирослав Николић Serbian 54 | Lauri Nurmi Finnish 55 | Daniel Nylander Swedish 56 | Mikel Olasagasti Basque 57 | Yi-Jyun Pan Chinese (traditional) 58 | Michael Piefel German 59 | Sergey Poznyakoff Polish 60 | Božidar Putanec Croatian 61 | Trần Ngọc Quân Vietnamese 62 | Sharuzzaman Ahmat Raslan Malay 63 | Sergey A. Ribalchenko Ukrainian and Russian 64 | Michel Robitaille French 65 | Christian Rose Swedish 66 | Dimitriy Ryazantcev Russian 67 | Stig E Sandø Norwegian Bokmål 68 | Kevin Patrick Scannell Irish 69 | Benno Schulenberg Dutch and Esperanto 70 | Danilo Segan Serbian 71 | Clytie Siddall Vietnamese 72 | Keld Simonsen Danish 73 | Guus Sliepen Dutch 74 | Cezary Sliwa Polish 75 | Johnny A. Solbu Norwegian Bokmål 76 | Pierre Tane French 77 | Yasuaki Taniguchi Japanese 78 | Jacobo Tarrío Galician 79 | Andika Triwidada Indonesian 80 | Francisco Javier Tsao Santín Galician 81 | Balázs Úr Hungarian 82 | Miquel Vidal Catalan 83 | Phan Vinh Thinh Vietnamese 84 | Pauli Virtanen Finnish 85 | Aron Xu Chinese (simplified) 86 | Boyuan Yang <073plan@gmail.com> Chinese (simplified) 87 | Peio Ziarsolo Basque 88 | Anton Zinoviev Bulgarian 89 | 90 | 91 | Other stuff: 92 | =========== 93 | Ben Armstrong Negative -r value idea, code 94 | Thomas Dickey Curses help and advice 95 | Kamil Dudka Several small bug fixes 96 | Sven Guckes Advice and advocacy 97 | Thijs Kinkhorst rnano.1 manpage 98 | Jim Knoble Pico compat for browser 99 | Ryan Krebs Many bug fixes and testing 100 | Roy Lanek Advice and advocacy 101 | Chuck Mead Feedback and RPM stuff 102 | Mike Melanson Bug reports 103 | Neil Parks Bug reports and fixes 104 | Jeremy Robichaud Beta tester 105 | Bill Soudan Regex code, etc 106 | Ken Tyler Search fixes and more 107 | -------------------------------------------------------------------------------- /TODO: -------------------------------------------------------------------------------- 1 | 2 | For a list of open bugs and requested features see: 3 | 4 | https://savannah.gnu.org/bugs/?group=nano 5 | 6 | -------------------------------------------------------------------------------- /autogen.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Generate configure & friends for GIT users. 3 | 4 | gnulib_url="git://git.sv.gnu.org/gnulib.git" 5 | gnulib_hash="f05b5a23f6cef8833402a298d1576a0118912ac8" 6 | 7 | modules=" 8 | canonicalize-lgpl 9 | futimens 10 | getdelim 11 | getline 12 | getopt-gnu 13 | glob 14 | isblank 15 | iswblank 16 | lstat 17 | mkstemps 18 | nl_langinfo 19 | regex 20 | sigaction 21 | snprintf-posix 22 | stdarg 23 | strcase 24 | strcasestr-simple 25 | strnlen 26 | sys_wait 27 | vsnprintf-posix 28 | wchar 29 | wctype-h 30 | wcwidth 31 | " 32 | 33 | # Make sure the local gnulib git repo is up-to-date. 34 | if [ ! -d "gnulib" ]; then 35 | git clone --depth=2222 ${gnulib_url} 36 | fi 37 | cd gnulib >/dev/null || exit 1 38 | curr_hash=$(git log -1 --format=%H) 39 | if [ "${gnulib_hash}" != "${curr_hash}" ]; then 40 | echo "Pulling..." 41 | git pull 42 | git checkout --force ${gnulib_hash} 43 | fi 44 | cd .. >/dev/null || exit 1 45 | 46 | rm -rf lib 47 | echo "Gnulib-tool..." 48 | ./gnulib/gnulib-tool --import ${modules} 49 | echo 50 | 51 | echo "Autoreconf..." 52 | autoreconf --install --symlink --force 53 | echo "Done." 54 | -------------------------------------------------------------------------------- /configure.ac: -------------------------------------------------------------------------------- 1 | # Configuration for GNU nano - a small and user-friendly text editor 2 | # 3 | # Copyright (C) 1999-2011, 2013-2025 Free Software Foundation, Inc. 4 | # Copyright (C) 2014, 2017 Mike Frysinger 5 | # 6 | # GNU nano is free software: you can redistribute it and/or modify 7 | # it under the terms of the GNU General Public License as published 8 | # by the Free Software Foundation, either version 3 of the License, 9 | # or (at your option) any later version. 10 | # 11 | # GNU nano is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty 13 | # of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 14 | # See the GNU General Public License for more details. 15 | # 16 | # You should have received a copy of the GNU General Public License 17 | # along with this program. If not, see https://www.gnu.org/licenses/. 18 | 19 | AC_INIT([GNU nano], [8.6], [nano-devel@gnu.org], [nano]) 20 | AC_CONFIG_SRCDIR([src/nano.c]) 21 | AC_CANONICAL_HOST 22 | AM_INIT_AUTOMAKE([1.14]) 23 | AM_MAINTAINER_MODE([enable]) 24 | AC_CONFIG_HEADERS([config.h]) 25 | 26 | dnl Make sure the ONCE macros are available. 27 | 28 | AC_PREREQ([2.69]) 29 | 30 | dnl Lie about gnulib features we don't use to speed up & shrink down. 31 | 32 | gl_cv_func_printf_directive_n=yes 33 | gl_cv_func_printf_infinite_long_double=yes 34 | gl_cv_func_printf_long_double=yes 35 | gl_cv_func_snprintf_directive_n=yes 36 | gl_cv_glob_lists_symlinks=yes 37 | 38 | dnl Checks for programs. 39 | 40 | AC_USE_SYSTEM_EXTENSIONS 41 | AC_PROG_CC 42 | gl_EARLY 43 | gl_INIT 44 | AC_PROG_LN_S 45 | AC_SEARCH_LIBS([strerror], [cposix]) 46 | AC_SYS_LARGEFILE 47 | PKG_PROG_PKG_CONFIG 48 | 49 | dnl Internationalization macros. 50 | 51 | AM_GNU_GETTEXT_VERSION([0.20]) 52 | AM_GNU_GETTEXT([external], [need-ngettext]) 53 | AM_CONDITIONAL(USE_NLS, test x$USE_NLS = xyes) 54 | 55 | dnl Data location. 56 | 57 | pkgdatadir=${datadir}/${PACKAGE} 58 | AC_DEFINE_DIR([PKGDATADIR], [pkgdatadir], [Where data are placed to.]) 59 | 60 | dnl Whether this is a git repository. 61 | 62 | AC_MSG_CHECKING([whether building from git]) 63 | if test -f "$srcdir/roll-a-release.sh" ; then 64 | AC_MSG_RESULT([yes]) 65 | from_git=yes 66 | else 67 | AC_MSG_RESULT([no]) 68 | from_git=no 69 | fi 70 | AM_CONDITIONAL(BUILDING_FROM_GIT, test x$from_git = xyes) 71 | 72 | dnl Checks for pkg-config and gettext when building from git. 73 | 74 | if test x$from_git = xyes; then 75 | if test ! -f $(aclocal --print-ac-dir)/pkg.m4; then 76 | AC_MSG_ERROR([ 77 | *** The pkg.m4 macros are missing. 78 | *** The pkg-config package needs to be installed when building from git. 79 | *** After fixing this problem, rerun ./autogen.sh.]) 80 | fi 81 | if test "$ac_cv_path_MSGFMT" = ":"; then 82 | AC_MSG_ERROR([ 83 | *** The msgfmt program is missing. 84 | *** The gettext package needs to be installed when building from git.]) 85 | fi 86 | fi 87 | 88 | dnl Checks for header files. 89 | 90 | AC_CHECK_HEADERS(libintl.h limits.h pwd.h termios.h sys/param.h) 91 | 92 | dnl Checks for options. 93 | 94 | AC_ARG_ENABLE(browser, 95 | AS_HELP_STRING([--disable-browser], [Disable the built-in file browser])) 96 | if test "x$enable_tiny" = xyes; then 97 | if test "x$enable_browser" != xyes; then 98 | enable_browser=no 99 | fi 100 | fi 101 | if test "x$enable_browser" != xno; then 102 | AC_DEFINE(ENABLE_BROWSER, 1, [Define this to enable the built-in file browser.]) 103 | fi 104 | 105 | AC_ARG_ENABLE(color, 106 | AS_HELP_STRING([--disable-color], [Disable color and syntax highlighting])) 107 | if test "x$enable_tiny" = xyes; then 108 | if test "x$enable_color" = xyes; then 109 | if test "x$enable_nanorc" != xyes; then 110 | AC_MSG_ERROR([ 111 | *** --enable-color needs --enable-nanorc to work]) 112 | fi 113 | else 114 | enable_color=no 115 | fi 116 | fi 117 | if test "x$enable_nanorc" = xno; then 118 | if test "x$enable_color" = xyes; then 119 | AC_MSG_ERROR([ 120 | *** --enable-color cannot work with --disable-nanorc]) 121 | else 122 | # Disabling nanorc silently disables color support. 123 | enable_color=no 124 | fi 125 | fi 126 | if test "x$enable_color" != xno; then 127 | AC_DEFINE(ENABLE_COLOR, 1, [Define this to have syntax highlighting.]) 128 | color_support=yes 129 | fi 130 | 131 | AC_ARG_ENABLE(comment, 132 | AS_HELP_STRING([--disable-comment], [Disable the comment/uncomment function])) 133 | if test "x$enable_tiny" = xyes; then 134 | if test "x$enable_comment" = xyes; then 135 | AC_MSG_ERROR([ 136 | *** --enable-comment cannot work with --enable-tiny]) 137 | else 138 | enable_comment=no 139 | fi 140 | fi 141 | if test "x$enable_comment" != xno; then 142 | AC_DEFINE(ENABLE_COMMENT, 1, [Define this to enable the comment/uncomment function.]) 143 | fi 144 | 145 | AC_ARG_ENABLE(extra, 146 | AS_HELP_STRING([--disable-extra], [Disable the Easter egg])) 147 | if test "x$enable_tiny" = xyes; then 148 | if test "x$enable_extra" != xyes; then 149 | enable_extra=no 150 | fi 151 | fi 152 | if test "x$enable_extra" != xno; then 153 | AC_DEFINE(ENABLE_EXTRA, 1, [Define this to have an Easter egg.]) 154 | fi 155 | 156 | AC_ARG_ENABLE(formatter, 157 | AS_HELP_STRING([--disable-formatter], [Disable the formatting tool])) 158 | if test "x$enable_tiny" = xyes; then 159 | if test "x$enable_formatter" = xyes; then 160 | if test "x$enable_color" != xyes; then 161 | AC_MSG_ERROR([ 162 | *** --enable-formatter needs both --enable-color and --enable-nanorc to work]) 163 | fi 164 | else 165 | enable_formatter=no 166 | fi 167 | fi 168 | if test "x$enable_color" = xno; then 169 | if test "x$enable_formatter" = xyes; then 170 | AC_MSG_ERROR([ 171 | *** --enable-formatter cannot work with --disable-color nor --disable-nanorc]) 172 | else 173 | enable_formatter=no 174 | fi 175 | fi 176 | if test "x$enable_formatter" != xno; then 177 | AC_DEFINE(ENABLE_FORMATTER, 1, [Define this to have access to a formatter.]) 178 | fi 179 | 180 | AC_ARG_ENABLE(help, 181 | AS_HELP_STRING([--disable-help], [Disable the built-in help texts])) 182 | if test "x$enable_tiny" = xyes; then 183 | if test "x$enable_help" = xyes; then 184 | if test "x$enable_multibuffer" != xyes; then 185 | AC_MSG_ERROR([ 186 | *** --enable-help needs --enable-multibuffer to work]) 187 | fi 188 | else 189 | enable_help=no 190 | fi 191 | fi 192 | if test "x$enable_multibuffer" = xno; then 193 | if test "x$enable_help" = xyes; then 194 | AC_MSG_ERROR([ 195 | *** --enable-help cannot work with --disable-multibuffer]) 196 | else 197 | # Disabling multibuffer silently disables the help texts. 198 | enable_help=no 199 | fi 200 | fi 201 | if test "x$enable_help" != xno; then 202 | AC_DEFINE(ENABLE_HELP, 1, [Define this to enable the Ctrl+G help texts.]) 203 | fi 204 | 205 | AC_ARG_ENABLE(histories, 206 | AS_HELP_STRING([--disable-histories], [Disable search and position histories])) 207 | if test "x$enable_tiny" = xyes; then 208 | if test "x$enable_histories" != xyes; then 209 | enable_histories=no 210 | fi 211 | fi 212 | if test "x$enable_histories" != xno; then 213 | AC_DEFINE(ENABLE_HISTORIES, 1, [Define this to have search and position histories.]) 214 | fi 215 | 216 | AC_ARG_ENABLE(justify, 217 | AS_HELP_STRING([--disable-justify], [Disable the justify/unjustify functions])) 218 | if test "x$enable_tiny" = xyes; then 219 | if test "x$enable_justify" != xyes; then 220 | enable_justify=no 221 | fi 222 | fi 223 | if test "x$enable_justify" != xno; then 224 | AC_DEFINE(ENABLE_JUSTIFY, 1, [Define this to have the routines for justifying.]) 225 | fi 226 | 227 | AC_ARG_ENABLE(libmagic, 228 | AS_HELP_STRING([--disable-libmagic], [Disable detection of file types via libmagic])) 229 | if test "x$enable_libmagic" = xyes; then 230 | if test "x$enable_tiny" = xyes; then 231 | if test "x$enable_color" != xyes; then 232 | AC_MSG_ERROR([ 233 | *** --enable-libmagic needs both --enable-color and --enable-nanorc to work]) 234 | fi 235 | fi 236 | if test "x$enable_color" = xno; then 237 | AC_MSG_ERROR([ 238 | *** --enable-libmagic cannot work with --disable-color nor --disable-nanorc]) 239 | fi 240 | fi 241 | 242 | AC_ARG_ENABLE(linter, 243 | AS_HELP_STRING([--disable-linter], [Disable the linting tool])) 244 | if test "x$enable_tiny" = xyes; then 245 | if test "x$enable_linter" = xyes; then 246 | if test "x$enable_color" != xyes; then 247 | AC_MSG_ERROR([ 248 | *** --enable-linter needs both --enable-color and --enable-nanorc to work]) 249 | fi 250 | else 251 | enable_linter=no 252 | fi 253 | fi 254 | if test "x$enable_color" = xno; then 255 | if test "x$enable_linter" = xyes; then 256 | AC_MSG_ERROR([ 257 | *** --enable-linter cannot work with --disable-color nor --disable-nanorc]) 258 | else 259 | enable_linter=no 260 | fi 261 | fi 262 | if test "x$enable_linter" != xno; then 263 | AC_DEFINE(ENABLE_LINTER, 1, [Define this to have access to a linter.]) 264 | fi 265 | 266 | AC_ARG_ENABLE(linenumbers, 267 | AS_HELP_STRING([--disable-linenumbers], [Disable line numbering])) 268 | if test "x$enable_tiny" = xyes; then 269 | if test "x$enable_linenumbers" != xyes; then 270 | enable_linenumbers=no 271 | fi 272 | fi 273 | if test "x$enable_linenumbers" != xno; then 274 | AC_DEFINE(ENABLE_LINENUMBERS, 1, [Define this to enable line numbering.]) 275 | fi 276 | 277 | AC_ARG_ENABLE(mouse, 278 | AS_HELP_STRING([--disable-mouse], [Disable mouse support])) 279 | if test "x$enable_tiny" = xyes; then 280 | if test "x$enable_mouse" != xyes; then 281 | enable_mouse=no 282 | fi 283 | fi 284 | if test "x$enable_mouse" != xno; then 285 | AC_DEFINE(ENABLE_MOUSE, 1, [Define this to enable mouse support.]) 286 | fi 287 | 288 | AC_ARG_ENABLE(multibuffer, 289 | AS_HELP_STRING([--disable-multibuffer], [Disable multiple file buffers])) 290 | if test "x$enable_tiny" = xyes; then 291 | if test "x$enable_multibuffer" != xyes; then 292 | enable_multibuffer=no 293 | fi 294 | fi 295 | if test "x$enable_multibuffer" != xno; then 296 | AC_DEFINE(ENABLE_MULTIBUFFER, 1, [Define this to enable multiple file buffers.]) 297 | fi 298 | 299 | AC_ARG_ENABLE(nanorc, 300 | AS_HELP_STRING([--disable-nanorc], [Disable the use of .nanorc files])) 301 | if test "x$enable_tiny" = xyes; then 302 | if test "x$enable_nanorc" != xyes; then 303 | enable_nanorc=no 304 | fi 305 | fi 306 | if test "x$enable_nanorc" != xno; then 307 | AC_DEFINE(ENABLE_NANORC, 1, [Define this to enable the use of .nanorc files.]) 308 | nanorc_support=yes 309 | fi 310 | 311 | AC_ARG_ENABLE(operatingdir, 312 | AS_HELP_STRING([--disable-operatingdir], [Disable the setting of an operating directory])) 313 | if test "x$enable_tiny" = xyes; then 314 | if test "x$enable_operatingdir" != xyes; then 315 | enable_operatingdir=no 316 | fi 317 | fi 318 | if test "x$enable_operatingdir" != xno; then 319 | AC_DEFINE(ENABLE_OPERATINGDIR, 1, [Define this to allow setting an operating directory (a chroot of sorts).]) 320 | fi 321 | 322 | AC_ARG_ENABLE(speller, 323 | AS_HELP_STRING([--disable-speller], [Disable the spell-checking tool])) 324 | if test "x$enable_tiny" = xyes; then 325 | if test "x$enable_speller" != xyes; then 326 | enable_speller=no 327 | fi 328 | fi 329 | if test "x$enable_speller" != xno; then 330 | AC_DEFINE(ENABLE_SPELLER, 1, [Define this to have access to a spell checker.]) 331 | fi 332 | 333 | AC_ARG_ENABLE(tabcomp, 334 | AS_HELP_STRING([--disable-tabcomp], [Disable the tab-completion functions])) 335 | if test "x$enable_tiny" = xyes; then 336 | if test "x$enable_tabcomp" != xyes; then 337 | enable_tabcomp=no 338 | fi 339 | fi 340 | if test "x$enable_tabcomp" != xno; then 341 | AC_DEFINE(ENABLE_TABCOMP, 1, [Define this to have tab completion for filenames and search strings.]) 342 | fi 343 | 344 | AC_ARG_ENABLE(wordcomp, 345 | AS_HELP_STRING([--disable-wordcomp], [Disable the word-completion function])) 346 | if test "x$enable_tiny" = xyes; then 347 | if test "x$enable_wordcomp" = xyes; then 348 | AC_MSG_ERROR([ 349 | *** --enable-wordcomp cannot work with --enable-tiny]) 350 | else 351 | enable_wordcomp=no 352 | fi 353 | fi 354 | if test "x$enable_wordcomp" != xno; then 355 | AC_DEFINE(ENABLE_WORDCOMPLETION, 1, [Define this to enable the word-completion function.]) 356 | fi 357 | 358 | AC_ARG_ENABLE(wrapping, 359 | AS_HELP_STRING([--disable-wrapping], [Disable all hard-wrapping of text])) 360 | if test "x$enable_tiny" = xyes; then 361 | if test "x$enable_wrapping" != xyes; then 362 | enable_wrapping=no 363 | fi 364 | fi 365 | if test "x$enable_wrapping" != xno; then 366 | AC_DEFINE(ENABLE_WRAPPING, 1, [Define this to have hard text wrapping.]) 367 | fi 368 | 369 | AC_ARG_ENABLE(debug, 370 | AS_HELP_STRING([--enable-debug], [Enable debugging (disabled by default)])) 371 | if test "x$enable_debug" = xyes; then 372 | AC_DEFINE(DEBUG, 1, [Define this to enable debug messages and abortion on failing asserts.]) 373 | else 374 | AC_DEFINE(NDEBUG, 1, [Shut up assert warnings :-)]) 375 | fi 376 | 377 | AC_ARG_ENABLE(tiny, 378 | AS_HELP_STRING([--enable-tiny], [Disable features for the sake of size])) 379 | if test "x$enable_tiny" = xyes; then 380 | AC_DEFINE(NANO_TINY, 1, [Define this to make the nano executable as small as possible.]) 381 | if test "x$enable_libmagic" != xyes; then 382 | enable_libmagic=no 383 | fi 384 | fi 385 | 386 | AM_CONDITIONAL(USE_COLOR, test x$color_support = xyes) 387 | AM_CONDITIONAL(USE_NANORC, test x$nanorc_support = xyes) 388 | 389 | AC_MSG_CHECKING([whether to enable UTF-8 support]) 390 | AC_ARG_ENABLE(utf8, AS_HELP_STRING([--enable-utf8], [Enable UTF-8 support])) 391 | AC_MSG_RESULT(${enable_utf8:-auto}) 392 | 393 | AC_ARG_ENABLE(altrcname, 394 | AS_HELP_STRING([--enable-altrcname], [Specify an alternate rcfile name (default: .nanorc)]), 395 | [if test x$enableval != no; then 396 | AC_DEFINE_UNQUOTED(RCFILE_NAME, "$enableval", [Specify an alternate rcfile name (default: .nanorc).]) rcfilename=$enableval 397 | fi]) 398 | 399 | dnl Checks for functions. 400 | 401 | if test "x$enable_utf8" != xno; then 402 | AC_CHECK_FUNCS(iswalpha iswalnum iswpunct mbstowcs wctomb) 403 | fi 404 | 405 | AC_CHECK_FUNCS_ONCE(chmod chown fchmod fchown flockfile funlockfile 406 | fork fsync geteuid pipe wait waitpid) 407 | 408 | dnl Checks for available flags. 409 | 410 | AX_CHECK_COMPILE_FLAG([-Wall], [CFLAGS="$CFLAGS -Wall"], [], []) 411 | 412 | dnl Checks for libraries. 413 | 414 | if eval "test x$CURSES_LIB_NAME = x"; then 415 | if test "x$enable_utf8" != xno; then 416 | PKG_CHECK_MODULES([NCURSESW], [ncursesw], [ 417 | CURSES_LIB=$NCURSESW_LIBS 418 | CPPFLAGS="$NCURSESW_CFLAGS $CPPFLAGS" 419 | CURSES_LIB_NAME=ncursesw 420 | CURSES_LIB_WIDE=yes 421 | ], [:]) 422 | else 423 | PKG_CHECK_MODULES([NCURSES], [ncurses], [ 424 | CURSES_LIB=$NCURSES_LIBS 425 | CPPFLAGS="$NCURSES_CFLAGS $CPPFLAGS" 426 | CURSES_LIB_NAME=ncurses 427 | ], [:]) 428 | fi 429 | fi 430 | 431 | if eval "test x$CURSES_LIB_NAME = x"; then 432 | AC_CHECK_HEADERS(ncurses.h) 433 | 434 | if test "x$enable_utf8" != xno; then 435 | OLDLIBS="$LIBS" 436 | AC_CHECK_TOOL(NCURSESW_CONFIG, ncursesw5-config, no) 437 | if test "x$NCURSESW_CONFIG" != xno; then 438 | CURSES_LIB=`$NCURSESW_CONFIG --libs` 439 | LIBS="$CURSES_LIB $LIBS" 440 | CPPFLAGS="`$NCURSESW_CONFIG --cflags` $CPPFLAGS" 441 | AC_CHECK_LIB(ncursesw, wget_wch, [CURSES_LIB_NAME=ncursesw CURSES_LIB_WIDE=yes]) 442 | else 443 | AC_CHECK_LIB(ncursesw, wget_wch, [CURSES_LIB="-lncursesw" CURSES_LIB_NAME=ncursesw CURSES_LIB_WIDE=yes]) 444 | fi 445 | LIBS="$OLDLIBS" 446 | fi 447 | 448 | if eval "test x$CURSES_LIB_NAME = x"; then 449 | AC_CHECK_LIB(ncurses, initscr, [CURSES_LIB="-lncurses" CURSES_LIB_NAME=ncurses]) 450 | fi 451 | fi 452 | 453 | if eval "test x$CURSES_LIB_NAME = x"; then 454 | AC_CHECK_HEADERS(curses.h) 455 | 456 | if test "x$enable_utf8" != xno; then 457 | AC_CHECK_LIB(curses, wget_wch, [CURSES_LIB="-lcurses" CURSES_LIB_NAME=curses CURSES_LIB_WIDE=yes]) 458 | fi 459 | 460 | if eval "test x$CURSES_LIB_NAME = x"; then 461 | AC_CHECK_LIB(curses, initscr, [CURSES_LIB="-lcurses" CURSES_LIB_NAME=curses]) 462 | fi 463 | fi 464 | 465 | if eval "test x$CURSES_LIB_NAME = x"; then 466 | AC_MSG_ERROR([ 467 | *** No curses lib was found. Please install the curses header files 468 | *** from libncurses-dev (Debian), ncurses-devel (Fedora), or similar. 469 | *** (Or install ncurses from https://ftp.gnu.org/gnu/ncurses/.)]) 470 | else 471 | AC_MSG_RESULT([ The curses library to be used is: $CURSES_LIB_NAME]) 472 | fi 473 | 474 | AC_CHECK_LIB([$CURSES_LIB_NAME], [use_default_colors], 475 | [AC_DEFINE(HAVE_USE_DEFAULT_COLORS, 1, [Define this if your curses library has the use_default_colors() function.])], 476 | [], [$CURSES_LIB]) 477 | AC_CHECK_LIB([$CURSES_LIB_NAME], [set_escdelay], 478 | [AC_DEFINE(HAVE_SET_ESCDELAY, 1, [Define this if your curses library has the set_escdelay() function.])], 479 | [], [$CURSES_LIB]) 480 | AC_CHECK_LIB([$CURSES_LIB_NAME], [key_defined], 481 | [AC_DEFINE(HAVE_KEY_DEFINED, 1, [Define this if your curses library has the key_defined() function.])], 482 | [], [$CURSES_LIB]) 483 | 484 | LIBS="$LIBS $CURSES_LIB" 485 | 486 | AC_SUBST(CURSES_LIB) 487 | 488 | if test "x$enable_utf8" != xno && \ 489 | test x$CURSES_LIB_WIDE = xyes && \ 490 | test x$ac_cv_func_iswalpha = xyes && \ 491 | test x$ac_cv_func_iswalnum = xyes && \ 492 | test x$ac_cv_func_iswpunct = xyes && \ 493 | test x$ac_cv_func_mbstowcs = xyes && \ 494 | test x$ac_cv_func_wctomb = xyes; then 495 | AC_DEFINE(ENABLE_UTF8, 1, [Define this if your system has sufficient UTF-8 support.]) 496 | else 497 | if test "x$enable_utf8" = xyes; then 498 | AC_MSG_ERROR([ 499 | *** UTF-8 support was requested, but insufficient support was 500 | *** detected in your curses and/or C libraries. Please verify 501 | *** that both your curses library and your C library were built 502 | *** with wide-character support.]) 503 | elif test "x$enable_utf8" != xno; then 504 | AC_MSG_WARN([ 505 | *** Insufficient UTF-8 support was detected in your curses 506 | *** and/or C libraries. If you want UTF-8 support, please 507 | *** verify that both your curses library and your C library 508 | *** were built with wide-character support.]) 509 | fi 510 | fi 511 | 512 | AC_CACHE_CHECK([for enhanced regular expression flag], nano_cv_flag_reg_enhanced, 513 | [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], 514 | [[ 515 | #ifndef REG_ENHANCED 516 | error: No REG_ENHANCED support! 517 | #endif 518 | ]])], 519 | [nano_cv_flag_reg_enhanced=yes], 520 | [nano_cv_flag_reg_enhanced=no])]) 521 | dnl The bundled gnulib regex module doesn't support REG_ENHANCED. 522 | if test "$ac_use_included_regex" = "yes"; then 523 | nano_cv_flag_reg_enhanced="no" 524 | fi 525 | if test "$nano_cv_flag_reg_enhanced" = "yes"; then 526 | nano_reg_extended="REG_EXTENDED | REG_ENHANCED" 527 | else 528 | nano_reg_extended="REG_EXTENDED" 529 | fi 530 | 531 | AC_DEFINE_UNQUOTED(NANO_REG_EXTENDED, $nano_reg_extended, 532 | [Flag(s) to use to get the full range of extended regular expressions]) 533 | 534 | if test x$color_support = xyes; then 535 | AC_MSG_CHECKING([whether _XOPEN_SOURCE_EXTENDED is needed]) 536 | AC_RUN_IFELSE([AC_LANG_SOURCE([[ 537 | #include 538 | int main(void) 539 | { 540 | int testcolor = COLOR_WHITE; 541 | return 0; 542 | }]])], 543 | AC_MSG_RESULT(no), 544 | AC_RUN_IFELSE([AC_LANG_SOURCE([[ 545 | #ifndef _XOPEN_SOURCE_EXTENDED 546 | #define _XOPEN_SOURCE_EXTENDED 1 547 | #endif 548 | #include 549 | int main(void) 550 | { 551 | int testcolor = COLOR_WHITE; 552 | return 0; 553 | }]])], 554 | AC_DEFINE(NEED_XOPEN_SOURCE_EXTENDED, 1, [Define this if you need the _XOPEN_SOURCE_EXTENDED macro for color support.]) 555 | AC_MSG_RESULT(yes), 556 | AC_MSG_RESULT(not sure) 557 | AC_MSG_WARN([ 558 | *** Couldn't successfully compile basic color test with or without 559 | *** _XOPEN_SOURCE_EXTENDED. This build may not compile. Consider 560 | *** configuring with --disable-color or installing ncurses.])), 561 | AC_MSG_WARN([ 562 | *** Can't check need for _XOPEN_SOURCE_EXTENDED when cross-compiling.])) 563 | fi 564 | 565 | AS_IF([test "x$enable_libmagic" != "xno"], [ 566 | AC_CHECK_HEADERS([magic.h]) 567 | AC_CHECK_LIB(magic, magic_open) 568 | AC_CHECK_HEADERS([zlib.h]) 569 | AC_CHECK_LIB(z, inflate) 570 | ]) 571 | 572 | # Check for groff html support. 573 | AC_MSG_CHECKING([for HTML support in groff]) 574 | groff -t -mandoc -Thtml /dev/null 575 | if test $? -ne 0 ; then 576 | AC_MSG_RESULT([no]) 577 | AC_MSG_WARN([ 578 | *** Will not generate HTML version of man pages. Consider 579 | *** installing a newer version of groff with HTML support.]) 580 | groff_html_support=no 581 | else 582 | AC_MSG_RESULT([yes]) 583 | groff_html_support=yes 584 | fi 585 | AM_CONDITIONAL(GROFF_HTML, test x$groff_html_support = xyes) 586 | 587 | AC_CONFIG_FILES([ 588 | Makefile 589 | doc/Makefile 590 | doc/sample.nanorc 591 | lib/Makefile 592 | m4/Makefile 593 | po/Makefile.in 594 | src/Makefile 595 | syntax/Makefile 596 | ]) 597 | 598 | AC_OUTPUT 599 | 600 | make showinfo 601 | -------------------------------------------------------------------------------- /doc/.gitignore: -------------------------------------------------------------------------------- 1 | nano.1.html 2 | rnano.1.html 3 | nanorc.5.html 4 | texinfo.tex 5 | nano.info 6 | nano.html 7 | nano.pdf 8 | sample.nanorc 9 | -------------------------------------------------------------------------------- /doc/Makefile.am: -------------------------------------------------------------------------------- 1 | SUBDIRS = 2 | BUILT_SOURCES = 3 | 4 | dist_html_DATA = faq.html 5 | 6 | dist_man_MANS = nano.1 rnano.1 7 | html_pages = nano.1.html rnano.1.html 8 | 9 | if USE_NANORC 10 | dist_man_MANS += nanorc.5 11 | html_pages += nanorc.5.html 12 | endif 13 | 14 | nano.1.html: nano.1 15 | groff -t -mandoc -Thtml < $? > $@ 16 | nanorc.5.html: nanorc.5 17 | groff -t -mandoc -Thtml < $? > $@ 18 | rnano.1.html: rnano.1 19 | groff -t -mandoc -Thtml < $? > $@ 20 | 21 | if GROFF_HTML 22 | BUILT_SOURCES += $(html_pages) 23 | dist_html_DATA += $(html_pages) 24 | endif 25 | 26 | info_TEXINFOS = nano.texi 27 | 28 | BUILT_SOURCES += nano.html 29 | dist_html_DATA += nano.html 30 | 31 | AM_MAKEINFOHTMLFLAGS = --no-split -c HEADERS=0 32 | 33 | EXTRA_DIST = $(BUILT_SOURCES) $(info_TEXINFOS) 34 | -------------------------------------------------------------------------------- /doc/cheatsheet.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Cheatsheet for GNU nano 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |

Overview of nano's shortcuts        

16 |

The editor's keystrokes and their functions             

17 |
18 | 19 | 20 | 136 |
21 | 22 | File handling 23 | 24 | 25 | 26 | 27 | 28 |
Ctrl+S   Save current file
Ctrl+OOffer to write file ("Save as")
Ctrl+RInsert a file into current one
Ctrl+XClose buffer, exit from nano
29 |
30 | 31 | Editing 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 |
Ctrl+K   Cut current line into cutbuffer
Alt+6Copy current line into cutbuffer
Ctrl+UPaste contents of cutbuffer
Ctrl+]Complete current word
Alt+3Comment/uncomment line/region
Alt+UUndo last action
Alt+ERedo last undone action
41 |
42 | 43 | Search and replace 44 | 45 | 46 | 47 | 48 | 49 | 50 |
Ctrl+B   Start backward search
Ctrl+FStart forward search
Alt+BFind next occurrence backward
Alt+FFind next occurrence forward
Alt+RStart a replacing session
51 |
52 | 53 | Deletion 54 | 55 | 56 | 57 | 58 | 59 | 60 |
Ctrl+HDelete character before cursor      
Ctrl+DDelete character under cursor
Alt+BspDelete word to the left
Ctrl+Del   Delete word to the right
Alt+DelDelete current line
61 |
62 | 63 | Operations 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 |
Ctrl+T   Execute some command
Ctrl+T Ctrl+SRun a spell check
Ctrl+T Ctrl+YRun a syntax check
Ctrl+T Ctrl+O  Run a formatter
TabIndent marked region
Shift+Tab   Unindent marked region
Ctrl+JJustify paragraph or region
Alt+JJustify entire buffer
Alt+TCut until end of buffer
Alt+:Start/stop recording of macro      
Alt+;Replay macro
77 |
78 | 79 |
80 | 81 | Moving around 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 |
One character backward
One character forward
Ctrl+One word backward
Ctrl+One word forward
Ctrl+ATo start of line
Ctrl+ETo end of line
Ctrl+POne line up
Ctrl+NOne line down
Ctrl+To previous block
Ctrl+To next block
Alt+Home  To first row in viewport
Alt+EndTo last row in viewport
Ctrl+YOne page up
Ctrl+VOne page down
Alt+\To top of buffer
Alt+/To end of buffer
100 |
101 | 102 | Special movement 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 |
Alt+G     Go to specified line
Alt+]Go to complementary bracket
Alt+Scroll viewport up
Alt+Scroll viewport down
Alt+<Switch to preceding buffer
Alt+>Switch to succeeding buffer
111 |
112 | 113 | Information 114 | 115 | 116 | 117 | 118 |
Ctrl+C   Report cursor position
Alt+DReport line/word/character counts
Ctrl+GDisplay help text
119 |
120 | 121 | Various 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 |
Alt+A     Set or unset the mark
Alt+VEnter next keystroke verbatim
Alt+CTurn constant position info on/off
Alt+NTurn line numbers on/off
Alt+PTurn visible whitespace on/off
Alt+STurn softwrapping on/off
Alt+XHide/unhide the help lines
Alt+ZHide/unhide the info bars
Ctrl+LRefresh the screen
133 |
134 | 135 |
137 | 138 | 139 | 140 | 141 | -------------------------------------------------------------------------------- /doc/rnano.1: -------------------------------------------------------------------------------- 1 | .\" Copyright (C) 2002-2007, 2014-2025 Free Software Foundation, Inc. 2 | .\" 3 | .\" This document is dual-licensed. You may distribute and/or modify it 4 | .\" under the terms of either of the following licenses: 5 | .\" 6 | .\" * The GNU General Public License, as published by the Free Software 7 | .\" Foundation, version 3 or (at your option) any later version. You 8 | .\" should have received a copy of the GNU General Public License 9 | .\" along with this program. If not, see 10 | .\" . 11 | .\" 12 | .\" * The GNU Free Documentation License, as published by the Free 13 | .\" Software Foundation, version 1.2 or (at your option) any later 14 | .\" version, with no Invariant Sections, no Front-Cover Texts, and no 15 | .\" Back-Cover Texts. You should have received a copy of the GNU Free 16 | .\" Documentation License along with this program. If not, see 17 | .\" . 18 | .\" 19 | .TH RNANO 1 "version 8.6" "August 2025" 20 | 21 | .SH NAME 22 | rnano \- a restricted nano 23 | 24 | .SH SYNOPSIS 25 | .B rnano 26 | .RI [ options "] [[+" line [, column "]]\ " file "]..." 27 | 28 | .SH DESCRIPTION 29 | \fBrnano\fR runs the \fBnano\fR editor in restricted mode. This allows 30 | editing only the specified file or files, and doesn't allow the user 31 | access to the filesystem nor to a command shell. 32 | .sp 33 | In restricted mode, \fBnano\fR will: 34 | .IP \[bu] 2 35 | not make backups; 36 | .IP \[bu] 37 | not allow suspending; 38 | .IP \[bu] 39 | not allow spell checking; 40 | .IP \[bu] 41 | not read nor write the history files; 42 | .IP \[bu] 43 | not allow saving the current buffer under a different name; 44 | .IP \[bu] 45 | not allow inserting another file or opening a new buffer; 46 | .IP \[bu] 47 | not allow appending or prepending to any file. 48 | 49 | .SH OPTIONS 50 | .TP 51 | .BR \-h ", " \-\-help 52 | Show the available command-line options and exit. 53 | .P 54 | For all existing options, see the \fBnano\fR(1) man page. 55 | 56 | .SH BUGS 57 | Please report bugs via 58 | .IR https://savannah.gnu.org/bugs/?group=nano . 59 | 60 | .SH HOMEPAGE 61 | .I https://nano-editor.org/ 62 | 63 | .SH SEE ALSO 64 | .BR nano (1) 65 | -------------------------------------------------------------------------------- /doc/sample.nanorc.in: -------------------------------------------------------------------------------- 1 | ## Sample initialization file for GNU nano. 2 | ## 3 | ## For the options that take parameters, the default value is shown. 4 | ## Other options are unset by default. To make sure that an option 5 | ## is disabled, you can use "unset