NanoHowto

来自Ubuntu中文
跳到导航跳到搜索
Draft
翻译人员:speme

如何使用nano

介绍

attachment:IconsPage/IconGNOMETerminal.png

This page will explain simple things with nano, and will give links to off site help. 这个页面提供了nano的一些基本信息,并提供了其它相关站点的链接。

nano是什么?

Nano是一个简单的没有花梢及华丽效果的文本编辑器。它是pine邮件客户端自带的文本编辑器pico的克隆版。Nano在做简单文本文件编辑时相当不错。但不要希望用它来做复杂的编辑工作。其它的编辑器诸如"emacs","vim","gedit"都提供了文本着色以及自动文本格式化。而Nano只做最基本的编辑操作,而不提供其它功能 Nano is a text editor that is not flashy or fancy. It is a clone of the pico editor which is shipped with the pine email client. Nano is nice to just make quick edits in text files, but most do not prefer it to do heavy editing. Other editor's such as "emacs", "vim", "gedit" all offer coloring of text and auto formating. Nano gets the job done without any distractions.

如何运行nano

To just start a regular nano session. 开始一次常规nano会话

bash:~$ nano -w <文件名>

This will open <nameoffile> into a editing window. You can create new files like this or edit existing files. The "-w" is present to disable wordwrapping, which can cause problems in some types of files. 这将打开<文件名>所指的文件并进入编辑状态。你可以新建一个文件或是编辑一个已经存在的文件。"-w"参数用来取消文本自动换行。文本自动换行在打开某些特殊格式的文件时可能导致某些问题。

如何使用nano

The basic controls for nano are shown on the bottom of the screen. The <sup> mark means to hold the control key and press the letter following it. For example, X (quit) means hold control and press X. To see more nano commands, hit control-G. On the help screen, M- before a letter means to hold down Meta or Alt and press it. So M-M (enable mouse support) means hold alt and press M. nano uses some odd conventions: nano的基本操作显示在屏幕的下方。<sup>的意思是按下ctrl键的同时按下后面跟着的键。例如,X(退出)的意思是在按ctrl键的同时按X键。要知道更多的nano快捷键,可以敲control-G来获取相关信息。在帮助屏幕中,M-显示在某个字符的前面意味着在按META键或是ALT键的同时按下随后的键。就像M-M(提供鼠标支持)表示按ALT时按M键。nano使用的快捷键中比较奇怪的有:

  • WriteOut (control-O) - 保存
  • Cur Pos (control-C) - tells you what line and letter the cursor is on告诉你光标在哪一行的哪个位置
  • Read File (control-R) - inserts the contents of another file插入其它文件的内容
  • pressing Alt-F after control-R behaves just like an Open command in other text editors.在其他文本编辑器中表现象一个开放命令
  • Where Is (control-W) - searches for some text in the file在文件中查找文本

The help screen explains most of the commands very well. Press Control-G to read it! 帮助中非常好地解释了相当多的使用方法。请按CTRL-G来阅读它!

Links

`note`: How does Justify/Unjustify work?

UserDocumentation



等待校对