I am connecting through putty to a linux server, where I'd like to use
vim and its syntax highlight. However, I cannot figure out, why it
doesn't work for me.
I googled for an hour by now, read all similar forum posts and read all
through
http://vimdoc.sourceforge.net/htmldoc/usr_06.html#06.1
and
http://vimdoc.sourceforge.net/htmldoc/syntax.html#xterm-color
Tried (almost) everythnig describe there, but still no effect.
Some helpful info:
- When I type "ls" (in bash), I see colored results (directories,
symlinks, etc.)
- filetype is correctly detected (typing :set filetype prints out
correctly "filetype=perl"
- when I type ":hi Normal ctermfg=green", all text is green
- when I type ":hi Comment ctermfg=Cyan", nothnig happens.
- when I type ":syntax" (in Vim), it says "No Syntax items defined for
this buffer"
Probably the parser would't work well? Doesn't recognize perl comments
and other structures (functions, variables, ...)? Just an idea, don't
have a clue, what the reason is.
Has somebody some idea please?
Thanks and HAND
Alex
> - when I type ":syntax" (in Vim), it says "No Syntax items defined for
> this buffer"
What does :version say ? Do you have +syntax (build with syntax
highlighting) ?
Kind regards,
--
Étienne
Yes, when I type ":version", the "+syntax" is there (see end of mail).
Don't know, wether following thing will help you guys: when I type
":syntax off", I get this error message
E484: Can't open file /usr/share/vim/current/syntax/nosyntax.vim
(Such a file really doesn't exist on my filesys).
---------------------
:version
VIM - Vi IMproved 7.2 (2008 Aug 9, compiled Feb 25 2009 17:43:03)
Included patches: 1-108
Compiled by 'http://www.opensuse.org/'
Huge version without GUI. Features included (+) or not (-):
+arabic +autocmd -balloon_eval -browse ++builtin_terms +byte_offset
+cindent -clientserver -clipboard +cmdline_compl +cmdline_hist
+cmdline_info +comments +cryptv +cscope +cursorshape +dialog_con +diff
+digraphs -dnd -ebcdic +emacs_tags +eval +ex_extra +extra_search +farsi
+file_in_path +find_in_path +float +folding -footer +fork() +gettext
-hangul_input +iconv +insert_expand +jumplist +keymap +langmap
+libcall +linebreak +lispindent +listcmds +localmap +menu +mksession
+modify_fname +mouse -mouseshape +mouse_dec -mouse_gpm -mouse_jsbterm
+mouse_netterm -mouse_sysmouse +mouse_xterm +multi_byte +multi_lang
-mzscheme -netbeans_intg -osfiletype +path_extra -perl +postscript
+printer +profile -python +quickfix +reltime +rightleft -ruby
+scrollbind +signs +smartindent +sniff +statusline -sun_workshop +syntax
+tag_binary +tag_old_static -tag_any_white -tcl +terminfo +termresponse
+textobjects +title -toolbar +user_commands +vertsplit +virtualedit
+visual +visualextra +viminfo +vreplace +wildignore +wildmenu
+windows +writebackup -X11 -xfontset -xim -xsmp -xterm_clipboard -xterm_save
system vimrc file: "/etc/vimrc"
user vimrc file: "$HOME/.vimrc"
user exrc file: "$HOME/.exrc"
fall-back for $VIM: "/etc"
f-b for $VIMRUNTIME: "/usr/share/vim/current"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -march=i586
-mtune=i686 -fmessage-length=0 -O2 -Wall -D_FORTIFY_SOURCE=2
-fstack-protector -funwind-tables -fasynchronous-unwind-tables -g -Wall
-pipe -fno
-strict-aliasing -fstack-protector-all
Linking: gcc -L/usr/local/lib -o vim -lm -lncurses -lacl
Tinou wrote / napísal(a):
--
S prianim pekneho dna
Alex Kutka
Did you execute :syntax enable ?
Could you post your .vimrc and the output of :scriptnames ?
Regards,
Dennis Benzinger
From that I'd say that your installation is broken or incomplete.
Does whatever source you installed vim from put the runtime files in
a separate package? Did you use a package manager that can verify
the integrity of your vim installation?
> :version
> VIM - Vi IMproved 7.2 (2008 Aug 9, compiled Feb 25 2009 17:43:03)
> Included patches: 1-108
> Compiled by 'http://www.opensuse.org/'
> Huge version without GUI. Features included (+) or not (-):
> fall-back for $VIM: "/etc"
> f-b for $VIMRUNTIME: "/usr/share/vim/current"
Those two lines are weird. As ":help $VIMRUNTIME" says, $VIMRUNTIME
is normally $VIM/vim(version) where (version) is a version
number. More conventional values would be:
fall-back for $VIM: "/usr/share/vim"
f-b for $VIMRUNTIME: "/usr/share/vim/vim72"
That's not to say that one can never change $VIM or $VIMRUNTIME, but
one should be careful doing that and be prepared to deal with the
consequences.
You might have a look to see if /etc/vim72 and/or
/usr/share/vim/vim72 exist and if your runtime files got put there
instead of where vim is expecting them, i.e.,
/usr/share/vim/current.
HTH,
Gary
There should be an :set nocompatible on the first line of your .vimrc,
is it there?
AFAIK putty supports xterm with 256 colors, I don't know if t_Co=8 works
for putty but t_Co=256 works for me.
This works only if you have terminfo for putty-256color and screen-256color.
But, afaik ubuntu does not include any of them. Maybe some other
distributions do not include them too.
Have privilege to modify ~/.vimrc and having an openSSH account do not
mean you can install new deb packages. So if those packages are not
installed by default it may not be available to many hosts.
It is unlikely that system administrator would want to install such a
package, while users may need it. This is probably a problem of debian
though.
Your vimrc is severely b0rked.
> ---------------------------------------
'runtimepath' should definitely never have only one directory in it.
If nothing else, this line breaks $HOME/.vim, $VIM/after, and
$HOME/.vim/after.
> set runtimepath=/usr/share/vim/vim72
a) This has an "if" and "else" clause that are identical, and b) the
whole if should be unnecessary on nearly any modern linux system, at
least one running vim72.
> if &term =~ "xterm-color"
> if has("terminfo")
> set t_Co=8
> set t_Sf=
> et t_Sb=
> lse
> set t_Co=8
> set t_Sf=
> et t_Sb=
> ndif
> endif
These things are fine...
> set number
> set title
> set background=dark
You only need one of these lines. Probably best to just stick with
"syntax on", but either way, you only need one or the other, since one
implies the other.
> syntax on
> syntax enable
> ---------------------------------------
But I'd be willing to bet that removing your override of 'runtimepath'
fixes things for you.
~Matt
The guidelines for the list may be found at:
http://groups.google.com/group/vim_use/web/vim-information
Regards,
Chip Campbell
After reading this whole thread, and after the ":version" output told me
you're probably (like me) running SuSE or openSUSE Linux, here is what I
suggest (based on openSUSE 11.2 which has just been released and which I
installed today -- I don't expect package names to be very different in
recent releases, and YaST exists since earlier than I've known SuSE,
which dates back to SuSE 6.4, long before I knew about Vim):
1. Start up YaST => Software => Software Management, and make sure that
both "vim-base" and "vim-data" packages are installed as well as one or
more (and possibly all three) of vim, vim-enhanced and gvim. If you
installed from a CD or DVD, you may have to have it at hand and use it
in order to add packages. If you installed from an ISO image on a hard
drive, and that ISO image is still there (and mounted), YaST will find
any needed packages without asking you anything. If you installed from
the Net, and your SuSE version is still supported, YAST will also find
it provided that your modem is connected.
2. If you added any missing package(s), let YaST (the Software
Management window) run and close itself, but *don't* close the YaST2
Control Center, and immediately run the "Online Update" function. If it
proposes any patches, these are for packages you already have installed:
click "Accept" and let it run its course.
3. In your vimrc, remove the set runtimepath= line, and make sure that
your vimrc contains one (but not both) of
runtime vimrc_example.vim
or
filetype plugin indent on
syntax on
where the word "indent" is optional -- omit it if you don't want Vim to
decide without your say-so how your files should be indented; include it
if you want Vim to "prettify" your indentation according to whatever
filetype-related indenting rules it comes with.
4. Restart Vim.
5. If you still have problems, come back here and describe them in as
much detail as you can.
Best regards,
Tony.
--
Those who make peaceful revolution impossible will make violent
revolution inevitable.
-- John F. Kennedy