I am considering attaching a macro to the space bar to insert a space.
My question is whether this will change its normal mode behavior. For example, if I type 23<space>
will it execute the macro 23 times or do the normal thing (move forward 23 spaces)?
I want to keep the old functionality for repetitive actions because the space navigation goes past end of line but 'L' navigation does not.
Just to clarify, this is the behavior I am envisioning:
- typing "400< space bar >" moves forward 400 characters including past end of line
hitting the bar inserts one space in normal mode, ie:
:nnoremap <space> i<space><esc>
Not sure if it possible to achieve both these objectives. If it is not possible, then maybe the best option is to change the normal space bar behavior to a different key, since I very rarely use the space bar for navigation. Maybe Shift+Spacebar for movement?
{0-9a-zA-Z"}
not inspace
. To change the behavior of the space bar in insert mode you can remap it withinoremap <Space> [...]
is that what you are talking about? If so the answer isinoremap
will change the behavior of the space bar only in insert mode, whilennoremap
will change the behavior in normal mode.:echo
(or any other command) and then pressingSpace
you want the space bar to do something else than inserting only one space?< C-Space>
for example.