-S option

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

-S option

Jorge Almeida-2
I'm fighting the following strange behaviour:
From an xterm, in Linux:
$ vim -S bar.vim foo.txt

bar.vim is a very basic syntax file. What happens is that foo.txt gets
edited but the syntax highlighting is missing.
I can activate it via
:so bar.vim
but it should not be necessary. What's wrong?

Note that
$ gvim -S bar.vim foo.txt
edits the file with syn. hi. active.


TIA

Jorge Almeida

--
--
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].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/CAKpSnp%2B5xpUUKihXGcoe2ocHmvZy7dh5fVGJj7qoV4U%3DhM3Mjg%40mail.gmail.com.

bar.vim (586 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: -S option

Gary Johnson-4
On 2020-01-11, Jorge Almeida wrote:

> I'm fighting the following strange behaviour:
> >From an xterm, in Linux:
> $ vim -S bar.vim foo.txt
>
> bar.vim is a very basic syntax file. What happens is that foo.txt gets
> edited but the syntax highlighting is missing.
> I can activate it via
> :so bar.vim
> but it should not be necessary. What's wrong?
>
> Note that
> $ gvim -S bar.vim foo.txt
> edits the file with syn. hi. active.

It works for me.

I created the following files,

----------------------------- bar.vim ------------------------------
syn keyword Statement cow
----------------------------- foo.txt ------------------------------
The cow stood in the pasture.
--------------------------------------------------------------------

and ran vim as follows:

    $ vim -N -u NONE --cmd 'syntax on' -S bar.vim foo.txt

The word "cow" was highlighted in yellow, as expected.

The vim I used is a normal version, reasonably up to date.

    $ vim --version
    VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Dec 17 2019 13:33:01)
    Included patches: 1-18
    Compiled by gary@aurora
    Normal version with GTK2 GUI.  Features included (+) or not (-):
    ...

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].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/20200111185152.GA7193%40phoenix.
Reply | Threaded
Open this post in threaded view
|

Re: -S option

Jorge Almeida-2
On Sat, Jan 11, 2020 at 6:52 PM Gary Johnson <[hidden email]> wrote:
>
> On 2020-01-11, Jorge Almeida wrote:
> > I'm fighting the following strange behaviour:
> > >From an xterm, in Linux:
> > $ vim -S bar.vim foo.txt


>     $ vim -N -u NONE --cmd 'syntax on' -S bar.vim foo.txt
>
Thanks a lot. The problem goes away with the '-u NONE' part. So I
checked my .vimrc and the culprit was a custom color scheme I use. The
corresponding file, in .vim/colors/, contained a line 'hi clear",
before my custom colors. I don't know whether it was supposed to be
there or I just put it there , cargo-cult like. Anyway, commenting out
that line yields the desired behaviour.

regards

Jorge

--
--
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].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/CAKpSnp%2B%2BcRn_2PPJpucA%3D%3DHzkqP6oKwA%2BxHnTO8RisNVDKoOgA%40mail.gmail.com.