[教学]nano编辑器中文帮助文档

Vim、Emacs配置和使用
回复
头像
vbem
帖子: 239
注册时间: 2006-09-13 9:09

[教学]nano编辑器中文帮助文档

#1

帖子 vbem » 2007-04-16 11:07

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

1.1 Overview 概述

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

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

代码: 全选

nano [OPTION]... [FILE]


But it is also possible to edit several files in a row. Additionally, the cursor can be put on a desired line number by adding this number with a plus sign before any filename, and even in a desired column by adding it 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 of which 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 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.
启用智能HOME键.无论何处按下HOME键,光标跳到该行第一个非空格字符.如果已在该处,则跳到本行第一个字符.
[注:不常用]

代码: 全选

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

代码: 全选

-C <dir>, --backupdir=<dir>
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 be retrieved 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. You should only need to use this option if they don't, as mouse support won'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 <str>, --quotestr=<str>
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 the command line; read any nanorc files; allow suspending; allow a file to be appended to, prepended to, or saved under a different name if it already has one; or use backup files or spell checking. Also accessible by 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 <str>, --syntax=<str>
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 Delete work properly. You should only need to use this option if Backspace acts 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, 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.
开启鼠标支持.单击光标定位,双击标记文本,以及执行快捷命令.
[注:可以开启,不过过多的使用鼠标是编辑效率低下的原因之一]

代码: 全选

-o <dir>, --operatingdir=<dir>
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 will occur at the width of the screen less #cols, allowing it to vary along with the width of the screen if the screen is resized. The default value is -8.
以#cols为界自动换行,默认-8意味屏宽-8.
[注:一般不修改该值]

代码: 全选

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

代码: 全选

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

代码: 全选

-v, --view
Don't allow the contents of the file to be altered. Note that this option should NOT be used in place of correct file permissions to implement 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 Mode it 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 key sequences, 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 help and 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 key and pressing the desired key, or by pressing the Esc key twice and pressing the desired key.
Control快捷键是先按住Ctrl再同时按特定的键,或者按两下Esc再按特定的键.
* Pressing Esc twice and then typing a three-digit number from 000 to 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 the Esc key once and pressing the desired key. Certain operating systems "swallow" the Alt key so that it never reaches the application; if your operating system does this, you should use the Esc key to generate Meta key sequences.
Meta键一般被映射为Alt键,也可以按一下Esc再按特定的键.

2.3 The Titlebar 标题栏

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

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

2.4 The Statusbar 状态栏

The statusbar is the third line from the bottom of the screen, or the bottom line in Expert Mode. See See Expert Mode, for more info. It shows important and informational messages. Any error messages that occur from using the editor will appear on the statusbar. Any questions that are asked of the user will be asked on the statusbar, and any user input (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 screen which 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 mouse click places the cursor at the indicated position. Clicking a second time in the same position toggles the mark. Clicking in the shortcut list 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 is fairly self explanatory, documenting the various parts of the editor and 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 that would normally be done via command line options. They are invoked via Meta key sequences. See See Special Functions, for more info. The following 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 should not be in DOS or Mac format. During startup, nano will first read its system-wide settings from SYSCONFDIR/nanorc, and then user-specific settings from ~/.nanorc.
A nanorc file accepts a series of "set" and "unset" commands, which can be used to configure nano on startup without using the command line options. Additionally, the "syntax", "color", and "icolor" keywords are used to define syntax highlighting rules for different text patterns. nano will read one command per line.
Options in nanorc files take precedence over nano's defaults, and command line options override nanorc settings. Options are also unset by default, except for those that take arguments.
Quotes inside string parameters don't have to be escaped with backslashes. The last double quote in the string will be treated as its end. 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 justifying paragraphs. They cannot contain blank characters. Only closing punctuation, optionally followed by closing brackets, can end sentences. 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 maximum line length will be the screen width less "n" columns. The default value 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 bracket searches. They cannot contain blank characters. The former set must come before the latter set, and both must be in the same order. The default 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 place the 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 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.
set/unset preserve
Preserve the XON and XOFF keys (^Q and ^S).
set punct "string"
Set the characters treated as closing punctuation when justifying paragraphs. They cannot contain blank characters. Only closing punctuation, optionally followed by closing brackets, can end sentences. 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 and Delete work properly. You should only need to use this option if Backspace 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 support won'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 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.
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 if the current filename matches the extended regular expression "fileregex". All following "color" and "icolor" statements will apply to "syntax" until a new syntax is defined.
The "none" syntax is reserved; specifying it on the command line is the same as not having a syntax at all. The "default" syntax is special: it takes no "fileregex", and applies to files that don't match any other syntax's "fileregex".
color fgcolor,bgcolor "regex" ...
For the currently defined syntax, display all expressions matching the extended regular expression "regex" with foreground color "fgcolor" and background color "bgcolor", at least one of which must be specified. Legal colors for foreground and background color are: white, black, red, blue, green, yellow, magenta, and cyan. You may use the prefix "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 regular expression "sr" and end with the extended regular expression "er" with foreground color "fgcolor" and background color "bgcolor", at least one of which must be specified. This allows syntax highlighting to span multiple lines. Note that all subsequent instances of "sr" after an initial "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 file browser. Here, one can navigate directories in a graphical manner in order to find the desired file.
读写文件时,按下^T激活文件浏览器.以图形话的方式导航寻找需要的文件.

Basic movement in the file browser is accomplished with the arrow keys, page up, and page down. More advanced movement is accomplished by searching via ^W (or 'w') and changing directories via ^_ (or 'g'). The behavior of the Enter (or 's') key 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 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 or replace strings will be stored and can be accessed with the up/down arrow keys. Previously, nano offered a more consistent, but incompatible with Pico, method for entering search and replace strings. In the old method, previous entries would be displayed by default as editable text in front of the cursor, as opposed to being bracketed and uneditable as it is in Pico. The old behavior could be made compatible with Pico via the -p option, but recent versions of Pico use the -p option to preserve the XON and XOFF sequences within the editor. Since, with the new method, search and replace strings can still be edited by simply hitting the up arrow key once, the old method was removed completely.
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 does not have to be restarted to turn a particular feature of the editor on or off. Please see the internal help function (^G) for a list of what functions can be toggled for a particular version of nano. See See Feature Toggles, for more info.
Cursor Position Display
The output of the "Display Cursor Position" in nano displays the given column position, as well as the row and total character position of 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 and automatically replace it. The nano implementation will pause at each search string found and query whether to replace this instance or not. The internal spell checker operates similarly. Note that there is no way to force these functions to behave in the Pico fashion. As of version 1.1.99pre1, misspelled words are sorted and trimmed for uniqueness 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 much smaller, but makes it difficult for new users to learn more than very basic 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 -s command line option, which allows specifying an alternate spell checker.
--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 the larger internals of the editor, like the marking code and the cut to end of line code. It also disables the function toggles.
--enable-debug
Enable support for runtime debug output. This can get pretty messy, so chances are you only want this feature to work on the nano source.
--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 can store custom settings in the nanorc file rather than having to pass command line options to get desired behavior. See See Nanorc Files, for more 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 will require either the wide version of ncurses, or a UTF-8-enabled version of Slang.
--disable-utf8
Disable support for reading and writing Unicode files.
--with-slang
Compiling nano with Slang is supported, and will make the binary notably smaller than if compiled with ncurses or other curses libraries.
头像
vbem
帖子: 239
注册时间: 2006-09-13 9:09

#2

帖子 vbem » 2007-04-16 11:08

留个空 8)
头像
ascent
帖子: 36
注册时间: 2009-06-21 19:57

Re: [教学]nano编辑器中文帮助文档

#3

帖子 ascent » 2009-12-01 15:36

楼主可以把这发到wiki上
dooman
帖子: 3
注册时间: 2010-04-06 13:13

Re: [教学]nano编辑器中文帮助文档

#4

帖子 dooman » 2010-04-06 13:49

E文好多啊!! :em06
头像
bobo4548
帖子: 661
注册时间: 2007-07-17 22:52
来自: cn,shandong

Re: [教学]nano编辑器中文帮助文档

#5

帖子 bobo4548 » 2010-04-07 19:32

请问楼主如何设置nano的默认字体阿,我的系统中的字体显示的不好看且比较小,看起文字来比较吃力,谢谢!
头像
wangdu2002
帖子: 13284
注册时间: 2008-12-13 19:39
来自: 物华天宝人杰地灵

Re: [教学]nano编辑器中文帮助文档

#6

帖子 wangdu2002 » 2010-04-07 19:41

楼主辛苦了。。。 :em11
不过只是改配置文件,纯终端下vi更爽些,X下leafpad轻快。 :em03
行到水穷处,坐看云起时。
海内生明月,天涯共此夕。
--------------------吾本独!
头像
黄美姬
帖子: 8428
注册时间: 2009-10-08 11:15
来自: 大城市铁岭

Re: [教学]nano编辑器中文帮助文档

#7

帖子 黄美姬 » 2011-05-17 21:41

:em04 :em04
我们是命运的妓女,它把我们都嫖了

N卡驱动:http://www.nvidia.cn/Download/index.aspx?lang=cn
极品飞车:http://www.geforce.cn/optimize/optimal- ... ts-450-ops
孤岛危机优化设置:http://www.geforce.cn/optimize/optimal- ... tx-450-ops
:cp /etc/skel/.bashrc ~/
PS1="\[\e]2;\u@\H \w\a\e[32;1m\]\T$\[\e[0m\] "
http://cdimage.ubuntu.com/
http://releases.ubuntu.com/
回复