Wednesday, April 18, 2018

embedded syntax filetype detection for smart indent

Hi,

In vimscript, is it possible to change filetype detection into embed syntax betwween EOF like this code :


fun! helper#XpathList(A,L,P) "{{{

ruby << EOF

require 'ox'
require 'open-uri'

# 0.on one xml file
xmlpath = ENV['tmp']+"/localConf.xml"
doc = Ox.parse(open(xmlpath).read)

# 1.retrieve all sorted child possible elements'name
arr = doc.root.locate('*/' + Vim::evaluate('a:A') )

arr_out = {}
arr.each do |a|
a.each do |key, value|
arr_out[key.value]=""
end
end

# 2.Proposal Array/Vim List returned
Vim::command("return " + arr_out.keys().to_s )

EOF # Ruby end
endfunction "}}}
" }}} Vimscript end


Finally could we use smart gg=GG that will understand vim syntax and embed delimited syntax like ruby, python etc..

See :h ruby

Thank you

--
--
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 vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments: