On 05/03/10 05:08, Aman Jain wrote:
Hi
Sometimes I would like to save the text of a webpage, so that
I don't have to copy it over from a browser to vim.
I did :e http://www.somewebsite.com
and vim shows html for the website.
Is there a way such that I get to see only the text, and not
the html tags.
Thanks
Aman Jain
Well, with an appropriately crafted colour scheme you could link the
various highlight groups used from < to > included to the Ignore
standard group: they will then normally be displayed as "invisible",
with background and foreground both equal to the default background.
These tags will then occupy space but that space will be shown empty
(moving the cursor over it, or yanking, or using ga etc. will still see
the "invisible" text, of course). This can be done on plain-vanilla vim
(compiled with +syntax, of course, which I think implies also +eval
+autocmd and maybe some others), by means of a rather simple colorscheme.
Or, by adding Vince Negri's "conceal/ownsyntax" patch (item 14 on the
"Unofficial patches" page,
http://groups.google.com/group/vim_dev/web/vim-patches ) and recompiling
Vim, then adding some vim-script code of which I don't know the details
but the helpfile that comes with the patch explains them, you could even
arrange that the syntax groups in question occupy no screen space at
all. I haven't tested this patch myself though.
In either case, remember that Vim was never meant as a WYSIWYG editor.
If you want to see <IMG> as pictures, <TABLE> in lines and columns, <UL>
as bulleted lists, <OL> as numbered lists, <HR> has horizontal divider
lines, and <HEAD> as not displayed (to mention only a few), it's better
to save the file to disk (a local disk is all right) and view it in a
browser (with file:/// prefixed for a local files, and in all cases
forward slashes as path divider and %xx hex escaping for spaces and
other "wild" characters in the pathname).
Best regards,
Tony.
--
If all the world's a stage, I want to operate the trap door.
-- Paul Beatty
--
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