This is the first push to this repo with my dotfiles
[dotfilesold/.git] / .nano / readme.md
1 # Improved Nano Syntax Highlighting Files
2
3 This repository holds ``{lang}.nanorc`` files that have improved definitions of syntax highlighting for various languages.
4
5 ## Installation
6
7 There are three ways to install this repo.
8
9 ### 1. Automatic installer
10
11 Copy the following code to download and run the installer script:
12
13 ```sh
14 curl https://raw.githubusercontent.com/scopatz/nanorc/master/install.sh | sh
15 ```
16
17 If your machine doesn't have `curl` command, use this code:
18
19 ```sh
20 wget https://raw.githubusercontent.com/scopatz/nanorc/master/install.sh -O- | sh
21 ```
22
23 #### Note
24
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.
27
28 ### 2. Package managers
29
30 The follow table lists all systems with this package published.  
31 Feel free to add your official package manager.
32
33 > Systems that are based in others' package managers or repositories are compatible. For example: `pacman` based systems are compatible with `Arch Linux`.
34
35 | System     | Command                                  |
36 | ---------- | ---------------------------------------- |
37 | Arch Linux | `pacman -S nano-syntax-highlighting`     |
38
39 ### 3. Clone repo (copy the files)
40
41 The files should be placed inside of the `~/.nano/` directory.
42
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/`).
46
47 For user, only run:
48
49 `git clone git@github.com:scopatz/nanorc.git $install_path` or  
50 `git clone https://github.com/scopatz/nanorc.git $install_path`
51
52 For system wide, run:
53
54 `sudo git clone https://github.com/scopatz/nanorc.git $install_path`
55
56 ## Configuration
57
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.
61
62 Again there are three ways:
63
64 ### 1. Include all
65
66 Append the content of the folder in one line, with wildcard:
67
68 `echo "include $install_path/*.nanorc" >> ~/.nanorc` or  
69 `echo "include $install_path/*.nanorc" >> /etc/nanorc`
70
71 ### 2. Include/append our `nanorc` file
72
73 Simply run:
74
75 `cat $install_path/nanorc >> ~/.nanorc` or  
76 `cat $install_path/nanorc >> /etc/nanorc`
77
78 ### 3. One by one
79
80 Add your preferable languages one by onento the file. For example:
81
82 ```
83 ## C/C++
84 include "~/.nano/c.nanorc"
85 ```
86
87 ## Tricks & Tweaks
88
89 ### MacOS
90
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).
95
96 ### Why not include the original files?
97
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)!
104
105 ### My shortcut is not working!
106
107 Please see this [issue](https://savannah.gnu.org/bugs/?56994).
108
109 ## Acknowledgements
110
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)