sponsor Vim development Vim logo Vim Book Ad

basic Tip #1223: Move current buffer to a new tab

 tip karma   Rating 15/9, Viewed by 1851 

Read and edit this tip on the Vim tip wiki. The wiki may have a more recent version of this tip.

created:   May 9, 2006 11:19      complexity:   basic
author:   Clayton Smith      as of Vim:  

function MoveToTab()
    let l:current = bufnr('%')
    close
    tabnew
    exe "b ". l:current
endfunction
map to :call MoveToTab()<CR>

 rate this tip  Life Changing Helpful Unfulfilling 

<< Alternative tab navigation | Toggle Spellcheck with Function Keys >>

Additional Notes

elien122@netian.com, May 9, 2006 12:18
i think this can be condensed into  :tab sp<CR>
Anonymous, May 9, 2006 12:36
this closes the current buffer then reopens it in a tab, that just creates a new tab with the buffer.
Anonymous, May 9, 2006 19:51
Alternative way to move current window to a new tab is: <Ctrl-w> T (capital)   :)
Anonymous, May 25, 2006 1:22
When you use :tab ball - it makes out of all buffers a tab
If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
   
Sponsored by Web Concept Group Inc. SourceForge.net Logo