nano:基本操作

  nano编辑器:发音[‘nænoʊ] 。

  1. 顶端行显示程序版本,正在编辑的当前文件名,以及是否或者文件未被修改。
  2. 接下来是主编辑窗口显示正在编辑的文件。
  3. 状态行是底部的第三行显示重要讯息。
  4. 底部两行显示最常用的编辑器中的捷径。 控制键符号 实际的键 ^ Ctrl M- Alt

Control Key

Replaced Key

Annotation

^G

F1

显示此帮助文本

^X

F2

关闭当前文件缓冲区/从nano退出

^O

F3

将当前文件写入磁盘

^J

F4

对齐当前段落

^R

F5

将另一个文件插入当前文件

^W

F6

搜索字符串或正则表达式

^Y

F7

转到上一画面

^V

F8

转到下一个屏幕

^K

F9

剪切

^U

F10

粘贴

^C

F11

显示光标位置

^T

F12

拼写检查

^A

转到当前行的开始

^E

转到当前行的结尾

^L

刷新当前屏幕

^Z

如果挂起已启用,挂起编辑器

^_

转到行号和列号\

^Space

空格前进一个字

M-Space

空间返回一个字

M-\

M-|

光标移至文件起始行

M-/

M-?

光标移至文件结尾行

M-^

M-6

复制当前行并将其存储在剪切缓冲区中

M-}

缩进当前行

M-{

反缩进当前行

M-V

逐字插入下一个按键

M-T

从光标位置切换到文件末尾

M-J

对齐整个文件

M-D

计算单词,行和字符的数量

M-S

平滑滚动启用/禁用

M-P

空格显示启用/禁用

M-Y

颜色语法突出显示启用/禁用

M-I

自动缩进启用/禁用

M-M

鼠标支持启用/禁用


  官方原文档(在 nano 下按 ^G 可直接查看 ):

Main nano help text

 The nano editor is designed to emulate the functionality and ease-of-use of
 the UW Pico text editor.  There are four main sections of the editor.  The top
 line shows the program version, the current filename being edited, and whether
 or not the file has been modified.  Next is the main editor window showing the
 file being edited.  The status line is the third line from the bottom and
 shows important messages.  The bottom two lines show the most commonly used
 shortcuts in the editor.

 The notation for shortcuts is as follows: Control-key sequences are notated
 with a caret (^) symbol and can be entered either by using the Control (Ctrl)
 key or pressing the Escape (Esc) key twice.  Escape-key sequences are notated
 with the Meta (M-) symbol and can be entered using either the Esc, Alt, or
 Meta key depending on your keyboard setup.  Also, pressing Esc twice and then
 typing a three-digit decimal number from 000 to 255 will enter the character
 with the corresponding value.  The following keystrokes are available in the
 main editor window.  Alternative keys are shown in parentheses:

^G      (F1)            Display this help text
^X      (F2)            Close the current file buffer / Exit from nano
^O      (F3)            Write the current file to disk
^J      (F4)            Justify the current paragraph

^R      (F5)            Insert another file into the current one
^W      (F6)            Search for a string or a regular expression
^Y      (F7)            Go to previous screen
^V      (F8)            Go to next screen

^K      (F9)            Cut the current line and store it in the cutbuffer
^U      (F10)           Uncut from the cutbuffer into the current line
^C      (F11)           Display the position of the cursor
^T      (F12)           Invoke the spell checker, if available

M-\     (M-|)           Go to the first line of the file
M-/     (M-?)           Go to the last line of the file

^_      (F13)   (M-G)   Go to line and column number
^\      (F14)   (M-R)   Replace a string or a regular expression
^^      (F15)   (M-A)   Mark text at the cursor position
M-W     (F16)           Repeat last search

M-^     (M-6)           Copy the current line and store it in the cutbuffer
M-}                     Indent the current line
M-{                     Unindent the current line
^F                      Go forward one character
^B                      Go back one character
^Space                  Go forward one word
M-Space                 Go back one word
^P                      Go to previous line
^N                      Go to next line

^A                      Go to beginning of current line
^E                      Go to end of current line
M-(     (M-9)           Go to beginning of paragraph; then of previous paragraph
M-)     (M-0)           Go just beyond end of paragraph; then of next paragraph
M-]                     Go to the matching bracket
M--     (M-_)           Scroll up one line without scrolling the cursor
M-+     (M-=)           Scroll down one line without scrolling the cursor
M-<     (M-,)           Switch to the previous file buffer
M->     (M-.)           Switch to the next file buffer

M-V                     Insert the next keystroke verbatim
^I                      Insert a tab at the cursor position
^M                      Insert a newline at the cursor position
^D                      Delete the character under the cursor
^H                      Delete the character to the left of the cursor
M-T                     Cut from the cursor position to the end of the file

M-J                     Justify the entire file
M-D                     Count the number of words, lines, and characters
^L                      Refresh (redraw) the current screen
^Z                      Suspend the editor (if suspend is enabled)

(M-X)                   Help mode enable/disable
(M-C)                   Constant cursor position display enable/disable
(M-O)                   Use of one more line for editing enable/disable
(M-S)                   Smooth scrolling enable/disable
(M-P)                   Whitespace display enable/disable
(M-Y)                   Color syntax highlighting enable/disable
(M-H)                   Smart home key enable/disable
(M-I)                   Auto indent enable/disable
(M-K)                   Cut to end enable/disable
(M-L)                   Long line wrapping enable/disable
(M-Q)                   Conversion of typed tabs to spaces enable/disable
(M-B)                   Backup files enable/disable
(M-F)                   Multiple file buffers enable/disable
(M-M)                   Mouse support enable/disable
(M-N)                   No conversion from DOS/Mac format enable/disable
(M-Z)                   Suspension enable/disable
(M-$)                   Soft line wrapping enable/disable


本文参与腾讯云自媒体分享计划,欢迎正在阅读的你也加入,一起分享。

我来说两句

0 条评论
登录 后参与评论

相关文章

  • leetcode: 66. Plus One

    JNingWei
  • leetcode: 53. Maximum Subarray

    JNingWei
  • leetcode: 118. Pascal's Triangle

    JNingWei
  • Fix Notification Switching Position Issue

    I once faced with a problem. I wrote a piece of code related with notifcation. E...

    技术小黑屋
  • TW洞见 | 敏捷回顾7步法

    Paulo和TC一直在收集整理关于敏捷回顾的任何想法和活动。在这篇内容里面,他们分享了7步法来帮助你组织你的下一次回顾。 Agenda structure: 1...

    ThoughtWorks
  • 基于图卷积网络的运动结构图像检索(CS CV)

    用于运动结构(SfM)的常规图像检索技术受到有效识别重复模式的局限,无法保证以高精度和高召回率创建足够的匹配对。在本文中,我们提出了一种基于图卷积网络(GCN)...

    gaowanting
  • 2019.8.15乘兴打Codeforces Round #569 (Div. 2)小记

    Recently, on the course of algorithms and data structures, Valeriy learned how t...

    glm233
  • The Note based on Data Structures and Algorithm Analysis in C CHAPTER 3 P1

    The Note based on Data Structures and Algorithm Analysis in C

    Chiptune
  • 使用SAP Transaction Launcher将ABAP Webdynpro嵌入到WebClient UI中

    THINK twice why you want to include an ABAP webdynpro component into CRM UI, as ...

    Jerry Wang
  • 使用SAP Transaction Launcher将ABAP Webdynpro嵌入到WebClient UI中

    THINK twice why you want to include an ABAP webdynpro component into CRM UI, as ...

    Jerry Wang

扫码关注云+社区

领取腾讯云代金券