summaryrefslogtreecommitdiff
path: root/runtime/doc/os_risc.txt
blob: 0f6d2bba176d58c3c835a459ab565aad38c8f508 (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
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
*os_risc.txt*   For Vim version 7.2a.  Last change: 2005 Mar 29


		  VIM REFERENCE MANUAL    by Thomas Leonard


						*riscos* *RISCOS* *RISC-OS*
This file contains the particularities for the RISC OS version of Vim.

The RISC OS port is a completely new port and is not based on the old `archi'
port.

1.  File locations		|riscos-locations|
2.  Filename munging		|riscos-munging|
3.  Command-line use		|riscos-commandline|
4.  Desktop (GUI) use		|riscos-gui|
5.  Remote use (telnet)		|riscos-remote|
6.  Temporary files		|riscos-temp-files|
7.  Interrupting		|riscos-interrupt|
8.  Memory usage		|riscos-memory|
9.  Filetypes			|riscos-filetypes|
10. The shell			|riscos-shell|
11. Porting new releases	|riscos-porting|

If I've missed anything, email me and I'll try to fix it.  In fact, even if I
haven't missed anything then email me anyway to give me some confidence that it
actually works!

Thomas Leonard <tal197@ecs.soton.ac.uk>

	[these URLs no longer work...]
 Port homepage:	http://www.ecs.soton.ac.uk/~tal197/
	or try:	http://www.soton.ac.uk/~tal197/

==============================================================================
							*riscos-locations*
1. File locations

The Vim executable and shared resource files are all stored inside the !Vim
application directory.

When !Vim is first seen by the filer, it aliases the *vi and *ex commands to
run the command-line versions of Vim (see |riscos-commandline|).

!Vim.Resources and !Vim.Resources2 contain the files from the standard Vim
distribution, but modified slightly to work within the limits of ADFS, plus
some extra files such as the window templates.

User choices are read from `Choices:*' and are saved to `<Choices$Write>.*'.
If you have the new !Boot structure then these should be set up already.  If
not, set Choices$Path to a list of directories to search when looking for
user configuration files.  Set Choices$Write to the directory you want files
to be saved into (so your search patterns and marks can be remembered between
sessions).

==============================================================================
							*riscos-munging*
2. Filename munging

All pathname munging is disabled by default, so Vim should behave like a
normal RISC OS application now.  So, if you want to edit `doc/html' then you
actually type `*vi doc/html'.

The only times munging is done is when:

- Searching included files from C programs, since these are always munged.
  See |[I|.
  Note: make sure you are in the right directory when you use this
	command (i.e. the one with subdirectories 'c' and 'h').

- Sourcing files using |:so|.
  Paths starting `$VIM/' are munged like this:

  $VIM/syntax/help.vim  ->  Vim:syntax.help

  Also, files ending in `.vim' have their extensions removed, and slashes
  replaced with dots.

Some tag files and script files may have to be edited to work under this port.

==============================================================================
							*riscos-commandline*
3. Command-line use

To use Vim from the command-line use the `*vi' command (or '*ex' for
|Ex-mode|).

Type `*vi -h' for a list of options.

Running the command-line version of Vim in a large high-color mode may cause
the scrolling to be very slow.  Either change to a mode with fewer colors or
use the GUI version.

Also, holding down Ctrl will slow it down even more, and Ctrl-Shift will
freeze it, as usual for text programs.

==============================================================================
							*riscos-gui*
4. Desktop use

Limitations:

- Left scrollbars don't work properly (right and bottom are fine).
- Doesn't increase scroll speed if it gets behind.

You can resize the window by dragging the lower-right corner, even though
there is no icon shown there.

You can use the --rows and --columns arguments to specify the initial size of
the Vim window, like this: >

  *Vi -g --rows 20 --columns 80

The global clipboard is supported, so you can select some text and then
paste it directly into another application (provided it supports the
clipboard too).

Clicking Menu now opens a menu like a normal RISC OS program.  Hold down Shift
when clicking Menu to paste (from the global clipboard).

Dragging a file to the window replaces the CURRENT buffer (the one with the
cursor, NOT the one you dragged to) with the file.

Dragging with Ctrl held down causes a new Vim window to be opened for the
file (see |:sp|).

Dragging a file in with Shift held down in insert mode inserts the pathname of
the file.

:browse :w opens a standard RISC OS save box.
:browse :e opens a directory viewer.

For fonts, you have the choice of the system font, an outline font, the system
font via ZapRedraw and any of the Zap fonts via ZapRedraw: >

  :set guifont=
<			To use the system font via the VDU drivers.  Supports
			bold and underline.
>
  :set guifont=Corpus.Medium
<			Use the named outline font.  You can use any font, but
			only monospaced ones like Corpus look right.
>
  :set guifont=Corpus.Medium:w8:h12:b:i
<			As before, but with size of 8 point by 12 point, and
			in bold italic.
			If only one of width and height is given then that
			value is used for both.  If neither is given then 10
			point is used.

Thanks to John Kortink, Vim can use the ZapRedraw module.  Start the font name
with '!' (or '!!' for double height), like this: >

  :set guifont=!!
<			Use the system font, but via ZapRedraw.  This gives a
			faster redraw on StrongARM processors, but you can't
			get bold or italic text.  Double height.
>
  :set guifont=!script
<			Uses the named Zap font (a directory in VimFont$Path).
			The redraw is the same speed as for '!!', but you get
			a nicer looking font.
			Only the "man+" and "script" fonts are supplied
			currently, but you can use any of the Zap fonts if
			they are in VimFont$Path.
			Vim will try to load font files '0', 'B', 'I' and 'IB'
			from the named directory.  Only '0' (normal style) MUST
			be present.  Link files are not currently supported.

Note that when using ZapRedraw the edit bar is drawn in front of the character
you are on rather than behind it.  Also redraw is incorrect for screen modes
with eigen values of 0.  If the font includes control characters then you can
get Vim to display them by changing the 'isprint' option.

If you find the scrolling is too slow on your machine, try experimenting
with the 'scrolljump' and 'ttyscroll' options.

In particular, StrongARM users may find that: >

  :set ttyscroll=0

makes scrolling faster in high-color modes.

=============================================================================
							*riscos-remote*
5. Remote use (telnet)

I have included a built-in termcap entry, but you can edit the termcap file to
allow other codes to be used if you want to use Vim from a remote terminal.

Although I do not have an internet connection to my Acorn, I have managed to
run Vim in a FreeTerm window using the loopback connection.

It seems to work pretty well now, using '*vi -T ansi'.

==============================================================================
							*riscos-temp-files*
6. Temporary files

If Vim crashes then the swap and backup files (if any) will be in the
directories set with the 'directory' and 'bdir' options.  By default the swap
files are in <Wimp$ScrapDir> (i.e. inside !Scrap) and backups are in the
directory you were saving to.  Vim will allow you to try and recover the file
when you next try to edit it.

To see a list of swap files, press <F12> and type `*vi -r'.

Vim no longer brings up ATTENTION warnings if you try to edit two files with
the same name in different directories.

However, it also no longer warns if you try to edit the same file twice (with
two copies of Vim), though you will still be warned when you save that the
datestamp has changed.

==============================================================================
							*riscos-interrupt*
7. Interrupting

To break out of a looping macro, or similar, hold down Escape in the
command-line version, or press CTRL-C in the GUI version.

==============================================================================
							*riscos-memory*
8. Memory usage

Vim will use dynamic areas on RISC OS 3.5 or later.  If you can use them on
older machines then edit the !RunTxt and GVim files.  I don't know what UnixLib
does by default on these machines so I'm playing safe.

It doesn't work at all well without dynamic areas, since it can't change its
memory allocation once running.  Hence you should edit `!Vim.GVim' and
`!Vim.!RunTxt' to choose the best size for you.  You probably need at least
about 1400K.

==============================================================================
							*riscos-filetypes*
9. Filetypes

You can now specify that autocommands are only executed for files of certain
types.  The filetype is given in the form &xxx, when xxx is the filetype.

Filetypes must be specified by number (e.g. &fff for Text).

The system has changed from version 5.3.  The new sequence of events is:

- A file is loaded. |'osfiletype'| is set to the RISC OS filetype.
- Based on the filetype and pathname, Vim will try to set |'filetype'| to the
  Vim-type of the file.
- Setting this option may load syntax files and perform other actions.
- Saving the file will give it a filetype of |'osfiletype'|.

Some examples may make this clearer:

  Kind of file loaded	osfiletype	filetype ~
  C code 'c.hellow'	Text (&fff)	C
  LaTeX document	LaTeX (&2a8)	TeX
  Draw document		DrawFile (&aff)	(not changed)

==============================================================================
							*riscos-shell*
10. The shell

- Bangs (!s) are only replaced if they are followed by a space or end-of-line,
  since many pathnames contain them.

- You can prefix the command with '~', which stops any output from being
  displayed.  This also means that you don't have to press <Enter> afterwards,
  and stops the screen from being redrawn. {only in the GUI version}

==============================================================================
							*riscos-porting*
11. Porting new releases to RISC OS

Downloading everything you need:

- Get the latest source distribution (see www.vim.org)
- Get the runtime environment files (e.g. these help files)
- Get the `extra' archive (contains the RISC OS specific bits)
- Get the RISC OS binary distribution (if possible)


Unarchiving:

- Create a raFS disk and put the archives on it
- Un-gzip them
- Un-tar them   (*tar xELf 50 archive/tar)


Recompiling the sources:

- Create c, s, and h directories.
- Put all the header files in 'h'.	     \
- Put all the C files in `c'.		     | And lose the extensions
- Put the assembler file (`swis/s') in 's'.  /
- Rename all the files in `proto' to `h', like this:
    raFS::VimSrc.source.proto.file/pro
	  becomes
    raFS::VimSrc.source.h.file_pro
- In the files `h.proto' and `c.termlib', search and replace
    .pro"
       with
    _pro.h"
- Create a simple Makefile if desired and do '*make -k'.
  Use 'CC = gcc -DRISCOS -DUSE_GUI -O2 -x c' in the Makefile.
- Save the binary as !Vim.Vim in the binary distribution.


Updating the run-time environment:

- Replace old or missing files inside !Vim.Resources with the
  new files.
- Remove files in `doc' not ending in `/txt', except for `tags'.
- Lose the extensions from the files in `doc'.
- Edit the `doc.tags' file.  Remove extensions from the second column: >
	:%s/^\(.[^\t]*\t.*\)\.txt\t/\1\t/
- Remove extensions from the syntax files.  Split them into two directories
  to avoid the 77 entry limit on old ADFS filesystems.
- Edit `Vim:FileType' to match `*.c.*' as well as `*/c' and so on.
  Add filetype checking too.
- Edit `Vim:Menu' and remove all the keys from the menus: >
	:%s/<Tab>[^ \t]*//
<
 vim:tw=78:ts=8:ft=help:norl: