📄 os_os2.txt
字号:
*os_os2.txt* For Vim version 5.8. Last change: 1999 Sep 14 VIM REFERENCE MANUAL by Paul Slootman *OS2* *OS/2*This file contains the particularities for the OS/2 version of Vim.At present there is no native PM version of the GUI version of vim: The OS/2version is a console application. However, there is now a Win32s-compatibleGUI version, which should be usable by owners of Warp 4 (which supportsWin32s) in a Win-OS/2 session. The notes in this file refer to the nativeconsole version.NOTEThis OS/2 port works well for me and a couple of other OS/2 users; however,since I haven't had much feedback, that either means no (OS/2-specific) bugsexist (besides the ones mentioned below), or no one has yet created asituation in which any bugs are apparent. File I/O in Dos and Unix mode,binary mode, and FAT handling all seem to work well, which would seem to bethe most likely places for trouble.A known problem is that files opened by Vim are inherited by other programsthat are started via a shell escape from within Vim. This specifically meansthat Vim won't be able to remove the swap file(s) associated with buffers openat the time the other program was started, until the other program is stopped.At that time, the swap file may be removed, but if Vim could not do that thefirst time, it won't be removed at all. You'll get warnings that some otherVim session may be editing the file when you start Vim up again on that file.This can be reproduced with ":!start epm". Now quit Vim, and start Vim againwith the file that was in the buffer at the time epm was started. I'm workingon this!A second problem is that Vim doesn't understand the situation when using itwhen accessing the OS/2 system via the network, e.g. using telnet from a Unixsystem, and then starting Vim. The problem seems to be that OS/2 =sometimes=recognizes function / cursor keys, and tries to convert those to thecorresponding OS/2 codes generated by the "normal" PC keyboard. I've beentesting a workaround (mapping the OS/2 codes to the correct functions), but sofar I can't say anything conclusive (this is on Warp 3, by the way). In themeantime any help will be appreciated.PREREQUISITESTo run Vim, you need the emx runtime environment (at least rev. 0.9b). Thisis generally available as (ask Archie about it): emxrt.zip emx runtime packageI've included a copy of emx.dll, which should be copied to one of thedirectories listed in your LIBPATH. Emx is GPL'ed, but the emx.dll library isnot (read COPYING.EMX to find out what that means to you).This emx.dll is from the emxfix04.zip package, which unfortunately has a bug,eh, I mean a POSIX feature, in select(). Versions of Vim before 3.27 willappear to hang when starting (actually, while processing vimrc). Hit return acouple of times until Vim starts working if this happens. Next, get an up todate version of Vim!HELP AND VIMRC FILEIf you unpack the archive that Vim came in and run Vim directly from where itwas unpacked, Vim should be able to find the runtime files and your .vimrcwithout any settings.If you put the runtime files separately from the binary, the VIM environmentvariable is used to find the location of the help files and the system .vimrc.Place an entry such as this in CONFIG.SYS:> SET VIM=c:/local/lib/vimPut your .vimrc and your other Vim files in this directory. Copy the runtimedirectory to this directory. Each version of Vim has its own runtimedirectory. It will be called something like "c:/local/lib/vim/vim54". Thusyou get a tree of Vim files like this: c:/local/lib/vim/.vimrc c:/local/lib/vim/vim54/filetype.vim c:/local/lib/vim/vim54/doc/help.txt etc.Note: .vimrc may also be called _vimrc to accommodate those who have chosen toinstall OS/2 on a FAT file system. Vim first tries to find .vimrc and if thatfails, looks for _vimrc in the same place. The existence of a .vimrc or_vimrc file influences the 'compatible' options, which can have unexpected sideeffects. See |'compatible'|.If you're using network drives with OS/2, then you can install Vim on anetwork drive (including .vimrc; this is then called the "system" vimrc file),and then use a personal copy of .vimrc (the "user" vimrc file). This should belocated in a directory indicated by the HOME environment variable.ENVIRONMENT VARIABLES IN FILE NAMESThis HOME environment variable is also used when using ~ in file names, so":e ~/textfile" will edit the file "textfile" in the directory referred to byHOME. Additionally you can use other environment variables in file names, asas ":n $SRC/*.c".The HOME environment variable is also used to locate the .viminfo file(see |viminfo-file|). There is no support yet for .viminfo on FAT filesystems yet, sorry. You could try the -i startup flag (as in "vim -i$HOME/_viminfo") however.If the HOME environment variable is not set, the value "C:/" is used as adefault.BACKSLASHESUsing slashes ('/') and backslashes ('\') can be a bit of a problem (see|dos-backslash| for more explanation), but in almost all cases Vim does "TheRight Thing". Vim itself uses backslashes in file names, but will happilyaccept forward slashes if they are entered (in fact, sometimes that worksbetter!).TEMP FILESTemporary files (for filtering) are put in the first directory in the nextlist that exists and where a file can be created: $TMP $TEMP C:\TMP C:\TEMP current directoryTERMINAL SETTING *os2ansi*Use "os2ansi" as the TERM environment variable (or don't set it at all, as thedefault is the correct value). You can set term to os2ansi in the .vimrc, incase you need TERM to be a different value for other applications. Theproblem is that OS/2 ANSI emulation is quite limited (it doesn't have insert /delete line, for example).If you want to use a different value for TERM (because of other programs, forexample), make sure that the termcap entry for that TERM value has theappropriate key mappings. The termcap.dat distributed with emx does not alwayshave them. Here are some suitable values to add to the termcap entry of yourchoice; these allow the cursor keys and the named function keys (such aspagedown) to work. :ku=\316H:kd=\316P:kl=\316K:kr=\316M:%i=\316t:#4=\316s:\ :kD=\316S:kI=\316R:kN=\316Q:kP=\316I:kh=\316G:@7=\316O:\ :k1=\316;:k2=\316<:k3=\316=:k4=\316>:k5=\316?:k6=\316@:\ :k7=\316A:k8=\316B:k9=\316C:k;=\316D:Paul Slootman43 LINE WINDOWA suggestion from Steven Tryon, on how to run Vim in a bigger window:When I call Vim from an OS/2 WPS application such as PMMail it comes upin the default 25-line mode. To get a more useful window size I makemy external editor "vimbig.cmd" which in turn calls "vimbig2.cmd".Brute force and awkwardness, perhaps, but it works.vimbig.cmd:> @echo off> start "Vi Improved" /f vimbig2.cmd %1 %2 %3 %4vimbig2.cmd:> @echo off> mode 80,43> vim.exe %1 %2 %3 %4> exit vim:ts=8:sw=8:tw=78:
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -