84
|
1 ***************************************
|
|
2 Improved Nano Syntax Highlighting Files
|
|
3 ***************************************
|
|
4
|
|
5 This repository holds ``{lang}.nanorc`` files that have improved
|
|
6 definitions of syntax highlighting for various languages.
|
|
7
|
|
8
|
|
9 1. Copy files
|
|
10 ~~~~~~
|
|
11
|
|
12 These should be placed inside of the ``~/.nano/`` directory.
|
|
13 Or for system-wide installation ``/usr/share/nano-syntax-highlighting/``.
|
|
14 In other words::
|
|
15
|
|
16 git clone git@github.com:scopatz/nanorc.git ~/.nano
|
|
17
|
|
18 *Note - if you have any issues (ssh was not properly configured), alternatively use::
|
|
19
|
|
20 git clone https://github.com/scopatz/nanorc.git ~/.nano
|
|
21
|
|
22 *System wide will look like so*::
|
|
23
|
|
24 sudo git clone https://github.com/scopatz/nanorc.git /usr/share/nano-syntax-highlighting/
|
|
25
|
|
26
|
|
27 2. Configure ``nano``
|
|
28 ~~~~~~~~~
|
|
29
|
|
30 Once there you should add the languages you want to your
|
|
31 nano configuration file ``~/.nanorc``. For example::
|
|
32
|
|
33 ## C/C++
|
|
34 include "~/.nano/c.nanorc"
|
|
35
|
|
36 You can also append the contents of ``~/.nano/nanorc`` into your
|
|
37 ``~/.nanorc`` to include all languages::
|
|
38
|
|
39 cat ~/.nano/nanorc >> ~/.nanorc
|
|
40
|
|
41 Or to be less verbose, append content of the folder in one line with wildcard::
|
|
42
|
|
43 ## For all users
|
|
44 $ echo "include $install_path/*.nanorc" >> /etc/nanorc
|
|
45 ## For current user
|
|
46 $ echo "include $install_path/*.nanorc" >> ~/.nanorc
|
|
47
|
|
48 where ``$install_path`` is ``/usr/share/nano-syntax-highlighting`` or ``~/.nano/`` or ...
|
|
49
|
|
50 1a. Automatic installer
|
|
51 ~~~~~~~~~~~~~~~~~~~~~~
|
|
52 Finally, you can run an automatic installer using the following code::
|
|
53
|
|
54 $ curl https://raw.githubusercontent.com/scopatz/nanorc/master/install.sh | sh
|
|
55
|
|
56 or alternatively::
|
|
57
|
|
58 $ wget https://raw.githubusercontent.com/scopatz/nanorc/master/install.sh -O- | sh
|
|
59
|
|
60 *Note -
|
|
61 some syntax definitions which exist in Nano upstream may be preferable to the ones provided by this package.
|
|
62 The install.sh script may be run with ``-l`` or ``--lite`` to insert the included syntax definitions from this package
|
|
63 with lower precedence than the ones provided by the standard package.
|
|
64
|
|
65
|
|
66 1b. Distributive specific installation via package managers
|
|
67 ~~~~~~~~~~
|
|
68 On **Arch Linux** and other *pacman/aur* based systems it is possible to::
|
|
69
|
|
70 $ yaourt nano-syntax-highlight
|
|
71
|
|
72 Then you need to mannually add ``.nanorc``-s to user's ``~/.nanorc`` or system ``/etc/nanorc``. See **$2**
|