Auto hotkey to copy selected code and run in cygwin - autohotkey

My company uses Windows, but our AWS resource is in Linux. During code fiddling, it often creates a situation where I open cygwin, ssh to the AWS head node, load R/Python in the cygwin console, copy and paste a block of selected code from my local Rstudio code editor, and paste it to cygwin console and run.
In Rstudio, one can press "Ctrl + Enter" to run a selected block of R/Python code in the code editor. How can I achieve the effect of: by pressing "Ctrl + Shift", the selected block of code will be auto-copied into the cygwin window and run?
I am looking at this post: https://www.autohotkey.com/board/topic/92654-copy-and-paste-between-applications-noobs-first-attempt/ but couldn't figure out how to adjust it to my need.
Thanks!

Related

How to switch from the code/script to the terminal in vscode without mouse usage

I dont want to use my mouse to move to the terminal below the script in VSCode.
Example:
I have a python terminal below, which I would like to experiment in between writing the script.

How to replicate the following Spyder behavior in VSCode?

I'm new to coding Python in VSCode. Previously I used Spyder but decided to move to VSCode as the project management seems better in it (I could easily switch to other files/folders by clicking on the path, just like in PyCharm). But I really need this one workflow which I still have not managed to do it in VSCode.
write some codes like Selenium.
Click run (F5)
The selenium browser opens up.
I could use the Ipython terminal to access the code interactively (find the element in the browser etc) and send new command.
I would like to have this workflow in VSCode. Im also quite overwhelmed by the difference in these 2 IDEs, for example, in VSCode, you have integrated terminal, a debugging console and an output tab, while im used to have only one-for-all Ipython tab.
Ok, I figured out what I need. Basically I just need to right click on the python file that I want to run on the side bar. Then I have to select 'run current file in interactive window'. The only difference is on the Ipython console, I have to use shift+Enter to send my input instead of just clicking enter. But its not a big deal.

How to get Clean Terminal in VSC

I want to have a clean Terminal in VSC, but every time I run my code there is some useless stuff I would like to remove, for example my Microsoft Version and the path to my files.
Is there any way to remove them from my Terminal?
On all my other PC's I don't have this Problem, only on this PC. I already tried to change the console argument in my Launch.json but if I change it to InternalConsole it dosen't run the code anymore. Also it would show my results in the debugger and I would like to use the Terminal.
You can clear your Terminal after each run, by typing clear in Terminal. To have it done automatically, check 'Clear Before Reusing', or 'Clear Previous Output' (if you're using Code Runner) in Settings. To get there, press Ctrl + , on Win or Command + , on Mac and type 'clear' in the search box.
Sending the output to the Debug console looks cleaner, but it doesn't allow user input. Other than that, I don't think there's a way to not have the path of your file displayed as the file executes.

Running a script in julia VSCode

this might sound like a very stupid question, but what is the difference between F5 command in julia vscode and Ctrl + Enter? I know, that F5 means start debbuging, but I just don't understand, why a script written by someone else openend in julia vscode can be executed only by the Ctrl + Enter command. Is it something like debbuging is only for some kind of projects and this is only a script?
Thanks for your help.
As with all things in vs code you can run them from the command palette by pressing ctrl/cmd+shift+p and typing in “Julia” will pop out the various run commands.
As for keybinds, you can check if there is one set or set your own to run this command by managing your keyboard shortcuts. cmd/ctrl+k cmd/ctrl+s will bring up the keyboard shortcut palette.

Sublime Text 3 has integrated terminal?

I normally use the WebStorm IDE for Node.js and FE JavaScript development. However I was thinking of using Sublime Text 3 since I am running out of computing power on a crappy old Macbook Pro and ST3 should be lighter on memory and CPU.
However, my one hangup is that ST3 doesn't seem to have a command line terminal integration possible. I find this to be a very useful feature that's available in Eclipse and WebStorm.
I did some Googling and I don't see any great terminal integration plugins for ST3, is there such a thing or not?
Here is WebStorm with the terminal integrated:
Terminus does this. Supports both Unix and Windows. Works great. 👍
In View (on Windows)
Ctrl + Shift + P --> Terminus: Open Default Shell in Tab (View)
In Panel (on Unix)
Ctrl + Shift + P --> Terminus: Open Default Shell in Panel
Type exit to exit and close the terminal opened in a panel.
I installed the Sublime package TerminalView that can show a terminal window within Sublime in a separate tab.
It works with MacOS or Linux but is no longer actively supported.
Installation:
Open the command palette (Cmd+Shift+P on Mac, Ctrl+Shift+P on Windows) and find Package Control: Install Package
Search for TerminalView and hit Return to install.
The terminal windows has a few flaws (at least on macOS) as it seems to conflict with Sublime's keyboard shortcuts. I however use it only to automatically run unit tests when the edited program code changes. Therefore it works just fine. In that case it works best if I show the terminal window below the text editor. You can do so in the menu View > Layout > Rows: 2.
In sublime 3,
ctrl + shift + p search Package Control: Install Package
Search and install TerminalView
to set shortcuts,
go to Preferences -> Key Bindings
on right side Pane paste this,
[
{ "keys": ["ctrl+shift+t"], "command": "terminal_view_open" }
]
Now ctrl+shift+t is your shortcuts
I prefer Terminus and it's the first cross platform terminal for Sublime Text. Check this video it might help you
I tried Sublime package - TerminalView, quickly realized I couldn't copy paste things. Tried on MacOS.
Terminus(https://github.com/randy3k/Terminus ) looks good to me, it has two options
(i) opens in a tab(view)
(ii) opens also in a panel. (which I prefer most)
The below original answer is now outdated; see below answer by Svish.
I was wondering the same thing a while back, and I believe the answer is: no.
There's no good terminal integration in ST3, except, maybe, for Terminal, which simply takes you to the terminal from any given project folder.
Works ok, but not sure how much it really saves.
No way to have it in the ST3 window AFAIK.