patch 9.1.0906: filetype: Nvidia PTX files are not recognized

Problem:  filetype: Nvidia PTX files are not recognized
Solution: detect '*.ptx' files as ptx filetype (Yinzuo Jiang)

Reference: https://docs.nvidia.com/cuda/parallel-thread-execution/

closes: #16171

Signed-off-by: Yinzuo Jiang <jiangyinzuo@foxmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
Yinzuo Jiang
2024-12-05 21:31:09 +01:00
committed by Christian Brabandt
parent 73785accfd
commit bdb5f85a51
6 changed files with 77 additions and 0 deletions

16
runtime/ftplugin/ptx.vim Normal file
View File

@ -0,0 +1,16 @@
" Vim filetype plugin file
" Language: Nvidia PTX (Parellel Thread Execution)
" Maintainer: Yinzuo Jiang <jiangyinzuo@foxmail.com>
" Last Change: 2024-12-05
if exists("b:did_ftplugin")
finish
endif
let b:did_ftplugin = 1
" Comments in PTX follow C/C++ syntax
" See: https://docs.nvidia.com/cuda/parallel-thread-execution/#syntax
setlocal commentstring=//\ %s
let b:undo_ftplugin = 'setl commentstring<'