blob: 823938a32253687cf35e49f0a9b53486acf865fb [file] [log] [blame]
Bram Moolenaar4421d6a2010-08-14 13:33:56 +02001*os_beos.txt* For Vim version 7.3g. Last change: 2005 Mar 29
Bram Moolenaar071d4272004-06-13 20:20:40 +00002
3
4 VIM REFERENCE MANUAL by Bram Moolenaar
5
6
7 *BeOS* *BeBox*
8This is a port of Vim 5.1 to the BeOS Preview Release 2 (also known as PR2)
9or later.
10
11This file contains the particularities for the BeBox/BeOS version of Vim. For
12matters not discussed in this file, Vim behaves very much like the Unix
13|os_unix.txt| version.
14
15 1. General |beos-general|
16 2. Compiling Vim |beos-compiling|
17 3. Timeout in the Terminal |beos-timeout|
18 4. Unicode vs. Latin1 |beos-unicode|
19 5. The BeOS GUI |beos-gui|
20 6. The $VIM directory |beos-vimdir|
21 7. Drag & Drop |beos-dragndrop|
22 8. Single Launch vs. Multiple
23 Launch |beos-launch|
24 9. Fonts |beos-fonts|
2510. The meta key modifier |beos-meta|
2611. Mouse key mappings |beos-mouse|
2712. Color names |beos-colors|
2813. Compiling with Perl |beos-perl|
29
30
311. General *beos-general*
32
33The default syntax highlighting mostly works with different foreground colors
Bram Moolenaar402d2fe2005-04-15 21:00:38 +000034to highlight items. This works best if you set your Terminal window to a
35darkish background and light letters. Some middle-grey background (for
Bram Moolenaar071d4272004-06-13 20:20:40 +000036instance (r,g,b)=(168,168,168)) with black letters also works nicely. If you
37use the default light background and dark letters, it may look better to
Bram Moolenaar402d2fe2005-04-15 21:00:38 +000038simply reverse the notion of foreground and background color settings. To do
Bram Moolenaar071d4272004-06-13 20:20:40 +000039this, add this to your .vimrc file (where <Esc> may need to be replaced with
40the escape character): >
41
42 :if &term == "beos-ansi"
43 : set t_AB=<Esc>[3%dm
44 : set t_AF=<Esc>[4%dm
45 :endif
46
47
482. Compiling Vim *beos-compiling*
49
50From the Advanced Access Preview Release (AAPR) on, Vim can be configured with
Bram Moolenaar402d2fe2005-04-15 21:00:38 +000051the standard configure script. To get the compiler and its flags right, use
Bram Moolenaar071d4272004-06-13 20:20:40 +000052the following command-line in the shell (you can cut and paste it in one go):
53
54CC=$BE_C_COMPILER CFLAGS="$BE_DEFAULT_C_FLAGS -O7" \
55 ./configure --prefix=/boot/home/config
56
57$BE_C_COMPILER is usually "mwcc", $BE_DEFAULT_C_FLAGS is usually "-I- -I."
58
59When configure has run, and you wish to enable GUI support, you must edit the
60config.mk file so that the lines with GUI_xxx refer to $(BEOSGUI_xxx) instead
61of $(NONE_xxx).
62Alternatively you can make this change in the Makefile; it will have a
Bram Moolenaar402d2fe2005-04-15 21:00:38 +000063more permanent effect. Search for "NONE_".
Bram Moolenaar071d4272004-06-13 20:20:40 +000064
Bram Moolenaar402d2fe2005-04-15 21:00:38 +000065After compilation you need to add the resources to the binary. Add the
Bram Moolenaar071d4272004-06-13 20:20:40 +000066following few lines near the end (before the line with "exit $exit_value") of
67the link.sh script to do this automatically.
68
69 rmattr BEOS:TYPE vim
70 copyres os_beos.rsrc vim
71 mimeset vim
72
73Also, create a dummy file "strip":
74
75 #!/bin/sh
76 mimeset $1
77 exit 0
78
79You will need it when using "make install" to install Vim.
80
81Now type "make" to compile Vim, then "make install" to install it.
82
83If you want to install Vim by hand, you must copy Vim to $HOME/config/bin, and
Bram Moolenaar402d2fe2005-04-15 21:00:38 +000084create a bunch of symlinks to it ({g,r,rg}{vim,ex,view}). Furthermore you must
85copy Vim's configuration files to $HOME/config/share/vim:
Bram Moolenaar071d4272004-06-13 20:20:40 +000086vim-5.0s/{*.vim,doc,syntax}. For completeness, you should also copy the nroff
Bram Moolenaar402d2fe2005-04-15 21:00:38 +000087manual pages to $HOME/config/man/man1. Don't forget ctags/ctags and xxd/xxd!
Bram Moolenaar071d4272004-06-13 20:20:40 +000088
Bram Moolenaar402d2fe2005-04-15 21:00:38 +000089Obviously, you need the unlimited linker to actually link Vim. See
Bram Moolenaar071d4272004-06-13 20:20:40 +000090http://www.metrowerks.com for purchasing the CodeWarrior compiler for BeOS.
91There are currently no other linkers that can do the job.
92
93This won't be able to include the Perl or Python interfaces even if
94you have the appropriate files installed. |beos-perl|
95
96
973. Timeout in the Terminal *beos-timeout*
98
99Because some POSIX/UNIX features are still missing[1], there is no direct OS
Bram Moolenaar402d2fe2005-04-15 21:00:38 +0000100support for read-with-timeout in the Terminal. This would mean that you cannot
Bram Moolenaar071d4272004-06-13 20:20:40 +0000101use :mappings of more than one character, unless you also :set notimeout.
102|'timeout'|
103
104To circumvent this problem, I added a workaround to provide the necessary
105input with timeout by using an extra thread which reads ahead one character.
106As a side effect, it also makes Vim recognize when the Terminal window
107resizes.
108
109Function keys are not supported in the Terminal since they produce very
110indistinctive character sequences.
111
112These problems do not exist in the GUI.
113
114[1]: there is no select() on file descriptors; also the termios VMIN and VTIME
Bram Moolenaar402d2fe2005-04-15 21:00:38 +0000115settings do not seem to work properly. This has been the case since DR7 at
Bram Moolenaar071d4272004-06-13 20:20:40 +0000116least and still has not been fixed as of PR2.
117
118 *beos-unicode*
1194. Unicode vs. Latin1 *beos-utf8*
120
121BeOS uses Unicode and UTF-8 for text strings (16-bit characters encoded to
Bram Moolenaar402d2fe2005-04-15 21:00:38 +00001228-bit characters). Vim assumes ISO-Latin1 or other 8-bit character codes.
123This does not produce the desired results for non-ASCII characters. Try the
124command :digraphs to see. If they look messed up, use :set isprint=@ to
Bram Moolenaar071d4272004-06-13 20:20:40 +0000125(slightly) improve the display of ISO-Latin1 characters 128-255. This works
126better in the GUI, depending on which font you use (below).
127
128You may also use the /boot/bin/xtou command to convert UTF-8 files from (xtou
129-f iso1 filename) or to (xtou -t iso1 filename) ISO-Latin1 characters.
130
131
1325. The BeOS GUI *beos-gui*
133
134Normally Vim starts with the GUI if you start it as gvim or vim -g. The BeOS
135version tries to determine if it was started from the Tracker instead of the
Bram Moolenaar402d2fe2005-04-15 21:00:38 +0000136Terminal, and if so, use the GUI anyway. However, the current detection scheme
137is fooled if you use the command "vim - </dev/null" or "vim filename &". The
Bram Moolenaar071d4272004-06-13 20:20:40 +0000138latter can be called a feature but probably only works because there is no
139BSD-style job control.
140
141Stuff that does not work yet:
142
143- Running external commands from the GUI does not work 100% (again due to lack
Bram Moolenaar402d2fe2005-04-15 21:00:38 +0000144 of support for select()). There was a choice between seeing the command's
145 output, or being able to interrupt it. I chose for seeing the output. Even
Bram Moolenaar071d4272004-06-13 20:20:40 +0000146 now the command sometimes crashes mysteriously, apparently in Be's
Bram Moolenaar402d2fe2005-04-15 21:00:38 +0000147 malloc_internal() called from the putenv() function, after fork()ing. (data
148 access exception occurred, ec01b0ec: 90e80000 *stw r7, 0x0000 (r8)). (:!ls
149 works usually, :r !ls usually doesn't). This has been reported as bug
Bram Moolenaar071d4272004-06-13 20:20:40 +0000150 # 971215-083826.
151- The window title.
152- Starting the GUI from the Terminal version with :gui always acts as if
Bram Moolenaar402d2fe2005-04-15 21:00:38 +0000153 :gui -f were used. There is no way to fix this that I can see.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000154- There are some small display glitches here and there that I hope to clean up
Bram Moolenaar402d2fe2005-04-15 21:00:38 +0000155 later. Most of them occur when the window is partially obscured. Some of
Bram Moolenaar071d4272004-06-13 20:20:40 +0000156 them seem to be bugs in BeOS, because the Terminal has similar glitches.
Bram Moolenaar402d2fe2005-04-15 21:00:38 +0000157- Mouse up events are not generated when outside the window. This is a bug in
158 BeOS. You can notice this when selecting text and moving the cursor outside
Bram Moolenaar071d4272004-06-13 20:20:40 +0000159 the window, then letting go of the mouse button. Another way is when you
160 drag the scrollbar and do the same thing. Because Vim still thinks you are
Bram Moolenaar402d2fe2005-04-15 21:00:38 +0000161 still playing with the scrollbar it won't change it itself. I provided a
Bram Moolenaar071d4272004-06-13 20:20:40 +0000162 workaround which kicks in when the window is activated or deactivated (so it
163 works best with focus- follows-mouse (/boot/bin/ffm) turned on).
164- The cursor does not flash (very low priority; I'm not sure I even like it
165 when it flashes)
166
167
Bram Moolenaar50cde822005-06-05 21:54:54 +00001686. The $VIM directory *beos-vimdir*
Bram Moolenaar071d4272004-06-13 20:20:40 +0000169
170$VIM is the symbolic name for the place where Vims support files are stored.
171The default value for $VIM is set at compile time and can be determined with >
172
173 :version
174
Bram Moolenaar402d2fe2005-04-15 21:00:38 +0000175The normal value is /boot/home/config/share/vim. If you don't like it you can
Bram Moolenaar071d4272004-06-13 20:20:40 +0000176set the VIM environment variable to override this, or set 'helpfile' in your
177.vimrc: >
178
179 :if version >= 500
180 : set helpfile=~/vim/vim54/doc/help.txt
181 : syntax on
182 :endif
183
184
1857. Drag & Drop *beos-dragndrop*
186
187You can drop files and directories on either the Vim icon (starts a new Vim
188session, unless you use the File Types application to set Vim to be "Single
189Launch") or on the Vim window (starts editing the files). Dropping a folder
190sets Vim's current working directory. |:cd| |:pwd| If you drop files or
191folders with either SHIFT key pressed, Vim changes directory to the folder
Bram Moolenaar402d2fe2005-04-15 21:00:38 +0000192that contains the first item dropped. When starting Vim, there is no need to
Bram Moolenaar071d4272004-06-13 20:20:40 +0000193press shift: Vim behaves as if you do.
194
195Files dropped set the current argument list. |argument-list|
196
197
1988. Single Launch vs. Multiple Launch *beos-launch*
199
200As distributed Vim's Application Flags (as seen in the FileTypes preference)
Bram Moolenaar402d2fe2005-04-15 21:00:38 +0000201are set to Multiple Launch. If you prefer, you can set them to Single Launch
Bram Moolenaar071d4272004-06-13 20:20:40 +0000202instead. Attempts to start a second copy of Vim will cause the first Vim to
Bram Moolenaar402d2fe2005-04-15 21:00:38 +0000203open the files instead. This works from the Tracker but also from the command
204line. In the latter case, non-file (option) arguments are not supported.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000205
206NB: Only the GUI version has a BApplication (and hence Application Flags).
207This section does not apply to the GUI-less version, should you compile one.
208
209
2109. Fonts *beos-fonts*
211
212Set fonts with >
213
214 :set guifont=Courier10_BT/Roman/10
215
216where the first part is the font family, the second part the style, and the
Bram Moolenaar402d2fe2005-04-15 21:00:38 +0000217third part the size. You can use underscores instead of spaces in family and
Bram Moolenaar071d4272004-06-13 20:20:40 +0000218style.
219
Bram Moolenaar402d2fe2005-04-15 21:00:38 +0000220Best results are obtained with monospaced fonts (such as Courier). Vim
Bram Moolenaar071d4272004-06-13 20:20:40 +0000221attempts to use all fonts in B_FIXED_SPACING mode but apparently this does not
222work for proportional fonts (despite what the BeBook says).
223
224Vim also tries to use the B_ISO8859_1 encoding, also known as ISO Latin 1.
Bram Moolenaar402d2fe2005-04-15 21:00:38 +0000225This also does not work for all fonts. It does work for Courier, but not for
226ProFontISOLatin1/Regular (strangely enough). You can verify this by giving the >
Bram Moolenaar071d4272004-06-13 20:20:40 +0000227
228 :digraphs
229
230command, which lists a bunch of characters with their ISO Latin 1 encoding.
231If, for instance, there are "box" characters among them, or the last character
232isn't a dotted-y, then for this font the encoding does not work.
233
234If the font you specify is unavailable, you get the system fixed font.
235
236Standard fixed-width system fonts are:
237
238 ProFontISOLatin1/Regular
239 Courier10_BT/Roman
240 Courier10_BT/Italic
241 Courier10_BT/Bold
242 Courier10_BT/Bold_Italic
243
244Standard proportional system fonts are:
245
246 Swis721_BT/Roman
247 Swis721_BT/Italic
248 Swis721_BT/Bold
249 Swis721_BT/Bold_Italic
250 Dutch801_Rm_BT/Roman
251 Dutch801_Rm_BT/Italic
252 Dutch801_Rm_BT/Bold
253 Dutch801_Rm_BT/Bold_Italic
254 Baskerville/Roman
255 Baskerville/Italic
256 Baskerville/Bold
257 Baskerville/Bold_Italic
258 SymbolProp_BT/Regular
259
260Try some of them, just for fun.
261
262
26310. The meta key modifier *beos-meta*
264
265The META key modifier is obtained by the left or right OPTION keys. This is
266because the ALT (aka COMMAND) keys are not passed to applications.
267
268
26911. Mouse key mappings *beos-mouse*
270
271Vim calls the various mouse buttons LeftMouse, MiddleMouse and RightMouse. If
272you use the default Mouse preference settings these names indeed correspond to
Bram Moolenaar402d2fe2005-04-15 21:00:38 +0000273reality. Vim uses this mapping:
Bram Moolenaar071d4272004-06-13 20:20:40 +0000274
275 Button 1 -> LeftMouse,
276 Button 2 -> RightMouse,
277 Button 3 -> MiddleMouse.
278
279If your mouse has fewer than 3 buttons you can provide your own mapping from
Bram Moolenaar402d2fe2005-04-15 21:00:38 +0000280mouse clicks with modifier(s) to other mouse buttons. See the file
Bram Moolenaar071d4272004-06-13 20:20:40 +0000281vim-5.x/macros/swapmous.vim for an example. |gui-mouse-mapping|
282
283
28412. Color names *beos-colors*
285
Bram Moolenaar402d2fe2005-04-15 21:00:38 +0000286Vim has a number of color names built-in. Additional names are read from the
287file $VIMRUNTIME/rgb.txt, if present. This file is basically the color
288database from X. Names used from this file are cached for efficiency.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000289
290
29113. Compiling with Perl *beos-perl*
292
Bram Moolenaar402d2fe2005-04-15 21:00:38 +0000293Compiling with Perl support enabled is slightly tricky. The Metrowerks
294compiler has some strange ideas where to search for include files. Since
Bram Moolenaar071d4272004-06-13 20:20:40 +0000295several include files with Perl have the same names as some Vim header
Bram Moolenaar402d2fe2005-04-15 21:00:38 +0000296files, the wrong ones get included. To fix this, run the following Perl
Bram Moolenaar071d4272004-06-13 20:20:40 +0000297script while in the vim-5.0/src directory: >
298
299 preproc.pl > perl.h
300
301 #!/bin/env perl
302 # Simple #include expander, just good enough for the Perl header files.
303
304 use strict;
305 use IO::File;
306 use Config;
307
308 sub doinclude
309 {
310 my $filename = $_[0];
311 my $fh = new IO::File($filename, "r");
312 if (defined $fh) {
313 print "/* Start of $filename */\n";
314
315 while (<$fh>) {
316 if (/^#include "(.*)"/) {
317 doinclude($1);
318 print "/* Back in $filename */\n";
319 } else {
320 print $_;
321 }
322 }
323 print "/* End of $filename */\n";
324
325 undef $fh;
326 } else {
327 print "/* Cannot open $filename */\n";
328 print "#include \"$filename\"\n";
329 }
330 }
331
332 chdir $Config{installarchlib}."/CORE";
333 doinclude "perl.h";
334
335It expands the "perl.h" header file, using only other Perl header files.
336
337Now you can configure & make Vim with the --enable-perlinterp option.
338Be warned though that this adds about 616 kilobytes to the size of Vim!
339Without Perl, Vim with default features and GUI is about 575K, with Perl
340it is about 1191K.
341
342-Olaf Seibert
343
344[Note: these addresses no longer work:]
345<rhialto@polder.ubc.kun.nl>
346http://polder.ubc.kun.nl/~rhialto/be
347
348 vim:tw=78:ts=8:ft=help:norl: