Results 1 to 4 of 4

Thread: wierd problem with vi/konsole

  1. #1

    Default wierd problem with vi/konsole

    Hello, Guys

    I just notice something on my laptop.

    Everytime I create a text file for perl, vi/konsole does not show me the syntax highlight and indent until I save the file and reopen it.

    So I am wandering if any of you have this issue or not.

    I running the latest version of kde and openSUSE 64bit.

    Thanks,

  2. #2
    Barry Nichols NNTP User

    Default Re: wierd problem with vi/konsole

    yeast2u <yeast2u@no-mx.forums.opensuse.org> writes:

    > Hello, Guys
    >
    > I just notice something on my laptop.
    >
    > Everytime I create a text file for perl, vi/konsole does not show me
    > the syntax highlight and indent until I save the file and reopen it.
    >
    > So I am wandering if any of you have this issue or not.
    >
    > I running the latest version of kde and openSUSE 64bit.
    >
    > Thanks,


    Could it be that the file name extension is used to decide what syntax
    highlighting to use?

    --
    Regards,
    Barry Nichols

  3. #3

    Default Re: wierd problem with vi/konsole

    Quote Originally Posted by Barry Nichols View Post
    yeast2u <yeast2u@no-mx.forums.opensuse.org> writes:

    > Hello, Guys
    >
    > I just notice something on my laptop.
    >
    > Everytime I create a text file for perl, vi/konsole does not show me
    > the syntax highlight and indent until I save the file and reopen it.
    >
    > So I am wandering if any of you have this issue or not.
    >
    > I running the latest version of kde and openSUSE 64bit.
    >
    > Thanks,


    Could it be that the file name extension is used to decide what syntax
    highlighting to use?
    --
    Regards,
    Barry Nichols
    It could be that. Thanks,

  4. #4

    Default Re: wierd problem with vi/konsole

    vi can't determine the syntax highlight to use without something to go on. Usually this is the file name but I think it can also figure it out from the #! at the top.

    If you want to tell vi what syntax to use (either because it doesn't know or its wrong) hit Esc and type the following
    Code:
    :set syntax=perl
    replace "perl" with whatever syntax highlight you want to use e.g. python, cpp, sh (heaps more are supported).

    There is a way to tell vim what file types to associate with particular highlighters in your ~/.vimrc file but I'll leave that as an exercise for the reader.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •