Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

"You can then flick back and forth between the tabs using :tabn and :tabp."

Also gt and gT, but I still like to map these to single-key shortcuts.

    map Y gt
    map T gT


Yes, gt and gT are the way to do this.

Admittedly I wouldn't personally recommend those mappings, because both already correspond to commands I use quite frequently. By default Y is synonym for yy, to yank a whole line, and T<char> moves back to the nearest instance of <char> on the current line. The first one I think people could live without, but the latter is kind of important for good vi.


It just might be me, but I always prefer multiple keys to pressing a dead key . After some time, my short finger cannot take it. For eg, I always use yy instead of Y.


Same here, but mine is

    nnoremap <Tab> gt
    nnoremap <S-Tab> gT
Normal mode tab switches through tabs. One (and two) key goodness.


That's a good one actually, I might switch over to that.


Unfortunately Tab is equivalent to ctrl-i, which I already use (jump forward in history list), so I can't use this in the end.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: