I started using xmonad as my window manager a couple of weeks ago. I love it. Its great. But since then I have had to use 'ESC' key a lot when I am in emacs and want to press the 'ALT' key. This is because 'ALT' key is used by xmonad as the 'mod' key.
Is there a way to assign the emacs mod key to anything other than the 'ALT' key like assigning it to the 'windows' key.
Any help would be higly appreciated.
Thanks,
Vimal
P.S. this is the keyboard I am using
http://tinyurl.com/c4955o
Actually, it would be much easier to assign Xmonad's mod key to be the "Windows" (super) key. It's what I do!
Here's how:
Xmonad FAQ
Bindings starting with Alt modifier often conflict with applications, so the first modification I always make to XMonad configuration is to change the modifier to the Super (Windows) key.
modMask = mod4Mask
I like the idea that everything associated with window management is assigned to a modifier used just for this purpose, this makes it conceptually isolated and easier to remember.
More details can be found in a great tutorial on configuring XMonad.
You can configure xmonad to use Emacsey key sequences instead of the default Mod-X or Mod-Shift-X. Details are here.
emacs commands are often show M-/ which means hold the Meta key, and press forward slash. You need to use xkeycaps to figure out which key on your keyboard is assigned the META modifier, and that's the key you want to use for META key chords.
Also, xkeycaps lets you assign the META modifier to whatever key you like, so if you don't like the way it's setup, you can fix it.
You will probably want to read the xkeycaps man page thoroughly, or post more questions here, if you set META to some places, GNOME won't pick up the META key correctly, but I've forgotten exactly what problems I had.
Related
I want to map two dot/period key presses to Tab key in AutoHotkey script. I tried to map similarly as its shown for remapping semicolon key - on AutoHotkey forums, but it doesn't work. I tried following:
1. `..`::Tab
2. ..::Tab
AutoHotkey gives an error
.
I tried searching on AutoHotkey Remap docs, but couldn't figure it out. The period key is the one with the greater than mark and not the number keypad period key. See this: Dot/period key
Addition info/context in response to reply by user 0x464e:
Basically, I am trying to expand Emmet style abbreviations in devtools style sub-panel since the chrome devtools team wont implement it.
I am not a fast typist, so it's a pain to type complete property names. For example, if I want to type margin-top, (see the image), Chrome autocomplete brings up margin, margin-block margin-block-end etc.
Now, for margin-top, you need to at least type margin-t to get the autocomplete to show that property.
This is the case for many very common CSS properties like margins, paddings, etc., so autocomplete isn't great.
On the other hand, if I just type mt and have Autohotkey expand to margin-top, it's much much faster, saves me much time and keeps me sane.
Basically, I have setup some hotstring in .ahk script and they work too.
However, if I press mt followed by a Tab key press, Chrome's autocomplete takes over and hotstring fails, (try once to see the problem). Instead, currently I press spacebar, or . (period) to trigger the hotstring. It works, but the problem is it leaves a space or a dot with the expanded text. [see this].
So, that's the actual reason I wanted a double period key trigger to replace Tab.
It would be great if the hotstring trigger would work with a double period key, but doesn't leave the trigger character itself and then have send Tab so as to jump to the value input of the just expanded property.
You're not really looking for a traditional remap, which is why you didn't find it from the documentation.
Remapping is just simply remapping one key to another, but you're not trying to do that. You're trying to make some action do another action.
Anyway, what you're asking is doable, but there's loads of different ways it can be achieved with difficulties varying from simple to extremely advanced & complicated.
You'll need to specify things more clearly before this can be answered properly.
Biggest questions that pop into my head right away are at least:
Should this work everywhere, or just in text input fields?
How should the original functionality of . be preserved, if at all.
(What should happen after the initial . keypress?)
Should there be some timeout between the keypresses?
Etc, this is just what I could think of right away, but surely there's more.
Anyway, for now I can give a simple implementation with a hotstring:
:*?:..::{Tab}
So this is a hotstring with the * and ? options.
I'm guessing these would probably be pretty good options for this.
So what this does, is it presses backspace twice and sends a Tab if you type ...
This should be fine for text editors, but it leaves much to be desired (the points I listed above aren't considered since I can't know what you're looking for. This is just what a default simple hotstring can offer).
Looks to me like you don't actually want the additional mapping of .. to Tab, but instead just want to update your existing hotstrings to activate immediately (without waiting for an EndChar) when the hotstring is followed by ..
Normally, you might look to the Ending Characters option to create this functionality, but since you want multiple characters to trigger this, we need to look to other options.
I will be using the example of ::mt::margin-top for my sample implementation. Extend any changes I make to these to the rest of your hotstrings in the script you screenshotted.
Here are the changes I am making to this example:
Add your .. to the end of each of your hotstrings triggers. For example ::mt::margin-top becomes ::mt..::margin-top. However, at this present, this still requires some sort of ending character to be pressed in order to proc. Let's fix that in the next step
Add the Asterisk Modifier to the hotstring. From the docs:
* (asterisk): An ending character (e.g. Space, ., or Enter) is not required to trigger the hotstring.
Final code for ::mt::margin-top example:
:*:mt..::margin-top
And extend this * insertion and .. appendation to each of your hotstrings.
Hope this helped! Lmk if you need any more help or changes.
I [currently] don't use the menu feature for want of screen real estate, so it's possible the answer lies there.
Is there any way to associate a docstring with a keybinding such that it'll show up in the C-c C-h (or related) help displays? Right now all I get is either Prefix Command or the name of the function/lambda to which the key is bound. I'd like to have something about the purpose of the prefixed keymap for the former, and explanatory text for the more obscure functions for the latter.
Yes, I know that clicking on the function name will bring up a help window with details; I'm just looking for a one-liner property that can be shown in the original *Help* pane without disrupting the screen layout with new panes.
I suspect the answer is 'no,' but it seems a fairly obvious feature..
Thanks!
Given that there are so many major modes which define their own maps for this prefix (e.g. latex, org, term), is there a safe way to move these maps somewhere else, and always have the C-c key free?
I'm hoping there's a convenient way, because I noticed ErgoEmacs does exactly this.
As far as i know, there no easy way, unless you dive deep into emacs innards and create ways to remap every mode's keys on load. (I think Matthew Fidler is actually working on this)
ergoemacs-mode does not remap the C-c. It turns on cua-mode, but cua-mode doesn't remap C-c neither, it just create several clever ways so that key can be used for multiple purposes (e.g. by the speed you press the key, or whether there's a text selection, etc.). All C-c * keys are still there.
see discussion on this same question here
https://plus.google.com/103652929131043355278/posts/Nb4xn4gDB6p
I'm new to Eclipse. Is it possible in Eclipse to hit a keybinding and find the name of the command it is bound too?
For example, pressing Ctrl+Shift+R and have something like "open-dialog" come up in a list telling me that Ctrl+Shift+R is bound to the command "open-dialog".
Unfortunately, Eclipse doesn't make this easy. (Related note: IntelliJ IDEA does.) There are a few things that might help you out, though:
In the Eclipse settings for key bindings, you could do "Export to CSV". Then you can search that document for key combinations.
Also in the Eclipse settings for key bindings, you can sort the "Binding" column. The list is unwieldy to scroll through, but the ordering of multi-key combinations seems to be well defined so you could eventually find the key combination you're looking for.
If you want to look up a common command without going into the settings, you can assign a keyboard shortcut to "Show Key Assist". You can't sort the list by key combination, but it's at least a relatively short list to look through.
Windows > Preferences > General > Keys
You can TYPE ( not press ) the name of the keys, it will sort the list by the name of the keys
Going by the original wording,
pressing Ctrl+Shift+R and
have something like "open-dialog" come up
it sounds like the Show key binding when command is invoked -> Through keyboard option in the Keys preference page would at least partially do what you're looking for:
This will bring up a toast-like overlay each time you press a key combination that's associated with a command. It will show the command name and a more detailed command explanation, if available.
However, the overlay will only display for a few seconds and then disappear, i.e. an onlooker might miss it if they are distracted by other activities on the screen. I don't think that there is a way to display this information "in a list", i.e. in a more permanent fashion, but I think that this would be a great feature to help developers learn new keyboard shortcuts in a pair programming environment.
I am looking for a way to have my control key and caps-lock key switched when I am in the emacs window, but when I go to any other program such as Firefox I want to be able to use the normal control button for new windows, tabs and such.
Additional Information: I am using Ubuntu, but answers for all systems are good since someone else may want to know how to do it on their system.
Emacs never actually sees the CapsLock keycode (under X anyway), so you can't remap the key in Lisp. Take a look at this page for details:
http://www.emacswiki.org/emacs/MovingTheCtrlKey
On windows using Auto Hot Key you can achieve this with this piece of code put in default script:
#IfWinActive, emacs#
CapsLock::Control
#IfWinActive
Auto Hot Key is a very handy utility and it is also free software like in GPL.
For globally remapping keys there is xmodmap. xkeycaps is an interactive tool. You can put control on both keys.
Since you want to remap the keys only for Emacs (which I find somewhat ill-advised) you need to look inside Emacs for a solution. It should be possible, because you can rebind all keys, but it may be too tedious to swap all keys around if the modifiers cannot be swapped.
Personally I map CapsLock to Compose, to type all kinds of funny characters like ä, ß, å, þ, «, —, ...