You are not logged in.

#1 2016-04-15 08:14:35

Johann
New Member
Registered: 2016-04-15
Posts: 4

Gvim not automatically "filling" the window it's in

I wanted gvim to be a little bigger when started with W-e (W = Windows key). I didn't find anything to deal with the dimensions of individual applications in openbox, so I put this in ~/.config/openbox/rc.xml:

<application class="*">
  <size>
    <width>800</width>
  </size>
</application>

This seems to work for gvim, but when started, the application doesn't fill the window it's in, screenshot. Gvim seems to expand to the window dimensions only when the window is moved, and stays that way (expanded) afterwards.

Any ideas what's the problem?

Offline

#2 2016-04-15 09:29:13

xaos52
The Good Doctor
From: Planet of the @pes
Registered: 2015-09-30
Posts: 695

Re: Gvim not automatically "filling" the window it's in

Launching the command with

xterm -e gvim

does work as expected.

Offline

#3 2016-04-15 10:55:30

Johann
New Member
Registered: 2016-04-15
Posts: 4

Re: Gvim not automatically "filling" the window it's in

Thanks -- that works here too.

I can edit the rc.xml file to that effect, so that W-e will execute xterm -e gvim (instead of bl-text-editor, which is set to bl-gvim), but I would like to use gvim as the default editor too. It seems that the galternatives program doesn't allow that command as a choice and I don't know how to progress from there.

In case it's relevant, I'm using vim-athena.

Offline

#4 2016-04-15 11:06:21

xaos52
The Good Doctor
From: Planet of the @pes
Registered: 2015-09-30
Posts: 695

Re: Gvim not automatically "filling" the window it's in

works for me!
/usr/bin/gvim is offered as an alternative and can be selected.
That is all that needss to be done.
And it (text editor) works from the menu.

Can you elaborate on what does not work for you?

Edit:
Oh, I see.
/usr/bin/bl-gvim is offered as alternative.

You will have to add the path for /usr/bin/gvim using galternatives.
And then select it as your choice.

Offline

#5 2016-04-15 11:30:36

Johann
New Member
Registered: 2016-04-15
Posts: 4

Re: Gvim not automatically "filling" the window it's in

I meant that galternatives doesn't allow xterm -e gvim as a choice.

Hmm, I can set bl-text-editor to /usr/bin/gvim, but after that nothing happens with W-e, or when trying to open associated files on a file manager (I use spacefm), or with the Text editor entry on the menu. However I can execute (/usr/bin/)gvim fine via the run dialog or from a terminal, although the original problem of partially filled window is then present.

/usr/bin/gvim links to /etc/alternatives/gvim, which links to /usr/bin/vim.athena.

This is quite fresh install of hydrogen-rc2, with not much tweaking done except for installing chromium, audacious and couple of other common programs and running aptitude update && aptitude upgrade.

EDIT: OK, I uninstalled vim-athena and replaced it with vim-gtk, and everything seems to work just fine! So maybe the problem is connected to the athena gui, I don't know.

Last edited by Johann (2016-04-15 12:01:05)

Offline

#6 2016-04-15 11:56:16

xaos52
The Good Doctor
From: Planet of the @pes
Registered: 2015-09-30
Posts: 695

Re: Gvim not automatically "filling" the window it's in

Now it get it.
You will have to  create a small wrapper script 'gvim' - you can name it what you want - somewhere in your PATH: - $HOME/bin or /usr/local/bin - with following content:

#!/bin/sh
xterm -e /usr/bin/vim.athena "$@" &

and in glalternatives, add path $HOME/bin/gvim ( or /usr/local/bin/gvim ) and select it.

I guess not many ( zero ? )users have chosen vim.athena as their default editor. But thats OK. wink

Offline

#7 2016-04-15 12:03:35

Johann
New Member
Registered: 2016-04-15
Posts: 4

Re: Gvim not automatically "filling" the window it's in

Oh, I didn't see your reply when editing my post. So I moved to vim-gtk and it works for me.

Thanks for the help! Maybe I'll utilise your wrapper script if I can't get used to vim-gtk.

Offline

#8 2016-04-15 12:13:25

xaos52
The Good Doctor
From: Planet of the @pes
Registered: 2015-09-30
Posts: 695

Re: Gvim not automatically "filling" the window it's in

No problem.
We like to put the user in control.

Offline

Board footer

Powered by FluxBB