How can I move the cursor quickly to a specific location in a text I have just copy pasted in an Advanced Scripting command? - naturallyspeaking

I am writing an Advanced Scripting voice command in Dragon NaturallySpeaking Professional 11.5 to write SQL commands by voice. Regarding the ORDER BY variable_name ASC command, I would like to move cursor right before ASC:
Sub Main
Clipboard(" ORDER BY ASC ")
SendKeys "^v"
End Sub
How can I do so efficiently as in the built-in double quotes command?

Add some arrow keys right after ^v:
Sub Main
Clipboard(" ORDER BY ASC ")
SendKeys "^v^{LEFT}{LEFT}"
End Sub

Related

Shortcut key to jump to start of entire string in VSCode

What keyboard shortcut lets you go to the start of a string? I need this for emails. When i use CTRL + back arrow it jumps to the dot and # sign, i have a block of strings with emails at the end, i want to select only the email by going to the end of the string but as some people have firstname.lastname#something.com and flastname#something.com the cursors dont line up when i use CTRL + back arrow.
I cant find any specific shortcuts which would help in this situation.
thanks!
You can use the extension Select By
You can use the:
forward - backward
surround
Add this to your settings:
"selectby.regexes": {
"email": {
"surround": "[-.a-zA-Z0-9]+#[-.a-zA-Z0-9]+"
}
}
You can call the select with a command or define a keybinding, see the doc page
There are no built-in commands that will do what you want. You will need an extension. I wrote such an extension: Jump and select.
With this setting (in your settings.json):
"jump-and-select.putCursorBackward": "afterCharacter" // default is beforeCharacter
and the default keybinding for jumping backward and selecting Shift+Alt+B it is easy to select everything from your cursor to some preceding character. Just trigger that keybinding and type the character to select backward to, in your case a Space. As you can see in the demo, it works with multiple or single cursors.

How to use editor.action.joinLines in visual studio code?

As the title says, in visual studio code you can use the editor.action.joinLines to join different lines of text to one single line? Being an editor noob, the question is how? How do I map this command to a key board short cut, or what mouse actions do I need to do after selecting the said text, to get two different lines as one single line? Specifically I am working on Mac OS X.
To join several lines you have to select them first (you can read more about various ways of selecting text in the vs code documentation) and then invoke the Join Lines command. As a result, all text from the second and next lines will be appended to the end of first lines.
You can invoke the Join Lines command either from the Command Palette by pressing F1 or ⇧+⌘+P on macOS and typing Join Lines or by pressing the assigned shortcut - ⌃+J
You can also configure your own key bindings by clicking File>Preferences>Keyboardshortcuts on Vscode main menu.
There you can bind the command joinLines to your prefered Keyboard keys as shown in this link.
View image

Automatic Code Identation

I have a huge code and now for testing purpose I have to add that whole script into an infinite while loop is there any short way (without pressing space for each row) to add a space for indentation so the whole code is consider part of the one while loop ? Such as for example when we press ctrl +r it comments out the line
Ctrl-I/Cmd-I will automatically indent the file. Other wse you just select multiple row and use Tab/Shift-Tab to move them backwards and forwards.
For indentation is a must, however Matlab as a language does not care so it is not really a must to indent it. Additionally, you can just execute the code from the command line, say that you script or function is called Umar, then from the command line you just type while 1, Umar; end.
You can copy the code into notepad++.
Activate Column mode selection holding alt+shift and use the mouse to select the column of all the text you want to insert a space/tabulation/etc. and just insert it.
Final step is to copy back the code to matlab.
Matlab does not currently support column selection.
MATLAB has the option to select all your code, then press the right click and select smart indent button.
If you like to use shortcuts, just type the combination of Ctrl+A (select all) followed by Ctrl+I (smart indent)

Oracle SQL Developer: how do I make the Home and End keys behave?

When I'm working in a Worksheet in Oracle SQL Developer, the Home and End keys jump me to the beginning and end of the whole Worksheet respectively, not the beginning and end of the current line. Is there a way to change this behavior?
Set your shourcut behaviours in Tools -> Preferences -> Shortcut Keys
source :
http://www.thatjeffsmith.com/archive/2012/11/keyboard-shortcuts-in-oracle-sql-developer/

SQLDeveloper: execute current line without highlighting

In Toad one can easily execute current line without highlighting it. Let say, you have a worksheet like this:
select * from item -- cursor here
select * from product
When I click on CTRL+Enter I want only the line where the cursor is to be executed. In SQLDeveloper, if there is no second line, CTRL+Enter works as I want. Basically, I want to do the same as described here, but for some reason, I can't find the Tools -> Preferences -> Window Types -> SQL Window and check "AutoSelect statement" in the version of the SQLDeveloper I am using: 4.0.0.13, build Build MAIN: 13.80.
Seems like, this functionality is taken out in the 4.x of Oracle SQLDeveloper?
If you have a block (anonymous or such) of code before your sql statement, make sure to end with forward slash, for the CTRL+enter to work.
CTRL+Enter on the select sysdate statement below works in second example below, but not on the first example.
Example 1:
begin
NULL;
end;
select sysdate from dual; -- press CTRL+Enter on this statement
Example 2:
begin
NULL;
end;
/
select sysdate from dual; -- press CTRL+Enter on this statement
For those who also wonder about the same thing, here is what you gotta do. End each statement with ; and it works.
select * from item
;
select * from product;
Actually the best option is mentioned here :
http://forums.allroundautomations.com/ubb/ubbthreads.php?ubb=showflat&Number=46683
1) Press Ctrl-F8 when the cursor is on the statement. Now only the
current statement is executed. You can assign a different key through
the preferences (Tools > Preferences > Key Configuration > "SQL
Window: Execute current statement").
2) Enable the "AutoSelect statement" preference (Tools > Preferences >
SQL Window). Now the standard execute function will automatically
select the current statement under the cursor and execute it. To
execute multiple statements you now have to explicitly select them
first in the editor, or use Ctrl-F8.
I also ran into a similar situation where Ctrl+Enter shortcut stopped working for executing any statement and had to highlight the entire statement for executing it.
How it worked:
(i) By removing/commenting out all the comments in the worksheet i.e. just have only the Sql statements in the worksheet, if at all you have put any statements/comments in the worksheet for your understanding, just disable those and then Ctrl+Enter starts working.
PS: I didn't do any other changes apart from this to make this shortcut work.
Cheers