{"data":{"markdownRemark":{"html":"<p>This tutorial will show you how to work with multiple tabs open within one VIM session. If you're not so sure with VIM just yet, then go check out our VIM tutorial on the\nSysadmin learning path here (TODO create sysadmin learning path/VIM)</p>\n<p>As a Sysadmin or Developer you will need to work with VIM very often, its a text editor at its core, but capable of so much more. On this site, you will find many VIM tutorials as we believe its one of critical tools you will need to master Linux from the beginning. (Yes we know about Emacs, but don't care about it, get over it) So lets get to it ...</p>\n<p>The only things its necessary to understand for now is that VIM has multiple \"modes\" it can operate it. For the purposes of this tutorial there are two modes we care about,</p>\n<ul>\n<li>\"escape mode\" - this is not the official name for this mode, but its easy to remember as escape mode, because to access it, you press <code class=\"language-text\">ESC</code> on your keyboard</li>\n<li>\"insert mode\" - this mode allows you to insert text into your document, there are a few ways to enter insert mode, however for now, we just need to press <code class=\"language-text\">i</code> on your keyboard, while in 'escape mode'.</li>\n</ul>\n<p>So remember ... <code class=\"language-text\">ESC</code> and <code class=\"language-text\">i</code>, and keep in mind, when you see any examples below written as <code class=\"language-text\">&lt;&lt;filename_here&gt;&gt;</code>, dont actually put <code class=\"language-text\">&lt;&lt;filename_here&gt;&gt;</code> but replace it with your actual filename you want to use. Unfortunately this is necessary to point out.</p>\n<p>\n  <a\n    class=\"gatsby-resp-image-link\"\n    href=\"/static/photo-1507915600431-5292809c5ab7-9dd5589acc559d83b4787647adf486f4-4f3fd.jpg\"\n    style=\"display: block\"\n    target=\"_blank\"\n    rel=\"noopener\"\n  >\n  \n  <span\n    class=\"gatsby-resp-image-wrapper\"\n    style=\"position: relative; display: block;  max-width: 710px; margin-left: auto; margin-right: auto;\"\n  >\n    <span\n      class=\"gatsby-resp-image-background-image\"\n      style=\"padding-bottom: 66.68375192209123%; position: relative; bottom: 0; left: 0; background-image: url('data:image/jpeg;base64,/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wgARCAANABQDASIAAhEBAxEB/8QAGQAAAgMBAAAAAAAAAAAAAAAAAAMBAgQF/8QAFQEBAQAAAAAAAAAAAAAAAAAAAAH/2gAMAwEAAhADEAAAAeXF0StMwf/EABsQAAEEAwAAAAAAAAAAAAAAAAABAhAREiFB/9oACAEBAAEFAuRiO0Wp/8QAFBEBAAAAAAAAAAAAAAAAAAAAEP/aAAgBAwEBPwE//8QAFBEBAAAAAAAAAAAAAAAAAAAAEP/aAAgBAgEBPwE//8QAFxAAAwEAAAAAAAAAAAAAAAAAAAExEP/aAAgBAQAGPwJZRUuf/8QAGhAAAwEAAwAAAAAAAAAAAAAAAAExEVFhof/aAAgBAQABPyFeRFTQ0hxyahjuZ//aAAwDAQACAAMAAAAQeM//xAAUEQEAAAAAAAAAAAAAAAAAAAAQ/9oACAEDAQE/ED//xAAXEQEAAwAAAAAAAAAAAAAAAAAAAREx/9oACAECAQE/EJ1T/8QAHhAAAgEEAwEAAAAAAAAAAAAAAREAITGR0UFRYfH/2gAIAQEAAT8QQXQU5GoizEAajK7EEQIIfFIFVHpz7U//2Q=='); background-size: cover; display: block;\"\n    >\n      <img\n        class=\"gatsby-resp-image-image\"\n        style=\"width: 100%; height: 100%; margin: 0; vertical-align: middle; position: absolute; top: 0; left: 0; box-shadow: inset 0px 0px 0px 400px white;\"\n        alt=\"test\"\n        title=\"\"\n        src=\"/static/photo-1507915600431-5292809c5ab7-9dd5589acc559d83b4787647adf486f4-8b432.jpg\"\n        srcset=\"/static/photo-1507915600431-5292809c5ab7-9dd5589acc559d83b4787647adf486f4-81942.jpg 178w,\n/static/photo-1507915600431-5292809c5ab7-9dd5589acc559d83b4787647adf486f4-60db8.jpg 355w,\n/static/photo-1507915600431-5292809c5ab7-9dd5589acc559d83b4787647adf486f4-8b432.jpg 710w,\n/static/photo-1507915600431-5292809c5ab7-9dd5589acc559d83b4787647adf486f4-9f4c5.jpg 1065w,\n/static/photo-1507915600431-5292809c5ab7-9dd5589acc559d83b4787647adf486f4-9a880.jpg 1420w,\n/static/photo-1507915600431-5292809c5ab7-9dd5589acc559d83b4787647adf486f4-4f3fd.jpg 1951w\"\n        sizes=\"(max-width: 710px) 100vw, 710px\"\n      />\n    </span>\n  </span>\n  \n  </a>\n    </p>\n<p>First of all open any existing file on your system in VIM, we will use <code class=\"language-text\">/etc/hosts</code> as an example here</p>\n<p><code class=\"language-text\">vim /etc/hosts</code></p>\n<p>VIM is open, and displaying the /etc/hosts file</p>\n<p>\n  <a\n    class=\"gatsby-resp-image-link\"\n    href=\"/static/hosts-72c045f3e8a44736649c0d75eae74267-71443.jpg\"\n    style=\"display: block\"\n    target=\"_blank\"\n    rel=\"noopener\"\n  >\n  \n  <span\n    class=\"gatsby-resp-image-wrapper\"\n    style=\"position: relative; display: block;  max-width: 710px; margin-left: auto; margin-right: auto;\"\n  >\n    <span\n      class=\"gatsby-resp-image-background-image\"\n      style=\"padding-bottom: 76.08%; position: relative; bottom: 0; left: 0; background-image: url('data:image/jpeg;base64,/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wgARCAAPABQDASIAAhEBAxEB/8QAFgABAQEAAAAAAAAAAAAAAAAAAgAF/8QAFAEBAAAAAAAAAAAAAAAAAAAAAP/aAAwDAQACEAMQAAABwS4E4//EABgQAAMBAQAAAAAAAAAAAAAAAAABEhAR/9oACAEBAAEFAu7LJZLP/8QAFBEBAAAAAAAAAAAAAAAAAAAAEP/aAAgBAwEBPwE//8QAFBEBAAAAAAAAAAAAAAAAAAAAEP/aAAgBAgEBPwE//8QAFBABAAAAAAAAAAAAAAAAAAAAIP/aAAgBAQAGPwJf/8QAFxABAQEBAAAAAAAAAAAAAAAAAGEQEf/aAAgBAQABPyHrZppv/9oADAMBAAIAAwAAABAAD//EABURAQEAAAAAAAAAAAAAAAAAABAR/9oACAEDAQE/EIf/xAAUEQEAAAAAAAAAAAAAAAAAAAAQ/9oACAECAQE/ED//xAAZEAEAAgMAAAAAAAAAAAAAAAABAPAQQZH/2gAIAQEAAT8QW29zSkvSXpP/2Q=='); background-size: cover; display: block;\"\n    >\n      <img\n        class=\"gatsby-resp-image-image\"\n        style=\"width: 100%; height: 100%; margin: 0; vertical-align: middle; position: absolute; top: 0; left: 0; box-shadow: inset 0px 0px 0px 400px white;\"\n        alt=\"hosts\"\n        title=\"\"\n        src=\"/static/hosts-72c045f3e8a44736649c0d75eae74267-8b432.jpg\"\n        srcset=\"/static/hosts-72c045f3e8a44736649c0d75eae74267-81942.jpg 178w,\n/static/hosts-72c045f3e8a44736649c0d75eae74267-60db8.jpg 355w,\n/static/hosts-72c045f3e8a44736649c0d75eae74267-8b432.jpg 710w,\n/static/hosts-72c045f3e8a44736649c0d75eae74267-9f4c5.jpg 1065w,\n/static/hosts-72c045f3e8a44736649c0d75eae74267-71443.jpg 1250w\"\n        sizes=\"(max-width: 710px) 100vw, 710px\"\n      />\n    </span>\n  </span>\n  \n  </a>\n    </p>\n<p>so lets open some more tabs shall we...</p>\n<p>enter escape mode, by pressing <code class=\"language-text\">ESC</code>, then enter the following instruction to VIM,</p>\n<blockquote>\n<p>👍 you can press the <code class=\"language-text\">TAB</code> key after typing <code class=\"language-text\">:tabedit</code> to show a file selector</p>\n</blockquote>\n<p><code class=\"language-text\">:tabedit &lt;&lt;filename_here&gt;&gt;</code></p>\n<p>for example, I will open a document called SeanTest.doc like this,</p>\n<p><code class=\"language-text\">:tabedit ./Downloads/SeanTest.doc</code></p>\n<p>and we can see now there are two tabs open in VIM...</p>\n<p>\n  <a\n    class=\"gatsby-resp-image-link\"\n    href=\"/static/tabs-42d88790969bccf9cd7bb002542db055-f8452.png\"\n    style=\"display: block\"\n    target=\"_blank\"\n    rel=\"noopener\"\n  >\n  \n  <span\n    class=\"gatsby-resp-image-wrapper\"\n    style=\"position: relative; display: block;  max-width: 710px; margin-left: auto; margin-right: auto;\"\n  >\n    <span\n      class=\"gatsby-resp-image-background-image\"\n      style=\"padding-bottom: 73.568281938326%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAPCAIAAABr+ngCAAAACXBIWXMAAA7DAAAOwwHHb6hkAAABDElEQVQoz52SP0/DMBDF/S8mF8eO6hqrVFGo0oKEFEAqa9ooC+2HYGVCQh1AYmfhY3Nylk4h5udb3z2/uyPfq5u3an263rxX61d39WLs1+r25/7p1Gw/m+3HaJHHS3+3XDZl+VBVG+cWAJ5xwxghhJK/yLSZO6eLQqapkBKLJ4gUlHFKx4tcJIn3fuG90TpXCrBFsJ1KWZZ1XWutOecsSpkBWGtTACEEpZREgW5u7uxsJgQnsaCbNgbNASBajCGNMXme47f/I0ZnnDOLDTxkljJsVibxzpQW4dvYZRjBwCSxUgo3rFSG+nAmOU5O4p2FnY9DIMMHZ14xybuu2wX2u33btn3fH4+Hw/MkfgF71ijMLbTvkQAAAABJRU5ErkJggg=='); background-size: cover; display: block;\"\n    >\n      <img\n        class=\"gatsby-resp-image-image\"\n        style=\"width: 100%; height: 100%; margin: 0; vertical-align: middle; position: absolute; top: 0; left: 0; box-shadow: inset 0px 0px 0px 400px white;\"\n        alt=\"tabs\"\n        title=\"\"\n        src=\"/static/tabs-42d88790969bccf9cd7bb002542db055-09ff3.png\"\n        srcset=\"/static/tabs-42d88790969bccf9cd7bb002542db055-2279c.png 178w,\n/static/tabs-42d88790969bccf9cd7bb002542db055-dbe09.png 355w,\n/static/tabs-42d88790969bccf9cd7bb002542db055-09ff3.png 710w,\n/static/tabs-42d88790969bccf9cd7bb002542db055-393d8.png 1065w,\n/static/tabs-42d88790969bccf9cd7bb002542db055-f8452.png 1362w\"\n        sizes=\"(max-width: 710px) 100vw, 710px\"\n      />\n    </span>\n  </span>\n  \n  </a>\n    </p>\n<p>I opened a few more tabs just for fun,</p>\n<p>you can repeat this as many times as you like, open all the files!</p>\n<h3 id=\"ok-cool-so-how-to-work-with-these-tabs\"><a href=\"#ok-cool-so-how-to-work-with-these-tabs\" aria-hidden=\"true\" class=\"anchor\"><svg aria-hidden=\"true\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Ok cool, So how to work with these tabs?</h3>\n<p>Heres a quick way to find out your options to work with tabs in VIM ...</p>\n<p>go to escape mode, and type\n<code class=\"language-text\">:tab</code> .. and then press the <code class=\"language-text\">TAB</code> key on your keyboard, you will see something like this...</p>\n<p>\n  <a\n    class=\"gatsby-resp-image-link\"\n    href=\"/static/tabopts-cd908645d918b188d06b6bcf8381b2b4-32f58.png\"\n    style=\"display: block\"\n    target=\"_blank\"\n    rel=\"noopener\"\n  >\n  \n  <span\n    class=\"gatsby-resp-image-wrapper\"\n    style=\"position: relative; display: block;  max-width: 710px; margin-left: auto; margin-right: auto;\"\n  >\n    <span\n      class=\"gatsby-resp-image-background-image\"\n      style=\"padding-bottom: 17.340286831812257%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAADCAIAAAAcOLh5AAAACXBIWXMAAA7DAAAOwwHHb6hkAAAARUlEQVQI15XLUQrAMAgDUEUsSE+iEe39T7eNbrDfvq8EEhIRMxtDmZmI+MSznnOqvucz3e3uCCRQVatX5h0REfj8867bBZIFCsEDbdTvAAAAAElFTkSuQmCC'); background-size: cover; display: block;\"\n    >\n      <img\n        class=\"gatsby-resp-image-image\"\n        style=\"width: 100%; height: 100%; margin: 0; vertical-align: middle; position: absolute; top: 0; left: 0; box-shadow: inset 0px 0px 0px 400px white;\"\n        alt=\"tabopts\"\n        title=\"\"\n        src=\"/static/tabopts-cd908645d918b188d06b6bcf8381b2b4-09ff3.png\"\n        srcset=\"/static/tabopts-cd908645d918b188d06b6bcf8381b2b4-2279c.png 178w,\n/static/tabopts-cd908645d918b188d06b6bcf8381b2b4-dbe09.png 355w,\n/static/tabopts-cd908645d918b188d06b6bcf8381b2b4-09ff3.png 710w,\n/static/tabopts-cd908645d918b188d06b6bcf8381b2b4-393d8.png 1065w,\n/static/tabopts-cd908645d918b188d06b6bcf8381b2b4-3667d.png 1420w,\n/static/tabopts-cd908645d918b188d06b6bcf8381b2b4-32f58.png 1534w\"\n        sizes=\"(max-width: 710px) 100vw, 710px\"\n      />\n    </span>\n  </span>\n  \n  </a>\n    </p>\n<p>So, lets do a quick walkthrough of the most commonly used ones,</p>\n<ul>\n<li><code class=\"language-text\">:tabNext</code> and <code class=\"language-text\">:tabnext</code> will take you to the next tab</li>\n<li><code class=\"language-text\">:tabprevious</code> will you take you to the previous tab</li>\n<li><code class=\"language-text\">:tabs</code> will show you a list of all open tabs</li>\n<li><code class=\"language-text\">:tabclose!</code> will close the current tab</li>\n</ul>\n<blockquote>\n<p>👍 you can also use</p>\n<p> <code class=\"language-text\">g</code> <code class=\"language-text\">t</code> in escape mode instead of typing <code class=\"language-text\">:tabnext</code></p>\n<p><code class=\"language-text\">g</code> <code class=\"language-text\">T</code> instead of <code class=\"language-text\">:tabprevious</code></p>\n</blockquote>\n<p>That's how to work with multiple tabs in VIM, if you have any questions or comments, please feel free to leave them below.</p>\n<p>If Sean Helped You today, feel free to share this post or connect with us soon, available via <a href=\"mailto:seanwillhelpyou@gmail.com\">gmail</a>, <a href=\"https://app.slack.com/client/TLMMVFQ1X/CLVTNC1MM\">slack</a> or <a href=\"https://github.com/RH-sdavey/sean-will-help-you\">github</a>.\nThanks for reading!</p>","timeToRead":3,"excerpt":"This tutorial will show you how to work with multiple tabs open within one VIM session. If you're not so sure with VIM just yet, then go…","frontmatter":{"title":"How to work with tabs in VIM","cover":"https://picsum.photos/id/308/2500/1000","date":"2019-04-01","category":"VIM","tags":["Vim","Swhy"],"author":"Endless"},"fields":{"slug":"/how-to-work-with-tabs-in-vim"}},"prev":{"excerpt":"After changes to the NTP configuration file (usually ntp.conf) the NTP service needs to be restarted. Lets find…","frontmatter":{"title":"How to restart Linux NTPD service","cover":"https://picsum.photos/id/357/2500/1000","date":"2019-05-02"},"fields":{"slug":"/how-to-restart-linux-ntpd-service"}},"next":{"excerpt":"Lets have a look at a very important file for any sysadmin of a Linux machine, /etc/passwd Why is this file so…","frontmatter":{"title":"How to read the /etc/passwd file on Linux","cover":"https://picsum.photos/id/336/2500/1000","date":"2019-03-17"},"fields":{"slug":"/how-to-read-the-etc-passwd-file-on-linux"}},"authors":{"edges":[{"node":{"uid":"Endless","name":"Endless","image":"https://api.adorable.io/avatars/285/pwpwpw.png","url":"https://github.com/RH-sdavey/sean-will-help-you","bio":"Endless Will Help You"}},{"node":{"uid":"Weez","name":"Salloweezy","image":"https://api.adorable.io/avatars/124/weezzzy.png","url":"http://gatsbyjs.org/","bio":"."}},{"node":{"uid":"Sean","name":"Sean","image":"https://api.adorable.io/avatars/124/weez.png","url":"https://github.com/RH-sdavey/sean-will-help-you","bio":"SEAN User created for SWHY"}},{"node":{"uid":"casper","name":"Casper User","image":"https://api.adorable.io/avatars/124/seasz.png","url":"http://gatsbyjs.org/","bio":"Yeah, I like animals better than people sometimes... Especially dogs. Dogs are the best. Every time you come home, they act like they haven't seen you in a year. And the good thing about dogs... is they got different dogs for different people."}},{"node":{"uid":"guinevere","name":"Guinevere Kuiper","image":"https://api.adorable.io/avatars/282/seaszss.png","url":"https://randomuser.me/api/?seed=user1","bio":"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam laoreet lorem nec ligula aliquet, porta blandit augue luctus. Vivamus ac quam diam. Sed vestibulum pharetra hendrerit."}}]}},"pageContext":{"slug":"/how-to-work-with-tabs-in-vim","total":12,"prev":"/how-to-restart-linux-ntpd-service","next":"/how-to-read-the-etc-passwd-file-on-linux"}}