How do you set copy mode from your screenrc? - gnu-screen

I want to enter copy-mode by default from screen. Right now, I'm using stuff to start a server. I'd like to then enter copy-mode so I can just use the mouse to scroll up.
I can't just use stuff "Ctrl-a ESC" (even though Ctrl-a ESC entered from the terminal sets screen mode just fine).
Is there a special character for Ctrl-a that I can stuff? (like ^M for a return)

The command I needed was... copy.

Related

Ssh console prints ^H when pressing the return key

I did not know if I had to post that in a more system specific stack exchange. So please inform me where to go if this question does not belong here.
I am using mobaXterm tu SSH into a server. It worked fine for the last week, but since today, I have a behavior modification.
When I press the return key, it prints ^H instead of deleting previous character.
For example:
# cd bni/^H^H^H
Why did it suddenly change and how can I configure it to actualy delete the character instead of printing this ?
Edit: With a new terminal, the "problem" does not occur.
In MobaXterm's changelog https://mobaxterm.mobatek.net/download-home-edition.html, you can see they added a New option for sending ^H when pressing the backspace key in Version 3.0. It has a checkbox setting 'Backspace sends ^H' in Settings --> Terminal tab.
You can also use Shift+Backspace to remove a character.
You could also use the stty command to set your erase character:
stty erase {press backspace to get the ^H character}
You may need to include this in your login scripts to make it permanent.

Curser/Caret deletes while typing

I've pressed some combination of button by accident and in doing so caused the cursor/caret to stop working properly. When I type in the editor it replaces what I already have with the new text
For instance, if I have
if(this.class()==foo){...}
And I try adding "del" infront of 'this.class()' it comes out as
if(dels.class()==foo){...}
How do I turn this effect off? It's not block cursor or selection mode.
Found out I activated the Insert/overwrite keymap by pressing 'insert'

PHPstorm scrolling with keyboard

I'am looking for an option to force scroll code when entering with keyboard cursor in example at 5 line from the end.
Default behavior is to scroll code when entering 1st or last visible line of code.
I would like to change it even for 10th from the beginning and 10th before last.
It appears the base IDE does not have an option for this. However, the behaviour is available in the IdeaVIM plugin (docs) under the scrolloff option.
'Scroll offset' mode can be enabled for the current session with the command:
:set scrolloffset=10
Add that to your ~/.ideavimrc to make it permanent.
NB: IdeaVIM changes the IDE to behave more like vim*, which may require some re-training.
If you're not familiar with Vim:
Install the IdeaVIM plugin (via Settings → Plugins → Browse Repositores → type 'ideavim' in search)
Restart the IDE
Open a file
Note the caret is a block like █; this indicates 'normal' mode
Press : to enter the 'command' mode
Type set scrolloff=10 then Enter
Scroll around, notice the editor scrolls before the caret gets to the very top (or bottom)
Press i to enter 'insert' mode, and edit your file as usual
Press ESC to return to 'normal' mode
Interactive vim lessons
openvim.com
vim-adventures.com
* It seems difficult to have the plugin only modify the scrolloffset behaviour and leave the rest per the default IDE.
You can set "EditorMoveUpAndScroll" shortcut.

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.

When using vim or less in gnu screen, quitting vim or less leaves a lingering imprint

On my new Ubuntu system, I start a screen session and edit a file in vim or view it in less. After I quit, the screen doesn't redraw itself, but simply scrolls up to show a command line under all the stuff I was just viewing in vim or less.
How can I change this so that quitting vim will return me to the screen the way it was before I invoked vim?
screen's altscreen (alternate screen) feature is turned off by default.
Add this to your .screenrc:
altscreen on
See: http://www.gnu.org/software/screen/manual/screen.html#Redisplay
This is caused by your termcap for screen being incomplete. (This seems to be a really common problem.) Vim doesn't know the sequence for restoring the screen, so it just leaves it like it was.
You can work around this problem by setting vim's term option (or the TERM environment variable before you start vim) to a terminal that's "screen compatible", like xterm. eg:
TERM=xterm vim
or (in vim):
:set term=xterm
You can set the t_ti and t_te options in vim to the right codes. See :help xterm-screens in vim for more details.