LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Debian (http://www.linuxquestions.org/questions/debian-26/)
-   -   vim without syntax highlighting (http://www.linuxquestions.org/questions/debian-26/vim-without-syntax-highlighting-502633/)

lord_didger 11-17-2006 06:17 PM

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.

rickh 11-17-2006 07:00 PM

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 (")

lord_didger 11-18-2006 04:43 AM

the command is ':syntax enable'. However I tried also ':syntax on'. In both cases I got the same response

PingFloyd 11-18-2006 10:00 AM

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'.

HappyTux 11-18-2006 10:11 AM

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


lord_didger 11-18-2006 01:29 PM

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


All times are GMT -5. The time now is 07:28 PM.