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

Re: Which .vimrc

Expand Messages
  • Zdenek Sekera
    ... Right you are, this works. However: syntax highlighting has a problem there: I have underlined is highlighted as a variable (that is the Bar in
    Message 1 of 10 , Oct 31, 2000
    • 0 Attachment
      c928400@... wrote:
      >
      > Thus wrote Zdenek Sekera (zs@...) on [001031]:
      > > Just out of curiosity, how to do it and put <BAR> at the end of the
      > > line?
      > > The problem here is the 'echo' that will complain if done this way:
      >
      > > map ,gv :if !exists("current_gvimrc") <Bar><Bar> current_gvimrc == ""
      > > <Bar>
      > > \ echo "Cannot determine current" . '.vimrc' <Bar>
      > > ^^^
      > > \ else <BAR>
      > > \ :exe "e " . expand(current_gvimrc) <Bar>
      > > \ endif<CR>
      >
      > > What's the trick here?
      >
      > The problem for you in this case is that
      >
      > current_gvimrc == ""
      >
      > and everything there after appears to be seen as one expression.
      > Grouping the conditions seems to do the trick:
      >
      > map ,gv :if (!exists("current_gvimrc") <Bar><Bar> current_gvimrc == "") <Bar>
      > \ echo "Cannot determine current" . '.vimrc' <Bar>
      > \else <Bar>
      > \ :exe "e " . expand(current_gvimrc) <Bar>
      > \endif<CR>

      Right you are, this works.
      However: syntax highlighting has a problem there: <Bar> I have
      underlined is
      highlighted as a variable (that is the 'Bar' in <Bar> is highlighted as
      a var.
      Dr. Chips???

      Also, this executes differently from the case when <Bar>'s are at the
      beginning
      of the line: a) it needs <CR><CR> at the end to prevent 'Hit return' and
      b) with <CR><CR> it uses temporarily one more command (not surprising)
      line so
      the display moves up and down which is far less pleasant.

      This difference is somewhat surprising to me, both statements should
      look
      identical after parsing, IMHO.
      So why it doesn't behave the same way?

      ---Zdenek
    Your message has been successfully submitted and would be delivered to recipients shortly.