• 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 404 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 (24.3K 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

  • What is Configuration Management February 5, 2023
  • What is ChatGPT? February 3, 2023
  • Zebronics Pixaplay 16 : Entry Level Movie Projector Review February 2, 2023
  • What is Voice User Interface (VUI) January 31, 2023
  • Proxy Server: Design Pattern in Programming January 30, 2023

About This Article

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

Source:The Customize Windows, JiMA.in

PC users can consult Corrine Chorney for Security.

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

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

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

We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Accept”, you consent to the use of ALL the cookies.
Do not sell my personal information.
Cookie SettingsAccept
Manage consent

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. These cookies ensure basic functionalities and security features of the website, anonymously.
CookieDurationDescription
cookielawinfo-checkbox-analytics11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics".
cookielawinfo-checkbox-functional11 monthsThe cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional".
cookielawinfo-checkbox-necessary11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary".
cookielawinfo-checkbox-others11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other.
cookielawinfo-checkbox-performance11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance".
viewed_cookie_policy11 monthsThe cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data.
Functional
Functional cookies help to perform certain functionalities like sharing the content of the website on social media platforms, collect feedbacks, and other third-party features.
Performance
Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.
Analytics
Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.
Advertisement
Advertisement cookies are used to provide visitors with relevant ads and marketing campaigns. These cookies track visitors across websites and collect information to provide customized ads.
Others
Other uncategorized cookies are those that are being analyzed and have not been classified into a category as yet.
SAVE & ACCEPT