17

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

Can this be done programatically?

Zoe
  • 27,060
  • 21
  • 118
  • 148
Luis
  • 1,828
  • 2
  • 19
  • 27

6 Answers6

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!
Zoe
  • 27,060
  • 21
  • 118
  • 148
Sam Stokes
  • 14,617
  • 7
  • 36
  • 33
  • 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). – Evgeni Sergeev Jun 02 '15 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. – Mark P Neyer Jan 20 '16 at 00:55
  • Another use case: https://github.com/LazoCoder/Pokemon-Terminal/ for vim – Giftiger Wunsch Jun 14 '17 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 :)

rmeador
  • 25,504
  • 18
  • 62
  • 103
4

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

Evgeni Sergeev
  • 22,495
  • 17
  • 107
  • 124
  • 1
    but it's windows only :( – simon_xia Aug 19 '16 at 15:00
  • I found a mirror [of the code](https://github.com/skywind3000/vim-bgimg/blob/master/autoload/bgimg.c) 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. – Zoe Aug 13 '19 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).

Paul Wicks
  • 62,960
  • 55
  • 119
  • 146
1

MacVim supports transparent backgrounds if you are on that OS.

bryan kennedy
  • 6,969
  • 5
  • 43
  • 64
1

No, not yet.

However on win32 and vim 6.2 this guy implemented it.

ByteNirvana
  • 5,640
  • 4
  • 21
  • 20