1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

debianのvisudoコマンドのエディタをvimにする

Last updated at Posted at 2021-05-24

概要

debianを使ってみてまず驚いたのが、デフォルトでのエディタがnanoだったことだ。
使い慣れているvimにしたいので、その変更してみた。
ちなみにだけど、政治、宗教、野球、Linuxのテキストエディタの話は最悪殴り合いに発展したりしなかったりするので変に煽ったりするのはやめましょう。
個人的にはVim以外ありえないと思う。

変更手順

まずvimが入っていなければ、apt-get install vimでインストール。

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

  選択肢    パス              優先度  状態
------------------------------------------------------------
* 0            /bin/nano            40        自動モード
  1            /bin/nano            40        手動モード
  2            /usr/bin/vim.basic   30        手動モード
  3            /usr/bin/vim.tiny    10        手動モード

現在の選択 [*] を保持するには Enter、さもなければ選択肢の番号のキーを押してください:

ここで2を選択。
設定したら、もういちど、update-alternatives --config editorをしてカーソルが2を示しているか確認。

1
0
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
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?