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>
|
|
5 " Last Change: 2020 Sep 28
|
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
|
|
28 let b:undo_ftplugin = "setl fo< com< cms< def< sua<" .
|
|
29 \ " | unlet! b:browsefilter"
|
10895
|
30
|
22441
|
31 " TODO: set this in scripts.vim?
|
|
32 if exists("g:awk_is_gawk")
|
|
33 setlocal include=@include
|
|
34 setlocal suffixesadd+=.gawk
|
|
35 if has("unix") || has("win32unix")
|
|
36 setlocal formatprg=gawk\ -f-\ -o/dev/stdout
|
|
37 let b:undo_ftplugin .= " | setl fp<"
|
|
38 endif
|
|
39
|
|
40 let path = system("gawk 'BEGIN { printf ENVIRON[\"AWKPATH\"] }'")
|
|
41 let path = substitute(path, '^\.\=:\|:\.\=$\|:\.\=:', ',,', 'g') " POSIX cwd
|
|
42 let path = substitute(path, ':', ',', 'g')
|
|
43
|
|
44 let &l:path = path
|
|
45 let b:undo_ftplugin .= " | setl inc< path<"
|
|
46 endif
|
|
47
|
|
48 if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
|
|
49 let b:browsefilter = "Awk Source Files (*.awk,*.gawk)\t*.awk;*.gawk\n" .
|
|
50 \ "All Files (*.*)\t*.*\n"
|
|
51 endif
|
|
52
|
|
53 let &cpo = s:cpo_save
|
|
54 unlet s:cpo_save
|
|
55
|
|
56 " vim: nowrap sw=2 sts=2 ts=8
|