othree / xml.vim Goto Github PK
View Code? Open in Web Editor NEWhelps editing xml (and [x]html, sgml, xslt) files
Home Page: http://www.vim.org/scripts/script.php?script_id=1397
helps editing xml (and [x]html, sgml, xslt) files
Home Page: http://www.vim.org/scripts/script.php?script_id=1397
Fix some bug by othree. This is a mirror of http://www.vim.org/scripts/script.php?script_id=1397 A plugin for editing xml. I used xml.vim (http://www.vim.org/scripts/script.php?script_id=301) The script does retain most of the functionality of the original xml.vim - closing tags while you type - optional adding attributes - and more - % matches end or begin tag it adds: - fold tags, comments and Cdata - add start tag - add end tags - add tag around a visual blok or a tag, - join 2 adjacent same tags - delete tag - delete tag section - change a tag - visual mode (blocks, listitems The documentation will be created once the script is loaded e.g edit a xml file. Read the help documentation by typing from within vim :help xml-plugin
Hi, your plugin works great with xml files but when i open a php-file i get the following error...transalted from german.
E15: invalid Expression: expand(':p:h')^M
Line 2:
E121: Undefined variable: s:path
E15: invalid expression: 'so ' . s:path . '/xml.vim'^M
Any hints?
greetz Andi
In an xml file :map [[
will tell you that [[
is remapped by this plugin to
n [[ *@m':call <SNR>148_findOpenTag('bW')<CR>
I would like to adjust my visual selection with the motions defined by this plugin.
However, a :xmap [[
will say No Mapping Found
.
I tried a naive approache to add them
~/.vim/pack/minpac/start/xml.vim master*
❯ g diff
diff --git a/ftplugin/xml.vim b/ftplugin/xml.vim
index fc67f1b..0990097 100644
--- a/ftplugin/xml.vim
+++ b/ftplugin/xml.vim
@@ -1479,10 +1479,16 @@ call s:unmapKeys()
call <SID>mapKey('n', ']]', "m':call <SID>findOpenTag('W')<CR>")
call <SID>mapKey('n', '[]', "m':call <SID>findCloseTag('bW')<CR>")
call <SID>mapKey('n', '][', "m':call <SID>findCloseTag('W')<CR>")
+ call <SID>mapKey('x', '[[', "m':call <SID>findOpenTag('bW')<CR>")
+ call <SID>mapKey('x', ']]', "m':call <SID>findOpenTag('W')<CR>")
+ call <SID>mapKey('x', '[]', "m':call <SID>findCloseTag('bW')<CR>")
+ call <SID>mapKey('x', '][', "m':call <SID>findCloseTag('W')<CR>")
" Move around comments {{{2
call <SID>mapKey('n', ']"', substitute(':call search("^\(\s*<!--.*\n\)\@<!\(\s*-->\)", "W")<CR>', '"', "'", 'g'))
call <SID>mapKey('n', '["', substitute(':call search("\%(^\s*<!--.*\n\)\%(^\s*-->\)\@!", "bW")<CR>', '"', "'", 'g'))
+ call <SID>mapKey('x', ']"', substitute(':call search("^\(\s*<!--.*\n\)\@<!\(\s*-->\)", "W")<CR>', '"', "'", 'g'))
+ call <SID>mapKey('x', '["', substitute(':call search("\%(^\s*<!--.*\n\)\%(^\s*-->\)\@!", "bW")<CR>', '"', "'", 'g'))
" insert mode shortcuts {{{2
call <SID>mapKey('i', b:suffix, ' ><Esc>db:call <SID>makeElement()<Cr>')
But this does not work.
Would you be interest in adding them?
Hi othree:
I don't know I should report this bug here or neocomplete. So, I report in neocomplete Shougo/neocomplete.vim#255 first, and also attached a minimal vimrc to reproduce the bug.
Mark
I have xml.vim
installed, but not the matchit
plugin. Thus, b:match_ignorecase
is not set, and when the plugin unloads, the unlet
call gives an error. Other plugins use unlet!
to ignore the errors during onload.
I will submit a PR shortly.
I'm getting the following error in Windows when I install xml.vim
:
The error is showed only once, but the script does not work afterwards (no folding etc).
Install it as follows:
mkdir -p ~/vimfiles/ftplugin
cd ~/vimfiles/ftplugin
curl -O https://raw.githubusercontent.com/othree/xml.vim/master/ftplugin/xml.vim
Vim version:
VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Aug 10 2013 14:38:33)
The problem is we have arrow function in jsx, and >
would trigger the tag expand, the solution is check the previous character and not expand if it's =
.
I'm wondering if a PR like that would be acceptable.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.