Some Nano Questions?

Tim Chase blinux.list at thechases.com
Wed Apr 19 17:05:29 UTC 2006


> Hi All:  I am trying to use nano more often than pico. 
> Even after I mention that editor in the Lynx config, it 
> still runs pico instead.

Well, if you truely want to run nano, not pico, you can
rename your pico executable to something like
"I_Really_Mean_Pico", and then link your nano executable to
"pico".  Something like the following (as root)

cd /usr/bin
mv pico I_Really_Mean_Pico
ln -s `which nano` pico

Lynx really should be smart enough to take your preferences.
  Make sure that when you go to change your options, you have
the "Save these settings" box checked so that it will
preserve them between Lynx sessions.  You can check this by
looking in your ~/.lynxrc file for a line that *should* read

	file_editor:/usr/bin/nano

If it's not there, is commented out with a leading hash
mark, or points to a different editor, you can add it,
uncomment it, or change it to point at your preferred editor.

Alternatively, you can export your EDITOR variable to point
at the application you'd like.  You can do this in your
.bashrc or .profile file.  Just edit it and the following
two lines:

	EDITOR=/usr/bin/nano
	export EDITOR

(if there's already an "export" line, you can just add
"EDITOR" to the end of it).  Most applications respect this
setting, so changing this will have more wide-reaching
effects...you may or may not want this sort of behavior.

> Next, how can I run a global search-and-replace?  The 
> manual implies a function kee which I don't have such as 
> f14?

The nano help I have here indicates that not only does F14
work, but so should control+underscore and "M-R".  That's
Emacs notation for "Meta+R", where "Meta" usually the "Alt"
key (this information is at the top of that help file).  All
that to say that Alt+R should do the trick for you.  The
same for the others (F13 through F16):  Alt+G for "Goto line
#", Alt+A for "Mark text at last cursor position", and Alt+W
for "repeat last search".  Additionally, if your
console/shell/terminal has problems passing Alt+whatever
through to the application, you can press <escape>, release
<escape>, and then press the key you were going to press
with <alt>, such as <escape-down> <escape-up> <g>.

> And lastly, is their a way like world-perfect where I can
> block text and move it to another file?

First, start Nano with multiple files, such as

    bash$ nano file1.txt file2.txt

You can use control+carat (that's usually control+shift+6)
to start the beginning of the block.  Move to the other end
of your block and press control+K to cut the block (you
might want to press control+U immediately afterwards to put
the text back in).  Then use Alt+period or Alt+comma to move
though the files you started up on the command line.  You
can also use escape followed by the comma or period, as like
above.  Once you get to the file you want, navigate to the
location in that file that you want the text and press
control+U.  Nano will place the text at the cursor.

Hope that gives you some stuff to work with.

I personally just learned vi/vim and find it much easier to
use...after spending a month learning it. (grins)

-tim








More information about the Blinux-list mailing list