|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if exists("b:did_ftplugin") |
|
|
finish |
|
|
endif |
|
|
|
|
|
|
|
|
let b:did_ftplugin = 1 |
|
|
|
|
|
let s:cpo_save = &cpo |
|
|
set cpo&vim |
|
|
|
|
|
setlocal comments=:# |
|
|
setlocal commentstring=#\ %s |
|
|
setlocal formatoptions-=t formatoptions+=croql |
|
|
|
|
|
setlocal define=function |
|
|
setlocal suffixesadd+=.awk |
|
|
|
|
|
let b:undo_ftplugin = "setl fo< com< cms< def< sua<" |
|
|
|
|
|
|
|
|
if exists("g:awk_is_gawk") |
|
|
setlocal include=@include |
|
|
setlocal suffixesadd+=.gawk |
|
|
if has("unix") || has("win32unix") |
|
|
setlocal formatprg=gawk\ -f-\ -o/dev/stdout |
|
|
let b:undo_ftplugin .= " | setl fp<" |
|
|
endif |
|
|
|
|
|
|
|
|
if dist#vim#IsSafeExecutable('awk', 'gawk') |
|
|
let path = system("gawk 'BEGIN { printf ENVIRON[\"AWKPATH\"] }'") |
|
|
let path = substitute(path, '^\.\=:\|:\.\=$\|:\.\=:', ',,', 'g') |
|
|
let path = substitute(path, ':', ',', 'g') |
|
|
|
|
|
let &l:path = path |
|
|
endif |
|
|
let b:undo_ftplugin .= " | setl inc< path<" |
|
|
endif |
|
|
|
|
|
if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") |
|
|
let b:browsefilter = "Awk Source Files (*.awk, *.gawk)\t*.awk;*.gawk\n" |
|
|
if has("win32") |
|
|
let b:browsefilter .= "All Files (*.*)\t*\n" |
|
|
else |
|
|
let b:browsefilter .= "All Files (*)\t*\n" |
|
|
endif |
|
|
let b:undo_ftplugin .= " | unlet! b:browsefilter" |
|
|
endif |
|
|
|
|
|
let &cpo = s:cpo_save |
|
|
unlet s:cpo_save |
|
|
|
|
|
|
|
|
|