What are non character keys called? - keyboard

What would be the proper term for a key on a keyboard that are not a char but have an affect on a text-field?
backspace
arrow keys
delete
etc..

Related

Is there any difference between hjkl and arrow keys?

Besides their position and hand movement required, is there any difference between using hjkl and the arrow keys? Can I use either one interchangeably and expect the same behavior? The only difference I can think of is that the arrow keys work in insert mode so you save strokes if you need to move 1-2 chars.
Note: I use an alternate keyboard layout and the hjkl keys are mixed up. I have a programmable layer on my keyboard and wondering whether it should have hjkl or the arrow keys. I'd prefer to use the arrow keys since they can be used in all programs.
Arrow keys vs. h,j,k,l
You are correct in your assessment. They are equivalent, except that the arrow keys also work in insert mode.
(The same is true in a couple of other places, for instance you can use left/right arrows to move around within a command or search/replace you are typing, but you cannot use hjkl for movement in those cases.)
There is one other difference, I suppose - since they are separate keys, they can be mapped to separate things. So if you remap h for instance, it would not affect the function of <Left>, and vice-versa.
Other keys
You asked about some other keys in the comments.
X - Bkspc, x - Delete, 0 - Home, $ - End, R - Insert
Some are equivalent, but not all of these.
x, X, backspace, delete
x and <Del> are equivalent, and even share the exact same node in the help text. Both of them delete characters under and after the cursor.
X and <BS> both delete characters to the left of the cursor. But in different modes: X does so in normal mode, and <BS> does so in insert mode. If you are in normal mode, <BS> just goes backward by one character without changing the text (so it behaves like h).
0, $, Home, End
These are interchangeable.
R, Insert
These do not do the same thing. <Insert> works like i, and inserts. R enters insert mode, but in a special way where it overwrites characters rather than inserting before them.

mapping of control and shift key not working in vim

I tried to map Ctrl and Shift key with spacebar in VIM (not GVIM) normal mode, but seems to be not working for me , Here are my mappings :
nmap <C-Space> :nohlsearch<CR>
nmap <S-Space> :w<CR>
Other keys got mapped in normal mode & getting expected results but Ctrl & Shift doesn't mapping with other keys. Could anyone know this reason ? .
Thanks.
Control (Ctrl) and Shift are modifier keys. Unless you have radically changed your keyboard configuration, those keys do nothing unless you press at the same time a non-modifier key. Likewise, pressing two modifiers at the same time without a non-modifier key does nothing.
That said, most of the keys on a terminal can be modified. Due to the way things evolved back in the 1970s / 1980s, not all of the modified keys differ. For instance, it is common to have both of these sending an ASCII NUL (0):
control space
control #
That is because originally the control key acted to suppress all but the low-order 5 bits of an 8-bit character. Space is 32, and # is 64 in ASCII.
Further reading:
ASCII Table and Description

How to map reparted sequence in VIM?

I want to map 'space+u' as 'Ctrl+u', I have this at my config:
nnoremap <space>u <C-u>
But it isn't work as Ctrl+u. When I press 'space+u', firstly it works fine, but when I press 'u' second time - it works an 'undo' (I'm holding 'space' since first time). I want to make it works as , when I press 'Ctrl', hold it and can hit 'u' any times I want.
What can I do?
The mapping you made means "space first, then u in succession". Not simultaneous action there, which explains the behavior for subsequent calls.
Vim listens to key press events; the system reports it that this-and-that key was typed, with that-and-that modifier (ctrl, super). Few applications would understand to check arbitrary combinations of keys being held (outside of games).
For this sort of hacks there is an established project for Linux systems called https://github.com/alols/xcape. In combination of xcape and xmodmap you can basically map <space> as a modifier key like less used Hyper key (this is the part for xmodmap). Then you would use xcape to make sure that pressing space in isolation would result in a space character. People have used xcape to map return as a right Ctrl key (while Caps Lock would act as the left Ctrl).

Show pressed keys in VIM normal mode statusline

I use VIM, the Colemak keyboard layout, and a Microsoft Natural 4000 keyboard. Since the Natural 4000 has differently-shaped keys, I could not change the keycaps. This means each key is labeled with an "incorrect" key -- I press the key that says "O" and it types "Y".
That's fine in normal use, because I touch-type smoothly with Colemak and don't make many typos. But with VIM it presents a bit of a problem, because I often need to hit a key "out of sequence" -- i.e, just suddenly hit "g" without any context. For some reason that's harder to do, and I keep hitting the wrong keys.
I'd like to be able to hit a prefix key (say, the leader key twice -- \) and then have any further keys I hit within 1-2 seconds shown on the status line.
This way, I could quickly hit \ and then tap a key or two, and see what key it "really" is.
Any ideas how I could make that happen?
Try set this
:set showcmd
It displays your keystrokes in statusline as you enter them, without any need for a prefix key.
you can also turn it off by using below command in normal mode of vim (pressing Esc key).
:set noshowcmd

How do you map Command/Apple option in vim

I am going through this document and this is what I gathered.
<Esc> Escape key
<C-G> CTRL-G
<Up> cursor up key
<C-LeftMouse> Control- left mouse click
<S-F11> Shifted function key 11
<M-a> Meta- a ('a' with bit 8 set)
<M-A> Meta- A ('A' with bit 8 set)
<t_kd> "kd" termcap entry (cursor down key)
However I don't see how I can map Command/Apple key here. I am using plugin mentioned here. It works great. I open a tab and then I hit Command-R and I get the list of files. I could not find where the mapping is done between Command-R and the function. I am using vim settings as mentioned here
the modifier "D" stands for the "Command" key
Or T- in gvim, but it doesn't work with all keys, e. g. not with letters. T-CR, T-F5 or T-DELETE are OK though. Availability could be checked with ^K or ^V

Resources