how to map alt+hjkl in insert mode in vim with secureCRT? - vim

os: ubuntu16.04
tools: secureCRT 8.x
i tried many ways but failed, press alt+h/j/k/l will exit insert model to normal model.
like select session-option/terminal/emulation/emacs/use-alt-as-meta-key also dose not work.

After a period of adaptation, I used to use the combination of crtl + hjkl

Related

Iterm2 alt + backspace Like Linux

I changed my job and now I have a Macbook for working I configured Iterm2 with zsh and almost everything is working, but certain shortcuts aren't, one of the most used by me every day "alt+backspace" to delete a word before a special character appears, I tried a lot of things with the Hexa code an so on, in most cases it is almost working, but it deletes the entire line
Example :
ls /tmp/file1
With alt+ backspace this will delete the complete text /tmp/file1 while on Linux it will just delete file1
Is there some way to configure Iterm2 to have the same behaviour than in Linux for this shortcut ?
I tried things like this
https://jorge.fbarr.net/2018/06/08/iterm-and-altbackspace/
But it's not working as in Linux.
This is what helped me. Option key should send ESC+ sequences and all will work fine.
And I have no idea what is "normal"

How can I write to multiple lines simultaneously in Geany?

I want to modify the beginning of every line of a txt file in Geany. Somehow it is possible to write in multiple lines at the same time (maybe with box selection?).
How to do this?
You need to install before the plugin Extra Selection.
For my configuration (Debian/Buster, Geany 1.33) I add to configure shortcuts key.
See plugin manual for more details :
Usage :
Under Tools -> Extra Selection, there are 7 new items: "Column
Mode", "Select to Line", "Select to Matching Brace", "Toggle
Rectangular/Stream", "Set Anchor", "Select to Anchor" and "Rectangle
Select to Anchor". Normally these should be bound to keys, for example
Alt-C, Alt-Shift-L, Ctrl-Shift-B, Ctrl+2, F12, Shift-F12 and
Alt-Shift-F12.
This is just an addition to the answer by #zaboop since the edit queue was full and many people might not have understood the solution properly.
In Geany you cannot edit different parts of multiple lines at once (like in VS Code) without using plugins.
Instead what you can do is you can edit the starting of multiple lines at once.To do so:
Hold Shift + Alt and press your up or down arrow keys to correspondingly select the lines above or below the current line.
Then release Shift + Alt and continue editing the lines.
No plugins needed.
Strangely, unlike the other answers, I had to press Shift + Ctrl while selecting a region, and selecting only works with the mouse, not with the keyboard. After selecting, I was able to edit multiple lines at once.
Configuration: (Debian-based) Raspberry Pi OS, accessed via VNC, Geany 1.33
Select the region, while pressing Alt-Shift, then move around with cursor with arrows.

Why does cygwin mintty type 8~ (tilde) on its own?

CYGWIN_NT-6.3 x86_64
I open and use a terminal (mintty) and every so often an
8~
or simply
~
will appear on the commandline.
Why does this happen and how do I prevent this from happening.
Found the cause.
I run a utility to keep my windows machine from going to sleep. In the background it creates an event for key-up for F15.
This has been transparent until using cywin.
If the utility that is causing this input is Caffeine sending a F15 key up event, you can prevent it from happening in two ways:
Prevent F15 from being interpreted on the mintty side: Add the following line to your mintty config file (e.g. ~/.minttyrc). It tells mintty to ignore F15 by itself or with the Ctrl modifier, which does the trick for me (by itself, it produces ~, and with Ctrl, ;5~):
KeyFunctions=F15:void;C+F15:void
Prevent Caffeine from sending F15 by running it with the -useshift option.
I guess the first way is preferrable, because it keeps all the benefits of using the F15 key up event.

IdeaVim edit multiple lines at the same time in PhpStorm

I have IdeaVim plugin installed and I'm having trouble editing multiple lines at the same time, but I have seen a few videos on web where people do it properly.
So I select a word using let's say v + e and then I do Alt + j (I'm using Ubuntu) to select multiple occurances in the document, and then if I press c, it edits only the first occurance and then just deletes the rest.
I tried loads of key combinations but cannot get it working. Is this not possible to do in IdeaVim? Do I have to toggle the plugin on and off to achieve this?
Working with multiple carets is not supported by IdeaVim (besides the Visual Block mode, Ctrl+V). Feel free to vote for this feature request VIM-780.
Note that you can achieve even better results for editing variable and function names in your code with the Rename refactoring ("Refactor | Rename..."). It will rename all the correct usages of the variable across multiple files.

Mapping numeric keypad keys in vim

I'm unable to get this mapping to work in vim inside an xterm terminal.
:map <k0> :echo 'Hello'<CR>
I can get the same mapping to work fine in gvim. If I issue the above command in vim on a terminal, it accepts it, and it shows up correctly when I type :map. But in normal mode, if I press the 0 keypad key, a "0" shows up on the status line, and then disappears with the next keypress.
I'm using the vim that came with Fedora 14 if that matters, and a plain xterm. The keypad keys work fine in insert mode, both with numlock on and off.
What am I missing?
Try to add this line to your ~/.Xdefaults:
xterm*appkeypadDefault: false
and relaunch xterm.
The "Application Keypad Mode" is likely the reason of your troubles.
But I don't think you should do what you are doing. In --NORMAL-- mode, numeric input is used to indicate "count" like in 4dd. Mapping numbers to other commands is going to get you into troubles fast.
You should add a xterm tag to your question.
There's some ambiguity in the question, which may indicate the actual problem. vim accepts that binding for k0 supposing that it is a function key.
Most keyboards that you'll see number function-keys starting at 1, and a few terminal descriptions equate function-key 1 to k0, a few equate it k0 to function-key 10. It's also possible that someone assumes that is part of the numeric keypad, but unlikely (since the keypad uses different character sequences than the function keys).
That's assuming you used a terminal description that knows about the function keys. The vt100 terminal description doesn't do that, since vt100's had no function keys (other than PF1 through PF4 which are or aren't depending who you talk to). But if you had TERM=vt100, then some of the numeric keypad could be recognized on the basis of the terminal description (see for instance the lengthy comment above the vt100+fnkeys description).
It's not in TERM=xterm, however.
What you're overlooking is that vim (helpfully perhaps) amends the terminal description using its built-in termcaps. It recognizes PF1, etc. using table entries like this:
{K_XF1, IF_EB("\033O*P", ESC_STR "O*P")},
{K_XF2, IF_EB("\033O*Q", ESC_STR "O*Q")},
{K_XF3, IF_EB("\033O*R", ESC_STR "O*R")},
{K_XF4, IF_EB("\033O*S", ESC_STR "O*S")},
But there are no entries for the numbered keys; there's no "\033O*p" for the 0 key.
If vim has (in the terminal description) the k0, and you haven't mapped it to anything, vim will treat it as a literal 0. The same happens with k1, etc., in effect treating the function-keys and numeric keypad as the same thing.
For what it's worth, GNU screen does the same thing, but also for the numbered keys. If I run vim inside screen, vim will see only the 0's. A literal 0 in vim doesn't do much in command-mode.

Resources