LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 11-17-2006, 06:17 PM   #1
lord_didger
Member
 
Registered: Jun 2005
Location: Poland
Distribution: Debian
Posts: 106

Rep: Reputation: 15
vim without syntax highlighting


Hi,
I have vim 7.0-122+1. This version doesn't have syntax highlighting (when I try to enable it the program tells me that 'command is not available in thi version'). What should I do to enable it? What packages remove or install from my Linux? I use Debian etch.
 
Old 11-17-2006, 07:00 PM   #2
rickh
Senior Member
 
Registered: May 2004
Location: Albuquerque, NM USA
Distribution: Debian-Lenny/Sid 32/64 Desktop: Generic AMD64-EVGA 680i Laptop: Generic Intel SIS-AC97
Posts: 4,250

Rep: Reputation: 62
Quote:
...tells me that 'command is not available in thi version'
What 'command' are you trying to use?

There are lots of ways to turn it on including commands, but the easiest thing is probably to find the line in /usr/share/vim/vimrc that says " syntax on, and remove the comment symbol (")

Last edited by rickh; 11-17-2006 at 07:06 PM.
 
Old 11-18-2006, 04:43 AM   #3
lord_didger
Member
 
Registered: Jun 2005
Location: Poland
Distribution: Debian
Posts: 106

Original Poster
Rep: Reputation: 15
the command is ':syntax enable'. However I tried also ':syntax on'. In both cases I got the same response
 
Old 11-18-2006, 10:00 AM   #4
PingFloyd
Member
 
Registered: Jun 2006
Posts: 94

Rep: Reputation: 16
type ':script' to see what all scripts it's loading, and then check any of those for anything odd.

Especially make sure that any needed dependencies are loaded. For example, the .vim files under .../syntax/ directory. As to which ones are needed for what, I couldn't really tell you. It seems like my vim has always loaded all the appropriate scripts, on it's own, just fine. Anyway, that gives you something to check out and investigate.

If that doesn't help, then the next thing you could do is 'vim --version'. This will give alot of information about the modules and options your vim was compiled with.

This may be a stupid question, but are you naming the file with the proper extension? AFAIK, vim doesn't know how to properly highlight, until the file being worked on, has a filename extension that it is familiar with. That is also providing that the necessary script(s) have been loaded up, which is one of the reasons I make mention of looking at the output of ':script'.

Last edited by PingFloyd; 11-18-2006 at 10:13 AM.
 
Old 11-18-2006, 10:11 AM   #5
HappyTux
Senior Member
 
Registered: Mar 2003
Location: Nova Scotia, Canada
Distribution: Debian AMD64
Posts: 4,170

Rep: Reputation: 244Reputation: 244Reputation: 244
Quote:
Originally Posted by lord_didger
Hi,
I have vim 7.0-122+1. This version doesn't have syntax highlighting (when I try to enable it the program tells me that 'command is not available in thi version'). What should I do to enable it? What packages remove or install from my Linux? I use Debian etch.
Create a ~/.vimrc file with the syntax on like in my file below.

Code:
>$ cat .vimrc
" Syntax highlighting all the time set this to avoid editing the
" " /etc/vim/vimrc after an upgrade the file usually gets overwritten.
syntax on
"
" " Use F12 to switch to insert mode without the stair-step effect.
set pastetoggle=<F12>
Also here is what I have installed for vim related packages.

Code:
>$ COLUMNS=125 dpkg -l | grep vim
ii  vim                       7.0-122+1                 Vi IMproved - enhanced vi editor
ii  vim-common                7.0-122+1                 Vi IMproved - Common files
ii  vim-doc                   7.0-122+1                 Vi IMproved - HTML documentation
ii  vim-runtime               7.0-122+1                 Vi IMproved - Runtime files
ii  vim-scripts               7-3                       plugins for vim, adding bells and whistles
 
Old 11-18-2006, 01:29 PM   #6
lord_didger
Member
 
Registered: Jun 2005
Location: Poland
Distribution: Debian
Posts: 106

Original Poster
Rep: Reputation: 15
I was sure that I installed the vim package because vim worked but I didn't. I didn't have vim and vim-scripts. Thanks a lot
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Vim syntax highlighting problem darkwing0o0rama Linux - Software 5 06-27-2006 12:01 PM
vim syntax highlighting problems. donniejones18 Linux - Software 7 04-16-2006 08:03 PM
vim syntax highlighting MiniMe001 Linux - General 2 06-19-2005 11:08 AM
How to make vim has syntax highlighting ICO Linux - General 4 01-05-2004 10:35 AM
Vim syntax highlighting NSKL Linux - Software 2 11-09-2002 02:39 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 02:51 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration