Is there a way to make the “o” keypress of other-window repeatable?Make helm window the only windowDefining the window pointed by “other-window”How to modify bindings to match ECB window numbers?Creating function to move top-buffer to other windowDefine an emacs function to take arguments in the same way as something like M-x goto-linePrevent *org todo* pop-up window from displaying in new frame (dedicated window scenario)How to make pop-up window appear in the divided portion of the frameemacs home made perspective: source + eshell + compilationhow to use this-command and last-command in tests?
Is there a commercial liquid with refractive index greater than n=2?
Virtual destructor moves object out of rodata section
How does the illumination of the sky from the sun compare to that of the moon?
Why don't politicians push for fossil fuel reduction by pointing out their scarcity?
What's the point of writing that I know will never be used or read?
What security risks does exposing the size of the plaintext entail?
Why was ramjet fuel used as hydraulic fluid during Saturn V checkout?
Starships without computers?
Can you find the next number in the following series?
Will some rockets really collapse under their own weight?
My new Acer Aspire 7 doesn't have a Legacy Boot option, what can I do to get it?
Designing a prison for a telekinetic race
Is there a way to make the "o" keypress of other-window <C-x><C-o> repeatable?
Spongy green glass found on graves
Best model for precedence constraints within scheduling problem
How to add a table description to a longtable?
what article (a/an) to use when there when there's a parenthesis following it?
Rotate List by K places
Why should P.I be willing to write strong LOR even if that means losing a undergraduate from his/her lab?
Has there ever been a truly bilingual country prior to the contemporary period?
Is there a utility / method to organize trad gear so that each piece is immediately accessible?
Would getting a natural 20 with a penalty still count as a critical hit?
Testing control surfaces pre flight; what feedback does pilot recieve?
Why is su world executable?
Is there a way to make the “o” keypress of other-window repeatable?
Make helm window the only windowDefining the window pointed by “other-window”How to modify bindings to match ECB window numbers?Creating function to move top-buffer to other windowDefine an emacs function to take arguments in the same way as something like M-x goto-linePrevent *org todo* pop-up window from displaying in new frame (dedicated window scenario)How to make pop-up window appear in the divided portion of the frameemacs home made perspective: source + eshell + compilationhow to use this-command and last-command in tests?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
Question is as stated in the title.
Instead of using various packages for switching windows, it might be simpler to make <C-x><C-o> behave like <C-x><C-+>, such that repeated presses of the o key after the initial <C-x><C-o> will keep switching windows.
window commands navigation
add a comment |
Question is as stated in the title.
Instead of using various packages for switching windows, it might be simpler to make <C-x><C-o> behave like <C-x><C-+>, such that repeated presses of the o key after the initial <C-x><C-o> will keep switching windows.
window commands navigation
github.com/alphapapa/defrepeater.el looks like a general path to realize such requests as yours. When I tried that out it refused to work occasionally. Finally I stopped using it. But I guess it's worth to be rediscovered.
– Marco Wahl
9 hours ago
add a comment |
Question is as stated in the title.
Instead of using various packages for switching windows, it might be simpler to make <C-x><C-o> behave like <C-x><C-+>, such that repeated presses of the o key after the initial <C-x><C-o> will keep switching windows.
window commands navigation
Question is as stated in the title.
Instead of using various packages for switching windows, it might be simpler to make <C-x><C-o> behave like <C-x><C-+>, such that repeated presses of the o key after the initial <C-x><C-o> will keep switching windows.
window commands navigation
window commands navigation
edited 4 hours ago
Drew
50.9k4 gold badges65 silver badges113 bronze badges
50.9k4 gold badges65 silver badges113 bronze badges
asked 11 hours ago
yongjieyongjieyongjieyongjie
1113 bronze badges
1113 bronze badges
github.com/alphapapa/defrepeater.el looks like a general path to realize such requests as yours. When I tried that out it refused to work occasionally. Finally I stopped using it. But I guess it's worth to be rediscovered.
– Marco Wahl
9 hours ago
add a comment |
github.com/alphapapa/defrepeater.el looks like a general path to realize such requests as yours. When I tried that out it refused to work occasionally. Finally I stopped using it. But I guess it's worth to be rediscovered.
– Marco Wahl
9 hours ago
github.com/alphapapa/defrepeater.el looks like a general path to realize such requests as yours. When I tried that out it refused to work occasionally. Finally I stopped using it. But I guess it's worth to be rediscovered.
– Marco Wahl
9 hours ago
github.com/alphapapa/defrepeater.el looks like a general path to realize such requests as yours. When I tried that out it refused to work occasionally. Finally I stopped using it. But I guess it's worth to be rediscovered.
– Marco Wahl
9 hours ago
add a comment |
3 Answers
3
active
oldest
votes
You could write a function similar to text-scale-adjust. E.g.
(defun mw-other-window-repeat (count &optional all-frames)
"Wrapper around `other-window' to continue to jump to other with key o."
(interactive "p")
(other-window count all-frames)
(message "Use o to jump to next window.")
(set-transient-map
(let ((map (make-sparse-keymap)))
(define-key map (kbd "o")
(lambda () (interactive) (mw-other-window-repeat 1)))
map)))
(global-set-key (kbd "C-x o") #'mw-other-window-repeat)
C-x ooooooo
has the desired effect AFAICS. The repetition is over with another key press than o.
add a comment |
I use this in several of my libraries. Use it to make pretty much any command repeatable even when it's on a prefix key.
(defun repeat-command (command)
"Repeat COMMAND."
(require 'repeat)
(let ((repeat-previous-repeated-command command)
(repeat-message-function #'ignore)
(last-repeatable-command 'repeat))
(repeat nil)))
Then define a repeatable version of an existing command, such as other-window, just by passing that command to repeat-command. For example:
(defun other-window-repeat ()
"Select another window in cyclic ordering of windows.
This is a repeatable version of `other-window'."
(interactive)
(repeat-command 'other-window))
(global-set-key (kbd "C-x 4 o") 'other-window-repeat)
add a comment |
hydra (https://github.com/abo-abo/hydra) are another way to get repeatable commands. This doesn't move the point on the first call, but you can press o as many times as you want to move around.
(defhydra other-window (:color red :body-pre (other-window 1))
"other window"
("o" (other-window 1)))
(global-set-key (kbd "C-x o") #'other-window/body)
You can add:body-pre (other-window 1)to the hydra arguments to have it move the point on first call.
– clemera
3 hours ago
Cool, thanks! I only knew of :pre which runs before every head. I updated this solution with your suggestion!
– John Kitchin
34 mins ago
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "583"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2femacs.stackexchange.com%2fquestions%2f52201%2fis-there-a-way-to-make-the-o-keypress-of-other-window-c-xc-o-repeatable%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
You could write a function similar to text-scale-adjust. E.g.
(defun mw-other-window-repeat (count &optional all-frames)
"Wrapper around `other-window' to continue to jump to other with key o."
(interactive "p")
(other-window count all-frames)
(message "Use o to jump to next window.")
(set-transient-map
(let ((map (make-sparse-keymap)))
(define-key map (kbd "o")
(lambda () (interactive) (mw-other-window-repeat 1)))
map)))
(global-set-key (kbd "C-x o") #'mw-other-window-repeat)
C-x ooooooo
has the desired effect AFAICS. The repetition is over with another key press than o.
add a comment |
You could write a function similar to text-scale-adjust. E.g.
(defun mw-other-window-repeat (count &optional all-frames)
"Wrapper around `other-window' to continue to jump to other with key o."
(interactive "p")
(other-window count all-frames)
(message "Use o to jump to next window.")
(set-transient-map
(let ((map (make-sparse-keymap)))
(define-key map (kbd "o")
(lambda () (interactive) (mw-other-window-repeat 1)))
map)))
(global-set-key (kbd "C-x o") #'mw-other-window-repeat)
C-x ooooooo
has the desired effect AFAICS. The repetition is over with another key press than o.
add a comment |
You could write a function similar to text-scale-adjust. E.g.
(defun mw-other-window-repeat (count &optional all-frames)
"Wrapper around `other-window' to continue to jump to other with key o."
(interactive "p")
(other-window count all-frames)
(message "Use o to jump to next window.")
(set-transient-map
(let ((map (make-sparse-keymap)))
(define-key map (kbd "o")
(lambda () (interactive) (mw-other-window-repeat 1)))
map)))
(global-set-key (kbd "C-x o") #'mw-other-window-repeat)
C-x ooooooo
has the desired effect AFAICS. The repetition is over with another key press than o.
You could write a function similar to text-scale-adjust. E.g.
(defun mw-other-window-repeat (count &optional all-frames)
"Wrapper around `other-window' to continue to jump to other with key o."
(interactive "p")
(other-window count all-frames)
(message "Use o to jump to next window.")
(set-transient-map
(let ((map (make-sparse-keymap)))
(define-key map (kbd "o")
(lambda () (interactive) (mw-other-window-repeat 1)))
map)))
(global-set-key (kbd "C-x o") #'mw-other-window-repeat)
C-x ooooooo
has the desired effect AFAICS. The repetition is over with another key press than o.
answered 9 hours ago
Marco WahlMarco Wahl
1,8064 silver badges7 bronze badges
1,8064 silver badges7 bronze badges
add a comment |
add a comment |
I use this in several of my libraries. Use it to make pretty much any command repeatable even when it's on a prefix key.
(defun repeat-command (command)
"Repeat COMMAND."
(require 'repeat)
(let ((repeat-previous-repeated-command command)
(repeat-message-function #'ignore)
(last-repeatable-command 'repeat))
(repeat nil)))
Then define a repeatable version of an existing command, such as other-window, just by passing that command to repeat-command. For example:
(defun other-window-repeat ()
"Select another window in cyclic ordering of windows.
This is a repeatable version of `other-window'."
(interactive)
(repeat-command 'other-window))
(global-set-key (kbd "C-x 4 o") 'other-window-repeat)
add a comment |
I use this in several of my libraries. Use it to make pretty much any command repeatable even when it's on a prefix key.
(defun repeat-command (command)
"Repeat COMMAND."
(require 'repeat)
(let ((repeat-previous-repeated-command command)
(repeat-message-function #'ignore)
(last-repeatable-command 'repeat))
(repeat nil)))
Then define a repeatable version of an existing command, such as other-window, just by passing that command to repeat-command. For example:
(defun other-window-repeat ()
"Select another window in cyclic ordering of windows.
This is a repeatable version of `other-window'."
(interactive)
(repeat-command 'other-window))
(global-set-key (kbd "C-x 4 o") 'other-window-repeat)
add a comment |
I use this in several of my libraries. Use it to make pretty much any command repeatable even when it's on a prefix key.
(defun repeat-command (command)
"Repeat COMMAND."
(require 'repeat)
(let ((repeat-previous-repeated-command command)
(repeat-message-function #'ignore)
(last-repeatable-command 'repeat))
(repeat nil)))
Then define a repeatable version of an existing command, such as other-window, just by passing that command to repeat-command. For example:
(defun other-window-repeat ()
"Select another window in cyclic ordering of windows.
This is a repeatable version of `other-window'."
(interactive)
(repeat-command 'other-window))
(global-set-key (kbd "C-x 4 o") 'other-window-repeat)
I use this in several of my libraries. Use it to make pretty much any command repeatable even when it's on a prefix key.
(defun repeat-command (command)
"Repeat COMMAND."
(require 'repeat)
(let ((repeat-previous-repeated-command command)
(repeat-message-function #'ignore)
(last-repeatable-command 'repeat))
(repeat nil)))
Then define a repeatable version of an existing command, such as other-window, just by passing that command to repeat-command. For example:
(defun other-window-repeat ()
"Select another window in cyclic ordering of windows.
This is a repeatable version of `other-window'."
(interactive)
(repeat-command 'other-window))
(global-set-key (kbd "C-x 4 o") 'other-window-repeat)
answered 4 hours ago
DrewDrew
50.9k4 gold badges65 silver badges113 bronze badges
50.9k4 gold badges65 silver badges113 bronze badges
add a comment |
add a comment |
hydra (https://github.com/abo-abo/hydra) are another way to get repeatable commands. This doesn't move the point on the first call, but you can press o as many times as you want to move around.
(defhydra other-window (:color red :body-pre (other-window 1))
"other window"
("o" (other-window 1)))
(global-set-key (kbd "C-x o") #'other-window/body)
You can add:body-pre (other-window 1)to the hydra arguments to have it move the point on first call.
– clemera
3 hours ago
Cool, thanks! I only knew of :pre which runs before every head. I updated this solution with your suggestion!
– John Kitchin
34 mins ago
add a comment |
hydra (https://github.com/abo-abo/hydra) are another way to get repeatable commands. This doesn't move the point on the first call, but you can press o as many times as you want to move around.
(defhydra other-window (:color red :body-pre (other-window 1))
"other window"
("o" (other-window 1)))
(global-set-key (kbd "C-x o") #'other-window/body)
You can add:body-pre (other-window 1)to the hydra arguments to have it move the point on first call.
– clemera
3 hours ago
Cool, thanks! I only knew of :pre which runs before every head. I updated this solution with your suggestion!
– John Kitchin
34 mins ago
add a comment |
hydra (https://github.com/abo-abo/hydra) are another way to get repeatable commands. This doesn't move the point on the first call, but you can press o as many times as you want to move around.
(defhydra other-window (:color red :body-pre (other-window 1))
"other window"
("o" (other-window 1)))
(global-set-key (kbd "C-x o") #'other-window/body)
hydra (https://github.com/abo-abo/hydra) are another way to get repeatable commands. This doesn't move the point on the first call, but you can press o as many times as you want to move around.
(defhydra other-window (:color red :body-pre (other-window 1))
"other window"
("o" (other-window 1)))
(global-set-key (kbd "C-x o") #'other-window/body)
edited 35 mins ago
answered 6 hours ago
John KitchinJohn Kitchin
6,5161 gold badge6 silver badges20 bronze badges
6,5161 gold badge6 silver badges20 bronze badges
You can add:body-pre (other-window 1)to the hydra arguments to have it move the point on first call.
– clemera
3 hours ago
Cool, thanks! I only knew of :pre which runs before every head. I updated this solution with your suggestion!
– John Kitchin
34 mins ago
add a comment |
You can add:body-pre (other-window 1)to the hydra arguments to have it move the point on first call.
– clemera
3 hours ago
Cool, thanks! I only knew of :pre which runs before every head. I updated this solution with your suggestion!
– John Kitchin
34 mins ago
You can add
:body-pre (other-window 1) to the hydra arguments to have it move the point on first call.– clemera
3 hours ago
You can add
:body-pre (other-window 1) to the hydra arguments to have it move the point on first call.– clemera
3 hours ago
Cool, thanks! I only knew of :pre which runs before every head. I updated this solution with your suggestion!
– John Kitchin
34 mins ago
Cool, thanks! I only knew of :pre which runs before every head. I updated this solution with your suggestion!
– John Kitchin
34 mins ago
add a comment |
Thanks for contributing an answer to Emacs Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2femacs.stackexchange.com%2fquestions%2f52201%2fis-there-a-way-to-make-the-o-keypress-of-other-window-c-xc-o-repeatable%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
github.com/alphapapa/defrepeater.el looks like a general path to realize such requests as yours. When I tried that out it refused to work occasionally. Finally I stopped using it. But I guess it's worth to be rediscovered.
– Marco Wahl
9 hours ago