Question
Is there a way to get j to move to the next result in the Eclipse auto-complete popup when using Vrapper?
Rationale
When I use Eclipse auto completion Ctrl+Space, I would like to use the j and k keys to move to the next and previous match. I get so used to moving this way in Vrapper that it is a bit hard to switch tactics in the specific Eclipse situations that Vrapper does not control. The auto-complete popup is the most common of these situations for me.
Possibilities
I see several possibilities for solving this:
Write a feature request for Vrapper to solve this (if it isn't solved already)
Create a key combination in Eclipse if the command for this is exposed
Create a key combination outside of Eclipse that sends a ↓
Live with using the ↓ key like everyone else does
Perhaps there is a .vimrc trick such as mapping j to ↓and Eclipse will capture that ↓
My workaround for this until I find a better one is to use the following AutoHotkey script:
#j:: ; The # stands for the left win key
SendInput {Down}
return
#k::
SendInput {Up}
return
I'm not completely happy using the Win+j combination, but it seems to work fairly well for now.
I asked this same question on github and got the following response which answers the question. I'm re-posting it here.
We have an option :set contentassistmode which will enable Ctrl-n/Ctrl-p to go to next/previous match in the Ctrl-Space pop-up. You can then use :camap to remap and to j and k or any other key you want. I'm sorry but we don't have a solution for the quick-fix pop-up.
See http://vrapper.sourceforge.net/documentation/?topic=configuration#vrapper
Link: https://github.com/vrapper/vrapper/issues/648
Related
I'm a complete newbie when it comes to emacs. I recently installed Doom emacs and I've been really enjoying it. One thing that I'm struggling to find out is how do I quickly access/select on of the actions that are given to me by lsp-mode (I assume it's lsp-ui). I've attached a screenshot - the actions that I'm referring to are on the right-hand side.
Quick side questions:
When I jump to definition (spc-c-d) how do I jump back? Do I just kill the buffer?
Using ivy, how can I easily go through the list? - using control-n is a bit hard
You can come back to the previous buffer using CTRL+O
You can go down or up in the list using CTRL+j or CTRL+k
There are some tricks to get the answer:
first, try to find the action or function you know.
example 1. "M-x action-you-want-to-know"
example 2. "C-h k then-type-the-shortcut-key-you-want-to-search"
second, try to get the answer from project issues
The answer to your question:
1: press "C-o" jump backward
2: Try to input multi keywords in your search field to narrow down the search scope, just like increment search.
If you get too many lines after ivy-search some keyword you input, that means you donot know what you want to search, right?
I am trying to remap a function key like F4 to do an ALT then press H + M + C.
Tried reading the docs but was not successful in getting my answer.
I actually thought this may work but it's not.
F4::!hmc
That was probably working, but AutoHotkey runs too fast for most applications to pick up on the macros. It looks like you want to manipulate Word or some sort of ribbon menu. Try this:
SetKeyDelay, 50 ; Increase this to increase the delay
F4::!mhc
You could also try switch our your ! for {Alt} and see if you get any improvements there. Let me know if this works for you.
I have written a python script for my co-workers, and then created an autohotkey script to run it every time someone presses Ctrl+LShift+Y. Looks something like this:
^+y::Run helper.py
The python script is fine, but the ahk script doesn't work on all the computers. Sometimes it works fine, and sometimes you get this error:
^+y does not exist in current keyboard layout
Now, searching the web this seems to be a problem with multi-language keyboards (we're using both Hebrew and English), because different languages means a different layouts (I guess?). I also found someone explaining that to solve this you need to use scan codes instead of the usual ^ and + and so on (I'd link to it but I cannot seem to find it now).
This all vaguely makes sense to me on a theoretical level, but when I want to realize it with actual code, I don't really know what to do. To me it seems as if this topic is hardly discussed (with the few exceptions being lacking in examples or hard to understand), so I'd love an answer that would include the following:
some simple way of determining the scan code for a key. This should preferably be a pythonic solution (and just out of curiosity, I'd love to know how to do this with linux as well). This is probably the easier part (but I think is an inherent part of a complete answer).
This is the important part: examples of how you implement that scan code in an autohotkey script, including edge-cases (if there are any).
Question 1
As you want to use the key with autohotkey, it makes sense to use autohotkey detect the key in the first place. Obviously this method works only on windows where autohotkey is running.
Write a Autohotkey script with this line and run it.
#InstallKeybdHook
Press the key you want to examine.
Open the script menu by right clicking the icon of the script in the right lower corner of your screen.
Select OPEN, then from the Menu "View / Key history and script info"
There is a line for each keypress.
First column is the VK (Virtual key) code, next is the scancode.
For example for CAPSLOCK the VK is 14 and the Scancode 03a
Question 2:
#InstallKeybdHook
VK14::
msgbox, you pressed capslock!
return
OR
#InstallKeybdHook
SC03a::
msgbox, you pressed capslock!
return
both work.
Note that you can combine two keys into a hotkey by combining them with & (but not 3)
#InstallKeybdHook
RShift & SC03a::
msgbox, you pressed Rshift capslock!
return
You can modify a Scancode with + and ^
#InstallKeybdHook
^+SC02C::
msgbox, you pressed Ctrl Shift and Y(maybe)!
return
Further info about this is on the page "List of Keys, Mouse Buttons, and Joystick Controls" of the autohotkey help file that comes with the default installation.
I really like the Ctrl+1 shortcut (hints for errors and mini refactorings) in Eclipse. Is there an equivalent for it in IntelliJ and Android Studio?
Alt+Enter
Personally I don't think AltEnter is particularly correct. Ctrl1 does lots of code generation like generating local variables given a method call etc.
CtrlAltV ... generates a local variable
CtrlAltF ... generate a field
AltInsert ... generate (drop down menu to generate all sorts)
Now, unrelated to the question but maybe helpful and in the same ball park is that the "foreach" short cut in IntelliJ is iter rather than for.
I also don't think ctrl+enter is the answer.
I'd say ctrl+alt+shift+t (Refactor this...) which I remapped to ctrl+1 is the closest thing to ctrl+1 from eclipse. It allows you to inline, extract code (variable, method, field etc.), move code, pull members etc.
Ctrl + 1 was one of my favorite shortcuts but unfortunately there is no exact equivalent shortcut for that. You can search for Quick fix in: File-->Settings-->Keymap, but you'll find nothing.
Although many people would say Alt + Enter is the nearest answer. but I think there are better equivalents such as Ctrl+Alt+Shift+t. It will give you some magic options.
You can also remap it to Ctrl + 1 by going to:
File-->Settings-->Keymap
Try pressing CTRL + ALT + v.
It will give the return type exactly of that method.
I think the "Other -> Show Context Actions" is very close to Ctrl+1 in Eclipse.
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 ä, ß, å, þ, «, —, ...