Merge remote-tracking branch 'upstream/master' into line-folding
This commit is contained in:
65
ChangeLog
65
ChangeLog
@@ -1,3 +1,68 @@
|
||||
Changes between v8.0 and v8.1:
|
||||
------------------------------
|
||||
|
||||
Benno Schulenberg (56):
|
||||
bindings: let ^L put the cursor line at center, then top, then bottom
|
||||
build: check for the correct function in an #ifdef
|
||||
build: require version 0.20 of gettext for building nano from git
|
||||
build: use the standard `autoreconf` invocation
|
||||
bump version numbers and add a news item for the 8.1 release
|
||||
docs: add 'set colonparsing' to the sample nanorc
|
||||
docs: add the Alt+Home/Alt+End shortcuts to the cheatsheet
|
||||
docs: avert hyphenation of the technical words "ncurses" and "terminfo"
|
||||
docs: correct the description of --bold, as function tags are unaffected
|
||||
docs: document the new --listsyntaxes (-z) option
|
||||
docs: don't say any more that -z was removed, as it has been repurposed
|
||||
docs: explain the behavior of the new function `cycle`
|
||||
docs: explain the details of --colonparsing / -@ / 'set colonparsing'
|
||||
docs: extend the FAQ item about urxvt modified keys, with M-Home/M-End
|
||||
docs: properly escape a literal '@' in the texi document
|
||||
docs: remove the 'filename:linenumber' format from the synopsis
|
||||
files: avoid mistakenly setting the column number to a given line number
|
||||
files: look for digits and colons starting from the end of the filename
|
||||
files: when a filename with a colon and digits exists, open that file
|
||||
files: with --rectrict, prevent invoking the browser and toggling backups
|
||||
general: disable the type-ahead checking that ncurses normally does
|
||||
gnulib: update to its current upstream state
|
||||
help: regroup the `center` item, placing it with the new `cycle`
|
||||
help: show option -Y/--syntax in --help output also in restricted mode
|
||||
input: drop recognition of the urxvt escape sequences for M-Home/M-End
|
||||
input: make sure that a string-bind return value is non-negative
|
||||
input: provide for urxvt setting a high bit or sending an extra escape
|
||||
input: recognize the raw Xterm escape sequences for Alt+Home and Alt+End
|
||||
minibar: do not falsely report that a new, empty file is in Mac format
|
||||
moving: use edit_scroll() only when scrolling one row is enough
|
||||
new feature: add bindable function `cycle` that pushes cursor line around
|
||||
new feature: option -z lists the names of available syntaxes
|
||||
options: remove the deprecated synonym -$ of -S/--softwrap
|
||||
options: require --colonparsing/-@ to parse colon+number after a filename
|
||||
rcfile: remove old bindable function 'nowrap', alias of 'breaklonglines'
|
||||
startup: do not activate --modernbindings when name starts with "e"
|
||||
syntaxes: mention the original author of most of the syntax files
|
||||
syntax: man: colorize some of the things that manipulate hyphenation
|
||||
syntax: patch: recognize also the .rej extension
|
||||
text: do not check for <Tab> + mark while getting input but in do_tab()
|
||||
tweaks: add a space after a '+', for consistent formatting
|
||||
tweaks: discard a bracketed paste in the help viewer with fewer beeps
|
||||
tweaks: drop two redundant conditions
|
||||
tweaks: elide unhelpful occurrences of the word "will"
|
||||
tweaks: exclude the colon-parsing code from the tiny version
|
||||
tweaks: extend the deprecation period of 'set nowrap' and prefix 'bright'
|
||||
tweaks: implement do_center() with a single call instead of three
|
||||
tweaks: in FAQ, use 'id' attribute instead of empty anchor with 'name'
|
||||
tweaks: make a comment more accurate, and unabbreviate a variable name
|
||||
tweaks: make the inclusion condition for do_center() more strict
|
||||
tweaks: remove the now unneeded special keycode INDENT_KEY
|
||||
tweaks: reshuffle a declaration, adjust a comment, normalize indentation
|
||||
tweaks: reshuffle some lines, to put vaguely related things together
|
||||
tweaks: rewrap some lines, for more even lengths
|
||||
tweaks: simplify a condition, to match the same condition five lines back
|
||||
tweaks: slightly reword a phrase in the explanation of --colonparsing
|
||||
|
||||
Jaroslav Fowkes (1):
|
||||
syntax: fortran: fix a typo (a missing backslash)
|
||||
|
||||
|
||||
Changes between v7.2 and v8.0:
|
||||
------------------------------
|
||||
|
||||
|
||||
@@ -7,7 +7,8 @@ Since 8.0:
|
||||
^Z undo, ^Y redo, ^O open a file, and ^G find again, among others.
|
||||
- M-Home/M-End put the cursor on the first/last row in the viewport.
|
||||
- With `nano filename:number` the given file will be opened with the
|
||||
cursor on the given line number.
|
||||
cursor on the given line number (when 'set colonparsing' is used).
|
||||
- Option --listsyntaxes lists the names of available syntaxes.
|
||||
|
||||
Since 7.0:
|
||||
- String binds may contain bindable function names between braces.
|
||||
|
||||
10
NEWS
10
NEWS
@@ -1,3 +1,13 @@
|
||||
2024.07.12 - GNU nano 8.1 "de dag van de bitterkoekjespudding"
|
||||
• The idiom `nano filename:linenumber` is understood only when the
|
||||
option --colonparsing (or 'set colonparsing') is used.
|
||||
• Modern bindings are *not* activated when nano's invocation name
|
||||
starts with "e", as it jars with Debian's alternatives system.
|
||||
• New bindable function 'cycle' first centers the current row,
|
||||
then moves it to the top of the viewport, then to the bottom.
|
||||
It is bound by default to ^L.
|
||||
• Option --listsyntaxes/-z lists the names of available syntaxes.
|
||||
|
||||
2024.05.01 - GNU nano 8.0 "Grus grus"
|
||||
• By default ^F is bound to starting a forward search, and ^B to
|
||||
starting a backward search, while M-F and M-B repeat the search
|
||||
|
||||
2
README
2
README
@@ -15,7 +15,7 @@ Appearance
|
||||
In rough ASCII graphics, this is what nano's screen looks like:
|
||||
|
||||
____________________________________________________________________
|
||||
| GNU nano 8.0 filename Modified |
|
||||
| GNU nano 8.1 filename Modified |
|
||||
--------------------------------------------------------------------
|
||||
| This is the text window, displaying the contents of a 'buffer', |
|
||||
| the contents of the file you are editing. |
|
||||
|
||||
@@ -12,9 +12,9 @@ To successfully compile GNU nano from git, you'll need the following:
|
||||
|
||||
autoconf (version >= 2.69)
|
||||
automake (version >= 1.14)
|
||||
autopoint (version >= 0.18.3)
|
||||
autopoint (version >= 0.20)
|
||||
gcc (version >= 5.0)
|
||||
gettext (version >= 0.18.3)
|
||||
gettext (version >= 0.20)
|
||||
git (version >= 2.7.4)
|
||||
groff (version >= 1.12)
|
||||
make (any version)
|
||||
|
||||
15
autogen.sh
15
autogen.sh
@@ -2,7 +2,7 @@
|
||||
# Generate configure & friends for GIT users.
|
||||
|
||||
gnulib_url="git://git.sv.gnu.org/gnulib.git"
|
||||
gnulib_hash="f948d1813a3545c75ba79087e6cb52b51d44dfe6"
|
||||
gnulib_hash="0ba13435a9362bec0ff5fd0830907b9fac723e41"
|
||||
|
||||
modules="
|
||||
canonicalize-lgpl
|
||||
@@ -43,20 +43,11 @@ if [ "${gnulib_hash}" != "${curr_hash}" ]; then
|
||||
fi
|
||||
cd .. >/dev/null || exit 1
|
||||
|
||||
echo "Autopoint..."
|
||||
autopoint --force
|
||||
|
||||
rm -rf lib
|
||||
echo "Gnulib-tool..."
|
||||
./gnulib/gnulib-tool --import ${modules}
|
||||
echo
|
||||
|
||||
echo "Aclocal..."
|
||||
aclocal -I m4
|
||||
echo "Autoconf..."
|
||||
autoconf
|
||||
echo "Autoheader..."
|
||||
autoheader
|
||||
echo "Automake..."
|
||||
automake --add-missing
|
||||
echo "Autoreconf..."
|
||||
autoreconf --install --symlink --force
|
||||
echo "Done."
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see https://www.gnu.org/licenses/.
|
||||
|
||||
AC_INIT([GNU nano], [8.0], [nano-devel@gnu.org], [nano])
|
||||
AC_INIT([GNU nano], [8.1], [nano-devel@gnu.org], [nano])
|
||||
AC_CONFIG_SRCDIR([src/nano.c])
|
||||
AC_CANONICAL_HOST
|
||||
AM_INIT_AUTOMAKE([1.14])
|
||||
@@ -48,7 +48,7 @@ PKG_PROG_PKG_CONFIG
|
||||
|
||||
dnl Internationalization macros.
|
||||
|
||||
AM_GNU_GETTEXT_VERSION([0.18.3])
|
||||
AM_GNU_GETTEXT_VERSION([0.20])
|
||||
AM_GNU_GETTEXT([external], [need-ngettext])
|
||||
AM_CONDITIONAL(USE_NLS, test x$USE_NLS = xyes)
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
|
||||
<b>Search and replace</b>
|
||||
<table><tbody>
|
||||
<tr><td>Ctrl+B </td><td>Start backward search</td></tr>
|
||||
<tr><td>Ctrl+B </td><td>Start backward search</td></tr>
|
||||
<tr><td>Ctrl+F</td><td>Start forward search</td></tr>
|
||||
<tr><td>Alt+B</td><td>Find next occurrence backward</td></tr>
|
||||
<tr><td>Alt+F</td><td>Find next occurrence forward</td></tr>
|
||||
@@ -70,6 +70,7 @@
|
||||
<tr><td>Shift+Tab </td><td>Unindent marked region</td></tr>
|
||||
<tr><td>Ctrl+J</td><td>Justify paragraph or region</td></tr>
|
||||
<tr><td>Alt+J</td><td>Justify entire buffer</td></tr>
|
||||
<tr><td>Alt+T</td><td>Cut until end of buffer</td></tr>
|
||||
<tr><td>Alt+:</td><td>Start/stop recording of macro </td></tr>
|
||||
<tr><td>Alt+;</td><td>Replay macro</td></tr>
|
||||
</tbody></table>
|
||||
@@ -83,12 +84,14 @@
|
||||
<tr><td><b>→</b></td><td>One character forward</td></tr>
|
||||
<tr><td>Ctrl+<b>←</b></td><td>One word backward</td></tr>
|
||||
<tr><td>Ctrl+<b>→</b></td><td>One word forward</td></tr>
|
||||
<tr><td>Ctrl+A </td><td>To start of line</td></tr>
|
||||
<tr><td>Ctrl+A</td><td>To start of line</td></tr>
|
||||
<tr><td>Ctrl+E</td><td>To end of line</td></tr>
|
||||
<tr><td>Ctrl+P</td><td>One line up</td></tr>
|
||||
<tr><td>Ctrl+N</td><td>One line down</td></tr>
|
||||
<tr><td>Ctrl+<b>↑</b></td><td>To previous block</td></tr>
|
||||
<tr><td>Ctrl+<b>↓</b></td><td>To next block</td></tr>
|
||||
<tr><td>Alt+Home </td><td>To first row in viewport</td></tr>
|
||||
<tr><td>Alt+End</td><td>To last row in viewport</td></tr>
|
||||
<tr><td>Ctrl+Y</td><td>One page up</td></tr>
|
||||
<tr><td>Ctrl+V</td><td>One page down</td></tr>
|
||||
<tr><td>Alt+\</td><td>To top of buffer</td></tr>
|
||||
@@ -98,7 +101,7 @@
|
||||
|
||||
<b>Special movement</b>
|
||||
<table><tbody>
|
||||
<tr><td>Alt+G </td><td>Go to specified line</td></tr>
|
||||
<tr><td>Alt+G </td><td>Go to specified line</td></tr>
|
||||
<tr><td>Alt+]</td><td>Go to complementary bracket</td></tr>
|
||||
<tr><td>Alt+<b>↑</b></td><td>Scroll viewport up</td></tr>
|
||||
<tr><td>Alt+<b>↓</b></td><td>Scroll viewport down</td></tr>
|
||||
@@ -117,8 +120,7 @@
|
||||
|
||||
<b>Various</b>
|
||||
<table><tbody>
|
||||
<tr><td>Alt+A</td><td>Turn the mark on/off</td></tr>
|
||||
<tr><td>Alt+T </td><td>Cut until end of buffer</td></tr>
|
||||
<tr><td>Alt+A </td><td>Set or unset the mark</td></tr>
|
||||
<tr><td>Alt+V</td><td>Enter next keystroke verbatim</td></tr>
|
||||
<tr><td>Alt+C</td><td>Turn constant position info on/off</td></tr>
|
||||
<tr><td>Alt+N</td><td>Turn line numbers on/off</td></tr>
|
||||
|
||||
102
doc/faq.html
102
doc/faq.html
@@ -76,10 +76,10 @@
|
||||
</p></blockquote>
|
||||
<hr width="100%">
|
||||
|
||||
<h1><a name="1"></a>1. General</h1>
|
||||
<h3><a name="1.1"></a>1.1. What is GNU nano?</h3>
|
||||
<h1 id="1">1. General</h1>
|
||||
<h3 id="1.1">1.1. What is GNU nano?</h3>
|
||||
<blockquote><p>GNU nano was designed to be a free replacement for the Pico text editor, part of the Pine email suite from <a href="http://www.washington.edu/pine/">The University of Washington</a>. It aimed to "emulate Pico as closely as is reasonable and then include extra functionality".</p></blockquote>
|
||||
<h3><a name="1.2"></a>1.2. What is the history behind nano?</h3>
|
||||
<h3 id="1.2">1.2. What is the history behind nano?</h3>
|
||||
<blockquote><p>Funny you should ask!</p>
|
||||
<p><b>In the beginning...</b></p>
|
||||
<p>For years Pine was THE program used to read email on a Unix system. The Pico text editor is the portion of the program one would use to compose his or her mail messages. Many beginners to Unix flocked to Pico and Pine because of their well organized, easy to use interfaces. With the proliferation of GNU/Linux in the mid to late 90's, many University students became intimately familiar with the strengths (and weaknesses) of Pine and Pico.</p>
|
||||
@@ -89,30 +89,30 @@
|
||||
<p>It was in late 1999 when Chris Allegretta (our hero) was yet again complaining to himself about the less-than-perfect license Pico was distributed under, the 1000 makefiles that came with it and how just a few small improvements could make it the Best Editor in the World (TM). Having been a convert from Slackware to Debian, he missed having a simple binary package that included Pine and Pico, and had grown tired of downloading them himself.</p>
|
||||
<p>Finally something snapped inside and Chris coded and hacked like a madman for many hours straight one weekend to make a (barely usable) Pico clone, at the time called TIP (Tip Isn't Pico). The program could not be invoked without a filename, could not save files, had no help text display, spell checker, and so forth. But over time it improved, and with the help of a few great coders it matured to the (hopefully) stable state it is in today.</p>
|
||||
<p>In February 2001, nano was declared an official GNU program by Richard Stallman. nano also reached its first production release on March 22, 2001.</p></blockquote>
|
||||
<h3><a name="1.3"></a>1.3. Why the name change from TIP?</h3>
|
||||
<h3 id="1.3">1.3. Why the name change from TIP?</h3>
|
||||
<blockquote><p>On January 10, 2000, TIP was officially renamed to nano because of a namespace conflict with another program called 'tip'. The original 'tip' program "establishes a full duplex terminal connection to a remote host", and was included with many older Unix systems (and newer ones like Solaris). The conflict was not noticed at first because there is no 'tip' utility included with most GNU/Linux distributions (where nano was developed).</p></blockquote>
|
||||
<h3><a name="1.4"></a>1.4. What is the current version of nano?</h3>
|
||||
<blockquote><p>The current version of nano <i>should</i> be <b>8.0</b>. Of course, you should always check the <a href="https://nano-editor.org/">nano homepage</a> to see what the latest and greatest version is.</p></blockquote>
|
||||
<h3><a name="1.5"></a>1.5. I want to read the man page without having to download the program!</h3>
|
||||
<h3 id="1.4">1.4. What is the current version of nano?</h3>
|
||||
<blockquote><p>The current version of nano <i>should</i> be <b>8.1</b>. Of course, you should always check the <a href="https://nano-editor.org/">nano homepage</a> to see what the latest and greatest version is.</p></blockquote>
|
||||
<h3 id="1.5">1.5. I want to read the man page without having to download the program!</h3>
|
||||
<blockquote><p>Jeez, demanding, aren't we? Okay, look <a href="https://nano-editor.org/dist/latest/nano.1.html">here</a>.</p></blockquote>
|
||||
<hr width="100%">
|
||||
|
||||
<h1><a name="2"></a>2. Where to get GNU nano.</h1>
|
||||
<h3><a name="2.1"></a>2.1. Web sites that carry nano.</h3>
|
||||
<h1 id="2">2. Where to get GNU nano.</h1>
|
||||
<h3 id="2.1">2.1. Web sites that carry nano.</h3>
|
||||
<blockquote><p>The nano source tarballs can be downloaded from the following web sites:</p>
|
||||
<ul>
|
||||
<li><a href="https://nano-editor.org/dist/latest/">https://nano-editor.org/dist/latest/</a></li>
|
||||
<li><a href="https://ftpmirror.gnu.org/gnu/nano/">https://ftpmirror.gnu.org/gnu/nano/</a></li>
|
||||
</ul>
|
||||
</blockquote>
|
||||
<h3><a name="2.2"></a>2.2. RPM packages (RedHat, OpenSuse, and derivatives).</h3>
|
||||
<h3 id="2.2">2.2. RPM packages (RedHat, OpenSuse, and derivatives).</h3>
|
||||
<blockquote>
|
||||
<ul>
|
||||
<li><a href="https://kojipkgs.fedoraproject.org//packages/nano/">https://kojipkgs.fedoraproject.org//packages/nano/</a></li>
|
||||
<li><a href="https://software.opensuse.org/package/nano">https://software.opensuse.org/package/nano</a></li>
|
||||
</ul>
|
||||
</blockquote>
|
||||
<h3><a name="2.3"></a>2.3. Deb packages (Debian and derivatives):</h3>
|
||||
<h3 id="2.3">2.3. Deb packages (Debian and derivatives):</h3>
|
||||
<blockquote><p>Debian users can check out the current nano packages for:</p>
|
||||
<ul>
|
||||
<li><a href="https://packages.debian.org/stable/editors/nano">stable</a></li>
|
||||
@@ -121,14 +121,14 @@
|
||||
</ul>
|
||||
<p>You can also have a look at the <a href="http://ftp.debian.org/debian/pool/main/n/nano/">Package Pool</a> to see all the available binary and source packages.</p>
|
||||
</blockquote>
|
||||
<h3><a name="2.4"></a>2.4. By git (for the brave).</h3>
|
||||
<h3 id="2.4">2.4. By git (for the brave).</h3>
|
||||
<blockquote><p>For the "bleeding edge" current version of nano, you can use <b>git</b> to download the current source code. <i>Note:</i> believe it or not, by downloading code that has not yet stabilized into an official release, there could quite possibly be bugs, in fact the code may not even compile! Anyway, see <a href="http://git.savannah.gnu.org/cgit/nano.git/tree/README.hacking">the hacking document</a> for info on getting and building nano from git.</p></blockquote>
|
||||
<hr width="100%">
|
||||
|
||||
<h1><a name="3"></a>3. Installation and Configuration</h1>
|
||||
<h3><a name="3.1"></a>3.1. How do I install the RPM or DEB package?</h3>
|
||||
<h1 id="3">3. Installation and Configuration</h1>
|
||||
<h3 id="3.1">3.1. How do I install the RPM or DEB package?</h3>
|
||||
<blockquote><p>It's simple really! As root, type <b>rpm -Uvh nano-x.y-1*.rpm</b> if you have a RedHat-ish system or <b>dpkg -i nano_x.y-1*.deb</b> if you have a Debian-ish system, where <b>x.y</b> is the version number of nano. There are other programs to install packages, and if you wish to use those, knock yourself out.</p></blockquote>
|
||||
<h3><a name="3.2"></a>3.2. Compiling from source: WHAT THE HECK DO I DO NOW?</h3>
|
||||
<h3 id="3.2">3.2. Compiling from source: WHAT THE HECK DO I DO NOW?</h3>
|
||||
<blockquote><p>Okay, take a deep breath, this really isn't hard. Unpack the nano source with a command like:</p>
|
||||
<p class="indented"><b>tar -xvf nano-x.y.tar.gz</b></p>
|
||||
<p>Then you need to run <b>configure</b> with any options you might want (if any).</p>
|
||||
@@ -137,13 +137,13 @@
|
||||
<b>./configure</b><br>
|
||||
<b>make</b><br>
|
||||
<b>make install</b> #(as root, of course)</p></blockquote>
|
||||
<h3><a name="3.3"></a>3.3. Why does everything go into /usr/local?</h3>
|
||||
<h3 id="3.3">3.3. Why does everything go into /usr/local?</h3>
|
||||
<blockquote><p>Well, that's what the <b>configure</b> script defaults to. If you wish to change this, simply do this:</p>
|
||||
<p class="indented"><b>./configure --prefix=/usr</b></p>
|
||||
<p>This will put nano into /usr/bin when you run <b>make install</b>.</p></blockquote>
|
||||
<h3><a name="3.4"></a>3.4. nano should automatically run strip on the binary when installing it!</h3>
|
||||
<h3 id="3.4">3.4. nano should automatically run strip on the binary when installing it!</h3>
|
||||
<blockquote><p>It does when you use <b>make install-strip</b>. The default <b>make install</b> does not, and will not, run strip automatically.</p></blockquote>
|
||||
<h3><a name="3.5"></a>3.5. How can I make the executable smaller? This is too bloated!</h3>
|
||||
<h3 id="3.5">3.5. How can I make the executable smaller? This is too bloated!</h3>
|
||||
<blockquote><p>Actually, there are several parts of the editor that can be disabled. You can pass arguments to the <b>configure</b> script that disable certain features. Here's a brief list:</p>
|
||||
<pre>
|
||||
<b>--disable-browser</b> Disable the built-in file browser
|
||||
@@ -167,20 +167,20 @@
|
||||
<b>--disable-wrapping</b> Disable all hard-wrapping of text</pre>
|
||||
<p>There's also the <b>--enable-tiny</b> option which disables everything above, as well as some larger chunks of the program (like the undo/redo code and the code for selecting text). Also, if you know you don't need other languages, you can use <b>--disable-nls</b> to disable internationalization and save a few kilobytes. And finally, there's always good old <b>strip</b> to remove all unneeded symbols.</p>
|
||||
</blockquote>
|
||||
<h3><a name="3.6"></a>3.6. Tell me more about this multibuffer stuff!</h3>
|
||||
<h3 id="3.6">3.6. Tell me more about this multibuffer stuff!</h3>
|
||||
<blockquote><p>To use multiple file buffers, you must not have configured nano with <b>--disable-multibuffer</b> nor with <b>--enable-tiny</b> (use <b>nano -V</b> to check the compilation options). Then when you want to insert a file into its own buffer instead of into the current file, just hit <b>Meta-F</b> after typing <b>^R</b>. If you always want files to be loaded into their own buffers, use the <b>-F</b> or <b>--multibuffer</b> flag when you invoke nano, or add <b>set multibuffer</b> to your .nanorc file.</p>
|
||||
<p>You can move between the buffers you have open with the <b>Meta-<</b> and <b>Meta-></b> keys, or more easily without holding Shift: <b>Meta-,</b> and <b>Meta-.</b> (clear as mud, right? =-). When you have more than one buffer open, the ^X shortcut will say "Close", instead of "Exit".</p></blockquote>
|
||||
<h3><a name="3.7"></a>3.7. Tell me more about this verbatim input stuff!</h3>
|
||||
<h3 id="3.7">3.7. Tell me more about this verbatim input stuff!</h3>
|
||||
<blockquote><p>When you want to insert a literal character into the file you're editing, such as a control character that nano usually treats as a command, first press <b>Meta-V</b> (if you're not at a prompt, you'll get the message "Verbatim Input" on the status bar), then press the key(s) that generate the character you want.</p>
|
||||
<p>Alternatively, if Unicode support is enabled (see section <a href="#5.3">5.3</a>), you can press <b>Meta-V</b> and then type a six-digit hexadecimal code (from 000000 to 10FFFF, case-insensitive), and the character with the corresponding value will be inserted. The status bar will change to "Unicode Input: ......" when you do this.</p></blockquote>
|
||||
<h3><a name="3.8"></a>3.8. How do I make a .nanorc file that will be read when I start nano?</h3>
|
||||
<h3 id="3.8">3.8. How do I make a .nanorc file that will be read when I start nano?</h3>
|
||||
<blockquote><p>It's not hard at all! Simply copy the <b>sample.nanorc</b> from the doc/ directory in the nano source package (or from /usr/doc/nano on your system) to <b>.nanorc</b> in your home directory, and then edit it. If you didn't get a sample nanorc, the syntax of the file is simple: features are turned on and off by using the words <b>set</b> and <b>unset</b> followed by the long option name of the feature (see <b>man nanorc</b> for the full list of options). For example, "set quickblank" or "set smarthome". Of course, for this to work, your nano must <b>not</b> have been compiled with <b>--disable-nanorc</b>.</p></blockquote>
|
||||
<h3><a name="3.9"></a>3.9. Why does my self-compiled nano not read /etc/nanorc?</h3>
|
||||
<blockquote><p>By default (see <a href="#3.3">3.3</a>), nano gets installed into /usr/local. This also means that, at startup, nano will read <b>/usr/local/etc/nanorc</b> instead of <b>/etc/nanorc</b>. You can make a symlink from the former to the latter if you want your self-compiled nano to read the same nanorc as the system-installed nano. Or you can configure your nano to overwrite the system nano (again, see <a href="#3.3">3.3</a>).</p></blockquote>
|
||||
<h3 id="3.9">3.9. Why does my self-compiled nano not read /etc/nanorc?</h3>
|
||||
<blockquote><p>By default (see <a href="#3.3">3.3</a>), nano gets installed into /usr/local. This also means that, at startup, nano reads <b>/usr/local/etc/nanorc</b> instead of <b>/etc/nanorc</b>. You can make a symlink from the former to the latter if you want your self-compiled nano to read the same nanorc as the system-installed nano. Or you can configure your nano to overwrite the system nano (again, see <a href="#3.3">3.3</a>).</p></blockquote>
|
||||
<hr width="100%">
|
||||
|
||||
<h1><a name="4"></a>4. Running</h1>
|
||||
<h3><a name="4.1"></a>4.1. Alt+Up does nothing on a Linux console. How can I make it scroll?</h3>
|
||||
<h1 id="4">4. Running</h1>
|
||||
<h3 id="4.1">4.1. Alt+Up does nothing on a Linux console. How can I make it scroll?</h3>
|
||||
<blockquote><p>On Debian and its derivatives, the <b>Alt+Up</b> keystroke on a Linux console
|
||||
produces by default a 'KeyboardSignal', which normally does absolutely nothing and is useless
|
||||
for the average user. To get the keystroke to do what it ought to do (scroll the viewport
|
||||
@@ -193,7 +193,7 @@
|
||||
sed -i 's/KeyboardSignal/Up/' ${file%.gz};<br>
|
||||
gzip ${file%.gz};<br>
|
||||
done</b></p></blockquote>
|
||||
<h3><a name="4.2"></a>4.2. How can I make Ctrl+Shift+Left/Right select words on urxvt?</h3>
|
||||
<h3 id="4.2">4.2. How can I make Ctrl+Shift+Left/Right select words on urxvt?</h3>
|
||||
<blockquote><p>The urxvt terminal emulator produces non-standard escape sequences for the modified cursor keys. These deviant sequences are not listed in the terminfo database, which means that ncurses does not recognize them. The easiest way around this is to tell urxvt to produce xterm-compatible escape sequences for the relevant keystrokes. To achieve this, add the following lines to your ~/.Xresources file:</p>
|
||||
<pre>
|
||||
URxvt.iso14755_52: False
|
||||
@@ -217,21 +217,21 @@
|
||||
URxvt.keysym.M-Page_Up: \033[5;3~
|
||||
URxvt.keysym.M-Page_Down: \033[6;3~</pre>
|
||||
<p>Then run <b>xrdb ~/.Xresources</b> and restart your urxvt terminal. Now <b>Ctrl+Shift+Left</b> and <b>Ctrl+Shift+Right</b> will select words, <b>Alt+Up</b> and <b>Alt+Down</b> will scroll the text without moving the cursor, and several such things more.</p></blockquote>
|
||||
<h3><a name="4.3"></a>4.3. Ack! My numeric keypad's keys don't work properly when NumLock is off! What can I do?</h3>
|
||||
<h3 id="4.3">4.3. Ack! My numeric keypad's keys don't work properly when NumLock is off! What can I do?</h3>
|
||||
<blockquote><p>You can use the <b>-K</b> or <b>--rawsequences</b> option on the command line, or add the line <b>set rawsequences</b> to your .nanorc. However, nano's mouse support will be disabled if you do any of these things.</p></blockquote>
|
||||
<h3><a name="4.4"></a>4.4. With what keystroke can I paste text from the clipboard into nano?</h3>
|
||||
<blockquote><p>In most desktop environments <b>Shift+Insert</b> will paste the contents of the clipboard.</p></blockquote>
|
||||
<h3><a name="4.5"></a>4.5. How do I select text for or paste text from the clipboard when nano's mouse support is turned on?</h3>
|
||||
<h3 id="4.4">4.4. With what keystroke can I paste text from the clipboard into nano?</h3>
|
||||
<blockquote><p>In most desktop environments <b>Shift+Insert</b> pastes the contents of the clipboard.</p></blockquote>
|
||||
<h3 id="4.5">4.5. How do I select text for or paste text from the clipboard when nano's mouse support is turned on?</h3>
|
||||
<blockquote><p>Try holding down the Shift key and selecting or pasting the text as you normally would.</p></blockquote>
|
||||
<h3><a name="4.6"></a>4.6. When I paste text into a document, each line gets indented further than the last. Why? And how can I stop this?</h3>
|
||||
<h3 id="4.6">4.6. When I paste text into a document, each line gets indented further than the last. Why? And how can I stop this?</h3>
|
||||
<blockquote><p>You have the <i>autoindent</i> feature turned on. Hit <b>Meta-I</b> to turn it off, paste your text, and then hit <b>Meta-I</b> again to turn it back on.</p>
|
||||
<p><i>Update:</i> Since version 4.8, nano will suppress auto-indentation during a paste (when your terminal understands <a href="https://en.wikipedia.org/wiki/Bracketed-paste">bracketed pastes</a>), so you no longer need to toggle it off and on manually.</p></blockquote>
|
||||
<h3><a name="4.7"></a>4.7. When I paste from Windows into a remote nano, nano rewraps the lines. What gives?</h3>
|
||||
<p><i>Update:</i> Since version 4.8, nano suppresses auto-indentation during a paste (when your terminal understands <a href="https://en.wikipedia.org/wiki/Bracketed-paste">bracketed pastes</a>), so you no longer need to toggle it off and on manually.</p></blockquote>
|
||||
<h3 id="4.7">4.7. When I paste from Windows into a remote nano, nano rewraps the lines. What gives?</h3>
|
||||
<blockquote><p>When pasting from Windows, in some situations linefeeds are sent instead of carriage returns (Enters). And linefeeds are <b>^J</b>s, which make nano justify (rewrap) the current paragraph. To prevent these linefeeds from causing these unwanted justifications, add this line to your .nanorc on the remote Linux box: <b>unbind ^J main</b> or <b>bind ^J enter main</b>, depending on whether the paste contains CR + LF or only LF.</p>
|
||||
<p><i>Update:</i> Since version 4.8, nano will ignore linefeed characters in a paste (when your terminal understands <a href="https://en.wikipedia.org/wiki/Bracketed-paste">bracketed pastes</a>), so you no longer need the above workaround.</p></blockquote>
|
||||
<h3><a name="4.8"></a>4.8. I've compiled nano with color support, but I don't see any color when I run it!</h3>
|
||||
<p><i>Update:</i> Since version 4.8, nano ignores linefeed characters in a paste (when your terminal understands <a href="https://en.wikipedia.org/wiki/Bracketed-paste">bracketed pastes</a>), so you no longer need the above workaround.</p></blockquote>
|
||||
<h3 id="4.8">4.8. I've compiled nano with color support, but I don't see any color when I run it!</h3>
|
||||
<blockquote><p>If you want nano to actually use color, you have to specify the color configurations you want it to use in your .nanorc. Several example configurations are in the <b>syntax/</b> subdirectory of the nano source, which are normally installed to <b>/usr/local/share/nano/</b>. To enable all of them, uncomment the line <b># include "/usr/local/share/nano/*.nanorc"</b> in your nanorc. See also section <a href="#3.9">3.9</a>.</p></blockquote>
|
||||
<h3><a name="4.9"></a>4.9. How do I make nano my default editor (in Pine, mutt, etc.)?</h3>
|
||||
<h3 id="4.9">4.9. How do I make nano my default editor (in Pine, mutt, etc.)?</h3>
|
||||
<blockquote><p>You need to make nano your $EDITOR. If you want this to be saved, you should put a line like this in your <b>.bashrc</b> if you use bash (or <b>.zshrc</b> if you believe in zsh):</p>
|
||||
<p class="indented"><b>export EDITOR=/usr/local/bin/nano</b></p>
|
||||
<p>or, if you use tcsh, put this in your <b>.cshrc</b> file:</p>
|
||||
@@ -246,44 +246,44 @@
|
||||
<p>Again, replace x.y with the version of nano you use.</p></blockquote>
|
||||
<hr width="100%">
|
||||
|
||||
<h1><a name="5"></a>5. Internationalization</h1>
|
||||
<h3><a name="5.1"></a>5.1. There's no translation for my language!</h3>
|
||||
<h1 id="5">5. Internationalization</h1>
|
||||
<h3 id="5.1">5.1. There's no translation for my language!</h3>
|
||||
<blockquote><p>In June 2001, GNU nano entered the <a href="https://translationproject.org/html/welcome.html">Translation Project</a> and since then, translations should be managed from there.</p>
|
||||
<p>If there isn't a translation for your language, you could ask <a href="https://translationproject.org/team/">your language team</a> to translate nano, or better still, join that team and do it yourself. Joining a team is easy. You just need to ask the team leader to add you, and then send a <a href="https://translationproject.org/disclaim.txt">translation disclaimer to the FSF</a> (this is necessary as nano is an official GNU package, but it does <b>not</b> mean that you transfer the rights of your work to the FSF, it's just so the FSF can legally manage them).</p>
|
||||
<p>In any case, translating nano is easy. Just grab the latest <b>nano.pot</b> file listed on <a href="https://translationproject.org/domain/nano.html">nano's page</a> at the TP, and translate each <b>msgid</b> line into your native language on the <b>msgstr</b> line. When you're done, you should send it to the TP's central PO-file repository.</p></blockquote>
|
||||
<h3><a name="5.2"></a>5.2. I don't like the translation for <x> in my language. How can I fix it?</h3>
|
||||
<h3 id="5.2">5.2. I don't like the translation for <x> in my language. How can I fix it?</h3>
|
||||
<blockquote><p>The best way is to send an e-mail with your suggested corrections to the team's mailing list. The address is mentioned in the <code>Language-Team:</code> field in the relevant PO file. The team leader or the assigned translator can then make the changes reach the nano-devel list.</p></blockquote>
|
||||
<h3><a name="5.3"></a>5.3. What is the status of Unicode support?</h3>
|
||||
<h3 id="5.3">5.3. What is the status of Unicode support?</h3>
|
||||
<blockquote><p>Unicode should be fully usable nowadays. When the encoding of your terminal is set to UTF-8, and your locale (mainly the LANG environment variable) is UTF-8 too, then you should be able to read, enter and save Unicode text.</p></blockquote>
|
||||
<hr width="100%">
|
||||
|
||||
<h1><a name="6"></a>6. Advocacy and Licensing</h1>
|
||||
<h3><a name="6.1"></a>6.1. Why should I use nano instead of Pico?</h3>
|
||||
<h1 id="6">6. Advocacy and Licensing</h1>
|
||||
<h3 id="6.1">6.1. Why should I use nano instead of Pico?</h3>
|
||||
<blockquote><p>If you want features like undo/redo, syntax highlighting, line numbers, soft-wrapping, opening multiple files at once, an interface localized to your language, or search and replace with support for regular expressions, then you want nano.</p></blockquote>
|
||||
<h3><a name="6.2"></a>6.2. Why should I use Pico instead of nano?</h3>
|
||||
<h3 id="6.2">6.2. Why should I use Pico instead of nano?</h3>
|
||||
<blockquote><p>If you use your editor only to write emails or other texts and have no need for the above-mentioned features, then Pico will do fine for you.</p></blockquote>
|
||||
<h3><a name="6.3"></a>6.3. What is so bad about the older Pine license?</h3>
|
||||
<h3 id="6.3">6.3. What is so bad about the older Pine license?</h3>
|
||||
<blockquote><p>The U of W license for older versions of Pine and Pico is not considered truly Free Software according to both the Free Software Foundation and the <a href="https://www.debian.org/social_contract#guidelines">Debian Free Software Guidelines</a>. The main problem regards the limitations on distributing derived works: according to UW, you can distribute their software, and you can modify it, but you can not do both, i.e. distribute modified binaries.</p></blockquote>
|
||||
<h3><a name="6.4"></a>6.4. Okay, well, what mail program should I use then?</h3>
|
||||
<h3 id="6.4">6.4. Okay, well, what mail program should I use then?</h3>
|
||||
<blockquote><p>If you are looking to use a Free Software program similar to Pine, and Emacs is not your thing, you should definitely take a look at <a href="http://www.mutt.org/">mutt</a>. It is a full-screen, console based mail program that actually has a lot more flexibility than Pine, but has a keymap included in the distribution that allows you to use the same keystrokes as Pine would to send and receive mail. It's also under the GNU General Public License, version 2.0.</p>
|
||||
<p>Of course, due to the license change you can now use the <a href="http://www.washington.edu/alpine/">Alpine distribution</a> of PINE as it is now considered Free Software, but you would be sacrificing many of nano's features to do so.</p></blockquote>
|
||||
<hr width="100%">
|
||||
|
||||
<h1><a name="7"></a>7. Miscellaneous</h1>
|
||||
<h3><a name="7.1"></a>7.1. Where can I ask questions or send suggestions?</h3>
|
||||
<h1 id="7">7. Miscellaneous</h1>
|
||||
<h3 id="7.1">7.1. Where can I ask questions or send suggestions?</h3>
|
||||
<blockquote><p>There are three mailing lists for nano hosted at <a href="https://savannah.gnu.org/">Savannah</a>: info-nano, help-nano and nano-devel. info-nano is a very low traffic list where new versions of nano are announced (surprise!). help-nano is for getting help with the editor without needing to hear all of the development issues surrounding it. nano-devel is a normally low, sometimes high traffic list for discussing the present and future development of nano. Here are links to where you can sign up for a given list:</p>
|
||||
<p>info-nano - <a href="https://lists.gnu.org/mailman/listinfo/info-nano/">https://lists.gnu.org/mailman/listinfo/info-nano/</a><br>
|
||||
help-nano - <a href="https://lists.gnu.org/mailman/listinfo/help-nano/">https://lists.gnu.org/mailman/listinfo/help-nano/</a><br>
|
||||
nano-devel - <a href="https://lists.gnu.org/mailman/listinfo/nano-devel/">https://lists.gnu.org/mailman/listinfo/nano-devel/</a></p></blockquote>
|
||||
<h3><a name="7.2"></a>7.3. How do I submit a bug report or patch?</h3>
|
||||
<h3 id="7.2">7.3. How do I submit a bug report or patch?</h3>
|
||||
<blockquote>
|
||||
<p>The best way to submit bugs is through the <a href="https://savannah.gnu.org/bugs/?group=nano">Savannah bug tracker</a>, as you can check whether the bug you are reporting has already been submitted, and it makes it easier for the maintainers to keep track of them.
|
||||
<p>You can submit patches for nano via <a href="https://savannah.gnu.org/patch/?group=nano">Savannah's patch manager</a>.</p></blockquote>
|
||||
<h3><a name="7.3"></a>7.3. I want to send the development team a big load of cash (or just a thank you).</h3>
|
||||
<h3 id="7.3">7.3. I want to send the development team a big load of cash (or just a thank you).</h3>
|
||||
<blockquote><p>That's fine. Send it <a href="mailto:nano-devel@gnu.org">our way</a>! Better yet, fix a <a href="https://savannah.gnu.org/bugs/?group=nano">bug</a> in the program or implement a <a href="https://nano-editor.org/dist/latest/TODO">cool feature</a> and send us that instead (though cash is fine too).</p></blockquote>
|
||||
<h3><a name="7.4"></a>7.4. How do I join the development team?</h3>
|
||||
<h3 id="7.4">7.4. How do I join the development team?</h3>
|
||||
<blockquote><p>The easiest way is to consistently send in good patches that add some needed functionality, fix a bug or two, and/or make the program more optimized/efficient. Then ask nicely and you will probably be added to the Savannah development list and be given write access after a while. There is a lot of responsibility that goes along with being a team member, so don't think it's just something to add to your resume.</p></blockquote>
|
||||
<h3><a name="7.5"></a>7.5. Can I have write access to the git tree?</h3>
|
||||
<h3 id="7.5">7.5. Can I have write access to the git tree?</h3>
|
||||
<blockquote><p>Re-read section <a href="#7.4">7.4</a> and you should know the answer.</p></blockquote>
|
||||
<hr width="100%">
|
||||
|
||||
|
||||
76
doc/nano.1
76
doc/nano.1
@@ -16,7 +16,7 @@
|
||||
.\" Documentation License along with this program. If not, see
|
||||
.\" <https://www.gnu.org/licenses/>.
|
||||
.\"
|
||||
.TH NANO 1 "version 8.0" "May 2024"
|
||||
.TH NANO 1 "version 8.1" "July 2024"
|
||||
|
||||
.SH NAME
|
||||
nano \- Nano's ANOther text editor, inspired by Pico
|
||||
@@ -77,21 +77,21 @@ Entering text and moving around in a file is straightforward: typing the
|
||||
letters and using the normal cursor movement keys. Commands are entered
|
||||
by using the Control (^) and the Alt or Meta (M\-) keys.
|
||||
Typing \fB^K\fR deletes the current line and puts it in the cutbuffer.
|
||||
Consecutive \fB^K\fRs will put all deleted lines together in the cutbuffer.
|
||||
Any cursor movement or executing any other command will cause the next
|
||||
\fB^K\fR to overwrite the cutbuffer. A \fB^U\fR will paste the current
|
||||
Consecutive \fB^K\fRs put all deleted lines together in the cutbuffer.
|
||||
Any cursor movement or executing any other command causes the next
|
||||
\fB^K\fR to overwrite the cutbuffer. A \fB^U\fR pastes the current
|
||||
contents of the cutbuffer at the current cursor position.
|
||||
.sp
|
||||
When a more precise piece of text needs to be cut or copied, you can mark
|
||||
its start with \fB^6\fR, move the cursor to its end (the marked text will be
|
||||
highlighted), and then use \fB^K\fR to cut it, or \fBM\-6\fR to copy it to the
|
||||
cutbuffer. You can also save the marked text to a file with \fB^O\fR, or
|
||||
spell check it with \fB^T^T\fR.
|
||||
its start with \fB^6\fR, move the cursor to its end (the marked text is
|
||||
highlighted), and then use \fB^K\fR to cut it, or \fBM\-6\fR to copy it to
|
||||
the cutbuffer. You can also save the marked text to a file with \fB^O\fR,
|
||||
or spell check it with \fB^T^T\fR.
|
||||
.sp
|
||||
On some terminals, text can be selected also by holding down Shift while
|
||||
using the arrow keys. Holding down the Ctrl or Alt key too will increase
|
||||
using the arrow keys. Holding down the Ctrl or Alt key too increases
|
||||
the stride.
|
||||
Any cursor movement without Shift being held will cancel such a selection.
|
||||
Any cursor movement without Shift being held cancels such a selection.
|
||||
.sp
|
||||
Any valid Unicode code point can be inserted into the buffer by typing
|
||||
\fBM\-V\fR followed by the hexadecimal digits of the code point (concluded
|
||||
@@ -111,10 +111,9 @@ The default key bindings can be changed via a \fInanorc\fR file -- see
|
||||
.TP
|
||||
.BR \-A ", " \-\-smarthome
|
||||
Make the Home key smarter. When Home is pressed anywhere but at the
|
||||
very beginning of non-whitespace characters on a line, the cursor will
|
||||
jump to that beginning (either forwards or backwards). If the cursor is
|
||||
already at that position, it will jump to the true beginning of the
|
||||
line.
|
||||
very beginning of non-whitespace characters on a line, the cursor jumps
|
||||
to that beginning (either forwards or backwards). If the cursor is
|
||||
already at that position, it jumps to the true beginning of the line.
|
||||
.TP
|
||||
.BR \-B ", " \-\-backup
|
||||
When saving a file, back up the previous version of it, using the current
|
||||
@@ -158,9 +157,9 @@ in your \fInanorc\fR file.)
|
||||
.BR \-K ", " \-\-rawsequences
|
||||
Interpret escape sequences directly, instead of asking \fBncurses\fR
|
||||
to translate them. (If you need this option to get some keys to work
|
||||
properly, it means that the \fBterminfo\fR terminal description that is used
|
||||
does not fully match the actual behavior of your terminal. This can
|
||||
happen when you ssh into a BSD machine, for example.)
|
||||
properly, it means that the \fBterminfo\fR terminal description that
|
||||
is used does not fully match the actual behavior of your terminal.
|
||||
This can happen when you ssh into a BSD machine, for example.)
|
||||
Using this option disables \fBnano\fR's mouse support.
|
||||
.TP
|
||||
.BR \-L ", " \-\-nonewlines
|
||||
@@ -287,14 +286,14 @@ Display line numbers to the left of the text area.
|
||||
.BR \-m ", " \-\-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
|
||||
click), and execute shortcuts. The mouse works 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.
|
||||
.TP
|
||||
.BR \-n ", " \-\-noread
|
||||
Treat any name given on the command line as a new file. This allows
|
||||
\fBnano\fR to write to named pipes: it will start with a blank buffer,
|
||||
and will write to the pipe when the user saves the "file". This way
|
||||
\fBnano\fR to write to named pipes: it starts with a blank buffer,
|
||||
and writes to the pipe when the user saves the "file". This way
|
||||
\fBnano\fR can be used as an editor in combination with for instance
|
||||
\fBgpg\fR without having to write sensitive data to disk first.
|
||||
.TP
|
||||
@@ -303,8 +302,8 @@ Set the operating directory. This makes \fBnano\fP set up something
|
||||
similar to a chroot.
|
||||
.TP
|
||||
.BR \-p ", " \-\-preserve
|
||||
Preserve the XON and XOFF sequences (\fB^Q\fR and \fB^S\fR) so they
|
||||
will be caught by the terminal.
|
||||
Preserve the XOFF and XON sequences (\fB^S\fR and \fB^Q\fR) so that
|
||||
they are caught by the terminal (stopping and resuming the output).
|
||||
Note that option \fB\-/\fR (\fB\-\-modernbindings\fR) overrides this.
|
||||
.TP
|
||||
.BR \-q ", " \-\-indicator
|
||||
@@ -314,7 +313,7 @@ and how much of the buffer is covered by the viewport.
|
||||
.TP
|
||||
.BR \-r\ \fInumber ", " \-\-fill= \fInumber
|
||||
Set the target width for justifying and automatic hard-wrapping at this
|
||||
\fInumber\fR of columns. If the value is 0 or less, wrapping will occur
|
||||
\fInumber\fR of columns. If the value is 0 or less, wrapping occurs
|
||||
at the width of the screen minus \fInumber\fR columns, allowing the wrap
|
||||
point to vary along with the width of the screen if the screen is resized.
|
||||
The default value is \fB\-8\fR.
|
||||
@@ -361,8 +360,8 @@ understand the digits as a line number. If the trimmed filename does
|
||||
not exist either, then repeat the process and understand the obtained
|
||||
two numbers as line and column number. But if the doubly trimmed
|
||||
filename does not exist either, then forget the trimming and accept
|
||||
the original filename as is. To disable this colon parsing, use
|
||||
something like \fB+1\fR before the filename.
|
||||
the original filename as is. To disable this colon parsing for some
|
||||
file, use \fB+1\fR or similar before the relevant filename.
|
||||
.TP
|
||||
.BR \-% ", " \-\-stateflags
|
||||
Use the top-right corner of the screen for showing some state flags:
|
||||
@@ -423,9 +422,9 @@ the help viewer and the linter. All other toggles work in
|
||||
the main menu only.
|
||||
|
||||
.SH FILES
|
||||
When \fB\-\-rcfile\fR is given, \fBnano\fR will read just the specified file
|
||||
for setting its options and syntaxes and key bindings. Without that option,
|
||||
\fBnano\fR will read two configuration files: first the system's
|
||||
When \fB\-\-rcfile\fR is given, \fBnano\fR reads just the specified file
|
||||
for setting its options and syntaxes and key bindings. Without that
|
||||
option, \fBnano\fR reads two configuration files: first the system's
|
||||
\fInanorc\fR (if it exists), and then the user's \fInanorc\fR (if it
|
||||
exists), either \fI~/.nanorc\fR or \fI$XDG_CONFIG_HOME/nano/nanorc\fR
|
||||
or \fI~/.config/nano/nanorc\fR, whichever is encountered first. See
|
||||
@@ -444,18 +443,17 @@ When you want to copy marked text from \fBnano\fR to the system's clipboard,
|
||||
see one of the examples in the \fBnanorc\fR(5) man page.
|
||||
.sp
|
||||
If no alternative spell checker command is specified on the command
|
||||
line nor in one of the \fInanorc\fP files, \fBnano\fP will check the
|
||||
line nor in one of the \fInanorc\fP files, \fBnano\fP checks the
|
||||
\fBSPELL\fP environment variable for one.
|
||||
.sp
|
||||
In some cases \fBnano\fP will try to dump the buffer into an emergency
|
||||
file. This will happen mainly if \fBnano\fP receives a SIGHUP or
|
||||
SIGTERM or runs out of memory. It will write the buffer into a file
|
||||
named \fInano.save\fP if the buffer didn't have a name already, or will
|
||||
add a ".save" suffix to the current filename. If an emergency file with
|
||||
that name already exists in the current directory, it will add ".save"
|
||||
plus a number (e.g.\& ".save.1") to the current filename in order to make
|
||||
it unique. In multibuffer mode, \fBnano\fP will write all the open
|
||||
buffers to their respective emergency files.
|
||||
In some cases \fBnano\fP tries to dump the buffer into an emergency file.
|
||||
This happens mainly if \fBnano\fP receives a SIGHUP or SIGTERM or runs out
|
||||
of memory. It writes the buffer into a file named \fInano.save\fP if the
|
||||
buffer didn't have a name already, or adds a ".save" suffix to the current
|
||||
filename. If an emergency file with that name already exists in the
|
||||
current directory, it adds ".save" plus a number (e.g.\& ".save.1") to
|
||||
the current filename in order to make it unique. In multibuffer mode,
|
||||
\fBnano\fP writes all open buffers to their respective emergency files.
|
||||
.sp
|
||||
If you have any question about how to use \fBnano\fR in some specific
|
||||
situation, you can ask on \fIhelp-nano@gnu.org\fR.
|
||||
@@ -469,7 +467,7 @@ Please report any other bugs that you encounter via:
|
||||
.br
|
||||
.IR https://savannah.gnu.org/bugs/?group=nano .
|
||||
.sp
|
||||
When nano crashes, it will save any modified buffers to emergency .save files.
|
||||
When nano crashes, it saves any modified buffers to emergency .save files.
|
||||
If you are able to reproduce the crash and you want to get a backtrace, define
|
||||
the environment variable \fBNANO_NOCATCH\fR.
|
||||
|
||||
|
||||
147
doc/nano.texi
147
doc/nano.texi
@@ -13,8 +13,8 @@ The complete manual for the GNU nano text editor.
|
||||
|
||||
@smallbook
|
||||
@set EDITION 0.8
|
||||
@set VERSION 8.0
|
||||
@set UPDATED May 2024
|
||||
@set VERSION 8.1
|
||||
@set UPDATED July 2024
|
||||
|
||||
@dircategory Editors
|
||||
@direntry
|
||||
@@ -29,7 +29,7 @@ The complete manual for the GNU nano text editor.
|
||||
|
||||
@title GNU @command{nano}
|
||||
@subtitle a small and friendly text editor
|
||||
@subtitle version 8.0
|
||||
@subtitle version 8.1
|
||||
|
||||
@author Chris Allegretta
|
||||
|
||||
@@ -79,7 +79,7 @@ For suggesting improvements: @email{nano-devel@@gnu.org}
|
||||
@node Top
|
||||
@top
|
||||
|
||||
This manual documents GNU @command{nano}, version 8.0.
|
||||
This manual documents GNU @command{nano}, version 8.1.
|
||||
|
||||
@menu
|
||||
* Introduction::
|
||||
@@ -213,9 +213,9 @@ file has been modified since it was last saved or opened.
|
||||
|
||||
The status bar is the third line from the bottom of the screen. It
|
||||
shows important and informational messages. Any error messages that
|
||||
occur from using the editor will appear on the status bar. Any questions
|
||||
that are asked of the user will be asked on the status bar, and any user
|
||||
input (search strings, filenames, etc.) will be input on the status bar.
|
||||
occur from using the editor appear on the status bar. Any questions
|
||||
that are asked of the user are asked on the status bar, and any user
|
||||
input (search strings, filenames, etc.) is input on the status bar.
|
||||
|
||||
The two help lines at the bottom of the screen show some of the most
|
||||
essential functions of the editor.
|
||||
@@ -233,21 +233,21 @@ Characters not present on the keyboard can be entered in two ways:
|
||||
@item
|
||||
For characters with a single-byte code,
|
||||
pressing the Esc key twice and then typing a three-digit decimal number
|
||||
(from @kbd{000} to @kbd{255}) will make @command{nano} behave as if you
|
||||
(from @kbd{000} to @kbd{255}) makes @command{nano} behave as if you
|
||||
typed the key with that value.
|
||||
|
||||
@item
|
||||
For any possible character, pressing @kbd{M-V} (Alt+V) and then typing a
|
||||
series of hexadecimal digits (at most six, or concluded with @kbd{Enter} or
|
||||
@kbd{Space}) will enter the corresponding Unicode character into the buffer.
|
||||
@kbd{Space}) enters the corresponding Unicode character into the buffer.
|
||||
@end itemize
|
||||
|
||||
For example, typing @kbd{Esc Esc 2 3 4} will enter the character "ê" ---
|
||||
For example, typing @kbd{Esc Esc 2 3 4} enters the character "ê" ---
|
||||
useful when writing about a French party. Typing @kbd{M-V 0 0 2 2 c 4}
|
||||
will enter the symbol "⋄", a little diamond.
|
||||
enters the symbol "⋄", a little diamond.
|
||||
|
||||
Typing @kbd{M-V} followed by anything other than a hexadecimal digit
|
||||
will enter this keystroke verbatim into the buffer, allowing the user
|
||||
enters this keystroke verbatim into the buffer, allowing the user
|
||||
to insert literal control codes (except @code{^J}) or escape sequences.
|
||||
|
||||
@node Commands
|
||||
@@ -277,8 +277,8 @@ and then pressing the desired key.
|
||||
|
||||
Text can be cut from a file a whole line at a time with @kbd{^K}.
|
||||
The cut line is stored in the cutbuffer. Consecutive strokes of @kbd{^K}
|
||||
will add each cut line to this buffer, but a @kbd{^K}
|
||||
after any other keystroke will overwrite the entire cutbuffer.
|
||||
add each cut line to this buffer, but a @kbd{^K}
|
||||
after any other keystroke overwrites the entire cutbuffer.
|
||||
|
||||
The contents of the cutbuffer can be pasted at the current cursor position
|
||||
with @kbd{^U}.
|
||||
@@ -291,14 +291,14 @@ with @kbd{M-6}.
|
||||
|
||||
Text can be selected by first 'setting the Mark' with @kbd{^6}
|
||||
or @kbd{M-A} and then moving the cursor to the other end of the portion
|
||||
to be selected. The selected portion of text will be highlighted.
|
||||
to be selected. The selected portion of text is highlighted.
|
||||
This selection can now be cut or copied in its entirety with a single
|
||||
@kbd{^K} or @kbd{M-6}. Or the selection can be used to limit the scope of
|
||||
a search-and-replace (@kbd{^\}) or spell-checking session (@kbd{^T^T}).
|
||||
|
||||
On some terminals, text can be selected also by holding down @kbd{Shift}
|
||||
while using the cursor keys. Holding down the @kbd{Ctrl} or @kbd{Alt}
|
||||
key too will increase the stride. Such a selection is cancelled
|
||||
key too increases the stride. Such a selection is cancelled
|
||||
upon any cursor movement where @kbd{Shift} isn't held.
|
||||
|
||||
Cutting or copying selected text toggles off the mark automatically.
|
||||
@@ -320,7 +320,7 @@ When a regular expression contains fragments between parentheses,
|
||||
the replacement string can refer back to these fragments via
|
||||
@code{\1} to @code{\9}.
|
||||
|
||||
For each occurrence of the search string you will be asked whether to
|
||||
For each occurrence of the search string you are asked whether to
|
||||
replace it. You can choose Yes (replace it), or No (skip this one),
|
||||
or All (replace all remaining occurrences without asking any more),
|
||||
or Cancel (stop with replacing, but replacements that have already
|
||||
@@ -344,7 +344,7 @@ executes the selected shortcut. To be able to select text with the
|
||||
left button, or paste text with the middle button, hold down the
|
||||
Shift key during those actions.
|
||||
|
||||
The mouse will work in the X Window System, and on the console when gpm
|
||||
The mouse works in the X Window System, and on the console when gpm
|
||||
is running.
|
||||
|
||||
@node Anchors
|
||||
@@ -384,7 +384,7 @@ and @kbd{^V} (Page Down) keys. @kbd{^X} exits from the help viewer.
|
||||
@chapter The File Browser
|
||||
|
||||
When in the Read-File (@kbd{^R}) or Write-Out menu (@kbd{^O}),
|
||||
pressing @kbd{^T} will invoke the file browser.
|
||||
pressing @kbd{^T} invokes the file browser.
|
||||
Here, one can navigate directories in a graphical manner in order to
|
||||
find the desired file.
|
||||
|
||||
@@ -393,8 +393,8 @@ other cursor-movement keys. More targeted movement is accomplished by
|
||||
searching, via @kbd{^W} or @kbd{w}, or by changing directory, via
|
||||
@kbd{^_} or @kbd{g}. The behavior of the @kbd{Enter} key (or @kbd{s})
|
||||
varies by what is currently selected.
|
||||
If the currently selected object is a directory, the file browser will
|
||||
enter and display the contents of the directory. If the object is a
|
||||
If the currently selected object is a directory, the file browser
|
||||
enters and displays the contents of the directory. If the object is a
|
||||
file, this filename and path are copied to the status bar, and the file
|
||||
browser exits.
|
||||
|
||||
@@ -409,10 +409,9 @@ browser exits.
|
||||
@item -A
|
||||
@itemx --smarthome
|
||||
Make the Home key smarter. When Home is pressed anywhere but at the
|
||||
very beginning of non-whitespace characters on a line, the cursor will
|
||||
jump to that beginning (either forwards or backwards). If the cursor is
|
||||
already at that position, it will jump to the true beginning of the
|
||||
line.
|
||||
very beginning of non-whitespace characters on a line, the cursor jumps
|
||||
to that beginning (either forwards or backwards). If the cursor is
|
||||
already at that position, it jumps to the true beginning of the line.
|
||||
|
||||
@item -B
|
||||
@itemx --backup
|
||||
@@ -623,16 +622,16 @@ Display line numbers to the left of the text area.
|
||||
@item -m
|
||||
@itemx --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.
|
||||
clicks can be used to place the cursor, set the mark (with two clicks),
|
||||
and execute shortcuts. The mouse works 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.
|
||||
|
||||
@item -n
|
||||
@itemx --noread
|
||||
Treat any name given on the command line as a new file. This allows
|
||||
@command{nano} to write to named pipes: it will start with a blank buffer,
|
||||
and will write to the pipe when the user saves the "file". This way
|
||||
@command{nano} to write to named pipes: it starts with a blank buffer,
|
||||
and writes to the pipe when the user saves the "file". This way
|
||||
@command{nano} can be used as an editor in combination with for instance
|
||||
@command{gpg} without having to write sensitive data to disk first.
|
||||
|
||||
@@ -643,8 +642,8 @@ similar to a chroot.
|
||||
|
||||
@item -p
|
||||
@itemx --preserve
|
||||
Preserve the @kbd{^Q} (XON) and @kbd{^S} (XOFF) sequences so data being
|
||||
sent to the editor can be stopped and started.
|
||||
Preserve the @kbd{^S} (XOFF) and @kbd{^Q} (XON) sequences so that
|
||||
data being sent to the terminal can be stopped and resumed.
|
||||
Note that option @option{-/} (@option{--modernbindings}) overrides this.
|
||||
|
||||
@item -q
|
||||
@@ -656,7 +655,7 @@ and how much of the buffer is covered by the viewport.
|
||||
@item -r @var{number}
|
||||
@itemx --fill=@var{number}
|
||||
Set the target width for justifying and automatic hard-wrapping at this
|
||||
@var{number} of columns. If the value is 0 or less, wrapping will occur
|
||||
@var{number} of columns. If the value is 0 or less, wrapping occurs
|
||||
at the width of the screen minus @var{number} columns, allowing the wrap
|
||||
point to vary along with the width of the screen if the screen is resized.
|
||||
The default value is @t{-8}.
|
||||
@@ -721,7 +720,7 @@ List the names of the available syntaxes and exit.
|
||||
When neither the file's name nor its first line give a clue,
|
||||
try using libmagic to determine the applicable syntax.
|
||||
|
||||
@item -@
|
||||
@item -@@
|
||||
@itemx --colonparsing
|
||||
When a filename given on the command line ends in a colon plus digits
|
||||
and this filename does not exist, then snip the colon plus digits and
|
||||
@@ -729,8 +728,8 @@ understand the digits as a line number. If the trimmed filename does
|
||||
not exist either, then repeat the process and understand the obtained
|
||||
two numbers as line and column number. But if the doubly trimmed
|
||||
filename does not exist either, then forget the trimming and accept
|
||||
the original filename as is. To disable this colon parsing, use
|
||||
something like @code{+1} before the filename.
|
||||
the original filename as is. To disable this colon parsing for some
|
||||
file, use @code{+1} or similar before the relevant filename.
|
||||
|
||||
@item -%
|
||||
@itemx --stateflags
|
||||
@@ -852,13 +851,13 @@ not the help lines. The latter are toggled with @kbd{M-X}.
|
||||
@chapter Nanorc Files
|
||||
|
||||
Nanorc files can be used to configure @command{nano} to your liking
|
||||
without using command-line options. During startup @command{nano} will
|
||||
normally read two files: first the system-wide file, @file{/etc/nanorc}
|
||||
without using command-line options. During startup @command{nano}
|
||||
normally reads two files: first the system-wide file, @file{/etc/nanorc}
|
||||
(the exact path may be different on your system), and then the user-specific
|
||||
file, either @file{~/.nanorc} or @file{$XDG_CONFIG_HOME/nano/nanorc} or
|
||||
@file{.config/nano/nanorc}, whichever exists first.
|
||||
However, if @option{--rcfile} is given, @command{nano} will skip the
|
||||
above files and will read just the specified settings file.
|
||||
However, if @option{--rcfile} is given, @command{nano} skips the
|
||||
above files and reads just the specified settings file.
|
||||
|
||||
A nanorc file can contain @command{set} and @command{unset} commands for
|
||||
various options (@pxref{Settings}). It can also contain commands that
|
||||
@@ -948,8 +947,8 @@ understand the digits as a line number. If the trimmed filename does
|
||||
not exist either, then repeat the process and understand the obtained
|
||||
two numbers as line and column number. But if the doubly trimmed
|
||||
filename does not exist either, then forget the trimming and accept
|
||||
the original filename as is. To disable this colon parsing, use
|
||||
something like @code{+1} before the filename.
|
||||
the original filename as is. To disable this colon parsing for some
|
||||
file, use @code{+1} or similar before the relevant filename.
|
||||
|
||||
@item set constantshow
|
||||
Constantly display the cursor position on the status bar.
|
||||
@@ -968,7 +967,7 @@ The default value is @t{bold,white,red}.
|
||||
|
||||
@item set fill @var{number}
|
||||
Set the target width for justifying and automatic hard-wrapping at this
|
||||
@var{number} of columns. If the value is 0 or less, wrapping will occur
|
||||
@var{number} of columns. If the value is 0 or less, wrapping occurs
|
||||
at the width of the screen minus @var{number} columns, allowing the wrap
|
||||
point to vary along with the width of the screen if the screen is resized.
|
||||
The default value is @t{-8}.
|
||||
@@ -1073,7 +1072,7 @@ Use this color combination for the mini bar.
|
||||
|
||||
@item set mouse
|
||||
Enable mouse support, so that mouse clicks can be used to place the
|
||||
cursor, set the mark (with a double click), or execute shortcuts.
|
||||
cursor, set the mark (with two clicks), or execute shortcuts.
|
||||
|
||||
@item set multibuffer
|
||||
When reading in a file with @kbd{^R}, insert it into a new buffer by default.
|
||||
@@ -1097,7 +1096,7 @@ Use this color combination for line numbers.
|
||||
@xref{@code{set keycolor}} for valid color names.
|
||||
|
||||
@item set operatingdir "@var{directory}"
|
||||
@command{nano} will only read and write files inside "directory" and its
|
||||
@command{nano} only reads and writes files inside "directory" and its
|
||||
subdirectories. Also, the current directory is changed to here, so
|
||||
files are inserted from this directory. By default, the operating
|
||||
directory feature is turned off.
|
||||
@@ -1107,7 +1106,8 @@ Save the cursor position of files between editing sessions.
|
||||
The cursor position is remembered for the 200 most-recently edited files.
|
||||
|
||||
@item set preserve
|
||||
Preserve the XON and XOFF keys (@kbd{^Q} and @kbd{^S}).
|
||||
Preserve the XOFF and XON sequences (@kbd{^S} and @kbd{^Q}) so that
|
||||
they are caught by the terminal (stopping and resuming the output).
|
||||
|
||||
@item set promptcolor [bold,][italic,]@var{fgcolor},@var{bgcolor}
|
||||
Use this color combination for the prompt bar.
|
||||
@@ -1170,10 +1170,9 @@ poor vision.
|
||||
|
||||
@item set smarthome
|
||||
Make the Home key smarter. When Home is pressed anywhere but at the
|
||||
very beginning of non-whitespace characters on a line, the cursor will
|
||||
jump to that beginning (either forwards or backwards). If the cursor is
|
||||
already at that position, it will jump to the true beginning of the
|
||||
line.
|
||||
very beginning of non-whitespace characters on a line, the cursor jumps
|
||||
to that beginning (either forwards or backwards). If the cursor is
|
||||
already at that position, it jumps to the true beginning of the line.
|
||||
|
||||
@item set softwrap
|
||||
Display lines that exceed the screen's width over multiple screen lines.
|
||||
@@ -1299,10 +1298,10 @@ via the following commands in a nanorc file:
|
||||
@item syntax @var{name} ["@var{fileregex}" @dots{}]
|
||||
Start the definition of a syntax with this @var{name}.
|
||||
All subsequent @code{color} and other such commands
|
||||
will be added to this syntax, until a new @code{syntax}
|
||||
are added to this syntax, until a new @code{syntax}
|
||||
command is encountered.
|
||||
|
||||
When @command{nano} is run, this syntax will be automatically
|
||||
When @command{nano} is run, this syntax is automatically
|
||||
activated (for the relevant buffer) if the absolute filename
|
||||
matches the extended regular expression @var{fileregex}.
|
||||
Or the syntax can be explicitly activated (for all buffers)
|
||||
@@ -1324,8 +1323,8 @@ If no @var{fileregex} matched and no @code{header} regex matched
|
||||
either, then compare this @var{regex} (or regexes) against the
|
||||
result of querying the @code{magic} database about the current
|
||||
file, to determine whether this syntax should be used for it.
|
||||
(This functionality only works when @code{libmagic} is installed
|
||||
on the system and will be silently ignored otherwise.)
|
||||
(This querying is done only when @code{libmagic} is actually installed
|
||||
on the system and @option{--magic} or @code{set magic} was given.)
|
||||
|
||||
@item formatter @var{program} [@var{argument} @dots{}]
|
||||
Run the given @var{program} on the full contents of the current buffer.
|
||||
@@ -1393,7 +1392,7 @@ Paint all pieces of text whose start matches extended regular expression
|
||||
"fromrx" and whose end matches extended regular expression "torx" with
|
||||
the given foreground and background colors, at least one of
|
||||
which must be specified. This means that, after an initial instance of
|
||||
"fromrx", all text until the first instance of "torx" will be colored.
|
||||
"fromrx", all text until the first instance of "torx" is colored.
|
||||
This allows syntax highlighting to span multiple lines.
|
||||
|
||||
@item icolor [bold,][italic,]@var{fgcolor},@var{bgcolor} start="@var{fromrx}" end="@var{torx}"
|
||||
@@ -1430,7 +1429,7 @@ Rebinds @code{key} to @code{function} in the context of @code{menu}
|
||||
Makes @code{key} produce @code{string} in the context of @code{menu}
|
||||
(or in all menus where the key exists when @code{all} is used).
|
||||
Besides literal text and/or control codes, the @code{string} may contain
|
||||
function names between braces. These functions will be invoked when the
|
||||
function names between braces. These functions are invoked when the
|
||||
key is typed. To include a literal opening brace, use @code{@{@{@}}.
|
||||
|
||||
@item unbind key menu
|
||||
@@ -1441,10 +1440,10 @@ Unbinds @code{key} from @code{menu}
|
||||
|
||||
Note that @code{bind key "@{function@}" menu} is equivalent to
|
||||
@code{bind key function menu}, except that for the latter form
|
||||
@command{nano} will check the availability of the @code{function}
|
||||
@command{nano} checks the availability of the @code{function}
|
||||
in the given @code{menu} at startup time (and report an error if
|
||||
it does not exist there), whereas for the first form @command{nano}
|
||||
will check at execution time that the @code{function} exists but not
|
||||
checks at execution time that the @code{function} exists but not
|
||||
whether it makes any sense in the current menu. The user has to take
|
||||
care that a function name between braces (or any sequence of them)
|
||||
is appropriate. Strange behavior can result when it is not.
|
||||
@@ -1589,7 +1588,7 @@ the contents of the buffer.)
|
||||
@item linter
|
||||
Invokes a syntax-checking program (if the active syntax defines one).
|
||||
If this program produces lines of the form "filename:linenum:charnum:
|
||||
some message", then the cursor will be put at the indicated position
|
||||
some message", then the cursor is put at the indicated position
|
||||
in the mentioned file while showing "some message" on the status bar.
|
||||
You can move from message to message with @kbd{PgUp} and @kbd{PgDn},
|
||||
and leave linting mode with @kbd{^C} or @kbd{Enter}.
|
||||
@@ -1643,7 +1642,11 @@ while keeping the cursor in the same text position, if possible.
|
||||
(This function is bound by default to @kbd{Alt+Down}.)
|
||||
|
||||
@item center
|
||||
Scrolls the line with the cursor to the middle of the screen.
|
||||
Scrolls the line with the cursor to the middle of the viewport.
|
||||
|
||||
@item cycle
|
||||
Scrolls the line with the cursor first to the middle of the viewport,
|
||||
then to the top, then to the bottom.
|
||||
|
||||
@item prevword
|
||||
Moves the cursor to the beginning of the previous word.
|
||||
@@ -1851,14 +1854,14 @@ whitespace as the preceding line --- or as the next line if the preceding line
|
||||
is the beginning of a paragraph.
|
||||
|
||||
@item cutfromcursor
|
||||
Toggles whether cutting text will cut the whole line or just from the current cursor
|
||||
Toggles whether cutting text cuts the whole line or just from the current cursor
|
||||
position to the end of the line.
|
||||
|
||||
@item breaklonglines
|
||||
Toggles whether long lines will be hard-wrapped to the next line.
|
||||
Toggles whether the overlong part of a line is hard-wrapped to the next line.
|
||||
|
||||
@item tabstospaces
|
||||
Toggles whether typed tabs will be converted to spaces.
|
||||
Toggles whether typed tabs are converted to spaces.
|
||||
|
||||
@item mouse
|
||||
Toggles mouse support.
|
||||
@@ -1943,7 +1946,7 @@ whereas Pico does it at screen width minus six columns. You can make
|
||||
@command{nano} do as Pico by using @option{--fill=-6}.
|
||||
|
||||
@item Scrolling
|
||||
By default, @command{nano} will scroll just one line (instead of half
|
||||
By default, @command{nano} scrolls just one line (instead of half
|
||||
a screen) when the cursor is moved to a line that is just out of view.
|
||||
And when paging up or down, @command{nano} keeps the cursor in the same
|
||||
screen position as much as possible, instead of always placing it on the
|
||||
@@ -1959,8 +1962,8 @@ get it back with the @option{--emptyline} option.
|
||||
|
||||
@item Interactive Replace
|
||||
Instead of allowing you to replace either just one occurrence of a search
|
||||
string or all of them, @command{nano}'s replace function is interactive: it
|
||||
will pause at each found search string and query whether to replace this
|
||||
string or all of them, @command{nano}'s replace function is interactive:
|
||||
it pauses at each found search string and asks whether to replace this
|
||||
instance. You can then choose Yes, or No (skip this one), or All (don't
|
||||
ask any more), or Cancel (stop with replacing).
|
||||
|
||||
@@ -1985,8 +1988,8 @@ but also (between the two) the current column position.
|
||||
|
||||
@item Spell Checking
|
||||
In the internal spell checker misspelled words are sorted alphabetically
|
||||
and trimmed for uniqueness, such that the words 'apple' and 'Apple' will
|
||||
be prompted for correction separately.
|
||||
and trimmed for uniqueness, such that the strings 'Aplpe' and 'aplpe'
|
||||
will be offered for correction separately.
|
||||
|
||||
@item Writing Selected Text to Files
|
||||
When using the Write-Out key (@kbd{^O}), text that has been selected using the
|
||||
@@ -1998,8 +2001,8 @@ When using the Read-File key (@kbd{^R}), @command{nano} can not just read a file
|
||||
it can also read the output of a command to be run (@kbd{^X}).
|
||||
|
||||
@item Reading from Working Directory
|
||||
By default, Pico will read files from the user's home directory (when
|
||||
using @kbd{^R}), but it will write files to the current working directory
|
||||
By default, Pico reads files from the user's home directory (when
|
||||
using @kbd{^R}), but it writes files to the current working directory
|
||||
(when using @kbd{^O}). @command{nano} makes this symmetrical: always reading
|
||||
from and writing to the current working directory --- the directory
|
||||
that @command{nano} was started in.
|
||||
@@ -2134,7 +2137,7 @@ Include some code for runtime debugging output. This can get messy, so
|
||||
chances are you only want this feature when you're working on the nano source.
|
||||
|
||||
@item --disable-nls
|
||||
Exclude Native Language support. This will disable the use of any
|
||||
Exclude Native Language support. This disables the use of any
|
||||
available GNU @command{nano} translations.
|
||||
|
||||
@item --enable-utf8
|
||||
|
||||
79
doc/nanorc.5
79
doc/nanorc.5
@@ -16,7 +16,7 @@
|
||||
.\" Documentation License along with this program. If not, see
|
||||
.\" <https://www.gnu.org/licenses/>.
|
||||
.\"
|
||||
.TH NANORC 5 "version 8.0" "May 2024"
|
||||
.TH NANORC 5 "version 8.1" "July 2024"
|
||||
|
||||
.SH NAME
|
||||
nanorc \- GNU nano's configuration file
|
||||
@@ -24,13 +24,12 @@ nanorc \- GNU nano's configuration file
|
||||
.SH DESCRIPTION
|
||||
The \fInanorc\fP files contain the default settings for \fBnano\fP,
|
||||
a small and friendly text editor. During startup, if \fB\-\-rcfile\fR
|
||||
is not given, \fBnano\fR will read two files: first the
|
||||
system-wide settings, from \fI/etc/nanorc\fP (the exact path might be
|
||||
different on your system), and then the user-specific settings, either
|
||||
from \fI~/.nanorc\fR or from \fI$XDG_CONFIG_HOME/nano/nanorc\fR
|
||||
or from \fI~/.config/nano/nanorc\fR, whichever is encountered first.
|
||||
If \fB\-\-rcfile\fR is given, \fBnano\fR will read just the specified
|
||||
settings file.
|
||||
is not given, \fBnano\fR reads two files: first the system-wide settings,
|
||||
from \fI/etc/nanorc\fP (the exact path might be different on your system),
|
||||
and then the user-specific settings, either from \fI~/.nanorc\fR or from
|
||||
\fI$XDG_CONFIG_HOME/nano/nanorc\fR or from \fI~/.config/nano/nanorc\fR,
|
||||
whichever is encountered first. If \fB\-\-rcfile\fR is given,
|
||||
\fBnano\fR reads just the specified settings file.
|
||||
|
||||
.SH NOTICE
|
||||
Since version 8.0, to be newcomer friendly, \fB^F\fR starts a forward search,
|
||||
@@ -102,8 +101,8 @@ The uniquely numbered files are stored in the specified \fIdirectory\fR.
|
||||
.TP
|
||||
.B set boldtext
|
||||
Use bold instead of reverse video for the title bar, status bar,
|
||||
prompt bar, mini bar, key combos, line numbers,
|
||||
and selected text. This can be overridden by setting the options
|
||||
prompt bar, mini bar, key combos, line numbers, and selected text.
|
||||
This can be overridden by setting the options
|
||||
\fBtitlecolor\fP, \fBstatuscolor\fP, \fBpromptcolor\fP, \fBminicolor\fP,
|
||||
\fBkeycolor\fP, \fBnumbercolor\fP, and/or \fBselectedcolor\fP.
|
||||
.TP
|
||||
@@ -130,8 +129,8 @@ understand the digits as a line number. If the trimmed filename does
|
||||
not exist either, then repeat the process and understand the obtained
|
||||
two numbers as line and column number. But if the doubly trimmed
|
||||
filename does not exist either, then forget the trimming and accept
|
||||
the original filename as is. To disable this colon parsing, use
|
||||
something like \fB+1\fR before the filename.
|
||||
the original filename as is. To disable this colon parsing for some
|
||||
file, use \fB+1\fR or similar before the relevant filename.
|
||||
.TP
|
||||
.B set constantshow
|
||||
Constantly display the cursor position in the status bar.
|
||||
@@ -150,7 +149,7 @@ See \fBset titlecolor\fR for valid color names.
|
||||
.TP
|
||||
.B set fill \fInumber\fR
|
||||
Set the target width for justifying and automatic hard-wrapping at this
|
||||
\fInumber\fR of columns. If the value is 0 or less, wrapping will occur
|
||||
\fInumber\fR of columns. If the value is 0 or less, wrapping occurs
|
||||
at the width of the screen minus \fInumber\fR columns, allowing the wrap
|
||||
point to vary along with the width of the screen if the screen is resized.
|
||||
The default value is \fB\-8\fR.
|
||||
@@ -223,9 +222,9 @@ Use this color combination for the mini bar.
|
||||
See \fBset titlecolor\fR for more details.
|
||||
.TP
|
||||
.B 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
|
||||
Enable mouse support, if available for your system. When enabled,
|
||||
mouse clicks can be used to place the cursor, set the mark (with two
|
||||
clicks), and execute shortcuts. The mouse works 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.
|
||||
.TP
|
||||
@@ -251,7 +250,7 @@ Use this color combination for line numbers.
|
||||
See \fBset titlecolor\fR for more details.
|
||||
.TP
|
||||
.B set operatingdir "\fIdirectory\fP"
|
||||
\fBnano\fP will only read and write files inside \fIdirectory\fP and its
|
||||
\fBnano\fP only reads and writes files inside \fIdirectory\fP and its
|
||||
subdirectories. Also, the current directory is changed to here, so
|
||||
files are inserted from this directory. By default, the operating
|
||||
directory feature is turned off.
|
||||
@@ -261,7 +260,8 @@ Save the cursor position of files between editing sessions.
|
||||
The cursor position is remembered for the 200 most-recently edited files.
|
||||
.TP
|
||||
.B set preserve
|
||||
Preserve the XON and XOFF keys (\fB^Q\fR and \fB^S\fR).
|
||||
Preserve the XOFF and XON sequences (\fB^S\fR and \fB^Q\fR) so that
|
||||
they are caught by the terminal (stopping and resuming the output).
|
||||
.TP
|
||||
.B set promptcolor \fR[\fBbold,\fR][\fBitalic,\fR]\fIfgcolor\fB,\fIbgcolor\fR
|
||||
Use this color combination for the prompt bar.
|
||||
@@ -323,10 +323,9 @@ poor vision.
|
||||
.TP
|
||||
.B set smarthome
|
||||
Make the Home key smarter. When Home is pressed anywhere but at the
|
||||
very beginning of non-whitespace characters on a line, the cursor will
|
||||
jump to that beginning (either forwards or backwards). If the cursor is
|
||||
already at that position, it will jump to the true beginning of the
|
||||
line.
|
||||
very beginning of non-whitespace characters on a line, the cursor jumps
|
||||
to that beginning (either forwards or backwards). If the cursor is
|
||||
already at that position, it jumps to the true beginning of the line.
|
||||
.TP
|
||||
.B set softwrap
|
||||
Display lines that exceed the screen's width over multiple screen lines.
|
||||
@@ -467,10 +466,10 @@ via the following commands:
|
||||
.BI syntax " name \fR[" """" fileregex """ " \fR...]
|
||||
Start the definition of a syntax with this \fIname\fR.
|
||||
All subsequent \fBcolor\fR and other such commands
|
||||
will be added to this syntax, until a new \fBsyntax\fR
|
||||
are added to this syntax, until a new \fBsyntax\fR
|
||||
command is encountered.
|
||||
.sp
|
||||
When \fBnano\fR is run, this syntax will be automatically
|
||||
When \fBnano\fR is run, this syntax is automatically
|
||||
activated (for the relevant buffer) if the absolute filename
|
||||
matches the extended regular expression \fIfileregex\fR.
|
||||
Or the syntax can be explicitly activated (for all buffers)
|
||||
@@ -492,8 +491,8 @@ If no \fIfileregex\fR matched and no \fBheader\fR regex matched
|
||||
either, then compare this \fIregex\fR (or regexes) against the
|
||||
result of querying the \fBmagic\fP database about the current
|
||||
file, to determine whether this syntax should be used for it.
|
||||
(This functionality only works when \fBlibmagic\fP is installed on the
|
||||
system and will be silently ignored otherwise.)
|
||||
(This querying is done only when \fBlibmagic\fR is actually installed
|
||||
on the system and \fB\-\-magic\fR or \fBset magic\fR was given.)
|
||||
.TP
|
||||
.BI formatter " program " \fR[ "argument " \fR...]
|
||||
Run the given \fIprogram\fR on the full contents of the current buffer.
|
||||
@@ -558,7 +557,7 @@ Paint all pieces of text whose start matches extended regular expression
|
||||
with the given foreground and background colors,
|
||||
at least one of which must be specified. This means that, after an
|
||||
initial instance of \fIfromrx\fP, all text until the first instance of
|
||||
\fItorx\fP will be colored. This allows syntax highlighting to span
|
||||
\fItorx\fP is colored. This allows syntax highlighting to span
|
||||
multiple lines.
|
||||
.TP
|
||||
.BI "icolor \fR[\fBbold,\fR][\fBitalic,\fR]" fgcolor , bgcolor " start=""" fromrx """ end=""" torx """
|
||||
@@ -590,7 +589,7 @@ Rebinds the given \fIkey\fP to the given \fIfunction\fP in the given \fImenu\fP
|
||||
Makes the given \fIkey\fR produce the given \fIstring\fR in the given
|
||||
\fImenu\fR (or in all menus where the key exists when \fBall\fR is used).
|
||||
Besides literal text and/or control codes, the \fIstring\fR may contain
|
||||
function names between braces. These functions will be invoked when
|
||||
function names between braces. These functions are invoked when
|
||||
the key is typed. To include a literal opening brace, use \fB{{}\fR.
|
||||
.TP
|
||||
.BI unbind " key menu"
|
||||
@@ -600,9 +599,9 @@ menus where the key exists when \fBall\fP is used).
|
||||
.sp
|
||||
Note that \fBbind \fIkey\fR \fB"{\fIfunction\fB}"\fR \fImenu\fR is equivalent
|
||||
to \fBbind \fIkey\fR \fIfunction\fR \fImenu\fR, except that for the latter form
|
||||
\fBnano\fR will check the availability of the \fIfunction\fR in the given \fImenu\fR
|
||||
\fBnano\fR checks the availability of the \fIfunction\fR in the given \fImenu\fR
|
||||
at startup time (and report an error if it does not exist there), whereas for the
|
||||
first form \fBnano\fR will check at execution time that the \fIfunction\fR exists
|
||||
first form \fBnano\fR checks at execution time that the \fIfunction\fR exists
|
||||
but not whether it makes any sense in the current menu. The user has to take care
|
||||
that a function name between braces (or any sequence of them) is appropriate.
|
||||
Strange behavior can result when it is not.
|
||||
@@ -638,8 +637,8 @@ Example: F10.
|
||||
Rebinding \fB^M\fR (Enter) or \fB^I\fR (Tab) is probably not a good idea.
|
||||
Rebinding \fB^[\fR (Esc) is not possible, because its keycode
|
||||
is the starter byte of Meta keystrokes and escape sequences.
|
||||
Rebinding any of the dedicated cursor-moving keys (the arrows, Home, End,
|
||||
PageUp and PageDown) is not possible.
|
||||
Rebinding any of the dedicated cursor-moving keys (the arrows,
|
||||
Home, End, PageUp and PageDown) is not possible.
|
||||
On some terminals it's not possible to rebind \fB^H\fR (unless \fB\-\-raw\fR
|
||||
is used) because its keycode is identical to that of the Backspace key.
|
||||
|
||||
@@ -723,7 +722,7 @@ Counts and reports on the status bar the number of lines, words,
|
||||
and characters in the current buffer (or in the marked region).
|
||||
.TP
|
||||
.B execute
|
||||
Prompts for a program to execute. The program's output will be inserted
|
||||
Prompts for a program to execute. The program's output is inserted
|
||||
into the current buffer (or into a new buffer when \fBM\-F\fR is toggled).
|
||||
.TP
|
||||
.B speller
|
||||
@@ -739,7 +738,7 @@ the contents of the buffer.)
|
||||
.B linter
|
||||
Invokes a syntax-checking program (if the active syntax defines one).
|
||||
If this program produces lines of the form "filename:linenum:charnum:
|
||||
some message", then the cursor will be put at the indicated position
|
||||
some message", then the cursor is put at the indicated position
|
||||
in the mentioned file while showing "some message" on the status bar.
|
||||
You can move from message to message with <PgUp> and <PgDn>,
|
||||
and leave linting mode with \fB^C\fR or <Enter>.
|
||||
@@ -794,7 +793,11 @@ while keeping the cursor in the same text position, if possible.
|
||||
(This function is bound by default to <Alt+Down>.)
|
||||
.TP
|
||||
.B center
|
||||
Scrolls the line with the cursor to the middle of the screen.
|
||||
Scrolls the line with the cursor to the middle of the viewport.
|
||||
.TP
|
||||
.B cycle
|
||||
Scrolls the line with the cursor first to the middle of the viewport,
|
||||
then to the top, then to the bottom.
|
||||
.TP
|
||||
.B prevword
|
||||
Moves the cursor to the beginning of the previous word.
|
||||
@@ -1002,14 +1005,14 @@ whitespace as the preceding line -- or as the next line if the preceding line
|
||||
is the beginning of a paragraph.
|
||||
.TP
|
||||
.B cutfromcursor
|
||||
Toggles whether cutting text will cut the whole line or just from the current cursor
|
||||
Toggles whether cutting text cuts the whole line or just from the current cursor
|
||||
position to the end of the line.
|
||||
.TP
|
||||
.B breaklonglines
|
||||
Toggles whether long lines will be hard-wrapped to the next line.
|
||||
Toggles whether the overlong part of a line is hard-wrapped to the next line.
|
||||
.TP
|
||||
.B tabstospaces
|
||||
Toggles whether typed tabs will be converted to spaces.
|
||||
Toggles whether typed tabs are converted to spaces.
|
||||
.TP
|
||||
.B mouse
|
||||
Toggles mouse support.
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
.\" Documentation License along with this program. If not, see
|
||||
.\" <https://www.gnu.org/licenses/>.
|
||||
.\"
|
||||
.TH RNANO 1 "version 8.0" "May 2024"
|
||||
.TH RNANO 1 "version 8.1" "July 2024"
|
||||
|
||||
.SH NAME
|
||||
rnano \- a restricted nano
|
||||
|
||||
@@ -50,6 +50,10 @@
|
||||
## Do case-sensitive searches by default.
|
||||
# set casesensitive
|
||||
|
||||
## Interpret digits given on the command line after a colon after a filename
|
||||
## as the line number to go to in that file.
|
||||
# set colonparsing
|
||||
|
||||
## Constantly display the cursor position in the status bar or minibar.
|
||||
# set constantshow
|
||||
|
||||
@@ -98,8 +102,8 @@
|
||||
# set minibar
|
||||
|
||||
## 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
|
||||
## mouse clicks can be used to place the cursor, set the mark (with
|
||||
## two clicks), and execute shortcuts. The mouse will work in the
|
||||
## X Window System, and on the console when gpm is running.
|
||||
# set mouse
|
||||
|
||||
|
||||
@@ -31,6 +31,5 @@ EXTRA_DIST = \
|
||||
threadlib.m4 \
|
||||
uintmax_t.m4 \
|
||||
visibility.m4 \
|
||||
wchar_t.m4 \
|
||||
wint_t.m4 \
|
||||
xsize.m4
|
||||
|
||||
923
po/nano.pot
923
po/nano.pot
File diff suppressed because it is too large
Load Diff
933
po/pt_BR.po
933
po/pt_BR.po
File diff suppressed because it is too large
Load Diff
931
po/zh_CN.po
931
po/zh_CN.po
File diff suppressed because it is too large
Load Diff
929
po/zh_TW.po
929
po/zh_TW.po
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
VERSION="8.0"
|
||||
VERSION="8.1"
|
||||
|
||||
./configure -C --enable-tiny && make && ./configure -C &&
|
||||
|
||||
|
||||
@@ -498,11 +498,11 @@ char *browse(char *path)
|
||||
#ifndef NANO_TINY
|
||||
/* Simulate a terminal resize to force a directory reread,
|
||||
* or because the terminal dimensions might have changed. */
|
||||
kbinput = KEY_WINCH;
|
||||
kbinput = THE_WINDOW_RESIZED;
|
||||
} else if (function == do_toggle && get_shortcut(kbinput)->toggle == NO_HELP) {
|
||||
TOGGLE(NO_HELP);
|
||||
window_init();
|
||||
kbinput = KEY_WINCH;
|
||||
kbinput = THE_WINDOW_RESIZED;
|
||||
#endif
|
||||
} else if (function == do_search_backward) {
|
||||
search_filename(BACKWARD);
|
||||
@@ -642,7 +642,7 @@ char *browse(char *path)
|
||||
implant(first_sc_for(MBROWSER, function)->expansion);
|
||||
#endif
|
||||
#ifndef NANO_TINY
|
||||
} else if (kbinput == KEY_WINCH) {
|
||||
} else if (kbinput == THE_WINDOW_RESIZED) {
|
||||
; /* Gets handled below. */
|
||||
#endif
|
||||
} else if (function == do_exit) {
|
||||
@@ -652,7 +652,7 @@ char *browse(char *path)
|
||||
|
||||
#ifndef NANO_TINY
|
||||
/* If the terminal resized (or might have), refresh the file list. */
|
||||
if (kbinput == KEY_WINCH) {
|
||||
if (kbinput == THE_WINDOW_RESIZED) {
|
||||
/* Remember the selected file, to be able to reselect it. */
|
||||
present_name = copy_of(filelist[selected]);
|
||||
goto read_directory_contents;
|
||||
|
||||
@@ -227,8 +227,13 @@
|
||||
#define PLANTED_A_COMMAND 0x4EC
|
||||
#define NO_SUCH_FUNCTION 0x4EF
|
||||
|
||||
/* A special keycode for when <Tab> is pressed while the mark is on. */
|
||||
#define INDENT_KEY 0x4F1
|
||||
#ifndef NANO_TINY
|
||||
/* A special keycode for Ctrl + the central key on the numeric keypad. */
|
||||
#define KEY_CENTER 0x4F0
|
||||
|
||||
/* A special keycode for when we get a SIGWINCH (a window resize). */
|
||||
#define THE_WINDOW_RESIZED 0x4F7
|
||||
#endif
|
||||
|
||||
/* A special keycode to signal the beginning and end of a bracketed paste. */
|
||||
#define BRACKETED_PASTE_MARKER 0x4FB
|
||||
@@ -240,9 +245,6 @@
|
||||
#define KEY_FRESH 0x4FE
|
||||
|
||||
#ifndef NANO_TINY
|
||||
/* A special keycode for when we get a SIGWINCH (a window resize). */
|
||||
#define KEY_WINCH -2
|
||||
|
||||
/* Some extra flags for the undo function. */
|
||||
#define WAS_BACKSPACE_AT_EOF (1<<1)
|
||||
#define WAS_WHOLE_LINE (1<<2)
|
||||
|
||||
14
src/global.c
14
src/global.c
@@ -139,6 +139,9 @@ int *bardata = NULL;
|
||||
/* An array of characters that together depict the scrollbar. */
|
||||
ssize_t stripe_column = 0;
|
||||
/* The column at which a vertical bar will be drawn. */
|
||||
int cycling_aim = 0;
|
||||
/* Whether to center the line with the cursor (0), push it
|
||||
* to the top of the viewport (1), or to the bottom (2). */
|
||||
#endif
|
||||
|
||||
linestruct *cutbuffer = NULL;
|
||||
@@ -608,6 +611,7 @@ void shortcut_init(void)
|
||||
const char *toprow_gist = N_("Go to first row in the viewport");
|
||||
const char *bottomrow_gist = N_("Go to last row in the viewport");
|
||||
const char *center_gist = N_("Center the line where the cursor is");
|
||||
const char *cycle_gist = N_("Push the cursor line to the center, then top, then bottom");
|
||||
#endif
|
||||
const char *prevpage_gist = N_("Go one screenful up");
|
||||
const char *nextpage_gist = N_("Go one screenful down");
|
||||
@@ -1085,11 +1089,13 @@ void shortcut_init(void)
|
||||
|
||||
#ifdef ENABLE_HELP
|
||||
add_to_funcs(full_refresh, MMAIN,
|
||||
N_("Refresh"), WHENHELP(refresh_gist), TOGETHER);
|
||||
N_("Refresh"), WHENHELP(refresh_gist), BLANKAFTER);
|
||||
#endif
|
||||
#ifndef NANO_TINY
|
||||
add_to_funcs(do_center, MMAIN,
|
||||
N_("Center"), WHENHELP(center_gist), BLANKAFTER);
|
||||
N_("Center"), WHENHELP(center_gist), TOGETHER);
|
||||
add_to_funcs(do_cycle, MMAIN,
|
||||
N_("Cycle"), WHENHELP(cycle_gist), BLANKAFTER);
|
||||
#endif
|
||||
|
||||
add_to_funcs(do_savefile, MMAIN,
|
||||
@@ -1324,7 +1330,6 @@ void shortcut_init(void)
|
||||
add_to_sclist(MMAIN, "^6", 0, do_mark, 0);
|
||||
add_to_sclist(MMAIN, "^^", 0, do_mark, 0);
|
||||
add_to_sclist(MMAIN, "M-}", 0, do_indent, 0);
|
||||
add_to_sclist(MMAIN, "", INDENT_KEY, do_indent, 0);
|
||||
add_to_sclist(MMAIN, "M-{", 0, do_unindent, 0);
|
||||
add_to_sclist(MMAIN, "Sh-Tab", SHIFT_TAB, do_unindent, 0);
|
||||
add_to_sclist(MMAIN, "M-:", 0, record_macro, 0);
|
||||
@@ -1442,7 +1447,7 @@ void shortcut_init(void)
|
||||
add_to_sclist(MEXECUTE, "^J", 0, do_full_justify, 0);
|
||||
#endif
|
||||
#ifndef NANO_TINY
|
||||
add_to_sclist(MMAIN, "^L", 0, do_center, 0);
|
||||
add_to_sclist(MMAIN, "^L", 0, do_cycle, 0);
|
||||
#endif
|
||||
add_to_sclist(MMOST|MBROWSER|MHELP|MYESNO, "^L", 0, full_refresh, 0);
|
||||
|
||||
@@ -1579,6 +1584,7 @@ void shortcut_init(void)
|
||||
#endif
|
||||
#ifndef NANO_TINY
|
||||
add_to_sclist((MMOST & ~MMAIN) | MYESNO, "", KEY_CANCEL, do_cancel, 0);
|
||||
add_to_sclist(MMAIN, "", KEY_CENTER, do_center, 0);
|
||||
add_to_sclist(MMAIN, "", KEY_SIC, do_insertfile, 0);
|
||||
/* Catch and ignore bracketed paste marker keys. */
|
||||
add_to_sclist(MMOST|MBROWSER|MHELP|MYESNO, "", BRACKETED_PASTE_MARKER, do_nothing, 0);
|
||||
|
||||
@@ -477,7 +477,9 @@ void show_help(void)
|
||||
#ifndef NANO_TINY
|
||||
spotlighted = FALSE;
|
||||
|
||||
if (bracketed_paste || kbinput == BRACKETED_PASTE_MARKER) {
|
||||
while (bracketed_paste)
|
||||
kbinput = get_kbinput(midwin, BLIND);
|
||||
if (kbinput == BRACKETED_PASTE_MARKER) {
|
||||
beep();
|
||||
continue;
|
||||
}
|
||||
@@ -511,7 +513,7 @@ void show_help(void)
|
||||
get_mouseinput(&dummy_row, &dummy_col, TRUE);
|
||||
#endif
|
||||
#ifndef NANO_TINY
|
||||
} else if (kbinput == KEY_WINCH) {
|
||||
} else if (kbinput == THE_WINDOW_RESIZED) {
|
||||
; /* Nothing to do. */
|
||||
#endif
|
||||
} else if (function == do_exit) {
|
||||
|
||||
30
src/move.c
30
src/move.c
@@ -204,7 +204,7 @@ void to_top_row(void)
|
||||
|
||||
set_proper_index_and_pww(&leftedge, offset, FALSE);
|
||||
|
||||
place_the_cursor();
|
||||
refresh_needed = (openfile->mark);
|
||||
}
|
||||
|
||||
/* Place the cursor on the last row in the viewport, when possible. */
|
||||
@@ -220,15 +220,29 @@ void to_bottom_row(void)
|
||||
go_forward_chunks(editwinrows - 1, &openfile->current, &leftedge);
|
||||
set_proper_index_and_pww(&leftedge, offset, TRUE);
|
||||
|
||||
place_the_cursor();
|
||||
refresh_needed = (openfile->mark);
|
||||
}
|
||||
|
||||
/* Put the cursor line at the center, then the top, then the bottom. */
|
||||
void do_cycle(void)
|
||||
{
|
||||
if (cycling_aim == 0)
|
||||
adjust_viewport(CENTERING);
|
||||
else {
|
||||
openfile->cursor_row = (cycling_aim == 1) ? 0 : editwinrows - 1;
|
||||
adjust_viewport(STATIONARY);
|
||||
}
|
||||
|
||||
cycling_aim = (cycling_aim + 1) % 3;
|
||||
|
||||
draw_all_subwindows();
|
||||
full_refresh();
|
||||
}
|
||||
|
||||
/* Scroll the line with the cursor to the center of the screen. */
|
||||
void do_center(void)
|
||||
{
|
||||
adjust_viewport(CENTERING);
|
||||
draw_all_subwindows();
|
||||
full_refresh();
|
||||
do_cycle(); /* The main loop has set 'cycling_aim' to zero. */
|
||||
}
|
||||
#endif /* !NANO_TINY */
|
||||
|
||||
@@ -646,7 +660,8 @@ void do_up(void)
|
||||
|
||||
set_proper_index_and_pww(&leftedge, target_column, FALSE);
|
||||
|
||||
if (openfile->cursor_row == 0 && !ISSET(JUMPY_SCROLLING))
|
||||
if (openfile->cursor_row == 0 && !ISSET(JUMPY_SCROLLING) &&
|
||||
(tabsize < editwincols || !ISSET(SOFTWRAP)))
|
||||
edit_scroll(BACKWARD);
|
||||
else
|
||||
edit_redraw(was_current, FLOWING);
|
||||
@@ -669,7 +684,8 @@ void do_down(void)
|
||||
|
||||
set_proper_index_and_pww(&leftedge, target_column, TRUE);
|
||||
|
||||
if (openfile->cursor_row == editwinrows - 1 && !ISSET(JUMPY_SCROLLING))
|
||||
if (openfile->cursor_row == editwinrows - 1 && !ISSET(JUMPY_SCROLLING) &&
|
||||
(tabsize < editwincols || !ISSET(SOFTWRAP)))
|
||||
edit_scroll(FORWARD);
|
||||
else
|
||||
edit_redraw(was_current, FLOWING);
|
||||
|
||||
@@ -1600,7 +1600,7 @@ void process_a_keystroke(void)
|
||||
lastmessage = VACUUM;
|
||||
|
||||
#ifndef NANO_TINY
|
||||
if (input == KEY_WINCH)
|
||||
if (input == THE_WINDOW_RESIZED)
|
||||
return;
|
||||
#endif
|
||||
#ifdef ENABLE_MOUSE
|
||||
@@ -1651,6 +1651,11 @@ void process_a_keystroke(void)
|
||||
depth = 0;
|
||||
}
|
||||
|
||||
#ifndef NANO_TINY
|
||||
if (function != do_cycle)
|
||||
cycling_aim = 0;
|
||||
#endif
|
||||
|
||||
if (!function) {
|
||||
pletion_line = NULL;
|
||||
keep_cutbuffer = FALSE;
|
||||
@@ -2555,7 +2560,7 @@ int main(int argc, char **argv)
|
||||
maybe_two:
|
||||
while (--coda > filename + 1 && ('0' <= *coda && *coda <= '9'))
|
||||
;
|
||||
if (*coda == ':' && ('0' <= *(coda + 1) && *(coda +1) <= '9')) {
|
||||
if (*coda == ':' && ('0' <= *(coda + 1) && *(coda + 1) <= '9')) {
|
||||
*coda = '\0';
|
||||
if (stat(filename, &fileinfo) < 0) {
|
||||
*coda = ':';
|
||||
|
||||
@@ -442,9 +442,9 @@ functionptrtype acquire_an_answer(int *actual, bool *listed,
|
||||
|
||||
#ifndef NANO_TINY
|
||||
/* If the window size changed, go reformat the prompt string. */
|
||||
if (input == KEY_WINCH) {
|
||||
if (input == THE_WINDOW_RESIZED) {
|
||||
refresh_func(); /* Only needed when in file browser. */
|
||||
*actual = KEY_WINCH;
|
||||
*actual = THE_WINDOW_RESIZED;
|
||||
#ifdef ENABLE_HISTORIES
|
||||
free(stored_string);
|
||||
#endif
|
||||
@@ -598,7 +598,7 @@ int do_prompt(int menu, const char *provided, linestruct **history_list,
|
||||
free(prompt);
|
||||
|
||||
#ifndef NANO_TINY
|
||||
if (retval == KEY_WINCH)
|
||||
if (retval == THE_WINDOW_RESIZED)
|
||||
goto redo_theprompt;
|
||||
#endif
|
||||
|
||||
@@ -697,7 +697,7 @@ int ask_user(bool withall, const char *question)
|
||||
kbinput = get_kbinput(footwin, !withall);
|
||||
|
||||
#ifndef NANO_TINY
|
||||
if (kbinput == KEY_WINCH)
|
||||
if (kbinput == THE_WINDOW_RESIZED)
|
||||
continue;
|
||||
|
||||
/* Accept first character of an external paste and ignore the rest. */
|
||||
|
||||
@@ -98,6 +98,7 @@ extern int sidebar;
|
||||
#ifndef NANO_TINY
|
||||
extern int *bardata;
|
||||
extern ssize_t stripe_column;
|
||||
extern int cycling_aim;
|
||||
#endif
|
||||
|
||||
extern linestruct *cutbuffer;
|
||||
@@ -366,6 +367,7 @@ void do_page_down(void);
|
||||
#ifndef NANO_TINY
|
||||
void to_top_row(void);
|
||||
void to_bottom_row(void);
|
||||
void do_cycle(void);
|
||||
void do_center(void);
|
||||
#endif
|
||||
#ifdef ENABLE_JUSTIFY
|
||||
@@ -601,8 +603,8 @@ linestruct *get_prev_visible_line(linestruct *line);
|
||||
void record_macro(void);
|
||||
void run_macro(void);
|
||||
#endif
|
||||
void reserve_space_for(size_t newsize);
|
||||
size_t waiting_keycodes(void);
|
||||
void put_back(int keycode);
|
||||
#ifdef ENABLE_NANORC
|
||||
void implant(const char *string);
|
||||
#endif
|
||||
|
||||
@@ -363,6 +363,8 @@ keystruct *strtosc(const char *input)
|
||||
s->func = to_bottom_row;
|
||||
else if (!strcmp(input, "center"))
|
||||
s->func = do_center;
|
||||
else if (!strcmp(input, "cycle"))
|
||||
s->func = do_cycle;
|
||||
#endif
|
||||
else if (!strcmp(input, "pageup") ||
|
||||
!strcmp(input, "prevpage"))
|
||||
|
||||
@@ -57,6 +57,12 @@ void do_mark(void)
|
||||
* of spaces that a tab would normally take up at this position. */
|
||||
void do_tab(void)
|
||||
{
|
||||
#ifndef NANO_TINY
|
||||
/* When <Tab> is pressed while a region is marked, indent the region. */
|
||||
if (openfile->mark && openfile->mark != openfile->current)
|
||||
do_indent();
|
||||
else
|
||||
#endif
|
||||
#ifdef ENABLE_COLOR
|
||||
if (openfile->syntax && openfile->syntax->tabstring)
|
||||
inject(openfile->syntax->tabstring, strlen(openfile->syntax->tabstring));
|
||||
@@ -2885,7 +2891,7 @@ void do_linter(void)
|
||||
kbinput = get_kbinput(footwin, VISIBLE);
|
||||
|
||||
#ifndef NANO_TINY
|
||||
if (kbinput == KEY_WINCH)
|
||||
if (kbinput == THE_WINDOW_RESIZED)
|
||||
continue;
|
||||
#endif
|
||||
function = func_from_key(kbinput);
|
||||
|
||||
26
src/winio.c
26
src/winio.c
@@ -123,14 +123,9 @@ void run_macro(void)
|
||||
return;
|
||||
}
|
||||
|
||||
if (macro_length > capacity)
|
||||
reserve_space_for(macro_length);
|
||||
for (size_t index = macro_length; index > 0; )
|
||||
put_back(macro_buffer[--index]);
|
||||
|
||||
for (size_t i = 0; i < macro_length; i++)
|
||||
key_buffer[i] = macro_buffer[i];
|
||||
|
||||
waiting_codes = macro_length;
|
||||
nextcodes = key_buffer;
|
||||
mute_modifiers = TRUE;
|
||||
}
|
||||
#endif /* !NANO_TINY */
|
||||
@@ -267,7 +262,7 @@ void read_keys_from(WINDOW *frame)
|
||||
#ifndef NANO_TINY
|
||||
if (the_window_resized) {
|
||||
regenerate_screen();
|
||||
input = KEY_WINCH;
|
||||
input = THE_WINDOW_RESIZED;
|
||||
}
|
||||
|
||||
if (timed) {
|
||||
@@ -321,7 +316,7 @@ void read_keys_from(WINDOW *frame)
|
||||
}
|
||||
|
||||
/* If we got a SIGWINCH, get out as the frame argument is no longer valid. */
|
||||
if (input == KEY_WINCH)
|
||||
if (input == THE_WINDOW_RESIZED)
|
||||
return;
|
||||
|
||||
/* Remember where the recording of this keystroke (or burst of them) started. */
|
||||
@@ -709,6 +704,8 @@ int convert_CSI_sequence(const int *seq, size_t length, int *consumed)
|
||||
return CONTROL_RIGHT;
|
||||
case 'D': /* Esc [ 1 ; 5 D == Ctrl-Left on xterm. */
|
||||
return CONTROL_LEFT;
|
||||
case 'E': /* Esc [ 1 ; 5 E == Ctrl-"Center" on xterm. */
|
||||
return KEY_CENTER;
|
||||
case 'F': /* Esc [ 1 ; 5 F == Ctrl-End on xterm. */
|
||||
return CONTROL_END;
|
||||
case 'H': /* Esc [ 1 ; 5 H == Ctrl-Home on xterm. */
|
||||
@@ -1310,13 +1307,6 @@ int parse_kbinput(WINDOW *frame)
|
||||
}
|
||||
#endif /* __linux__ */
|
||||
|
||||
#ifndef NANO_TINY
|
||||
/* When <Tab> is pressed while the mark is on, do an indent. */
|
||||
if (keycode == '\t' && openfile->mark && currmenu == MMAIN &&
|
||||
!bracketed_paste && openfile->mark != openfile->current)
|
||||
return INDENT_KEY;
|
||||
#endif
|
||||
|
||||
/* Spurious codes from VTE -- see https://sv.gnu.org/bugs/?64578. */
|
||||
if (keycode == mousefocusin || keycode == mousefocusout)
|
||||
return ERR;
|
||||
@@ -1499,7 +1489,7 @@ int *parse_verbatim_kbinput(WINDOW *frame, size_t *count)
|
||||
|
||||
#ifndef NANO_TINY
|
||||
/* When the window was resized, abort and return nothing. */
|
||||
if (keycode == KEY_WINCH) {
|
||||
if (keycode == THE_WINDOW_RESIZED) {
|
||||
*count = 999;
|
||||
return NULL;
|
||||
}
|
||||
@@ -1523,7 +1513,7 @@ int *parse_verbatim_kbinput(WINDOW *frame, size_t *count)
|
||||
}
|
||||
|
||||
#ifndef NANO_TINY
|
||||
if (keycode == KEY_WINCH) {
|
||||
if (keycode == THE_WINDOW_RESIZED) {
|
||||
*count = 999;
|
||||
free(yield);
|
||||
return NULL;
|
||||
|
||||
@@ -15,8 +15,8 @@ color red "\<(FILENAME|FNR|FS|IGNORECASE|LINT|NF|NR|OFMT|OFS|ORS)\>"
|
||||
color red "\<(PROCINFO|RS|RT|RSTART|RLENGTH|SUBSEP|TEXTDOMAIN)\>"
|
||||
# Function declarations and special patterns.
|
||||
color brightgreen "\<(function|extension|BEGIN|END)\>"
|
||||
# Operators.
|
||||
color green "\{|\}|\(|\)|\;|\[|\]|\\|<|>|!|=|&|\+|-|\*|%|/|\?:|\^|\|"
|
||||
# Operators and brackets/braces/slashes/parentheses.
|
||||
color green "[][!%&()*+/:;<=>?\^{|}~-]"
|
||||
# Flow control.
|
||||
color brightyellow "\<(for|if|while|do|else|in|delete|exit)\>"
|
||||
color brightyellow "\<(break|continue|return)\>"
|
||||
|
||||
@@ -6,19 +6,19 @@ syntax man "\.[1-9]x?$"
|
||||
magic "troff or preprocessor input"
|
||||
comment ".\""
|
||||
|
||||
# Section headers, title line, and indented paragraphs.
|
||||
# Section headers, title line, and paragraphs.
|
||||
color green "^\.(SH|SS|TH) .*"
|
||||
color brightgreen "^\.((SH|SS|TH) |[HIT]P)"
|
||||
# Type faces, and normal paragraphs.
|
||||
color brightred "^\.(B[IR]?|I[BR]?|R[BI]|S[BM]) .*"
|
||||
color brightblue "^\.((B[IR]?|I[BR]?|R[BI]|S[BM]) |[LP]?P$)"
|
||||
color brightgreen "^\.((SH|SS|TH) |[HIT]P|TQ|LP$|P?P$)"
|
||||
# Type faces, and synopses.
|
||||
color brightred "^\.(B[IR]?|I[BR]?|RB|RI|SB|SM|SY|OP) .*"
|
||||
color brightblue "^\.((B[IR]?|I[BR]?|RB|RI|SB|SM|SY|OP) |YS$)"
|
||||
# Inline type faces.
|
||||
color magenta "\\f[BIPR]"
|
||||
# Hyphenation control.
|
||||
color purple "\\[%:]"
|
||||
color yellow "^\.(hc|hla|hlm|hw|hy)"
|
||||
# Relative margins, hyperlinks, and various other stuff.
|
||||
color yellow "^\.(RS|RE|UR|UE|PD|DT)"
|
||||
color yellow "^\.(RS|RE|UR|UE|MT|ME|EX|EE|PD|DT)"
|
||||
color yellow "^\.(ad|bp|br|ce|de|ds|el|ie|if|fi|ft|ig|in|na|ne|nf|nh|ps|so|sp|ti|tr)"
|
||||
|
||||
# Comments.
|
||||
|
||||
@@ -29,7 +29,7 @@ color brightmagenta "[[:blank:]](start=)?".+""
|
||||
color crimson "\{(help|cancel|exit|savefile|writeout|discardbuffer|insert|where(is|was)|find(previous|next|bracket)|replace)\}"
|
||||
color crimson "\{(cut|copy|paste|zap|chopword(left|right)|cutrestoffile|execute|mark|speller|linter|formatter|(full)?justify)\}"
|
||||
color crimson "\{(location|gotoline|(begin|end)para|comment|complete|(un)?indent|wordcount|(record|run)macro|anchor|undo|redo)\}"
|
||||
color crimson "\{(left|right|up|down|home|end|(scroll|page)(up|down)|(top|bottom)row|center|(prev|next)(word|block|anchor|buf))\}"
|
||||
color crimson "\{(left|right|up|down|home|end|(scroll|page)(up|down)|(top|bottom)row|center|cycle|(prev|next)(word|block|anchor|buf))\}"
|
||||
color crimson "\{(tab|enter|delete|backspace|verbatim|refresh|suspend|casesens|regexp|backwards|older|newer|(dos|mac)format)\}"
|
||||
color crimson "\{(append|prepend|backup|flip(goto|replace|execute|pipe|convert|newbuffer)|browser|gotodir|(first|last)(file|line))\}"
|
||||
color crimson "\{(nohelp|constantshow|softwrap|linenumbers|whitespacedisplay|nosyntax|zero)\}"
|
||||
|
||||
Reference in New Issue
Block a user