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

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

Easier Window Switching in Emacs


From: deech
Subject: Easier Window Switching in Emacs
Date: Sun, 27 Apr 2008 16:26:03 -0700 (PDT)
User-agent: G2/1.0

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


reply via email to

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