Bram Moolenaar | bb76f24 | 2016-09-12 14:24:39 +0200 | [diff] [blame] | 1 | *os_mac.txt* For Vim version 8.0. Last change: 2006 Apr 30 |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2 | |
| 3 | |
| 4 | VIM REFERENCE MANUAL by Bram Moolenaar et al. |
| 5 | |
| 6 | |
| 7 | *mac* *Mac* *macintosh* *Macintosh* |
| 8 | |
| 9 | This file documents the particularities of the Macintosh version of Vim. |
| 10 | |
| 11 | NOTE: This file is a bit outdated. You might find more useful info here: |
Bram Moolenaar | 89cb5e0 | 2004-07-19 20:55:54 +0000 | [diff] [blame] | 12 | http://macvim.org/ |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 13 | |
| 14 | 1. Filename Convention |mac-filename| |
Bram Moolenaar | e0720cb | 2017-03-29 13:48:40 +0200 | [diff] [blame^] | 15 | 2. .vimrc and .vim files |mac-vimfile| |
| 16 | 3. Standard mappings |mac-standard-mappings| |
| 17 | 4. FAQ |mac-faq| |
| 18 | 5. Known Lack |mac-lack| |
| 19 | 6. Mac Bug Report |mac-bug| |
| 20 | 7. Compiling Vim |mac-compile| |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 21 | |
| 22 | There was a Mac port for version 3.0 of Vim. Here are the first few lines |
| 23 | from the old file: |
| 24 | |
| 25 | VIM Release Notes |
| 26 | Initial Macintosh release, VIM version 3.0 |
| 27 | 19 October 1994 |
| 28 | |
| 29 | Eric Fischer |
| 30 | <enf1@midway.uchicago.edu>, <eric@jcp.uchicago.edu>, <etaoin@uchicago.edu> |
| 31 | 5759 N. Guilford Ave |
| 32 | Indianapolis IN 46220 USA |
| 33 | |
| 34 | ============================================================================== |
| 35 | 1. Filename Convention *mac-filename* |
| 36 | |
Bram Moolenaar | 4ea8fe1 | 2006-03-09 22:32:39 +0000 | [diff] [blame] | 37 | Starting with Vim version 7 you can just use the unix path separators with |
| 38 | Vim. In order to determine if the specified filename is relative to the |
| 39 | current folder or absolute (i.e. relative to the "Desktop"), the following |
| 40 | algorithm is used: |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 41 | |
| 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 | |
| 56 | You can use the |$VIM| and |$VIMRUNTIME| variable. > |
| 57 | |
| 58 | :so $VIMRUNTIME:syntax:syntax.vim |
| 59 | |
| 60 | ============================================================================== |
| 61 | 2. .vimrc and .vim files *mac-vimfile* |
| 62 | |
Bram Moolenaar | 4ea8fe1 | 2006-03-09 22:32:39 +0000 | [diff] [blame] | 63 | It is recommended to use Unix style line separators for Vim scripts, thus a |
| 64 | single newline character. |
| 65 | |
| 66 | When starting up Vim will load the $VIMRUNTIME/macmap.vim script to define |
| 67 | default command-key mappings. |
| 68 | |
| 69 | On older systems files starting with a dot "." are discouraged, thus the rc |
| 70 | files are named "vimrc" or "_vimrc" and "gvimrc" or "_gvimrc". These files |
| 71 | can be in any format (mac, dos or unix). Vim can handle any file format when |
| 72 | the |'nocompatible'| option is set, otherwise it will only handle mac format |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 73 | files. |
| 74 | |
| 75 | ============================================================================== |
Bram Moolenaar | e0720cb | 2017-03-29 13:48:40 +0200 | [diff] [blame^] | 76 | 3. Standard mappings *mac-standard-mappings* |
| 77 | |
| 78 | The following mappings are available for cut/copy/paste from/to clipboard. |
| 79 | |
| 80 | key Normal Visual Insert Description ~ |
| 81 | Command-v "*P "-d"*P <C-R>* paste text *<D-v>* |
| 82 | Command-c "*y copy Visual text *<D-c>* |
| 83 | Command-x "*d cut Visual text *<D-x>* |
| 84 | Backspace "*d cut Visual text |
| 85 | |
| 86 | ============================================================================== |
| 87 | 4. Mac FAQ *mac-faq* |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 88 | |
Bram Moolenaar | 3991dab | 2006-03-27 17:01:56 +0000 | [diff] [blame] | 89 | On the internet: http://macvim.org/OSX/index.php#FAQ |
| 90 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 91 | Q: I can't enter non-ASCII character in Apple Terminal. |
| 92 | A: Under Window Settings, Emulation, make sure that "Escape non-ASCII |
| 93 | characters" is not checked. |
| 94 | |
Bram Moolenaar | 1cd871b | 2004-12-19 22:46:22 +0000 | [diff] [blame] | 95 | Q: How do I start the GUI from the command line? |
| 96 | A: Assuming that Vim.app is located in /Applications: |
| 97 | open /Applications/Vim.app |
| 98 | Or: |
Bram Moolenaar | c9b4b05 | 2006-04-30 18:54:39 +0000 | [diff] [blame] | 99 | /Applications/Vim.app/Contents/MacOS/Vim -g {arguments} |
Bram Moolenaar | 1cd871b | 2004-12-19 22:46:22 +0000 | [diff] [blame] | 100 | |
Bram Moolenaar | e2f98b9 | 2006-03-29 21:18:24 +0000 | [diff] [blame] | 101 | Q: How can I set $PATH to something reasonable when I start Vim.app from the |
| 102 | GUI or with open? |
| 103 | A: 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 Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 109 | ============================================================================== |
Bram Moolenaar | e0720cb | 2017-03-29 13:48:40 +0200 | [diff] [blame^] | 110 | 5. Mac Lack *mac-lack* |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 111 | |
Bram Moolenaar | 69a7cb4 | 2004-06-20 12:51:53 +0000 | [diff] [blame] | 112 | In a terminal CTRL-^ needs to be entered as Shift-Control-6. CTRL-@ as |
| 113 | Shift-Control-2. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 114 | |
| 115 | ============================================================================== |
Bram Moolenaar | e0720cb | 2017-03-29 13:48:40 +0200 | [diff] [blame^] | 116 | 6. Mac Bug Report *mac-bug* |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 117 | |
| 118 | When reporting any Mac specific bug or feature change, please use the vim-mac |
| 119 | maillist |vim-mac|. However, you need to be subscribed. An alternative is to |
| 120 | send a message to the current MacVim maintainers: |
| 121 | |
| 122 | mac@vim.org |
| 123 | |
| 124 | ============================================================================== |
Bram Moolenaar | e0720cb | 2017-03-29 13:48:40 +0200 | [diff] [blame^] | 125 | 7. Compiling Vim *mac-compile* |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 126 | |
| 127 | See the file "src/INSTALLmac.txt" that comes with the source files. |
| 128 | |
| 129 | |
| 130 | vim:tw=78:ts=8:ft=help:norl: |