{"id":2067,"date":"2014-03-13T15:49:21","date_gmt":"2014-03-13T22:49:21","guid":{"rendered":"http:\/\/arcanius.silverfir.net\/blog\/?p=2067"},"modified":"2014-03-13T15:51:09","modified_gmt":"2014-03-13T22:51:09","slug":"screen-and-vim-with-256-colors","status":"publish","type":"post","link":"https:\/\/arcanius.silverfir.net\/blog\/screen-and-vim-with-256-colors\/","title":{"rendered":"Screen and Vim with 256 colors"},"content":{"rendered":"<p>There are a few guides out and about about <a title=\"How to get 256 colors with GNU screen and vim\" href=\"http:\/\/robotsrule.us\/vim\/\">how to get your terminal up and running with 256 colors<\/a>, which gives you a lot more options than the traditional 16 terminal colors that are enabled by default. I used several of these guides in coming up with my approach, but I had a few problems following these instructions. Eventually, through some trial and error, I found something that works, so I thought I&#8217;d share it here.<\/p>\n<p>To get going quickly, you can just use my <a href=\"https:\/\/github.com\/ryanmce\/dotfiles\">dotfiles, which I share on github<\/a> and periodically update.<\/p>\n<p>The key stuff I added for 256 colors are in these commits:<\/p>\n<ul>\n<li><a href=\"https:\/\/github.com\/ryanmce\/dotfiles\/commit\/bd2d22c5587c71881f4f6fda3d56099357c4a862 \">256 color support in screen<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/ryanmce\/dotfiles\/commit\/066162dfd624a434b8ec6a5750405725d73dfd1a\">enable 256 colors in vim<\/a><\/li>\n<\/ul>\n<p>The key thing that was hard for me to get right was the tempcapinfo line in screenrc. The trial-and-error invovled putting my old <tt>termcapinfo<\/tt> and the new suggested <tt>termcapinfo<\/tt> together in different ways. Apparently, the correct answer was &#8220;append the new one to the old one&#8221; and then I was done. So, my screenrc&#8217;s <tt>termcapinfo<\/tt> line now looks like this:<\/p>\n<pre>termcapinfo xterm 'is=\\E[r\\E[m\\E[2J\\E[H\\E[?7h\\E[?1;4;6l:Co#256:AF=\\E[38;5;%dm:AB=\\E[48;5;%dm:tc=screen:'<\/pre>\n<p>If anyone out there understand what in the world is going on there, please enlighten us in the comments!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>There are a few guides out and about about how to get your terminal up and running with 256 colors, which gives you a lot more options than the traditional 16 terminal colors that are enabled by default. I used several of these guides in coming up with my approach, but I had a few [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[79,8],"class_list":["post-2067","post","type-post","status-publish","format-standard","hentry","category-everything","tag-computers","tag-technology"],"_links":{"self":[{"href":"https:\/\/arcanius.silverfir.net\/blog\/wp-json\/wp\/v2\/posts\/2067","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/arcanius.silverfir.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/arcanius.silverfir.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/arcanius.silverfir.net\/blog\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/arcanius.silverfir.net\/blog\/wp-json\/wp\/v2\/comments?post=2067"}],"version-history":[{"count":3,"href":"https:\/\/arcanius.silverfir.net\/blog\/wp-json\/wp\/v2\/posts\/2067\/revisions"}],"predecessor-version":[{"id":2070,"href":"https:\/\/arcanius.silverfir.net\/blog\/wp-json\/wp\/v2\/posts\/2067\/revisions\/2070"}],"wp:attachment":[{"href":"https:\/\/arcanius.silverfir.net\/blog\/wp-json\/wp\/v2\/media?parent=2067"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/arcanius.silverfir.net\/blog\/wp-json\/wp\/v2\/categories?post=2067"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/arcanius.silverfir.net\/blog\/wp-json\/wp\/v2\/tags?post=2067"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}