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

Re: separate gvim and vim in a single .vimrc [no .gvimrc]

Expand Messages
  • pansz
    ... simply put gui-related stuffs in a function and put that function inside GUIEnter works great. I don t think it is a good way to separate your settings in
    Message 1 of 19 , Nov 1, 2009
    • 0 Attachment
      Tony Mechelynck 写道:
      > set errorbells visualbell
      > if !has('gui_running') " console Vim setting
      > let &t_vb = "\x07" . &t_vb " also ring the bell
      > endif
      > if has('autocmd') && has('gui')
      > " must set it again for the GUI
      > au GUIEnter * let &t_vb = "\<C-G>\e|50f"
      > " where 50 = flash time in milliseconds (default 20)
      > endif

      simply put gui-related stuffs in a function and put that function inside
      GUIEnter works great.

      I don't think it is a good way to separate your settings in
      has('gui_running') and GUIEnter. People are forced to remeber those
      things while otherwise unnecessary.

      If you put has('gui_running') and GUIEnter all over your .vimrc your
      .vimrc will increasingly become unreadable and difficult to maintain,
      while a single function triggered by GUIEnter is much easier to
      maintain. and by removing some unnecessary ":if has()"s .vimrc executes
      better.

      Think, you merge .gvimrc and .vimrc in order to retain elegance, but you
      leave some unpleasant code inside your .vimrc, why not try to make the
      code read better and runs better?


      --~--~---------~--~----~------------~-------~--~----~
      You received this message from the "vim_use" maillist.
      For more information, visit http://www.vim.org/maillist.php
      -~----------~----~----~----~------~----~------~--~---
    Your message has been successfully submitted and would be delivered to recipients shortly.