LoginSignup
3
3

More than 5 years have passed since last update.

ubuntu server16.04のデフォルトが nanoになってたので viにしてみる

Last updated at Posted at 2016-02-20

ubuntu serverを初めてVirtualBoxに入れてみた。
それをポーとフォワーディングしてsshしてみたのだけど、
visudo したところ、nanoで開かれてしまった。
viってついてるコマンドなのに。。。というのはさておき、
以下で変更

$ sudo update-alternatives --config editor
alternative editor (/usr/bin/editor を提供) には 4 個の選択肢があります。


  選択肢    パス              優先度  状態
------------------------------------------------------------
  0            /bin/nano            40        自動モード
  1            /bin/ed             -100       手動モード
  2            /bin/nano            40        手動モード
* 3            /usr/bin/vim.basic   30        手動モード
  4            /usr/bin/vim.tiny    10        手動モード
現在の選択 [*] を保持するには <Enter>、さもなければ選択肢の番号のキーを押してく ださい:

Press enter to keep the current choice[*], or type selection number: 3

crontab -e もやってみたらどうなるかと思ったら、
エディターを選べといわれた。

Select an editor.  To change later, run 'select-editor'.
  1. /bin/ed
  2. /bin/nano        <---- easiest
  3. /usr/bin/vim.basic
  4. /usr/bin/vim.tiny

nanoお勧めなのかな。。。

とりあえず、Ctrl+Oで保存、Ctrl+Xで終了。
これ知ってれば大丈夫そう。
そう思うと、viより簡単だけど、vi使っている人はvi使いたいよね。

3
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
3