红联Linux门户
Linux帮助

给新手推荐文本编辑器:nano

发布时间:2009-06-07 22:22:14来源:红联作者:刘冲
这个文本编辑器的好处是:很小,所以任何版本都有,
功能不大,所以使用简便不用怎么学。
启动后全屏(或者占用整个终端窗口),窗口下面有提示,可以是中文
开始使用只需要知道两个快捷键:ctrl+O是保存,ctrl+X是关闭,没有保存的话,退出是会提示你。

其他的跟windows下习惯差不错,比如可以使用退格键删除前面一个字符什么的,这在vi上是需要设置的。
不用切换控制模式和输入模式。

[font=Impact]下面转自ubuntu中文论坛,不是原创:[/font]
http://forum.ubuntu.org.cn/viewtopic.php?f=68&t=48708

Nano是一个简单的没有花梢及华丽效果的文本编辑器。Nano在做简单文本文件编辑时相当不错。但不要希望用它来做复杂的编辑工作。其它的编辑器诸如"emacs","vim","gedit"都提供了文本着色以及自动文本格式化。而Nano只做最基本的编辑操作,而不提供其它功能。
对于无需编程,只是偶尔修改配置文件的初学者而言,nano是很好的选择。而且它一样通过快捷键实现高效率的文本编辑,上手十分简单。

然而网上还没有关于nano详细操作的中文帮助文档,给不少E文不好的初学者增加学习的难度。
这篇中文文档翻译自nano的官方英文文档的绝大部分。
http://www.nano-editor.org/

由于本人翻译水平有限,所以采用了双语文档(^_^),并且在特定的位置标明的命令的常用性,方便初学者学习。部分极不常用部分没有翻译。不妥之处,大家指出。

=====================这是华丽的分割线=======================

1 Introduction 介绍

GNU nano is a small and friendly text editor. Besides basic textediting, nano offers many extra features like an interactive search andreplace, go to line and column number, auto-indentation, featuretoggles, internationalization support, and filename tab completion.
GNU nano是一个小巧友好的文本编辑器. 与基本的文本编辑相比, nano提供许多额外的特性,例如:交互式的查找和替换, 定位到指定的行列, 自动缩进, 特性切换, 国际化支持, 以及文件名标记完成.

1.1 Overview 概述

The original goal for nano was a complete bug-for-bug compatibleemulation of Pico, but nano's current goal is to be as compatible aspossible while offering a superset of Pico's functionality. See SeePico Compatibility, for more info.
nano原来的目标是很好的兼容模拟Pico,但现在nano的目标是尽可能的兼容并且提供超过Pico的功能.详见"Pico兼容性"一节.

The usual way to invoke nano is:
通常调用nano的方法是:

代码:
nano [OPTION]... [FILE]


Butit is also possible to edit several files in a row. Additionally, thecursor can be put on a desired line number by adding this number with aplus sign before any filename, and even in a desired column by addingit with a comma. So the complete synopsis is:
但是也可以同时编辑多个文件.另外,通过在文件名前增加一个行号可以将光标定位到期望的那一行,列号同理.一览如下:

代码:
nano [OPTION]... [[+LINE] FILE]...

nano [OPTION]... [[+,COLUMN] FILE]...

nano [OPTION]... [[+LINE,COLUMN] FILE]...


1.2 Command Line Options 命令行选项

nano takes the following options from the command line:
nano命令行有以下一些选项:

代码:
+LINE,COLUMN

Start at line number LINE and column number COLUMN (at least one ofwhich must be specified) instead of the default of line 1, column 1.
从LINE行COLUMN列开始(二者至少指明其一),默认是从1行1列.
[注:不常用]

代码:
-?

Same as -h, --help.
同-h,--help.
[注:一般Linux命令的参数如果用完整单词就用两个破折号"--",单个字母就一个破折号"-"]

代码:
-A, --smarthome

Make the Home key smarter. When Home is pressed anywhere but at thevery beginning of non-whitespace characters on a line, the cursor willjump to that beginning (either forwards or backwards). If the cursor isalready at that position, it will jump to the true beginning of theline.
启用智能HOME键.无论何处按下HOME键,光标跳到该行第一个非空格字符.如果已在该处,则跳到本行第一个字符.
[注:不常用]

代码:
-B, --backup

When saving a file, back up the previous version of it to the current filename suffixed with a ~.
自动备份保存修改前的文本,同一文件名前加个~.
[注:视情况而定,一般重要的配置文件最好加上,当然也可以手动备份]

代码:
-C , --backupdir=

Set the directory where nano puts unique backup files if file backups are enabled.
如果启用备份,可以通过这个选项指定备份目录.
[注:同上]

代码:
-D, --boldtext

Use bold text instead of reverse video text.
使用粗体文本代替反显文本.
[注:一般不常用]

代码:
-E, --tabstospaces

Convert typed tabs to spaces.
替换制表符TAB为空格.
[注:视情况开启]

代码:
-F, --multibuffer

Enable multiple file buffers, if available.
如果可能,就启用多文本缓冲.
[注:可以开启]

代码:
-H, --historylog

Log search and replace strings to ~/.nano_history, so they can beretrieved in later sessions, if nanorc support is available.
nano的日志文件.
[注:不常用]

代码:
-I, --ignorercfiles

Don't look at SYSCONFDIR/nanorc or ~/.nanorc, if nanorc support is available.
不在SYSCONFDIR/nanorc或~/.nanorc找日志文件.
[注:不常用]

代码:
-K, --rebindkeypad

Interpret the numeric keypad keys so that they all work properly. Youshould only need to use this option if they don't, as mouse supportwon't work properly with this option enabled.
鼠标支持和小键盘冲突时开启.
[注:不常用]

代码:
-L, --nonewlines

Don't add newlines to the ends of files.
文件尾不要加入新行.
[注:可以开启]

代码:
-N, --noconvert

Don't convert files from DOS/Mac format.
不转换来自DOS/Mac格式的文件.
[注:不常用]

代码:
-O, --morespace

Use the blank line below the title bar as extra editing space.
取消标题栏以增加编辑空间一行.
[注:可以开启]

代码:
-Q , --quotestr=

Set the quoting string for justifying. The default value is
设置匹配引用字符串.默认为

^([ \t]*[|>:}#])+

if extended regular expression support is available, or "> "otherwise. Note that \t above stands for a literal Tab character.
如果开启额外的规则表达式支持,或有">".注意"\t"代表一个TAB制表符.
[注:不常用]

代码:
-R, --restricted

Restricted mode: don't read or write to any file not specified on thecommand line; read any nanorc files; allow suspending; allow a file tobe appended to, prepended to, or saved under a different name if italready has one; or use backup files or spell checking. Also accessibleby invoking nano with any name beginning with 'r' (e.g. "rnano").
启用受限模式:命令行为指明就不读写任何文件,任何宏,允许终止,允许追加,预载,另存为覆盖,使用备份文件,拼写检查.同时可以用"rnano"来进入这个模式.
[注:不常用]

代码:
-S, --smooth

Enable smooth scrolling. Text will scroll line-by-line, instead of the usual chunk-by-chunk behavior.
开启平滑卷动.文本逐行卷动,而非块卷动.
[注:可以开启,不加此参数时每次卷动半屏]

代码:
-T <#cols>, --tabsize=<#cols>

Set the displayed tab length to #cols columns. The value of #cols must be greater than 0. The default value is 8.
设置显示制表符TAB的大小#cols.默认为8.
[注:可以根据自己情况修改]

代码:
-U, --quickblank

Do quick statusbar blanking. Statusbar messages will disappear after 1 keystroke instead of 25. Note that -c overrides this.
快速状态栏消隐.状态栏消息在击键1次后消失,而非25次.注意-c使它无效.
[注:不常用]

代码:
-V, --version

Show the current version number and exit.
显示版本并退出.
[注:不常用]

代码:
-W, --wordbounds

Detect word boundaries more accurately by treating punctuation characters as parts of words.
检测单词边界时把标点视为单词的一部分.
[注:不常用]

代码:
-Y , --syntax=

Specify a specific syntax highlighting from the nanorc to use, if available. See See Nanorc Files, for more info.
指明使用特别的nano资源文件以语法高亮.
[注:不常用]

代码:
-c, --const

Constantly display the cursor position and line number on the statusbar. Note that this overrides -U.
状态栏恒显示光标所在行列号.注意此命令使-U无效.
[注:不常用]

代码:
-d, --rebinddelete

Interpret the Delete key differently so that both Backspace and Deletework properly. You should only need to use this option if Backspaceacts like Delete on your system.
使Backspace和Delete各自正常工作.当二者功能相同时开启.
[注:不常用]

代码:
-h, --help

Show a summary of command line options and exit.
显示命令行参数总结并退出.
[注:见-?]

代码:
-i, --autoindent

Automatically indent new lines to the same number of spaces and tabs as the previous line.
自动缩进.
[注:可以开启]

代码:
-k, --cut

Cut from the current cursor position to the end of the current line.
从当前光标位置剪贴到本行未.
[注:不常用]

代码:
-l, --nofollow

When writing files, if the given file is a symbolic link, it is removed and a new file is created.
如果编辑符号链接文件,新建一个物理文件替代之.
[注:不常用]

代码:
-m, --mouse

Enable mouse support, if available for your system. When enabled, mouseclicks can be used to place the cursor, set the mark (with a doubleclick), and execute shortcuts. The mouse will work in the X WindowSystem, and on the console when gpm is running.
开启鼠标支持.单击光标定位,双击标记文本,以及执行快捷命令.
[注:可以开启,不过过多的使用鼠标是编辑效率低下的原因之一]

代码:
-o , --operatingdir=

Set operating directory. Makes nano set up something similar to a chroot.
设置工作目录.
[注:不常用]

代码:
-p, --preserve

Preserve the ^Q (XON) and ^S (XOFF) sequences so data being sent to the editor can be can be stopped and started.
保留^Q和^S使数据送到编辑器时可以被停止或开始.
[注:不常用]

代码:
-r <#cols>, --fill=<#cols>

Wrap lines at column #cols. If this value is 0 or less, wrapping willoccur at the width of the screen less #cols, allowing it to vary alongwith the width of the screen if the screen is resized. The defaultvalue is -8.
以#cols为界自动换行,默认-8意味屏宽-8.
[注:一般不修改该值]

代码:
-s , --speller=

Invoke the given program as the spell checker. By default, nano usesthe command specified in the SPELL environment variable, or, if SPELLis not set, its own interactive spell checker that requires the spellprogram to be installed on your system.
设定拼写检查程序.
[注:不常用]

代码:
-t, --tempfile

Don't ask whether or not to save the current contents of the file whenexiting, assume yes. This is most useful when using nano as thecomposer of a mailer program.
退出时不询问就直接保存修改.
[注:初学者建议不用]

代码:
-v, --view

Don't allow the contents of the file to be altered. Note that thisoption should NOT be used in place of correct file permissions toimplement a read-only file.
不得修改打开的文件.只读文件无须用此命令.
[注:不常用]

代码:
-w, --nowrap

Don't wrap long lines at any length. This option overrides any value for -r.
取消自动换行.
[注:修改配置文件时一定要开启]

代码:
-x, --nohelp

Expert Mode: don't show the Shortcut Lists at the bottom of the screen.This affects the location of the statusbar as well, as in Expert Modeit is located at the very bottom of the editor.
专家模式:屏底没有快捷键列表,只有状态条.

Note: When accessing the help system, Expert Mode is temporarily disabled to display the help system navigation keys.
注意:联机帮助将不再显示导航快捷键.
[注:不常用]

代码:
-z, --suspend

Enable nano's suspend ability using the system's suspend keystroke (usually ^Z).
允许nano接受系统终止命令(^Z).
[注:不常用]

代码:
-a, -b, -e, -f, -g, -j

Ignored, for compatibility with Pico.
忽略,和Pico兼容.
[注:不常用]

2 Editor Basics 编辑器基础

2.1 Entering Text 输入文本

All key sequences in nano are entered using the keyboard. nano is a"modeless" editor. All keys, with the exception of Control and Meta keysequences, will enter text into the file being edited.
所有的输入靠键盘.nano是一个"无模式"的编辑器.除了Control和Alt的快捷键外,都是文本输入.

2.2 Special Functions 特定功能

Special functions use the Control (Ctrl) key, displayed in the helpand shortcut lists as ^; the Meta key, displayed as M; or the Escape(Esc) key.
特定功能用到Control键,显示为^.Meta键,显示为M.还有Esc键.

* Control key sequences are entered by holding down the Ctrl keyand pressing the desired key, or by pressing the Esc key twice andpressing the desired key.
Control快捷键是先按住Ctrl再同时按特定的键,或者按两下Esc再按特定的键.
* Pressing Esc twice and then typing a three-digit number from 000to 255 will enter the character with the corresponding value.
按Esc两次在按三个数字(从000到255),可以输入特定ASCII字符.
* Meta key sequences are entered by holding down the Meta key(normally the Alt key) and pressing the desired key, or by pressing theEsc key once and pressing the desired key. Certain operating systems"swallow" the Alt key so that it never reaches the application; if youroperating system does this, you should use the Esc key to generate Metakey sequences.
Meta键一般被映射为Alt键,也可以按一下Esc再按特定的键.

2.3 The Titlebar 标题栏

The titlebar is the line displayed at the top of the editor. Thereare three sections: left, center and right. The section on the leftdisplays the version of nano being used. The center section displaysthe current filename, or "New Buffer" if the file has not yet beennamed. The section on the right will display "Modified" if the file hasbeen modified since it was last saved or opened.
标题栏显示在编辑器的顶上,有三个部分:左,中,右.左边显示nano的版本,中间显示当前文件名,新文件则显示"New Buffer".右边显示文件是否被修改.

Special modes: When nano is in "File browser" mode, the centersection will display the current directory instead of the filename. SeeSee The File Browser, for more info.
"文件浏览"模式下,中间显示目录.详见"文件浏览"一节.

2.4 The Statusbar 状态栏

The statusbar is the third line from the bottom of the screen, orthe bottom line in Expert Mode. See See Expert Mode, for more info. Itshows important and informational messages. Any error messages thatoccur from using the editor will appear on the statusbar. Any questionsthat are asked of the user will be asked on the statusbar, and any userinput (search strings, filenames, etc.) will be input on the statusbar.
状态栏显示在倒数第3行,专家模式下显示在最后一行.它用于显示重要的消息,如错误消息等.还有交互的询问消息(如查找,文件名等).

2.5 Shortcut Lists 快捷键列表

The Shortcut Lists are the two lines at the bottom of the screenwhich show some of the more commonly used functions in the editor.
快捷键列表在最下两行,它们都是编辑器最常用的功能.

2.6 Using the Mouse 使用鼠标

When mouse support has been configured and enabled, a single mouseclick places the cursor at the indicated position. Clicking a secondtime in the same position toggles the mark. Clicking in the shortcutlist executes the selected shortcut.
当鼠标支持开启时,单击鼠标可以定位光标到指定位置.双击则选中标记.单击快捷键列表执行快捷操作.

The mouse will work in the X Window System, and on the console when gpm is running.
鼠标在X Window,控制台的gpm下运行.

3 Online Help 联机帮助

The online help system in nano is available by pressing ^G. It isfairly self explanatory, documenting the various parts of the editorand available keystrokes. Navigation is via the ^Y (Page Up) and ^V(Page Down) keys. ^X exits the help system.
按^G开启联机帮助,它自适应当前功能.导航通过^Y(或Page Up)和^V(Page Down)键.^X退出联机帮助.

4 Feature Toggles 特性切换

Toggles allow you to change certain aspects of the editor thatwould normally be done via command line options. They are invoked viaMeta key sequences. See See Special Functions, for more info. Thefollowing global toggles are available:
由命令行选项指定的特性也可以用切换来改变.他们通过Meta键实现,详见"特定功能"一节.以下为全局切换:

Backup Files Toggle (Meta-B)
toggles the -B (--backup) command line option.
备份文件.
Constant Cursor Position Display Toggle (Meta-C)
toggles the -c (--const) command line option.
光标位置恒显示.
Multiple File Buffers Toggle (Meta-F)
toggles the -F (--multibuffer) command line option.
多文件缓冲.
Smart Home Key Toggle (Meta-H)
toggles the -A (--smarthome) command line option.
智能Home键.
Auto Indent Toggle (Meta-I)
toggles the -i (--autoindent) command line option.
自动缩进.
Cut To End Toggle (Meta-K)
toggles the -k (--cut) command line option.
剪贴到行尾.
Long Line Wrapping Toggle (Meta-L)
toggles the -w (--nowrap) command line option.
关闭自动换行.
Mouse Support Toggle (Meta-M)
toggles the -m (--mouse) command line option.
鼠标支持.
No Conversion From DOS/Mac Format Toggle (Meta-N)
toggles the -N (--noconvert) command line option.
不转换DOS/Mac格式文件.
More Space For Editing Toggle (Meta-O)
toggles the -O (--morespace) command line option.
取消标题栏以增加编辑空间一行.
Whitespace Display Toggle (Meta-P)
toggles whitespace display mode if you have a "whitespace" option in your nanorc. See See Nanorc Files, for more info.
切换空格模式.详见"Nanorc文件"一节.
Tabs to Spaces Toggle (Meta-Q)
toggles the -E (--tabstospaces) command line option.
替换制表符TAB为空格.
Smooth Scrolling Toggle (Meta-S)
toggles the -S (--smooth) command line option.
平滑卷动.
Expert/No Help Toggle (Meta-X)
toggles the -x (--nohelp) command line option.
专家模式.
Color Syntax Highlighting Toggle (Meta-Y)
toggles color syntax highlighting if you have color syntaxes in your nanorc. See See Nanorc Files, for more info.
彩色语法高亮.详见"Nanorc文件"一节.
Suspend Toggle (Meta-Z)
toggles the -z (--suspend) command line option.
允许nano接受系统终止命令(^Z).

5 Nanorc Files "Nanorc"文件
[注:nano的配置文件,以扩展nano,初学不常用,译略,^_^]

The nanorc files contain the default settings for nano. They shouldnot be in DOS or Mac format. During startup, nano will first read itssystem-wide settings from SYSCONFDIR/nanorc, and then user-specificsettings from ~/.nanorc.
A nanorc file accepts a series of "set" and "unset" commands,which can be used to configure nano on startup without using thecommand line options. Additionally, the "syntax", "color", and "icolor"keywords are used to define syntax highlighting rules for differenttext patterns. nano will read one command per line.
Options in nanorc files take precedence over nano's defaults, andcommand line options override nanorc settings. Options are also unsetby default, except for those that take arguments.
Quotes inside string parameters don't have to be escaped withbackslashes. The last double quote in the string will be treated as itsend. For example, for the "brackets" option,
""')>]}"
will match ", ', ), >, ], and }.
The supported commands and arguments are:
set/unset autoindent
Use auto-indentation.
set/unset backup
Create backup files in "filename~".
set backupdir "directory"
Set the directory where nano puts unique backup files if file backups are enabled.
set/unset backwards
Do backwards searches by default.
set/unset boldtext
Use bold text instead of reverse video text.
set brackets "string"
Set the characters treated as closing brackets when justifyingparagraphs. They cannot contain blank characters. Only closingpunctuation, optionally followed by closing brackets, can endsentences. The default value is
""')>]}"
set/unset casesensitive
Do case sensitive searches by default.
set/unset const
Constantly display the cursor position in the status bar.
set/unset cut
Use cut to end of line by default, instead of cutting the whole line.
set fill "n"
Wrap lines at column number "n". If "n" is 0 or less, the maximumline length will be the screen width less "n" columns. The defaultvalue is -8.
set/unset historylog
Enable ~/.nano_history for saving and reading search/replace strings.
set matchbrackets "string"
Set the opening and closing brackets that can be found by bracketsearches. They cannot contain blank characters. The former set mustcome before the latter set, and both must be in the same order. Thedefault value is
"(<[{)>]}"
set/unset morespace
Use the blank line below the titlebar as extra editing space.
set/unset mouse
Enable mouse support, so that mouse clicks can be used to placethe cursor, set the mark (with a double click), or execute shortcuts.
set/unset multibuffer
Allow inserting files into their own buffers.
set/unset noconvert
Don't convert files from DOS/Mac format.
set/unset nofollow
Don't follow symlinks when writing files.
set/unset nohelp
Don't display the help lists at the bottom of the screen.
set/unset nonewlines
Don't add newlines to the ends of files.
set/unset nowrap
Don't wrap text at all.
set operatingdir "directory"
nano will only read and write files inside "directory" and itssubdirectories. Also, the current directory is changed to here, sofiles are inserted from this directory. By default, the operatingdirectory feature is turned off.
set/unset preserve
Preserve the XON and XOFF keys (^Q and ^S).
set punct "string"
Set the characters treated as closing punctuation when justifyingparagraphs. They cannot contain blank characters. Only closingpunctuation, optionally followed by closing brackets, can endsentences. The default value is "!.?".
set/unset quickblank
Do quick statusbar blanking. Statusbar messages will disappear after 1 keystroke instead of 25.
set quotestr "string"
The email-quote string, used to justify email-quoted paragraphs.This is an extended regular expression if your system supports them,otherwise a literal string. The default value is
"^([ \\t]*[#:>\\|}])+"
if you have extended regular expression support, or "> " otherwise. Note that '\\t' stands for a literal Tab character.
set/unset rebinddelete
Interpret the Delete key differently so that both Backspace andDelete work properly. You should only need to use this option ifBackspace acts like Delete on your system.
set/unset rebindkeypad
Interpret the numeric keypad keys so that they all work properly.You should only need to use this option if they don't, as mouse supportwon't work properly with this option enabled.
set/unset regexp
Do extended regular expression searches by default.
set/unset smarthome
Make the Home key smarter. When Home is pressed anywhere but atthe very beginning of non-whitespace characters on a line, the cursorwill jump to that beginning (either forwards or backwards). If thecursor is already at that position, it will jump to the true beginningof the line.
set/unset smooth
Use smooth scrolling by default.
set speller "spellprog"
Use spelling checker "spellprog" instead of the built-in one, which calls "spell".
set/unset suspend
Allow nano to be suspended.
set tabsize "n"
Use a tab size of "n" columns. The value of "n" must be greater than 0. The default value is 8.
set/unset tabstospaces
Convert typed tabs to spaces.
set/unset tempfile
Save automatically on exit, don't prompt.
set/unset view
Disallow file modification.
set whitespace "string"
Set the two characters used to display the first characters of tabs and spaces. They must be single-column characters.
set/unset wordbounds
Detect word boundaries more accurately by treating punctuation characters as part of a word.
syntax "str" ["fileregex" ... ]
Defines a syntax named "str" which can be activated via the-Y/??yntax command line option, or will be automatically activated ifthe current filename matches the extended regular expression"fileregex". All following "color" and "icolor" statements will applyto "syntax" until a new syntax is defined.
The "none" syntax is reserved; specifying it on the command lineis the same as not having a syntax at all. The "default" syntax isspecial: it takes no "fileregex", and applies to files that don't matchany other syntax's "fileregex".
color fgcolor,bgcolor "regex" ...
For the currently defined syntax, display all expressions matchingthe extended regular expression "regex" with foreground color "fgcolor"and background color "bgcolor", at least one of which must bespecified. Legal colors for foreground and background color are: white,black, red, blue, green, yellow, magenta, and cyan. You may use theprefix "bright" to force a stronger color highlight for the foreground.If your terminal supports transparency, not specifying a "bgcolor"tells "nano" to attempt to use a transparent background.
icolor fgcolor,bgcolor "regex" ...
Same as above, except that the expression matching is case insensitive.
color fgcolor,bgcolor start="sr" end="er"
Display expressions which start with the extended regularexpression "sr" and end with the extended regular expression "er" withforeground color "fgcolor" and background color "bgcolor", at least oneof which must be specified. This allows syntax highlighting to spanmultiple lines. Note that all subsequent instances of "sr" after aninitial "sr" is found will be highlighted until the first instance of"er".
icolor fgcolor,bgcolor start="sr" end="er"
Same as above, except that the expression matching is case insensitive.
include "syntaxfile"
Read in self-contained color syntaxes from "syntaxfile". Note that"syntaxfile" can only contain "syntax", "color", and "icolor" commands.

6 The File Browser 文件浏览

When reading or writing files, pressing ^T will invoke the filebrowser. Here, one can navigate directories in a graphical manner inorder to find the desired file.
读写文件时,按下^T激活文件浏览器.以图形话的方式导航寻找需要的文件.

Basic movement in the file browser is accomplished with the arrowkeys, page up, and page down. More advanced movement is accomplished bysearching via ^W (or 'w') and changing directories via ^_ (or 'g'). Thebehavior of the Enter (or 's') key varies by what is currentlyselected. If the currently selected object is a directory, the filebrowser will enter and display the contents of the directory. If theobject is a file, this filename and path are copied to the statusbar,and the file browser exits.
文件浏览中的基本移动可以通过方向键,PageUp,PageDown完成.查找用^W(或^w),改变目录用^_(或'g').回车(或's')改变当前选中.如果选中的是目录,文件浏览器就进入该目录.如果选中的是文件,就打开.

7 Pico Compatibility "Pico"兼容性
[注:nano是向Pico编辑器兼容的,内容对初学者意义不大,译略,^_^]

nano attempts to emulate Pico as closely as possible, but there are certain differences between the editors:

Search and Replace History
As of version 1.1.99pre1 of nano, text entered as search orreplace strings will be stored and can be accessed with the up/downarrow keys. Previously, nano offered a more consistent, butincompatible with Pico, method for entering search and replace strings.In the old method, previous entries would be displayed by default aseditable text in front of the cursor, as opposed to being bracketed anduneditable as it is in Pico. The old behavior could be made compatiblewith Pico via the -p option, but recent versions of Pico use the -poption to preserve the XON and XOFF sequences within the editor. Since,with the new method, search and replace strings can still be edited bysimply hitting the up arrow key once, the old method was removedcompletely.
Writing, Appending, or Prepending Selected Text to Files
Text selected using the marking key (^^) can be written out,appended, or prepended to a new or existing file using the WriteOut key(^O).
Toggles
Many options which alter the functionality of the program can be"toggled" on or off using Meta key sequences, meaning the program doesnot have to be restarted to turn a particular feature of the editor onor off. Please see the internal help function (^G) for a list of whatfunctions can be toggled for a particular version of nano. See SeeFeature Toggles, for more info.
Cursor Position Display
The output of the "Display Cursor Position" in nano displays thegiven column position, as well as the row and total character positionof the cursor.
Interactive Replace and Spell Checker
It is worth noting that nano's replace function is interactive,i.e. it does not stop after one search string is found andautomatically replace it. The nano implementation will pause at eachsearch string found and query whether to replace this instance or not.The internal spell checker operates similarly. Note that there is noway to force these functions to behave in the Pico fashion. As ofversion 1.1.99pre1, misspelled words are sorted and trimmed foruniqueness in the internal spell checker such that the words 'apple'and 'Apple' will be prompted for correction separately.

8 Building and Configure Options 构建和配置
[注:从源文件编译安装nano,方法和其他程序安装相同,译略,^_^]

Building nano from source is fairly straightforward if you are familiar with compiling programs with autoconf support:

* tar xvfz nano-x.y.z.tar.gz (where x.y.z is the version of nano)
* cd nano-x.y.z/
* ./configure
* make
* make install

The possible options to ./configure are:

--disable-browser
Disable the mini file browser when reading or writing files.
--disable-help
Disable the help function. Doing this makes the binary muchsmaller, but makes it difficult for new users to learn more than verybasic things about using the editor.
--disable-justify
Disable the justify and unjustify functions.
--disable-mouse
Disable all mouse functionality. This also disables the -m command line option, which enables the mouse functionality.
--disable-operatingdir
Disable setting the operating directory. This also disables the -o command line option, which sets the operating directory.
--disable-speller
Disable use of the spell checker. This also disables the -scommand line option, which allows specifying an alternate spellchecker.
--disable-tabcomp
Disable the tab completion code when reading or writing files.
--disable-wrapping
Disable all long line wrapping. This also eliminates the -w command line option, which enables long line wrapping.
--enable-tiny
This option disables all the above. It also disables some of thelarger internals of the editor, like the marking code and the cut toend of line code. It also disables the function toggles.
--enable-debug
Enable support for runtime debug output. This can get prettymessy, so chances are you only want this feature to work on the nanosource.
--enable-extra
Enable extra features. At the moment, this is just easter egg-type stuff.
--enable-color
Enable support for syntax coloring of files using the nanorc file. This enables nanorc support as well.
--enable-multibuffer
Enable support for opening multiple files at a time and switching between them on the fly.
--enable-nanorc
Enable support for reading the nanorc file at startup. You canstore custom settings in the nanorc file rather than having to passcommand line options to get desired behavior. See See Nanorc Files, formore info.
--enable-all
Shortcut for enabling the above four features (extra, color, multibuffer, and nanorc).
--disable-nls
Disables Native Language support. This will disable use of the available GNU nano translations.
--disable-wrapping-as-root
Disable long line wrapping by default when nano is run as root.
--enable-utf8
Enable support for reading and writing Unicode files. This willrequire either the wide version of ncurses, or a UTF-8-enabled versionof Slang.
--disable-utf8
Disable support for reading and writing Unicode files.
--with-slang
Compiling nano with Slang is supported, and will make the binarynotably smaller than if compiled with ncurses or other curses libraries.
文章评论

共有 6 条评论

  1. leone 于 2010-08-28 13:27:50发表:

    感觉挺全面的,收藏啦~~

  2. cnbtoo 于 2009-06-08 00:02:02发表:

    默认的就够简单了

  3. 相思爱文 于 2009-06-07 23:11:40发表:

    不会用啊。不管是哪一个,用着习惯就好。
    系统默认的是nano,我给改成vim了。

  4. jiehe 于 2009-06-07 23:07:30发表:

    这么长的英语怎么看的完哦。

  5. jiehe 于 2009-06-07 23:07:25发表:

    这么长的英语怎么看的完哦。

  6. 刘冲 于 2009-06-07 23:01:34发表:

    奇怪,怎么没有人回复?