Debian > Debianのデフォルトのエディタ

更新日 2019-06-22
広告
visudoやcrontabなどのコマンドを実行すると、エディタが起動されて、ファイルを編集することになります。このときに使用するエディタを設定する方法を紹介します。
$ sudo update-alternatives --config editor
このコマンドを実行すると、エディタを選択できるようになります。
$ sudo update-alternatives --config editor
There are 8 choices for the alternative editor (providing /usr/bin/editor).

  Selection    Path                Priority   Status
------------------------------------------------------------
* 0            /usr/bin/joe         70        auto mode
  1            /bin/nano            40        manual mode
  2            /usr/bin/jmacs       50        manual mode
  3            /usr/bin/joe         70        manual mode
  4            /usr/bin/jpico       50        manual mode
  5            /usr/bin/jstar       50        manual mode
  6            /usr/bin/rjoe        25        manual mode
  7            /usr/bin/vim.basic   30        manual mode
  8            /usr/bin/vim.tiny    15        manual mode

Press <enter> to keep the current choice[*], or type selection number:
上記だと、デフォルトのエディタが0番(/usr/bin/joe)となっています。 使いたいエディタの番号を入力すれば、それがデフォルトのエディタとなります。
広告
お問い合わせは sweng.tips@gmail.com まで。
inserted by FC2 system