From mboxrd@z Thu Jan 1 00:00:00 1970 From: Oleh Subject: Re: Keyboard shortcut - is there a principle behind them? Date: Fri, 6 Dec 2013 10:49:52 +0100 Message-ID: References: <52A192A9.9000202@krugs.de> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:49486) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vos2l-000783-M4 for emacs-orgmode@gnu.org; Fri, 06 Dec 2013 04:49:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vos2j-0002KZ-Q3 for emacs-orgmode@gnu.org; Fri, 06 Dec 2013 04:49:55 -0500 Received: from mail-wi0-x22d.google.com ([2a00:1450:400c:c05::22d]:45417) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vos2j-0002KD-Df for emacs-orgmode@gnu.org; Fri, 06 Dec 2013 04:49:53 -0500 Received: by mail-wi0-f173.google.com with SMTP id hn9so586325wib.0 for ; Fri, 06 Dec 2013 01:49:52 -0800 (PST) In-Reply-To: <52A192A9.9000202@krugs.de> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Rainer@krugs.de Cc: emacs-orgmode , "ess-help@r-project.org" Initially the shortcuts were mnemonic, e.g. C-e: `move-end-of-line'. Obviously the keys ran out pretty quick. Now only few shortcuts are reserved for user space and plugins, the most notable of which is the `C-c` prefix. That's why most custom modes such as org-mode and ESS bind to shortcuts with `C-c` prefix: there's a convention that Emacs core will not use `C-c`. A nice way of remembering shortcuts only when you need them is to call commands by name with `M-x`. After a while, when you note that you're using one particular command a lot, you'll want to learn the shortcut for it. There's one package that might be of good use to you: `smex'. It uses ido completion for `M-x`. You can install it from MELPA/Marmelade. It binds automatically to `M-x` when you install, although I recommend: (global-set-key "\C-t" 'smex) As an example, say you want to tangle. Here's what you do: C-t tang Now you see a bunch of rectangle commands mixed into the bunch. You can filter them out by noting that tangle commands have `org` in their name. C-SPC org C-SPC Now there's only 7 candidates left and you can select the one you want with C-m either by cycling with C-s or continuing to type part of name. `smex` logs the commands you use most. For them it usually takes less than 2-3 characters from the name to be recognized. E.g. if you use `org-babel-tangle` a lot, you can usually call it with C-t bab C-m. Finally note that no shortcuts are set in stone. You can customize all of them if you want to do so. For instance, and probably a lot of people will disagree, it doesn't make sense for me to have `previous-line' on C-p. So I swap C-p and C-h: (keyboard-translate ?\C-h ?\C-p) (keyboard-translate ?\C-p ?\C-h) Oleh On Fri, Dec 6, 2013 at 10:02 AM, Rainer M Krug wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Hi > > one alternative subject could be "because it is Friday"... > > I am using org-mode and ess regularly, and I use quite a few keyboard > shortcuts, but each time I read about a new one, I am wondering: why > the heck these specific (default!) keyboard shortcuts? > > I am not asking why keyboard sequence, but e.g. why "export" in org is > C-c e and why tangle is C-c C-v t, and so on. > > In other words: I am trying to *understand* why C-c and not C-o, > because I have tremendous problems to remember the shortcuts - if I > would know that there is s tree structure, where each following key > narrows it down to further *thematically linked* commands, it would > make it easier to learn these. > > Any insight into this? Or is there a emacs function which returns a > random keyboard shortcut for a given function (some emacs shortcuts > really seem to be that way...). > > Thanks, > > Rainer > > > - -- > Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation > Biology, UCT), Dipl. Phys. (Germany) > > Centre of Excellence for Invasion Biology > Stellenbosch University > South Africa > > Tel : +33 - (0)9 53 10 27 44 > Cell: +33 - (0)6 85 62 59 98 > Fax : +33 - (0)9 58 10 27 44 > > Fax (D): +49 - (0)3 21 21 25 22 44 > > email: Rainer@krugs.de > > Skype: RMkrug > -----BEGIN PGP SIGNATURE----- > Version: GnuPG/MacGPG2 v2.0.22 (Darwin) > Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ > > iQEcBAEBAgAGBQJSoZKpAAoJENvXNx4PUvmCyp8IAM2uzkocZLD0MVVw/DSI4w7f > ZPFqVBppkzvc5Ef4vuA0Om4ETWqsgYaAs9Tnz3Q3mDGnkZ01yl4/PDGNav/sRGGY > pJs+HElogJCulNrHibh0Ai8X9w29yWZQZnXmPr5lAdmSjTDziUSdUakXte2KkD7O > v+82YoTDAbycUcqK7CUAFNmyNqn5UsXf1h2wYfe6xYaQUPTXnEWsLJAuE3otVE1P > fbmTAbOy+mq+4+2krwp+kCyGU4hoynpJBH1DBUvQgtJeEGYNL2AxYCnm4BU2axwK > qSykHLineyacD4x4RWzEu8uya/P/Q7OSAWQmdsnOT7xqrJo9wxphfrBVefLJb1A= > =BbQi > -----END PGP SIGNATURE----- >