Loading ...
Sorry, an error occurred while loading the content.
 

Re: color scheme for HTML

Expand Messages
  • Ben Fritz
    ... Ok, but a colorsheme is just colors. It has no affect whatsoever on what text is displayed. You re basically asking how do I set the background color of
    Message 1 of 7 , Apr 23, 2013
      On Tuesday, April 23, 2013 11:27:33 AM UTC-5, A HV wrote:
      > On Tuesday, 23 April 2013 17:02:12 UTC+2, Ben Fritz wrote:
      > > On Tuesday, April 23, 2013 9:30:52 AM UTC-5, A HV wrote:
      > > > Hello all,
      > > > Is it possible and how to set up a Color Scheme for HTML documents?
      > > > I use curl | vim to open HTML URLs by Vim but it is in HTML code. Is it possible to switch between the HTML code and formated document in Vim? Like eLinks does for saving HTML pages like formated document :).
      > > > Thanks
      > > > Anton
      > >
      > > You are NOT asking for a color scheme. I don't know why you would have thought that.
      > >
      > > You're asking Vim to parse HTML like a web browser. Vim does not and probably can not do that.
      > >
      > > For VERY simple HTML documents it might be possible to hack together a syntax script using the 'conceal' feature to hide the HTML tags and format text with bold, italics, and underline. It MIGHT be further possible to colorize the text. But you probably cannot support all possible 24-bit colors and their various combinations with bold, underline, italic, etc. with a static syntax script.
      > >
      > > If you're just trying to view the text, you can either use syntax highlighting to conceal all HTML tags (and maybe replace some common character entities with their character), or pipe it through a text web browser like eLinks on the way to Vim.
      >
      > Hello Ben Fritz,
      >
      > I make notes for my studies (for example the way like Vim help organized), Why HTML, it is because a lot of information is on-line and HTML has much more possibilities than text. I would like to get the information in native format (HTML or other in case of another language) in Vim for editing and the same time formated to be able to read it like normal text document in Vim. Something like interactive notebook.
      >
      > I had set up color scheme for Vim by Yakov Lerner.
      > ScrollColors : Colorsheme Scroller, Chooser, and Browser
      > http://www.vim.org/scripts/script.php?script_id=1488
      > It works well, I am looking for the second part of my interactive book a switch to get HTML to formated text feature. I will check for the 'conceal' feature and hide, show by color possibility.
      > Thank you for advise.
      >
      > Anton

      Ok, but a colorsheme is just colors. It has no affect whatsoever on what text is displayed. You're basically asking "how do I set the background color of my desktop to allow me to play games?" The two are completely unrelated.

      I still don't understand your use case. Are you looking for a way to edit formatted text within Vim? Maybe try the txtfmt plugin: http://www.vim.org/scripts/script.php?script_id=2208

      If you want to later export your txtfmt file into HTML, Vim's :TOhtml command can do that for you.

      If you want nice bullets, etc. as well then I'd suggest just using nice characters for it.

      Unicode offers a huge range of them, some of which I use often enough I've even created my own digraphs for them (:help digraph):

      digraph li 8226 " Bullet
      digraph l1 8226 " level-1 bullet
      digraph l2 8227 " level-2 bullet
      digraph l3 8728 " level-3 bullet

      These allow me to type CTRL+K li, l1, l2, or l3 to insert: •, •, ‣, or ∘into my text.

      You can make this better by setting your 'formatlistpat' option to include these for automatic list formatting. Here's how I do that (plus a few other characters I like to use for bullets and the like sometimes):

      scriptencoding utf-8
      let &l:formatlistpat='^\s*\%(\d\+[\]:.)}\t ]\d\@!\|[•‣∘—–»*†×✓✗↳-]\)\s*'

      --
      --
      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@....
      For more options, visit https://groups.google.com/groups/opt_out.
    • Mike Hume
      What about using markdown for note taking. It sounds like you are juggling between note taking and previewing the formatting of text. Markdown would help alot
      Message 2 of 7 , Apr 23, 2013
        What about using markdown for note taking. It sounds like you are juggling between note taking and previewing the formatting of text. Markdown would help alot with the juggling part. Are you running vim from a terminal?

        ~Mike

        On Apr 23, 2013, at 9:41 AM, Ben Fritz <fritzophrenic@...> wrote:

        > On Tuesday, April 23, 2013 11:27:33 AM UTC-5, A HV wrote:
        >> On Tuesday, 23 April 2013 17:02:12 UTC+2, Ben Fritz wrote:
        >>> On Tuesday, April 23, 2013 9:30:52 AM UTC-5, A HV wrote:
        >>>> Hello all,
        >>>> Is it possible and how to set up a Color Scheme for HTML documents?
        >>>> I use curl | vim to open HTML URLs by Vim but it is in HTML code. Is it possible to switch between the HTML code and formated document in Vim? Like eLinks does for saving HTML pages like formated document :).
        >>>> Thanks
        >>>> Anton
        >>>
        >>> You are NOT asking for a color scheme. I don't know why you would have thought that.
        >>>
        >>> You're asking Vim to parse HTML like a web browser. Vim does not and probably can not do that.
        >>>
        >>> For VERY simple HTML documents it might be possible to hack together a syntax script using the 'conceal' feature to hide the HTML tags and format text with bold, italics, and underline. It MIGHT be further possible to colorize the text. But you probably cannot support all possible 24-bit colors and their various combinations with bold, underline, italic, etc. with a static syntax script.
        >>>
        >>> If you're just trying to view the text, you can either use syntax highlighting to conceal all HTML tags (and maybe replace some common character entities with their character), or pipe it through a text web browser like eLinks on the way to Vim.
        >>
        >> Hello Ben Fritz,
        >>
        >> I make notes for my studies (for example the way like Vim help organized), Why HTML, it is because a lot of information is on-line and HTML has much more possibilities than text. I would like to get the information in native format (HTML or other in case of another language) in Vim for editing and the same time formated to be able to read it like normal text document in Vim. Something like interactive notebook.
        >>
        >> I had set up color scheme for Vim by Yakov Lerner.
        >> ScrollColors : Colorsheme Scroller, Chooser, and Browser
        >> http://www.vim.org/scripts/script.php?script_id=1488
        >> It works well, I am looking for the second part of my interactive book a switch to get HTML to formated text feature. I will check for the 'conceal' feature and hide, show by color possibility.
        >> Thank you for advise.
        >>
        >> Anton
        >
        > Ok, but a colorsheme is just colors. It has no affect whatsoever on what text is displayed. You're basically asking "how do I set the background color of my desktop to allow me to play games?" The two are completely unrelated.
        >
        > I still don't understand your use case. Are you looking for a way to edit formatted text within Vim? Maybe try the txtfmt plugin: http://www.vim.org/scripts/script.php?script_id=2208
        >
        > If you want to later export your txtfmt file into HTML, Vim's :TOhtml command can do that for you.
        >
        > If you want nice bullets, etc. as well then I'd suggest just using nice characters for it.
        >
        > Unicode offers a huge range of them, some of which I use often enough I've even created my own digraphs for them (:help digraph):
        >
        > digraph li 8226 " Bullet
        > digraph l1 8226 " level-1 bullet
        > digraph l2 8227 " level-2 bullet
        > digraph l3 8728 " level-3 bullet
        >
        > These allow me to type CTRL+K li, l1, l2, or l3 to insert: •, •, ‣, or ∘into my text.
        >
        > You can make this better by setting your 'formatlistpat' option to include these for automatic list formatting. Here's how I do that (plus a few other characters I like to use for bullets and the like sometimes):
        >
        > scriptencoding utf-8
        > let &l:formatlistpat='^\s*\%(\d\+[\]:.)}\t ]\d\@!\|[•‣∘—–»*†×✓✗↳-]\)\s*'
        >
        > --
        > --
        > 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@....
        > For more options, visit https://groups.google.com/groups/opt_out.
        >
        >

        --
        --
        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@....
        For more options, visit https://groups.google.com/groups/opt_out.
      • Gary Johnson
        ... You might want to look at using w3m to display your notebook as formatted HTML, then use w3m s E command to open the source of the current page. Edit your
        Message 3 of 7 , Apr 23, 2013
          On 2013-04-23, A HV wrote:
          > > On Tuesday, April 23, 2013 9:30:52 AM UTC-5, A HV wrote:
          > > > Hello all,
          > > > Is it possible and how to set up a Color Scheme for HTML
          > > > documents?
          > > > I use curl | vim to open HTML URLs by Vim but it is in HTML
          > > > code. Is it possible to switch between the HTML code and
          > > > formated document in Vim? Like eLinks does for saving HTML
          > > > pages like formated document :).

          > PS eLinks has feature "Toggle HTML/Plan" actually I am looking
          > such feature for Vim.

          You might want to look at using w3m to display your notebook as
          formatted HTML, then use w3m's E command to open the source of the
          current page. Edit your HTML source with Vim, then save and quit
          whenever you want to see the formatted version. W3m automatically
          reloads the current page when you exit the editor.

          Regards,
          Gary

          --
          --
          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@....
          For more options, visit https://groups.google.com/groups/opt_out.
        Your message has been successfully submitted and would be delivered to recipients shortly.