Tmux 3.0a how to past command line under Ubuntu 20.0.4 - paste

I tried to copy and paste command line in tmux3.0a, under Ubuntu 20.0.04.
First, i highlight the text, but somehow the highlight disappear right away.
Then a list show up, from which there is a "copy" for me to choose.
Say i copy the directory like this:
enter image description here
Here is my problem:
How do i do the paste now (there is no paste option in that list)?? Because whatever tricks i used doesnot work anymore...
I have tried Middlebutton the mouse, right click mouse, C-v..etc.

When I paste into the terminal, I must use ctrl+shift+v

When working in the terminal and tmux..
I simply use the default .tmux.conf and when I need to copy paste things I highlight them and hold down shift key.. then right-click copy or paste

Related

copy and paste from google colab terminal

It is passable to copy and paste from and to google colab terminal?
I tried to copy by 'ctrl +c' but it is not enable me to copy the text.
Alternatively i tried to copy by right click on the mouse , but the pop up menu it similar to pop up menu that opened at any point on the broswer.
namely the menu give me options like : save, print and so on.
for the paste operation we can use the shortkey below like unix terminal: Shift+Ctrl+V
but the copy operation can not be done by Shift+Ctrl+C

How can I enter a literal <TAB> character in IntelliJ/IDEA/PyCharm?

My configuration indents with four spaces, and I want to keep that. Occasionally (e.g. in a Makefile) I want to input a literal TAB character.
How can I force the IntelliJ-IDEs to input a tab or space, when it would not do so when I hit tab or space in that instance?
You seem to be asking two questions here:
1. How do I force IntelliJ IDE to input a tab, when it would not do so when I hit tab?
and
2. How do I force IntelliJ IDE to input a space, when it would not do so when I hit space?
I don't understand how the second case can arise. However, I have provided a solution to it as well.
Case 1. Insert a tab character when an IntelliJ IDE wants to replace it with spaces due to configuration
Solution
Use search and replace.
Details
Place the cursor where you want the tab to be
Press the X key
Select the X you just typed
From the main menu, choose Edit | Find | Replace to bring up the search and replace pane
Make sure there is an X in the search field
Enter \t in the replace field
Be sure the option Regex is checked
Be sure the option In Selection is checked
Click the Replace button
Case 2. Insert a space character when an IntelliJ IDE won't just let you type one (???)
Solution
Use search and replace.
Details
Place the cursor where you want the space to be
Press the X key
Select the X you just typed
From the main menu, choose Edit | Find | Replace to bring up the search and replace pane
Make sure there is an X in the search field
Enter a single space into the replace field
Be sure the option In Selection is checked
Click the Replace button
Install the plugin for Makefile support: https://plugins.jetbrains.com/plugin/9333-makefile-support
When I tried it today, this automatically use hard tabs in the editors for Makefile files.
Open another text editor, type a tab, and then copy and paste into the PyCharm editor. In MacOSX this worked for me using both Sublime Text 2 and TextEdit.
I can't think of any "direct" way. Probably the easiest way that I can think of is to write a Live Template to do it. See the help page on Live Templates for more information. When you write it, you may need to copy and paste a tab character in from another application.
However, when I tried it, IDEA saw it as just empty text and would not save it. So I used a variable with the "capitalize" function to capitalize a tab character.
Here's the template I created that you can paste into your templates. Now I type tab, hit the Tab key and I get a tab character. Of course you can change the abbreviation.
<template name="tab" value="$TAB$" description="Enter a tab Character" toReformat="false" toShortenFQNames="true">
<variable name="TAB" expression="capitalize(" ")" defaultValue=" " alwaysStopAt="false" />
<context>
<option name="OTHER" value="true" />
</context>
</template>
You could extend the idea to have multiple ones that enter multiple tabs. For example tab to enter 1 tab, tab2 for 2 tabs, etc.
Screenshot of it after use:
There may also be a way to hack a macro to do it. You could then assign the macro to a keyboard shortcut. I'll see if I can figure something out and update this if I do.
Use the menu option: Edit -> Convert Indents -> To Tabs.
Whenever I edit a makefile I do the "to tabs" conversion before I save the file.
UPDATE: Really sadly, I think the generated character still gets converted to spaces... Am checking...
There is an Action in JetBrains IDEs to enter a Tab character.
Here are the steps to use the Tab character action: (discovered in PyCharm 2020.3)
Double-tap the Shift key OR Help -> Find Action...
Type the 3 characters tab
Click on the action that is called Tab and shows the icon for the Tab character...
It remembers the last action you did, so if you have several tabs to add, you can get into a quick process by doing ShiftShift then Return each time.
Answer based on #Morfic's comment to the question. I think this is the cleanest and most sensible reply here so I figured it deserves a place as an answer (and needless to say, it worked for me).
If they're different types of files you could configure File -> Settings -> Editor -> Code style -> Tabs and Indents for each one to use either space or tab depending on how you want it.
One way to do this is to copy a TAB character from another text editor, then right click in your PyCharm file and use Copy / Paste Special -> Paste as Plain Text (Ctrl+Alt+Maj+V)
I guess this was not available in older PyCharm versions, because no other answer proposed it. Regular paste (Ctrl+V) doesn't work (replaced by spaces), but this one works. The function will also bypass other automatic formatting.
Inspired of Clare's suggestion,
assign the left tab key after finding 'tab' action.
At Actions tab, search by 'tab' and move your up/down arrow key and place there.
Then type Ctrl+1, you will see a popup. Select as follows and click OK.
Then, you might be asked "Do you want to remove other assignments?" if Tab key was already assigned. Click Leave because your usage won't conflict with the existing setup.

Atom: Imitate 'Shift-Enter' keybinding of IntelliJ

In IntelliJ IDEA, one of the more helpful commands I've found is 'Shift-Enter' - it effectively moves the cursor to the end of the line, and starts a new line, thus not affecting the text on the current line.
I'd like to re-create this in Atom, but I can't seem to figure out how one would go about doing so. It doesn't look like you can have multiple editor actions for a given key combination, and I'm not sure if I simply can't find the esoteric editor command I'm looking for.
How can I recreate the behavior of shift-enter in IntelliJ for Atom?
As it so happens, I stumbled across the shortcut: You can use cmd-enter to do the same action. I'm not sure what the underlying command is, but I hope this is helpful to other people!
You can recreate this behaviour by adding this to your keymap:
'atom-workspace atom-text-editor:not([mini])':
'shift-enter': 'editor:newline-below'
Detailed answer;
Freshly open atom editor
Open Keymap option
Copy this and paste this;
'atom-workspace atom-text-editor:not([mini])':
'shift-enter': 'editor:newline-below'
Click save and close the file
Press Shift and enter, Now you'll be able to form a new line below the line you currently in are regardless of the place you are typing in.

How can I expand multi-line selection to full lines in PHPStorm?

In Sublime Text I can arbitrarily select a set of lines and then use ⌘+L to expand the selection to the full lines. Is there a similar command in PHPStorm / WebStorm? (I'd like to map that command to a keyboard shortcut.)
I know PHPStorm has the option "Select Line at Caret", but that selects only one line.
Update
Nowadays (welcome 2020) Go to Preferences > Keymap. Change or add the value to
Add Carets to Ends of Selected Lines => CMD+SHIFT+L to have it behave like Sublime Text so it looks like
Old Answer
This is as close as I could get it (before 2020):
Go to Preferences > Keymap. Search for Clone Caret Above/Below.
On a Mac, it looks like this
The keys are:
CMD+SHIFT+CTRL+ARROW_UP for Clone Caret Above
CMD+SHIFT+CTRL+ARROW_DOWN for Clone Caret Below
Click on Apply and it will work
With WebStorm 11 (at least) the multi-caret keyboard shortcut is:
Ctrl then Ctrl+Arrow Up (or click & drag with the middle mouse button/scroll wheel)
then to select the full lines:
Home then Shift+End
which you could even create as a macro with a keyboard shortcut.
I used to accidentally activate the multi-caret all the time (I scroll with Ctrl+Up/Down), so I knew how to do part of it, but it took me ages to figure out that extra Ctrl tap at the beginning.
Hold down Alt + Shift and left click on the lines you want to select. This will put multiple cursors on the editor. Now you can use the Select Line at Caret option you mentioned to select all those lines.
You can find more about multiple selections here.
This is currently not possible with a selection. However, you can still do that from the keyboard. Instead of doing selections set up a shortcut for Clone Caret Above (Alt+Shift+U for me) and Clone Caret Bellow (Alt+Shift+D for me). This allows to go up or down a line and add a caret there. So instead of selecting each line, you directly move the caret there and clone it.
I am also coming from Sublime Text and missing that feature, but this worked also pretty well.

Intellij: How to copy/paste a file in order to duplicate it?

I can not seem to find a way to do this? I have a file named X in some folder, I want to create Y with the same contents in the same directory. The way I do in eclipse is to select the file and ^C, ^P, eclipse prompts for the new name.
UPDATE
Apparently this problem only occurs if compilation unit contains more than one type.
F5 will duplicate selected file prompting you to enter a name for the new file.
⌥ + drag
MacPress Option key and drag the original file.
PCPress Alt key and drag the original file.
You will be prompted for a new name.
Works for classes too:
As for a keyboard only solution to duplicate a file in IntelliJ:
On Linux:
Press Alt+Home to activate the navigation bar, then either press F5, or press Ctrl+C to copy the file and then press Ctrl+V to paste it, a dialog will appear to name your new file.
On Mac:
Press Cmd+Up to activate the navigation bar, then either press F5, or press Cmd+C to copy the file and then press Cmd+V to paste it, a dialog will appear to name your new file.
I found that ctrl+c/ctrl+v will not copy files on IDEA in Linux (using x2go to connect on a Windows box). I was able to get it working if I close xclipboard but then copying between Windows and Linux dialogs stops working.
Ctrl + C on target file/folder
Ctrl + V on destination folder
Enter new name and press Enter...