Actions

Difference between revisions of "Vim"

From RonWareWiki

 
(20 intermediate revisions by the same user not shown)
Line 17: Line 17:
 
# But it doesn't have a nice GUI!
 
# But it doesn't have a nice GUI!
  
As for #1 - if we only ever had to use Windows machines, that would almost be
+
As for #1 - if we only ever had to use Windows machines, that would almost be a reasonable statement.  Since we need to also work on Linux machines occasionally, and since '''vim''' is always installed on every Linux machine (it's the default editor), learning how to use VIM is a good idea even if you prefer to use another editor (as in objection #2).
a reasonable statement.  If one ever needs to work on Linux machines, since '''vim''' is always installed on every Linux machine (it's the default editor), learning how to use VIM is a good idea even if you prefer to use another editor (as in objection #2).
 
  
 
Concerning #3 and #4  - suffice it to say that VIM is not VI.  It is "improved" in the same manner that a [http://en.wikipedia.org/wiki/Mercedes-Benz_S-Class Mercedes S-class] is an "improved" [http://en.wikipedia.org/wiki/Ford_Model_T Model-T].  Among the standard features in VIM:
 
Concerning #3 and #4  - suffice it to say that VIM is not VI.  It is "improved" in the same manner that a [http://en.wikipedia.org/wiki/Mercedes-Benz_S-Class Mercedes S-class] is an "improved" [http://en.wikipedia.org/wiki/Ford_Model_T Model-T].  Among the standard features in VIM:
* exhaustive online help (accessible via F1 or the ":help" command)
+
* ''exhaustive'' and excellent online help (accessible via F1 or the ":help" command)
 
* GUI (both native Windows, and GTK on Linux); color schemes
 
* GUI (both native Windows, and GTK on Linux); color schemes
 
* syntax highlighting for over 400 languages
 
* syntax highlighting for over 400 languages
* multi-lingual support (UTF-8, custom keyboard input)
+
* multi-lingual support (UTF-8, custom keyboard input, custom spelling dictionaries)
 
* character, line and block selections; mouse selection
 
* character, line and block selections; mouse selection
 +
* [http://ctags.sourceforge.net/ ctags] and [http://cscope.sourceforge.net/ cscope] support
 
* comprehensive scripting language
 
* comprehensive scripting language
 +
* extensive regular expression support
  
 
There are tons of other features which I won't enumerate.  Now if the objection was "I like EMACS", I would say - fine, use EMACS.  They are functionally equivalent in terms of power, though VIM is smaller and faster (and easier to use IMO, but that's opinion).
 
There are tons of other features which I won't enumerate.  Now if the objection was "I like EMACS", I would say - fine, use EMACS.  They are functionally equivalent in terms of power, though VIM is smaller and faster (and easier to use IMO, but that's opinion).
Line 32: Line 33:
 
==How do I learn VIM?==
 
==How do I learn VIM?==
 
The editor already contains its own tutorials; but there are excellent resources online, many of which are not specific to VIM:
 
The editor already contains its own tutorials; but there are excellent resources online, many of which are not specific to VIM:
 +
* '''New''' free eBook: [http://www.swaroopch.com/notes/Vim A Byte of Vim]
 
* [http://www.viemu.com/a_vi_vim_graphical_cheat_sheet_tutorial.html Graphical VIM cheat-sheet]
 
* [http://www.viemu.com/a_vi_vim_graphical_cheat_sheet_tutorial.html Graphical VIM cheat-sheet]
 
* [http://thomer.com/vi/vi.html VI Lover's page]
 
* [http://thomer.com/vi/vi.html VI Lover's page]
Line 39: Line 41:
 
You can find more by [http://www.google.co.il/search?hl=en&q=vim+tutorial&btnG=Google+Search&meta= asking Google] for vim tutorials.
 
You can find more by [http://www.google.co.il/search?hl=en&q=vim+tutorial&btnG=Google+Search&meta= asking Google] for vim tutorials.
  
NOTE: '''vim''' starts a text-mode console version of VIM, whereas '''gvim''' starts a GUI version of VIM.  On Windows they are different programs while on Linux they are just symlinks to the same executable.  I ''always'' use '''gvim''' on Windows, because console support is ... not good ... on Windows because Microsoft thinks it unimportant.
+
NOTE: '''vim''' starts a text-mode console version of VIM, whereas '''gvim''' starts a GUI version of VIM.  On Windows they are different programs while on Linux they are just symlinks to the same executable.  I ''always'' use '''gvim''' on Windows, because console support is ... not good ... on Windows since Microsoft thinks it unimportant.
  
 
==How do I get VIM?==
 
==How do I get VIM?==
 
You can get it from the [http://www.vim.org/ vim website].  But if you use
 
You can get it from the [http://www.vim.org/ vim website].  But if you use
 
Windows, you might prefer to get [[User:Ron|Ron]]'s  build which is linked
 
Windows, you might prefer to get [[User:Ron|Ron]]'s  build which is linked
below.
+
below. Linux users of Ron's build should get 'wmctrl', 'exuberant ctags' and 'idutils'
  
 
Once you become a hard-core vimmer, you'll want to [http://www.cafepress.com/vimrefmug.25635024 drink your coffee from a VIM mug].
 
Once you become a hard-core vimmer, you'll want to [http://www.cafepress.com/vimrefmug.25635024 drink your coffee from a VIM mug].
Line 50: Line 52:
 
==Links==
 
==Links==
  
* My private build, in a Windows install format: [[ron:gvim71-264.exe|download it here (7.1.264, updated 2008-02-26)]].
+
* My private build: [http://dev.ronware.org/vim.cgi/home is here].
 
* [[vim/mmp|Symbian MMP syntax file]]
 
* [[vim/mmp|Symbian MMP syntax file]]
 +
* [[vim/sqlite|SQLite interface patch]]
 +
* [[vim/makevim|build script (bash)]]

Latest revision as of 17:02, 12 January 2010

VIM - the programmer's editor

VIM is an extremely powerful programmer's editor based on the vi editor from Unix. It takes a bit of getting used-to, but once one has a working knowledge of it, skill and speed come quickly.

VIM is an "improved vi", which has essentially all the features a programmer could want in a relatively small and fast package. Ron's install (link below) has all sorts of useful enhancements. It is packaged in an NSIS installer package, just click the exe file to install. Updates to his package are made from time to time; it's worthwhile checking back every so often.

Why use VIM?

  1. Why should I use VIM, when Notepad is right there on every Windows machine?
  2. I like MultiEdit/VisualStudio/Eclipse/...!
  3. Isn't VIM just for dinosaurs who don't like CRT screens?
  4. But it doesn't have a nice GUI!

As for #1 - if we only ever had to use Windows machines, that would almost be a reasonable statement. Since we need to also work on Linux machines occasionally, and since vim is always installed on every Linux machine (it's the default editor), learning how to use VIM is a good idea even if you prefer to use another editor (as in objection #2).

Concerning #3 and #4 - suffice it to say that VIM is not VI. It is "improved" in the same manner that a Mercedes S-class is an "improved" Model-T. Among the standard features in VIM:

  • exhaustive and excellent online help (accessible via F1 or the ":help" command)
  • GUI (both native Windows, and GTK on Linux); color schemes
  • syntax highlighting for over 400 languages
  • multi-lingual support (UTF-8, custom keyboard input, custom spelling dictionaries)
  • character, line and block selections; mouse selection
  • ctags and cscope support
  • comprehensive scripting language
  • extensive regular expression support

There are tons of other features which I won't enumerate. Now if the objection was "I like EMACS", I would say - fine, use EMACS. They are functionally equivalent in terms of power, though VIM is smaller and faster (and easier to use IMO, but that's opinion).

How do I learn VIM?

The editor already contains its own tutorials; but there are excellent resources online, many of which are not specific to VIM:

You can find more by asking Google for vim tutorials.

NOTE: vim starts a text-mode console version of VIM, whereas gvim starts a GUI version of VIM. On Windows they are different programs while on Linux they are just symlinks to the same executable. I always use gvim on Windows, because console support is ... not good ... on Windows since Microsoft thinks it unimportant.

How do I get VIM?

You can get it from the vim website. But if you use Windows, you might prefer to get Ron's build which is linked below. Linux users of Ron's build should get 'wmctrl', 'exuberant ctags' and 'idutils'

Once you become a hard-core vimmer, you'll want to drink your coffee from a VIM mug.

Links