• Home
  • Archive
  • Tools
  • Contact Us

The Customize Windows

Technology Journal

  • Cloud Computing
  • Computer
  • Digital Photography
  • Windows 7
  • Archive
  • Cloud Computing
  • Virtualization
  • Computer and Internet
  • Digital Photography
  • Android
  • Sysadmin
  • Electronics
  • Big Data
  • Virtualization
  • Downloads
  • Web Development
  • Apple
  • Android
Advertisement
You are here: Home » OS X Nano Syntax Highlighting

By Abhishek Ghosh January 20, 2015 2:57 am Updated on January 20, 2015

OS X Nano Syntax Highlighting

Advertisement

Here is How to Update OS X Nano and Enable OS X Nano Syntax Highlighting For Various Languages. Needed dot Files to Match With iTerm2 Has Been Supplied. Apple uses old version of Nano! Yes, it is 2.0 or something like that on OS X Yosemite – the funky OS update from Apple. Yosemite has targeted the mass, who will update Nano? An Operating System’s Text Editor does not get updated. We are using the Standard iTerm2-Homebrew-OhMyZSH setup. If you are thinking that, running brew upgrade nano will work, you are wrong!

 

Update OS X Nano For Syntax Highlighting

 

If you are using our way of iTerm2-Homebrew-OhMyZSH, you need not to care about anything much. Your profile file is .zshrc. Do not try to find .profile file unless you have created it before. Do not use homebrew dupe. First check your Nano’s condition by running this command :

nano -V

Advertisement

---

Version 2.0 or something, right? That will not take syntax highlighting. That is the basic reason to update OS X Nano for syntax highlighting. Vi is definitely powerful, but so much POWER, rarely required today unless you are developing software from command line. This is Nano’s Official Website :

http://nano-editor.org/download.php

At the time of writing this guide, latest Nano’s version is 2.2.6. Open Terminal not iTerm2. Run these commands :

Vim
1
2
3
4
5
6
7
cd Downloads
wget http://www.nano-editor.org/dist/v2.2/nano-2.2.6.tar.gz
tar -xzvf nano* && rm nano-2.2.6.tar.gz
cd nano-2.2.6 && ls -al
./configure
sudo make
sudo make install

Now, if you run which nano command, it should return this path – /usr/local/bin/nano. It will. Now close Terminal and open our nice looking iTerm2. Run nano -V and get this return :

Vim
1
2
3
4
5
GNU nano version 2.2.6 (compiled 06:51:24, Jan 20 2015)
(C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
2008, 2009 Free Software Foundation, Inc.
Email: nano@nano-editor.org Web: http://www.nano-editor.org/
Compiled options: --disable-nls --enable-color --enable-extra --enable-multibuffer --enable-nanorc

So, your System’s Nano is at latest version. Homebrew needed? No. Open your .zshrc at ~ location (that is your $HOME) :

Vim
1
cd $HOME && nano .zshrc

You will see that, this thing -> export PATH=/usr/local/bin:$PATH is already present there. If not, add it and run :

Vim
1
source .zshrc

OS X Nano Syntax Highlighting

 

OS X Nano Syntax Highlighting

 

We will create a new file named .nanorc at sweet $HOME :

Vim
1
nano ~/.nanorc

Copy paste this thing and hit ^ + O to write out and exit with ^ + X

Vim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
include "/usr/local/share/nano/nanorc.nanorc"
# Alphabetically
include "/usr/local/share/nano/awk.nanorc"
include "/usr/local/share/nano/asm.nanorc"
include "/usr/local/share/nano/c.nanorc"
include "/usr/local/share/nano/css.nanorc"
include "/usr/local/share/nano/cmake.nanorc"
include "/usr/local/share/nano/debian.nanorc"
include "/usr/local/share/nano/fortran.nanorc"
include "/usr/local/share/nano/gentoo.nanorc"
include "/usr/local/share/nano/groff.nanorc"
include "/usr/local/share/nano/html.nanorc"
include "/usr/local/share/nano/java.nanorc"
include "/usr/local/share/nano/man.nanorc"
include "/usr/local/share/nano/mutt.nanorc"
include "/usr/local/share/nano/makefile.nanorc"
include "/usr/local/share/nano/ocaml.nanorc"
include "/usr/local/share/nano/objc.nanorc"
include "/usr/local/share/nano/patch.nanorc"
include "/usr/local/share/nano/perl.nanorc"
include "/usr/local/share/nano/python.nanorc"
include "/usr/local/share/nano/php.nanorc"
include "/usr/local/share/nano/pov.nanorc"
include "/usr/local/share/nano/ruby.nanorc"
include "/usr/local/share/nano/sh.nanorc"
include "/usr/local/share/nano/tcl.nanorc"
include "/usr/local/share/nano/tex.nanorc"
include "/usr/local/share/nano/xml.nanorc"

OK, we only included, what were provided :

Vim
1
cd /usr/local/share/nano

Let us see, how our Nano is working with syntax highlighting :

Vim
1
nano ruby.nanorc

Getting some color? Good. Where is coffescript? This is the way to create :

Vim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# do not blindly copy
cd /usr/local/share/nano/
nano coffeescript.nanorc
# not tested !
 
syntax "coffeescript" "\.coffee$"
header "^#!.*/(env +)?coffee"
color red "[!&|=/*+-<>]|\<(and|or|is|isnt|not)\>"
color brightblue "[A-Za-z_][A-Za-z0-9_]*:[[:space:]]*(->|\()" "->"
color black    "[()]"
color cyan  "\<(for|of|continue|break|isnt|null|unless|this|else|if|return)\>"
color cyan  "\<(try|catch|finally|throw|new|delete|typeof|in|instanceof)\>"
color cyan  "\<(debugger|switch|while|do|class|extends|super)\>"
color cyan  "\<(undefined|then|unless|until|loop|of|by|when)\>"
color brightcyan  "\<(true|false|yes|no|on|off)\>"
color brightyellow "@[A-Za-z0-9_]*"
color yellow ""(\\.|[^"])*"|'(\\.|[^'])*'"
color brightblack "(^|[[:space:]])#([^{].*)?$"
color ,green "[[:space:]]+$"
color ,red " +"

You have to add this line within alphabetically C stuffs :

Vim
1
2
3
cd $HOME && nano ~/.nanorc
# add this line
include "/usr/local/share/nano/coffeescript.nanorc"

There are lot of such nanorc files in my GitHub repo.

Tagged With nano syntax highlighting os x , https://yandex ru/clck/jsredir?from=yandex ru;search;web;;&text=&etext=1821 DRpg8sp6YSsGbNOMc1P-rNvpi6xHhkmvq03KPSg4D_Q3NOClebB6y2T4B2GzObRc 1ec3ea8f1e94e14e346ea3aedf576f6bff8f1157&uuid=&state=_BLhILn4SxNIvvL0W45KSic66uCIg23qh8iRG98qeIXme , osx update nano , osx nano syntax color , nano editor os-x , nano color syntax mac , nano color on mac , MAC OS Nano , https://yandex ru/clck/jsredir?from=yandex ru;search;web;;&text=&etext=1828 JuuNcFsfsA6rvrstLpgwR2z6im9igCBVovdVZBGxSs_8sQnu56PhEdZ7Y8VKiK_5 42a96ad0c4fc22e086d03a56ec4fcaf71f6e93d9&uuid=&state=_BLhILn4SxNIvvL0W45KSic66uCIg23qh8iRG98qeIXme , update nano mac still uses old

This Article Has Been Shared 911 Times!

Facebook Twitter Pinterest
Abhishek Ghosh

About Abhishek Ghosh

Abhishek Ghosh is a Businessman, Surgeon, Author and Blogger. You can keep touch with him on Twitter - @AbhishekCTRL.

Here’s what we’ve got for you which might like :

Articles Related to OS X Nano Syntax Highlighting

  • Cloud Computing XaaS : Approaches and Possibilities

    Cloud Computing XaaS is an approach towards everything to provide as a service to make available and consume like we use electricity.Read the important aspects.

  • Mac OS X Original Theme for Ubuntu 12.04 : Will You Like It ?

    Mac OS X Original Theme for Ubuntu 12.04 will make Ubuntu look like Apple Mac OS X simply as the components are ported from Mac. But is it great to steal ?

  • List of Free eBook Websites with GNU GPL or Copyleft License

    List of Free eBook Websites with GNU GPL or Copyleft License lists many websites, you can download eBooks of various niche. Older books are mostly free.

  • Settings For Perfect Sound on MacBook Pro 15″ With Video

    Settings For Perfect Sound on MacBook Pro 15″ – this time not only text and screenshots but with video and real time sound with one music which is well known.

  • grep command : Details, Examples and Usages of Grep Command

    grep command for a program of UNIX and Unix like Operating System. It is used to search and filter. Historically, the name evolved from the command g / re / p.

Additionally, performing a search on this website can help you. Also, we have YouTube Videos.

Take The Conversation Further ...

We'd love to know your thoughts on this article.
Meet the Author over on Twitter to join the conversation right now!

If you want to Advertise on our Article or want a Sponsored Article, you are invited to Contact us.

Contact Us

Subscribe To Our Free Newsletter

Get new posts by email:

Please Confirm the Subscription When Approval Email Will Arrive in Your Email Inbox as Second Step.

Search this website…

 

Popular Articles

Our Homepage is best place to find popular articles!

Here Are Some Good to Read Articles :

  • Cloud Computing Service Models
  • What is Cloud Computing?
  • Cloud Computing and Social Networks in Mobile Space
  • ARM Processor Architecture
  • What Camera Mode to Choose
  • Indispensable MySQL queries for custom fields in WordPress
  • Windows 7 Speech Recognition Scripting Related Tutorials

Social Networks

  • Pinterest (22.1K Followers)
  • Twitter (5.8k Followers)
  • Facebook (5.7k Followers)
  • LinkedIn (3.7k Followers)
  • YouTube (1.3k Followers)
  • GitHub (Repository)
  • GitHub (Gists)
Looking to publish sponsored article on our website?

Contact us

Recent Posts

  • Big Data in Sports May 20, 2022
  • FaaS Versus PaaS Deployment: What You Should Know May 18, 2022
  • What Is A Digital Media Consultancy? May 17, 2022
  • How Artificial Intelligence (AI) Is Changing The Way We Play Bingo May 16, 2022
  • Why You Need A Big Data Consultant May 15, 2022

About This Article

Cite this article as: Abhishek Ghosh, "OS X Nano Syntax Highlighting," in The Customize Windows, January 20, 2015, May 20, 2022, https://thecustomizewindows.com/2015/01/os-x-nano-syntax-highlighting/.

Source:The Customize Windows, JiMA.in

This website uses cookies. If you do not want to allow us to use cookies and/or non-personalized Ads, kindly clear browser cookies after closing this webpage.

Read Privacy Policy.

PC users can consult Corrine Chorney for Security.

Want to know more about us? Read Notability and Mentions & Our Setup.

Copyright © 2022 - The Customize Windows | dESIGNed by The Customize Windows

Copyright  · Privacy Policy  · Advertising Policy  · Terms of Service  · Refund Policy