17

I wanted to know if I can place a background image into gVim.

Can this be done programatically?

3
  • 12
    I see what you did there.
    – Bjorn
    Apr 15, 2009 at 18:37
  • 12
    Now we know how to make all non programming related questions comply :) (although he is asking about a mostly programming related tool) Apr 15, 2009 at 18:42
  • 7
    laughing at revision history :)
    – Iraimbilanja
    Apr 15, 2009 at 18:47

6 Answers 6

11

If you must, I'd suggest something along the following lines:

  1. use a compositing window manager (e.g. Compiz on Linux, Windows Vista and Mac OS probably have analogs)
  2. set a desktop background
  3. make your gvim window transparent
  4. rejoice, your text is now harder to read!
3
  • 1
    Here's a use-case: display a grid of very faint characters that are stuck to the viewport (like the background on some poorly designed websites). This should only show through the whitespace in the edited file. The characters will essentially be rulers that allow us to jump anywhere on the screen by squinting and ~three key presses (given some appropriate macros). Jun 2, 2015 at 10:46
  • another use-case: in my terminal, i use a background image that i created specifically to help me focus. it's a gentle noise gradient. this noise gradient makes it easier to focus on a single line, because there's enough texture in the background to increase the difference between rows of pixels, but not enough to be distracting. It's surprisingly effective. Jan 20, 2016 at 0:55
  • Another use case: github.com/LazoCoder/Pokemon-Terminal for vim Jun 14, 2017 at 14:38
5

According to a trivial google search for "gvim background image", the answer is "no". I'm basing that off this thread from the Vim mailing list. Looks like they might want someone to implement the feature though, so that would make this question legitimately programming related if you asked HOW to do so yourself :)

0
4

It's been possible since 2013: see the vim-bgimg plugin.

2
  • 1
    but it's windows only :(
    – simon_xia
    Aug 19, 2016 at 15:00
  • I found a mirror of the code on GitHub. If anyone knows C and the Linux API, they could probably fork it or create a Linux variant in a separate repo that builds off the same idea. Aug 13, 2019 at 20:11
2

Like rmeador said, a google search and a perusal of the vim documentation seems to imply that the answer is no. However, take comfort in knowing that you aren't alone in desiring this feature. This guy wanted the same feature and actually implemented it, at least for win32 and vim 6.2. If you really want to do this, I'd give his patches a look as a starting place, although I don't know how much those sections of the vim codebase have changed between 6.2 and the current version (7.2).

1

No, not yet.

However on win32 and vim 6.2 this guy implemented it.

1

MacVim supports transparent backgrounds if you are on that OS.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.