2018-02-11 1:58 GMT+03:00 Ni Va <[email protected]>:
> Le samedi 10 février 2018 21:17:16 UTC+1, Tony Mechelynck a écrit :
>> On Sat, Feb 10, 2018 at 7:29 PM, 'Andy Wokula' via vim_use
>> <[email protected]> wrote:
>> > Am 10.02.2018 um 17:40 schrieb Ni Va:
>> >>
>> >> Hi,
>> >>
>> >> Like :h ruby says, I use this kind of script ruby interface below.
>> >>
>> >> How can i make vim switch automatically to ruby syntax in EOF section and
>> >> rest of time stay in vim syntax ?
>> >> Thank you
>> >>
>> >>
>> >> Example Vim script: >
>> >>
>> >>         function! RedGem()
>> >>         ruby << EOF
>> >>         class Garnet
>> >>                 def initialize(s)
>> >>                         @buffer = Vim::Buffer.current
>> >>                         vimputs(s)
>> >>                 end
>> >>                 def vimputs(s)
>> >>                         @buffer.append(@buffer.count,s)
>> >>                 end
>> >>         end
>> >>         gem = Garnet.new("pretty")
>> >>         EOF
>> >>         endfunction
>> >
>> >
>> > Configurable:
>> >     :h ft-vim-syntax
>> >
>> > --
>> > Andy
>>
>> Under :h g:vimsyn_embed it says: «By default, g:vimsyn_embed is a
>> string supporting interpreters that your vim itself supports.»
>> However, my gvim is compiled with +lua -mzscheme +perl +python
>> -python3 +ruby +tcl, and I don't set that variable in my vimrc (or
>> anywhere else AFAIK), yet it is set to 'lmpPr' as if I had compiled
>> with +mzscheme -tcl. How come?
>>
>> N.B. The same value is set if I run "view -u
>> /usr/local/share/vim/vim80/vimrc_example.vim ~/.vimrc" i.e. _viewing_
>> my vimrc (so that the vim ftplugin gets sourced) but not _sourcing_
>> it.
>>
>> Best regards,
>> Tony.
>
> Hi Tony,
>
> My version has all supports lua/python/ruby but meanwhile setting let 
> g:vimsyn_embed = 'r' in _vimrc it appears that not working because of 
> s:rubypath undefined as is in vim80/syntax.vim:
>
> let s:rubypath= fnameescape(expand("<sfile>:p:h")."/ruby.vim")
> if !filereadable(s:rubypath)
>  for s:rubypath in split(globpath(&rtp,"syntax/ruby.vim"),"\n")
>   if filereadable(fnameescape(s:rubypath))
>    let s:rubypath= fnameescape(s:rubypath)
>    break
>   endif
>  endfor
> endif
> if (g:vimsyn_embed =~# 'r' && has("ruby")) && filereadable(s:rubypath)
>
>
>
> expand("<sfile>:p:h") <<< returns nothing.

How are you checking this? Using `<sfile>` makes no sense anywhere,
but in a script file. Note: anywhere includes functions defined in a
script file. Check `:h <sfile>`.

>
> Thank you
>
> --
> --
> You received this message from the "vim_dev" 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_dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.

-- 
-- 
You received this message from the "vim_dev" 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_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui