I would appreciate it if someone can let a newbie know what the differences are between vi
and vim
. I've heard Vim is a successor to vi
but whenever I try to open vi
in Ubuntu it opens vim
instead.
Ubuntu – the difference between Vi and Vim
vim
Related Solutions
On 11.10:
$ vim.tiny --version
VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Oct 6 2011 10:32:12)
Included patches: 1-154
Modified by pkg-vim-maintainers@lists.alioth.debian.org
Compiled by buildd@
Small version without GUI. Features included (+) or not (-):
-arabic -autocmd -balloon_eval -browse +builtin_terms -byte_offset -cindent
-clientserver -clipboard -cmdline_compl +cmdline_hist -cmdline_info -comments
-conceal -cryptv -cscope -cursorbind -cursorshape -dialog -diff -digraphs -dnd
-ebcdic -emacs_tags -eval -ex_extra -extra_search -farsi -file_in_path
-find_in_path -float -folding -footer +fork() -gettext -hangul_input +iconv
-insert_expand +jumplist -keymap -langmap -libcall -linebreak -lispindent
-listcmds -localmap -lua -menu -mksession -modify_fname -mouse -mouse_dec
-mouse_gpm -mouse_jsbterm -mouse_netterm -mouse_sysmouse -mouse_xterm
+multi_byte -multi_lang -mzscheme -netbeans_intg -osfiletype -path_extra -perl
-persistent_undo -printer -profile -python -python3 -quickfix -reltime
-rightleft -ruby -scrollbind -signs -smartindent -sniff -startuptime
-statusline -sun_workshop -syntax -tag_binary -tag_old_static -tag_any_white
-tcl +terminfo -termresponse -textobjects -title -toolbar -user_commands
-vertsplit -virtualedit +visual -visualextra -viminfo -vreplace +wildignore
-wildmenu +windows +writebackup -X11 +xfontset -xim -xsmp -xterm_clipboard
-xterm_save
system vimrc file: "$VIM/vimrc"
user vimrc file: "$HOME/.vimrc"
user exrc file: "$HOME/.exrc"
fall-back for $VIM: "/usr/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -Wall -g -O2 -DTINY_VIMRC -D_FORTIFY_SOURCE=1
Linking: gcc -Wl,-Bsymbolic-functions -Wl,--as-needed -o vim -lSM -lICE -lXpm -lXt -lX11 -lXdmcp -lSM -lICE -lm -ltinfo -lselinux -ldl
There are only twelve features enabled (out of one hundred and twenty):
+builtin_terms Some terminals supported
+cmdline_hist Command line history
+fork() Shell commands are forked
+iconv Extra encoding conversions besides utf8<->latin1
+jumplist jumplist history,
So you can go back/forward with Ctrl-O/Ctrl-I
+multi_byte Multibyte characters
+terminfo Use terminfo instead of termcap
+visual Visual mode supported (but no blockwise visual mode)
+wildignore Allow wildcard patterns, to specify files to
ignore during filename completion
+windows Support more than one buffer window
+writebackup Backup files before overwriting (this either
provides this option, or defaults it to on)
+xfontset X fontset support
The descriptions are based on the feature list link posted by @Caesium.
The missing keybindings etc may be because you are running vim in vi compatible mode - you can turn that off by doing :set nocompatible
in vim or adding set nocompatible
to you .vimrc
file.
I did try Ctrl-W s
and that did a split for me while running /usr/bin/vim.tiny
while in compatible mode, so that might not be your problem. But I'm not sure what would be in that case. Maybe try making sure there is nothing in your .vimrc
file that would stop that working.
Including the vim
package, there appear to be at least six "vim-variants" (not including available documentation, or plugin packages) as well as the main vim
package in both the main
and universe
repositories.
Below is a brief summary of each (links go to package description and dependencies in Ubuntu LTS release 20.04 "Focal"):
Vim compiled and set up with a rather standard set of features. This package does not provide a GUI version of Vim or scripting language support. See the other vim-* packages if you need more (or less).
In order to install this package, run sudo apt-get install vim
- jvim-canna - Japanized VIM (Canna version)
This package allows the entering of Kanji from the console.
In order to install this package, run sudo apt-get install jvim-canna
Depends upon the libcanna1g
library
Does not appear to support Perl, Python, Ruby, or TCL scripting.
vim-athena - enhanced vi editor - compiled with an Athena GUI
This package is compiled with the Athena GUI as opposed to GTK+ or Gnome.
See this askubuntu answer for additional details.
In order to install this package, run
sudo apt-get install vim-athena
Supports Perl, Python, Ruby, and TCL scripting.
vim-gnome/vim-gtk3 - enhanced vi editor - compiled with a GNOME GUI (GTK2 before 17.10, GTK3 from 17.10)
In order to install this package, run
sudo apt-get install vim-gnome
Depends upon the
libgnome2
librarySupports Perl, Python, Ruby, and TCL scripting.
vim-gtk - enhanced vi editor - compiled with the GTK2 GUI
Used in KDE/Kubuntu-like environments
In order to install this package, run
sudo apt-get install vim-gtk
Supports Perl, Python, Ruby, and TCL scripting.
vim-nox - enhanced vi editor
Like vim-tiny, vim-nox is a minimal vim installation and does not have a GUI. It comes with mouse support, but no clipboard support, IIRC.
In order to install this package, run
sudo apt-get install vim-nox
Supports Perl, Python, Ruby, and TCL scripting.
vim-tiny - enhanced vi editor - compact version
vim-tiny is included as the default vim on Ubuntu distributions and comes with many optional features disabled(e.g. multi-level undo).
See this askubuntu answer for details on its feature set(or lack thereof).
In order to install this package, run
sudo apt-get install vim-tiny
Does not support Perl, Python, Ruby, or TCL scripting.
Locally, to see which features are supported in a particular installed vim package, running the following command: vim --version
will provide a list of features included(or excluded) in the particular package.
For example, on my system I can run either vim --version
, vim.tiny --version
, or vim.athena --version
to see the differences in their respective supported features. The Debian/Ubuntu /etc/alternatives
system determines which vim package executes when you runvi
or vim
, see What is etc/alternatives used for?
Python support
Before 16.04, the above packages (other than vim-tiny
) included Vim with scripting support for Python 2. In 16.04, they all support Python 3, and there are corresponding *-py2
packages (vim-gnome-py2
, for example) which provide a Vim command with Python 2 support. Both can be installed together, and the commands will be, for example, vim.gnome
and vim.gnome-py2
respectively. Otherwise, the *-py2
packages provide the same feature set as the corresponding packages. Python 2 support was removed after 16.04.
Best Answer
Functionally, vim is almost a proper superset of vi. Therefore, everything that is in vi is available in vim.
Vim adds onto those features. Here are a some of the extended vim features:
There are many more differences. Refer below sources which are few of good places to start finding out more.
Source: Vim.Org, Vim on Wikpedia.
Hope it helps! :)