35

I'm running Mac OS X Snow Leopard. How can I check which version of vim I have installed?

Ideally I'd like to know a general solution for checking software versions via the command line.

Gareth
  • 19,080
Stew
  • 1,469
  • 3
  • 13
  • 23

5 Answers5

46

The command:

vim --version

This is pretty standard for all unix executables.

ghoppe
  • 6,558
  • 25
  • 21
31

or, just if you run vim already and want to know what you are in right now:

:version
akira
  • 63,447
4

In a terminal run vim --version ther version number is in the top line of output.

2

You can also just open a blank VIM document by typing vi or vim in your terminal. The welcome screen will state your version as well as other information.

German
  • 121
0

For vim or neovim using regex:

vi --version | grep -oP '(?<=^VIM v)[0-9|.]+'
vi --version | grep -oP '(?<=^NVIM v)[0-9|.]+'

Assumes your grep has perl compatible regex (PCRE).