Mouse cursor in Terminal?
Solution 1
vim:
:set mouse=a
Solution 2
In Mac OS X Terminal, you can hold down Option (or Alt) and click, and the typing cursor will move to the mouse cursor.
Solution 3
Nano can do this with the '-m' argument.
themirror
Updated on September 17, 2022Comments
-
themirror over 1 year
I use Mac OS X Terminal.app. But the answer to this would probably apply to any typical UNIX-ish terminal emulator in a graphical environment.
Question -- what do I do to: Use my mouse cursor to click on a character-position in the current line of the terminal, and have the terminal's cursor jump to that spot?
Typically, you have to hold down an arrow key to move to the correct cursor position. If you're pasting in a long string of text at the shell prompt, or working in an editor like VI, this can take a long time. I know editors have other navigation keys like jump-words, but I like my mouse cursor.
-
Chris Page over 8 yearsAt the time this answer was given, Terminal did not support Mouse Reporting, so this answer was invalid—which makes me wonder how it could be the accepted answer. However, as of OS X 10.11 El Capitan, Terminal now supports Mouse Reporting and this will work in Vim.
-
Chris Page over 8 yearsAt the time this answer was given, Terminal did not support Mouse Reporting, so this answer was invalid. However, as of OS X 10.11 El Capitan, Terminal now supports Mouse Reporting and this will work in Vim.
-
Chris Page over 8 yearsIt would improve this answer to add an explanation of how to use
~/.vimrc
to enable Mouse Reporting automatically. -
Chris Page over 8 yearsIt would improve this answer to add an explanation of how to use
~/.nanorc
to enable Mouse Reporting automatically. -
akira over 8 years@ChrisPage: if you want to improve this answer: click the edit link. regarding the "at the time the answer was given the answer was invalid": i would not have given the answer if it would not have worked on my machine at that time. and it worked for OP at that time as well.
-
Chris Page over 8 yearsYou must have had the MouseTerm SIMBL plugin installed. bitheap.org/mouseterm
-
Chris Page over 8 yearsYou probably had the MouseTerm SIMBL plugin installed: bitheap.org/mouseterm
-
Sergio Abreu over 7 yearsI really wonder HOW one usefull I'd say ESSENCIAL thing doesn't come ready BY DEFAULT ...
-
Enrico about 7 years@ChrisPage why is it relevant that the answer was invalid (for you?) at the time it was written, if it worked for OP? Anyhow, remember you can improve answers too, the edit link is right there :)
-
Nick Meldrum almost 7 years@SergioAbreu some people use vim so they can stay on the keyboard and not use a mouse...
-
user26742873 about 3 years@ChrisPage Just write
set mouse=a
- there's no need for an explanation. -
Chris Page about 3 years@Enrico Invalid for everyone who did not install third-party software that is not mentioned. That's critical information.