开发者

Vim: Map Cmd-Alt-j to tabprevious?

I'm having a heck-of-a time with this. I've started using tabs more in MacVim and I'm trying t开发者_Python百科o make a mapping of Cmd+Alt+j and Cmd+Alt+k to move back and forth between tabs. Similar to using Cmd+Alt+Left or Right in Textmate, but without having to leave the home row.

When I try the following, it just simply doesn't work:

nnoremap <D-M-j> :tabprevious<CR>
nnoremap <D-M-k> :tabnext<CR>

Furthermore, if I try to type the actual keystroke into my gvimrc, I get instead a <D-M-(delta symbol)> or a <D-M-(degree symbol)> instead.

Is there some secret I'm missing, or something stupid I'm doing?


set macmeta will make your <M-D-j> binding work.


Do this :

nnoremap <D-M-j> gt To go to the next tab

nnoremap <D-M-k> gT To go to the previous tab

you can extend this by using this to switch buffers as well by replace in gt and gT with :bn<cr> and :bp<cr> respectively

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜