# Vim functions for file type detection
#
# Maintainer: The Vim Project <https://github.com/vim/vim>
-# Last Change: 2026 May 28
+# Last Change: 2026 May 29
# Former Maintainer: Bram Moolenaar <Bram@vim.org>
# These functions are moved here from runtime/filetype.vim to make startup
endfor
enddef
+# This function checks for Kawasaki robots AS file or atlas file type.
+export def FTas()
+ if exists("g:filetype_as")
+ exe "setf " .. g:filetype_as
+ return
+ endif
+ for lnum in range(1, min([line("$"), 30]))
+ if getline(lnum) =~ '^\.NETCONF'
+ setf kawasaki_as
+ return
+ endif
+ endfor
+ setf atlas
+enddef
+
# This function checks for the kind of assembly that is wanted by the user, or
# can be detected from the beginning of the file.
export def FTasm()
"astro": "astro",
# Atlas
"atl": "atlas",
- "as": "atlas",
# Atom is based on XML
"atom": "xml",
# Authzed
# KAREL
"kl": "karel",
"KL": "karel",
+ # Kawasaki AS
+ "pg": "kawasaki_as",
# KDL
"kdl": "kdl",
# KerML
-*filetype.txt* For Vim version 9.2. Last change: 2026 May 16
+*filetype.txt* For Vim version 9.2. Last change: 2026 May 29
VIM REFERENCE MANUAL by Bram Moolenaar
file name variable ~
*.app g:filetype_app
+ *.as g:filetype_as
*.asa g:filetype_asa |ft-aspperl-syntax|
|ft-aspvbs-syntax|
*.asm g:asmsyntax |ft-asm-syntax|
" Vim support file to detect file types
"
" Maintainer: The Vim Project <https://github.com/vim/vim>
-" Last Change: 2026 Apr 20
+" Last Change: 2026 May 29
" Former Maintainer: Bram Moolenaar <Bram@vim.org>
" If the filetype can be detected from extension or file name(the final path component),
" Arch Inventory file
au BufNewFile,BufRead .arch-inventory,=tagging-method setf arch
+" atlas or kawasaki_as
+au BufNewFile,BufRead *.as call dist#ft#FTas()
+
" Active Server Pages (with Visual Basic Script)
au BufNewFile,BufRead *.asa
\ if exists("g:filetype_asa") |
julia: ['file.jl'],
just: ['justfile', 'Justfile', '.justfile', 'config.just'],
karel: ['file.kl', 'file.KL'],
+ kawasaki_as: ['file.pg'],
kconfig: ['Kconfig', 'Kconfig.debug', 'Kconfig.file', 'Config.in', 'Config.in.host'],
kdl: ['file.kdl'],
kerml: ['file.kerml'],
filetype plugin off
endfunc
+func Test_as_file()
+ filetype on
+
+ call writefile([], 'Xfile.as', 'D')
+ split Xfile.as
+ call assert_equal('atlas', &filetype)
+ bwipe!
+ call writefile(['', '.NETCONF'], 'Xfile.as', 'D')
+ split Xfile.as
+ call assert_equal('kawasaki_as', &filetype)
+ bwipe!
+
+ filetype off
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 557,
/**/
556,
/**/