I have been using nano a lot recently to code on Python. I have been flying by on it all until this little stump, no color... it makes it harder to know if you got the syntax right and harder to code! I'm not the best at code so please be nice and use step by step guide.
Nano is perfectly fine as a simple code editor. It has wonderful syntax highlighting. You will probably want an up-to-date version of nano.
- Install homebrew: https://brew.sh/
- Install nano:
brew install nano
Add this line to
~/.nanorc
. That directory has all the syntax highlighting definition files.include "/usr/local/share/nano/*.nanorc"
It seems like the default version of nano included with OS X is very basic; it may not support syntax highlighting.
(source: https://gist.github.com/BlakeGardner/5587269)
You could try installing an updated version of nano using homebrew and then find instructions for enabling colors.
See also this stack overflow answer regarding installing updated nano.
Alternatively, you could also try a different editor such as TextMate, Emacs, or Vim. These editors will have additional convenience features like auto indentation.
-
I went and used macports to install one, ill try to use homebrew or git. – gidoBOSSftw5731 Apr 20 '16 at 18:57
-
-
-
After updating to a newer nano, in
/usr/local/share/nano/
, you'll have various*.nanorc
files. All you have to do is have a~/.nanorc
file withinclude /usr/local/share/nano/python.nanorc
– bernie Apr 20 '16 at 19:21
You cannot easily "update and use color" on OS X using nano, so use an alternative text editor, Sublime text is a good shout.