Ctrl+D equivalent in DBeaver - dbeaver

I checked the DBeaver shortcuts docs page and Googled a lot but couldn't find any info on this...
Does DBeaver have a Ctrl+D equivalent (I am referring to Ctrl+D in VS Code, where it multi-selects by adding the current selection)?
Background
I work with BigQuery a lot, and in BigQuery Console and VS Code they both have the Ctrl+D functionality but not in DBeaver (at least not by default with the same hotkey)

DBeaver does not come with this functionality working by default, but you can very easily add this shortcut yourself with the following 4 steps:
On the top context menu, click Window -> Preferences. Then select User Interface -> Keys.
The command you want to add a binding to is the Multi selection down relative to anchor selection. So, on the filter text box, write multi. Select it, then on the bottom pane select the Binding text box, and press the shortcut keys down (In this case, press Ctrl+D).
Make sure that the When column changes to Editing Text. Otherwise, change this yourself. It will look like the iamge below
The Ctrl+D shortcut is already taken by the "Delete Line" command, so you need to unbind them. On the filter textbox, write ctrl+d. Then click on row that shows Delete Line, and click the Unbind Command button.
Click Apply and Close and have fun.

I believe it is Ctrl+Alt+Down (from https://dbeaver.com/docs/wiki/Shortcuts/)

Related

See unsaved changes in vscode

Sometimes when closing vscode, or a tab therein, I get a dialogue asking "Do you want to save the changes you made to filename?" However, the unsaved edits are actually from a previous session that was closed without such a query, probably when turning off the computer, so I can't remember if it was meaningful edits, or maybe just an accidental key-press, like a shortcut gone wrong; and doing undo to revisit the last edits doesn't work either.
My question: How can I see the diff between the saved version of a file, and the version in the editor window? I think it would be nicest just to have a "show diff" option in the dialogue, but for now I'm also happy with a command line diff command.
I'm using ubuntu 20.04.
I'm using VSCode version 1.52.1 on MacOS and I had a similar problem that may not be the same problem, but I'm guessing it will work for you as well.
When you're in the Explorer view, in the upper left part of Explorer you have your "Open Editors." If that shows a dot to the left indicating that the buffer has changes in it, you can right click the file name and select "Compare with Saved." This will open another buffer to the side that will show you any unsaved changes.
To get rid of that window (it took me a bit to figure this out I'm sorry to say!), you can click the 'X' to the left of the extra buffer in "Open Editors."
Hope this works for you!
A few bright notes for the keyboard players out there:
The command you are asking about has a default shortcut. Unless you've applied a keyboard map extension, the Ctrl+Kd arpeggio opens the very same diff view between the active and saved versions of the current file. The default shortcut to close an editor tab (be it the diff or a file or anything at all) is Ctrl+W.
The command, like any command in VSCode, is also accessible via the Ctrl+Shift+P command dropdown (on Linux, F1 opens it too). Start typing e.g. compa sav (it saves your keyboard wear and tear to shorten words to a prefix which is unambiguous enough), and the list will shrink dynamically to just a few commands. Yours is File: Compare Active File with Saved. When it's close to the top enough, navigate the list of commands with the down arrow and execute it with Enter. As a bonus, you may click on the little gear to the right of the command currently highlighted in the list and redefine its shortcut, if you use it very often and prefer a chord shortcut to the default arpeggio one. Sorry, there does not seem to be a shortcut in lieu of the gear click. If there is, please let me know!
But if you really, really want to right-click on the filename in the Open Editors view of the Explorer sidebar, you can open that view directly with, you guessed it, a shortcut: Ctrl+Ke. And if you change your mind on a dime right at this moment, or realize that you in fact never had a mouse to do the right-click in the first place, use Shift+F10 to drop down the "right-click menu", properly called the context menu, which you navigate with arrows and execute with Enter (that's kinda a common theme, as you probably noticed). This works mostly anywhere the right-click does.
While in the Open Editors view, to switch to an editor file tab, move the selection to the desired file. Press Space to bring the file into view but stay in the Open Editors view, or Enter to bring the file into view and shift the keyboard focus to it. Pressing Ctrl+Shift+E brings focus back to the editor from any view in the Explorer sidebar. The same shortcut moves focus to the Explorer sidebar from the editor.
Happy ♬ k'boarding ♬!
ctrl+shift+P (or command+shift+P on mac) and fuzzy search for "compare changes with saved files"

VSCode how to automatically insert Intellisense suggestions without having to press Enter?

Default VS Code Intellisense behaviour
User is presented with a menu of suggestions
User then has to press the Up or Down arrow keys to navigate through the menu
Finally user has to confirm with Enter to insert the suggestion and close the dialog
What I would like instead
Don't need to press Enter
Suggestions are automatically inserted (and cycled through) by pressing Up/Down
Pressing any other keys will close the dialog and resume typing
To be clear, I want to replicate the default behaviour of YouCompleteMe:
When you type, a completion menu pops up. If you like the completions, you use the <Tab> key (by default, can be changed to <Enter> or <Down> arrow or whatever) to select a completion string you want. The very act of "tabbing through" the list to select the item you want inserts the candidate string. When you tab to a different candidate, the editor code is replaced with the new candidate. There is no accept key because by the point where you have the candidate you want selected in the menu the candidate has already been inserted in the editor. There is nothing to "accept". You just keep typing, the candidate has already been inserted.
Is such behaviour possible with Visual Studio Code, either by default or through a plugin?
The editor.tabCompletion option is the closest thing currently available:
By default, tab completion is disabled. Use the editor.tabCompletion setting to enable it. These values exist:
off - (default) Tab completion is disabled.
on - Tab completion is enabled for all suggestions and repeated invocations insert the next best suggestion.
onlySnippets - Tab completion only inserts static snippets which prefix match the current line prefix.
(Emphasis mine)
... except that the first Tab press hides the suggestion window.
I did some digging about editor.tabCompletion, and I found that closing the suggestion window is part of the tab completion's option original design, and that while other users have asked about an option not to close the suggestion window or specifically YouCompleteMe-style behaviour, that this is currently not supported.
"editor.acceptSuggestionOnEnter": "off",
To disable Enter to accept suggestion.

Disable multi cursor functionality

I do not like the Visual Studio multi cursor options, and I never use them.
Inevitably, I phantom-pressing some key combination that brings up a multi cursor option, then I write some code, and then the code is destroyed afterward. Please tell me how to completely disable all such functionality in Visual Studio Code. I am running on Ubuntu, but also interested in how to accomplish this on Windows (if there is any difference).
I should mention, that this happens literally once every 5 minutes to me on Ubuntu, but in Windows it happens much less frequently (like once an hour).
Un-check Selection->Column Selection Mode
You can remove the keyboard shortcut(s) that trigger this functionality.
Click on the gear on the bottom-left corner of the window and choose "Keyboard Shortcuts" from the menu. Type "Add Cursor" into the "Search" box and it shows only the commands that contain "Add Cursor" in their name.
Right-click on each command that add a cursor and has a keyboard shortcut associated and select "Remove Keybinding".
Also search for "Multi-Cursor". It could return the command "Toggle Multi-Cursor Modifier" that is associated to a combination of modifier keys (one or more of Ctrl, Alt, Shift). If such a combination of keys is pressed when you click in the editor window it adds a new text cursor at the click position. You should also removed these key bindings.
Set this settings in editor settings :
"editor.columnSelection": false,
In Android Studio :
Un-check Selection->Column Selection Mode

How to enable "live search" in eclipse?

In Komodo Edit, an input field is available in the toolbar. When I type text in it, it highlights matching search results. Is there something like this in Eclipse, either directly or via a plugin?
As TK Gospodinov has already mentioned, there is an Incremental option in Find/Replace (Ctrl+F) dialog.
There is also a special key binding for Incremental search in Eclipse (and personally I use it more frequently). From Eclipse Tips and Tricks:
Use Edit > Incremental Find Next (Ctrl+J) or Edit > Incremental Find Previous (Ctrl+Shift+J) to enter the incremental find mode, and start typing the string to match. Matches are found incrementally as you type. The search string is shown in the status line. Press Ctrl+J or Ctrl+Shift+J to go to the next or previous match. Press Enter or Esc to exit incremental find mode.
If you'd like to have search functionality in a toolbar, you may be interested in the eclipse-glance plugin, which allows you to use the incremental search function in a toolbar by pressing Ctrl + Alt + F while in any text area.
This feature is already available in eclipse. No need to install any plug-in.
Press Ctrl+F, and the Find pop up appears.
Now check the incremental checkbox, and then your texts will be found as you type. No need to hit return.
OR
Use Ctrl+J and you can activate the live search, just that there wont be any UI visible, but you can see the status in eclipse status bar at the bottom.
Press Ctrl+J, start typing the text you want to search for. Press esc to go back to edit mode
The closest thing to the functionality you are asking about is the 'incremental search' mode, which is triggered by checking the 'Incremental' checkbox in the Options group on the Find/Replace dialog in Eclipse (Ctrl+F from the code editor). This will make it start highlighting matches as you type, and if they are keywords, Eclipse will highlight other occurrences (references) in the code editor. Matches inside strings or Javadoc will not be highlighted, however, unless it happens to be the first match after your cursor's position inside the editor.
One similar thing (not the same) is just enabling "mark occurences", then selecting function name, variable etc.

How can I go to the next Eclipse marker (e.g. build error) using the keyboard?

Suppose I make a method signature change that breaks several callers, and I want to review the call sites manually to update them.
Once I change the signature, my "Problems" view shows, say, a dozen errors.
What keys can I hit to navigate through them while leaving the keyboard focus in the editor for fast fixups?
(It's been a while, but I think the Visual Studio equivalent is F8.)
Note that this question does not duplicate Eclipse: How to go to a error using only the keyboard (keyboard-shortcut)?, as that one seeks to navigate only between markers in the current file. In this case, I want to go to the next error regardless of which file it's in.
("Marker" is the general Eclipse term for errors, warnings, etc.)
The best I've come up with so far is Ctrl + F7 to flip to the Problems view, then ↓ to pick the topmost error, then Enter to go to it (which returns focus to the editor).
Here's a way to move to the next error, regardless of editor, in one keystroke. It's not perfect, but it works until it's fixed in Eclipse.
Open a "Markers" view. Click the down arrow at the top right, and choose "Configure Contents". Uncheck the show all box, and create the view to show only the problems you want to see. You'll probably want to deselect "warnings" and "errors" as well. Save it.
Click the same "Markers" down arrow, and choose "Group By". Select "None". This is important because you don't want the parent tree level nodes to show, otherwise some of your "next" actions will take you to those, which don't represent an error.
In Eclipse -> preferences -> keys, search for "Markers". If there is not a keystroke bound to the Markers view, create one. I use Ctrl + Shift + M
Get a keyboard hotkey tool like AutoHotKey (for PC's) or iKey for the Mac. I'm using iKey, but there are plenty of other Mac tools you can use. In your hotkey tool, define an action for the keystroke you want to use for "next error". I chose the standard CMD + .
For that keystroke/action in your hotkey tool, generate 3 keystrokes in the following order:
Ctrl + Shift + M
Down arrow
Enter
Of course, you'll want to change the first one to whatever you picked for yours. You'll probably want to restrict that action to be executed only when Eclipse is the current application.
Save that, create some compile errors, and test it.
Try Ctrl + 3 for Quick access popup window.
If the "Markers view" is not already visible, then type in "markers", in the searchbox on the popup window. Once you have selected it, it should stay available, when you press Ctrl + 3 the next time around.
I just had the same problem, after refactoring some parts of code. I had a lot of errors in different files and i had to go through all of those.
I used the following solution:
Mark all (relevant) entries in the Problems view.
To do this switch to the Problems view using Ctrl+F7 and select the entries with Shift+↓/↑
You can also select all entries using Ctrl+A
Open the marked errors by pressing ↵.
Every file containing at least one marked error will be opened.
The cursor will automatically select one error/file, as if you open only this specific entry
Fix the errors in the opened file.
Here you can use Ctrl+. to navigate to next error inside this file
Close the file using Ctrl+W when your done.
Eclipse will automatically focus the next file and you can go back to step 3
In my case this solution was much faster then switching to the Problems view each time.
There's an Eclipse bug entered for this that has an attachment that looks like it does what you want.
You could use AutoHotkey:
save the mouse position, send a mouse event to click on the arrow in CDT console and then return the mouse back to it's original location. Record the mouse coords with window spy or use autohotkey's search by image function (first capture the images of two arrows with printscreen into bitmaps).