• 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 509 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 (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

  • The Future Of Serverless: The Load-Intensive Workload Case May 25, 2022
  • Cutting Out The Coding: Serverless Computing In Action May 24, 2022
  • Types of Blackjack Variants: Discover the Different Versions of the Game May 23, 2022
  • How Cloud, Robotics And Sensor Technologies Are Changing The Business Landscape May 23, 2022
  • Modernizing Your Business With a Hybrid Cloud Strategy May 22, 2022

About This Article

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

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