Files
clang-p2996/mlir/utils/vim/ftplugin/mlir.vim
Jack Frankland e4708260c7 [vim] Improve iskeyword for MLIR (#121750)
Define keywords for the MLIR syntax. This allows better recognition of
semantic constructs such as SSA value identification e.g. `%foo` which
gives improved motion handling when using 'word based' such as `w, e`.

This is based on the work done for the LLVM IR in
8c46413f34.

Signed-off-by: Jack Frankland <jack.frankland@arm.com>
2025-01-15 10:01:36 +00:00

22 lines
670 B
VimL

" Vim filetype plugin file
" Language: MLIR Assembly
" Maintainer: The MLIR team
if exists("b:did_ftplugin")
finish
endif
let b:did_ftplugin = 1
setlocal softtabstop=2 shiftwidth=2
setlocal expandtab
setlocal comments+=://
setlocal commentstring=//\ %s
" We treat sequences of the following characters as forming 'keywords', with
" the aim of easing movement around MLIR identifiers:
" * identifier prefixes: '%' and '@' (@-@)
" * all characters where isalpha() returns TRUE (@)
" * the digits 0-9 (48-57)
" * other characters that may form identifiers: '_', '.', '-', '$'
" Comment this out to restore the default behaviour
setlocal iskeyword=%,@-@,@,48-57,_,.,-,$