0

I want to map tab to the following button sequence: ctrl+x -> tab to a method call in .vimrc (in insert mode). The method is also in .vimrc

I kwow i should use inoremap <tab> button-sequence=method()<CR>

But how should I write the button sequence in the row above?

Thank you

Ozkan
  • 3,880
  • 9
  • 47
  • 78

1 Answers1

2

I'm not sure I understand your question but this is how you'd map <Tab> to execute function() in insert mode.

inoremap <Tab> :call function()<CR>

edit

I had to double check because I didn't know that <C-x><Tab> thing. It turns out that the real mapping is <C-x><C-i>: :h i_ctrl-x_ctrl-i. <Tab> and <C-i> represent the same character from the terminal's (and Vim's) standpoint.

So… this is what you want, even if mapping <Tab> to anything other than <Tab> in insert mode seems rather silly to me:

inoremap <Tab> <C-x><C-i>

See :h key-notation and :h mapping.

romainl
  • 186,200
  • 21
  • 280
  • 313
  • I also want to map `` to `ctrl-x + ` button combination. So in place of pushin ctrl-x and tab each time I want to only push tab. – Ozkan Jan 11 '13 at 13:41