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

Re: Having trouble using conceal

Expand Messages
  • HarleyPig
    ... That didn t work, but this did: if ! exists( autocmds_loaded ) let autocmds_loaded = 1 autocmd BufEnter * source endif if has( conceal ) How
    Message 1 of 7 , Jan 2, 2013
    • 0 Attachment
      On Wednesday, January 2, 2013 12:24:05 AM UTC-7, Tony Mechelynck wrote:
      > Try sourcing it from an autocommand, as follows:
      >
      > au VimEnter * au Syntax * source ~/.vim/ownsyntax.vim

      That didn't work, but this did:

      if ! exists( "autocmds_loaded" )

      let autocmds_loaded = 1
      autocmd BufEnter * source <sfile>

      endif

      if has( 'conceal' )

      " How can I use variables for the patterns?
      "syntax region myTimeStamp start="__TS:" end="|" conceal
      syntax match myTimeStamp "__TS:.*|" conceal
      highlight myTimeStamp ctermfg=red ctermbg=blue
      set conceallevel=2

      endif


      Thank you.

      My remaining problems are how to use a variable in the match (or region, I'm not sure which is better) and how to make the syntax work in commented sections.

      --
      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
    • Charles Campbell
      ... variable in the match/region: :help execute syntax work in (whatever) section: :help syn-containedin To figure out what section you re in... see
      Message 2 of 7 , Jan 2, 2013
      • 0 Attachment
        HarleyPig wrote:
        > <snip>
        > My remaining problems are how to use a variable in the match (or
        > region, I'm not sure which is better) and how to make the syntax work
        > in commented sections.
        variable in the match/region: :help execute
        syntax work in (whatever) section: :help syn-containedin

        To figure out what section you're in... see
        http://www.drchip.org/astronaut/vim/index.html#HILINKS

        Regards,
        Chip Campbell

        --
        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
      • HarleyPig
        ... Oh! Thanks ... I was looking for eval and it just wasn t making any sense for what I was trying to do. Now I ve got execute syntax match myTimeStamp .
        Message 3 of 7 , Jan 2, 2013
        • 0 Attachment
          On Wednesday, January 2, 2013 2:11:46 PM UTC-7, Charles Campbell wrote:
          > variable in the match/region: :help execute
          > syntax work in (whatever) section: :help syn-containedin

          Oh! Thanks ... I was looking for eval and it just wasn't making any sense for what I was trying to do. Now I've got

          execute 'syntax match myTimeStamp "' . g:timestamp_format_begin . '.*' . g:timestamp_format_delim . '" conceal containedin=.*Comment.*'

          and it's working fine. Thanks.

          > http://www.drchip.org/astronaut/vim/index.html#HILINKS

          Interesting plugin ... along with some others. I don't suppose you have these in a publicly available repo somewhere?

          Nice ... I'm already using Align. Didn't realize you were the author.

          --
          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
        Your message has been successfully submitted and would be delivered to recipients shortly.