Databricks notebook multicursor - intellij-idea

I would like to use Multicursor feature in Databricks notebook but I couldn't find one. Does this support it? Is there a plugin for it?
I look at IntelliJ Idea Multi-line editing feature as a perfect example:
https://www.jetbrains.com/help/rider/Multicursor.html

There is an option to get multiple cursor with Ctrl + alt + mouse left long click on all the lines that you want to select.

Related

Shift Tab on Google Colab

Using the command "Shift-Tab" does not work in Google Colab. Does anyone know an alternative that can be used?
I tried using shift + tab during the command and after a parenthesis after the command. For example, it was used at "print" and then again at "print("
On Colab, for SHIFT+ TAB to work, you have to disable Automatically trigger code completions on Tools->Settings.
You also have to have already imported the library that you are trying to get the docstring. For example run the import in another code snippet.
All Shortcuts can be found using CTRL + MH or going to Tools->Keyboard Shortcuts
Add a ? character and run the cell. Example:
You can see the docstring also just pressing TAB on Colab.
e.g.: print( + TAB
If it doesn't work, disable the Automatically trigger code completions by going to Tools->Settings->Editor
The shortcut for showing the docstring on Colab is ALT+/

What are the bigquery keyboard shortcuts?

Google's bigquery editor has keyboard shortcuts. For example ctrl+space composes a new query. I suspect there are more shortcuts, but I haven't found an useful list of them. Does anyone know them?
Ctrl + Space: If no query is open: compose new query. If query editor is open: autocomplete current word.
Ctrl + Enter: Run current query.
Tab: Autocomplete current word.
Ctrl: Highlight table names.
Ctrl + click on table name: Open table schema.
Ctrl + E: Run query from selection.
Ctrl + /: Comment current or selected line(s).
Ctrl + Shift + F: Format query.
(on Mac, replace Ctrl with Cmd)
This is the list from the official documentation: https://cloud.google.com/bigquery/docs/bigquery-web-ui#keyboard_shortcuts
You can see the shortcuts on the UI.
I found myself constantly refreshing bq page by accidentally hitting F5 as it is commonly used shortcut in many data tools for query/script execution. So in recently published Chrome Extension - BigQuery Mate - I have added F5 to execute query while in query editor.
Just Added:
I realized (a little ago) that one more shortcut is available now that i didn't know or see anyone mentioned before and was not available at a time this question was asked:
While your mouse is over Query Editor - pressing Alt - enters you into mode of copy of any rectangular part of your code. Quite useful!
July, 7 2016 Refresh:
I thought it also can be helpful to refresh this post with some BgQuery Mate keyboard shortcuts:
F5 – run query
Ctrl + F5 – run selection
F1 – help on selected or under-cursor-position keyword/function - opens respective documentation (SQL Version sensitive - Legacy / Standard)
Ctrl + Alt + / and Shift + Ctrl + Alt + / - comment/uncomment outside selection
Contextual Menu
Right Click > BigQuery Mate > Help on selected keyword/function – opens respective documentation (SQL Version sensitive - Legacy / Standard)
Right Click > BigQuery Mate > Preserve Format anywhere in Editor – Preserve Format – adjust Query Text such that further copy/paste preserves casing
I don't know all of them, but this seems a good place to share those I know:
ctrl+enter: runs the query
tab: autocomple
keep ctrl pressed: highlights the tables, clicking on them takes you to it
(note that in Apple ctrl might be the command key - I didn't know about ctrl+space, but it might be overloaded by mac os)
Continuing from Felipe Hoffa's answer above, the following keyboard shortcuts work on the Mac:
ctrl+enter: runs the query (same as Windows)
tab: autocompletes
keep the command key pressed: highlights the tables, clicking on them takes you to it.
Apparently, in the new tabbed view UI, there's two new keyboard shortcuts:
Alt+↑: move line of code up
Alt+↓: move line of code down
There might be others. I found them by accidentally hitting these keys. I can't find any documentation on these shortcuts, or I would include it.

How can I select next occurrence in IDEA editors

Ctrl+D performs the find_under_expand command in sublime. This basically searched for the next occurrence of the already selected text and selected it, so when I edit, it's edited on both places at the same time. I'm currently trying to move to IDEA editors (such as WebStorm, PHPStorm, PyCharm, etc) but didn't find something like this command in this IDE yet.
I believe they recently added this to the latest IntelliJ release, and I would assume PhpStorm as well. As the bindings are system specific, take a look at http://blog.jetbrains.com/phpstorm/2014/03/working-with-multiple-selection-in-phpstorm-8-eap/. Looks like that version is available through EAP, so don't know when they will release it for general consumption (or if they have already).
DEFAULT SHORTCUTS
Alt+J on Windows and Linux, Ctrl+G on Mac OS X
On Mac OS X, you can select the next occurrence with Ctrl+G
In the settings window, search for ”Add Selection for Next Occurence” (PhpStorm 8.0.1)
On mac the default is ctrl+G, but you can change it to ctrl+D (or cmd+D on mac)
Currently its mapped with
for selection, Alt + J
for unselection, Alt + Shift + J
but if you're familiar with sublime shortcuts like Ctrl + D
Jetbrains give you an option to change settings,
Settings -> Keymap -> Editor Actions
search for multiple selection, find Alt + J
then right click -> select change keyboard shortcuts
set shortcuts you want as like sublime, Ctrl + D
Here is the Docs
On Windows
Alt+j - Multiple Select
Alt+Shift+j - Unselect Multiple Select
I think what you want to do is refactor it at all the place in the file at once.
So in MAC machine the handy shortcut for it is shift + F6 (you may have have to use fn key before F6).
Click on the text you want to change and then press shift + F6. It will highlight the text and then your change at all the place in the file. :)
It will do the job same as sublime ctrl + D
PhpStorm has a "Select Word at Caret", Ctl+W and Ctl+Shift+W respectively (you can check your keys by searching under Preferences > Keymap).
Detail here:
http://www.jetbrains.com/phpstorm/webhelp/selecting-text-in-the-editor.html#d617165e275
Not entirely sure if it's the same as you mentioned, but it's mighty handy!

Using Sublime Text 2 key bindings in PyCharm

I would like to use the Sublime Text 2 key bindings in Pycharm. I know how to edit it one by one. Is there a way to override the entire keymap in one shot?
Something like
export the key bindings from sublime text 2
convert it into Pycharm's format
import it into Pycharm
Pycharm has some pre-configured keymaps. If there's a text / XML / JSON file where these maps are stored, I can try to convert it myself.
PyCharm now has Sublime Text keymap inbuilt as an alternative to Default Keymap.
Go to Setting -> Keymap and select Sublime Text from Keymap dropdown.
Hope that helps.
After poking around, I feel there's no easy way to do this.
If you change the default bindings, PyCharm creates a file in user space that shows the format of keymap. Theoretically, one could override all the fields in this file. But the problem is, there's no standard way of describing the action performed by a shortcut. Someone will have to do it manually, for each macro, to establish a correspondence between the actions performed by PyCharm & Sublime Text.
There is an IntelliJ request for this in their Youtrack tracker: IDEA-111333 Provide Sublime Text keymap.
From that thread, I found a repository for another remapping project. The keybinding file that imitates most of Sublime text can be found at in the directory PHPStorm-SpacePeacock/win_linux-keymaps-only/keymaps/Default for GNOME copy.xml. From the README:
The key mapping has been updated to better fit Sublime Text
conventions. Because I didn't think that ctrl + shift + alt + t is a
reasonable key combination for something as frequently used as
Refactor This.
Additionally, "search everywhere" HAD to be changed because
double-tapping left-shift is a two stroke trigger. This is a problem
because as you're working the IDE will be busy with analyzing,
indexing, and all of the things that IDEs do. If it's busy when you
try to hit the first left-shift, then the second left-shift won't pop
up the window. As far as user interfaces go, you should never have any
lack of confidence that an action will trigger the appropriate
response. Once you have that, you have to visually check each
operation which is slow and creates cognitive overhead. Consequently,
this was changed to ctrl + p (also to match Sublime Text) which
completely removes this problem.
ctrl + p search everywhere
ctrl + r search methods in current file
ctrl + alt + p change projects
ctrl + shift + enter complete current statement
ctrl + alt + enter refactor this
alt + enter show intended actions (intentions are one of my favorite
part JetBrains software)
ctrl + n new thing dialog
ctrl + shift + f format code
ctrl + d select word at cursor, or if a word is selected the select
the next occurrence of the word (multiple-cursors)
ctrl + t run tests
ctrl + alt + h show local history
ctrl + alt + r git conflict merge tool
(Less popular) keymaps that can be used with JetBrains Rider but not included in the installation package.
https://github.com/JetBrains/rider-non-bundled-keymaps
Intalling keymaps
In releases, get the sublime-text-keymap.jar file for the desired keymap.
In your IDE, choose File | Import Settings... from the menu and select the sublime-text-keymap.jar file.

What is the shortcut key for replace text in all files in Sublime Text 2?

How do I execute the "Replace" command with a keyboard shortcut?
I can't seem to find the "command" in the default keymap for OS X.
I know the single file replace all shortcut is control + option + enter, but that doesn't work in this case. This is in OS X, but it probably applies to Windows.
20 minutes of research turned up nothing.
Attempts:
Opened up the Find in Files panel and tried lots of combinations. No luck.
Browsed the keybindings file for anything bound to the find_in_files panel. No luck
Browsed the official Sublime Text API. No luck.
Browsed the unofficial list of commands. No luck.
This feels like a big oversight...
update: This is not implemented. Here is the official feature request.
Ctrl + shift + F
now you can add files and folder where you want to find and replace in all files.
Ctrl + Alt + Enter works for me in the latest Sublime Text 2