Hacker News new | past | comments | ask | show | jobs | submit login

Vim's tabs are not the same as TextMate tabs: they are workspaces, not 1-to-1 proxies for files. Don't try to use them like in other editors, it's an exercice in futility.

You can make use of command-line completion:

    :b <Tab>
which does partial words too:

    :b js<Tab> completes with teh name of your JS file
You can make command-line completion even faster:

    set wildcharm=<C-z>
    nnoremap <leader>b :b <C-z>
You can try quick, generic, mappings:

    nnoremap <PageUp> :bnext<CR>
    nnoremap <PageDown> :bprevious<CR>
You can try more precise ones:

    nnoremap <leader>1 :b1<CR>
    nnoremap <leader>2 :b2<CR>
    nnoremap <leader>3 :b3<CR>
    ...
to mimic TextMate.

You can try listing and choosing in one move:

    nnoremap gb :buffers<CR>:b<Space>
You can try the builtin Ctrl+^:

    3<C-^> is equivalent to :b3<CR>
You can remap it if you want:

    nnoremap & <C-^>
and do:

    1&



Join us for AI Startup School this June 16-17 in San Francisco!

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

Search: