Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Easier window switching in Emacs.

0 views
Skip to first unread message

deech

unread,
Apr 27, 2008, 2:20:17 PM4/27/08
to
Hi all,
Has anyone else noticed that window switching in emacs is a
bit cumbersome?

About a month ago I created a new prefix key C-t and bound
h,j,k,l to move to the left, top, bottom, and right window
respectively. Here is the snippet in my .emacs file that makes this
happen. Please note that this destroys C-t which is by default bound
to transpose-char. If you use this a lot try another prefix key.

;;Make window switching a little easier. C-x-o is a pain.
;;Unbind C-t. I don't really care about transposing chars.
(global-unset-key "\C-t")
;; Turn C-t into a prefix key
(define-prefix-command 'ctrl-t-prefix)
;; And within C-t bind vi-style navigation shortcuts
;; to window switching
(define-key 'ctrl-t-prefix "j" 'windmove-down)
(define-key 'ctrl-t-prefix "k" 'windmove-up)
(define-key 'ctrl-t-prefix "h" 'windmove-left)
(define-key 'ctrl-t-prefix "l" 'windmove-right)
(global-set-key "\C-t" 'ctrl-t-prefix)

Deech

Barry Margolin

unread,
Apr 27, 2008, 3:16:46 PM4/27/08
to
In article
<d64d6db5-d85d-4ee7...@d45g2000hsc.googlegroups.com>,
deech <aditya...@gmail.com> wrote:

> Hi all,
> Has anyone else noticed that window switching in emacs is a
> bit cumbersome?

Emacs issues are best posted in comp.emacs or gnu.emacs.help.

--
Barry Margolin, bar...@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
*** PLEASE don't copy me on replies, I'll read them in the group ***

Nathaniel Calloway

unread,
Apr 27, 2008, 4:06:47 PM4/27/08
to
deech <aditya...@gmail.com> writes:

> Hi all,
> Has anyone else noticed that window switching in emacs is a
> bit cumbersome?
>
> About a month ago I created a new prefix key C-t and bound
> h,j,k,l to move to the left, top, bottom, and right window
> respectively. Here is the snippet in my .emacs file that makes this
> happen. Please note that this destroys C-t which is by default bound
> to transpose-char. If you use this a lot try another prefix key.

Are you saying you don't miss the incredibly useful transpose
character fucntion? I use it daily to solve the Jumbles in the
newspaper.

-Nat

0 new messages