syntax for EOF ruby/python/other lang in vimscript

10 views
Skip to first unread message

Ni Va

unread,
Feb 10, 2018, 11:40:30 AM2/10/18
to vim_use
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


Andy Wokula

unread,
Feb 10, 2018, 1:29:20 PM2/10/18
to vim...@googlegroups.com
Configurable:
:h ft-vim-syntax

--
Andy

Ni Va

unread,
Feb 10, 2018, 1:42:37 PM2/10/18
to vim...@googlegroups.com

Thank y ou.


--
--
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 a topic in the Google Groups "vim_use" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/vim_use/Ce0aESekw8Q/unsubscribe.
To unsubscribe from this group and all its topics, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages