The GNU nano text editor (文本编辑器)

GNUnano是一个小巧且用户友好的GNU文本编辑器,提供了方便的快捷键操作,如Ctrl+S用于保存文件,Ctrl+O进行另存为,而Ctrl+X则用于关闭文件并退出编辑器。其源代码可在GNUSavannah上找到。

The GNU nano text editor {文本编辑器}

The GNU nano homepage
https://www.nano-editor.org/

GNU nano is a small and friendly text editor.

1. GNU nano

The GNU nano text editor
https://www.nano-editor.org/dist/latest/nano.html

Source Code
https://git.savannah.gnu.org/cgit/nano.git/

^ 表示键盘上的 Ctrl 键,M 表示键盘上的 Alt 键。

在这里插入图片描述

2. Overview of nano’s shortcuts

https://www.nano-editor.org/dist/latest/cheatsheet.html

  • File handling

Ctrl+S (^S) Save current file - 保存
Ctrl+O (^O) Offer to write file (Save as) - 另存为 / 写入当前文件至磁盘
Ctrl+R (^R) Insert a file into current one - 插入另一个文件的内容到当前正在编辑的文件中‌
Ctrl+X (^X) Close buffer, exit from nano - 关闭当前文件缓冲区 / 离开 nano

  • Moving around

← \leftarrow ← One character backward
→ \rightarrow → One character forward
Ctrl+ ← \leftarrow ← One word backward - 向后跳动一个单词
Ctrl+ → \rightarrow → One word forward - 向前跳动一个单词
Ctrl+A To start of line - 跳到行首
Ctrl+E To end of line - 跳到行尾
Ctrl+P One line up
Ctrl+N One line down
Ctrl+ ↑ \uparrow ↑ To previous block
Ctrl+ ↓ \downarrow ↓ To next block
Alt+Home To first row in viewport
Alt+End To last row in viewport
Ctrl+Y One page up - 跳到上一页
Ctrl+V One page down - 跳到下一页
Alt+\ To top of buffer
Alt+/ To end of buffer

  • Editing

Ctrl+K Cut current line into cutbuffer - 剪切 (当前行或者被标记的区域)
Alt+6 Copy current line into cutbuffer - 复制 (当前行或者被标记的区域)
Ctrl+U Paste contents of cutbuffer - 粘贴
Ctrl+] Complete current word
Alt+3 Comment/uncomment line/region
Alt+U Undo last action
Alt+E Redo last undone action

  • Search and replace

Ctrl+B Start backward search
Ctrl+F Start forward search
Alt+B Find next occurrence backward
Alt+F Find next occurrence forward
Alt+R Start a replacing session

  • Deletion

Ctrl+H Delete character before cursor
Ctrl+D Delete character under cursor
Alt+Bsp Delete word to the left
Ctrl+Del Delete word to the right
Alt+Del Delete current line

  • Special movement

Alt+G Go to a specified line
Alt+] Go to complementary bracket
Alt+< Scroll viewport to the left
Alt+> Scroll viewport to the right
Alt+ ↑ \uparrow ↑ Scroll viewport up
Alt+ ↓ \downarrow ↓ Scroll viewport down
Ctrl+L Center the current line
Alt+ ← \leftarrow ← Switch to preceding buffer
Alt+ → \rightarrow → Switch to succeeding buffer

  • Information

Ctrl+C Report cursor position - 报告光标位置
Alt+D Report line/word/character counts
Ctrl+G Display help text - 查看帮助

  • Various

Alt+A Set or unset the mark
Alt+C Turn constant position info on/off
Alt+N Turn line numbers on/off
Alt+P Turn visible whitespace on/off
Alt+S Turn softwrapping on/off
Alt+X Hide/unhide the help lines
Alt+Z Hide/unhide the info bars

  • Operations

Ctrl+T Execute some command
Ctrl+T Ctrl+S Run a spell check
Ctrl+T Ctrl+Y Run a syntax check
Ctrl+T Ctrl+O Run a formatter
Tab Indent marked region
Shift+Tab Unindent marked region
Ctrl+J Justify paragraph or region
Alt+J Justify entire buffer
Alt+T Cut until end of buffer
Alt+V Enter next keystroke verbatim
Alt+: Start/stop recording of macro
Alt+; Replay macro

verbatim [vɜː(r)ˈbeɪtɪm]
adj. 一字不差的 (地);逐字的 (地)
adv. 逐字的
n. 逐字报告

References

[1] Yongqiang Cheng (程永强), https://yongqiang.blog.csdn.net/
[2] The GNU nano text editor (文本编辑器), https://mp.weixin.qq.com/s/U1_RwgWPqjyU6eJQKCy_vg

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Yongqiang Cheng

梦想不是浮躁,而是沉淀和积累。

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值