Add /src/vim/release.sh, a script to compile and install vim
[msysgit.git] / share / vim / vim58 / doc / os_beos.txt
blob8f19fc7d690d6b752983296a2301d74c1dd835d2
1 *os_beos.txt*   For Vim version 5.8.  Last change: 2001 May 09
4                   VIM REFERENCE MANUAL    by Bram Moolenaar
7                                                         *BeOS* *BeBox*
8 This is a port of Vim 5.1 to the BeOS Preview Release 2 (also known as PR2)
9 or later.
11 This file contains the particularities for the BeBox/BeOS version of Vim.  For
12 matters not discussed in this file, Vim behaves very much like the Unix
13 |os_unix.txt| version.
15  1. General                     |beos-general|
16  2. Compiling Vim               |beos-compiling|
17  3. Timeout in the Terminal     |beos-timeout|
18  4. Unicode vs. Latin-1         |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|
25 10. The meta key modifier       |beos-meta|
26 11. Mouse key mappings          |beos-mouse|
27 12. Color names                 |beos-colors|
28 13. Compiling with Perl         |beos-perl|
29 14. WARNING: Intel
30     "architecture" detected!    |beos-ppc|
33                                                         *beos-general*
34 The default syntax highlighting mostly works with different foreground colors
35 to highlight items. This works best if you set your Terminal window to a
36 darkish background and light letters. Some middle-grey background (for
37 instance (r,g,b)=(168,168,168)) with black letters also works nicely.  If you
38 use the default light background and dark letters, it may look better to
39 simply reverse the notion of foreground and background color settings. To do
40 this, add this to your .vimrc file (where <Esc> may need to be replaced with
41 the escape character):
43 >  if &term == "beos-ansi"
44 >      set t_AB=<Esc>[3%dm
45 >      set t_AF=<Esc>[4%dm
46 >  endif
48 Compiling Vim                                           *beos-compiling*
50 From the Advanced Access Preview Release (AAPR) on, Vim can be configured with
51 the standard configure script. To get the compiler and its flags right, use
52 the following command-line in the shell (you can cut and paste it in one go):
54 CC=$BE_C_COMPILER CFLAGS="$BE_DEFAULT_C_FLAGS -O7" \
55     ./configure --prefix=/boot/home/config \
56     --disable-perlinterp --disable-pythoninterp
58 $BE_C_COMPILER is usually "mwcc", $BE_DEFAULT_C_FLAGS is usually "-I- -I."
60 When configure has run, and you wish to enable GUI support, you must edit the
61 config.mk file so that the lines with GUI_xxx refer to $(BEOSGUI_xxx) instead
62 of $(NONE_xxx).
63 Alternatively you can make this change in the Makefile; it will have a
64 more permanent effect. Search for "NONE_".
66 After compilation you need to add the resources to the binary. Add the
67 following few lines near the end (before the line with "exit $exit_value") of
68 the link.sh script to do this automatically.
70     rmattr BEOS:TYPE vim
71     copyres os_beos.rsrc vim
72     mimeset vim
74 Also, create a dummy file "strip":
76     #!/bin/sh
77     mimeset $1
78     exit 0
80 You will need it when using "make install" to install Vim.
82 Now type "make" to compile Vim, then "make install" to install it.
84 If you want to install Vim by hand, you must copy Vim to $HOME/config/bin, and
85 create a bunch of symlinks to it ({g,r,rg}{vim,ex,view}). Furthermore you must
86 copy Vims configuration files to $HOME/config/share/vim:
87 vim-5.0s/{*.vim,doc,syntax}.  For completeness, you should also copy the nroff
88 manual pages to $HOME/config/man/man1. Don't forget xxd/xxd!
90 Obviously, you need the unlimited linker to actually link Vim. See
91 http://www.metrowerks.com for purchasing the CodeWarrior compiler for BeOS.
92 There are currently no other linkers that can do the job.
94 This won't be able to include the Perl or Python interfaces even if
95 you have the appropriate files installed. |beos-perl|
97 Timeout in the Terminal                                 *beos-timeout*
99 Because some POSIX/UNIX features are still missing[1], there is no direct OS
100 support for read-with-timeout in the Terminal. This would meat that you cannot
101 use :mappings of more than one character, unless you also :set notimeout.
102 |'timeout'|
104 To circumvent this problem, I added a workaround to provide the necessary
105 input with timeout by using an extra thread which reads ahead one character.
106 As a side effect, it also makes Vim recognize when the Terminal window
107 resizes.
109 Function keys are not supported in the Terminal since they produce very
110 indistinctive character sequences.
112 These problems do not exist in the GUI.
114 [1]: there is no select() on file descriptors; also the termios VMIN and VTIME
115 settings do not seem to work properly. This has been the case since DR7 at
116 least and still has not been fixed as of PR2.
118                                                         *beos-unicode*
119 Unicode vs. Latin-1                                     *beos-utf8*
121 BeOS uses Unicode and UTF-8 for text strings (16-bit characters encoded to
122 8-bit characters). Vim assumes ISO-Latin-1 or other 8-bit character codes.
123 This does not produce the desired results for non-ASCII characters. Try the
124 command :digraphs to see. If they look messed up, use :set isprint=@ to
125 (slightly) improve the display of ISO-Latin-1 characters 128-255.  This works
126 better in the GUI, depending on which font you use (below).
128 You 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-Latin-1 characters.
131 Some remarks about the GUI:                             *beos-gui*
133 Normally Vim starts with the GUI if you start it as gvim or vim -g.  The BeOS
134 version tries to determine if it was started from the Tracker instead of the
135 Terminal, and if so, use the GUI anyway. However, the current detection scheme
136 is fooled if you use the command "vim - </dev/null" or "vim filename &". The
137 latter can be called a feature but probably only works because there is no
138 BSD-style job control.
140 Stuff that does not work yet:
142 - Running external commands from the GUI does not work 100% (again due to lack
143   of support for select()). There was a choice between seeing the command's
144   output, or being able to interrupt it. I chose for seeing the output. Even
145   now the command sometimes crashes mysteriously, apparently in Be's
146   malloc_internal() called from the putenv() function, after fork()ing. (data
147   access exception occurred, ec01b0ec:  90e80000 *stw r7, 0x0000 (r8))(:!ls
148   works usually, :r !ls usually doesn't). This has been reported as bug
149   # 971215-083826.
150 - The window title.
151 - Starting the GUI from the Terminal version with :gui always acts as if
152   :gui -f were used. There is no way to fix this that I can see.
153 - There are some small display glitches here and there that I hope to clean up
154   later. Most of them occur when the window is partially obscured. Some of
155   them seem to be bugs in BeOS, because the Terminal has similar glitches.
156 - Mouse up events are not generated when outside the window. This is a bug in
157   BeOS. You can notice this when selecting text and moving the cursor outside
158   the window, then letting go of the mouse button.  Another way is when you
159   drag the scrollbar and do the same thing.  Because Vim still thinks you are
160   still playing with the scrollbar it won't change it itself. I provided a
161   workaround which kicks in when the window is activated or deactivated (so it
162   works best with focus- follows-mouse (/boot/bin/ffm) turned on).
163 - The cursor does not flash (very low priority; I'm not sure I even like it
164   when it flashes)
166                                                         *beos-vimdir*
167 The $VIM directory
169 $VIM is the symbolic name for the place where Vims support files are stored.
170 The default value for $VIM is set at compile time and can be determined with
172 >  :version
174 The normal value is /boot/home/config/share/vim. If you don't like it you can
175 set the VIM environment variable to override this, or set 'helpfile' in your
176 .vimrc:
178 >  if version >= 500
179 >      set helpfile=~/vim/vim54/doc/help.txt
180 >      syntax on
181 >  endif
183 Drag & Drop                                             *beos-dragndrop*
185 You can drop files and directories on either the Vim icon (starts a new Vim
186 session, unless you use the File Types application to set Vim to be "Single
187 Launch") or on the Vim window (starts editing the files).  Dropping a folder
188 sets Vim's current working directory. |:cd| |:pwd| If you drop files or
189 folders with either SHIFT key pressed, Vim changes directory to the folder
190 that contains the first item dropped. When starting Vim, there is no need to
191 press shift: Vim behaves as if you do.
193 Files dropped set the current argument list. |argument-list|
195 Single Launch vs. Multiple Launch                       *beos-launch*
197 As distributed Vim's Application Flags (as seen in the FileTypes preference)
198 are set to Multiple Launch. If you prefer, you can set them to Single Launch
199 instead.  Attempts to start a second copy of Vim will cause the first Vim to
200 open the files instead. This works from the Tracker but also from the command
201 line. In the latter case, non-file (option) arguments are not supported.
203 NB: Only the GUI version has a BApplication (and hence Application Flags).
204 This section does not apply to the GUI-less version, should you compile one.
206 Fonts                                                   *beos-fonts*
208 Set fonts with
210 >  :set guifont=Courier10_BT/Roman/10
212 where the first part is the font family, the second part the style, and the
213 third part the size. You can use underscores instead of spaces in family and
214 style.
216 Best results are obtained with monospaced fonts (such as Courier). Vim
217 attempts to use all fonts in B_FIXED_SPACING mode but apparently this does not
218 work for proportional fonts (despite what the BeBook says).
220 Vim also tries to use the B_ISO8859_1 encoding, also known as ISO Latin 1.
221 This also does not work for all fonts. It does work for Courier, but not for
222 ProFontISOLatin1/Regular (strangely enough). You can verify this by giving the
224 >  :digraphs
226 command, which lists a bunch of characters with their ISO Latin 1 encoding.
227 If, for instance, there are "box" characters among them, or the last character
228 isn't a dotted-y, then for this font the encoding does not work.
230 If the font you specify is unavailable, you get the system fixed font.
232 Standard fixed-width system fonts are:
234               ProFontISOLatin1/Regular
235                   Courier10_BT/Roman
236                   Courier10_BT/Italic
237                   Courier10_BT/Bold
238                   Courier10_BT/Bold_Italic
240 Standard proportional system fonts are:
242                     Swis721_BT/Roman
243                     Swis721_BT/Italic
244                     Swis721_BT/Bold
245                     Swis721_BT/Bold_Italic
246                 Dutch801_Rm_BT/Roman
247                 Dutch801_Rm_BT/Italic
248                 Dutch801_Rm_BT/Bold
249                 Dutch801_Rm_BT/Bold_Italic
250                    Baskerville/Roman
251                    Baskerville/Italic
252                    Baskerville/Bold
253                    Baskerville/Bold_Italic
254                  SymbolProp_BT/Regular
256 Try some of them, just for fun.
258 The meta key modifier                                   *beos-meta*
260 The META key modifier is obtained by the left or right OPTION keys.  This is
261 because the ALT (aka COMMAND) keys are not passed to applications.
263 Mouse key mappings                                      *beos-mouse*
265 Vim calls the various mouse buttons LeftMouse, MiddleMouse and RightMouse.  If
266 you use the default Mouse preference settings these names indeed correspond to
267 reality. Vim uses this mapping:
269     Button 1 -> LeftMouse,
270     Button 2 -> RightMouse,
271     Button 3 -> MiddleMouse.
273 If your mouse has fewer than 3 buttons you can provide your own mapping from
274 mouse clicks with modifier(s) to other mouse buttons. See the file
275 vim-5.x/macros/swapmous.vim for an example.             |gui-mouse-mapping|
277 Color names                                             *beos-colors*
279 Vim has a number of color names built-in. Additional names are read from the
280 file $VIMRUNTIME/rgb.txt, if present. This file is basically the color
281 database from X. Names used from this file are cached for efficiency.
283 Compiling with Perl                                     *beos-perl*
285 Compiling with Perl support enabled is slightly tricky. The Metrowerks
286 compiler has some strange ideas where to search for include files. Since
287 several include files with Perl have the same names as some Vim header
288 files, the wrong ones get included. To fix this, run the following Perl
289 script while in the vim-5.0/src directory:
291 >   preproc.pl > perl.h
293     #!/bin/env perl
294     # Simple #include expander, just good enough for the Perl header files.
296     use strict;
297     use IO::File;
298     use Config;
300     sub doinclude
301     {
302         my $filename = $_[0];
303         my $fh = new IO::File($filename, "r");
304         if (defined $fh) {
305             print "/* Start of $filename */\n";
307             while (<$fh>) {
308                 if (/^#include "(.*)"/) {
309                     doinclude($1);
310                     print "/* Back in $filename */\n";
311                 } else {
312                     print $_;
313                 }
314             }
315             print "/* End of $filename */\n";
317             undef $fh;
318         } else {
319             print "/* Cannot open $filename */\n";
320             print "#include \"$filename\"\n";
321         }
322     }
324     chdir     $Config{installarchlib}."/CORE";
325     doinclude "perl.h";
327 It expands the "perl.h" header file, using only other Perl header files.
329 Now you can configure & make Vim without the --disable-perlinterp option.
330 Be warned though that this adds about 616 kilobytes to the size of Vim!
331 Without Perl, Vim with default features and GUI is about 575K, with Perl
332 it is about 1191K.
334 WARNING: Intel "architecture" detected!                 *beos-ppc*
335 or, Waiter, there is a fly in my soup!
337 This means that you have made a poor choice of hardware platform.
338 You'll be pleased to know that the Intel (compatibe) CPU that's inside
339 your computer is nothing more than a souped-up 8-bit machine. Or perhaps I
340 should not say that: it's an insult to other 8-bit CPUs.
342 However, apart from the occasional derisory remark, you have nothing to fear
343 from Vim. If you don't like them, "Use The Source, Luke!", and remove them.
344 However, the copyright that I claim on the files os_beos* and gui_beos*
345 prevents you from making your changed version available to others.
346 I don't think this is an unreasonable limitation.
348 -Olaf Seibert
349 <rhialto@polder.ubc.kun.nl>
350 http://polder.ubc.kun.nl/~rhialto/be
352  vim:ts=8:sw=8:tw=78:fo=tcq2:isk=!-~,^*,^\|,^\":