codekingpro/portable-devtools
115k
1" Vim filetype plugin2" Language: awk, nawk, gawk, mawk3" Maintainer: Doug Kearns <dougkearns@gmail.com>4" Previous Maintainer: Antonio Colombo <azc100@gmail.com>5" Last Change: 2024 Jan 146 7" This plugin was prepared by Mark Sikora8" This plugin was updated as proposed by Doug Kearns9 10" Only do this when not done yet for this buffer11if exists("b:did_ftplugin")12 finish13endif14 15" Don't load another plugin for this buffer16let b:did_ftplugin = 117 18let s:cpo_save = &cpo19set cpo&vim20 21setlocal comments=:#22setlocal commentstring=#\ %s23setlocal formatoptions-=t formatoptions+=croql24 25setlocal define=function26setlocal suffixesadd+=.awk27 28let b:undo_ftplugin = "setl fo< com< cms< def< sua<"29 30" TODO: set this in scripts.vim?31if exists("g:awk_is_gawk")32 setlocal include=@include33 setlocal suffixesadd+=.gawk34 if has("unix") || has("win32unix")35 setlocal formatprg=gawk\ -f-\ -o/dev/stdout36 let b:undo_ftplugin .= " | setl fp<"37 endif38 39 " Disabled by default for security reasons.40 if dist#vim#IsSafeExecutable('awk', 'gawk')41 let path = system("gawk 'BEGIN { printf ENVIRON[\"AWKPATH\"] }'")42 let path = substitute(path, '^\.\=:\|:\.\=$\|:\.\=:', ',,', 'g') " POSIX cwd43 let path = substitute(path, ':', ',', 'g')44 45 let &l:path = path46 endif47 let b:undo_ftplugin .= " | setl inc< path<"48endif49 50if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")51 let b:browsefilter = "Awk Source Files (*.awk, *.gawk)\t*.awk;*.gawk\n"52 if has("win32")53 let b:browsefilter .= "All Files (*.*)\t*\n"54 else55 let b:browsefilter .= "All Files (*)\t*\n"56 endif57 let b:undo_ftplugin .= " | unlet! b:browsefilter"58endif59 60let &cpo = s:cpo_save61unlet s:cpo_save62 63" vim: nowrap sw=2 sts=2 ts=864 