aboutsummaryrefslogtreecommitdiffhomepage
path: root/sundry/misc/editor-syntax-etc/nano/nanorc
blob: 30ba439cdb77cbaaab927daaa080de28c8cbc360 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
## Sample initialization file for GNU nano
## Please note that you must have configured nano with --enable-nanorc
## for this file to be read!  Also note that characters specially
## interpreted by the shell should not be escaped here.
##
## To make sure a value is not enabled, use "unset <option>"
##
## For the options that take parameters, the default value is given.
## Other options are unset by default.

## Use auto-indentation.
# set autoindent

## Backup files to filename~.
# set backup

## The directory to put unique backup files in.
# set backupdir ""

## Do backwards searches by default.
# set backwards

## The characters treated as closing brackets.  They cannot contain
## blank characters.  Only closing punctuation, optionally followed by
## closing brackets, can end sentences.
##
# set brackets "'")}]>"

## Do case sensitive searches by default.
# set casesensitive

## Constantly display the cursor position in the statusbar.  Note that
## this cancels out "quickblank".
# set const

## Use cut to end of line by default.
# set cut

## Set the line length for wrapping text and justifying paragraphs.
## If fill is 0 or less, the line length will be the screen width less
## this number.
##
# set fill -8

## Enable ~/.nano_history for saving and reading search/replace strings.
# set historylog

## Use the blank line below the titlebar as extra editing space.
# set morespace

## Enable mouse support, so that mouse clicks can be used to set the
## mark and run shortcuts.
# set mouse

## Allow multiple file buffers (inserting a file will put it into a
## separate buffer).  You must have configured with --enable-multibuffer
## for this to work.
##
# set multibuffer

## Don't convert files from DOS/Mac format.
# set noconvert

## Don't follow symlinks when writing files.
# set nofollow

## Don't display the helpful shortcut lists at the bottom of the screen.
# set nohelp

## Don't wrap text at all.
# set nowrap

## Set operating directory.  nano will not read or write files outside
## this directory and its subdirectories.  Also, the current directory
## is changed to here, so files are inserted from this dir.  A blank
## string means the operating directory feature is turned off.
##
# set operatingdir ""

## Preserve the XON and XOFF keys (^Q and ^S).
# set preserve

## The characters treated as closing punctuation.  They cannot contain
## blank characters.  Only closing punctuation, optionally followed by
## closing brackets, can end sentences.
##
# set punct ".?!"

## Do quick statusbar blanking.  Statusbar messages will disappear after
## 1 keystroke instead of 25.  Note that "const" cancels this out.
##
# set quickblank

## The email-quote string, used to justify email-quoted paragraphs.
## This is an extended regular expression if your system supports them,
## otherwise a literal string.  Default:
# set quotestr "^([ 	]*[\|>:}#])+"
## if you have regexps, otherwise:
# set quotestr "> "
## You can get old nano quoted-justify behavior via:
# set quotestr "(> )+"

## Fix Backspace/Delete confusion problem.
# set rebinddelete

## Do extended regular expression searches by default.
# set regexp

## Make the Home key smarter.  When Home is pressed anywhere but at the
## very beginning of non-whitespace characters on a line, the cursor
## will jump to that beginning (either forwards or backwards).  If the
## cursor is already at that position, it will jump to the true
## beginning of the line.
# set smarthome

## Use smooth scrolling as the default.
# set smooth

## Use this spelling checker instead of the internal one.  This option
## does not properly have a default value.
##
# set speller "aspell -x -c"

## Allow nano to be suspended.
# set suspend

## Use this tab size instead of the default; it must be greater than 0.
# set tabsize 8

## Convert typed tabs to spaces.
# set tabstospaces

## Save automatically on exit, don't prompt.
# set tempfile

## Disallow file modification; why would you want this in an rcfile? ;)
# set view

## The two single-column characters used to display the first characters
## of tabs and spaces.  187 decimal (00BB hexadecimal) and 183 decimal
## (00B7 hexadecimal) seem to be good values for these.
# set whitespace "  "

## Color setup
##
## Format:
##
## syntax "short description" ["filename regex" ...]
##
## color foreground,background "regex" ["regex"...]
## or
## icolor foreground,background "regex" ["regex"...]
##
## "color" will do case sensitive matches, while "icolor" will do case
## insensitive matches.
##
## Legal colors: white, black, red, blue, green, yellow, magenta, cyan.
## You may use the prefix "bright" to mean a stronger color highlight
## for the foreground.
##
## To use multi-line regexes, use the start="regex" end="regex" format.
##
## If your system supports transparency, not specifying a background
## color will use a transparent color.  If you don't want this, be sure
## to set the background color to black or white.
##
# syntax "c-file" "\.(c|C|cc|cpp|cxx|h|H|hh|hpp|hxx)$"
# color red "\<[A-Z_]{2,}\>"
# color green "\<(float|double|bool|char|int|short|long|sizeof|enum|void|static|const|struct|union|typedef|extern|signed|unsigned|inline)\>"
# color green "\<(class|namespace|template|public|protected|private|typename|this|friend|virtual|using|mutable|volatile|register|explicit)\>"
# color brightyellow "\<(for|if|while|do|else|case|default|switch|goto|continue|break|return)\>"
# color brightyellow "\<(try|throw|catch|operator|new|delete)\>"
# color brightcyan "^[[:space:]]*#[[:space:]]*(define|undef|include|ifn?def|endif|elif|else|if|warning|error)"
# color brightmagenta "'([^\]|(\\['abfnrtv\\]))'" "'\\(([0-7][0-7]?)|([0-3][0-7][0-7]))'" "'\\x[0-9A-Fa-f][0-9A-Fa-f]?'"
## color foreground,background "regex" ["regex"...]
##
#% sisu
syntax "sisu" "\.ss[tmi]$"
#color white,black ".*"
color cyan start="^0~" end="^$"
color cyan start="^@\S+:" end="^$"
#color cyan "^0~.*"
color brightyellow "^[1-6]~.*"
color brightyellow "^:?[A-C]~.*"
icolor brightwhite "^(Chapter|Part|Section|Book|Article|Preamble|Appendix)\s.*"
color brightyellow "^!_\s.*"
color brightyellow "[!*]\{.+?\}[!*]"
color yellow "[/_+-^,]\{.+?\}[/_+-^,]"
color green "~\{.+?\}~"
color green "~\^(\s|$)"
color green "^\^~\s.+"
#color green start="~\{" end="\}~"
color yellow "\{.+?\}http:\/\/\S+"
color brightblue "http:\/\/\S+"
color brightblue "^<<\s\S+?\.ss[it]"
color yellow "^(_[12]?\*|_[12])"
color magenta "^%+\s+.*"
color green start="^poem\{$" end="^\}poem$"
color green start="^code\{$" end="^\}code$"
color green start="^group\{$" end="^\}group$"
color green start="^alt\{$" end="^\}alt$"
color magenta "<:(pb|np)>"
color magenta "<(\/\s*)?br>"
color magenta "[a-zA-Z0-9,.::?!&]+http:\/\/\S+"

# .nanorc
#
 syntax "nanorc" "(\.|/|)nanorc$"
# highlight possible errors and parameters
 icolor brightwhite "^[[:space:]]*(set|unset|syntax|i?color).*$"
# set, unset and syntax
 icolor cyan "^[[:space:]]*(set|unset)[[:space:]]+(autoindent|backup|backupdir|backwards|brackets|casesensitive|const|cut|fill|historylog|morespace|mouse|multibuffer|noconvert|nofollow|nohelp|nowrap|operatingdir|preserve|punct|quickblank|quotestr|rebinddelete)\>" "^[[:space:]]*(set|unset)[[:space:]]+(regexp|smarthome|smooth|speller|suspend|tabsize|tabstospaces|tempfile|view|whitespace)\>"
 icolor green "^[[:space:]]*(set|unset|syntax)\>"
# colors
 icolor yellow "^[[:space:]]*i?color[[:space:]]*(bright)?(white|black|red|blue|green|yellow|magenta|cyan)?(,(white|black|red|blue|green|yellow|magenta|cyan))?\>"
 icolor magenta "^[[:space:]]*i?color\>" "\<(start|end)="
# strings
 icolor white "\"(\\.|[^\"])*\""
# comments
 icolor blue "^[[:space:]]*#.*$"