Skip to content

Commit e470826

Browse files
[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 8c46413. Signed-off-by: Jack Frankland <[email protected]>
1 parent eb96c8c commit e470826

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

mlir/utils/vim/ftplugin/mlir.vim

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,12 @@ let b:did_ftplugin = 1
1010
setlocal softtabstop=2 shiftwidth=2
1111
setlocal expandtab
1212
setlocal comments+=://
13+
setlocal commentstring=//\ %s
14+
" We treat sequences of the following characters as forming 'keywords', with
15+
" the aim of easing movement around MLIR identifiers:
16+
" * identifier prefixes: '%' and '@' (@-@)
17+
" * all characters where isalpha() returns TRUE (@)
18+
" * the digits 0-9 (48-57)
19+
" * other characters that may form identifiers: '_', '.', '-', '$'
20+
" Comment this out to restore the default behaviour
21+
setlocal iskeyword=%,@-@,@,48-57,_,.,-,$

0 commit comments

Comments
 (0)