Code Yarns ‍👨‍💻
Tech BlogPersonal Blog

Check operating system in Vim

📅 2012-Nov-09 ⬩ ✍️ Ashwin Nanjappa ⬩ 🏷️ linux, vim, windows ⬩ 📚 Archive

In Vim configuration files like vimrc or Vim scripts it might be necessary to know what is the operating system that Vim is running on. This can be done by checking for the feature that matches the operating system.

For example, Vim running on Linux will have its unix feature turned on. On Windows, it might have its win32 or win64 feature turned on. These features can be checked in Vim easily or tested in Vim scripts using the has function.

Tried with: Vim 7.3