It looks like you are trying to load a colour scheme that needs 256 colours, but
your terminal doesn't have that many colours (or Vim doesn't know it does). So,
you either need to add the line set t_Co=256 into your .vimrc, or set your $TERM
environment variable (before starting Vim) to something appropriate.
> I couldn't find this in my .vimrc file, so I thought it would be in my
> colorscheme. However, this message appears even if I comment out my
> colorscheme line in the .vimrc file. I would appreciate if someone
> could
> elucidate me on this matter, and how to rectify it.
That is a bit odd. There may be something else expecting 256 colours, I guess, but
I'm not sure what it might be.
> noremap <Space> <PageDown>
> noremap <S-Space> <PageUp>
>
> However, in Linux, running vim inside the gnome-terminal 2.18.2 (or
> when
> running gvim), both space and shift-space do page-down operation. I
> can't
> figure out the source of this problem. Note that the exact same .vimrc
> file
> works perfectly in MS Windows, i.e. shift-space does page-up.
This isn't surprising. A lot of keys such as shift-space won't work in terminals,
but only in the Vim GUI (gvim or vim -g). In a terminal, both space and
shift-space produce the same code, so Vim can't tell the difference.
If you are under Gnome, maybe try compiling in the GTK/GTK2 GUI of Vim; that would
probably work.
> Third, vim (the command line) when running on gnome-terminal 2.18.2
> has this
> strange behavior: whenever a key is pressed, it shows the key down
> below and
> the last line scrolls up. Perhaps this can be best explained using a
> screenshot, whose link I am putting in this email. Before capturing
> this
> screenshot, I pressed j j j k Esc Esc i. Text that I type also does
> not
> appear at the top of the screen. Is this a known problem?
>
> Screenshot below:
>
> http://img100.imageshack.us/img100/8112/vimhelppu8.png
Yuck!
My suspicion would be that 'columns' or 'rows' is set incorrectly to something
other than what the window size actually is. Does resizing the window help? Maybe
try setting those options manually ':set columns=80 rows=24' or such.
It could be related to the earlier problems, too, if the $TERM is set wrong, Vim
may not be able to properly find its size, etc. Odd though.
You may also find it handy to start Vim as 'vim -u NONE -U NONE -N' to start it in
nocompatible mode but without loading your .vimrc or any plugins. Then you will be
able to find out whether it is a Vim problem alone, or something that only shows
up with certain settings. If it is something with your settings, you should be
able to track it down by removing parts of your .vimrc, etc. until it goes away.
Anyway, those are my initial ideas. Others may be able to expand more (e.g. they
may know what your $TERM should be).
Ben.
Send instant messages to your online friends http://au.messenger.yahoo.com
Yep.
> > I couldn't find this in my .vimrc file, so I thought it would be in my
> > colorscheme. However, this message appears even if I comment out my
> > colorscheme line in the .vimrc file. I would appreciate if someone
> > could
> > elucidate me on this matter, and how to rectify it.
>
> That is a bit odd. There may be something else expecting 256 colours, I guess, but
> I'm not sure what it might be.
I've written a plugin that requires t_Co == 256, and set it to a few
people on #vim. On colorscheme changed events, it tries to use the
colors that were set for guifg and guibg to set ctermbg and ctermfg to
something on the 256-color cube. Not nearly as nice as the patch that
I still haven't gotten any feedback on, but my first attempt, and
works well enough for what it is. Just had a few shortcomings that
can't really be overcome in script...
> > noremap <Space> <PageDown>
> > noremap <S-Space> <PageUp>
> >
> > However, in Linux, running vim inside the gnome-terminal 2.18.2 (or
> > when
> > running gvim), both space and shift-space do page-down operation. I
> > can't
> > figure out the source of this problem. Note that the exact same .vimrc
> > file
> > works perfectly in MS Windows, i.e. shift-space does page-up.
>
> This isn't surprising. A lot of keys such as shift-space won't work in terminals,
> but only in the Vim GUI (gvim or vim -g). In a terminal, both space and
> shift-space produce the same code, so Vim can't tell the difference.
Yes, though some decent terminal emulators let you add new keys
(xterm, for one). For instance, I have, in my .Xdefaults, the
following lines for xterm keys:
*VT100.Translations: #override \
<Key>Delete: string("\033[3~")\n\
~Meta Shift<Key>Tab: string("\033[Z") \n\
Meta Shift<Key>Tab: string("\033\033[Z") \n
In addition to making sure that delete sends the code I want, this
lets me use shift-tab and alt-shift-tab in a terminal. You could add
a code for shift-space in the same way.
> If you are under Gnome, maybe try compiling in the GTK/GTK2 GUI of Vim; that would
> probably work.
>
Certainly would fix the keybinding problem, anyway.
> > Third, vim (the command line) when running on gnome-terminal 2.18.2
> > has this
> > strange behavior: whenever a key is pressed, it shows the key down
> > below and
> > the last line scrolls up. Perhaps this can be best explained using a
> > screenshot, whose link I am putting in this email. Before capturing
> > this
> > screenshot, I pressed j j j k Esc Esc i. Text that I type also does
> > not
> > appear at the top of the screen. Is this a known problem?
> >
> > Screenshot below:
> >
> > http://img100.imageshack.us/img100/8112/vimhelppu8.png
>
> Yuck!
>
> My suspicion would be that 'columns' or 'rows' is set incorrectly to something
> other than what the window size actually is. Does resizing the window help? Maybe
> try setting those options manually ':set columns=80 rows=24' or such.
My guess would be that you are setting one or both of those options
manually. In gvim, or a sane terminal like xterm, setting those
options to a higher value than actual will resize the window to what
you specify, but gnome-terminal is a piece of crap. So, if you're
setting 'columns' or 'rows' manually, that should be done in .gvimrc,
not .vimrc.
> It could be related to the earlier problems, too, if the $TERM is set wrong, Vim
> may not be able to properly find its size, etc. Odd though.
>
> You may also find it handy to start Vim as 'vim -u NONE -U NONE -N' to start it in
> nocompatible mode but without loading your .vimrc or any plugins. Then you will be
> able to find out whether it is a Vim problem alone, or something that only shows
> up with certain settings. If it is something with your settings, you should be
> able to track it down by removing parts of your .vimrc, etc. until it goes away.
Yep.
> Anyway, those are my initial ideas. Others may be able to expand more (e.g. they
> may know what your $TERM should be).
The real reason I replied was because I knew this one ;-) The proper
$TERM setting for a 256 color gnome terminal is "gnome-256color". On
an ubuntu system, like most others, this terminfo entry isn't
installed by default, but you can get it by installing the package
"ncurses-term". Unfortunately, I don't know of any way to change what
gnome terminal sets $TERM to when starting. If any one does, please
chip in, since no one but the terminal should ever need to change
$TERM!
~Matt
To compile the GTK/GTK2 GUI you should only need to make sure you have the GTK
development package installed for you OS so you have all the relevant headers, and
then pass --enable-gui=gtk or --enable-gui=gtk2 to ./configure for Vim.
Normally, space and shift-space are the same. You might program X11 to send
something else of your choosing (see "man xmodmap"), but then Insert-mode Vim
won't recognize shift-space as space unless you remap it the other way round.
Best regards,
Tony.
--
Everyone can be taught to sculpt: Michelangelo would have had to be
taught how _not_ to. So it is with the great programmers.