{"id":96,"date":"2010-11-07T05:56:57","date_gmt":"2010-11-07T10:56:57","guid":{"rendered":"http:\/\/wcarss.ca\/log\/?p=96"},"modified":"2010-11-07T05:56:57","modified_gmt":"2010-11-07T10:56:57","slug":"vim-tabs-for-ruby","status":"publish","type":"post","link":"https:\/\/wcarss.ca\/log\/2010\/11\/vim-tabs-for-ruby\/","title":{"rendered":"Vim tabs for Ruby"},"content":{"rendered":"<p>I&#8217;ve been annoyed time and time again by size-8 tabstops, mostly in when vim autoindents. In some languages, I&#8217;m happy to have ai on, but it&#8217;s frustrating to occasionally find a huge tab in my indents!<\/p>\n<p>The two things you need to set are tabstop and shiftwidth.<\/p>\n<p>:set tabstop=2<br \/>\n:set shiftwidth=2<\/p>\n<p>Now, vim does its autoindenting right.<\/p>\n<p>There&#8217;s also :set softtabstop .. but I can&#8217;t really tell what it does. I figured these things out from <a href=\"\">this place<\/a>, but it doesn&#8217;t quite seem to be right, as my softtabstop probably isn&#8217;t set to 2, but hitting tab only indents me 2 spaces.<\/p>\n<p>I also ran across the ability to just type :set and find out what things you&#8217;ve set up in vim at the moment; that&#8217;s kind of nice. It looks like it doesn&#8217;t deal with a lot of defaults, as I cannot find &#8220;softtabstop&#8221; in there, which is probably set, but not by any manual setting.<\/p>\n<p>So, I&#8217;ve typed these in.. how do I get them to stick forever? I&#8217;m going to put them in my vimrc. On a unix system, this would be in ~\/.vimrc, and on Windows, this should be in $HOME\/_vimrc or in $VIMRUNTIME\/_vimrc. Your HOME one will override your VIMRUNTIME one (the vimruntime one is probably somewhere like C:\\Program Files (x86)\\Vim7x\\_vimrc). <\/p>\n<p>You can go into them and just drop your set commands inside to make for nice indentation.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve been annoyed time and time again by size-8 tabstops, mostly in when vim autoindents. In some languages, I&#8217;m happy to have ai on, but it&#8217;s frustrating to occasionally find a huge tab in my indents! The two things you need to set are tabstop and shiftwidth. :set tabstop=2 :set shiftwidth=2 Now, vim does its [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/wcarss.ca\/log\/wp-json\/wp\/v2\/posts\/96"}],"collection":[{"href":"https:\/\/wcarss.ca\/log\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wcarss.ca\/log\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wcarss.ca\/log\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wcarss.ca\/log\/wp-json\/wp\/v2\/comments?post=96"}],"version-history":[{"count":1,"href":"https:\/\/wcarss.ca\/log\/wp-json\/wp\/v2\/posts\/96\/revisions"}],"predecessor-version":[{"id":118,"href":"https:\/\/wcarss.ca\/log\/wp-json\/wp\/v2\/posts\/96\/revisions\/118"}],"wp:attachment":[{"href":"https:\/\/wcarss.ca\/log\/wp-json\/wp\/v2\/media?parent=96"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wcarss.ca\/log\/wp-json\/wp\/v2\/categories?post=96"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wcarss.ca\/log\/wp-json\/wp\/v2\/tags?post=96"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}