vim acting strange
So i found some helpful vim-hints on a page. Mostly stuff for .vimrc
I found out that i didn't have a .vimrc, so i made one, with this in it: Code:
set nocompatible I write, for example, this: Code:
$hi Code:
$ni<C-N> Code:
*you Code:
^u<C-N> EDIT:Whenever i press tab, i get "<C-N>". The text i found (in norwegian, or else i would have linked to it) said that i would be able to "tab" as normal.. |
Re: vim acting strange
Code:
" autocomplete In vim, :help completion will give you details (including the code-snippet above). Quote:
Quote:
Look at the syn*.vim and filetype.vim files in your vim installation if you want to see how all this is done (most likely in /usr/share/vim/...) |
Re: Re: vim acting strange
Did you just start typing in a fresh vim window or did you open a file? vim needs the file extension (or some pattern in the filename) to know what kind of file it is and which syntax-highlighting "kit" it needs to use. So if you ask vim to open foo.sh or foo.pl which contains your code it should do the highlighting appropriately. [/B][/QUOTE]
I tried to open/make foo.cpp - no colors though =\ I just copied .vimrc from my friends box, but the highlighting still don't work.. |
I think vim by default does not associate .cpp with C++. .C is C++, .c is C (as far as vim knows -- or at least as far as vim knows as far as I know :)). You can change what it thinks is a C++ file either in /usr/share/vim/filetype* or in your .vimrc Or try .sh or .pl, I know it recognizes those.
|
AFAIK, vim does take C++ by default. And .sh didn't work either. Thanks for trying to help, though :-)
|
One last idea: is this a nonstandard install at all? In vim, what does your $VIM variable contain? (:echo $VIM) $VIM/vim*/ should contain your syntax and other files. If it doesn't, that could be the problem. You might be able to reset $VIM in your .vimrc but I'm not sure about that.
|
Quote:
and about the install: I installed vim with apt-get .. |
All times are GMT -5. The time now is 04:08 AM. |