
Ubuntu Desktop (20.04/18.04) のviコマンドは、viの最小限の機能を提供するvimのSmall版になっています。vimのHuge版をインストールして、viコマンドを高機能なvimのHuge版に切り替えます。
記事の目次
使用した環境
- Ubuntu 20.04.01 LTS Desktop
- Ubuntu 18.04.03 LTS Desktop
vimのバージョン確認(Small版確認)
vimのバージョンを確認します。20.04では、以下のように表示されます。
$ vi --version VIM - Vi IMproved 8.1 (2018 May 18, compiled Apr 15 2020 06:40:31) Included patches: 1-2269 Modified by team+vim@tracker.debian.org Compiled by team+vim@tracker.debian.org Small version without GUI. Features included (+) or not (-): ...
18.04では、以下のように表示されます。
$ vi --version VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Jun 06 2019 17:31:41) Included patches: 1-1453 Modified by pkg-vim-maintainers@lists.alioth.debian.org Compiled by pkg-vim-maintainers@lists.alioth.debian.org Small version without GUI. Features included (+) or not (-): ...
Small version without GUI版になっていることがわかります。
vimのHuge版のインストール
vimのHuge版をインストールします。
$ sudo apt install vim
vimのバージョン確認(Huge版確認)
vimのバージョンを確認します。20.04では、以下のうように表示されます。
$ vi --version VIM - Vi IMproved 8.1 (2018 May 18, compiled Apr 15 2020 06:40:31) Included patches: 1-2269 Modified by team+vim@tracker.debian.org Compiled by team+vim@tracker.debian.org Huge version without GUI. Features included (+) or not (-): ...
18.04では、以下のように表示されます。
$ vi --version VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Jun 06 2019 17:31:41) Included patches: 1-1453 Modified by pkg-vim-maintainers@lists.alioth.debian.org Compiled by pkg-vim-maintainers@lists.alioth.debian.org Huge version without GUI. Features included (+) or not (-): ...
Huge version without GUI版になっていることがわかります。
デフォルトのエディタをHuge版に変更
デフォルトのエディタをHuge版に変更します。(vim.basicへの変更)
$ sudo update-alternatives --config editor There are 4 choices for the alternative editor (providing /usr/bin/editor). Selection Path Priority Status ------------------------------------------------------------ * 0 /bin/nano 40 auto mode 1 /bin/ed -100 manual mode 2 /bin/nano 40 manual mode 3 /usr/bin/vim.basic 30 manual mode 4 /usr/bin/vim.tiny 15 manual mode Press <enter> to keep the current choice[*], or type selection number: 3 update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/editor (editor) in manual mode $ sudo update-alternatives --config editor There are 4 choices for the alternative editor (providing /usr/bin/editor). Selection Path Priority Status ------------------------------------------------------------ 0 /bin/nano 40 auto mode 1 /bin/ed -100 manual mode 2 /bin/nano 40 manual mode * 3 /usr/bin/vim.basic 30 manual mode 4 /usr/bin/vim.tiny 15 manual mode
おわりに
vimのHuge版をインストールして、viコマンドをvimのSmall版から高機能なHuge版に切り替えました。
記事一覧