I have swapped my number keys with their symbols, because the symbols occur much more frequently than numbers in many programming languages, like C or Haskell. You can see my key-swap function in my .vimrc file.
For the sake of examples, say
( are swapped.
There is one part I'm stumped in though. I currently use
cmap to cover most cases. However, some commands, like
f aren't covered. For example, f followed by 9 doesn't do
I know that
lmap takes care of this, and that's true. However, using
lmap (in conjunction with
iminsert=1) creates another problem: macros stop working.
For example, take the following line:
Stuff 9 other ( things
And the following key strokes: q q f 9 x q
While recording this macro, effectively
f(x is executed, which is the intended behavior. However, if I run this macro again (for example undo and rerun on same line, or just on another similar line), then what actually gets executed is
"qp I can see that the macro has recorded
f9x, which is fine, but it means that when playing the macro, the mapping is not taking into effect.
Note that I don't have this problem with
/ for example. As in, I can do (in a macro) / 9 to get
/( with the macro recording
/9 and when I replay the macro I correctly see
/( being executed.
So, what's wrong here? Why do macros respect the mapping with
/ but not with
f, and how can I get them to work correctly?
P.S. Possibly relevant information: I use