LoginSignup
55
39

More than 5 years have passed since last update.

nanoエディタユーザーじゃない人がうっかりnanoエディタを開いてしまった時の対処法

Last updated at Posted at 2016-03-17

処方箋

一回落ち着きます
スクリーンショット 2016-03-17 10.11.55.png
画面下の方をよく見ます

  • Ctrl + o<-保存
  • Ctrl + x<-終了(保存せずに終わろうとするとたまに怒られます) これでおk!

nanoエディタとは

nano は Mac OS X に標準搭載されているテキストエディタです。

Mac使っている人は表題のようなことが起こり得るってことですかね(<-Macしか使ったことないユーザー)

Ubuntuだとデフォルトのエディタがnano

あ。git使ってる時にでるからこれっぽい

なったことある?

ない

nanoエディタユーザーじゃない人がうっかりnanoエディタを開いてしまった時の対処法
  • ↑こんなこと起きたことないわ!って人はスルーで大丈夫です。生きていく上で全く必要のない記事になります(^^)b

なったことある

  • なったことある。
  • 何でかわかんないけど設定するほどじゃないから放っておいてる。
  • 毎回間違って開いて焦る。
  • 毎回間違えて開いて他人に終了させてもらっている。
  • 毎回間違えて開いた奴のエディタを終了させている。

↑こんな人に

とりあえずじゃない対処法

  • 何でか知らないがデフォルトがnanoで変えたい
sa_as@hoge~
$ 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    10        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.

↑これでvimになった!

  • 自分のgitの環境がUbuntuなのでgit commitとかするとnano出てくるよって人
git config --global core.editor "vi"   //viのひと
git config core.editor “mcedit”     //mceditのひと
git config core.editor “emacs -nw”   //emacsのひと

↑これでおk

  • 自分のじゃないVMに入った時にnanoが出て発狂しそうになる

設定を変えるわけにはいかないのでなるべくnanoを開かないように

nanoを開くタイミングはgit commitの瞬間が多いはず

taninno-kankyo@hoge~
$git commit -m "nanowohirakanai"   //こんなコメントをしたら殴られる可能性が高いので真似しないでください

↑これでおk

それでも…

うっかり開いちゃったらこの記事の上部にある処方箋使ってください…

最後に

nanoについて興味が出た方、nano使ってるよ!ってユーザーは記事を書いてみてはいいのではないでしょうか。

タグがvim,Emacs共に1000件以上のところ現在nanoタグ1桁でした。

nanoの神になれるかもしれない…

55
39
4

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
55
39