如何在纳米编辑器中用鼠标移动闪烁的光标?

Fed*_*ile 11 nano

我正在使用nano通过终端编写文本文件;每次我需要选择文本中某一行的位置时,我都会忍不住滚动所有行,使用键盘箭头移动闪烁的光标;有没有办法避免这种情况,只需使用鼠标直接选择我想要光标所在的位置?

ste*_*ver 16

您可以使用该-m (--mouse)选项启动 nano 。从man nano

   -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.
Run Code Online (Sandbox Code Playgroud)

  • 好吧,我只是浪费了 15 年的时间点击箭头来导航。这是有史以来最有用的“隐藏”功能。它应该是默认的。 (2认同)

cha*_*uck 10

将此添加到您的~/.nanorc文件中

set mouse
Run Code Online (Sandbox Code Playgroud)

这将导致每次打开 nano 时鼠标都在工作

(来源GNU nanorc 文档


小智 5

这适用于 Ubuntu:在使用 nano 时按住Esc并按下M,它将启用鼠标支持。