How do you reinstall nano on Mac OS X?
- Download the nano source (I recommend the tar.xz one) (nano-editor.org/download.php)
- Go to the folder it was downloaded to (By default it downloads to
~/Downloads
but if you changed the directory where files download then just go there). - Extract the nano source you downloaded.
- Open your terminal
- Type "cd " without the "" then drag and drop the folder you extracted and click enter.
- run "./configure" without the "".
- run "make" without the "".
- run "sudo make install" without the "".]
You have now successfully installed nano!
Update: The answer below is no longer accurate. As of Apr 4, 2017, the formulae were moved to homebrew/core. See https://github.com/Homebrew/homebrew-dupes/commits/master/README.md
The reason you can't find it in homebrew is because homebrew's main repo doesn't include programs that come with the OS. You have to add an additional repo:
brew tap homebrew/dupes
brew install nano
https://github.com/Homebrew/homebrew-dupes