Mercurial > vim
annotate runtime/ftplugin/awk.vim @ 35784:43ea277664a6
Added tag v9.1.0613 for changeset 9dd6970e4bdf127bee6f35932e8926ac771024a9
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Wed, 24 Jul 2024 21:45:04 +0200 |
parents | 8ae680be2a51 |
children |
rev | line source |
---|---|
10895 | 1 " Vim filetype plugin |
22824 | 2 " Language: awk, nawk, gawk, mawk |
3 " Maintainer: Doug Kearns <dougkearns@gmail.com> | |
4 " Previous Maintainer: Antonio Colombo <azc100@gmail.com> | |
34134
8ae680be2a51
runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents:
33716
diff
changeset
|
5 " Last Change: 2024 Jan 14 |
10895 | 6 |
7 " This plugin was prepared by Mark Sikora | |
22441 | 8 " This plugin was updated as proposed by Doug Kearns |
10895 | 9 |
10 " Only do this when not done yet for this buffer | |
11 if exists("b:did_ftplugin") | |
12 finish | |
13 endif | |
14 | |
15 " Don't load another plugin for this buffer | |
16 let b:did_ftplugin = 1 | |
17 | |
22441 | 18 let s:cpo_save = &cpo |
19 set cpo&vim | |
20 | |
21 setlocal comments=:# | |
22 setlocal commentstring=#\ %s | |
23 setlocal formatoptions-=t formatoptions+=croql | |
24 | |
25 setlocal define=function | |
26 setlocal suffixesadd+=.awk | |
27 | |
34134
8ae680be2a51
runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents:
33716
diff
changeset
|
28 let b:undo_ftplugin = "setl fo< com< cms< def< sua<" |
10895 | 29 |
22441 | 30 " TODO: set this in scripts.vim? |
31 if exists("g:awk_is_gawk") | |
32 setlocal include=@include | |
33 setlocal suffixesadd+=.gawk | |
34 if has("unix") || has("win32unix") | |
35 setlocal formatprg=gawk\ -f-\ -o/dev/stdout | |
36 let b:undo_ftplugin .= " | setl fp<" | |
37 endif | |
38 | |
33716
bd3ee5abdd7a
runtime(dist): centralize safe executable check and add vim library (#13413)
Christian Brabandt <cb@256bit.org>
parents:
33203
diff
changeset
|
39 " Disabled by default for security reasons. |
bd3ee5abdd7a
runtime(dist): centralize safe executable check and add vim library (#13413)
Christian Brabandt <cb@256bit.org>
parents:
33203
diff
changeset
|
40 if dist#vim#IsSafeExecutable('awk', 'gawk') |
33203
c3c347a71e05
runtime: don't execute external commands when loading ftplugins
Christian Brabandt <cb@256bit.org>
parents:
22824
diff
changeset
|
41 let path = system("gawk 'BEGIN { printf ENVIRON[\"AWKPATH\"] }'") |
c3c347a71e05
runtime: don't execute external commands when loading ftplugins
Christian Brabandt <cb@256bit.org>
parents:
22824
diff
changeset
|
42 let path = substitute(path, '^\.\=:\|:\.\=$\|:\.\=:', ',,', 'g') " POSIX cwd |
c3c347a71e05
runtime: don't execute external commands when loading ftplugins
Christian Brabandt <cb@256bit.org>
parents:
22824
diff
changeset
|
43 let path = substitute(path, ':', ',', 'g') |
22441 | 44 |
33203
c3c347a71e05
runtime: don't execute external commands when loading ftplugins
Christian Brabandt <cb@256bit.org>
parents:
22824
diff
changeset
|
45 let &l:path = path |
c3c347a71e05
runtime: don't execute external commands when loading ftplugins
Christian Brabandt <cb@256bit.org>
parents:
22824
diff
changeset
|
46 endif |
22441 | 47 let b:undo_ftplugin .= " | setl inc< path<" |
48 endif | |
49 | |
50 if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") | |
34134
8ae680be2a51
runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents:
33716
diff
changeset
|
51 let b:browsefilter = "Awk Source Files (*.awk, *.gawk)\t*.awk;*.gawk\n" |
8ae680be2a51
runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents:
33716
diff
changeset
|
52 if has("win32") |
8ae680be2a51
runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents:
33716
diff
changeset
|
53 let b:browsefilter .= "All Files (*.*)\t*\n" |
8ae680be2a51
runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents:
33716
diff
changeset
|
54 else |
8ae680be2a51
runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents:
33716
diff
changeset
|
55 let b:browsefilter .= "All Files (*)\t*\n" |
8ae680be2a51
runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents:
33716
diff
changeset
|
56 endif |
8ae680be2a51
runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents:
33716
diff
changeset
|
57 let b:undo_ftplugin .= " | unlet! b:browsefilter" |
22441 | 58 endif |
59 | |
60 let &cpo = s:cpo_save | |
61 unlet s:cpo_save | |
62 | |
63 " vim: nowrap sw=2 sts=2 ts=8 |