PhpStorm select text in terminal - terminal

I recently changed work and moved from VSCode to PhpStorm.
Is there some way I can use ctrl + shift + arrows to select text while using Terminal in PhpStorm?
It's very convenient to do this in VSCode when I need to execute multiple similar commands - I can just select and delete big chunks and replace them with new input. Now I have to delete each character individually by holding delete.
OS: Windows 10

Related

How can I quickly run one line from a Quarto code chunk that I'm editing in RStudio?

I've just started using Quarto for first time in RStudio (I usually use Rmarkdown).
In Rmarkdown, I could select a line from a code chunk and use Ctrl + ⏎ to evaluate it in the global environment. This was useful because it let test the behaviour of a line without requiring me to knit the document or run the entire chunk.
This shortcut does not work in Quarto documents in RStudio. Is there different keyboard shortcut which will let me a evaluate a single line from a chunk of code in a Quarto document?
Edit: some people are saying that the old shortcut should still work, so maybe this is a bug? I'll update this question when I know more (or perhaps delete the question and submit an issue should the need arise)
Currently using
R version 4.2.1 (2022-06-23 ucrt)
RStudio version 2022.07.1+554 (Spotted Wakerobin)
This is an RStudio bug on Windows 10
There's a known issue with Rstudio and the Quarto visual editor where pressing Ctrl + ⏎ from a 'floating' window results in no code being evaluated, or code in a different window being evaluated. It's part of a wider bug where the connection between floating windows and the main window is severed.
The issue is due for repair in 2024. Until, then you'll need to do the following to restore normal shortcut functionality:
'Re-dock' the window you're editing using the 'Return to main window' button:
Close all other 'floating' windows
Restart RStudio. Close the process completely; restarting the session will not work.

How do I rebind the Mac key shortcuts?

I am currently using a new Mac notebook. I was used to Unix before and now I would like to change the keystrokes so it is more like Unix. For example, when I press Alt Gr + ? it gives me the \ on Unix. But on Mac, I have to press Alt + Ctrl + 7 to get the backslash \.
How can I permanently rebind the keys, so it has the same outcome like Unix/Linux ? I would love to change it in a simple way, if that's possible. Thank you
This is possible with Karabiner-Elements, for example.
You can also search if existing rebind configurations are available for download.

Copy Paste in Bash on Ubuntu on Windows

How to execute a copy paste operation from Windows 10 to the Bash on Ubuntu on Windows environment?
I tried the following:
ctrl + shift + v
right click to paste
Any suggestions?
Update 2019/04/16: It seems copy/paste is now officially supported in Windows build >= 17643. Take a look at Rich Turner's answer. This can be enabled through the same settings menu described below by clicking the checkbox next to "Use Ctrl+Shift+C/V as Copy/Paste".
Another solution would be to enable "QuickEdit Mode" and then you can paste by right-clicking in the terminal.
To enable QuickEdit Mode, right-click on the toolbar (or simply click on the icon in the upper left corner), select Properties, and in the Options tab, click the checkbox next to QuickEdit Mode.
With this mode enabled, you can also copy text in the terminal by clicking and dragging. Once a selection is made, you can press Enter or right-click to copy.
To get right-click to paste to work:
Right-click on the title bar > Properties
Options tab > Edit options > enable QuickEdit Mode
At long last, we're excited to announce that we FINALLY implemented copy and paste support for Linux/WSL instances in Windows Console via CTRL + SHIFT + [C|V]!
You can enable/disable this feature in case you find a keyboard collision with a command-line app, but this should start working when you install and run any Win10 builds >= 17643. Select "Properties" from the menu to access the following dialog box.
Thanks for your patience while we re-engineered Console's internals to allow this feature to work :)
You can use AutoHotkey (third party application), the command below is good with plain alphanumeric text, however some other characters like =^"%#! are mistyped in console like bash or cmd. (In any non-console window this command works fine with all characters.)
^+v::SendRaw %clipboard%
Right-click the title bar, select context menu Edit -> Paste (until they fix the control key shortcuts)
As others have said, there is now an option for Ctrl+Shf+Vfor paste in Windows 10 Insider build #17643.
Unfortunately this isn't in my muscle memory and as a user of TTY terminals I'd like to use Shf+Ins as I do on all the Linux boxes I connect to.
This is possible on Windows 10 if you install ConEmu which wraps the terminal in a new GUI and allows Shf+Ins for paste. It also allows you to tweak the behaviour in the Properties.
The Console looks like this:
Copy options:
Paste options:
Shf+Ins works out of the box. I can't remember if you need to configure bash as one of the shells it uses but if you do, here is the task properties to add it:
Also allows tabbed Consoles (including different types, cmd.exe, powershell etc). I've been using this since early Windows 7 and in those days it made the command line on Windows usable!
Like it has been written before:
Right Click on Bash on Ubuntu on Windows Icon if you have it on a Task Bar Shortcut Icon
Click on Properties
Select Options Tab on the Properties Window
Check the QuickEditMode option
Click Apply
Now you are able to open a new Bash Terminal and just use Right-Click to paste
In order to be able to copy from Terminal, Just use CTRL+M and this will enable you to select and copy selected Text.
For pasting into Vim in the terminal (bash on ubuntu on windows):
export DISPLAY=localhost:0.0
Not sure how to copy from Vim though :-(
Alternate solution over here, my windows home version Windows Subsystem Linux terminal doesn't have the property to use Shift+Ctrl (C|V)
Use an actual linux terminal]1
Install an X-server in Windows (like X-Ming)
sudo apt install <your_favorite_terminal>
export DISPLAY=:0
fire your terminal app, I tested with xfce4-terminal and gnome-terminal
windows #ubuntu #development
For just copying (possibly long) texts to the Windows clipboard, I have found that just piping the output to clip.exe (including the .exe file extension) works fine for me. So:
$ echo "Hello World" | clip.exe
lets me paste Hello World using Ctrl-V anywhere else.
Now that I have posted this, I notice that related question Pipe from clipboard in linux subsytem for windows includes this and a command solution for pasting from the Windows clipboard as well.
you might have bash but it is still a windows window manager. Highlite some text in the bash terminal window. Right click on the title bar, select "Edit", select "Copy", Now Right Click again on the Title bar, select "Edit" , Select "Paste", Done. You should be able to Highlite text, hit "Enter" then Control V but this seems to be broken
For autohotkey users, a full answer is:
#IfWinActive ahk_class ConsoleWindowClass
^+v::SendInput %clipboard%
Which checks that you're in a console (windows or ubuntu) before pasting from the windows clipboard.
That turned out to be pretty simple. I've got it occasionally. To paste a text you simply need to right mouse button click anywhere in terminal window.

Can I make a shortcut to specify a switched tab in Mac OSX Terminal?

In Chrome, it's possible to switch tabs with cmd + tab_number, like cmd + 3 to go to the third tab. Is there anyway to specify this for Terminal on a Mac running Mavericks?
I know how to change a shortcut via System Preferences, but I'm not the exact name of the Menu Command I should add, if it's even possible.
You can Shift + Command + Left or Right Arrow to cycle through tabs:
Shift ⌘ ←→
or
⌘{}
If you want to use a specific # as you mentioned then you'll have to script it or use windows instead of tabs.

Vim in OSX: How to paste text from open window into a open file in vim?

In linux, I used Shift + Insert to paste anything in the system clipboard into the terminal. In Mac, there isn't an insert key - so, I'm left wondering how to do that ?
The standard Mac paste shortcut, Command-v, should paste the contents of the clipboard into vim, running in a terminal window, assuming vim is in insert mode. I just pasted the previous sentence into vim on my Mac, by that method. If you are new to Macs, and you have an Apple keyboard, the Command keys have an apple and a strange symbol resembling an octothorpe, with a loop at each corner. On my 3rd party keyboard, they are labeled with a diamond-shaped symbol.
This works with Macvim. The copied text is placed in the + register then in the macvim buffer hit "+p and the text will be pasted into the buffer. I find this quicker than using command-v,comand-c.
If you're using console vim then it is placed in the . register. Hit ".p to paste the text from the clipboard.
In Ubuntu, Shift+Insert is used to paste highlighted text, not to paste text copied in the buffer that was copied using Ctrl+C.
In macOS this functionality of pasting highlighted text can be done with ⇧Shift+⌘Command+V.
I hope this helps any users that are coming from Ubuntu.

Resources