问题描述
Nano是我在命令提示符中使用的编辑器。
当我打开一个大文件时,我想搜索一些文本(想想Ctrl
+ F
)。
有没有办法做到这一点?
最佳解决方案
Ctrl
+ W
是搜索的快捷方式。按下F6
键可以达到相同的效果。输入搜索词后,按Enter
。要重复搜索,请发布Alt
+ W
。在此菜单中,您可以使用箭头向上/向下键选择较早的搜索。
要切换向后搜索,您需要在搜索对话框中按Alt
+ B
。
有关更多快捷方式,请按F1
次佳解决方案
CTRL
– W
第三种解决方案
^W (F6) Search for a string or a regular expression
-
不是所有的系统工作F1帮助页面。尝试^ G。
-
并非所有系统nano都有帮助页面
是的,这只是帮助页面。对于那些看到此消息的人[对不起,此功能的支持已被禁用],而不是纳米帮助页面
^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
第四种方案
您可以使用Ctrl W
在nano中搜索文本。
Alt W
(或Esc
,W
)将重复查找。 (或者,将该框留空将默认为搜索的最后一个文本。)
在查找提示时按下Ctrl R
将激活替换模式。
(遗憾的是,Ctrl W
在nano的Ctrl G
帮助屏幕中似乎不起作用。)