<commit_before>---
title: From Vim-GTK to Vim-Qt
tags: [vim, qt, vim-qt, review]
---

[Vim-Qt](https://bitbucket.org/equalsraf/vim-qt/wiki/Home) is a gVim replacement
which aims to address a number of graphical issues in the standard GTK-based
Vim. After having used the default gVim for years, and putting up a number of
its quirks, I decided to give Vim-Qt a run for its money. In short, I was
pleasantly surprised.

### The state of Vim-GTK
My most notable gripes with gVim are regarding its cell rendering. If the
`guifont` setting doesn't perfectly match the width of the window, in that
`(window_width % character_with) == 0`, there is some remaining space which is
left uncolored on the right side of the window. Depending on your font size and
window width, that can be almost a full character's width. To remedy this, one
needs to influence the GTK renderer using external configs; I haven't had
much luck with it.

Aside from that, gVim's actual GUI elements aren't configurable. Sure, you can
`:set guiopts-=m` to remove the menu, but you can't change the size, color, and
font of the tabs. You also have no control over where the tool bars render. Note
that each issue described here is also present in Vim-GNOME and other Vim GUIs
based on Vim-GTK.

<div style="text-align:center">
<a href="{{ site.blog_url }}/img/vim-qt/vim-gtk.png" target="_blank">
<img alt="vim-gtk screen shot"
     src="{{ site.blog_url }}/img/vim-qt/vim-gtk.png" width="66%" />
</a>
</div>

### What Vim-Qt offers
Vim-Qt has packages available for
[Debian](http://download.opensuse.org/repositories/home:/ruiabreuferreira/),
[Ubuntu](https://launchpad.net/~equalsraf/+archive/ppa),
[Chakra](http://chakraos.org/ccr/packages.php?ID=1916),
[Arch](http://aur.archlinux.org/packages.php?ID=50082), and
[Gentoo](http://packages.gentoo.org/package/app-editors/vim-qt). Right out of
the box, Vim-Qt resolves the window background color issue. Aside from that, it
also cleans up the tabs a bit, with the help of Qt, so they look a
bit more sleek.

<div style="text-align:center">
<a href="{{ site.blog_url }}/img/vim-qt/vim-qt.png" target="_blank">
<img alt="vim-qt default screen shot"
     src="{{ site.blog_url }}/img/vim-qt/vim-qt.png" width="66%" />
</a>
<br/> <br/>
</div>

Vim-Qt takes advantage of its powerful Qt backend by allowing [dockable tool
bars](https://bitbucket.org/equalsraf/vim-qt/wiki/Features), which adds a great
deal of flexibility over the placement of tabs, file menus, and other widgets.
The most powerful feature, however, is its support for [Qt style
sheets](http://doc.qt.io/qt-5/stylesheet.html), which give you full control
over each individual element in the GUI. After some exploring, and this config,
I was able to turn my Vim-Qt setup into something much more minimal; it also
fits my color scheme just as I'd like.

<div style="text-align:center">
<a href="{{ site.blog_url }}/img/vim-qt/vim-qt-stylized.png" target="_blank">
<img alt="vim-qt stylized screen shot"
src="{{ site.blog_url }}/img/vim-qt/vim-qt-stylized.png" width="66%" />
</a>
<br/> <br/>
</div>

```css
MainWindow
{ background : #002b36; }

QToolBar
{
  border-bottom : 1px solid #333333;
  qproperty-movable: false;
}

QToolButton<commit_msg>Clean up vim-qt post with figures<commit_after>---
title: From Vim-GTK to Vim-Qt
tags: [vim, vim-gtk, qt, vim-qt, review]
---

[Vim-Qt](https://bitbucket.org/equalsraf/vim-qt/wiki/Home) is a gVim replacement
which aims to address a number of graphical issues in the standard GTK-based
Vim. After having used the default gVim for years, and putting up a number of
its quirks, I decided to give Vim-Qt a run for its money. In short, I was
pleasantly surprised.

### The state of Vim-GTK
My most notable gripes with gVim are regarding its cell rendering. If the
`guifont` setting doesn't perfectly match the width of the window, in that
`(window_width % character_with) == 0`, there is some remaining space which is
left uncolored on the right side of the window. Depending on your font size and
window width, that can be almost a full character's width. To remedy this, one
needs to influence the GTK renderer using external configs; I haven't had
much luck with it.

Aside from that, gVim's actual GUI elements aren't configurable. Sure, you can
`:set guiopts-=m` to remove the menu, but you can't change the size, color, and
font of the tabs. You also have no control over where the tool bars render. Note
that each issue described here is also present in Vim-GNOME and other Vim GUIs
based on Vim-GTK.

<figure>
<a href="{{ site.blog_url }}/img/vim-qt/vim-gtk.png" target="_blank">
<img alt="vim-gtk screen shot"
     src="{{ site.blog_url }}/img/vim-qt/vim-gtk.png" width="66%" />
</a>
</figure>

### What Vim-Qt offers
Vim-Qt is easy to install, since it has packages available for
[Debian](http://download.opensuse.org/repositories/home:/ruiabreuferreira/),
[Ubuntu](https://launchpad.net/~equalsraf/+archive/ppa),
[Chakra](http://chakraos.org/ccr/packages.php?ID=1916),
[Arch](http://aur.archlinux.org/packages.php?ID=50082), and
[Gentoo](http://packages.gentoo.org/package/app-editors/vim-qt). Right out of
the box, Vim-Qt also resolves the window background color issue. Aside from
that, it also cleans up the tabs a bit, with the help of Qt, so they look a bit
more sleek.

<figure>
  <a href="{{ site.blog_url }}/img/vim-qt/vim-qt.png" target="_blank">
    <img alt="vim-qt default screen shot"
         src="{{ site.blog_url }}/img/vim-qt/vim-qt.png" />
  </a>
  <figcaption>
  Vim-Qt takes advantage of its powerful Qt backend by allowing <a
  href="https://bitbucket.org/equalsraf/vim-qt/wiki/Features">dockable tool
  bars</a> , which adds a great deal of flexibility over the placement of tabs,
  file menus, and other widgets.
  </figcaption>
</figure>

<figure>
  <a href="{{ site.blog_url }}/img/vim-qt/vim-qt-stylized.png" target="_blank">
    <img alt="vim-qt stylized screen shot"
         src="{{ site.blog_url }}/img/vim-qt/vim-qt-stylized.png" />
  </a>
  <figcaption>
  The most powerful feature, however, is its
  support for <a href="http://doc.qt.io/qt-5/stylesheet.html">Qt style sheets</a>,
  which give you full control over each individual element in the GUI. After some
  exploring, and this config, I was able to turn my Vim-Qt setup into something
  much more minimal; it also fits my color scheme just as I'd like.
  </figcaption>
</figure>

```css
MainWindow
{ background : #002b36; }

QToolBar
{
  border-bottom : 1px solid #333333;
  qproperty-movable: false;
}

QToolButton
{'fraction_non_alphanumeric': 0.12404405016824717, 'fraction_numerical': 0.008259406546344448, 'mean_word_length': 4.120595144870791, 'pattern_counts': {'":': 0, '<': 45, '<?xml version=': 0, '>': 45, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2821832', 'n_tokens_mistral': 2282, 'n_tokens_neox': 2113, 'n_words': 821}