blob: 53010b17c2e60bb6935743d581e5b42dc6dc3806 [file] [log] [blame]
Bram Moolenaarbb76f242016-09-12 14:24:39 +02001*os_mac.txt* For Vim version 8.0. Last change: 2006 Apr 30
Bram Moolenaar071d4272004-06-13 20:20:40 +00002
3
4 VIM REFERENCE MANUAL by Bram Moolenaar et al.
5
6
7 *mac* *Mac* *macintosh* *Macintosh*
8
9This file documents the particularities of the Macintosh version of Vim.
10
11NOTE: This file is a bit outdated. You might find more useful info here:
Bram Moolenaar89cb5e02004-07-19 20:55:54 +000012 http://macvim.org/
Bram Moolenaar071d4272004-06-13 20:20:40 +000013
141. Filename Convention |mac-filename|
Bram Moolenaare0720cb2017-03-29 13:48:40 +0200152. .vimrc and .vim files |mac-vimfile|
163. Standard mappings |mac-standard-mappings|
174. FAQ |mac-faq|
185. Known Lack |mac-lack|
196. Mac Bug Report |mac-bug|
207. Compiling Vim |mac-compile|
Bram Moolenaar071d4272004-06-13 20:20:40 +000021
22There was a Mac port for version 3.0 of Vim. Here are the first few lines
23from the old file:
24
25VIM Release Notes
26Initial Macintosh release, VIM version 3.0
2719 October 1994
28
29Eric Fischer
30<enf1@midway.uchicago.edu>, <eric@jcp.uchicago.edu>, <etaoin@uchicago.edu>
315759 N. Guilford Ave
32Indianapolis IN 46220 USA
33
34==============================================================================
351. Filename Convention *mac-filename*
36
Bram Moolenaar4ea8fe12006-03-09 22:32:39 +000037Starting with Vim version 7 you can just use the unix path separators with
38Vim. In order to determine if the specified filename is relative to the
39current folder or absolute (i.e. relative to the "Desktop"), the following
40algorithm is used:
Bram Moolenaar071d4272004-06-13 20:20:40 +000041
42 If the path start by a "/", the path is absolute
43 If the path start by a ":", the path is relative
44 If the path doesn't start by neither a "/" nor ":",
45 and a ":" is found before a "/" then the path is absolute
46>
47 :e /HD/text
48 :e HD:text
49< Edit the file "text" of the disk "HD" >
50 :e :src:main.c
51 :e src/main.c
52< Edit the file "main.c" in the folder "src" in the current folder >
53 :e os_mac.c
54< Edit the file "os_mac.c" in the current folder.
55
56You can use the |$VIM| and |$VIMRUNTIME| variable. >
57
58 :so $VIMRUNTIME:syntax:syntax.vim
59
60==============================================================================
612. .vimrc and .vim files *mac-vimfile*
62
Bram Moolenaar4ea8fe12006-03-09 22:32:39 +000063It is recommended to use Unix style line separators for Vim scripts, thus a
64single newline character.
65
66When starting up Vim will load the $VIMRUNTIME/macmap.vim script to define
67default command-key mappings.
68
69On older systems files starting with a dot "." are discouraged, thus the rc
70files are named "vimrc" or "_vimrc" and "gvimrc" or "_gvimrc". These files
71can be in any format (mac, dos or unix). Vim can handle any file format when
72the |'nocompatible'| option is set, otherwise it will only handle mac format
Bram Moolenaar071d4272004-06-13 20:20:40 +000073files.
74
75==============================================================================
Bram Moolenaare0720cb2017-03-29 13:48:40 +0200763. Standard mappings *mac-standard-mappings*
77
78The following mappings are available for cut/copy/paste from/to clipboard.
79
80key Normal Visual Insert Description ~
81Command-v "*P "-d"*P <C-R>* paste text *<D-v>*
82Command-c "*y copy Visual text *<D-c>*
83Command-x "*d cut Visual text *<D-x>*
84Backspace "*d cut Visual text
85
86==============================================================================
874. Mac FAQ *mac-faq*
Bram Moolenaar071d4272004-06-13 20:20:40 +000088
Bram Moolenaar3991dab2006-03-27 17:01:56 +000089On the internet: http://macvim.org/OSX/index.php#FAQ
90
Bram Moolenaar071d4272004-06-13 20:20:40 +000091Q: I can't enter non-ASCII character in Apple Terminal.
92A: Under Window Settings, Emulation, make sure that "Escape non-ASCII
93 characters" is not checked.
94
Bram Moolenaar1cd871b2004-12-19 22:46:22 +000095Q: How do I start the GUI from the command line?
96A: Assuming that Vim.app is located in /Applications:
97 open /Applications/Vim.app
98 Or:
Bram Moolenaarc9b4b052006-04-30 18:54:39 +000099 /Applications/Vim.app/Contents/MacOS/Vim -g {arguments}
Bram Moolenaar1cd871b2004-12-19 22:46:22 +0000100
Bram Moolenaare2f98b92006-03-29 21:18:24 +0000101Q: How can I set $PATH to something reasonable when I start Vim.app from the
102 GUI or with open?
103A: The following trick works with most shells. Put it in your vimrc file.
104 This is included in the system vimrc file included with the binaries
105 distributed at macvim.org . >
106 let s:path = system("echo echo VIMPATH'${PATH}' | $SHELL -l")
107 let $PATH = matchstr(s:path, 'VIMPATH\zs.\{-}\ze\n')
108
Bram Moolenaar071d4272004-06-13 20:20:40 +0000109==============================================================================
Bram Moolenaare0720cb2017-03-29 13:48:40 +02001105. Mac Lack *mac-lack*
Bram Moolenaar071d4272004-06-13 20:20:40 +0000111
Bram Moolenaar69a7cb42004-06-20 12:51:53 +0000112In a terminal CTRL-^ needs to be entered as Shift-Control-6. CTRL-@ as
113Shift-Control-2.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000114
115==============================================================================
Bram Moolenaare0720cb2017-03-29 13:48:40 +02001166. Mac Bug Report *mac-bug*
Bram Moolenaar071d4272004-06-13 20:20:40 +0000117
118When reporting any Mac specific bug or feature change, please use the vim-mac
119maillist |vim-mac|. However, you need to be subscribed. An alternative is to
120send a message to the current MacVim maintainers:
121
122 mac@vim.org
123
124==============================================================================
Bram Moolenaare0720cb2017-03-29 13:48:40 +02001257. Compiling Vim *mac-compile*
Bram Moolenaar071d4272004-06-13 20:20:40 +0000126
127See the file "src/INSTALLmac.txt" that comes with the source files.
128
129
130 vim:tw=78:ts=8:ft=help:norl: