From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: deech Newsgroups: gmane.emacs.help Subject: Easier Window Switching in Emacs Date: Sun, 27 Apr 2008 16:26:03 -0700 (PDT) Organization: http://groups.google.com Message-ID: <45c19f71-2c6e-42bf-8bd9-06517fe87460@2g2000hsn.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1209396359 27574 80.91.229.12 (28 Apr 2008 15:25:59 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 28 Apr 2008 15:25:59 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Apr 28 17:26:36 2008 connect(): Connection refused Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1JqVDE-0008H9-EG for geh-help-gnu-emacs@m.gmane.org; Mon, 28 Apr 2008 17:24:16 +0200 Original-Received: from localhost ([127.0.0.1]:36418 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JqVCX-0003I8-P3 for geh-help-gnu-emacs@m.gmane.org; Mon, 28 Apr 2008 11:23:33 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!postnews.google.com!2g2000hsn.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 24 Original-NNTP-Posting-Host: 71.14.77.6 Original-X-Trace: posting.google.com 1209338764 27682 127.0.0.1 (27 Apr 2008 23:26:04 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Sun, 27 Apr 2008 23:26:04 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: 2g2000hsn.googlegroups.com; posting-host=71.14.77.6; posting-account=iIbT1QoAAAAvuMyxrxgetIu9BJhvSidP User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9b5pre) Gecko/2008030808,gzip(gfe),gzip(gfe) Original-Xref: shelby.stanford.edu gnu.emacs.help:158217 X-Mailman-Approved-At: Mon, 28 Apr 2008 11:21:42 -0400 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:53597 Archived-At: 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