diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000..2f0e02e7dc --- /dev/null +++ b/.gitignore @@ -0,0 +1,44 @@ +.*.swp +.DS_Store +src/MacVim/MacVim.xcodeproj/*.mode1 +src/MacVim/MacVim.xcodeproj/*.mode1v3 +src/MacVim/MacVim.xcodeproj/*.pbxuser +src/MacVim/MacVim.xcodeproj/project.xcworkspace +src/MacVim/MacVim.xcodeproj/xcuserdata +src/MacVim/icons/*.pyc +src/MacVim/icons/*.ttf +src/MacVim/icons/*.reg +src/MacVim/icons/*.zip +src/MacVim/icons/*.txt +src/MacVim/icons/*.so +src/MacVim/icons/*.egg-info +src/MacVim/icons/build +src/MacVim/icons/makeicns/*.o +src/MacVim/icons/makeicns/makeicns +src/MacVim/PSMTabBarControl/PSMTabBarControl.xcodeproj/*.mode1 +src/MacVim/PSMTabBarControl/PSMTabBarControl.xcodeproj/*.mode1v3 +src/MacVim/PSMTabBarControl/PSMTabBarControl.xcodeproj/*.pbxuser +src/MacVim/PSMTabBarControl/PSMTabBarControl.xcodeproj/xcuserdata +src/MacVim/PSMTabBarControl/build +src/MacVim/PSMTabBarControl/build +src/MacVim/build +src/TAGS +src/Vim +src/auto/config.cache +src/auto/config.h +src/auto/config.log +src/auto/config.mk +src/auto/config.status +src/auto/if_perl.c +src/auto/link.log +src/auto/link.sed +src/auto/osdef.h +src/auto/pathdef.c +src/config.log +src/config.status +src/objects +src/po/*.mo +src/tags +src/xxd/xxd +src/xxd/xxd.dSYM +src/a.out.dSYM diff --git a/README_extra.txt b/README_extra.txt index e496912dc8..f16e7c0190 100644 --- a/README_extra.txt +++ b/README_extra.txt @@ -19,8 +19,10 @@ src/os_beos.* Files for the BeOS port. src/os_msdos.* src/os_dos.* Files for the MS-DOS port. -src/gui_mac.* -src/os_mac.* Files for the Mac port. +src/gui_mac.* Carbon GUI (not used) +src/os_mac* Shared files for the different Mac ports. + +src/MacVim/* Files for the MacVim port. src/os_mint.8 Files for the Atari Mint port. diff --git a/README_mac.txt b/README_mac.txt index 08888d9bb8..92d0c35e12 100644 --- a/README_mac.txt +++ b/README_mac.txt @@ -1,8 +1,38 @@ README_mac.txt for version 7.4 of Vim: Vi IMproved. -This file explains the installation of Vim on Macintosh systems. +This file explains the installation of MacVim. See "README.txt" for general information about Vim. +See "src/MacVim/README" for an overview of the MacVim specific source code. +MacVim uses the usual configure/make steps to build the binary but instead of +"make install" you just drag the app bundle into the directory you wish to +install in (usually `/Applications'). -Sorry, this text still needs to be written! +How to build and install +======================== + +Run `./configure` in the `src/` directory with the flags you want (call +`./configure --help` to see a list of flags) e.g.: + + $ cd src + $ ./configure --with-features=huge \ + --enable-rubyinterp \ + --enable-pythoninterp \ + --enable-perlinterp \ + --enable-cscope + +Now build the project using `make`: + + $ make + +The resulting app bundle will reside under `MacVim/build/Release`. To try it +out quickly, type: + + $ open MacVim/build/Release/MacVim.app + +To install MacVim, type + + $ open MacVim/build/Release + +and drag the MacVim icon into your `Applications` folder. diff --git a/runtime/colors/macvim.vim b/runtime/colors/macvim.vim new file mode 100644 index 0000000000..394162f5f8 --- /dev/null +++ b/runtime/colors/macvim.vim @@ -0,0 +1,133 @@ +" MacVim colorscheme +" +" Maintainer: Bjorn Winckler +" Last Change: 2008 May 9 +" +" This is the default MacVim color scheme. It supports both light and dark +" backgrounds (see :h 'background'). +" + + +highlight clear + +" Reset String -> Constant links etc if they were reset +if exists("syntax_on") + syntax reset +endif + +let colors_name = "macvim" + + +" +" First list all groups common to both 'light' and 'dark' background. +" + +" `:he highlight-groups` +hi DiffAdd guibg=MediumSeaGreen +hi Directory guifg=#1600FF +hi ErrorMsg guibg=Firebrick2 guifg=White +hi FoldColumn guibg=Grey guifg=DarkBlue +hi Folded guibg=#E6E6E6 guifg=DarkBlue +hi IncSearch gui=reverse +hi ModeMsg gui=bold +hi MoreMsg gui=bold guifg=SeaGreen4 +hi NonText gui=bold guifg=Blue +hi Pmenu guibg=LightSteelBlue1 +hi PmenuSbar guibg=Grey +hi PmenuSel guifg=White guibg=SkyBlue4 +hi PmenuThumb gui=reverse +hi Question gui=bold guifg=Chartreuse4 +hi SignColumn guibg=Grey guifg=DarkBlue +hi SpecialKey guifg=Blue +hi SpellBad guisp=Firebrick2 gui=undercurl +hi SpellCap guisp=Blue gui=undercurl +hi SpellLocal guisp=DarkCyan gui=undercurl +hi SpellRare guisp=Magenta gui=undercurl +hi StatusLine gui=NONE guifg=White guibg=DarkSlateGray +hi StatusLineNC gui=NONE guifg=SlateGray guibg=Gray90 +hi TabLine gui=underline guibg=LightGrey +hi TabLineFill gui=reverse +hi TabLineSel gui=bold +hi Title gui=bold guifg=DeepSkyBlue3 +hi VertSplit gui=NONE guifg=DarkSlateGray guibg=Gray90 +if has("gui_macvim") + hi Visual guibg=MacSelectedTextBackgroundColor +else + hi Visual guibg=#72F7FF +endif +hi WarningMsg guifg=Firebrick2 + +" Syntax items (`:he group-name` -- more groups are available, these are just +" the top level syntax items for now). +hi Error gui=NONE guifg=White guibg=Firebrick3 +hi Identifier gui=NONE guifg=Aquamarine4 guibg=NONE +hi Ignore gui=NONE guifg=bg guibg=NONE +hi PreProc gui=NONE guifg=DodgerBlue3 guibg=NONE +hi Special gui=NONE guifg=BlueViolet guibg=NONE +hi String gui=NONE guifg=SkyBlue4 guibg=NONE +hi Underlined gui=underline guifg=SteelBlue1 + + +" +" Groups that differ between 'light' and 'dark' background. +" + +if &background == "dark" + hi Boolean gui=NONE guifg=DeepPink4 guibg=NONE + hi Comment gui=italic guifg=CadetBlue3 + hi Constant gui=NONE guifg=Goldenrod1 guibg=NONE + hi Cursor guibg=LightGoldenrod guifg=bg + hi CursorColumn guibg=Gray20 + hi CursorIM guibg=LightSlateGrey guifg=bg + hi CursorLine guibg=Gray20 + hi DiffChange guibg=MediumPurple4 + hi DiffDelete gui=bold guifg=White guibg=SlateBlue + hi DiffText gui=NONE guifg=White guibg=SteelBlue + hi LineNr guifg=#552A7B guibg=Grey5 + hi MatchParen guifg=White guibg=Magenta + hi Normal guifg=Grey50 guibg=Grey10 + hi Search guibg=Blue4 guifg=NONE + hi Statement gui=bold guifg=Purple1 guibg=NONE + hi Todo gui=NONE guifg=Green4 guibg=DeepSkyBlue1 + hi Type gui=bold guifg=Cyan4 guibg=NONE + hi WildMenu guibg=SkyBlue guifg=White + hi lCursor guibg=LightSlateGrey guifg=bg +else + hi Boolean gui=NONE guifg=Red3 guibg=NONE + hi Comment gui=italic guifg=Blue2 guibg=NONE + hi Constant gui=NONE guifg=DarkOrange guibg=NONE + hi Cursor guibg=fg guifg=bg + hi CursorColumn guibg=#F1F5FA + hi CursorIM guibg=fg guifg=bg + hi CursorLine guibg=#F1F5FA + hi DiffChange guibg=DeepSkyBlue + hi DiffDelete gui=bold guifg=Black guibg=SlateBlue + hi DiffText gui=NONE guibg=Gold + hi LineNr guifg=#888888 guibg=#E6E6E6 + hi MatchParen guifg=White guibg=MediumPurple1 + if has("gui_macvim") + hi Normal gui=NONE guifg=MacTextColor guibg=MacTextBackgroundColor + else + hi Normal gui=NONE guifg=Black guibg=White + endif + hi Search guibg=CadetBlue1 guifg=NONE + hi Statement gui=bold guifg=Maroon guibg=NONE + hi Todo gui=NONE guifg=DarkGreen guibg=PaleGreen1 + hi Type gui=bold guifg=Green4 guibg=NONE + hi WildMenu guibg=SkyBlue guifg=Black + hi lCursor guibg=fg guifg=bg +endif + + +" +" Change the selection color on focus change (but only if the "macvim" +" colorscheme is active). +" +if has("gui_macvim") && !exists("s:augroups_defined") + au FocusLost * if exists("colors_name") && colors_name == "macvim" | hi Visual guibg=MacSecondarySelectedControlColor | endif + au FocusGained * if exists("colors_name") && colors_name == "macvim" | hi Visual guibg=MacSelectedTextBackgroundColor | endif + + let s:augroups_defined = 1 +endif + +" vim: sw=2 diff --git a/runtime/doc/change.txt b/runtime/doc/change.txt index de340ec8b5..89293cd243 100644 --- a/runtime/doc/change.txt +++ b/runtime/doc/change.txt @@ -869,13 +869,13 @@ This replaces each 'E' character with a euro sign. Read more in ||. :promptf[ind] [string] Put up a Search dialog. When [string] is given, it is used as the initial search string. - {only for Win32, Motif and GTK GUI} + {only for Win32, Motif, GTK and MacVim GUI} *:promptr* *:promptrepl* :promptr[epl] [string] Put up a Search/Replace dialog. When [string] is given, it is used as the initial search string. - {only for Win32, Motif and GTK GUI} + {only for Win32, Motif, GTK and MacVim GUI} 4.4 Changing tabs *change-tabs* diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index cbd995da3d..a6f1f10929 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -6644,6 +6644,7 @@ fname_case Case in file names matters (for Amiga, MS-DOS, and folding Compiled with |folding| support. footer Compiled with GUI footer support. |gui-footer| fork Compiled to use fork()/exec() instead of system(). +fullscreen Compiled with 'fullscreen' support. gettext Compiled with message translation |multi-lang| gui Compiled with GUI enabled. gui_athena Compiled with Athena GUI. @@ -6651,6 +6652,7 @@ gui_gnome Compiled with Gnome support (gui_gtk is also defined). gui_gtk Compiled with GTK+ GUI (any version). gui_gtk2 Compiled with GTK+ 2 GUI (gui_gtk is also defined). gui_mac Compiled with Macintosh GUI. +gui_macvim Compiled with MacVim GUI. gui_motif Compiled with Motif GUI. gui_photon Compiled with Photon GUI. gui_running Vim is running in the GUI, or it will start soon. @@ -6693,6 +6695,7 @@ multi_lang Compiled with support for multiple languages. mzscheme Compiled with MzScheme interface |mzscheme|. netbeans_enabled Compiled with support for |netbeans| and connected. netbeans_intg Compiled with support for |netbeans|. +odbeditor Compiled with |odbeditor| support. ole Compiled with OLE automation support for Win32. os2 OS/2 version of Vim. path_extra Compiled with up/downwards search in 'path' and 'tags' @@ -6736,6 +6739,7 @@ tgetent Compiled with tgetent support, able to use a termcap or terminfo file. title Compiled with window title support |'title'|. toolbar Compiled with support for |gui-toolbar|. +transparency Compiled with 'transparency' support. unix Unix version of Vim. user_commands User-defined commands. vertsplit Compiled with vertically split windows |:vsplit|. diff --git a/runtime/doc/gui.txt b/runtime/doc/gui.txt index d77976330b..29142c5c26 100644 --- a/runtime/doc/gui.txt +++ b/runtime/doc/gui.txt @@ -25,8 +25,8 @@ Other GUI documentation: First you must make sure you actually have a version of Vim with the GUI code included. You can check this with the ":version" command, it says "with xxx -GUI", where "xxx" is X11-Motif, X11-Athena, Photon, GTK, GTK2, etc., or -"MS-Windows 32 bit GUI version". +GUI", where "xxx" is Macvim, X11-Motif, X11-Athena, Photon, GTK, GTK2, etc., +or "MS-Windows 32 bit GUI version". How to start the GUI depends on the system used. Mostly you can run the GUI version of Vim with: @@ -93,7 +93,7 @@ and initialize other things that you may want to set up differently from the terminal version. Recommended place for your personal GUI initializations: - Unix $HOME/.gvimrc or $HOME/.vim/gvimrc + Unix and Mac OS X $HOME/.gvimrc or $HOME/.vim/gvimrc OS/2 $HOME/.gvimrc, $HOME/vimfiles/gvimrc or $VIM/.gvimrc MS-DOS and Win32 $HOME/_gvimrc, $HOME/vimfiles/gvimrc @@ -692,9 +692,10 @@ because the item will never be selected. Use a single colon to keep it simple. *gui-toolbar* -The toolbar is currently available in the Win32, Athena, Motif, GTK+ (X11), -and Photon GUI. It should turn up in other GUIs in due course. The -default toolbar is setup in menu.vim. +The toolbar is currently available in the MacVim, Win32, Athena, Motif, GTK+ +(X11), and Photon GUI. It should turn up in other GUIs in due course. The +default toolbar is setup in menu.vim. (Note: The MacVim toolbar is modified +in "$VIM/gvimrc".) The display of the toolbar is controlled by the 'guioptions' letter 'T'. You can thus have menu & toolbar together, or either on its own, or neither. The appearance is controlled by the 'toolbar' option. You can choose between @@ -931,9 +932,9 @@ a menu item - you don't need to do a :tunmenu as well. 5.9 Popup Menus -In the Win32 and GTK+ GUI, you can cause a menu to popup at the cursor. -This behaves similarly to the PopUp menus except that any menu tree can -be popped up. +In the Win32, MacVim, and GTK+ GUI, you can cause a menu to popup at the +cursor. This behaves similarly to the PopUp menus except that any menu tree +can be popped up. This command is for backwards compatibility, using it is discouraged, because it behaves in a strange way. @@ -942,7 +943,7 @@ it behaves in a strange way. :popu[p] {name} Popup the menu {name}. The menu named must have at least one subentry, but need not appear on the menu-bar (see |hidden-menus|). - {only available for Win32 and GTK GUI} + {only available for Win32, MacVim, and GTK GUI} :popu[p]! {name} Like above, but use the position of the mouse pointer instead of the cursor. @@ -996,6 +997,8 @@ This section describes other features which are related to the GUI. :set guifont=*-lucidatypewriter-medium-r-normal-*-*-180-*-*-m-*-* elseif has("gui_win32") :set guifont=Luxi_Mono:h12:cANSI + elseif has("gui_macvim") + :set guifont=DejaVu\ Sans\ Mono:h13 endif endif diff --git a/runtime/doc/gui_mac.txt b/runtime/doc/gui_mac.txt new file mode 100644 index 0000000000..769fca9766 --- /dev/null +++ b/runtime/doc/gui_mac.txt @@ -0,0 +1,822 @@ +*gui_mac.txt* For Vim version 7.4. Last change: 2012 Jan 13 + + + VIM REFERENCE MANUAL by Bjorn Winckler + + +The MacVim Graphical User Interface *macvim* *gui-macvim* + + 1. MacVim differences |macvim-differences| + 2. Starting MacVim |macvim-start| + 3. Preferences |macvim-preferences| + 4. Special colors |macvim-colors| + 5. Menus |macvim-menus| + 6. Toolbar |macvim-toolbar| + 7. Dialogs |macvim-dialogs| + 8. System services |macvim-services| + 9. mvim:// URL handler |macvim-url-handler| +10. Keyboard shortcuts |macvim-shortcuts| +11. Trackpad gestures |macvim-gestures| +12. International |macvim-international| +13. Known bugs/missing features |macvim-todo| +14. Hints |macvim-hints| + +Other relevant documentation: +|gui.txt| For generic items of the GUI. + +{Vi does not have a GUI} + +============================================================================== +1. MacVim differences *macvim-differences* + +One of the goals of MacVim is to make Vim behave like a proper Mac OS X +application. For this reason MacVim behaves slightly different from other GUI +ports of Vim. Most of the modifications are provided in the system gvimrc +file; you can quickly open this file and look at it yourself by typing: > + :tabe $VIM/gvimrc +Note that this file will be overwritten each time you update MacVim, so it is +best to keep your own modifications inside "~/.gvimrc". + + *macvim-windows* +There is some confusion regarding the term "window" in MacVim since it means +one thing to Vim and another to MacVim. A "window" in Vim is what opens up +when you type ":sp", whereas a "window" in MacVim is the GUI window which +contains the text view, scrollbars, toolbar and tabline. To avoid confusion, +the former is referred to as a Vim-window, whereas the latter is simply called +a window. + + *macvim-encoding* +It is not possible to modify 'termencoding' in MacVim; this option is forcibly +set to "utf-8". The option 'encoding' also defaults to "utf-8" (as opposed to +"latin1" in the other GUI ports). + +Note: UTF-8 can represent all characters defined in Unicode, which includes +all characters in all other standard encodings, so it should be perfectly safe +to edit files in any encoding while 'encoding' is set to "utf-8". Of course, +you may need to set 'fileencodings' to auto-detect the encoding of the files +you edit, or force the detection with |++enc| on the command line. + +However, if you are editing files that use multiple encodings (container +formats like MIME or Unix mbox files) or no standard encoding (binary data, +see also |edit-binary|), you may want to prevent MacVim from re-encoding the +file at all. In this situation, you will need to set both 'encoding' and +'fileencodings' to a simple single-byte encoding such as Latin1 so that when +the file is read into memory, the original bytes are left untouched. + + *macvim-shift-movement* +Text editors on Mac OS X lets the user hold down shift+movement key to extend +the selection. Also, pressing a printable key whilst selecting replaces the +current selection with that character. MacVim can emulate this kind of +behaviour (by providing key bindings and by setting 'keymodel' and +'selectmode' to non-default values) although it is not enabled by default. To +make MacVim behave more like TextEdit and less like Vim, add the following +lines to your "~/.vimrc" (not .gvimrc) file: > + if has("gui_macvim") + let macvim_hig_shift_movement = 1 + endif +< + *macvim-drag-n-drop* +Dragging files and dropping them on a window opens those files in tabs in that +window, unless Vim is in command-line mode. In command-line mode the names of +the files are added to the command line. Holding down modifier keys whilst +dragging is not supported. + +If a file is dropped on the Dock icon, it is always opened in a new tab +regardless of the mode Vim is currently in. The same holds if you +double-click on a file in the Finder. + +The "Open files from applications" preference in the General preference pane +gives more options on how dropped files should open, in case tabs are not +desired. + + *macvim-default-menu* +The default menu in MacVim has been changed to conform better with the Apple +Human Interface Guidelines (HIG). At the moment this breaks the localized +menus, so only English menus are supported. + +Note: The menus are a work in progress. If you know something about the HIG +and want to contribute to MacVim you could do so by making the menus better. + + *macvim-window-title* +The default window title does not include the argument list because it looks +really bad once you start using tabs. For example, dropping two files, then +dropping two more, and switching back to the first tab would cause weird +strings like "((3) of 2)" to appear in the window title. + + *macvim-tablabel* +Tab labels only show the tail of the file name to make the tabs more readable +when editing files in deeply nested folders. Add the line "set guitablabel=" +to your .gvimrc file to revert back to the default Vim tab label. + + *macvim-options* +These are the non-standard options that MacVim supports: + 'antialias' 'fullscreen' 'fuoptions' + 'macmeta' 'toolbariconsize' 'transparency' + + *macvim-commands* +These are the non-standard commands that MacVim supports: + |:macaction| |:macmenu| + + *macvim-find* +Whenever you search for something in Vim (e.g. using "/") the search query is +copied to the OS X "Find Pasteboard". The idea is that if you search for +something and switch to another application, then you can hit (or ) +to repeat the search in the new app. The same feature works if you search in +some app, switch to MacVim and hit . + +Note that the command |n| is not the same as . The former will repeat +the last search made in Vim, whereas the latter searches for the string on the +OS X Find Pasteboard using the action findNext: (see |:macaction|). + +The key equivalent is a great way to bring a search from one window to +another in MacVim. Simply search for something in one window (using "/") then +switch to another (e.g. with ) and hit and the search will be +repeated in the new window. + + *macvim-backspace* *macvim-delete* +The 'backspace' option is set in the system vimrc to make the delete key +behave in a more familiar way to new users. If you dislike this non-default +behaviour, then add the line "set backspace&" to your "~/.vimrc" file. + +============================================================================== +2. Starting MacVim *macvim-start* + +The easiest way to start MacVim is by double-clicking its icon in the Finder, +but most users will probably prefer to use the Terminal. First some Finder +related ways of starting MacVim are described, then Terminal is discussed. +Note that you can put MacVim anywhere on your hard drive, but in this help +file it is assumed that you have put it inside your /Applications folder. + +MacVim automatically registers itself as an editor of several standard file +formats. This enables you to double-click a file to open it with MacVim (if +it is not associated with another program), or to right-click a file to bring +up the "Open with" menu. You can also drag and drop files onto the Dock icon +to open them in tabs in a new window, or you can drop them in an already open +window to open the files in tabs in that specific window (it is possible to +have files open in e.g. splits by changing the "Open files from applications" +option in the General preference pane). Finally, you can use Mac OS X System +Services to open files in MacVim, see |macvim-services|. + +There are essentially two ways to start MacVim from Terminal: either call the +Vim binary with the -g switch > + /Applications/MacVim.app/Contents/MacOS/Vim -g file ... +or use the "open" command (this method can not be used to pass parameters to +Vim) > + open -a MacVim file ... +The advantage of using the latter method is that the settings relating to file +opening in the preferences panel are respected, and files open instantly if +|Quickstart| is enabled. + +To save yourself from having to type the entire path to the Vim binary each +time you start MacVim, you could create an alias such as > + alias gvim='/Applications/MacVim.app/Contents/MacOS/Vim -g' +and add that to "~/.profile". + +Note: Do NOT call the MacVim binary inside the app bundle to start MacVim. + + *mvim* +A more flexible way to start MacVim is to use the shell script "mvim" which +comes bundled with MacVim. Put this script in a folder in your path and then +simply type "mvim" to start MacVim. This script will try to find MacVim.app +in various typical folders such as > + ~/Applications ~/Applications/vim + /Applications /Applications/vim + /Applications/Utilities /Applications/Utilities/vim +If you would rather put MacVim.app in some other directory then that is also +possible, simply set the environment variable VIM_APP_DIR to whatever folder +you have placed MacVim.app in. + +The "mvim" script can be symlinked to in order to start up MacVim in different +modes as follows (assuming you placed "mvim" in "/usr/local/bin"): > + * Diff: ln -s /usr/local/bin/mvim mvimdiff + * Read-only: ln -s /usr/local/bin/mvim mview + * Ex: ln -s /usr/local/bin/mvim mex + * Restricted: ln -s /usr/local/bin/mvim rmvim +If the symlink destination starts with "m" (or "g"), Vim will start in GUI +mode. Removing the initial "m" from the above destination names makes Vim +start without the GUI. (In the last case, the destination name can be +"rmvim", "rgvim" or "rvim".) + +Note: Starting MacVim by creating a symlink to > + .../MacVim.app/Contents/MacOS/Vim +with 'ln -s' does not work. + +Once in terminal Vim it is possible to start MacVim by using the following +command: + :gui [++opt] [+cmd] [-f|-b] [files...] +Note: Forking ("-b") currently does not work. + + *Quickstart* +Quickstart ensures that new windows open instantaneously e.g. when is +pressed. This feature can be enabled from the Advanced preferences pane (it +is disabled by default). Note that this setting does not affect the speed +with which windows open when using the |mvim| command. + +Note that any changes to runtime files that are kept in a non-standard +location (i.e. not in ~/.vim) will not be picked up for the first window that +opens after any changes. Also, there are some issues related to reading and +writing of the |viminfo| file which can lead to the command line history +appearing to be lost (as well as any other information stored in the |viminfo| +file). For example, if you open a window, edit some files then close the +window, then the next window that opens will not have the same command line +history as the window you just closed (however the next window you open will). +For these reasons Quickstart is disabled by default. + + *odbeditor* *external-editor* +MacVim can act as an 'external editor' for Mac OS X applications that support +the ODB Editor Protocol (or the 'external editor' protocol). Each application +has different ways of configuring this option, check the application's +documentation. Once configured properly MacVim can be used to open files in +such an application. + +A technical note: MacVim handles file open, modified and closed events. In +the open event the FTok and Burl parameters are parsed (the latter is ignored +at the moment though). In the modified and closed events the Tokn parameter +is sent back to the server application. + +============================================================================== +3. Preferences *macvim-prefs* *macvim-preferences* + +Some settings are global to the MacVim application and would not make sense as +Vim options. These settings are stored in the user defaults database and can +be accessed via the "MacVim.Preferences..." menu item. + + *macvim-user-defaults* +Not all entries in the user defaults database are exposed via the preference +panel, usually because they should not be changed by the user under normal +circumstances. These options can still be changed with the "defaults" command +by opening Terminal and typing > + defaults write org.vim.MacVim KEY VALUE +Check the man page on "defaults" for more information on this command as well +as general information regarding Mac OS X user defaults. + +Here is a list of relevant dictionary entries: + +KEY VALUE ~ +MMCellWidthMultiplier width of a normal glyph in em units [float] +MMDialogsTrackPwd open/save dialogs track the Vim pwd [bool] +MMLoginShellArgument login shell parameter [string] +MMLoginShellCommand which shell to use to launch Vim [string] +MMNoFontSubstitution disable automatic font substitution [bool] +MMShowAddTabButton enable "add tab" button on tabline [bool] +MMTabMaxWidth maximum width of a tab [int] +MMTabMinWidth minimum width of a tab [int] +MMTabOptimumWidth default width of a tab [int] +MMTextInsetBottom text area offset in pixels [int] +MMTextInsetLeft text area offset in pixels [int] +MMTextInsetRight text area offset in pixels [int] +MMTextInsetTop text area offset in pixels [int] +MMTexturedWindow use brushed metal window (Tiger only) [bool] +MMTranslateCtrlClick interpret ctrl-click as right-click [bool] +MMVerticalSplit files open in vertical splits [bool] +MMZoomBoth zoom button maximizes both directions [bool] + +As an example, if you have more than one mouse button and would wish to free +up Ctrl-click so you can bind it to something else, then the appropriate +command is: > + defaults write org.vim.MacVim MMTranslateCtrlClick 0 + +If you wish to restore all user defaults to their starting values, open +Terminal and type: > + defaults delete org.vim.MacVim +< + *macvim-login-shell* +Applications opened from the Finder do not automatically source the user's +environment variables (which are typically set in .profile or .bashrc). This +presents a problem when using |:!| to execute commands in the shell since e.g. +$PATH might not be set properly. To work around this problem MacVim starts +new Vim processes via a login shell so that all environment variables are set. + +By default MacVim uses the $SHELL environment variable to determine which +shell to use (if $SHELL is not set "/bin/bash" is used). It is possible to +override this choice by setting the user default MMLoginShellCommand to the +shell that should be used (e.g. "/bin/tcsh"). MacVim tries to make the shell +a login shell by prepending argv[0] with a dash. If you use an exotic shell +and need to pass it a parameter to make it a login shell then you can set the +user default MMLoginShellArgument (e.g. to "-l"). Finally, if the "bash" +shell is used, then "-l" is automatically added as an argument. To override +this behaviour set MMLoginShellArgument to "--". + +============================================================================== +4. Special colors *macvim-colors* + +The colors in MacVim are defined in two dictionaries inside the "Resources" +folder of the application bundle (MacVim.app/Contents/Resources). It is +possible to add more colors by modifying these files. Color names are case +insensitive when accessed from Vim, but in the dictionary they must be +lowercase. + + *SystemColors.plist* +There are only a few system colors that can be accessed from Vim. These +colors are defined in the dictionary "SystemColors.plist". This dictionary +stores (key, value) pairs where the key is the name of the color and the +value is an NSColor selector name. + +The most useful system colors are: > + MacSelectedTextBackgroundColor + MacSecondarySelectedColor +The former is the "Highlight Color" which can be changed in the "Appearance" +section of the System Preferences. The latter is the selection color used by +a Cocoa application when it is not in focus. + + *Colors.plist* +Apart from the system colors, it is also possible to use the standard X11 +color names (see http://en.wikipedia.org/wiki/X11_color_names) which usually +come in a file called "rgb.txt". MacVim does not have such a file, instead it +keeps these colors in a dictionary called "Colors.plist". The key in this +dictionary is the name of the color and the value is an RGB value on the form +#rrggbb stored as an integer. + + *macvim-colorscheme* +MacVim ships with a custom color scheme that is used instead of the default +Vim color scheme. The color scheme can be changed with > + :colorscheme macvim +If you prefer a dark background color, then type > + :set bg=dark +after having loaded the "macvim" color scheme. + +Use the |:colorscheme| command if you want to use another color scheme. Note +that if you want to set syntax highlight colors manually, then you must either +create your own color scheme or add the line > + let macvim_skip_colorscheme=1 +to your ~/.vimrc (~/.gvimrc will not work). Otherwise the "macvim" color +scheme will be loaded when the system gvimrc file is sourced and mess up your +changes. + +The color scheme uses the system "Highlight Color", which can be changed in +the "Appearance" pane of the System Preferences. It also changes the +highlight color when a window becomes inactive. + +============================================================================== +5. Menus *macvim-menus* + +Menus in Mac OS X behave slightly different from other platforms. For that +reason two new commands have been added to Vim. To understand what these +commands do you must first understand how menus work on OS X. + +Each entry in a menu is called a "menu item". With each menu item is +associated: a title, a key equivalent and an action message. When a menu is +displayed the title is shown on the left and the key equivalent (if any) is +shown on the right. Key equivalents enable you to access a menu item using +the keyboard instead of having to use the mouse. When a menu item is clicked +it will send it's associated action message. Actions can be used to instruct +MacVim to paste some text (paste:), open a new window (newWindow:), etc. +Certain actions are standard throughout OS X which is why MacVim must be able +to set these for each menu item. (E.g. the menu item "Edit.Paste" must be +bound to the action "paste:" otherwise pasting won't work in dialogs since +that is the action that instructs them to paste something.) + +Menus are configured using the |:macmenu| command and the |:macaction| command +can be used to send action messages. + + *:maca* *:macaction* +:maca[ction] {action:} Send the message "action:" to the first responder. + The list of allowed actions can be seen by typing + :maca + An attempt to send an action not listed here will + result in an error. This list is specified in a + property list file called |Actions.plist|. + + *:macm* *:macmenu* +:macm[enu] {menu} {key}={arg} ... + Set Mac specific properties for {menu}. The + properties that can be set are: + action the action this menu sends + alt "yes" if alternate of previous menu + key the key equivalent of this menu + This command must be used in a startup file, for + example in "~/.gvimrc". It has no effect otherwise. + + For convenience, a menu with "action=name:" which is + bound to will act as if bound to + ":maca name:". Thus, if "Menu.Item" is given by + :an Menu.Item + :macm Menu.Item action=name: + then ":emenu Menu.Item" is equivalent to + ":maca name:". + + The key equivalent is specified with the + syntax. This is case-sensitive, so means Cmd-a + whereas means Cmd-Shift-a. + Note that key equivalents must contain the Cmd + modifier flag (), and they take precedence over + normal mappings. + Use the syntax "key=" to clear the key equivalent + of a menu. This can be used to free up a key + combination that is set in the system gvimrc so that + it may be mapped to using ":map". + + Recognised values of "alt" are "0", "no", "1", and + "yes". The default is "no". An alternate menu must + have the same key equivalent as the previous menu, + except the modifier flags must differ. The alternate + menu is by default hidden and only shows up when the + modifier is held down. + +Here are some examples on how to use these commands: + +1. Create a menu item with title "New Window" under the "File" menu, with key +equivalent Cmd-n, which opens a new window when selected: > + :an 10.290 File.New\ Window + :macm File.New\ Window action=newWindow: key= +2. Change the key equivalent to cycle through tabs to Cmd-Left/Right: > + :macm Window.Previous\ Tab key= + :macm Window.Next\ Tab key= +3. Create a mapping in normal mode which closes the current tab/window: > + :map :maca performClose: +4. Free up Cmd-t and remap it to open a file browser in a split view: > + macm File.New\ Tab key= + nmap :sp . +Note: These two lines must be added to .gvimrc else the first line will fail. +The second line is case sensitive, so (Cmd-Shift-t) is not the same as + (Cmd-t)! + +The default menus are set up in "$VIMRUNTIME/menu.vim". Take a look at that +file for more examples on how to set up menus. Note: When no window is open a +minimal default menu is used. The default menu is set up in MainMenu.nib +which resides in "Resources/English.lproj/" folder inside the app bundle. + + *Actions.plist* +Some action messages would not be suitable to call from within Vim, so there +is a dictionary called "Actions.plist" (in the Resources folder of the +application bundle) which contains all actions that may be called. The key in +this dictionary is the name of the action message (case sensitive), the value +is not used. + +Hint: The |:macaction| command supports command-line completion so you can +enter ":maca" to see a list of all available actions. + +Here is a random assortment of actions from Actions.plist which might be +useful. + +Action Description ~ +fileOpen: Show "File Open" dialog +findNext: Search forward using the "Find Pasteboard" +findPrevious: Search backward using the "Find Pasteboard" +fontSizeDown: Decrease font size +fontSizeUp: Increase font size +hide: Hide MacVim +miniaturizeAll: Minimize all windows to the dock +newWindow: Open a new (empty) window +orderFrontCharacterPalette: Show the the "Special Characters" dialog +orderFrontFontPanel: Show the Font panel +orderFrontPreferencePanel: Show the Preferences panel +performMiniaturize: Minimize window to the dock +performZoom: Zoom window (same as clicking the green blob) +terminate: Quit MacVim +zoomAll: Zoom all windows +_cycleWindows: Select next window (similar to ) +_cycleWindowsBackwards: Select previous window (similar to ) + +============================================================================== +6. Toolbar *macvim-toolbar* + +The toolbar in MacVim works just like in the other GUIs (see |gui-toolbar|), +with the addition of two separator items (see |menu-separator|). You can use +them as follows: > + :an ToolBar.-space1- + :an ToolBar.-flexspace2- +The first example creates an empty space on the toolbar, the second creates an +empty space which will shink or expand so that the items to the right of it +are right-aligned. A space (flexspace) will be created for any toolbar item +whose name begins with "-space" ("-flexspace") and ends with "-" + +Toolbar icons should be tiff, png or icns, of dimension 32x32 or 24x24 pixels. +The larger size is used when 'tbis' is "medium" or "large", otherwise the +smaller size is used (which is the default). If the icon file only contains +one dimension then Mac OS X will scale the icon to the appropriate dimension +if necessary. To avoid this, use a file format which supports multiple +resolutions (such as icns) and provide both 32x32 and 24x24 versions of the +icon. + +Note: Only a subset of the builtin toolbar items presently have icons. If no +icon can be found a warning triangle is displayed instead. + +============================================================================== +7. Dialogs *macvim-dialogs* + +Dialogs can be controlled with the keyboard in two ways. By default each +button in a dialog is bound to a key. The button that is highlighted by blue +is bound to Enter, any button with the title "Cancel" is bound to Escape, and +any button with the title "Don't Save" is bound to . Other buttons are +usually bound to the first letter in the title of the button. There is no +visual feedback to indicate which letter a button is bound to, so sometimes +some experimentation might be required in order to figure out which key to +press. + +The second way of controlling dialogs with the keyboard is to enable "Full +keyboard access" in the "Keyboard" pane of the System Preferences (you can +also toggle this on or off by pressing Ctrl-F7). Once keyboard access is +enabled it is possible to move between buttons with Tab and pressing Space to +select the current button. The current button is indicated with a blue +outline. + +============================================================================== +8. System services *macvim-services* + +MacVim supports two system services. These can be accessed from the MacVim +submenu in the Services menu or by right-clicking a selection. For services +to work, MacVim.app should be located in the /Applications folder. (You might +have to logout and then login again before Mac OS X detects the MacVim +services.) + +These are the currently supported services: + * New MacVim Buffer With Selection: Create a new buffer and paste the + currently selected text. + * New MacVim Buffer Here: Create a new buffer and set the current + directory to the file or folder that is selected in the Finder. + +The services respect the "Open files from applications" setting in the general +preferences. + +============================================================================== +9. mvim:// URL handler *mvim://* *macvim-url-handler* + +MacVim supports a custom URL handler for "mvim://" URLs. The handler is +supposed to be compatible to TextMate's URL scheme as documented at > + http://blog.macromates.com/2007/the-textmate-url-scheme/. + +Currently, this means that the format is > + mvim://open? +where "arguments" can be: + * url — the actual file to open (i.e. a file://... URL), if you leave + out this argument, the frontmost document is implied + * line — line number to go to (one based) + * column — column number to go to (one based) + +For example, the link > + mvim://open?url=file:///etc/profile&line=20 +will open the file /etc/profile on line 20 when clicked in a web browser. + +Note that url has to be a file:// url pointing to an existing local file. + +============================================================================== +10. Keyboard shortcuts *macvim-shortcuts* + +Most keyboard shortcuts in MacVim are bound to menu items and can be +discovered by looking through the menus (see |macvim-menus| on how to create +your own menu shortcuts, see |cmd-key| on how to map your own commands to +Cmd-key shortcuts). The remaining shortcuts are listed here: + + *Cmd-.* ** +Cmd-. Interrupt Vim. Unlike Ctrl-C which is sent as normal + keyboard input (and hence has to be received and then + interpreted) this sends a SIGINT signal to the Vim + process. Use this shortcut if the Vim process appears + to have locked up and is not responding to key presses. + This Cmd-key combination cannot be unmapped. + + *Cmd-`* ** +Cmd-` Cycle to the next window. On an American keyboard the + `-key is located under the Esc-key. On European + keyboards this key is often adjacent to the left + Shift-key and it may be not even be marked with "`". + This Cmd-key combination can only be unmapped via the + "Keyboard" System Preferences. + + *Cmd-Left* ** +Cmd-Left Move cursor to the beginning of the line + (see |cmd-movement|). + + *Cmd-Right* ** +Cmd-Right Move cursor to the end of the line (see |cmd-movement|). + + *Cmd-Up* ** +Cmd-Up Move cursor to the first line (see |cmd-movement|). + + *Cmd-Down* ** +Cmd-Down Move cursor to the last line (see |cmd-movement|). + + *Alt-Left* ** +Alt-Left Move cursor to the beginning of the previous word + (see |alt-movement|). + + *Alt-Right* ** +Alt-Right Move cursor to the beginning of the next word + (see |alt-movement|). + + *Alt-Up* ** +Alt-Up Move cursor one paragraph forward (see |alt-movement|). + + *Alt-Down* ** +Alt-Down Move cursor to the previous paragraph + (see |alt-movement|). + + *cmd-movement* *alt-movement* +The above mappings involving Cmd/Alt + arrow key are enabled by default in the +system gvimrc file "$VIM/gvimrc". You can quickly disable all of these by +adding the following lines to your "~/.vimrc" (not .gvimrc) file: > + if has("gui_macvim") + let macvim_skip_cmd_opt_movement = 1 + endif +Note: These are the only key mappings that MacVim makes (not counting menu key +equivalents which are not set up with :map). + +See |macvim-shift-movement| if you want Shift to select text when used in +conjunction with the above Cmd/Alt movement shortcuts. + + *cmd-key* *cmd-shortcuts* +Creating key mappings that involve the Cmd key ( in Vim notation) can +sometimes be slightly involved. Here are all the things you need to consider: + +- Make sure the shortcut is not used by a menu item by looking through the + menus. If it is then you need to unbind it before you can map to it. This + is described under the help for the |:macmenu| command. +- Bindings to are case sensitive: is not the same as . If + you want to map something to Cmd+Shift+d, then you need to use , not + or . +- Some command key shortcuts are reserved by Mac OS X and cannot be mapped to + (e.g. ). However, some of these shortcuts can be freed up in the + System Preferences under Keyboard (e.g. Cmd+Space). +- A few command key mappings are set up by MacVim, see |cmd-movement|. + +============================================================================== +11. Trackpad gestures *macvim-gestures* + +MacVim supports trackpad swipe gestures. By default this can be used to +navigate back/forward in the help (try it!). + +Each gesture generates one of the following Vim pseudo keys: + + ** ** + Generated when swiping three fingers across the trackpad in a + horizontal direction. The Apple Magic Mouse generates these + events when swiping two fingers in a horizontal direction. + + ** ** + Generated when swiping three fingers across the trackpad in a + vertical direction. (Not supported by the Apple Magic Mouse.) + +You can map these keys like with any other key using the |:map| family of +commands. For example, the following commands map left/right swipe to change +to the previous/next tab in normal mode: > + + nmap gT + nmap gt + +As another example, here is how to switch buffers by swiping left/right: > + + nmap :bN + nmap :bn + +See the section on |key-mapping| for more help on how to map keys. + +============================================================================== +12. International *macvim-international* + +When editing non-English text it may be convenient to keep separate keyboard +layouts for normal and insert mode. This is supported via the 'imd' option on +Mac OS X 10.5 or later (on 10.4 the 'imd' option support is not as useful as +it only switches between Roman and non-Roman input sources and it has been +known not to work very reliably). + +For example: When 'noimd' is enabled (i.e. IM is enabled) the input source is +saved when toggling between normal and insert mode, so you can use a US layout +in normal mode then switch to insert mode and choose a Swedish layout. When +you go back to normal mode the US layout will be selected and when you enter +insert mode the Swedish layout is selected. This also works when searching +for text etc. see 'imc', 'imi', 'ims'. + +Note that the layout used in normal mode is the layout used when 'noimd' is +set (i.e when IM is enabled). If you find that MacVim switches to the +wrong layout when going back to normal mode, then select the layout you want +to use in normal mode and type ":set imd" followed by ":set noimd". + +============================================================================== +13. Known bugs/missing features *macvim-todo* + +This list is by no means exhaustive, it only enumerates some of the more +prominent bugs/missing features. + +- Localized menus are not supported. Choosing anything but "English" in the + "International" pane of "System Prefences" may break the menus (and + toolbar). +- Some Unicode characters are not handled well (e.g. nonspacing marks) +- Sometimes multibyte characters look "too wide", i.e. they overlap the + following character. It might help to change 'ambiwidth', or override the + automatic font substitution by setting 'guifontwide' manually. +- Printing. As a temporary solution creates a PostScript file which is + then opened in Preview where it may be printed. +- The toolbar looks ugly and is not very useful. + +If you find new bugs then please post your findings to the vim_mac mailing +list: *vim_mac* > + http://groups.google.com/group/vim_mac + +This is also the best place for making feature requests as well as for asking +general questions about MacVim. + +============================================================================== +14. Hints *macvim-hints* + +In this section some general (not necessarily MacVim specific) hints are +given. + +Scenario: ~ +You try opening a bunch of files in tabs but not all files get opened in their +own tab. +Solution: ~ +To get around this, set 'tabpagemax' to something big in your .gvimrc file +(e.g. ":set tabpagemax=100"). + +Scenario: ~ +You want to open a file in a tab in an already opened window, but typing "mvim +filename" in Terminal opens it up in a separate window. +Solution: ~ +Use the |--remote-tab| switch. If you have several windows open you might +have to specify which window you want the file to open in by using the +|--servername| switch. The title of a window usually ends in something like +"VIM" or "VIM3" --- this is the server name of that window. So to open a file +named "foobar.txt" in a window whose title ends in "VIM3" you would type (the +order of the arguments matters): > + mvim --servername VIM3 --remote-tab foobar.txt +For more information, consult the |client-server| manual page. + +Scenario: ~ +You like to be able to select text by holding down shift and pressing the +arrow keys and find the Vim way of selecting text strange. +Solution: ~ +See |macvim-shift-movement|. + +Scenario: ~ +You do not want MacVim to set up any key mappings. +Solution: ~ +See |cmd-movement|. + +Scenario: ~ +Enabling localized menus breaks the toolbar and the menus as well. +Solution: ~ +This is a known problem, see |macvim-todo|. + +Scenario: ~ +When you click the (green) zoom button you want the window to maximize +horizontally as well as vertically. +Solution: ~ +Hold down Cmd and click the zoom button. If you prefer this to be the default +action, then set the user default MMZoomBoth (see |macvim-prefs|). + +Scenario: ~ +Typing feels sluggish when the cursor is just before a right bracket (i.e. +')', '}', or ']'). +Solution: ~ +Disable the "matchparen" plugin (see |matchparen|) by typing :NoMatchParen. +If that helps, then you can permanently disable "matchparen" by adding the +following line to your "~/.vimrc": > + let loaded_matchparen=1 +< +Scenario: ~ +You want to use MacVim as an editor for some external application. +Solution: ~ +If the external application lets you set a program to execute then something +like "mvim -f" might be all you need (the "-f" switch ensures that the "mvim" +script returns only after you close the editor window, otherwise "mvim" +returns immediately). If the external program honors the EDITOR environment +variable (e.g Git does this) then you may get away by adding the following +line to your "~/.profile": > + export EDITOR='mvim -f' +If you have not installed the "mvim" script in your path you can provide the +path to the Vim binary instead. Thus, if "MacVim.app" resides in the +Applications folder then you would use the following line: > + export EDITOR='/Applications/MacVim.app/Contents/MacOS/Vim -g -f' + +Scenario: ~ +You have set MacVim to open from an external program and when you finish +editing (by closing the MacVim window) you want the external program to regain +focus. +Solution: ~ +Use the VimLeave autocommand to hide MacVim when the window closes: > + au VimLeave * maca hide: +Assuming your external program has a setting for which command to execute to +bring up an editor, you would set that option to something like: > + mvim -f -c "au VimLeave * maca hide:" +(See the above Scenario for an explanation of the "-f" switch.) + +Scenario: ~ +You would like to remap Caps Lock to Esc. +Solution: ~ +The app "PCKeyboardHack" can be used to remap Caps Lock. It is available as a +free download from: > + http://pqrs.org/macosx/keyremap4macbook/extra.html +On some Apple keyboards the Caps Lock key doesn't immediately register and +this makes Caps Lock "drop" key presses. To work around this problem go into +the "Keyboard" System Preference and remap Caps Lock to Ctrl first (click the +"Modifier Keys..." button). This trick may also be necessary if the Caps Lock +light turns on/off despite having remapped to Esc. + +Scenario: ~ +You have problems creating custom mappings involving the Cmd key. +Solution: ~ +To bind to a key involving Cmd you use the "" syntax. Many Cmd-key +mappings are already used by the menus so if your mapping doesn't work then +the solution is usually to first unmap the menu binding (see |macvim-menus|, +in particular read the end of that section). Also see the section on +|macvim-shortcuts| for some Cmd-key combinations which are not used by the +menus but still need to be freed up before they can be used in custom bindings. + +Scenario: ~ +You can't find the information on MacVim you thought should be in this manual +page. +Solution: ~ +Post your question on the |vim_mac| mailing list and wait for an answer. + + vim:tw=78:sw=4:ts=8:ft=help:norl: diff --git a/runtime/doc/gui_x11.txt b/runtime/doc/gui_x11.txt index f085e2f2cb..0d7070eea0 100644 --- a/runtime/doc/gui_x11.txt +++ b/runtime/doc/gui_x11.txt @@ -40,6 +40,9 @@ The "-f" option runs Vim in the foreground. The "-b" option runs Vim in the background (this is the default). Also see |++opt| and |+cmd|. +Note: For technical reasons, MacVim always runs Vim in the foreground when +using :gui. + *gui-fork* When the GUI is started, it does a fork() and exits the current process. When gvim was started from a shell this makes the shell accept further @@ -52,12 +55,18 @@ When using "gvim -f" and then ":gui", Vim will run in the foreground. The "-f" argument will be remembered. To force running Vim in the background use ":gui -b". +MacVim supports forking only when you're launching Vim. "mvim" and +"mvim -f" work as expected: "mvim" launches the gui and forks, while "mvim -f" +launches the gui but doesn't fork (see |mvim|). However, doing |:gui| in an +already running vim will never fork in MacVim. + "gvim --nofork" does the same as "gvim -f". *E851* *E852* When starting the GUI fails Vim will try to continue running in the terminal. If you want the GUI to run in the foreground always, include the 'f' -flag in 'guioptions'. |-f|. +flag in 'guioptions'. |-f|. MacVim does not support this flag in +'guioptions'. ============================================================================== 2. GUI Resources *gui-resources* *.Xdefaults* diff --git a/runtime/doc/help.txt b/runtime/doc/help.txt index f13a5294ec..8c46c62799 100644 --- a/runtime/doc/help.txt +++ b/runtime/doc/help.txt @@ -155,6 +155,7 @@ GUI ~ |gui_w16.txt| Windows 3.1 GUI |gui_w32.txt| Win32 GUI |gui_x11.txt| X11 GUI +|gui_mac.txt| MacVim GUI Interfaces ~ |if_cscop.txt| using Cscope with Vim diff --git a/runtime/doc/index.txt b/runtime/doc/index.txt index cda17681fd..2d0eda42da 100644 --- a/runtime/doc/index.txt +++ b/runtime/doc/index.txt @@ -1334,6 +1334,8 @@ tag command action ~ |:lwindow| :lw[indow] open or close location window |:move| :m[ove] move lines |:mark| :ma[rk] set a mark +|:macation| :maca[ction] send action message +|:macmenu| :macm[enu] set Mac specific properties for menu item |:make| :mak[e] execute external command 'makeprg' and parse error messages |:map| :map show or enter a mapping diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index 90d4ca7a70..2ca782978d 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -709,16 +709,21 @@ A jump table for the options with a short description can be found at |Q_op|. escape sequence to request cursor position report. *'antialias'* *'anti'* *'noantialias'* *'noanti'* -'antialias' 'anti' boolean (default: off) +'antialias' 'anti' boolean (default off, on for MacVim) global {not in Vi} - {only available when compiled with GUI enabled - on Mac OS X} + {only available when compiled with GUI enabled on + Mac OS X} This option only has an effect in the GUI version of Vim on Mac OS X v10.2 or later. When on, Vim will use smooth ("antialiased") fonts, which can be easier to read at certain sizes on certain displays. - Setting this option can sometimes cause problems if 'guifont' is set - to its default (empty string). + + Setting this option in the Carbon version can sometimes cause problems + if 'guifont' is set to its default (empty string). + + Support for this option is not flawless in MacVim. In particular, + Monaco always seems to render not antialiased for point sizes up + to 10. The ATSUI renderer has better antialias support. *'autochdir'* *'acd'* *'noautochdir'* *'noacd'* 'autochdir' 'acd' boolean (default off) @@ -2605,8 +2610,8 @@ A jump table for the options with a short description can be found at |Q_op|. This option cannot be set from a |modeline|. It would most likely corrupt the text. - NOTE: For GTK+ 2 it is highly recommended to set 'encoding' to - "utf-8". Although care has been taken to allow different values of + NOTE: For MacVim and GTK+ 2 it is highly recommended to set 'encoding' + to "utf-8". Although care has been taken to allow different values of 'encoding', "utf-8" is the natural choice for the environment and avoids unnecessary conversion overhead. "utf-8" has not been made the default to prevent different behavior of the GUI and terminal @@ -3330,8 +3335,8 @@ A jump table for the options with a short description can be found at |Q_op|. modeline, see |sandbox-option|. That stops the option from working, since changing the buffer text is not allowed. - *'fsync'* *'fs'* -'fsync' 'fs' boolean (default on) + *'fsync'* *'fs'* *'nofsync'* *'nofs'* +'fsync' 'fs' boolean (default on) global {not in Vi} When on, the library function fsync() will be called after writing a @@ -3344,6 +3349,88 @@ A jump table for the options with a short description can be found at |Q_op|. off. Also see 'swapsync' for controlling fsync() on swap files. + *'fullscreen'* *'fu'* *'nofullscreen'* *'nofu'* +'fullscreen' 'fu' boolean (default off) + global + {not in Vi} + {only in MacVim GUI} + When this option is set, the whole screen is covered by Vim. Screen + decorations drawn by the operating system (such as the dock or the + menu bar) are hidden. Most of Vim's window chrome is hidden as well + (e.g. toolbar, title bar). The tab bar and scroll bars remain visible. + Updates to the window position are ignored in fullscreen mode. + + See 'fuoptions' for how Vim resizes and colors the background when + entering and leaving fullscreen mode. + + Note: Setting 'fullscreen' usually changes the size of the Vim + control. However, for technical reasons, 'lines' and 'columns' will + currently only be updated when Vim runs its event loop. As a + consequence, if you set 'fullscreen' and 'lines' or 'columns' in a + Vim script file, you should always set 'fullscreen' after setting + 'lines' and 'columns', else 'lines' and 'columns' will be overwritten + with the values 'fullscreen' sets after the script has been executed + and the event loop is ran again. + + XXX: Add fuenter/fuleave autocommands? You might want to display + a NERDTree or a Tlist only in fullscreen for example. Then again, this + could probably be in a sizechanged autocommand that triggers if the + size is above a certain threshold. + XXX: Think about how 'fullscreen' and 'transparency' should interact. + + *'fuoptions'* *'fuopt'* +'fuoptions' 'fuopt' string (default "maxvert,maxhorz") + global + {not in Vi} + {only in MacVim GUI} + In fullscreen mode, most of the screen is black, only a part of the + screen is covered by the actual Vim control. The control is centered. + This option controls the size of the Vim control as well as the color + of the unused screen area. + value effect ~ + maxvert When entering fullscreen, 'lines' is set to the maximum number + of lines fitting on the screen in fullscreen mode. When + leaving fullscreen, if 'lines' is still equal to the maximized + number of lines, it is restored to the value it had before + entering fullscreen. + maxhorz When entering fullscreen, 'columns' is set to the maximum number + of columns fitting on the screen in fullscreen mode. When + leaving fullscreen, if 'columns' is still equal to the maximized + number of columns, it is restored to the value it had before + entering fullscreen. + background:color + {not supported in Mac OS X native full screen} + When entering fullscreen, 'color' defines the color of the part + of the screen that is not occupied by the Vim control. If + 'color' is an 8-digit hexadecimal number preceded by '#', + it is interpreted as an explicit color value '#aarrggbb', with + one byte each for the alpha, red, green, and blue values. + Otherwise, 'color' is interpreted as a highlight group name, + and the fullscreen background is filled with that highlight + group's background color, as defined by the current color + scheme. + + Examples: + Don't change size when entering fullscreen: > + :set fuoptions= +< Only maximize vertically when entering fullscreen: > + :set fuoptions=maxvert +< Maximize only vertically when entering fullscreen, and color the + background dark blue: > + :set fuoptions=maxvert,background:#FF003042 +< Don't change size when entering fullscreen, and color the background + like the current text background: > + :set fuoptions=background:Normal +< + XXX: what if the font size is changed? you probably never want to + restore the old 'lines' or 'columns' in that case. + XXX: Each time the Vim window resizes (for example due to font size + changes, re-maximize Vim to fullscreen?) + XXX: The approach doesn't restore vertical Vim size if fu is entered + without tabs and leaves with tabs (or the other way round). + + + *'gdefault'* *'gd'* *'nogdefault'* *'nogd'* 'gdefault' 'gd' boolean (default off) global @@ -3512,6 +3599,9 @@ A jump table for the options with a short description can be found at |Q_op|. For Win32, GTK, Motif, Mac OS and Photon: > :set guifont=* < will bring up a font requester, where you can pick the font you want. + In MacVim ":set guifont=*" calls: > + :macaction orderFrontFontPanel: +< which is the same as choosing "Show Fonts..." from the main menu. The font name depends on the GUI used. See |setting-guifont| for a way to set 'guifont' for various systems. @@ -3525,12 +3615,15 @@ A jump table for the options with a short description can be found at |Q_op|. set guifontwide=Microsoft\ Yahei\ 12,WenQuanYi\ Zen\ Hei\ 12 endif < - For Mac OSX you can use something like this: > + For Mac OS X you can use something like this: > :set guifont=Monaco:h10 -< Also see 'macatsui', it can help fix display problems. +< Also see 'macatsui', it can help fix display problems {not in MacVim}. + In MacVim, fonts with spaces are set like this: > + :set guifont=DejaVu\ Sans\ Mono:h13 +< *E236* Note that the fonts must be mono-spaced (all characters have the same - width). An exception is GTK 2: all fonts are accepted, but + width). An exception is MacVim and GTK 2: all fonts are accepted, but mono-spaced fonts look best. To preview a font on X11, you might be able to use the "xfontsel" @@ -3594,7 +3687,7 @@ A jump table for the options with a short description can be found at |Q_op|. Note: The size of these fonts must be exactly twice as wide as the one specified with 'guifont' and the same height. - All GUI versions but GTK+ 2: + All GUI versions but MacVim and GTK+ 2: 'guifontwide' is only used when 'encoding' is set to "utf-8" and 'guifontset' is empty or invalid. @@ -3602,6 +3695,12 @@ A jump table for the options with a short description can be found at |Q_op|. 'guifontwide' is empty Vim will attempt to find a matching double-width font and set 'guifontwide' to it. + MacVim only: *guifontwide_macvim* + + MacVim performs automatic font substitution. If 'guifontwide' is set, + that font will be used for all wide fonts. However, if a glyph is + not available in the wide font, then font substitution is still used. + GTK+ 2 GUI only: *guifontwide_gtk2* If set and valid, 'guifontwide' is always used for double width @@ -3686,6 +3785,8 @@ A jump table for the options with a short description can be found at |Q_op|. foreground. |gui-fork| Note: Set this option in the vimrc file. The forking may have happened already when the |gvimrc| file is read. + MacVim does not support this flag due to limitations with + forking on Mac OS X. *'go-i'* 'i' Use a Vim icon. For GTK with KDE it is used in the left-upper corner of the window. It's black&white on non-GTK, because of @@ -3704,10 +3805,10 @@ A jump table for the options with a short description can be found at |Q_op|. Exception: Athena will always use grey menu items. *'go-t'* 't' Include tearoff menu items. Currently only works for Win32, - GTK+, and Motif 1.2 GUI. + GTK+ and Motif 1.2 GUI. *'go-T'* - 'T' Include Toolbar. Currently only in Win32, GTK+, Motif, Photon - and Athena GUIs. + 'T' Include Toolbar. Currently only in Win32, GTK+, Motif, + Photon, MacVim and Athena GUIs. *'go-r'* 'r' Right-hand scrollbar is always present. *'go-R'* @@ -4098,11 +4199,12 @@ A jump table for the options with a short description can be found at |Q_op|. global {not in Vi} {only available when compiled with the |+xim|, - |+multi_byte_ime| or |global-ime| features} + |+multi_byte_ime| or |global-ime| features, always + available in MacVim} When set the Input Method is never used. This is useful to disable the IM when it doesn't work properly. - Currently this option is on by default for SGI/IRIX machines. This - may change in later releases. + Currently this option is on by default for SGI/IRIX. This may change + in later releases. *'iminsert'* *'imi'* 'iminsert' 'imi' number (default 0, 2 when an input method is supported) @@ -4747,7 +4849,7 @@ A jump table for the options with a short description can be found at |Q_op|. *'macatsui'* *'nomacatsui'* 'macatsui' boolean (default on) global - {only available in Mac GUI version} + {only available in Mac Carbon GUI version} This is a workaround for when drawing doesn't work properly. When set and compiled with multi-byte support ATSUI text drawing is used. When not set ATSUI text drawing is not used. Switch this option off when @@ -4759,6 +4861,19 @@ A jump table for the options with a short description can be found at |Q_op|. endif < Another option to check if you have drawing problems is 'termencoding'. + Note: MacVim does not use this option. + + *'macmeta'* *'mmta'* *'nomacmeta'* *'nommta'* +'macmeta' boolean (default off) + local to buffer + {only available in MacVim GUI} + Use option (alt) as meta key. When on, option-key presses are not + interpreted, thus enabling bindings to . When off, option-key + presses are interpreted by the selected input method and inserted as + text. + Note: Some keys (e.g. , , , ) can be + bound with the Meta flag even when this option is disabled, but this + is not the case for the majority of keys (e.g. , ). *'magic'* *'nomagic'* 'magic' boolean (default on) @@ -5759,7 +5874,7 @@ A jump table for the options with a short description can be found at |Q_op|. < *'runtimepath'* *'rtp'* *vimfiles* 'runtimepath' 'rtp' string (default: - Unix: "$HOME/.vim, + Unix, Mac OS X: "$HOME/.vim, $VIM/vimfiles, $VIMRUNTIME, $VIM/vimfiles/after, @@ -5774,7 +5889,7 @@ A jump table for the options with a short description can be found at |Q_op|. $VIMRUNTIME, $VIM/vimfiles/after, $HOME/vimfiles/after" - Macintosh: "$VIM:vimfiles, + Macintosh (pre-OS X): "$VIM:vimfiles, $VIMRUNTIME, $VIM:vimfiles:after" RISC-OS: "Choices:vimfiles, @@ -7209,8 +7324,9 @@ A jump table for the options with a short description can be found at |Q_op|. For further details see |arabic.txt|. *'termencoding'* *'tenc'* -'termencoding' 'tenc' string (default ""; with GTK+ 2 GUI: "utf-8"; with - Macintosh GUI: "macroman") +'termencoding' 'tenc' string (default "" + with GTK+ 2 and MacVim GUIs: "utf-8" + with Macintosh (Carbon) GUI: "macroman") global {only available when compiled with the |+multi_byte| feature} @@ -7219,14 +7335,14 @@ A jump table for the options with a short description can be found at |Q_op|. encoding the keyboard produces and the display will understand. For the GUI it only applies to the keyboard ( 'encoding' is used for the display). Except for the Mac when 'macatsui' is off, then - 'termencoding' should be "macroman". + 'termencoding' should be "macroman" (for the Carbon GUI). In the Win32 console version the default value is the console codepage when it differs from the ANSI codepage. *E617* - Note: This does not apply to the GTK+ 2 GUI. After the GUI has been - successfully initialized, 'termencoding' is forcibly set to "utf-8". - Any attempts to set a different value will be rejected, and an error - message is shown. + Note: This does not apply to the GTK+ 2 and MacVim GUIs. After the + GUI has been successfully initialized, 'termencoding' is forcibly set + to "utf-8". Any attempts to set a different value will be rejected, + and an error message is shown. For the Win32 GUI 'termencoding' is not used for typed characters, because the Win32 system always passes Unicode characters. When empty, the same encoding is used as for the 'encoding' option. @@ -7463,8 +7579,8 @@ A jump table for the options with a short description can be found at |Q_op|. *'toolbar'* *'tb'* 'toolbar' 'tb' string (default "icons,tooltips") global - {only for |+GUI_GTK|, |+GUI_Athena|, |+GUI_Motif| and - |+GUI_Photon|} + {only for |+GUI_GTK|, |+GUI_Athena|, |+GUI_Motif|, + |+GUI_Photon| and |gui_macvim|} The contents of this option controls various toolbar settings. The possible values are: icons Toolbar buttons are shown with icons. @@ -7474,6 +7590,7 @@ A jump table for the options with a short description can be found at |Q_op|. tooltips Tooltips are active for toolbar buttons. Tooltips refer to the popup help text which appears after the mouse cursor is placed over a toolbar button for a brief moment. + Note: Tooltips are always enabled in MacVim. If you want the toolbar to be shown with icons as well as text, do the following: > @@ -7491,7 +7608,7 @@ A jump table for the options with a short description can be found at |Q_op|. 'toolbariconsize' 'tbis' string (default "small") global {not in Vi} - {only in the GTK+ 2 GUI} + {only in the GTK+ 2 and MacVim GUIs} Controls the size of toolbar icons. The possible values are: tiny Use tiny toolbar icons. small Use small toolbar icons (default). @@ -7499,11 +7616,21 @@ A jump table for the options with a short description can be found at |Q_op|. large Use large toolbar icons. The exact dimensions in pixels of the various icon sizes depend on the current theme. Common dimensions are large=32x32, medium=24x24, - small=20x20 and tiny=16x16. + small=20x20 and tiny=16x16. In MacVim, both tiny and small equal + 24x24, whereas medium and large equal 32x32. If 'toolbariconsize' is empty, the global default size as determined by user preferences or the current theme is used. + *'transparency'* *'transp'* +'transparency' 'transp' number (default 0) + global + {not in Vi} + {only in MacVim GUI} + Transparency of the window background as a percent, with 0 meaning + opaque and 100 meaning completely transparent. Trying to set a value + outside the range 0-100 results in an error. + *'ttybuiltin'* *'tbi'* *'nottybuiltin'* *'notbi'* 'ttybuiltin' 'tbi' boolean (default on) global diff --git a/runtime/doc/os_mac.txt b/runtime/doc/os_mac.txt index 9ed23b4ae1..028b3c98a0 100644 --- a/runtime/doc/os_mac.txt +++ b/runtime/doc/os_mac.txt @@ -6,9 +6,13 @@ *mac* *Mac* *macintosh* *Macintosh* -This file documents the particularities of the Macintosh version of Vim. +This file documents the particularities of the Mac version of Vim. It was +written with the older Carbon version of Vim in mind. If you are using the +newer MacVim.app then please go to |macvim|. Some of the information here +does not apply to MacVim.app. -NOTE: This file is a bit outdated. You might find more useful info here: +NOTE: This file is a bit outdated. You might find more useful info on the old +Carbon version of Vim here: http://macvim.org/ 1. Filename Convention |mac-filename| diff --git a/runtime/doc/quickref.txt b/runtime/doc/quickref.txt index 79d87fa915..e26bd8558b 100644 --- a/runtime/doc/quickref.txt +++ b/runtime/doc/quickref.txt @@ -715,6 +715,8 @@ Short explanation of each option: *option-list* 'formatprg' 'fp' name of external program used with "gq" command 'formatexpr' 'fex' expression used with "gq" command 'fsync' 'fs' whether to invoke fsync() after file write +'fullscreen' 'fu' let vim cover the whole screen (MacVim only) +'fuoptions' 'fuopt' controls how 'fullscreen' behaves (MacVim only) 'gdefault' 'gd' the ":substitute" flag 'g' is default on 'grepformat' 'gfm' format of 'grepprg' output 'grepprg' 'gp' program to use for ":grep" @@ -775,6 +777,7 @@ Short explanation of each option: *option-list* 'listchars' 'lcs' characters for displaying in list mode 'loadplugins' 'lpl' load plugin scripts when starting up 'macatsui' Mac GUI: use ATSUI text drawing +'macmeta' 'mmta' use option as meta key (MacVim GUI only) 'magic' changes special characters in search patterns 'makeef' 'mef' name of the errorfile for ":make" 'makeprg' 'mp' program to use for the ":make" command @@ -915,7 +918,8 @@ Short explanation of each option: *option-list* 'titleold' old title, restored when exiting 'titlestring' string to use for the Vim window title 'toolbar' 'tb' GUI: which items to show in the toolbar -'toolbariconsize' 'tbis' size of the toolbar icons (for GTK 2 only) +'toolbariconsize' 'tbis' size of the toolbar icons (MacVim and GTK 2 only) +'transparency' 'transp' transparency of the GUI window (MacVim only) 'ttimeout' time out on mappings 'ttimeoutlen' 'ttm' time out time for key codes in milliseconds 'ttybuiltin' 'tbi' use built-in termcap before external termcap diff --git a/runtime/doc/remote.txt b/runtime/doc/remote.txt index 327258fa87..b465ac32b9 100644 --- a/runtime/doc/remote.txt +++ b/runtime/doc/remote.txt @@ -9,6 +9,7 @@ Vim client-server communication *client-server* 1. Common functionality |clientserver| 2. X11 specific items |x11-clientserver| 3. MS-Windows specific items |w32-clientserver| +4. MacVim specific items |macvim-clientserver| {Vi does not have any of these commands} @@ -201,4 +202,23 @@ When using gvim, the --remote-wait only works properly this way: > start /w gvim --remote-wait file.txt < +============================================================================== +4. MacVim specific items *macvim-clientserver* + +MacVim uses distributed objects for interprocess communication. A server +listens to a named port for new connections, and clients connect to this port +to send messages. Server listings are made possible by the frontend (MacVim) +keeping a list of all currently running servers. Thus, servers are not aware +of each other directly; only MacVim knows which servers are running. + +A client is any object which implements the MMVimClientProtocol (see +MacVim.h). Take a look at MMBackend if you wish to implement this protocol in +your own application. The current implementation assumes that the +NSConnections use mach ports for interprocess communication. This means that +you can only use Vim's client/server feature on a local machine (and not +across a network). + +Note: Client mode always works, but server mode only works when the GUI is +started. + vim:tw=78:sw=4:ts=8:ft=help:norl: diff --git a/runtime/doc/starting.txt b/runtime/doc/starting.txt index 773a3b9125..cb7de32dfe 100644 --- a/runtime/doc/starting.txt +++ b/runtime/doc/starting.txt @@ -795,7 +795,8 @@ accordingly. Vim proceeds in this order: Note that this file is ALWAYS read in 'compatible' mode, since the automatic resetting of 'compatible' is only done later. Add a ":set nocp" command if you like. - For the Macintosh the $VIMRUNTIME/macmap.vim is read. + For the Macintosh the $VIMRUNTIME/macmap.vim is read (not on + MacVim.app, this only applies to the older Carbon version). *VIMINIT* *.vimrc* *_vimrc* *EXINIT* *.exrc* *_exrc* *$MYVIMRC* c. Four places are searched for initializations. The first that exists diff --git a/runtime/doc/syntax.txt b/runtime/doc/syntax.txt index 35ea3ad7bc..c868c745be 100644 --- a/runtime/doc/syntax.txt +++ b/runtime/doc/syntax.txt @@ -4696,8 +4696,8 @@ guisp={color-name} *highlight-guisp* Black White Orange Purple Violet - In the Win32 GUI version, additional system colors are available. See - |win32-colors|. + In the Win32 and MacVim GUI versions, additional system colors are + available. See |win32-colors| and |macvim-colors| respectively. You can also specify a color by its Red, Green and Blue values. The format is "#rrggbb", where diff --git a/runtime/doc/tags b/runtime/doc/tags index 5c454c12a4..c2deea1504 100644 --- a/runtime/doc/tags +++ b/runtime/doc/tags @@ -275,6 +275,10 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME* 'fs' options.txt /*'fs'* 'fsync' options.txt /*'fsync'* 'ft' options.txt /*'ft'* +'fu' options.txt /*'fu'* +'fullscreen' options.txt /*'fullscreen'* +'fuopt' options.txt /*'fuopt'* +'fuoptions' options.txt /*'fuoptions'* 'gcr' options.txt /*'gcr'* 'gd' options.txt /*'gd'* 'gdefault' options.txt /*'gdefault'* @@ -413,6 +417,7 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME* 'lz' options.txt /*'lz'* 'ma' options.txt /*'ma'* 'macatsui' options.txt /*'macatsui'* +'macmeta' options.txt /*'macmeta'* 'magic' options.txt /*'magic'* 'makeef' options.txt /*'makeef'* 'makeprg' options.txt /*'makeprg'* @@ -439,6 +444,7 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME* 'mmd' options.txt /*'mmd'* 'mmp' options.txt /*'mmp'* 'mmt' options.txt /*'mmt'* +'mmta' options.txt /*'mmta'* 'mod' options.txt /*'mod'* 'modeline' options.txt /*'modeline'* 'modelines' options.txt /*'modelines'* @@ -541,6 +547,10 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME* 'nofk' options.txt /*'nofk'* 'nofkmap' options.txt /*'nofkmap'* 'nofoldenable' options.txt /*'nofoldenable'* +'nofs' options.txt /*'nofs'* +'nofsync' options.txt /*'nofsync'* +'nofu' options.txt /*'nofu'* +'nofullscreen' options.txt /*'nofullscreen'* 'nogd' options.txt /*'nogd'* 'nogdefault' options.txt /*'nogdefault'* 'noguipty' options.txt /*'noguipty'* @@ -577,9 +587,11 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME* 'nolz' options.txt /*'nolz'* 'noma' options.txt /*'noma'* 'nomacatsui' options.txt /*'nomacatsui'* +'nomacmeta' options.txt /*'nomacmeta'* 'nomagic' options.txt /*'nomagic'* 'nomh' options.txt /*'nomh'* 'noml' options.txt /*'noml'* +'nommta' options.txt /*'nommta'* 'nomod' options.txt /*'nomod'* 'nomodeline' options.txt /*'nomodeline'* 'nomodifiable' options.txt /*'nomodifiable'* @@ -1034,6 +1046,8 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME* 'top' options.txt /*'top'* 'tpm' options.txt /*'tpm'* 'tr' options.txt /*'tr'* +'transp' options.txt /*'transp'* +'transparency' options.txt /*'transparency'* 'ts' options.txt /*'ts'* 'tsl' options.txt /*'tsl'* 'tsr' options.txt /*'tsr'* @@ -1184,6 +1198,7 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME* +folding various.txt /*+folding* +footer various.txt /*+footer* +fork various.txt /*+fork* ++fullscreen various.txt /*+fullscreen* +gettext various.txt /*+gettext* +hangul_input various.txt /*+hangul_input* +iconv various.txt /*+iconv* @@ -1219,6 +1234,7 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME* +mzscheme various.txt /*+mzscheme* +mzscheme/dyn various.txt /*+mzscheme\/dyn* +netbeans_intg various.txt /*+netbeans_intg* ++odbeditor various.txt /*+odbeditor* +ole various.txt /*+ole* +path_extra various.txt /*+path_extra* +perl various.txt /*+perl* @@ -1256,6 +1272,7 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME* +tgetent various.txt /*+tgetent* +title various.txt /*+title* +toolbar various.txt /*+toolbar* ++transparency various.txt /*+transparency* +user_commands various.txt /*+user_commands* +vertsplit various.txt /*+vertsplit* +viminfo various.txt /*+viminfo* @@ -2431,6 +2448,10 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME* :lwindow quickfix.txt /*:lwindow* :m change.txt /*:m* :ma motion.txt /*:ma* +:maca gui_mac.txt /*:maca* +:macaction gui_mac.txt /*:macaction* +:macm gui_mac.txt /*:macm* +:macmenu gui_mac.txt /*:macmenu* :mak quickfix.txt /*:mak* :make quickfix.txt /*:make* :make_makeprg quickfix.txt /*:make_makeprg* @@ -3130,6 +3151,12 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME* map.txt /** map.txt /** gui_mac.txt /** + gui_mac.txt /** + gui_mac.txt /** + gui_mac.txt /** + gui_mac.txt /** + gui_mac.txt /** change.txt /** motion.txt /** change.txt /** @@ -3166,6 +3193,10 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME* visual.txt /** map.txt /** gui_mac.txt /** + gui_mac.txt /** + gui_mac.txt /** + gui_mac.txt /** term.txt /** change.txt /** term.txt /** @@ -3222,6 +3253,10 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME* scroll.txt /** scroll.txt /** motion.txt /** + gui_mac.txt /** + gui_mac.txt /** + gui_mac.txt /** + gui_mac.txt /** motion.txt /** undo.txt /** motion.txt /** @@ -3304,7 +3339,12 @@ A insert.txt /*A* ACL editing.txt /*ACL* ATTENTION usr_11.txt /*ATTENTION* Abbreviations map.txt /*Abbreviations* +Actions.plist gui_mac.txt /*Actions.plist* Aleph options.txt /*Aleph* +Alt-Down gui_mac.txt /*Alt-Down* +Alt-Left gui_mac.txt /*Alt-Left* +Alt-Right gui_mac.txt /*Alt-Right* +Alt-Up gui_mac.txt /*Alt-Up* Amiga os_amiga.txt /*Amiga* Arabic arabic.txt /*Arabic* Atari os_mint.txt /*Atari* @@ -3450,12 +3490,19 @@ CTRL-] tagsrch.txt /*CTRL-]* CTRL-^ editing.txt /*CTRL-^* CTRL-{char} intro.txt /*CTRL-{char}* Chinese mbyte.txt /*Chinese* +Cmd-. gui_mac.txt /*Cmd-.* +Cmd-Down gui_mac.txt /*Cmd-Down* +Cmd-Left gui_mac.txt /*Cmd-Left* +Cmd-Right gui_mac.txt /*Cmd-Right* +Cmd-Up gui_mac.txt /*Cmd-Up* +Cmd-` gui_mac.txt /*Cmd-`* Cmd-event autocmd.txt /*Cmd-event* Cmdline cmdline.txt /*Cmdline* Cmdline-mode cmdline.txt /*Cmdline-mode* CmdwinEnter autocmd.txt /*CmdwinEnter* CmdwinLeave autocmd.txt /*CmdwinLeave* ColorScheme autocmd.txt /*ColorScheme* +Colors.plist gui_mac.txt /*Colors.plist* Command-line cmdline.txt /*Command-line* Command-line-mode cmdline.txt /*Command-line-mode* CompleteDone autocmd.txt /*CompleteDone* @@ -4513,6 +4560,7 @@ QuickFixCmdPost autocmd.txt /*QuickFixCmdPost* QuickFixCmdPost-example quickfix.txt /*QuickFixCmdPost-example* QuickFixCmdPre autocmd.txt /*QuickFixCmdPre* Quickfix quickfix.txt /*Quickfix* +Quickstart gui_mac.txt /*Quickstart* QuitPre autocmd.txt /*QuitPre* R change.txt /*R* RISC-OS os_risc.txt /*RISC-OS* @@ -4542,6 +4590,7 @@ StdinReadPost autocmd.txt /*StdinReadPost* StdinReadPre autocmd.txt /*StdinReadPre* SwapExists autocmd.txt /*SwapExists* Syntax autocmd.txt /*Syntax* +SystemColors.plist gui_mac.txt /*SystemColors.plist* T motion.txt /*T* TCL if_tcl.txt /*TCL* TERM starting.txt /*TERM* @@ -4786,6 +4835,7 @@ after-directory options.txt /*after-directory* aleph options.txt /*aleph* alt intro.txt /*alt* alt-input debugger.txt /*alt-input* +alt-movement gui_mac.txt /*alt-movement* alternate-file editing.txt /*alternate-file* amiga-window starting.txt /*amiga-window* and() eval.txt /*and()* @@ -5122,6 +5172,9 @@ clipboard-html options.txt /*clipboard-html* clipboard-unnamed options.txt /*clipboard-unnamed* clipboard-unnamedplus options.txt /*clipboard-unnamedplus* clojure-indent indent.txt /*clojure-indent* +cmd-key gui_mac.txt /*cmd-key* +cmd-movement gui_mac.txt /*cmd-movement* +cmd-shortcuts gui_mac.txt /*cmd-shortcuts* cmdarg-variable eval.txt /*cmdarg-variable* cmdbang-variable eval.txt /*cmdbang-variable* cmdline-arguments vi_diff.txt /*cmdline-arguments* @@ -5614,6 +5667,7 @@ exrc starting.txt /*exrc* extend() eval.txt /*extend()* extension-removal cmdline.txt /*extension-removal* extensions-improvements todo.txt /*extensions-improvements* +external-editor gui_mac.txt /*external-editor* f motion.txt /*f* faq intro.txt /*faq* farsi farsi.txt /*farsi* @@ -6234,6 +6288,7 @@ gui-gtk-socketid gui_x11.txt /*gui-gtk-socketid* gui-horiz-scroll gui.txt /*gui-horiz-scroll* gui-init gui.txt /*gui-init* gui-kde gui_x11.txt /*gui-kde* +gui-macvim gui_mac.txt /*gui-macvim* gui-mouse gui.txt /*gui-mouse* gui-mouse-focus gui.txt /*gui-mouse-focus* gui-mouse-mapping gui.txt /*gui-mouse-mapping* @@ -6274,10 +6329,12 @@ gui-x11-printing gui_x11.txt /*gui-x11-printing* gui-x11-start gui_x11.txt /*gui-x11-start* gui-x11-various gui_x11.txt /*gui-x11-various* gui.txt gui.txt /*gui.txt* +gui_mac.txt gui_mac.txt /*gui_mac.txt* gui_w16.txt gui_w16.txt /*gui_w16.txt* gui_w32.txt gui_w32.txt /*gui_w32.txt* gui_x11.txt gui_x11.txt /*gui_x11.txt* guifontwide_gtk2 options.txt /*guifontwide_gtk2* +guifontwide_macvim options.txt /*guifontwide_macvim* guifontwide_win_mbyte options.txt /*guifontwide_win_mbyte* guioptions_a options.txt /*guioptions_a* guu change.txt /*guu* @@ -6311,7 +6368,6 @@ hebrew.txt hebrew.txt /*hebrew.txt* help helphelp.txt /*help* help-context help.txt /*help-context* help-summary usr_02.txt /*help-summary* -help-tags tags 1 help-translated helphelp.txt /*help-translated* help-writing helphelp.txt /*help-writing* help-xterm-window helphelp.txt /*help-xterm-window* @@ -6778,6 +6834,38 @@ mac-lack os_mac.txt /*mac-lack* mac-vimfile os_mac.txt /*mac-vimfile* macintosh os_mac.txt /*macintosh* macro map.txt /*macro* +macvim gui_mac.txt /*macvim* +macvim-backspace gui_mac.txt /*macvim-backspace* +macvim-clientserver remote.txt /*macvim-clientserver* +macvim-colors gui_mac.txt /*macvim-colors* +macvim-colorscheme gui_mac.txt /*macvim-colorscheme* +macvim-commands gui_mac.txt /*macvim-commands* +macvim-default-menu gui_mac.txt /*macvim-default-menu* +macvim-delete gui_mac.txt /*macvim-delete* +macvim-dialogs gui_mac.txt /*macvim-dialogs* +macvim-differences gui_mac.txt /*macvim-differences* +macvim-drag-n-drop gui_mac.txt /*macvim-drag-n-drop* +macvim-encoding gui_mac.txt /*macvim-encoding* +macvim-find gui_mac.txt /*macvim-find* +macvim-gestures gui_mac.txt /*macvim-gestures* +macvim-hints gui_mac.txt /*macvim-hints* +macvim-international gui_mac.txt /*macvim-international* +macvim-login-shell gui_mac.txt /*macvim-login-shell* +macvim-menus gui_mac.txt /*macvim-menus* +macvim-options gui_mac.txt /*macvim-options* +macvim-preferences gui_mac.txt /*macvim-preferences* +macvim-prefs gui_mac.txt /*macvim-prefs* +macvim-services gui_mac.txt /*macvim-services* +macvim-shift-movement gui_mac.txt /*macvim-shift-movement* +macvim-shortcuts gui_mac.txt /*macvim-shortcuts* +macvim-start gui_mac.txt /*macvim-start* +macvim-tablabel gui_mac.txt /*macvim-tablabel* +macvim-todo gui_mac.txt /*macvim-todo* +macvim-toolbar gui_mac.txt /*macvim-toolbar* +macvim-url-handler gui_mac.txt /*macvim-url-handler* +macvim-user-defaults gui_mac.txt /*macvim-user-defaults* +macvim-window-title gui_mac.txt /*macvim-window-title* +macvim-windows gui_mac.txt /*macvim-windows* mail-list intro.txt /*mail-list* mail.vim syntax.txt /*mail.vim* maillist intro.txt /*maillist* @@ -6925,6 +7013,8 @@ multilang mlang.txt /*multilang* multilang-menus mlang.txt /*multilang-menus* multilang-messages mlang.txt /*multilang-messages* multilang-scripts mlang.txt /*multilang-scripts* +mvim gui_mac.txt /*mvim* +mvim:// gui_mac.txt /*mvim:\/\/* myfiletypefile syntax.txt /*myfiletypefile* myscriptsfile syntax.txt /*myscriptsfile* mysql ft_sql.txt /*mysql* @@ -7279,6 +7369,7 @@ ocaml.vim syntax.txt /*ocaml.vim* octal eval.txt /*octal* octal-nrformats options.txt /*octal-nrformats* octal-number eval.txt /*octal-number* +odbeditor gui_mac.txt /*odbeditor* oldfiles-variable eval.txt /*oldfiles-variable* ole-activation if_ole.txt /*ole-activation* ole-eval if_ole.txt /*ole-eval* @@ -8637,6 +8728,7 @@ vim-variable eval.txt /*vim-variable* vim.vim syntax.txt /*vim.vim* vim7 version7.txt /*vim7* vim: options.txt /*vim:* +vim_mac gui_mac.txt /*vim_mac* vimball pi_vimball.txt /*vimball* vimball-contents pi_vimball.txt /*vimball-contents* vimball-extract pi_vimball.txt /*vimball-extract* diff --git a/runtime/doc/various.txt b/runtime/doc/various.txt index b264e5be8c..2bdfeeb73a 100644 --- a/runtime/doc/various.txt +++ b/runtime/doc/various.txt @@ -351,6 +351,7 @@ N *+folding* |folding| *+footer* |gui-footer| *+fork* Unix only: |fork| shell commands *+float* Floating point support +m *+fullscreen* MacVim only: edit in full-screen N *+gettext* message translations |multi-lang| *+GUI_Athena* Unix only: Athena |GUI| *+GUI_neXtaw* Unix only: neXtaw |GUI| @@ -392,6 +393,7 @@ N *+multi_lang* non-English language support |multi-lang| m *+mzscheme* Mzscheme interface |mzscheme| m *+mzscheme/dyn* Mzscheme interface |mzscheme-dynamic| |/dyn| m *+netbeans_intg* |netbeans| +m *+odbeditor* MacVim only: ODB Editor Protocol support |odbeditor| m *+ole* Win32 GUI only: |ole-interface| N *+path_extra* Up/downwards search in 'path' and 'tags' m *+perl* Perl interface |perl| @@ -431,6 +433,7 @@ N *+textobjects* |text-objects| selection *+tgetent* non-Unix only: able to use external termcap N *+title* Setting the window 'title' and 'icon' N *+toolbar* |gui-toolbar| +m *+transparency* MacVim only: window background transparency N *+user_commands* User-defined commands. |user-commands| N *+viminfo* |'viminfo'| N *+vertsplit* Vertically split windows |:vsplit| diff --git a/runtime/doc/version7.txt b/runtime/doc/version7.txt index 1bff5b5da9..fe9b9dd0e0 100644 --- a/runtime/doc/version7.txt +++ b/runtime/doc/version7.txt @@ -1203,6 +1203,8 @@ goes from 2.2 to 2.3. (Gordon Prieur) Mac: When starting up Vim will load the $VIMRUNTIME/macmap.vim script to define default command-key mappings. (mostly by Benji Fisher) +This only applies to the older Carbon version of Vim, MacVim.app does not +source this file. Mac: Add the selection type to the clipboard, so that Block, line and character selections can be used between two Vims. (Eckehard Berns) diff --git a/runtime/ftplugin/help.vim b/runtime/ftplugin/help.vim index a0a0f292eb..0a4e6fa4fb 100644 --- a/runtime/ftplugin/help.vim +++ b/runtime/ftplugin/help.vim @@ -18,5 +18,11 @@ if has("conceal") setlocal cole=2 cocu=nc endif +if has("gui_macvim") + " Use swipe gesture to navigate back/forward + nmap :po + nmap :ta +endif + let &cpo = s:cpo_save unlet s:cpo_save diff --git a/runtime/menu.vim b/runtime/menu.vim index 5c5bb97208..7b2be977fc 100644 --- a/runtime/menu.vim +++ b/runtime/menu.vim @@ -17,7 +17,7 @@ if !exists("did_install_default_menus") let did_install_default_menus = 1 -if exists("v:lang") || &langmenu != "" +if (exists("v:lang") || &langmenu != "") " Try to find a menu translation file for the current language. if &langmenu != "" if &langmenu =~ "none" @@ -67,7 +67,27 @@ if exists("v:lang") || &langmenu != "" endif +" MacVim Window menu (should be next to Help so give it a high priority) +if has("gui_macvim") + an 9998.300 Window.Minimize + an 9998.301 Window.Minimize\ All + an 9998.310 Window.Zoom + an 9998.311 Window.Zoom\ All + an 9998.320 Window.Toggle\ Full\ Screen\ Mode :set invfullscreen + an 9998.330 Window.-SEP1- + " TODO! Grey out if no tabs are visible. + an 9998.340 Window.Select\ Next\ Tab :tabnext + an 9998.350 Window.Select\ Previous\ Tab :tabprevious + an 9998.360 Window.-SEP2- + an 9998.370 Window.Bring\ All\ To\ Front +endif + " Help menu +if has("gui_macvim") + an 9999.1 &Help.MacVim\ Help :h gui_mac + an 9999.2 Help.MacVim\ Website + an 9999.3 &Help.-sep0- +endif an 9999.10 &Help.&Overview :help an 9999.20 &Help.&User\ Manual :help usr_toc an 9999.30 &Help.&How-to\ links :help how-to @@ -96,16 +116,32 @@ fun! s:Helpfind() endfun " File menu -an 10.310 &File.&Open\.\.\.:e :browse confirm e +if has("gui_macvim") + an 10.290 &File.New\ Window + an 10.295 &File.New\ Tab :tabnew + an 10.310 &File.Open\.\.\. + an 10.325 &File.Open\ Recent + an 10.328 &File.-SEP0- + an 10.330 &File.Close\ Window:qa :conf qa + an 10.332 &File.Close :conf q + an 10.341 &File.Save\ All :browse conf wa + an 10.350 &File.Save\ As\.\.\.:sav :browse confirm saveas +else +endif +if !has("gui_macvim") + an 10.310 &File.&Open\.\.\.:e :browse confirm e +endif an 10.320 &File.Sp&lit-Open\.\.\.:sp :browse sp an 10.320 &File.Open\ Tab\.\.\.:tabnew :browse tabnew -an 10.325 &File.&New:enew :confirm enew -an 10.330 &File.&Close:close +if !has("gui_macvim") + an 10.325 &File.&New:enew :confirm enew + an 10.330 &File.&Close:close \ :if winheight(2) < 0 && tabpagewinnr(2) == 0 \ confirm enew \ else \ confirm close \ endif +endif an 10.335 &File.-SEP1- an 10.340 &File.&Save:w :if expand("%") == ""browse confirm welseconfirm wendif an 10.350 &File.Save\ &As\.\.\.:sav :browse confirm saveas @@ -127,9 +163,11 @@ elseif has("unix") vunmenu &File.&Print vnoremenu &File.&Print :w !lpr endif -an 10.600 &File.-SEP4- -an 10.610 &File.Sa&ve-Exit:wqa :confirm wqa -an 10.620 &File.E&xit:qa :confirm qa +if !has("gui_macvim") + an 10.600 &File.-SEP4- + an 10.610 &File.Sa&ve-Exit:wqa :confirm wqa + an 10.620 &File.E&xit:qa :confirm qa +endif func! SelectAll() exe "norm! gg" . (&slm == "" ? "VG" : "gH\G") @@ -167,13 +205,20 @@ inoremenu