Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1 | " Vim filetype plugin file |
| 2 | " Language: Aap recipe |
Christian Brabandt | e978b45 | 2023-08-13 10:33:05 +0200 | [diff] [blame] | 3 | " Maintainer: The Vim Project <https://github.com/vim/vim> |
Doug Kearns | 93197fd | 2024-01-14 20:59:02 +0100 | [diff] [blame] | 4 | " Last Change: 2024 Jan 14 |
Christian Brabandt | e978b45 | 2023-08-13 10:33:05 +0200 | [diff] [blame] | 5 | " Former Maintainer: Bram Moolenaar <Bram@vim.org> |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 6 | |
| 7 | " Only do this when not done yet for this buffer |
| 8 | if exists("b:did_ftplugin") |
| 9 | finish |
| 10 | endif |
| 11 | |
| 12 | " Don't load another plugin for this buffer |
| 13 | let b:did_ftplugin = 1 |
| 14 | |
Bram Moolenaar | 519cc55 | 2021-11-16 19:18:26 +0000 | [diff] [blame] | 15 | " Reset 'formatoptions', 'comments', 'commentstring' and 'expandtab' to undo |
| 16 | " this plugin. |
| 17 | let b:undo_ftplugin = "setl fo< com< cms< et<" |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 18 | |
| 19 | " Set 'formatoptions' to break comment lines but not other lines, |
| 20 | " and insert the comment leader when hitting <CR> or using "o". |
| 21 | setlocal fo-=t fo+=croql |
| 22 | |
| 23 | " Set 'comments' to format dashed lists in comments. |
Bram Moolenaar | bf88493 | 2013-04-05 22:26:15 +0200 | [diff] [blame] | 24 | setlocal comments=s:#\ -,m:#\ \ ,e:#,n:#,fb:- |
Bram Moolenaar | 519cc55 | 2021-11-16 19:18:26 +0000 | [diff] [blame] | 25 | setlocal commentstring=#\ %s |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 26 | |
| 27 | " Expand tabs to spaces to avoid trouble. |
| 28 | setlocal expandtab |
Bram Moolenaar | 519cc55 | 2021-11-16 19:18:26 +0000 | [diff] [blame] | 29 | |
| 30 | if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") |
Doug Kearns | 93197fd | 2024-01-14 20:59:02 +0100 | [diff] [blame] | 31 | let b:browsefilter = "Aap Recipe Files (*.aap)\t*.aap\n" |
| 32 | if has("win32") |
| 33 | let b:browsefilter ..= "All Files (*.*)\t*\n" |
| 34 | else |
| 35 | let b:browsefilter ..= "All Files (*)\t*\n" |
| 36 | endif |
Bram Moolenaar | 519cc55 | 2021-11-16 19:18:26 +0000 | [diff] [blame] | 37 | let b:undo_ftplugin ..= " | unlet! b:browsefilter" |
| 38 | endif |