Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Scroll using the mouse in nano editor?

Tags:

nano

Probably not the right place to ask this question, but I couldn't find the answer anywhere. As the title says, is there a way to enable mouse wheel scrolling in the nano editor? (specifically ubuntu 14.04)

like image 954
jj172 Avatar asked Jun 22 '16 23:06

jj172


People also ask

How do I scroll in nano editor?

Or use Esc M to toggle mouse support from within nano. I hope this saves someone a day of searching. Yes, rather counter-intuitive (disable mouse support to be able to use the mouse to scroll).

How do I make my mouse scroll?

To move up or down through the pages on a screen, move your mouse cursor over to the scroll bar on the right-hand side. Click on and hold the scroll bar thumb and then move your mouse forward or back over the mouse mat to move up or down on the screen.


1 Answers

Nano doesn't support using the mouse wheel to scroll. You can enable nano's (limited) mouse support with alt-M or with --mouse when starting nano (another invocation returns to whatever mouse support your terminal has), but that's it:

−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. Text can still be selected through dragging by holding down the Shift key.

(https://www.nano-editor.org/dist/v2.6/nano.1.html)

By default, mouse services are provided by the terminal window. The mouse works almost the same as in a GUI editor. You can highlight text, right-click to copy and paste, and use the middle mouse button for pasting text from the buffer. However, when you use the middle mouse button to paste text, the text is pasted at the current cursor location, not at the mouse pointer location. Other limitations exist. For example, you cannot use the mouse to cut or delete text, nor can you use the mouse to scroll through the file.

Nano has its own built-in mouse services, but they are limited. They provide only the ability to move the cursor to the point where you click, and to mark the beginning and end of a section of text. Use the Alt-M key combination to toggle between using the terminal's mouse services and nano's built-in mouse services.

(https://help.ubuntu.com/community/Nano)

like image 70
meatspace Avatar answered Sep 29 '22 02:09

meatspace