how do I detect OS X in my .vimrc file, so certain configurations will only apply to OS X?

前端 未结 7 665
庸人自扰
庸人自扰 2020-12-12 15:18

I use my .vimrc file on my laptop (OS X) and several servers (Solaris & Linux), and could hypothetically someday use it on a Windows box. I know how to detect unix gene

7条回答
  •  长情又很酷
    2020-12-12 15:35

    This is the easiest way I have found.

    if system('uname -s') == "Darwin\n"
      "OSX
      set clipboard=unnamed 
    else
      "Linux
      set clipboard=unnamedplus
    endif
    

提交回复
热议问题