help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Can I use 'C-x o o o o o' instead of C-x o C-x o C-x o C-x o C-x o?


From: Joe Fineman
Subject: Re: Can I use 'C-x o o o o o' instead of C-x o C-x o C-x o C-x o C-x o?
Date: Tue, 28 Apr 2015 14:19:47 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (windows-nt)

張國良 <address@hidden> writes:

> Scenario 1
> - I split many windows.
> - I wish to switch to some other windows.
> - I type C-x o, C-x o, C-x o repeatedly until the cursor landed on the
> desired window.
> Is there a way to use C-x o o o instead?
>
> I aware that I can use C-u num C-x o, if I know the desired window is num
> step away.  But there are times that I do not know 'num'.
>
>
> Scenario 2
> - I use the windmove package.
> - I bind the windmove-up/down/left/right to C-o i, C-o k, C-o j, C-o l
> respectively.  Now, if I want to windmove to up-left, I type C-o i, C-o j.
> Is there a way to use C-o i j instead?

I long ago put the following in my .emacs:

(defun goto-next-window ()
  "Go to the next window after saving the current buffer."
  (interactive)
  (if (buffer-file-name) (save-buffer))
  (other-window 1))

(defun goto-previous-window ()
  "Go to the previous window after saving the current buffer."
  (interactive)
  (if (buffer-file-name) (save-buffer))
  (other-window -1))

(global-set-key (kbd "C-<prior>") 'goto-previous-window)
(global-set-key (kbd "C-<next>") 'goto-next-window)
-- 
---  Joe Fineman    address@hidden

||:  The higher the monkey climbs, the more he shows his rear.  :||


reply via email to

[Prev in Thread] Current Thread [Next in Thread]