{"id":14645,"date":"2026-09-28T01:00:00","date_gmt":"2026-09-28T05:00:00","guid":{"rendered":"https:\/\/www.both.org\/?p=14645"},"modified":"2026-09-21T12:28:34","modified_gmt":"2026-09-21T16:28:34","slug":"5-gvim-color-schemes-for-writing-code","status":"publish","type":"post","link":"https:\/\/www.both.org\/?p=14645","title":{"rendered":"5 GVim color schemes for writing code"},"content":{"rendered":"<div class=\"pld-like-dislike-wrap pld-template-1\">\r\n    <div class=\"pld-like-wrap  pld-common-wrap\">\r\n    <a href=\"javascript:void(0)\" class=\"pld-like-trigger pld-like-dislike-trigger  \" title=\"\" data-post-id=\"14645\" data-trigger-type=\"like\" data-restriction=\"cookie\" data-already-liked=\"0\">\r\n                        <i class=\"fas fa-thumbs-up\"><\/i>\r\n                <\/a>\r\n    <span class=\"pld-like-count-wrap pld-count-wrap\">    <\/span>\r\n<\/div><\/div>\n<p class=\"wp-block-paragraph\">I use all kinds of text editors, but Vim is currently my favorite on Linux. That\u2019s probably because I learned classic <strong>vi<\/strong> early in my career, when I managed different Unix systems; it didn\u2019t matter if I was on Solaris, HP-UX, Apollo, or Linux, I could always rely on <strong>vi<\/strong> being there. After a while, my fingers \u201clearn\u201d how to type the commands, so I don\u2019t really have to think about what I\u2019m doing\u2014\u201cfinger memory\u201d just makes it easy.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I use Vim whenever I\u2019m in a terminal, especially for quick edits. But if I\u2019m working in a graphical desktop session, I like to use tools that can leverage the desktop environment, so everything feels the same. That\u2019s why <a href=\"https:\/\/www.both.org\/?p=14617\">GVim is my new favorite editor<\/a>. With GVim, <em>it\u2019s still Vim<\/em>, but running in a graphical window, not a terminal. You can install GVim using the <code>vim-X11<\/code> package:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ sudo dnf install vim-X11<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">GVim reads the same <em>vimrc<\/em> file that Vim uses. By default, Vim (or GVim) looks for <code>~\/.vimrc<\/code> or <code>~\/.vim\/vimrc<\/code>, in that order, and uses the first file that it finds. However, GVim will also look for <code>~\/.gvimrc<\/code> or <code>~\/.vim\/gvimrc<\/code> and use that for additional initialization. You can also use an <code>if<\/code> statement in your <em>vimrc<\/em> file to detect if the editor is running as GVim (<code>if has('gui_running')<\/code>) or not (<code>else<\/code>) and load settings specific to each environment.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">That\u2019s a great feature to know about, because GVim will use the same preferences from my <em>vimrc<\/em> (such as <code>set tabstop=4<\/code> to set my tab stops to 4 spaces) then it will read <em>gvimrc<\/em> for extra settings. For example, my <em>gvimrc<\/em> has a <code>set guifont<\/code> line that specifies a nice-looking font when editing in a graphical window.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The color schemes were the most interesting to me. While I initially used the Retrobox color scheme in Vim, and it looks <em>okay<\/em> in GVim, I wanted to know what the other color schemes looked like in GVim. I created this montage of all 28 color schemes in GVim. These screenshots show a short C program that uses comments, <em>include<\/em> statements, a <em>main<\/em> function, a <em>while<\/em> loop, and several <em>if<\/em> statements. I created each screenshot by writing a new <em>vimrc<\/em> file to specify the color scheme.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"4932\" height=\"3260\" src=\"http:\/\/www.both.org\/wp-content\/uploads\/2026\/09\/gvim92colors.png\" alt=\"A montage of all 28 GVim color schemes\" class=\"wp-image-14639\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">While I like a <a href=\"https:\/\/www.both.org\/?p=14636\">dark Vim theme<\/a> when I\u2019m working in a terminal, I prefer to use a lighter color scheme in GVim. Yet the background shouldn\u2019t be glaring white; a light gray works well for me. Highlighting shouldn\u2019t be too bright, but it should be noticeable. With those parameters, these 5 GVim color schemes look best to me:<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Lunaperche<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">This is a very nice color scheme for a graphical environment. The Lunaperche color theme uses bold type for keywords and color for almost everything else. The background is light but not too bright, which isn\u2019t tiring on my eyes.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"820\" height=\"650\" src=\"http:\/\/www.both.org\/wp-content\/uploads\/2026\/09\/gvim92lunaperche.png\" alt=\"GVim with black text on an off-white background\" class=\"wp-image-14641\"\/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Catppuccin<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">I like that the Catppuccin color scheme provides obvious highlighting for code that makes it easy for me to see numbers, keywords, strings, and other kinds of code statements. However, the background color is a bit too \u201cgray\u201d which sometimes makes it difficult to read the text, but I found using a slightly \u201cbolder\u201d font counters this somewhat.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"820\" height=\"650\" src=\"http:\/\/www.both.org\/wp-content\/uploads\/2026\/09\/gvim92catppucin.png\" alt=\"GVim with gray text on a light gray background\" class=\"wp-image-14640\"\/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Wildcharm<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">I like how the Wildcharm theme uses a off-white background and muted colors that are still easy to read. The only thing I would change about this theme is to use a different color for numbers than for strings.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"820\" height=\"650\" src=\"http:\/\/www.both.org\/wp-content\/uploads\/2026\/09\/gvim92wildcharm.png\" alt=\"GVim with black text on a light gray background\" class=\"wp-image-14644\"\/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Shine<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The Shine color theme provides a good balance for code. Keywords are in a different color and bold, as are numbers. Comments use a muted gray, and strings are brown.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"820\" height=\"650\" src=\"http:\/\/www.both.org\/wp-content\/uploads\/2026\/09\/gvim92shine.png\" alt=\"GVim with black text on an off-white background\" class=\"wp-image-14643\"\/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Morning<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">While the background color is a bit too \u201cgray\u201d for me, I find the Morning color scheme works well for code. A nice feature in this theme is how it highlights text and numbers with a white background, which stands out from the normal background color.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"820\" height=\"650\" src=\"http:\/\/www.both.org\/wp-content\/uploads\/2026\/09\/gvim92morning.png\" alt=\"GVim with black text on a gray background\" class=\"wp-image-14642\"\/><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p class=\"wp-block-paragraph\">Be careful when specifying the color scheme for GVim if you also use a different theme for Vim in a terminal. It can be tempting to add the GVim color theme in <em>gvimrc<\/em> and your Vim color theme in <em>vimrc<\/em>, but GVim will read both of these files: <em>vimrc<\/em> then <em>gvimrc<\/em>. Loading one color scheme on \u201ctop\u201d of another will not give you the results you are looking for.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Instead, use an <code>if<\/code> statement in your <em>vimrc<\/em> file, such as <code>~\/.vimrc<\/code> or <code>~\/.vim\/vimrc<\/code> and add a specific <code>colorscheme<\/code> when GVim is running, and a different <code>colorscheme<\/code> when it\u2019s Vim. The <code>has('gui_running')<\/code> condition will be \u201ctrue\u201d only for GVim. For example, to make Lunaperche the default color theme whenever you start GVim, while using Habamax for Vim, add this line to your <em>vimrc<\/em> file:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>if has('gui_running')\n  colorscheme lunaperche\nelse\n  colorscheme habamax\nendif<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">You can put other GVim initialization in your <code>if<\/code> block, but I prefer to set other \u201cGUI\u201d options in <em>gvimrc<\/em>. For example, I use this line in <em>gvimrc<\/em> to set the GVim font to IBM Plex Mono, 14 point: (Note that because the font name has spaces in it, I need to \u201cprotect\u201d the spaces using a backslash.)<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>set guifont=IBM\\ Plex\\ Mono\\ 14<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">When using the Catppuccin color scheme, I used a slightly \u201cbolder than normal\u201d font weight by specifying <code>weight=450<\/code> on the font line. Normal or \u201cRegular\u201d font weight is 400, and \u201cMedium\u201d weight is 500, so 450 is in the middle: (Add the font weight before the font size.)<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>set guifont=IBM\\ Plex\\ Mono\\ weight=450\\ 14<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Try these color schemes for GVim, the graphical version of Vim.<\/p>\n","protected":false},"author":33,"featured_media":6830,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_lmt_disableupdate":"","_lmt_disable":"","footnotes":"","_members_access_role":[],"_members_access_error":""},"categories":[77,219],"tags":[120,220],"class_list":["post-14645","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-desktop","category-vim","tag-desktop","tag-vim"],"modified_by":"Jim Hall","_links":{"self":[{"href":"https:\/\/www.both.org\/index.php?rest_route=\/wp\/v2\/posts\/14645","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.both.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.both.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.both.org\/index.php?rest_route=\/wp\/v2\/users\/33"}],"replies":[{"embeddable":true,"href":"https:\/\/www.both.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=14645"}],"version-history":[{"count":1,"href":"https:\/\/www.both.org\/index.php?rest_route=\/wp\/v2\/posts\/14645\/revisions"}],"predecessor-version":[{"id":14646,"href":"https:\/\/www.both.org\/index.php?rest_route=\/wp\/v2\/posts\/14645\/revisions\/14646"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.both.org\/index.php?rest_route=\/wp\/v2\/media\/6830"}],"wp:attachment":[{"href":"https:\/\/www.both.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=14645"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.both.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=14645"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.both.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=14645"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}