Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1 | " Vim syntax support file |
Christian Brabandt | e978b45 | 2023-08-13 10:33:05 +0200 | [diff] [blame] | 2 | " Maintainer: The Vim Project <https://github.com/vim/vim> |
| 3 | " Last Change: 2023 Aug 10 |
| 4 | " Former Maintainer: Bram Moolenaar <Bram@vim.org> |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 5 | |
| 6 | " This file is used for ":syntax manual". |
| 7 | " It installs the Syntax autocommands, but no the FileType autocommands. |
| 8 | |
| 9 | if !has("syntax") |
| 10 | finish |
| 11 | endif |
| 12 | |
| 13 | " Load the Syntax autocommands and set the default methods for highlighting. |
| 14 | if !exists("syntax_on") |
| 15 | so <sfile>:p:h/synload.vim |
| 16 | endif |
| 17 | |
| 18 | let syntax_manual = 1 |
| 19 | |
Bram Moolenaar | 885f24f | 2016-02-01 22:54:46 +0100 | [diff] [blame] | 20 | " Overrule the connection between FileType and Syntax autocommands. This sets |
| 21 | " the syntax when the file type is detected, without changing the value. |
| 22 | augroup syntaxset |
| 23 | au! FileType * exe "set syntax=" . &syntax |
| 24 | augroup END |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 25 | |
| 26 | " 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] | 27 | " Don't do it when the 'M' flag is included in 'guioptions'. |
| 28 | 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] | 29 | source $VIMRUNTIME/menu.vim |
| 30 | endif |