1 # Improved Nano Syntax Highlighting Files
3 This repository holds ``{lang}.nanorc`` files that have improved definitions of syntax highlighting for various languages.
7 There are three ways to install this repo.
9 ### 1. Automatic installer
11 Copy the following code to download and run the installer script:
14 curl https://raw.githubusercontent.com/scopatz/nanorc/master/install.sh | sh
17 If your machine doesn't have `curl` command, use this code:
20 wget https://raw.githubusercontent.com/scopatz/nanorc/master/install.sh -O- | sh
25 Some syntax definitions which exist in Nano upstream may be preferable to the ones provided by this package.
26 The ` install.sh` script may be run with `-l` or `--lite` to insert the included syntax definitions from this package with *lower* precedence than the ones provided by the standard package.
28 ### 2. Package managers
30 The follow table lists all systems with this package published.
31 Feel free to add your official package manager.
33 > Systems that are based in others' package managers or repositories are compatible. For example: `pacman` based systems are compatible with `Arch Linux`.
36 | ---------- | ---------------------------------------- |
37 | Arch Linux | `pacman -S nano-syntax-highlighting` |
39 ### 3. Clone repo (copy the files)
41 The files should be placed inside of the `~/.nano/` directory.
43 You can put the files in another directory inside the correct `.nano` folder.
44 For example: `~/.nano/nanorc/`.
45 For readability will use `$install_path` for the path of your choose (in *system wide* the path is always `/usr/share/nano-syntax-highlighting/`).
49 `git clone git@github.com:scopatz/nanorc.git $install_path` or
50 `git clone https://github.com/scopatz/nanorc.git $install_path`
54 `sudo git clone https://github.com/scopatz/nanorc.git $install_path`
58 After installation, you need to inform `nano` to used the new highlight files.
59 The configuration file is located at `~/.nanorc`, for users, and at `/etc/nanorc`, for system wide.
60 If this file doesn't exist, create a new one.
62 Again there are three ways:
66 Append the content of the folder in one line, with wildcard:
68 `echo "include $install_path/*.nanorc" >> ~/.nanorc` or
69 `echo "include $install_path/*.nanorc" >> /etc/nanorc`
71 ### 2. Include/append our `nanorc` file
75 `cat $install_path/nanorc >> ~/.nanorc` or
76 `cat $install_path/nanorc >> /etc/nanorc`
80 Add your preferable languages one by onento the file. For example:
84 include "~/.nano/c.nanorc"
91 `\<` and `\>` are regular character escapes on MacOS.
92 The bug is fixed in Nano, but this might be a problem if you are using an older version
93 If this is the case, replace them respectively with `[[:<:]]` and `[[:>:]]`.
94 This is reported in [Issue 52](https://github.com/scopatz/nanorc/issues/52).
96 ### Why not include the original files?
98 It is a good question, but the way that nano reads the files matters.
99 In other words, the regex instructions should be in a _specific order_ (you can see that in some nanorc files).
100 So, if we `include` or `extendsyntax` (yes, there is also this command) the colors or other things won't be work well.
101 The best way to do is copying and editing the original files (if it is needed).
102 Please see this [issue](https://savannah.gnu.org/bugs/index.php?5698).
103 But if some original nanorc file needs an update, feel free to [patch it](https://savannah.gnu.org/patch/?func=additem&group=nano)!
105 ### My shortcut is not working!
107 Please see this [issue](https://savannah.gnu.org/bugs/?56994).
111 Some of these files are derived from the original [Nano](https://www.nano-editor.org) editor [repo](https://git.savannah.gnu.org/cgit/nano.git)