Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1 | " Vim syntax support file |
| 2 | " Maintainer: Bram Moolenaar <Bram@vim.org> |
Bram Moolenaar | 885f24f | 2016-02-01 22:54:46 +0100 | [diff] [blame] | 3 | " Last Change: 2016 Feb 01 |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4 | |
| 5 | " This file is used for ":syntax manual". |
| 6 | " It installs the Syntax autocommands, but no the FileType autocommands. |
| 7 | |
| 8 | if !has("syntax") |
| 9 | finish |
| 10 | endif |
| 11 | |
| 12 | " Load the Syntax autocommands and set the default methods for highlighting. |
| 13 | if !exists("syntax_on") |
| 14 | so <sfile>:p:h/synload.vim |
| 15 | endif |
| 16 | |
| 17 | let syntax_manual = 1 |
| 18 | |
Bram Moolenaar | 885f24f | 2016-02-01 22:54:46 +0100 | [diff] [blame] | 19 | " Overrule the connection between FileType and Syntax autocommands. This sets |
| 20 | " the syntax when the file type is detected, without changing the value. |
| 21 | augroup syntaxset |
| 22 | au! FileType * exe "set syntax=" . &syntax |
| 23 | augroup END |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 24 | |
| 25 | " If the GUI is already running, may still need to install the FileType menu. |
Bram Moolenaar | a7241f5 | 2008-06-24 20:39:31 +0000 | [diff] [blame] | 26 | " Don't do it when the 'M' flag is included in 'guioptions'. |
| 27 | if has("menu") && has("gui_running") && !exists("did_install_syntax_menu") && &guioptions !~# 'M' |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 28 | source $VIMRUNTIME/menu.vim |
| 29 | endif |