1.4.8. 定制vim

你可以通过“~/.vimrc”来定制vim(1)的行为。

尝试下列例子

  1. " -------------------------------
  2. " Local configuration
  3. "
  4. set nocompatible
  5. set nopaste
  6. set pastetoggle=<f2>
  7. syn on
  8. if $USER == "root"
  9. set nomodeline
  10. set noswapfile
  11. else
  12. set modeline
  13. set swapfile
  14. endif
  15. " filler to avoid the line above being recognized as a modeline
  16. " filler
  17. " filler