From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?UTF-8?B?5by15ZyL6Imv?= Newsgroups: gmane.emacs.help 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: Thu, 30 Apr 2015 17:56:04 +0800 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1430387791 5795 80.91.229.3 (30 Apr 2015 09:56:31 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 30 Apr 2015 09:56:31 +0000 (UTC) To: "help-gnu-emacs@gnu.org" Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Apr 30 11:56:31 2015 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YnlCo-0007dE-Ri for geh-help-gnu-emacs@m.gmane.org; Thu, 30 Apr 2015 11:56:30 +0200 Original-Received: from localhost ([::1]:42832 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YnlCo-0006hq-2c for geh-help-gnu-emacs@m.gmane.org; Thu, 30 Apr 2015 05:56:30 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38779) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YnlCU-0006hh-Vj for help-gnu-emacs@gnu.org; Thu, 30 Apr 2015 05:56:17 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YnlCP-000686-Rv for help-gnu-emacs@gnu.org; Thu, 30 Apr 2015 05:56:10 -0400 Original-Received: from mail-yh0-f45.google.com ([209.85.213.45]:32975) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YnlCP-00067e-Mb for help-gnu-emacs@gnu.org; Thu, 30 Apr 2015 05:56:05 -0400 Original-Received: by yhcb70 with SMTP id b70so11884971yhc.0 for ; Thu, 30 Apr 2015 02:56:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=rOps3Fj+0BhwOpTEDe/V4egEzT8JVYDgVkUsFBCfukE=; b=hBu3ENvfohmt9/Y0bVW18Nqg4anXsxBP3rUFVK9l27z5GGU8+MXKFU1o4JhURnZsrb Q4LCNzCfSVqAmIwPy5ptTggWu17oNAzAsdcX4Sww2vKYWTrPwkUZ+phMS9wHRrQkWMts x1YQ9e/esEifmXZxJgC1BpflQxwquyPF4PCqSY4fzI959piEKYJTC7sdjv4FXK6BS1kJ lmC1vyBErYwpJftHBV4JrSBH8A28EFQwtQlb/K9aoVdSXlSF1QpgjMP5/5s1iK8iGLfJ YRywN91CMd8OkKTuZpSQzHc2V2DxBU1cLeqfu+UmX7dwFBW6gAIv6CDZndYvwzfiKbRN 6+mA== X-Gm-Message-State: ALoCoQkc5xmXRZguTZxcn4hQ14F/cgg59sBvPbE2z10/IOo7Ianjyx+uiYwtbvMKkiaXZ2XyTdIc X-Received: by 10.236.1.71 with SMTP id 47mr2753982yhc.92.1430387764695; Thu, 30 Apr 2015 02:56:04 -0700 (PDT) Original-Received: by 10.13.241.197 with HTTP; Thu, 30 Apr 2015 02:56:04 -0700 (PDT) X-Originating-IP: [2401:fa00:13:0:b082:4f5a:5866:9cf4] In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.213.45 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:104094 Archived-At: Thanks all for the ideas. I end up use hydra and ace window. Here is my config if you are interested. > ** Hydra the windmove keys & move spliter > > #+BEGIN_SRC emacs-lisp > > (require 'hydra) > > (defhydra hydra-windmove (global-map "C-o") > > "windmove with ijkl" > > ("i" windmove-up "up") > > ("j" windmove-left "left") > > ("k" windmove-down "down") > > ("l" windmove-right "right") > > ("n" other-window "next") > > ("p" (other-window -1) "prev") > > ("[" hydra-move-splitter-left) > > ("." hydra-move-splitter-down) > > ("," hydra-move-splitter-up) > > ("]" hydra-move-splitter-right) > > ) > > >> (defun hydra-move-splitter-left (arg) > > "Move window splitter left." > > (interactive "p") > > (if (let ((windmove-wrap-around)) > > (windmove-find-other-window 'right)) > > (shrink-window-horizontally arg) > > (enlarge-window-horizontally arg))) > > >> (defun hydra-move-splitter-right (arg) > > "Move window splitter right." > > (interactive "p") > > (if (let ((windmove-wrap-around)) > > (windmove-find-other-window 'right)) > > (enlarge-window-horizontally arg) > > (shrink-window-horizontally arg))) > > >> (defun hydra-move-splitter-up (arg) > > "Move window splitter up." > > (interactive "p") > > (if (let ((windmove-wrap-around)) > > (windmove-find-other-window 'up)) > > (enlarge-window arg) > > (shrink-window arg))) > > >> (defun hydra-move-splitter-down (arg) > > "Move window splitter down." > > (interactive "p") > > (if (let ((windmove-wrap-around)) > > (windmove-find-other-window 'up)) > > (shrink-window arg) > > (enlarge-window arg))) > > #+END_SRC > > >> ** Ace window (switch to window with number) > > #+BEGIN_SRC emacs-lisp > > (require 'ace-window) > > (global-set-key (kbd "M-p") 'ace-window) > > #+END_SRC > > >> 2015-04-28 18:56 GMT+08:00 =E5=BC=B5=E5=9C=8B=E8=89=AF : > Hi all, > > 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? > > > Many thanks. > > >