[vim] Improve iskeyword for LLVM IR #117905
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This patch sets the 'iskeyword' variable to characters found in LLVM IR identifiers. Keywords are used in many places in vim, most notably being treated as word boundaries for commands like 'w' and '*'. The aim with this is to improve the navigability and editability of LLVM IR files as now one is able to: skip over entire identifiers with motions (e.g.,
w/e/b
); yank/delete whole identifiers (e.g.,diw
); highlight/search for the identifier under the cursor (*
), etc.More complicated LLVM identifiers including quotation marks are not supported. The 'iskeyword' variable is just a list of characters, not a regex, and including quotation marks and all the characters permitted in quoted identifiers would expand the scope to almost everything and become less usable. These types of identifiers are rare by comparison.
Note that this does change how words are considered across the entire LLVM IR file, so including strings, comments, names, etc. Given that the majority of editing/navigating LLVM IR is working with and across values, this is arguably a worthwhile trade-off.