Snowflake - How to Multi Line Comment - sql

Is there a shortcut for multi line commenting out? A.k.a. commenting blocks of SQL at a time via a shortcut or menu option?

You have to highlight the rows you want to comment out and then press Cmd (Mac) or Crtl (Windows) + /
See here: https://docs.snowflake.com/en/user-guide/ui-worksheet.html

I don't think there's something like multi-line comment in snowflake. Even on the community page: page there's just the shortcut for a single line comment while having the whole thing highlighted, which is:
Press CMD + / (Mac) or CTRL + / (Windows) again. The comments are removed from the highlighted lines.

Related

Is there a shortcut key to duplicate line in google colab?? If not how can it be implemented?

I usually duplicate the line if i need to use the code same as the above line. I did not find the shortcut key to duplicate the line . I saw some posts to implement shortcut key to duplicate line but they are rather complicated and requires to run script every time.
For anyone still looking for a keyboard shortcut to duplicate lines in Google Colab,Left_Alt + Shift + Down_arrow works for me!
if you want duplicate a code line or selected code lines just use ctrl+c and ctrl+v. or ctrl+c+v
I found the solution just in case anyone wants to use it.
Ctrl + Shift + Down_arrow
Use this: Alt + Shift + Arrow down

Is there a keyboard shortcut for inserting a new line above the one the caret is on?

I can do command-return to create a new line under the current one, even if the caret is in the middle of a word, but I often find myself wishing there was a similar command for inserting a line above and moving the caret to it. Does that exist?
I know I can type out my new line and then move it, but it'd be nice to skip that.
Yep: ⌘ (Command) + shift + enter if you're on a Mac
Found here

What is the Stata 11 do-file editor shortcut for selecting a command line?

A task I use multiple times a minute is to select command lines from my do-files and execute them.
The shortcut for this function in previous versions of Stata was Ctrl+Shift+Up/Down arrow. I used to use Stata 10 and now that I've upgraded to Stata 11, the keystroke sequence described in the previous sentence does nothing. I'm limited to Ctrl+Shift+Left/Right arrows, which is painstakingly slow.
Go to the start of the line (with the Home key) and then Shift+Up/Down.
Credit:
The comment by Roberto Ferrer
I automate the selecting of line and exectuting the command with the following autohotkey script.:
^+Enter::Send {Control down}l{Control up}{pause}^d{down}{Home}
Return
Above is assigned to Ctrl + Shift + Enter, but it could be any keyboard combination. I usually use Ctrl + Ö or Ctrl + Ä since I use a scandinavian keyboard.
Same code as above but assigned to Ctrl + Ö:
^ö::Send {Control down}l{Control up}{pause}^d{down}{Home}
Return
If you prefer having the cursor at the end of the next line after executing, replace {Home} with {End}

Adding spaces in multiple lines simultaneously - in Pycharm

I occasionally need to go line-by line and change the indentation of the code.
Is there a shortcut in Pycharm where I can add spaces (format the indent) in the begining of multiple lines simultaneously without processing each line individually?
Highlight/ select the lines you want indented, then press TAB as often as needed until they reach the proper indent level.
You can remove spaces with SHIFT TAB.
You can also use CTRL+ALT+I to auto-indent the selection.
Select the block that you want to indent then press TAB. It will work.
To auto indent all the codes in Pycharm just press these sequencies:
CTR + A to select all the text files and then press
CTRL+ALT+I
Select all that you want to indent, then do CTRL+ALT+I to indent all of it. This should work in Pycharm
Use shift +alt on windows machine
Continuation indent for Mac pro: Preferences -> Editor -> Code Style -> the language -> Tabs and Indents
If Ctrl + ALT + I is not working and every time needs to press the Insert button to get the pointer.
So go to Tools -> Select Vim if it is checked then it will be disabled.
Now you can intend code directly selecting multiple lines.

IntelliJ navigate to next and previous highlighted variable

In IntelliJ 10.5 I have "Highlight usages of element at caret" enabled. When a variable/method/etc is selected, is there a way to move to the next and previous occurrence? I'm looking for the equivalent of Control-K in Eclipse.
Edit: Shortcut to navigate between highlighted usages simply moves to the next text occurrence, which is different than moving to the next occurrence of the variable/method/etc. If I have the variable foo selected, I want to navigate to the next occurrence of foo and not any piece of text called "foo" (including "foo" in comments, method names, etc).
Also, pressing F3 seems to be buggy. When I press F3, it sometimes searches using the previous searched text and not the currently highlighted text.
F3 or shift+F3
ctrl+c, ctrl+f, enter or up and down arrows
ctrl+alt+F7
Added this in case people don't look at your edit.
It's not currently possible, see my question: Shortcut to navigate between highlighted usages.
I even created an issue IDEA-70523 addressing this feature, please vote for it if you can't live without it like me :-).
Install Identifier Highlighter Reloaded and use Alt + Shift + Up/Down (can be redefined in Keymap settings) :)
After you give it a shot and notice the 'hey, the highlight stays there after I move my cursor out of it' annoyance, consider upvoting this issue :)
In the Mac OS, you can navigate to next highlighted usage by press control + option + up/down arrow.
Vote this request up for make them implement the feature.
http://youtrack.jetbrains.com/issue/IDEA-59638
I found something thay may more suite your needs : alt + mouse-wheel up/down.
It goes to previous / next occurrence of identifier under caret.
Shortcut name is "Go to next highlighted element usage".
I usually do the following:
Highlight the word
Cmd + F (it will highlight all the matches in file)
Cmd + G (next match)
Cmd + Shift + G (previous match)
I could not get any of IntelliJ's native options for Find Next/Previous to behave like in Eclipse. Find Word at Caret comes close, but it only allows you to slurp and find the next word, not previous.
Identifier Highlighter Reloaded also does not behave like Eclipse.
I wrote an IntelliJ plugin to reproduce the exact behavior as in Eclipse. You can find it here: https://plugins.jetbrains.com/plugin/10635-quick-find-plugin
Look for next occurrence # Keymap
^G = "select" the variable that you want to search for
[shift]⌘G = [previous]next occurrence of selected variable
All credits to #Igor Wojda for his comment in the accepted answer.
(AFAIK, limiting search scope to only variable/method is not possible)
For text based match and quick jump:
Simply place the cursor over the desired word to be searched
Press Ctrl+F3
For further down/up search, simply use
F3/Shift+F3 respectively
in Intellij shortcut for this action, it's not defined.
but you can define it like this:
Ctrl+ Alt + S
search " highlighted usage"
then you can set a shortcut for that.
Ctrl+Alt+Up and Ctrl+Alt+Down navigates to the next and previous usages of a highlighted variable in IntelliJ.
I use this functionality of navigating to the next usage of a variable in a file by hot in Visual Studio all the time (Ctrl+Shift+Up and Ctrl+Shift+Down) and was looking for the equivalent in IntelliJ