Debian Codegraph @

doc/modes.html

raw symbols SCIP
1 <HTML>
2 <HEAD><TITLE>Mode Configuration</TITLE></HEAD>
3 <BODY>
4 fte allows each file extension to have a different editing mode. Mode
5 is a collection of editor settings such as keybindings, tab settings,
6 autoindent settings, syntax highlighting,...
7 <P>
8 Syntax of <B>mode</B> command is
9 <P>
10 <PRE>
11 mode NAME { mode settings }
12 mode NAME: PARENT { mode settings }
13 </PRE>
14
15 <P> Mode with name <I>NAME</I>inherits settings from mode <I>PARENT</I>
16 if parent mode is specified at mode declaration.
17
18 <P> When editor is searching for a mode to use for a file it will
19 first check if the mode has been overriden by a <A
20 HREF="command.html#ec.FileOpenInMode">FileOpenInMode</A> command or a command line
21 option (<B>-m</B>).
22
23 <P> Then it will check if the file name matches <A
24 HREF="#ms.FileNameRx">FileNameRx</A> defined in mode declarations.
25
26 <P> If the mode has still not been found, it will read the first line
27 (max 80 chars) of the file, and attempt to match the <A
28 HREF="#ms.FirstLineRx">FirstLineRx</A> with the first line.
29
30 <P> If this fails, the editor will use mode specified by
31 <B><A HREF="global.html#gs.DefaultModeName">DefaultModeName</A></B> global
32 setting to load a file. If that mode does not exist, first mode defined
33 in the configuration file will be used.
34
35 <HR>
36 <H2><A NAME="modesetup">Mode Settings</A></H2>
37 <P>
38 The following settings can be specified for each mode:
39 <H3><A NAME="ms.ExpandTabs">ExpandTabs</A></H3>
40 {0,1}
41 <P>
42 Should be set to 1 if tabs are to be expanded when displayed. Use
43 <A HREF="command.html#ec.ToggleExpandTabs">ToggleExpandTabs</A> command to toggle
44 during editing.
45
46 <H3><A NAME="ms.TabSize">TabSize</A></H3>
47 {1-32}
48 <P>Tab size when tabs are shown expanded on display.
49
50 <H3><A NAME="ms.AutoIndent">AutoIndent</A></H3>
51 {0,1}
52 <P>Should be set to 1 if autoindent is to be used. Use
53 <A HREF="command.html#ec.ToggleAutoIndent">ToggleAutoIndent</A> command
54 to toggle it on/off during editing.
55
56 <H3><A NAME="ms.Insert">Insert</A></H3>
57
58 {0,1}
59 <P>
60 If set to <B>1</B>, Insert mode is active by default.
61 If set to <B>0</B>, Overwrite mode is active by default.
62 <P> Use <A HREF="command.html#ec.ToggleInsert">ToggleInsert</A> command
63 to toggle it on/off during editing.
64
65 <H3><A NAME="ms.StripChar">StripChar</A></H3>
66 {ASCII code/-1}
67
68 <P>This characted will be stripped if it is found the end of any line
69 when the file is being loaded. If it is set to <B>-1</B>, no characted
70 will be stripped.
71 <P>Usually used to strip 13 (CR) characters from DOS text files.
72
73 <H3><A NAME="ms.LineChar">LineChar</A></H3>
74 {ASCII code/-1}
75
76 <P>This character is used as a line separator when loading a file.
77 If set to <B>-1</B>, there is no line separator. (<B>WARNING: File will
78 be loaded as one line if LineChar is set to -1</B>).
79 <P>Usually set to 10 (LF) as standard text file line separator.
80
81 <H3><A NAME="ms.AddCR">AddCR</A></H3>
82 {0,1}
83
84 <P>If set to <B>1</B>, CR (13, \r) character will be added to end of
85 line when saving.
86
87 <H3><A NAME="ms.AddLF">AddLF</A></H3>
88
89 {0,1}
90 <P>If set to <B>1</B>, LF (10, \n) characted will be added to end if line when saving.
91
92 <H3><A NAME="ms.ForceNewLine">ForceNewLine</A></H3>
93 {0,1}
94 <P>Normally, when saving, the last line is saved without any CR/LF
95 characters. This setting will override that behaviour.
96
97 <H3><A NAME="ms.Hilit">Hilit</A></H3>
98 {0,1}
99 <P>If set to <B>1</B>, syntax highliting will be active.
100
101 <H3><A NAME="ms.ShowTabs">ShowTabs</A></H3>
102 {0,1}
103 <P>If set to <B>1</B>, tabs will be visible as circles (EPM-like).
104
105 <H3><A NAME="ms.IndentMode">IndentMode</A></H3>
106 {PLAIN,C,REXX}
107 <P>Activates the specified smart indent mode. (PLAIN mode specifies
108 no smart audoindenting, just normal autoindent).
109
110 <H3><A NAME="colorizer">Colorizer</A></H3>
111 Specifies a previously declared <A HREF="#colorizer">colorize</A> mode to use for syntax
112 highlighting in this editing mode.
113
114 <H3><A NAME="eventmap">EventMap</A></H3>
115 Specify the name of existing eventmap to use for current mode.
116
117 <H3><A NAME="ms.UndoLimit">UndoLimit</A></H3>
118 {Number}
119 <P>Limit undo to this many recent commands (-1 = unlimited)
120
121 <H3><A NAME="ms.UndoMoves">UndoMoves</A></H3>
122 {0,1}
123 <P>If set to 1, all cursor movements will be recorded on undo stack.
124
125 <H3><A NAME="ms.KeepBackups">KeepBackups</A></H3>
126 {0,1}
127 <P>If set to <B>0</B>, backup files will be deleted after a successful
128 save operation.
129
130 <H3><A NAME="ms.MatchCase">MatchCase</A></H3>
131 {0,1}
132 <P>If set to <B>0</B>, searches will be case insensitive. This can be
133 toggled via <A HREF="command.html#ec.ToggleMatchCase">ToggleMatchCase</A> command when editor
134 is running.
135
136 <H3><A NAME="ms.BackSpKillTab">BackSpKillTab</A></H3>
137 {0,1}
138 <P>If set to 1, <A HREF="command.html#ec.BackSpace">BackSpace</A> will kill entire tabs instead of converting them to spaces.
139
140 <H3><A NAME="ms.DeleteKillTab">DeleteKillTab</A></H3>
141 {0,1}
142 <P>If set to 1, <A HREF="command.html#ec.Delete">Delete</A> will kill entire tabs instead of converting them to spaces.
143
144 <H3><A NAME="ms.BackSpUnindents">BackSpUnindents</A></H3>
145 {0,1}
146 <P>If set to 1, <A HREF="command.html#ec.BackSpace">BackSpace</A> will unindent to previous indentation level if issued on beginning of line.
147
148 <H3><A NAME="ms.SpaceTabs">SpaceTabs</A></H3>
149 {0,1}
150 <P>If set to 1, <A HREF="command.html#ec.InsertTab">InsertTab</A> command will insert spaces instead of tabs.
151
152 <H3><A NAME="ms.IndentWithTabs">IndentWithTabs</A></H3>
153 {0,1}
154 <P>If set to 1, indentation will be done using tabs instead of spaces.
155
156 <H3><A NAME="ms.WordWrap">WordWrap</A></H3>
157 {0,1,2}
158 <P>If set to 1, editor wrap current line when right margin is reached.
159 If set to 2, editor will wrap current paragraph continously. Paragraphs
160 as recognised by <A HREF="command.html#ec.WrapPara">WrapPara</A> command must be
161 separated by blank lines.
162
163 <H3><A NAME="ms.LeftMargin">LeftMargin</A></H3>
164 {1-xx}
165 <P>Left margin for word wrap (<A HREF="command.html#ec.WrapPara">WrapPara</A> command).
166
167 <H3><A NAME="ms.RightMargin">RightMargin</A></H3>
168 {1-xx}
169 <P>Right margin for word wrap (<A HREF="command.html#ec.WrapPara">WrapPara</A> command).
170
171 <H3><A NAME="ms.Trim">Trim</A></H3>
172 {0,1}
173 <P>If set to 1, spaces on the end of line will be trimmed when editing.
174
175 <H3><A NAME="ms.ShowMarkers">ShowMarkers</A></H3>
176 {0,1}
177 <P>If set to 1, end of line and end of file markers will be shown.
178
179 <H3><A NAME="ms.CursorTroughTabs">CursorTroughTabs</A></H3>
180 {0,1}
181 <P>If set to 1, editor will allow cursor to be positioned inside tabs.
182
183 <H3><A NAME="ms.DefFindOpt">DefFindOpt</A></H3>
184 'options'
185 <P>Default <A HREF="#search.options">search options</A> for <A HREF="command.html#ec.Find">Find</A> command.
186
187 <H3><A NAME="ms.DefFindReplaceOpt">DefFindReplaceOpt</A></H3>
188 'options'
189 <P>Default <A HREF="#search.options">search/replace</A> options for <A HREF="command.html#ec.FindReplace">FindReplace</A> command.
190
191 <H3><A NAME="ms.SaveFolds">SaveFolds</A></H3>
192 {0,1,2}
193 <P>If 0, folds are not saved. If 1, folds are saved at beginning of
194 line, if 2 folds are saved at end of line.
195 <P>Folds are saved as comments in source files, depending on active
196 editing mode.
197 <P> See mode settings <A HREF="#ms.CommentStart">CommentStart</A> and
198 <A HREF="#ms.CommentEnd">CommentEnd</A> for configuration of fold
199 comments.
200
201 <H3><A NAME="ms.CommentStart">CommentStart</A></H3>
202 "comment-start-string"
203 <P>String that starts comments (for saving folds)
204
205 <H3><A NAME="ms.CommentEnd">CommentEnd</A></H3>
206 "comment-end-string"
207 <P>String that ends comments
208
209 <H3><A NAME="ms.AutoHilitParen">AutoHilitParen</A></H3>
210 {0,1}
211 <P>If set to <B>1</B>, editor will automatically highlight the
212 matching bracket if it is visible on screen. This is equivalent
213 to executing <A HREF="command.html#ec.HilitMatchBracket">HilitMatchBracket</A> command.
214
215 <H3><A NAME="ms.Abbreviations">Abbreviations</A></H3>
216 {0,1}
217 <P>If set to 1, <A HREF="#abbrevs">abbreviation</A> expansion will be
218 active in this mode.
219
220 <H3><A NAME="ms.BackSpKillBlock">BackSpKillBlock</A></H3>
221 {0,1}
222 <P>If set to 1, <A HREF="command.html#ec.BackSpace">BackSpace</A> command will
223 delete block if it is marked, otherwise it will delete the previous
224 character.
225
226 <H3><A NAME="ms.DeleteKillBlock">DeleteKillBlock</A></H3>
227 {0,1}
228 <P>If set to 1, <A HREF="command.html#ec.Delete">Delete</A> command will delete
229 block if marked, instead of deleting the character below cursor.
230
231 <H3><A NAME="ms.PersistentBlocks">PersistentBlocks</A></H3>
232 {0,1}
233 <P>If set to 1, blocks will stay marked even if cursor
234 is moved in the file, if set to 0, block is unmarked as soon
235 as the cursor is moved.
236
237 <H3><A NAME="ms.InsertKillBlock">InsertKillBlock</A></H3>
238 {0,1}
239 <P>If set to 1, the marked block is deleted when a new character
240 is typed.
241
242 <H3><A NAME="ms.FileNameRx">FileNameRx</A></H3>
243 "regexp"
244 <P>Must be set to regexp that matches names of files that should
245 be edited in this mode. Has priority over <A HREF="#ms.FirstLineRx">FirstLineRx</A>
246
247 <H3><A NAME="ms.FirstLineRx">FirstLineRx</A></H3>
248 "regexp"
249 <P>Must be set to regex that matches the first line of files that
250 should be edited in this mode. This is checked only if no
251 <A HREF="#ms.FileNameRx">FileNameRx</A> matches the filename.
252
253 <H3><A NAME="ms.RoutineRegexp">RoutineRegexp</A></H3>
254 "regexp"
255 <P> Regular expression that matches function header.
256 <P> Used by editor commands:
257 <A HREF="command.html#ec.ListRoutines">ListRoutines</A>,
258 <A HREF="command.html#ec.MoveFunctionPrev">MoveFunctionPrev</A>,
259 <A HREF="command.html#ec.MoveFunctionNext">MoveFunctionNext</A>,
260 <A HREF="command.html#ec.BlockMarkFunction">BlockMarkFunction</A>,
261 <A HREF="command.html#ec.IndentFunction">IndentFunction</A>.
262
263 <HR>
264 <H2><A NAME="loading">Loading files in various formats</A></H2>
265 <P>
266 Here are settings for loading files in various formats:
267 <P>
268 <DL>
269 <DT>DOS/Win/OS2/NT text files (CR/LF delimited):
270 <DD>
271 <PRE>
272 StripChar 13
273 LineChar 10
274 AddCR 1
275 AddLF 1
276 </PRE>
277 <BR>
278 <DT>Unix text files (LF delimited):
279 <DD>
280 <PRE>
281 StripChar -1
282 LineChar 10
283 AddCR 0
284 AddLF 1
285 </PRE>
286 <DT>MAC text files (CR delimited):
287 <DD>
288 <PRE>
289 StripChar -1
290 LineChar 13
291 AddCR 1
292 AddLF 0
293 </PRE>
294 <DT>Binary files (fixed record length):
295 <DD>
296 <PRE>
297 StripChar -1
298 LineChar -1
299 AddCR 0
300 AddLF 0
301 LoadMargin 64
302 ForceNewLine 0
303 </PRE>
304 </DL>
305
306 <HR>
307 <H2><A NAME="modes-tabopts">Configuration of Tab options</A></H2>
308
309 </BODY>
310 </HTML>