VI and VIM

davidktw

Arch-Supremacy Member
Joined
Apr 15, 2010
Messages
13,391
Reaction score
1,180
Recently I encounter some/one whom have/has difficulty differentiating between VI and VIM. There is nothing I feel upset about it since they are after all just tools. It was mentioned briefly that VI and VIM are mentioned all over the Internet, and for something that could be searched, why talk about it. However if it is all over the Internet, why is it that hard to differentiate between VI and VIM ?

Apparently to my knowledge, there is no VI in Linux that is installed by default. One can find alternate implementation of VI, but they are after all clones with enhancement, just like the popular VIM. If you found VI in Linux, it is nonetheless just a symbolic/hard link to VIM mainly with the intention to provide a fallback for scripts or tools that looks for "vi" instead of the newer "vim". However these days, linux developers should go for "vim" instead.

If you have problem differentiating between VI and VIM. Here are some screenshots which may help you.

VIM Version
Code:
$ vim --version
VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Jan  2 2014 19:39:32)
Included patches: 1-52
Modified by pkg-vim-maintainers@lists.alioth.debian.org
Compiled by buildd@
Huge version without GUI.  Features included (+) or not (-):
+acl             +farsi           +mouse_netterm   +syntax
+arabic          +file_in_path    +mouse_sgr       +tag_binary
+autocmd         +find_in_path    -mouse_sysmouse  +tag_old_static
-balloon_eval    +float           +mouse_urxvt     -tag_any_white
-browse          +folding         +mouse_xterm     -tcl
++builtin_terms  -footer          +multi_byte      +terminfo
+byte_offset     +fork()          +multi_lang      +termresponse
+cindent         +gettext         -mzscheme        +textobjects
-clientserver    -hangul_input    +netbeans_intg   +title
-clipboard       +iconv           +path_extra      -toolbar
+cmdline_compl   +insert_expand   -perl            +user_commands
+cmdline_hist    +jumplist        +persistent_undo +vertsplit
+cmdline_info    +keymap          +postscript      +virtualedit
+comments        +langmap         +printer         +visual
+conceal         +libcall         +profile         +visualextra
+cryptv          +linebreak       +python          +viminfo
+cscope          +lispindent      -python3         +vreplace
+cursorbind      +listcmds        +quickfix        +wildignore
+cursorshape     +localmap        +reltime         +wildmenu
+dialog_con      -lua             +rightleft       +windows
+diff            +menu            -ruby            +writebackup
+digraphs        +mksession       +scrollbind      -X11
-dnd             +modify_fname    +signs           -xfontset
-ebcdic          +mouse           +smartindent     -xim
+emacs_tags      -mouseshape      -sniff           -xsmp
+eval            +mouse_dec       +startuptime     -xterm_clipboard
+ex_extra        +mouse_gpm       +statusline      -xterm_save
+extra_search    -mouse_jsbterm   -sun_workshop    -xpm
   system vimrc file: "$VIM/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
      user exrc file: "$HOME/.exrc"
  fall-back for $VIM: "/usr/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H     -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: gcc   -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,--as-needed -o vim        -lm -ltinfo -lnsl  -lselinux  -lacl -lattr -lgpm -ldl    -L/usr/lib/python2.7/config-x86_64-linux-gnu -lpython2.7 -lpthread -ldl -lutil -lm -Xlinker -export-dynamic -Wl,-O1 -Wl,-Bsymbolic-functions

When you start up VIM, you get
Code:
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~                              VIM - Vi IMproved
~
~                                version 7.4.52
~                           by Bram Moolenaar et al.
~           Modified by pkg-vim-maintainers@lists.alioth.debian.org
~                 Vim is open source and freely distributable
~
~                        Become a registered Vim user!
~                type  :help register<Enter>   for information
~
~                type  :q<Enter>               to exit
~                type  :help<Enter>  or  <F1>  for on-line help
~                type  :help version7<Enter>   for version info
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
                                                              0,0-1         All

Using the command ":ve" shows
Code:
:ve
VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Jul 22 2016 20:10:33)
MacOS X (unix) version
Included patches: 1-1129
Compiled by MacPorts
Big version without GUI.  Features included (+) or not (-):
+acl             +farsi           +mouse_netterm   +syntax
+arabic          +file_in_path    +mouse_sgr       +tag_binary
+autocmd         +find_in_path    -mouse_sysmouse  +tag_old_static
-balloon_eval    +float           +mouse_urxvt     -tag_any_white
-browse          +folding         +mouse_xterm     -tcl
++builtin_terms  -footer          +multi_byte      +terminfo
+byte_offset     +fork()          +multi_lang      +termresponse
+cindent         +gettext         -mzscheme        +textobjects
-clientserver    -hangul_input    +netbeans_intg   +title
+clipboard       +iconv           +path_extra      -toolbar
+cmdline_compl   +insert_expand   +perl            +user_commands
+cmdline_hist    +jumplist        +persistent_undo +vertsplit
+cmdline_info    +keymap          +postscript      +virtualedit
+comments        +langmap         +printer         +visual
+conceal         +libcall         -profile         +visualextra
+cryptv          +linebreak       -python          +viminfo
-cscope          +lispindent      -python3         +vreplace
-- More --

If you are actually using the legacy big brother of VIM, called VI. Which can still be found in some unix platforms such as Solaris, HP-UX, BSD, the behaviour will be very different. Below are some screenshots of a true legacy VI
Code:
$ vi --version
vi: unknown option -- -
usage: vi [-eFRrS] [-c cmd] [-t tag] [-w size] [file ...]

When you start up VI
Code:
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
/tmp//vi.EFr6D34aOa: new file: line 1

Using the command ":ve" shows
Code:
Version 1.79 (10/23/96) The CSRG, University of California, Berkeley.

I hope this small little bits of knowledge helps make you a better unix developer. Sometimes knowing some history in the IT industry enriches your knowledge and helps you in appreciating the evolution of technologies. Have fun programming.
 

Rock-kun

Senior Member
Joined
Sep 10, 2007
Messages
991
Reaction score
1
I know that VI / VIM is one of the most powerful text editors in Linux / Unix-land, but it's just too complicated to use for simple text edits (which makes up 99% of my use case).

Yay for NANO. :D
 

davidktw

Arch-Supremacy Member
Joined
Apr 15, 2010
Messages
13,391
Reaction score
1,180
I know that VI / VIM is one of the most powerful text editors in Linux / Unix-land, but it's just too complicated to use for simple text edits (which makes up 99% of my use case).

Yay for NANO. :D

Well it's your choice. The software is always there waiting for you. My experience is once you really get the hang of it, you won't even give a 2nd thought starting it up for almost anything even when merely just editing the hosts file or fstab.

You will, in fact, learn a particular habit of wanting to depress the ESC key very often and use "dd" to delete lines instead of backspace when you are using other text editors in Windows or Unix. The beauty of VI/VIM is how the keystrokes are design to minimise on keystrokes to perform text manipulation, where in the past, the latency across network is significant.

I suspect if one don't have such habit, it would indicate one is not fluent in it enough. Such behaviour is reported all over the place and I only realise it when I exhibit this phenomenal and when I later read up about it in the Internet that a lot other VI/VIM users also experienced similar behaviour.
 
Important Forum Advisory Note
This forum is moderated by volunteer moderators who will react only to members' feedback on posts. Moderators are not employees or representatives of HWZ. Forum members and moderators are responsible for their own posts.

Please refer to our Community Guidelines and Standards, Terms of Service and Member T&Cs for more information.
Top