{"id":116,"date":"2014-11-24T21:13:51","date_gmt":"2014-11-24T21:13:51","guid":{"rendered":"http:\/\/islascruz.org\/blog\/?p=116"},"modified":"2015-02-12T04:47:56","modified_gmt":"2015-02-12T10:47:56","slug":"vim-pro-tip-edit-the-current-buffer-in-a-new-tab","status":"publish","type":"post","link":"https:\/\/islascruz.org\/blog\/2014\/11\/24\/vim-pro-tip-edit-the-current-buffer-in-a-new-tab\/","title":{"rendered":"Vim Pro tip &#8211; Edit the current buffer in a new tab"},"content":{"rendered":"<p><a href=\"http:\/\/islascruz.org\/blog\/wp-content\/uploads\/2014\/11\/Vim_logo.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-119\" src=\"http:\/\/islascruz.org\/blog\/wp-content\/uploads\/2014\/11\/Vim_logo.png\" alt=\"Vim_logo\" width=\"688\" height=\"688\" \/><\/a><\/p>\n<p>Quite often I found in <a href=\"http:\/\/www.vim.org\/\" target=\"_blank\" rel=\"noopener\">vim<\/a> that I would like the current buffer in a new tab, I use a lot the vertical and horizontal splits in vim, then I reach the limit (my screen limit) for the vertical\/horizontal splits, this means: if I add a new vertical split the code looks ugly even if it respects the 80 columns width, or if add a new horizontal split there would be just too few lines that is not worth to keep the buffer.<\/p>\n<p>Then I used open a new tab, type<\/p>\n<pre><strong>:e<\/strong><\/pre>\n<p>then type the path to the buffer I like to edit. Until now, now I open a new tab, then type<\/p>\n<pre><strong>:ls<\/strong><\/pre>\n<p>check then number of the buffer I want in this new tab and then type<\/p>\n<pre><strong>:bX<\/strong><\/pre>\n<p>being &#8220;X&#8221; the number of the buffer, ej &#8220;<strong>:b2<\/strong>&#8220;. Another trick is to type<\/p>\n<pre><strong>:bn<\/strong><\/pre>\n<p>for the next buffer or<\/p>\n<pre><strong>:bp<\/strong><\/pre>\n<p>for the previous.<\/p>\n<div class=\"pvc_clear\"><\/div>\n<p id=\"pvc_stats_116\" class=\"pvc_stats all  \" data-element-id=\"116\" style=\"\"><i class=\"pvc-stats-icon medium\" aria-hidden=\"true\"><svg aria-hidden=\"true\" focusable=\"false\" data-prefix=\"far\" data-icon=\"chart-bar\" role=\"img\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 512 512\" class=\"svg-inline--fa fa-chart-bar fa-w-16 fa-2x\"><path fill=\"currentColor\" d=\"M396.8 352h22.4c6.4 0 12.8-6.4 12.8-12.8V108.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v230.4c0 6.4 6.4 12.8 12.8 12.8zm-192 0h22.4c6.4 0 12.8-6.4 12.8-12.8V140.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v198.4c0 6.4 6.4 12.8 12.8 12.8zm96 0h22.4c6.4 0 12.8-6.4 12.8-12.8V204.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v134.4c0 6.4 6.4 12.8 12.8 12.8zM496 400H48V80c0-8.84-7.16-16-16-16H16C7.16 64 0 71.16 0 80v336c0 17.67 14.33 32 32 32h464c8.84 0 16-7.16 16-16v-16c0-8.84-7.16-16-16-16zm-387.2-48h22.4c6.4 0 12.8-6.4 12.8-12.8v-70.4c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v70.4c0 6.4 6.4 12.8 12.8 12.8z\" class=\"\"><\/path><\/svg><\/i> <img loading=\"lazy\" decoding=\"async\" width=\"16\" height=\"16\" alt=\"Loading\" src=\"https:\/\/islascruz.org\/blog\/wp-content\/plugins\/page-views-count\/ajax-loader-2x.gif\" border=0 \/><\/p>\n<div class=\"pvc_clear\"><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Quite often I found in vim that I would like the current buffer in a new tab, I use a lot the vertical and horizontal splits in vim, then I reach the limit (my screen limit) for the vertical\/horizontal splits, this means: if I add a new vertical split the code looks ugly even if [&hellip;]<\/p>\n<div class=\"pvc_clear\"><\/div>\n<p id=\"pvc_stats_116\" class=\"pvc_stats all  \" data-element-id=\"116\" style=\"\"><i class=\"pvc-stats-icon medium\" aria-hidden=\"true\"><svg aria-hidden=\"true\" focusable=\"false\" data-prefix=\"far\" data-icon=\"chart-bar\" role=\"img\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 512 512\" class=\"svg-inline--fa fa-chart-bar fa-w-16 fa-2x\"><path fill=\"currentColor\" d=\"M396.8 352h22.4c6.4 0 12.8-6.4 12.8-12.8V108.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v230.4c0 6.4 6.4 12.8 12.8 12.8zm-192 0h22.4c6.4 0 12.8-6.4 12.8-12.8V140.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v198.4c0 6.4 6.4 12.8 12.8 12.8zm96 0h22.4c6.4 0 12.8-6.4 12.8-12.8V204.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v134.4c0 6.4 6.4 12.8 12.8 12.8zM496 400H48V80c0-8.84-7.16-16-16-16H16C7.16 64 0 71.16 0 80v336c0 17.67 14.33 32 32 32h464c8.84 0 16-7.16 16-16v-16c0-8.84-7.16-16-16-16zm-387.2-48h22.4c6.4 0 12.8-6.4 12.8-12.8v-70.4c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v70.4c0 6.4 6.4 12.8 12.8 12.8z\" class=\"\"><\/path><\/svg><\/i> <img loading=\"lazy\" decoding=\"async\" width=\"16\" height=\"16\" alt=\"Loading\" src=\"https:\/\/islascruz.org\/blog\/wp-content\/plugins\/page-views-count\/ajax-loader-2x.gif\" border=0 \/><\/p>\n<div class=\"pvc_clear\"><\/div>\n","protected":false},"author":1,"featured_media":119,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[14],"tags":[34,33],"class_list":["post-116","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-programming","tag-tips","tag-vim"],"brizy_media":[],"_links":{"self":[{"href":"https:\/\/islascruz.org\/blog\/wp-json\/wp\/v2\/posts\/116","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/islascruz.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/islascruz.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/islascruz.org\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/islascruz.org\/blog\/wp-json\/wp\/v2\/comments?post=116"}],"version-history":[{"count":4,"href":"https:\/\/islascruz.org\/blog\/wp-json\/wp\/v2\/posts\/116\/revisions"}],"predecessor-version":[{"id":121,"href":"https:\/\/islascruz.org\/blog\/wp-json\/wp\/v2\/posts\/116\/revisions\/121"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/islascruz.org\/blog\/wp-json\/wp\/v2\/media\/119"}],"wp:attachment":[{"href":"https:\/\/islascruz.org\/blog\/wp-json\/wp\/v2\/media?parent=116"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/islascruz.org\/blog\/wp-json\/wp\/v2\/categories?post=116"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/islascruz.org\/blog\/wp-json\/wp\/v2\/tags?post=116"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}