Use a keyboard shortcut to trigger a html-supported window based on the selected text - ide

I would like to add a feature in my editor: users select a text, and click on a keyboard shortcut (e.g., F9), then a window with content by html (eg, a table like this) appears next to the selection, in the end, users move the mouse or press a keyboard shortcut to make the window disappear.
I understand that we could use addDynamicKeybinding or like here to add a keyboard shortcut.
But for the window, it seems that we have only diagnostic window that support html, right? If so, the only use case I know about diagnostic window is by HoverProvider like here, where we need to hover on a text to make the diagnostic window appear.
Does anyone know how to use a keyboard shortcut to trigger a html-supported window, whose content is related to the selected text?

Related

How to get keyboard shortcut showing in menu without causing double pasting?

When I assign the standard keyboard shortcut for paste in my menu, using the keyboard shortcut actually pastes twice because the system automatically performs a paste when that shortcut is used and then it activates the menu item, thereby pasting again. If I do not specify the keyboard shortcut, then the keyboard shortcut still works because it's a system default shortcut but the menu item no longer shows the shortcut in the menu.
For example, if I write this:
menu("Edit"){
item("Copy") {
action {
when (scene.focusOwner){
myTextField -> myTextField.copy()
myTextArea -> myTextArea.copy()
}
}
}
item("Paste") {
action{
when (scene.focusOwner){
myTextField -> myTextField.paste()
myTextArea -> myTextArea.paste()
}
}
}
}
Then both the menu and the Ctrl/Command-V shortcut work fine because the shortcut is predefined in the system but it doesn't show in the menu, as you see below:
screenshot of edit menu, keyboard shortcut notation not visible in menu
If, however, I change the code for the Paste menu item to this:
item("Paste", "Shortcut+V"){.....
then the menu looks like it should:
screenshot of edit menu with shortcut notation displayed
BUT, using the Ctrl/Command-V key combo causes a DOUBLE paste, because first the built-in system shortcut happens, causing a paste to occur, and then the key combo activates the action{} code block in the menu code causing another paste to occur.
How do I either get the action{} code block to only happen when the menu item is clicked by a mouse (while still keeping the shortcut notation visible in the menu item), or disable the system shortcut (preferably the former)?
Any help is appreciated.
(IntelliJ Idea, MacOS X Ventura, JDK-FX 11)

Navigating project files in intellij idea

I want to jump through files in the project window using the up / down buttons. Now I press the down button, then press the enter button and the focus goes to the code editor window. But I do not want the focus to go away, I want to continue jumping through the files, pressing the down button and enter when I want to open the file. I can do this using this combination: down arrow, enter, F12, down arrow, down arrow, enter, F12 ...
Is there any way to tweak this to avoid using F12?
I'm using Intellij idea 2020.3
I'd suggest reassigning shortcut combination Main Menu | Window | Active Tool Window | Jump to Last Tool Window to anything more suitable for you, e.g. ESC and be sure that you don't use the same shortcut for other actions and operations.

How to check/uncheck individual change checkbox in IntelliJ commit diff dialog?

I am an aspiring keyboard user, using IntelliJ to do selective commits to my project.
To do this, I open the Commit dialog with Ctrl+K.
I then press Shift+Tab to switch to the file list, Home to select the root-level node, and Space to uncheck/de-select all files.
I then press the down arrow once or more to select a file, press Ctrl+D to display its diff. I press F7 to go to the first change in the file.
At this point, to the left of the right pane (with the new version of the file) is a checkbox. Not the one at the top which selects all the changes in the file, but the one which selects just the change displayed.
My question is: How do I select/un-select this checkbox without using the mouse cursor? I need to use the mouse as little as possible due to RSI.
Note: When asking questions like this, I sometimes get responses with other pointing device suggestions. Unless you're going to recommend a keyboard technique, I am not interested in your suggestion, and will flag/report your response if that's what it is.
By default there is no keyboard keymap for this action. But you can easily choose new keymap for this.
Go to File->Settings and search for "include" in the search box. What you need is to assign a keymap for "Include Lines Into Commit". Double click on this option and assign any keymap that you want. It is hard to find new keymap that didn't assign to any other action, but only for the demo I choosed Ctrl+T.
You can see what I did in the following image:
Click on Apply and then you can use the keymap that you choose to check/uncheck any individual change checkbox in Intellij commit diff dialog.

Navigate (switch) between 'Find' and 'code preview' in IntelliJ IDEA

Hi I have to make a lot of searches in InteliJ and I want navigate between findings of searched text and code preview of specific file.
I tried to search it on web, and also combination of shortcuts like tab, ctrl+tab and many more but nothing work.. Do you know how to switch between those two windows?
right now I have to click it with mouse to focus on one of the windows.
The code preview window is intended to be used as exactly that - a preview, not a UI to be used for complex editing operations. If you need to do anything with the search results, use the "Open in Find Window" button to open the toolwindow with the results. After that, you can use for example Ctrl+Alt+Up/Down to navigate between the occurrences, or other keyboard shortcut to switch between the toolwindow and the editor.

Keyboard shortcut to navigate between IntelliJ views

In IntelliJ, there are some underlined numbers on the side menus :
1: Project
7: Structure
Like below :
So there is probably a keyboard shortcut which allows to navigate from one view to another by just entering the view number.
I tried the different digits with Ctrl, Ctrl+Shift, Ctrl+Alt etc but could not find the right shortcut.
How can I easily navigate between those views?
The shortcut is Alt + [number]
ps. There's a plugin force-shortcuts if you wanna replace your mouse click actions with shortcuts (https://github.com/treytrahin/force-shortcuts-intellij-plugin). It's super annoying but you learn really fast. And by the way here are such plugins to most editors and IDEs.
ALT+F1 opens a window where you can choose one of the views by pressing the corresponding number.
Info: It actually opens the selected file in the selected view - which is not that bad maybe - but not 100% what you want?
Also there are cool things like pressing C to open a file chosen in Project Explorer directly in Explorer for example.