Quantcast

VIM loses syntax highlighting when using split command

classic Classic list List threaded Threaded
20 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

VIM loses syntax highlighting when using split command

naaj_ila
This post was updated on .
In my home directory
"verilog.vim" file is there, which defines syntax highlighting whnever we will open <filename>.v files.
In .vimrc , i added "source ~/verilog.vim" .

Example: file1.v
module test ;
$display("Hello");
endmodule

"module", "display" are keywords and they will be in  colour/highlighted .

Whenever a single file(say file1.v) is opened , its working fine (syntax highlight is working)


whne i opened another file(file2.v)  in the file1.v using ":sp file2.v" or ":tabnew file2.v"
For file2.v syntax highlight is not enabled/working  , file1.v syntax is still OK.


Can anybody tell step by step what i have to do to resolve this problem


---------------------------------------.vimrc-------------------------------------------------

filetype on
set t_kb=^?
set t_kD=^H
set backspace=indent,eol,start
set backspace=indent,eol,start

"set  guifont=Calibri\ Regular\ 14
"shows the opening bracket whenever a bracket is closed
se showmatch

se ai
se nu
se ic

" set backspace
"se bs=2

" expands all tab into spaces
se expandtab
set hlsearch

" searches even while yo uare typing the search pattern
set incsearch



syntax on
"filetype plugin on

" will remember what were the last 100 commands executed till now.
set history=100

" set color to morning
"color morning

"show the cursor position all the time
se ruler

autocmd!


"set  guifont=Courier\ Regular\ 40
set gfn=Monospace\ 40
source ~/verilog.vim
source ~/verilog_systemverilog.vim
"set  guifont=Courier\ 16
source ~/vimfiles/matchit.vim
let b:match_words = '\<begin\>:\<end\>,'.'\<class\>:\<endclass\>,'.'\<task\>:\<endtask\>,'.'\<case\>:\<endcase\>'
"filetype plugin on
"filetype syntax on
"filetype indent on
":ft-vim-syntax
----------------------------------------------------------------------------------
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Syntax highlight not happening on :newtab <filename>

Christian Brabandt
On Wed, January 30, 2013 09:47, naaj_ila wrote:

> If i opened a file <file1>
> 1)gvim file1.v     -- syntax highlight is enabled
> 2):tabnew file2.v  -- syntax highlight is gone
> 3):sp file3.v     -- syntax highligh is gone
>
>
> Can anybody tell step by step what i have to do to resolve this problem
>
> Just for info::: ".vimrc" , "verilog.vim" file are in the same place
>

The question is, what did you do to make Vim recognize .v files
and what did you do with the verilog.vim file? Please give us
more input here.

regards,
Christian

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Syntax highlight not happening on :newtab <filename>

naaj_ila
In my home directory
"verilog.vim" file is there, which defines syntax highlighting whnever we will open <filename>.v files.
In .vimrc , i added "source ~/verilog.vim" .

Example: file1.v
module test ;
$display("Hello");
endmodule

"module", "display" are keywords and they will be in  colour/highlighted .

Whenever a single file(say file1.v) is opened , its working fine (syntax highlight is working)


whne i opened another file(file2.v)  in the file1.v using ":sp file2.v" or ":newtab file2.v"
For file2.v syntax highlight is not enabled/working  , file1.v syntax is still OK.

 
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Syntax highlight not happening on :newtab <filename>

Gary Johnson-4
On 2013-01-30, naaj_ila wrote:

> In my home directory
> "verilog.vim" file is there, which defines syntax highlighting whnever we
> will open <filename>.v files.
> In .vimrc , i added "source ~/verilog.vim" .
>
> Example: file1.v
> module test ;
> $display("Hello");
> endmodule
>
> "module", "display" are keywords and they will be in  colour/highlighted .
>
> Whenever a single file(say file1.v) is opened , its working fine (syntax
> highlight is working)
>
>
> whne i opened another file(file2.v)  in the file1.v using ":sp file2.v" or
> ":newtab file2.v"
> For file2.v syntax highlight is not enabled/working  , file1.v syntax is
> still OK.

Syntax files such as your verilog.vim contain :syntax commands that
assign colors to patterns.  The scope of those :syntax commands is
the current buffer.  (I can't find that in the documentation.)  When
you open a new buffer, the :syntax commands from the original buffer
are not applied to the new buffer.

When you start vim to open a file, the "source ~/verilog.vim"
command in your ~/.vimrc executes a number of :syntax commands that
apply colors to the contents of that first buffer.  When you open
another file, that file is opened into a new buffer that has no
:syntax commands applied to it, so you see no colors.

The problem is that you are not using Vim's syntax highlighting
facility as it was designed to be used.  You are throwing commands
into your ~/.vimrc and hoping for the best.   You should probably
read

    :help usr_06.txt
    :help usr_43.txt

To fix this problem, you need to:

1.  Move ~/verilog.vim to ~/.vim/syntax/verilog.vim where it
    belongs;

2.  Remove the "source ~/verilog.vim" command from your ~/.vimrc;

3.  Add to your ~/.vimrc the command "syntax on".

Vim already knows that the .v suffix means that the file type is
verilog.

HTH,
Gary

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Syntax highlight not happening on :newtab <filename>

naaj_ila
Hi Gary ,
Followed the steps which you had given,
but its not working
Even opening the  single file is not having the syntax enabled .
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Syntax highlight not happening on :newtab <filename>

Gary Johnson-4
On 2013-01-31, naaj_ila wrote:
> Hi Gary ,
> Followed the steps which you had given,
> but its not working
> Even opening the  single file is not having the syntax enabled .

I just tried the following experiments.  I first created a ~/file1.v
from your example, then copied the default verilog.vim to my ~/.vim
hierarchy:

    cp /usr/local/share/vim/vim73/syntax/verilog.vim ~/.vim/syntax

1.  
        vim -N -u NONE --cmd 'syntax on' file1.v

    The file was syntax highlighted.

        :scriptnames
          1: /usr/local/share/vim/vim73/syntax/syntax.vim
          2: /usr/local/share/vim/vim73/syntax/synload.vim
          3: /usr/local/share/vim/vim73/syntax/syncolor.vim
          4: /usr/local/share/vim/vim73/filetype.vim
          5: ~/.vim/syntax/verilog.vim
          6: /usr/local/share/vim/vim73/syntax/verilog.vim

2.
    Created a file2.v identical to file1.v with Hello changed to
    Goodbye.

    Moved my ~/.vimrc asided and created a new one containing only

        syntax on

    Executed

        vim file1.v
        :split file2.v

    Both buffers are highlighted.

Something in your configuration is keeping file1.v from being
properly syntax highlighted.  It works for me with my normal
configuration and with a minimal configuration with just "syntax
on".  We just need to find out what in your configuration is keeping
this from working for you.

One approach is for you to start with a minimal configuration, get
highlighting to work, then add pieces of your normal configuration
until highlighting stops.

Why are you using your own verilog.vim instead of the default
$VIMRUNTIME/syntax/verilog.vim?

Regards,
Gary

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Syntax highlight not happening on :newtab <filename>

Ben Fritz
In reply to this post by naaj_ila
On Thursday, January 31, 2013 3:24:59 AM UTC-6, ali jaan wrote:
> Hi Gary ,
>
> Followed the steps which you had given,
>
> but its not working
>
> Even opening the  single file is not having the syntax enabled .
>

Is filetype detection turned on in your .vimrc?

Some systems turn it on by default in a "system .vimrc" but others do not.

Try putting

  filetype plugin indent on

or

  filetype plugin on

or

  filetype indent on

or

  filetype on

into your .vimrc, before the "sytnax on" command.

:help :filetype
:help :filetype-overview
:help filetype-detect

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Syntax highlight not happening on :newtab <filename>

Gary Johnson-4
On 2013-01-31, Ben Fritz wrote:

> Is filetype detection turned on in your .vimrc?
>
> Some systems turn it on by default in a "system .vimrc" but others do not.
>
> Try putting
>
>   filetype plugin indent on
>
> or
>
>   filetype plugin on
>
> or
>
>   filetype indent on
>
> or
>
>   filetype on
>
> into your .vimrc, before the "sytnax on" command.
>
> :help :filetype
> :help :filetype-overview
> :help filetype-detect

The "filetype on" command is not needed for "syntax on" to work.

Regards,
Gary

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Syntax highlight not happening on :newtab <filename>

Ben Fritz
On Thursday, January 31, 2013 12:01:53 PM UTC-6, Gary Johnson wrote:
>
> The "filetype on" command is not needed for "syntax on" to work.
>

But, doesn't Vim use the filetype to figure out which syntax file to load?

From the help:

                                                        *:filetype* *:filet*
To enable file type detection, use this command in your vimrc: >
        :filetype on
Each time a new or existing file is edited, Vim will try to recognize the type
of the file and set the 'filetype' option.  This will trigger the FileType
event, which can be used to set the syntax highlighting, set options, etc.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Syntax highlight not happening on :newtab <filename>

Gary Johnson-4
On 2013-01-31, Ben Fritz wrote:
> On Thursday, January 31, 2013 12:01:53 PM UTC-6, Gary Johnson wrote:
> >
> > The "filetype on" command is not needed for "syntax on" to work.
> >
>
> But, doesn't Vim use the filetype to figure out which syntax file to load?

Yes, but if filetype detection is not already enabled when "syntax
on" is executed, the syntax system enables it itself.

The command "syntax on" sources the file
$VIMRUNTIME/syntax/syntax.vim.  You can see in that file where
"filetype on" is executed.

Regards,
Gary

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Syntax highlight not happening on :newtab <filename>

naaj_ila
This post was updated on .
Hi Gary ,

Thanks for the reply.
I observed one thing, if i commente thsi text from .vimrc
"source ~/.vim/syntax/verilog.vim".
Syntax is not highlighted for single file itself.

Just for info:::
My home directory files
.vim  
.vim/syntax/verilog.vim
.vim/syntax/verilog_systemverilog.vim
.vimrc
.cshrc

-------------------------------------.vimrc------------------------------

syntax on
syntax enable
set backspace=indent,eol,start
set backspace=indent,eol,start


"shows the opening bracket whenever a bracket is closed
se showmatch

se ai
se nu
se ic

" set backspace
"se bs=2

" expands all tab into spaces
se expandtab
set hlsearch

" searches even while yo uare typing the search pattern
set incsearch

" will remember what were the last 100 commands executed till now.
set history=100

" set color to morning
"color morning

"show the cursor position all the time
se ruler
autocmd!
set gfn=Monospace\ 40
"source ~/.vim/syntax/verilog.vim
"source ~/.vim/syntax/verilog_systemverilog.vim


--------------------------------------------------------


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Syntax highlight not happening on :newtab <filename>

Christian Brabandt
On Fri, February 1, 2013 05:51, naaj_ila wrote:

> Hi Gary ,
>
> Thanks for the reply.
> By default, when i used "which vim" . It shows "/usr/<comp_name>/bin/vim"
> .
> I didnot like taht version of vim .
> So in my .cshrc file i used an alias like this
>
> "alias vim /usr/<comp_name>/pkgs/vim/7.2/bin/vim" . I liked this version.
>
> Is this effecting anyways?

Possibly.

It would help, if you started answering the questions,
that have been asked. Try to redo the examples given by Gary in
<20130131162709.GA1644@phoenix> and show us the result.

BTW: Where did you get the verilog.vim file from (there should be
some installation instructions other then drop into your .vim
directory, this is usually just plain wrong)? And what is wrong
with the one that is bundled with vim?

regards,
Christian

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Syntax highlight not happening on :newtab <filename>

Gary Johnson-4
On 2013-02-01, Christian Brabandt wrote:

> On Fri, February 1, 2013 05:51, naaj_ila wrote:
> > Hi Gary ,
> >
> > Thanks for the reply.
> > By default, when i used "which vim" . It shows "/usr/<comp_name>/bin/vim"
> > .
> > I didnot like taht version of vim .
> > So in my .cshrc file i used an alias like this
> >
> > "alias vim /usr/<comp_name>/pkgs/vim/7.2/bin/vim" . I liked this version.
> >
> > Is this effecting anyways?
>
> Possibly.
>
> It would help, if you started answering the questions,
> that have been asked. Try to redo the examples given by Gary in
> <20130131162709.GA1644@phoenix> and show us the result.

I thought of another command that might give us more information
than my previous suggestions.  Execute the following at your shell
prompt.

    vim -N -u NONE -i NONE -V9verbose --cmd 'syntax on' file1.v

Then execute the following within vim.

    :sp file2.v

Note any syntax highlighting in either window, then execute

    :qa

There will be a file in the current directory named verbose which
will contain a record of the autocommands executed and files
sourced.  See ":help 'verbose'" for more on what is in that file.
Open the file and verify that it doesn't contain any sensitive
information (it shouldn't).  Then attach it to your next reply to
this list.

If you saw file2.v properly highlighted, then there is something in
one of your configuration files that is causing the problem.  In
that case, you could repeat the steps above starting with this
command,

    vim -V9verbose2 file1.v

and also attach the file verbose2 to your next reply.

Regards,
Gary

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: VIM loses syntax highlighting when using split command

naaj_ila
This post was updated on .
In reply to this post by naaj_ila
Hi Gary ,
Its working fine
i added these things in ~/.vim/syntax/filetype.vim

augroup filetypedetect
au! BufRead,BufNewFile *.v so ~/.vim/syntax/verilog.vim
augroup END


Working fine from now
-----------------------------------------------------
I need one more help

Whenever ,  i wanted to open VIm in new buffer via (sp and tabnew ) , i need to source one command

:let b:match_words = '\<begin\>:\<end\>,'.'\<class\>:\<endclass\>,'.'\<task\>:\<endtask\>,'.'\<case\>:\<endcase\>'

How can i do that
I added thsi one in .vimrc. Its working only for one file but not in split files


 

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: VIM loses syntax highlighting when using split command

Gary Johnson-4
On 2013-02-01, naaj_ila wrote:

> Hi Gary ,
> Its working fine
> i added these things in ~/.vim/syntax/filetype.vim
>
> augroup filetypedetect
> au! BufRead,BufNewFile *.v so ~/.vim/syntax/verilog.vim
> augroup END
>
>
> Working fine from now

How does putting that in ~/.vim/syntax/filetype.vim help you?  That
file should be sourced by vim only when you open a file whose file
type is filetype.

While your solution may work in this instance, it is not the
standard way of doing these things.  If your version of vim does not
automatically detect verilog files, a proper solution is to put
something like this

    augroup filetypedetect
        au! BufRead,BufNewFile *.v setfiletype verilog
    augroup END

in ~/.vim/filetype.vim.  Vim will then take care of sourcing
~/.vim/syntax/verilog.vim for you if you have "syntax on".  It will
also source any other verilog plugins such as
~/.vim/ftplugin/verilog.vim if you have an appropriate "filetype on"
command in your ~/.vimrc.  See

    :help new-filetype

There is nothing wrong with doing things a non-standard way as long
as you know what you're doing.  If you're not sure what you're
doing, or you seem to be having difficulty in getting something to
work, it is better to follow the standard methods as you will have
fewer problems and it will be easier for others to help you.

> -----------------------------------------------------
> I need one more help
>
> Whenever ,  i wanted to open VIm in new buffer via (sp and tabnew ) , i need
> to source one command
>
> :let b:match_words =
> '\<begin\>:\<end\>,'.'\<class\>:\<endclass\>,'.'\<task\>:\<endtask\>,'.'\<case\>:\<endcase\>'
>
> How can i do that
> I added thsi one in .vimrc. Its working only for one file but not in split
> files

It's not working for any but the first file you open because
b:match_words is a buffer-local variable.  See

    :help buffer-variable

The setting of b:match_words should be done in a filetype plugin so
that it is done for every buffer of that filetype.  In this case, it
should be put in ~/.vim/ftplugin/verilog.vim or
~/.vim/after/ftplugin/verilog.vim.

This is a good example of why your autocommand above should set the
filetype to verilog instead of sourcing your syntax file.  If you
set the filetype properly, things like filetype plugins just work.

Regards,
Gary

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: VIM loses syntax highlighting when using split command

Christian Brabandt
In reply to this post by naaj_ila
Hi naaj_ila!

On Fr, 01 Feb 2013, naaj_ila wrote:

> Whenever ,  i wanted to open VIm in new buffer via (sp and tabnew ) , i need
> to source one command
>
> :let b:match_words =
> '\<begin\>:\<end\>,'.'\<class\>:\<endclass\>,'.'\<task\>:\<endtask\>,'.'\<case\>:\<endcase\>'
>
> How can i do that
> I added thsi one in .vimrc. Its working only for one file but not in split
> files

What was wrong with the answer you received last time?

regards,
Christian
--
Oft tut auch der Unrecht, der nichts tut. Wer das Unrecht nicht
verbietet, wenn er kann, der befiehlt es.
                -- Mark Aurel (römischer Kaiser, 121-180)

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: VIM loses syntax highlighting when using split command

Christian Brabandt
In reply to this post by naaj_ila
Hi naaj_ila!

On Fr, 01 Feb 2013, naaj_ila wrote:

> Its working fine
> i added these things in ~/.vim/syntax/filetype.vim

This looks totally wrong.
>
> augroup filetypedetect
> au! BufRead,BufNewFile *.v so ~/.vim/syntax/verilog.vim
> augroup END

I am wondering, why do you need this? Vim should automatically detect
*.v files as verilog files? Does yours not?

Try this: vim -u NONE -N file.v

What does Vim tell you, after entering:

:filetype detect
:set ft?

regards,
Christian
--
Lieber Kaker-Laken, als gar keine Bettwäsche.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: VIM loses syntax highlighting when using split command

Christian Brabandt
In reply to this post by naaj_ila
Hi alijohnshaik!
(redirecting to vim_use)

On Sa, 02 Feb 2013, [hidden email] wrote:

> <quote author='Christian Brabandt'>
> Hi naaj_ila!
>
> On Fr, 01 Feb 2013, naaj_ila wrote:
>
> > Its working fine
> > i added these things in ~/.vim/syntax/filetype.vim
>
> This looks totally wrong.
> >
> > augroup filetypedetect
> > au! BufRead,BufNewFile *.v so ~/.vim/syntax/verilog.vim
> > augroup END
>
> I am wondering, why do you need this? Vim should automatically detect
> *.v files as verilog files? Does yours not?
>
> Try this: vim -u NONE -N file.v
>
> What does Vim tell you, after entering:
>
> :filetype detect
> :set ft?
> --------------------------------------
> Its coming like this  after executing the command
> filetype =
> -----------------------------------

Interesting. Your vim does not by default detect verilog files. What vim
version is this?

To make vim recognize .v files as verilog filetypes, put the following
into your .vimrc:
filetype plugin on

Now create a file called ~/.vim/ftdetect/verilog.vim (create
non-existing directories) and put in that file:
,----
| au BufRead,BufNewFile *.v set filetype=verilog
`----

and then place your verilog.vim syntax file into
~/.vim/syntax/ (again, creating non-existent directories).
(and make sure, your .vimrc contains:
:syntax on


See also the help at :h new-filetype and have a look at section 26 of
the faq http://vimhelp.appspot.com/vim_faq.txt.html

regards,
Christian
--
Was kann an der Arbeit gut sein, wenn die Reichen sie den Armen überlassen.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: VIM loses syntax highlighting when using split command

naaj_ila
Thanks Christian 

Yeah its wroking fine 


On Sun, Feb 3, 2013 at 6:26 PM, Christian Brabandt <[hidden email]> wrote:
Hi alijohnshaik!
(redirecting to vim_use)

On Sa, 02 Feb 2013, [hidden email] wrote:

> <quote author='Christian Brabandt'>
> Hi naaj_ila!
>
> On Fr, 01 Feb 2013, naaj_ila wrote:
>
> > Its working fine
> > i added these things in ~/.vim/syntax/filetype.vim
>
> This looks totally wrong.
> >
> > augroup filetypedetect
> > au! BufRead,BufNewFile *.v so ~/.vim/syntax/verilog.vim
> > augroup END
>
> I am wondering, why do you need this? Vim should automatically detect
> *.v files as verilog files? Does yours not?
>
> Try this: vim -u NONE -N file.v
>
> What does Vim tell you, after entering:
>
> :filetype detect
> :set ft?
> --------------------------------------
> Its coming like this  after executing the command
> filetype =
> -----------------------------------

Interesting. Your vim does not by default detect verilog files. What vim
version is this?

To make vim recognize .v files as verilog filetypes, put the following
into your .vimrc:
filetype plugin on

Now create a file called ~/.vim/ftdetect/verilog.vim (create
non-existing directories) and put in that file:
,----
| au BufRead,BufNewFile *.v set filetype=verilog
`----

and then place your verilog.vim syntax file into
~/.vim/syntax/ (again, creating non-existent directories).
(and make sure, your .vimrc contains:
:syntax on


See also the help at :h new-filetype and have a look at section 26 of
the faq http://vimhelp.appspot.com/vim_faq.txt.html

regards,
Christian
--
Was kann an der Arbeit gut sein, wenn die Reichen sie den Armen überlassen.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
 
---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: VIM loses syntax highlighting when using split command

Venu Gopal
In reply to this post by Christian Brabandt
I had the same issue, but is now solved with your solution.

Thanks, Christian!


On Sunday, February 3, 2013 4:56:22 AM UTC-8, Christian Brabandt wrote:

> Hi alijohnshaik!
>
> (redirecting to vim_use)
>
>
>
> On Sa, 02 Feb 2013, [hidden email] wrote:
>
>
>
> > <quote author='Christian Brabandt'>
>
> > Hi naaj_ila!
>
> >
>
> > On Fr, 01 Feb 2013, naaj_ila wrote:
>
> >
>
> > > Its working fine
>
> > > i added these things in ~/.vim/syntax/filetype.vim
>
> >
>
> > This looks totally wrong.
>
> > >
>
> > > augroup filetypedetect
>
> > > au! BufRead,BufNewFile *.v so ~/.vim/syntax/verilog.vim
>
> > > augroup END
>
> >
>
> > I am wondering, why do you need this? Vim should automatically detect
>
> > *.v files as verilog files? Does yours not?
>
> >
>
> > Try this: vim -u NONE -N file.v
>
> >
>
> > What does Vim tell you, after entering:
>
> >
>
> > :filetype detect
>
> > :set ft?
>
> > --------------------------------------
>
> > Its coming like this  after executing the command
>
> > filetype =
>
> > -----------------------------------
>
>
>
> Interesting. Your vim does not by default detect verilog files. What vim
>
> version is this?
>
>
>
> To make vim recognize .v files as verilog filetypes, put the following
>
> into your .vimrc:
>
> filetype plugin on
>
>
>
> Now create a file called ~/.vim/ftdetect/verilog.vim (create
>
> non-existing directories) and put in that file:
>
> ,----
>
> | au BufRead,BufNewFile *.v set filetype=verilog
>
> `----
>
>
>
> and then place your verilog.vim syntax file into
>
> ~/.vim/syntax/ (again, creating non-existent directories).
>
> (and make sure, your .vimrc contains:
>
> :syntax on
>
>
>
>
>
> See also the help at :h new-filetype and have a look at section 26 of
>
> the faq http://vimhelp.appspot.com/vim_faq.txt.html
>
>
>
> regards,
>
> Christian
>
> --
>
> Was kann an der Arbeit gut sein, wenn die Reichen sie den Armen �berlassen.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
Loading...