robin/laufey
git clone https://git.robinwobin.dev/robin/laufey
7ed6966023
master
1" Vim filetype plugin 2" Language: awk, nawk, gawk, mawk 3" Maintainer: Doug Kearns <dougkearns@gmail.com> 4" Previous Maintainer: Antonio Colombo <azc100@gmail.com> 5" Last Change: 2024 Jan 14 6 7" This plugin was prepared by Mark Sikora 8" This plugin was updated as proposed by Doug Kearns 9 10" Only do this when not done yet for this buffer 11if exists ( "b:did_ftplugin" ) 12finish 13endif 14 15" Don't load another plugin for this buffer 16let b: did_ftplugin = 1 17 18let s: cpo_save = & cpo 19set cpo & vim 20 21setlocal comments = :# 22setlocal commentstring = #\ %s 23setlocal formatoptions -= tformatoptions += croql 24 25setlocal define = function 26setlocal suffixesadd += .awk 27 28let b: undo_ftplugin = "setl fo< com< cms< def< sua<" 29 30" TODO: set this in scripts.vim? 31if exists ( "g:awk_is_gawk" ) 32setlocal include = @include 33setlocal suffixesadd += .gawk 34if has ( "unix" ) || has ( "win32unix" ) 35setlocal formatprg = gawk\ -f-\ -o/dev/stdout 36let b: undo_ftplugin .= " | setl fp<" 37endif 38 39" Disabled by default for security reasons. 40if dist#vim#IsSafeExecutable ( 'awk' , 'gawk' ) 41let path = system ( "gawk 'BEGIN { printf ENVIRON[\"AWKPATH\"] }'" ) 42let path = substitute ( path , '^\.\=:\|:\.\=$\|:\.\=:' , ',,' , 'g' ) " POSIX cwd 43let path = substitute ( path , ':' , ',' , 'g' ) 44 45let & l: path = path 46endif 47let b: undo_ftplugin .= " | setl inc< path<" 48endif 49 50if ( has ( "gui_win32" ) || has ( "gui_gtk" )) && ! exists ( "b:browsefilter" ) 51let b: browsefilter = "Awk Source Files (*.awk, *.gawk)\t*.awk;*.gawk\n" 52if has ( "win32" ) 53let b: browsefilter .= "All Files (*.*)\t*\n" 54else 55let b: browsefilter .= "All Files (*)\t*\n" 56endif 57let b: undo_ftplugin .= " | unlet! b:browsefilter" 58endif 59 60let & cpo = s: cpo_save 61unlet s: cpo_save 62 63" vim: nowrap sw=2 sts=2 ts=8