Saturday, March 23, 2013

Configuration of magic box .gvimrc

I  know a little much about .vimrc file configuration. I have written something about it here. These features will make your gvim window comfortable to read.
The .gvimrc file is a file that is source by gvim software every time you open any file using gvim software. So if you want to set some setting permanently write down appropriate command by taking reference of the following discussion. Same as we have discussed in earlier post.


 Changing Background and font color

here is a simple command for using highlighting your gvim background and text. Simply  type command below to make your background of gvim Black and foreground (normal text color) white.
           :highlight Normal guibg=Black guifg=White
you can experiment on this command and it you like this setting you can write it in your .gvimrc file so that now onward your each and every window will open with Black background. You can write colors black,white,green,red etc. as per your requirements.
Creating groups for highlighting variable

The following commands creates perticular group of words. I have created one group of my roommates here by the following command.
          :syntax keyword room sandip hitesh brijesh
after creating this type of group you can link some property which might be given in your gvim package. The gvim software I am using has defined propery under name keyword and user can link property of keyword with defined group as follows.
               :highlight link room keyword
by this command above three words will have property same as keyword(related to highlighting in gvim).  So if in your gvim package if keyword is highlighted as bold & red color. Whenever you are typing "sandip" "brijesh"  or  "hitesh" these words becomes bold and red colored. You can see what property has been set for highlighting for any group.
             :highlight keywordThis command gives current highlighting setting for the word group keyword. Same way you can see settings for any other variable by following command.
             :highlight groupname  or :hi groupname
while using this command if group is linked to any other group it will show you that group name to which your group is linked.
Some more colors of background and foreground possible for gvim. 

         Here are some groups that has been defined in gvim package.
                *Comment any comment
        *Constant           any constant
        *Identifier         any variable name
        *Statement          any statement
        *PreProc generic    Preprocesso
        *Type               int, long, char, etc.
        *Special            any special symbol
        *Underlined         text that stands out, HTML links
                *Special                           any special symbol
        *Underlined         text that stands out, HTML links
        *Ignore             left blank, hidden  |hl-Ignore|
        *Error              any erroneous construct
        *Todo               anything that needs extra attention; mostly the keywords TODO FIXME and XXX


Now if you want to check which items are currently defined you can use following command:
           :syntax
To check which syntax items have currently been defined. This is quit useful when experimenting with syntax.  It also shows the colors used for each item, which helps to find out what is what.



MATCHING CASE
Some languages are not case sensitive, such as Pascal.  Others, such as C, are
case sensitive.  You need to tell which type you have with the following
commands:
 :syntax case match
 :syntax case ignore

The "match" argument means that Vim will match the case of syntax elements. Therefore, "int" differs from "Int" and "INT".  If the "ignore" argument is used, the following are equivalent: "Procedure", "PROCEDURE" and "procedure". 
   The ":syntax case" commands can appear anywhere in a syntax file and affect the syntax definitions that follow.  In most cases, you have only one ":syntax case" command in your syntax file; if you work with an unusual language that contains both case-sensitive and non-case-sensitive elements, however, you can scatter the ":syntax case" command throughout the file.



This command is for ignoring case is different from the earlier command :set ic that we have seen earlier.









 PREVIOUS PAGE              GO BACK TO INDEX                  NEXT PAGE

No comments:

Post a Comment