When trying to swap characters in certain modes, it struck me that I could not swap the character used after pressing f, such that fa actually jumps to the next b on the line. According to the vim documentation at :h f:

f{char}         To [count]'th occurrence of {char} to the right.  The
    cursor is placed on {char} |inclusive|.
    {char} can be entered as a digraph |digraph-arg|.
    When 'encoding' is set to Unicode, composing
    characters may be used, see |utf-8-char-arg|.
    |:lmap| mappings apply to {char}.  The CTRL-^ command
    in Insert mode can be used to switch this on/off

This made me think that :lmap a b should solve my problem. fa still jumps to the next a however, even after starting vim with vim -u NONE. Am I missing something here?

  • 2
    Did you enable it with <c-^> in Insert mode, or by setting 'iminsert'? Works for me, btw. – Antony Jan 4 '17 at 10:48
  • That's indeed the setting I missed. Thanks! If you make it an answer, I'll accept it. – Octaviour Jan 4 '17 at 11:13

You need to enable the language mapping with either <C-^> in Insert mode or with :set iminsert=1.

:h f
:h i_CTRL-^
:h 'iminsert'

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.