nanorc.sample 4.92 KB
Newer Older
1
2
3
4
5
## Sample initialization file for GNU nano
## Please note that you must have configured nano with 
## --enable-nanorc for this file to be read!
##
## To make sure a value is not enabled, use "unset <option>"
6

7
## Use auto-indentation
8
9
# set autoindent

10
## Backup files to filename~
11
# set backup
12

13
## Constantly update the cursor position
14
15
# set const

16
## Use cut to end of line with ^K by default
17
18
# set cut

19
20
21
22
## Use this value instead of the default
## An out-of-range negative value can make nano die complaining that the
## screen is too small
## set fill -8
23

24
## Use alternate keypad routines
25
26
# set keypad

27
28
29
30
31
## Allow multiple file buffers (using ^R inserts into separate buffer)
## You must have configured with --enable-multibuffer or --enable-extra
## for this to work
##
## set multibuffer
32

33
## Don't convert files from DOS/Mac format
34
# set noconvert
35

36
## Don't follow symlinks when writing files
37
38
# set nofollow

39
## Don't display the help lists at the bottom of the screen
40
41
# set nohelp

42
## Don't wrap text at all
43
44
# set nowrap

45
## Set operating directory (chroot of sorts)
46
47
# set operatingdir "~"

48
49
## Preserve the XON and XOFF keys (^Q and ^S)
# set preserve
50

51
52
## The email-quote string.  This is a "regular expression" if your
## system supports them, otherwise a literal string.  Default
Chris Allegretta's avatar
Chris Allegretta committed
53
54
# set quotestr "^([ \t]*[|>:}#])+" if you have regexps, otherwise
# set quotestr "> ".
55
## You can get old nano quoted-justify behavior via:
Chris Allegretta's avatar
Chris Allegretta committed
56
# set quotestr "(> )+"
57

58
## Do regular expression searches by default 
59
60
# set regexp

61
## Use smooth scrolling as the default
62
# set smooth
63

64
## Use this spelling checker instead of the default one
65
66
# set speller aspell

67
## Allow nano to be suspended with ^Z
68
69
# set suspend

70
## Use this tab size instead of the default; it must be greater than 0
71
# set tabsize 4
72

73
## Save automatically on exit, don't prompt
74
# set tempfile
75

76
## Disallow file modification, why would you want this in an rc file? ;)
77
# set view
78

79
80
81
82
83
84
85
86
87
88
89
90
91
92
## Color setup
## Format: 
## syntax "short description" ["filename regex" ...]
## color foreground,background "regex" ["regex"...]
##
## Legal colors are: white, black, red, blue, green, yellow, purple,
## cyan.  You may use the prefix "bright" to mean a stronger color
## highlight.
##
## 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.
93

Chris Allegretta's avatar
Chris Allegretta committed
94
# syntax "c-file" ".*\.c$" ".*\.h$"
95
# color red "\<[A-Z_]{2,}\>" 
96
97
98
99
100
# color green "\<float\>" "\<char\>" "\<int\>" "\<void\>"
# color green "\<static\>" "\<const\>" "\<struct\>" 
# color brightyellow "\<if\>" "\<while\>" "\<do\>" "\<else\>" "\<case\>" "\<switch\>"
# color brightcyan "#define" "#include" "#ifn*def" "#endif" 
# color brightcyan "#elif" "#else" "#if"
101

102
103
104
105
## You will in general want your comments and strings to come last,
## because syntax highlighting rules will be applied in the order they
## are read in.  Note that quotes in regexes should not be escaped (use "
## instead of \").
106

107
# color brightyellow "<[^= ]*>" ""(\\.|[^\"])*""
108
109

## This string is VERY resource intensive!!!
110
# color brightyellow start=""(\\.|[^\"])*\\( |	)*$" end="^(\\.|[^\"])*""
111
112

## And we want to have some nice comment highlighting too
113
# color brightblue "//.*"
Chris Allegretta's avatar
Chris Allegretta committed
114
# color brightblue start="/\*" end="\*/"
115

116
117

## Here are some short examples for TeX files and HTML
118
119
120
121
122
123
124
125
126
127
128
# syntax "HTML" "\.html$"
#
# color blue start="<" end=">"
# color red "&([^; ])*;"
#
# syntax "TeX" "\.tex$"
#
# color green "\\(.|([A-Za-z]*))"
# color magenta "\{" "\}"
# color blue "%.*"

129

130
## For this you will probably want to set your editor to "nano -Y mutt"
131
132
# syntax "mutt"
# color green "^>.*"
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

## Here is are examples for groff and for your .nanorc

#syntax "groff" "\.ms$" "\.mm$" "\.me$" "\.tmac$" "^tmac." ".rof"
## The argument of .nr or .ds
#color cyan "^\.ds [^ ]*"
#color cyan "^\.nr [^ ]*"
## Single character escapes
#color brightmagenta "\\."
## Highlight the argument of \f or \s in the same colour
#color brightmagenta "\\f."
#color brightmagenta "\\f\(.."
#color brightmagenta "\\s(\+|\-)?[0-9]"
## \n
#color cyan "(\\|\\\\)n."
#color cyan "(\\|\\\\)n\(.."
#color cyan start="(\\|\\\\)n\[" end="]"
## Requests
#color brightgreen "^\. *[^ ]*"
## Comments
#color yellow "^\.\\\".*$"
## Strings
#color green "(\\|\\\\)\*."
#color green "(\\|\\\\)\*\(.."
#color green start="(\\|\\\\)\*\[" end="]"
## Characters
#color brightred "\\\(.."
#color brightred start="\\\[" end="]"
## Macro arguments
#color brightcyan "\\\\\$[1-9]"


#syntax "nanorc" "[\.]*nanorc$"
#color white "^ *(set|unset).*$"
#color cyan "^ *(set|unset) (autoindent|backup|const|cut|fill|keypad|multibuffer|noconvert|nofollow|nohelp|nowrap|operatingdir|preserve|quotestr|regexp|smooth|speller|suspend|tabsize|tempfile|view)"
#color brightwhite "^ *syntax [^ ]*"
#color brightblue "^ *set\>" "^ *unset\>" "^ *syntax\>"
#color white "^ *color\>.*"
#color yellow "^ *color [^ ]*"
#color magenta "^ *color\>"
#color green "^#.*$"