LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 01-24-2006, 10:47 AM   #1
alaios
Senior Member
 
Registered: Jan 2003
Location: Aachen
Distribution: Opensuse 11.2 (nice and steady)
Posts: 2,203

Rep: Reputation: 45
How vi makes it?


Hi i have noticed yesterday than vi knows when it should highlight somewords.. For example i was editing the /boot/grub/menu.lst and the savedefault word were highlighted.. How did he know that this word is reserved for grub.. ? The same happens when i write some c code.. Do u know how vi does this?
 
Old 01-24-2006, 10:56 AM   #2
oneandoneis2
Senior Member
 
Registered: Nov 2003
Location: London, England
Distribution: Ubuntu
Posts: 1,460

Rep: Reputation: 48
Syntax highlighting
 
Old 01-24-2006, 11:56 AM   #3
alaios
Senior Member
 
Registered: Jan 2003
Location: Aachen
Distribution: Opensuse 11.2 (nice and steady)
Posts: 2,203

Original Poster
Rep: Reputation: 45
I know what syntax highliting is what i dont know is how can recognize each time depnding what u do which words to highlight
 
Old 01-24-2006, 04:23 PM   #4
AdaHacker
Member
 
Registered: Oct 2001
Location: Brockport, NY
Distribution: Kubuntu
Posts: 384

Rep: Reputation: 32
It's the same idea as a file manager determining the MIME type of a particular file. Vim comes with a whole bunch of scripts with logic to determine the type of a file based on its name and/or contents. When that's done, Vim just loads the syntax file for that type, which determines which characters should be highlighted.
 
Old 01-25-2006, 02:42 AM   #5
alaios
Senior Member
 
Registered: Jan 2003
Location: Aachen
Distribution: Opensuse 11.2 (nice and steady)
Posts: 2,203

Original Poster
Rep: Reputation: 45
Ok thats a better reply ... Do u know where i can find the vi's syntax files?? IOs it possible to create one?
 
Old 01-25-2006, 05:41 AM   #6
AdaHacker
Member
 
Registered: Oct 2001
Location: Brockport, NY
Distribution: Kubuntu
Posts: 384

Rep: Reputation: 32
Vim's syntax file are located with the rest of the runtime data, usually under /usr/share/vim/vim63/syntax, or something like that. For information on making your own syntax files, consult the documentation. Just open Vim and, in command mode, type
Code:
:help syn-files
.
 
Old 01-25-2006, 06:41 AM   #7
alaios
Senior Member
 
Registered: Jan 2003
Location: Aachen
Distribution: Opensuse 11.2 (nice and steady)
Posts: 2,203

Original Poster
Rep: Reputation: 45
thx a lot really
 
  


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
who makes this desk? GUIPenguin General 7 10-08-2005 09:57 AM
What makes Slackware the best? halfpower Slackware 11 09-07-2005 11:11 PM
what makes ubuntu better fakie_flip Ubuntu 2 08-19-2005 03:09 PM
What makes a distro? JCdude2525 Linux - Distributions 3 04-10-2005 10:19 PM
Makes quotas little_ball Slackware 1 10-30-2004 02:39 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:19 PM.

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