1

I have a frustrating problem with the firefox pluign vimperator. When I'm switching tabs with cntrl + n, if a tab that has focus on a field is open along the way from the current tab to the target tab, this opens firefox in a new window. How can I take focus away from all fields when I switch tabs in vimperator?

2 Answers 2

2

(Sorry I have to do a new answer, because it's too long for a comment.)

I have my keyboard mappings customized beyond recognition, but I use gt/gT or Ctrl-Tab to cycle through tabs. But the main thing I have trouble duplicating is that if I switch out of a tab while in insert mode and then switch back to it, I don't switch back into insert mode. I wonder if you have some setting that is making it focus the first text field automatically or something. (E.g., nofocuscontent.)

Anyway,

:help map

should give you the basics in mappings. You might do

:nmap <C-n> gt<Esc>

or possibly

:nmap <C-n> :tabnext<CR><Esc>

or put it in your .vimperatorrc to remap it automatically on load; there you can leave out the opening ':' . (Replace gt/:tabnext with gT or :tabprev for <C-p>, etc.)

You might even solve your problem just by unmapping or remapping <C-n> in insert mode to prevent it from opening a new window (unless you like that feature).

:imap <C-n> <Nop>

will make ctrl-N do nothing in insert mode, or you could make it move tabs too:

:imap <C-n> <Esc>gt<Esc>

or some such.

1

This is hard to test, because I'm having trouble duplicating the problem (Ctrl-N does not switch tabs for me, etc.) Have you tried:

:set focuscontent

?

(See :help focuscontent for more info.)

If that doesn't work, you might just consider remapping Ctrl-N to gt<Esc>.

1
  • Hi, thanks for the response. How would I go about mapping that? cntrl-N, cntrl-P don't switch tabs for you?
    – James
    Commented Aug 25, 2010 at 7:11

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .