• 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 » Nginx Config Syntax Highlighting in Nano (Ubuntu)

By Abhishek Ghosh January 22, 2015 9:29 am Updated on January 22, 2015

Nginx Config Syntax Highlighting in Nano (Ubuntu)

Advertisement

Normally, People Will Use SSH to Edit the Nginx Configuration Files. Here is How to Get Nginx Config Syntax Highlighting in Nano on Ubuntu. First, we are describing the method for localhost, so that one can test and edit the rc files, in other two subheads, we will describe how to enable Nginx config Syntax Highlighting in Nano on Ubuntu Server and what are problems of Syntax Highlighting in Nano. By any means, DO NOT MAKE NANO THE DEFAULT TEXT EDITOR. Using Vi is not so difficult – open the file with command like vi /etc/nginx/nginx.conf and press i to edit. Edit it and press escape. Then type :w to write out and :q to exit.

 

Nginx Config Syntax Highlighting in Nano : OS X localhost

 

Apple keeps the Nano in 2.0.x version. Homebrew-dupes do not upgrade Nano anymore, why all do not like Nano to get upgraded will be discussed later. You can follow our guide to upgrade Nano in OS X in the guide for OS X Nano Syntax Highlighting. Only add this flag while building :

Vim
1
--enable-nanorc

Do not follow rest of the guide. Now, do these steps :

Advertisement

---

Vim
1
2
3
4
cd ~ && git clone https://github.com/AbhishekGhosh/nano-syntax-highlighting-iNano-.git
cd nano-syntax* && sudo make install-global TEXT=white
vi /etc/nanorc
# nano ~/.nanorc

That /etc/nanorc is a read only file unless you use --enable-nanorc during building it. If you add ~/.nanorc, it might create problem. Paste this line on either /etc/nanorc (ideally) or in ~/.nanorc (create it, it will not be present by default) :

Vim
1
include "/usr/local/share/nano/ALL.nanorc"

You will get Syntax highlighting more than default. This is my current repo on GitHub for Nanorc. Star the repo, I will update it. When I will update, you’ll also update again.
Test any file on your computer including Nginx Files.

Without the flag, adding the line on /etc/nanorc, will not work.

 

Nginx Config Syntax Highlighting in Nano : Ubuntu Server

 

Nano is already in updated version. Be you are a user or the root, does not matter, the commands are same :

Vim
1
2
3
cd ~ && git clone https://github.com/AbhishekGhosh/nano-syntax-highlighting-iNano-.git
cd nano-syntax* && sudo make install-global TEXT=white
vi ~/.nanorc

As that /etc/nanorc is a read only file unless we have not got the chance to build Nano with --enable-nanorc flag, we have no other way than using ~/.nanorc. Paste this line on ~/.nanorc (create it, it will not be present by default) :

Vim
1
include "/usr/local/share/nano/ALL.nanorc"

Open any nginx file with nano like /etc/nginx/sites-available/default or /etc/nginx/nginx.conf. Getting color? If you do not get color, that is for so many commented out stuffs on default, remove them, you’ll get color.

Nginx Config Syntax Highlighting in Nano (Ubuntu)

 

Why Syntax Highlighting in Nano is Disabled By Default?

 

Nano’s syntax highlighting is kept to off to avoid segmentation error. Apple probably does not upgrade Nano out of fear. Maybe, Homebrew-dupes discontinued for the same reasons. We have some collection of nanorc files – on the Github repo, the script concatenates all the files to one; you will not need to add so much lines. We are including in this way :

include /usr/local/share/nano/ALL.nanorc

If you know more .nanorc, you can send a pull request to add.

We use .zshrc on all my Macs, MacBooks with export PATH=/usr/local/bin:$PATH on both .zshrc and .bash_profile. As Nano is not the system default text editor, unlike vi, there is no fear, you can build the latest version.

Our .bash_profile has that only one line. There is no .bashrc. It is impractical to comment out so many includes on the fly.

When nano will throw segmentation error, then the way is to use vi to open it with sudo vi ~/.nanorc in Terminal (not iTerm2) and commenting out that line to solve the segmentation error.

When Nano was ported from Pico – http://www.washington.edu/pine/getpine/ , then it had another name. Again it was re-written with the Nano name. At anytime, Nano can throw segmentation error if you are using Syntax Highlighting. Nano supports both nanorc and .nanorc, even nanor.c. The files can be kept at /usr/share/nano or at $HOME or /etc either as nanorc or .nanorc. That segmentation fault or segmentation error can happen occur under some of these circumstances:

A buggy program
Try to access an array beyond the end of an array under C programming language
Missing config file or /dev/ inside a chrooted jail in shared libs
Hardware is faulty
Memory or driver is faulty
Overheating

So much is not said, only people says – “Vi is powerful editor”. Powerful means, it will not throw abnormal errors. Chance of error increases if you use Syntax Highlighting in Nano.

Tagged With edit nginx config ubuntu , how to use nano to edit nginx in linux , nano config , nano nginixconf sytax , nano segfault using nanorc , nginx configuration edit with nano , nginx syntax , ubuntu gedit nginx config highlight mode , what to edit in the nginx config to enable usage for organizer on windows

This Article Has Been Shared 854 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 Nginx Config Syntax Highlighting in Nano (Ubuntu)

  • Select and Delete All Text of a File In SSH

    It is Quite Pathetic To Hold the Delete/Backspace Key of Any in Text Editor Like Nano or Vi in SSH Session. Here is a Practical Cheat Sheet.

  • Wildcard in Computing : What is this Wildcard ?

    Wildcard is a technical term used in computing which indicates a placeholder for other characters. This concept is often referred to as globbing.

  • Syntax Highlighting : All About the Colorful Snippets

    Syntax Highlighting is a method for coloring certain words and characters in a text depending on their importance in in an piece of code or snippet.

  • Desktop Virtualization with Oracle VirtualBox

    Desktop Virtualization provides a complete work environment. Custom configured operating system of the guest systems are stored on the host systems.

  • Installing Apache2 With PHP5 and MySQL Easy Guide

    Installing Apache2 With PHP5 and MySQL on Rackspace Cloud Server with Ubuntu Linux is written in easy language and as step by step guide for the newbies.

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

  • Projector Screen Basics February 6, 2023
  • 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

About This Article

Cite this article as: Abhishek Ghosh, "Nginx Config Syntax Highlighting in Nano (Ubuntu)," in The Customize Windows, January 22, 2015, February 6, 2023, https://thecustomizewindows.com/2015/01/nginx-config-syntax-highlighting-nano-ubuntu/.

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