In tmux once in copy-mode one can exit either with Esc or with q (in vi-mode). I would like that to be C-g. Is there a way to do that?
Turns out the relevant command is called cancel and the relevant mode is called emacs-copy, thus what did the trick was
bind-key -t emacs-copy C-g cancel
Related
I am trying to do some code blocks in emacs org-mode.
What I am do is
press C-c C-, s
write sh :session. at this point i have
#+begin_src sh :session[cursor]
#+end_src ^
than press Enter and got some selector in modeline, that looks like autocomplition
Once I make selection my cursor disapears and I have to reopen file to have it back
How can I prevent cursor from disappearing?
How can I debug what exactly happening when I press enter?
Are you using ivy? If yes, this issue might be helpful to further dissect the problem.
Also, completion in src-block doesn't work well if using helm or ivy.
Tl;Dr
set org-src-tab-acts-natively to nil with
(setq org-src-tab-acts-natively nil)
However, This will disable the completion.
I want to remap Control-v for it to use my custom function, but it looks like I can't do that. I'm running emacs in terminal.
(global-unset-key "\C-v")
(global-set-key "\C-v" 'my-cut-or-paste)
If I try to unset first, C-h k just not showing any binding for this shortcut, and C-v just do nothing. If not unsetting shortcut, its not get remapped... The strange thing is how C-h k showing different keys for such shortcuts. For example - one time it can show
r runs the command self-insert-command, which is an interactive
other time (after emacs reload)
i runs the command self-insert-command, which is an interactive
If I try to set my function to such keys (i or r), C-v gets remapped, but those keys (i or r) are mapped to my function too, so I cant type.
Is this kind of 'terminal-related' key sequences? Is it able to do at all? thx.
My guess would be that your terminal is intercepting C-v as a paste-from-clipboard command.
If your clipboard has something that starts with i, you see:
i runs the command self-insert-command, which is an interactive
Similar for "r" or other letters. Emacs is blind to the fact that the "letters" come from a external paste, not from your keyboard. You should check the configuration options of your terminal, to see if you can unset that key.
I have a lot (~30) of buffers whose names start with the same substring. Is there a way I can pass a regular expression to the kill buffer command so I can kill all of them in one go?
The command I was looking for M-x kill-matching-buffers.
Run M-x ibuffer (built-in command).
On each line with a buffer you want to delete press 'd'.
When finished press 'x' to commit changes.
A more interactive and versatile approach is with helm-buffers-list:
Type what you want to match.
Select all matches with M-m (helm-toggle-all-marks).
Optionally, refine your selection with C-SPC (helm-toggle-visible-marks),
using C-n/C-p to navigate.
Press TAB, select "kill buffers" from the available options.
Other options are query-replace / occur / grep / revert, and a bunch of others.
C-x C-b to list all buffers
k to mark buffers for kill (D appears next to buffer)
x to execute kill
Using helm:
Open helm using helm-mini. In my case I have it mapped to C-2
Scroll through the list and mark the ones you want to delete with C-Space
Now just press M-S-d / M-D
This deletes all selected buffers and closes helm-mini.
When I tab-complete in a minibuffer and Emacs displays a completion list in a new buffer, how do I switch to that buffer without using the mouse?
I tried C-x o, but that just switched to the first buffer, out of which I entered the minibuffer.
I also tried C-x b, but that gives me command attempted to use minibuffer while in minibuffer.
Lastly I tried C-x <C-right>, which gives me cannot switch buffers in minibuffer window.
EDIT: I spoke about minibuffer completion in my example, but being able to access the completion list (using the keyboard) from within a regular buffer is also important to me, and not working. The M-v shortcut was suggested, but it only seems to work inside the minibuffer accessed by M-x, in every other buffer I've tried, M-v is bound to scroll down command and does not switch to the completion list. I doesn't even seem to work in other minibuffers. For example, it doesn't work in the shell command minibuffer invoked by M-! either.
You can use M-v (documented here) which switches to the completion buffer and puts the cursor on the first completion:
Typing M-v, while in the minibuffer, selects the window showing the
completion list (switch-to-completions). This paves the way for using
the commands below. <PageUp> or <prior> does the same. You can also
select the window in other ways...
EDIT: It looks like based on your edit to the original question that what you're asking for is a way to switch to the completions buffer more globally. There is a function switch-to-completions that selects the completions list - you might consider binding that function to a key of your choosing, e.g.:
(define-key global-map (kbd "C-x t") 'switch-to-completions)
For example, such a binding allows me to switch to completions from "Shell command: " invoked by M-!, and places the cursor on the first possible completion.
You can use C-xo twice, or use M--C-xo, which switches to the previous buffer instead of the next one.
I'm using emacs 23 (acquamacs) and have installed nrepl.el.
I've evaluated some Clojure code with
C-c C-p
(this key combo is to Evaluate the form preceding point and display the result in a popup buffer.)
Running it has produced a nice popup buffer for me to see the results.
How do I hide this popup buffer? (I don't want to kill it - just get my fullscreen back).
FYI Re this command - I've run this with
C-h k C-c C-p
and got
^C ^P runs the command nrepl-pprint-eval-last-expression, which is an interactive compiled Lisp function in `nrepl.el'.
It is bound to ^C ^P, <menu-bar> <nREPL> <Eval last expression in popup buffer>.
(nrepl-pprint-eval-last-expression)
Evaluate the expression preceding point and pprint its value in a popup buffer.
You haven't provided enough information for anyone to test (that's not a standard global binding), and you haven't even indicated whether the new window is selected; but there's a generic solution which will work regardless.
Add (winner-mode 1) to your init file, and then you can always use C-c<left> to undo the most recent window configuration change (or changes plural, if you repeat the command).
Either that or just press q. I just tried it out with the help buffer and it dismisses the window but not the buffer. However, popup buffers in the style of ac-nrepl does for its autocompletion are meant to simply be dismissed
Always, when asking Emacs questions, say what the key sequence does. C-c C-p does nothing here. TO find out what it does press C-h k C-c C-p and report back. In this case we're invoking 'describe-key and then telling it to describe what C-c C-p does.