You are not logged in.

#1 2006-12-12 23:27:00

elasticdog
Member
From: Washington, USA
Registered: 2005-05-02
Posts: 995
Website

Vim issues...meta keys and colorscheme not working correctly

The first issue isn't really a vim problem, but it's related.  When running Vim in a terminal, my meta key bindings don't work.  I've tracked it down to a problem with Xfce's Terminal as noted here: http://vimdoc.sourceforge.net/htmldoc/m … p-alt-keys
...but I'm not sure exactly how to fix it.  I suppose I could always switch to another terminal, but I'd like to stick with Xfce's version if possible.

The second issue is that my color scheme isn't being set when I first load up gVim.  As soon as I open a file, it properly displays, but the "splash" page doesn't show it.  I'm using desert (who doesn't) and this is what it looks like when I first load up gVim:
gvimsk3.th.png
I did stop using a separate <code>.gvimrc</code> in favor of putting everything in my <code>.vimrc</code> file under a conditional, and all the other settings work just fine.  Here's what that conditional looks like:

if has( "gui_running" )
    set columns=84            " Set the window's width
    set lines=43              " Set the window's height
    set guioptions-=T         " Remove the toolbar from the window
    set guifont=Terminus 12  " Use a clean monospaced font
    colorscheme desert
else
    set background=dark
    colorscheme desert
endif

In case you're curious, here's my entire <code>.vimrc</code> file.

Offline

#2 2006-12-13 00:27:19

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: Vim issues...meta keys and colorscheme not working correctly

IIRC this happens for because gvim does not find a ~/.gvimrc and reads /etc/gvimrc after ~/.vimrc (I think).
Try symlinking ~/.vimrc to ~/.gvimrc

Offline

#3 2006-12-13 22:04:02

tranquility
Member
From: Portugal
Registered: 2004-08-06
Posts: 136

Re: Vim issues...meta keys and colorscheme not working correctly

or create a ~/.gvimrc with a "so ~/.vimrc" on it smile

Offline

#4 2006-12-13 22:54:08

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: Vim issues...meta keys and colorscheme not working correctly

As for the meta bindings, you can't bind them the same as a GUI.  Terminal meta characters are actually 2 characters... Alt-A will translate to <ESC>A.

You need something like:

if has('gui_running')
   map <M> foo
else
   map ^[A foo
endif

NOTE: That ^[ is a literal esc character (C-v, C-[).

Offline

#5 2006-12-14 01:07:47

elasticdog
Member
From: Washington, USA
Registered: 2005-05-02
Posts: 995
Website

Re: Vim issues...meta keys and colorscheme not working correctly

Thanks for the info...how did I know that phrak would be all over this topic big_smile.  I might try using xterm or aterm on my desktop, but I guess that won't really solve the issue if I'm SSHing in to the machine.  Perhaps I'll just change those mappings.  Hmmm...

Offline

#6 2007-01-08 22:58:28

lateralus_
Member
From: Belgium
Registered: 2007-01-07
Posts: 17

Re: Vim issues...meta keys and colorscheme not working correctly

phrakture wrote:

IIRC this happens for because gvim does not find a ~/.gvimrc and reads /etc/gvimrc after ~/.vimrc (I think).
Try symlinking ~/.vimrc to ~/.gvimrc

That solved the problem for me. Thanks  wink


There are a lot of lies going around.... and half of them are true.
        -- Winston Churchill

Offline

Board footer

Powered by FluxBB