annotate runtime/ftplugin/awk.vim @ 35442:08468d7e398c

runtime(java): Add a config variable for commonly used compiler options Commit: https://github.com/vim/vim/commit/0ddab582fa13d1d653800494e45ecfba00974a18 Author: Doug Kearns <dougkearns@gmail.com> Date: Sun Jun 16 16:58:09 2024 +0200 runtime(java): Add a config variable for commonly used compiler options The value of g:javac_makeprg_params, if set, is added to the value of 'makeprg' as an option string. closes: #14999 Signed-off-by: Doug Kearns <dougkearns@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
author Christian Brabandt <cb@256bit.org>
date Sun, 16 Jun 2024 17:00:10 +0200
parents 8ae680be2a51
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
10895
c391bfbdb452 Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
1 " Vim filetype plugin
22824
8dad79c661d1 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 22441
diff changeset
2 " Language: awk, nawk, gawk, mawk
8dad79c661d1 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 22441
diff changeset
3 " Maintainer: Doug Kearns <dougkearns@gmail.com>
8dad79c661d1 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 22441
diff changeset
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
c391bfbdb452 Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
6
c391bfbdb452 Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
7 " This plugin was prepared by Mark Sikora
22441
a3bb84cd0f59 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10895
diff changeset
8 " This plugin was updated as proposed by Doug Kearns
10895
c391bfbdb452 Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
9
c391bfbdb452 Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
10 " Only do this when not done yet for this buffer
c391bfbdb452 Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
11 if exists("b:did_ftplugin")
c391bfbdb452 Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
12 finish
c391bfbdb452 Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
13 endif
c391bfbdb452 Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
14
c391bfbdb452 Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
15 " Don't load another plugin for this buffer
c391bfbdb452 Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
16 let b:did_ftplugin = 1
c391bfbdb452 Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
17
22441
a3bb84cd0f59 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10895
diff changeset
18 let s:cpo_save = &cpo
a3bb84cd0f59 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10895
diff changeset
19 set cpo&vim
a3bb84cd0f59 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10895
diff changeset
20
a3bb84cd0f59 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10895
diff changeset
21 setlocal comments=:#
a3bb84cd0f59 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10895
diff changeset
22 setlocal commentstring=#\ %s
a3bb84cd0f59 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10895
diff changeset
23 setlocal formatoptions-=t formatoptions+=croql
a3bb84cd0f59 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10895
diff changeset
24
a3bb84cd0f59 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10895
diff changeset
25 setlocal define=function
a3bb84cd0f59 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10895
diff changeset
26 setlocal suffixesadd+=.awk
a3bb84cd0f59 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10895
diff changeset
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
c391bfbdb452 Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
29
22441
a3bb84cd0f59 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10895
diff changeset
30 " TODO: set this in scripts.vim?
a3bb84cd0f59 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10895
diff changeset
31 if exists("g:awk_is_gawk")
a3bb84cd0f59 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10895
diff changeset
32 setlocal include=@include
a3bb84cd0f59 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10895
diff changeset
33 setlocal suffixesadd+=.gawk
a3bb84cd0f59 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10895
diff changeset
34 if has("unix") || has("win32unix")
a3bb84cd0f59 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10895
diff changeset
35 setlocal formatprg=gawk\ -f-\ -o/dev/stdout
a3bb84cd0f59 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10895
diff changeset
36 let b:undo_ftplugin .= " | setl fp<"
a3bb84cd0f59 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10895
diff changeset
37 endif
a3bb84cd0f59 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10895
diff changeset
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
a3bb84cd0f59 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10895
diff changeset
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
a3bb84cd0f59 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10895
diff changeset
47 let b:undo_ftplugin .= " | setl inc< path<"
a3bb84cd0f59 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10895
diff changeset
48 endif
a3bb84cd0f59 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10895
diff changeset
49
a3bb84cd0f59 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10895
diff changeset
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
a3bb84cd0f59 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10895
diff changeset
58 endif
a3bb84cd0f59 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10895
diff changeset
59
a3bb84cd0f59 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10895
diff changeset
60 let &cpo = s:cpo_save
a3bb84cd0f59 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10895
diff changeset
61 unlet s:cpo_save
a3bb84cd0f59 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10895
diff changeset
62
a3bb84cd0f59 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10895
diff changeset
63 " vim: nowrap sw=2 sts=2 ts=8