Loading ...
Sorry, an error occurred while loading the content.

114183Re: Which is the best way of doing some mapping reuse?

Expand Messages
  • John Little
    May 2 5:16 AM
    • 0 Attachment
      On May 2, 10:45 pm, Raúl Núñez de Arenas Coronado <raul...@...>
      > First one is copying and pasting the map...

      How about a level of indirection using :exe :

      let mapped = "<silent><buffer> <LocalLeader>KEY "
      let mapping = "m'gg\"+yG\""
      exe 'nnoremap ' . mapped . mapping
      exe 'inoremap ' . mapped . '<esc>' . mapping . 'i'

      I don't know how usable this is, I just checked :map output to see
      that the mappings had been made.

      You could extend this to a general function, f. ex.
      call Makemaps(mapped, mapping, modes)

      Regards, John

      You received this message from the "vim_use" maillist.
      Do not top-post! Type your reply below the text you are replying to.
      For more information, visit http://www.vim.org/maillist.php
    • Show all 3 messages in this topic