0

Is is possible to use language mappings (such as those generated by the 'keymap' option or :lmap commands) in :substitute search-and-replace commands, the same way they get used in regular searches? If there is no builtin way are there any plugins that do this?

Language mappings in search: When you have langmaps active they are applied in "search mode", i.e. when you press /. This does not happen in the usual command mode.

3
  • 1
    In particular it is unclear to me how langmap are used in search. I believe langmap only impact normal mode and not command mode. Aug 24, 2022 at 13:02
  • 1
    @VivianDeSmedt You're talking about langmap option. But the question is about lmap command.
    – Matt
    Aug 24, 2022 at 16:29
  • Thanks @Matt, You are most probably right but the question should probably edited accordingly ;-) Aug 24, 2022 at 16:57

1 Answer 1

1

When switching to the command line mode (i.e. colon but not slash) the &imsearch option is forcefully reset "as you're expected to type command" as the help page says.

So you have to switch &keymap manually as needed using the same ctrl+6 as always. I see no sense in fighting against this behaviour using tricky autocommands. After all, most of the commands are indeed typed in Latin alphabet only.

2
  • Do you know if there is any way to trigger this automatically when I'm doing search-and-replace (e.g. at the same time as incsearch goes into effect?)
    – 0x539
    Aug 24, 2022 at 17:53
  • @0x539 As I said, you can play with autocommands, but it's not simply worth.
    – Matt
    Aug 24, 2022 at 18:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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