tag:blogger.com,1999:blog-3992530807750384868.post5665846641446989540..comments2022-03-28T08:42:20.497+03:00Comments on emacs-fu: keyboard shortcutsUnknownnoreply@blogger.comBlogger8125tag:blogger.com,1999:blog-3992530807750384868.post-36163729780341957662009-07-29T23:40:21.374+03:002009-07-29T23:40:21.374+03:00I remap the Caps Lock key to be Super and define a...I remap the Caps Lock key to be Super and define a lot of my own key bindings using it. The best part is that I can have logic movement keys instead of C-f, C-b and friends. I have super-j and super-k for left and right character, shift-super-j and shift-super-k for word movement etc.Jonas Österhttps://www.blogger.com/profile/13372639729614378453noreply@blogger.comtag:blogger.com,1999:blog-3992530807750384868.post-42858413506706204172009-07-08T22:53:20.033+03:002009-07-08T22:53:20.033+03:00I like to use C-z as my personal prefix character....I like to use C-z as my personal prefix character. I used to hate fumbling a C-x ... key and having Emacs minimize itself or drop back to the shell. And I don't need that functionality often enough for it to merit taking up as valuable a piece of keymap real-estate as C-z. So I fixed that and solved my lack of free keys at the same time. Two birds with one stone. For the rare times when I actually want to suspend Emacs, I just use M-x.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-3992530807750384868.post-52668141022781749952009-07-05T23:30:05.457+03:002009-07-05T23:30:05.457+03:00I use triples starting with <f2> as I don...I use triples starting with <f2> as I don't have to press and hold control (super has the same advantages, nice tip), but I group the functions by the second key. e.g. f2-i is for all functions that insert something; f2-t is for my skeletons (templates); f2-s is for support functions; etc.Jaredhttp://curiousprogrammer.wordpress.comnoreply@blogger.comtag:blogger.com,1999:blog-3992530807750384868.post-69608541522164100822009-07-04T12:00:44.466+03:002009-07-04T12:00:44.466+03:00@Michael: good point about the WM
@piyo: ah, that ...@Michael: good point about the WM<br />@piyo: ah, that is a very nice write-up. <br /><br />I tried the function-keys for a while, but, as you say, they are to far away<br />for things you need all the time. And they're not very mnemonic for things<br />that I need only now and then. One exception is F7 for compilation (or<br />'eval-buffer', 'perl -c', etc.); I think it's the same as in VC++. There the<br />distance is not so important - I hit the key with force, then lean back in my<br />chair to see where it will lead me.<br /> <br />I am tempted to move to the "C-c X"-scheme - even though I am a rather<br />infrequent user of emacs on Win. "C-c" would at least work everywhere -<br />console, X, Win, Mac etc.djcbhttps://www.blogger.com/profile/15938154009846040711noreply@blogger.comtag:blogger.com,1999:blog-3992530807750384868.post-73607500567274748912009-07-04T07:43:18.026+03:002009-07-04T07:43:18.026+03:00Keyboard settings are a very personal journey, req...Keyboard settings are a very personal journey, requiring much self-reflection. This is a long post, but I enjoyed writing it. Of course, YMMV.<br /><br />For keybinding in Emacs, I use Control-Q as my main user map prefix key. It's easy to hit (as a Caps-as-Control disciple), and if I really need a Control-Q I can just press it twice, but really how often do I need it (C-Q C-Q C-j isn't much more mental energy)? I then add more prefix keys under there like "d" as in C-Q d {b,f,d} for ediff-{buffers,files,directories}, C-Q {C-R,r} for query-replace{-regexp,}.<br /><br />I also bind Control-L as another prefix map key. Out of all the keys in my home row this one is less likely to conflict after redefinition. Since C-L was M-x recenter, I usually put visual related functionality there, like "recenter with this line at top", the winner keys (ESDF just like FPS games), setnu mode, scroll-bar-mode, menu-bar-mode, etc.<br /><br />I remind myself of my bindings with C-h after the prefix key(s). Also I like to write my bindings in my setting file in qwerty order so that I know what is open and what can be set. Finally I make sure to put all bindings in one file like piyo-input.el.<br /><br />I say ignore the C-c [a-Z]. I want the freedom to press the Control key for the rest of my sequence. Also after a decade of using Emacs, I am only finally starting to use the Function keys, namely F3 and F4. It's just too far to reach, though. Even the arrow keys are too far.<br /><br />As an aside, I use Emacs inside of GNU Screen, and I set the GNU Screen key prefix to Control-T instead of the Emacs-clashing default Control-A. How often do I need to press Control-T? It is possible to define sub-prefix key maps in GNU Screen, and I have set for example C-T x {2,3} to split the screen just like Emacs.<br /><br />I am mainly a Windows user and also use Linux mainly from ssh and Putty. I avoid using the Windows key for just Emacs, and besides, the key is not translated through a terminal emulator. I would not recommend becoming dependent on it for this usage. Under Windows, the Windows key is for system-level mapping solely for Microsoft's apps, not application-level key, so I don't understand how this is "ironic".<br /><br />You can of course repurpose the Windows key to your own settings. Unfortunately it is not built in. I would recommend a system-level key macro program like AutoHotKey (AHK) so that you can define a lot more keybindings. One great one I made is Windows-Shift-V, which copies the text clipboard directly to Emacs via gnuclientw.exe. You can also redefine keys on a per-application basis, so you make your "Super-E" to work. Perhaps you have to make AHK capture the "Super-E" (which is in reality Windows-E or Open Explorer), which can send to Emacs another user defined key sequence (like the invisible F13 through F22 keys) which you bind to your function.piyohttps://www.blogger.com/profile/16255445653576846162noreply@blogger.comtag:blogger.com,1999:blog-3992530807750384868.post-9111979511941772362009-07-04T05:30:43.603+03:002009-07-04T05:30:43.603+03:00I have C-x C-m as a group for my hotkeys; you can ...I have C-x C-m as a group for my hotkeys; you can make it with (define-prefix-command 'my-hotkey-preifx) (global-set-key [(control x)(control m)] 'my-hotkey-prefix) and then just bind things as normal. I avoid using the win key since my window manager binds lots of hotkeys using itMichael Mrozekhttps://www.blogger.com/profile/08593850922533973503noreply@blogger.comtag:blogger.com,1999:blog-3992530807750384868.post-88936825312027719492009-07-04T00:27:15.071+03:002009-07-04T00:27:15.071+03:00@Paul R: thanks, that's a useful; C-c X is an...@Paul R: thanks, that's a useful; C-c X is an alternative for s-X.djcbhttps://www.blogger.com/profile/15938154009846040711noreply@blogger.comtag:blogger.com,1999:blog-3992530807750384868.post-1125876188798702012009-07-03T23:44:47.469+03:002009-07-03T23:44:47.469+03:00C-c [a-Z] (this is C-c followed by a letter) is re...C-c [a-Z] (this is C-c followed by a letter) is reserved to the user. Any mode using it should be fixed. And AFACT org-mode does not use it.<br /><br /><i>From que Info keymap node as of emacs 23 latest build :<br />" As a user, you can redefine any key, but it is usually best to stick<br />to key sequences that consist of `C-c' followed by a letter (upper or<br />lower case). These keys are "reserved for users," so they won't<br />conflict with any properly designed Emacs extension. The function keys<br />F5 through F9 are also reserved for users. If you redefine some<br />other key, your definition may be overridden by certain extensions or<br />major modes which redefine the same key."</i>Paul Rnoreply@blogger.com