Saturday, June 7, 2014

SOLVED: No menu bar (but menus are loaded) :-?

On 07/06/14 00:42, BPJ wrote:
> 2014-06-06 11:55, Tony Mechelynck skrev:
>> gvim 7.4.316 (Huge) with GTK2/GNOME2 GUI
>> libgnome-2.32.1-13.1.3-x86_64.rpm
>> libgnome-devel-2.32.1-13.1.3-x86_64.rpm
>> gtk2-devel-2.24.2-2.1-x86.6.rpm
>> libgtk-2_0-0-2.24.2-2.1-x86_64.rpm
>>
>> guioptions=gimrLtc
>> wildcharm=^T
>>
>> :map <C-Z> :emenu <C-T>
>>
>> ":set go+=T" makes the toolbar appear.
>> Right-click makes the context menu appear (in graphical style).
>> Ctrl-Z makes the "console" menus appear on the status line (same
>> titles as the normal GUI menus but with some backslash escapes;
>> navigate with ←↑↓→ as usual for comand-line completion.
>>
>> No GUI-style menu bar.
>>
>> Maybe I removed it some months or years ago, but for the love of
>> me I cannot make it reappear; however, I don't think I removed it.
>> I think that "not so long ago" (but how many patchlevels back?) it
>> was still present.
>>
>> My vimrc includes a line
>> runtime! menu.vim
>> so menus are enabled even in Console mode. Bracketing that line
>> between "if !has('gui_running')" ... "endif" (without the double
>> quotes of course) makes no difference (still no menubar after
>> restarting gvim).
>
> Since you mention GNOME, perhaps this can help:
>
> <http://vim.wikia.com/wiki/Restore_missing_gvim_menu_bar_under_GNOME>
>
> (THe page was added by me after spending hours on finding a solution a
> few years ago.)
>
> /bpj
>
>
Thank you BPJ!

Most of the proposed solutions are obviously irrelevant in my case (in
particular, 'guioptions' already includes m and running gvim as root
with /root/.vimrc a symlink to /home/tonymec/.vimrc doesn't change
anything), but one of them isn't, and it works. I'm writing it down here
for anyone who would have the same problem. It consists of modifying
~/.gnome2/Vim as follows:

Bad:
--------------------------------

[Placement]
Dock=Toolbar\\0,0,0,0\\Menubar\\0,0,0,0
--------------------------------
Good:
--------------------------------

[Placement]
Dock=Toolbar\\0,1,0,0\\Menubar\\0,0,0,0
--------------------------------

(The first line of the file is empty.)

I did it while gvim wasn't running (well, actually I edited the file
under another name, closed gvim, then moved the other-named file to the
original), then restarted gvim, and voilà! The GUI-style menus are there
again (and the console-style menus started on the statusline by my
Ctrl-Z mapping still work, BTW).

Yayayaaay!


Best regards,
Tony.
--
hundred-and-one symptoms of being an internet addict:
121. You ask for e-mail adresses instead of telephone numbers.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment