How to navigate by clicking with your cursor in Unix? - emacs

So when I am writing in Unix in the emacs editor it is not possible to change lines I wrote before by clicking on that particular part. Now I have to use my arrows on the keyboard and that takes a lot of time. Anyone suggestions?

I assume you're asking about using a mouse in a terminal. If so, use xterm-mouse-mode by running M-x xterm-mouse-mode or adding (xterm-mouse-mode 1) to your init.el.

Related

DOOM emacs Move Cider REPL windows vertical

I'd like to ask how to move cider repl in DOOM, from horizontal (screenshot below) to vertical? been trying many menus shortcut but still horizontal.
Thanks you so much
enter image description here
As was already mentioned, in DOOM this REPL window is transformed into a popup, and you can customize it in your .doom.d/config.el:
(after! cider
(set-popup-rules!
'(("^\\*cider-repl"
:side right
:width 100
:quit nil
:ttl nil))))
The easiest thing to achieve this is by splitting the windows vertically before jacking into Cider. I.e., in your source code file, hit C-x 3 which calls split-window-right.
Of course, you could write a small Elisp function to call this before jacking into Cider (you might want a defadvice), but you would have to check your current window layout first, so I never bothered to do this.
Doom uses a pop-up for the REPL window, so the simplest way would be to disable popups. Otherwise, you can maximize the popup (Ctrl ~), and split the window vertically...

Prevent mouse-selected text from being put into Emacs paste buffer?

In emacs, there is a feature where if I select text with a mouse, then without pressing
ctrl-c I can paste into emacs with ctrl-v if I have cua mode turned on.
I want to turn off this feature while keeping the cua mode on. I mean I want to
explicitly press ctrl-c so that the text will get copied to the clipboard.
I suspect that you are using a version of Emacs older than version 24? If so, see the last paragraph of this page of the current Emacs manual. You can probably get rid of the behaviour you dislike by setting x-select-enable-primary to nil.
From my quick tests, setting it to T (which isn't the default on Emacs 24) reproduces the problem behaviour, and this happens both in and not in cua-mode.

How can I configure emacs to switch to a particular buffer when I click the mouse in it?

I'm using iTerm2 on my mac to ssh into a Linux box and run emacs in the terminal. On a big monitor, I like to split the window to see multiple buffers side-by-side. I'd like to be able to switch to a particular buffer by clicking the mouse in it (rather than doing C-x o).
What seems to be happening is that if I click the mouse anywhere outside the currently active buffer e.g. in the next buffer, on the mode line etc., the click is being interpreted as which is bound to (tmm-menubar-mouse EVENT).
I have disabled the menubar by doing the following in my .emacs_d/init.el:
(menu-bar-mode -1)
This seems to disable the visible display of the menu bar at the top of the window, but the mouse click behavior I described is still happening.
I think what I need is to have the click interpreted as something other than and then bind that to some function that detects which buffer the click happened in and switch to it. But, I don't know how to do that and the searching I've done hasn't yielded any clear answer. Can anyone help?
Alternatively, I looked into using windmove to enable switching between buffers with SHIFT and the arrow keys. I did (windmove-default-keybindings) but emacs then seems to respond to SHIFT left-arrow by inserting "2C" into the buffer and SHIFT-right-arrow by inserting "2D". If anyone has any tips on making this work too, I'd love to hear them.
Thanks
I ran into this problem a while ago, where clicking on column > 95 was interpreted as <menu-bar> <mouse-1>, which invokes tmm-menubar-mouse. It turned out to be a bug:
http://debbugs.gnu.org/cgi/bugreport.cgi?bug=6594
There hasn't been a formal release since this bug was fixed, but you can get the patch here:
http://bzr.savannah.gnu.org/lh/emacs/emacs-23/revision/100618
If I recall correctly, you should be able to just drop the modified file into your existing emacs installation and byte-compile it (assuming you're running the 23.3.1, the latest release).

How do I keep Emacs org-mode from splitting windows?

I'm a new emacs user using emacs for the awesome org-mode. I have links to all my org files at the top of my pages but everytime I click a link it splits my window, so I only have half of the screen estate available. How do I set it so that emacs does not split the window horizontally but rather opens up a new window for my links?
I'm assuming you mean you want to open the link in a new frame. (Emacs terminology is a bit different from other GUI apps, because Emacs predates X11. What would be called a "window" in other apps is called a "frame" in Emacs, because "window" already had a specific meaning in Emacs, and was used in the names of lots of functions.) What's happening now is that you have a frame containing one window, and Emacs is splitting that window to form two windows.
You need to customize org-link-frame-setup to use find-file-other-frame instead of the default find-file-other-window.
You can do this by typing M-x customize-variable <ENTER> org-link-frame-setup <ENTER>. Click the Value Menu next to find-file-other-window and select find-file-other-frame, then click Save for future sessions.
One option is to tell Emacs to never split windows, which can be done like so:
(setq same-window-regexps '("."))
This will keep your window from splitting, and then you use your regular commands to switch buffers to get back to what you were looking at.
This is as opposed to what it sounds like you were asking for, which was new frames, which IMO doesn't really help if you have limited screen real estate because you're now having to switch frames (graphical windows).

How to switch split screen Emacs where one screen is the editor while the other is terminal emulator?

I have ssh'ed to a remote machine and started emacs. I opened one small python application, and then split the screen into two, and M-x terminal-emulator in the other. I would like to edit the script in one section, then press C-x o and run it on the other section. Unfortunately, I can't seem to C-x o away from the terminal emulator and it just ends up typing x o.
Is there a better quick way of doing what I'm trying to do? Or is there a keystroke that will let me switch back to the editor section?
Edit: I just tried doing 'M-x shell', instead of 'M-x term', and that allows me to use C-x o to switch.
While at the * terminal* window, C-^ o to switch to other window, and C-^ C-h for more help.
ALT-X other-window
C-TAB also works locally. Will that translate over SSH? If not, bind other-window to another key that will go over SSH.
I found this post and I customized the .emacs file accordingly.
http://nex-3.com/posts/45-efficient-window-switching-in-emacs