From c99604b4ae6abb97decd7174f48fa082109ff877 Mon Sep 17 00:00:00 2001 From: Peter Benjamin Date: Thu, 23 May 2024 11:13:47 -0700 Subject: [PATCH] feat(terraform): include dash in iskeyword --- ftplugin/terraform.vim | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ftplugin/terraform.vim b/ftplugin/terraform.vim index 7e56d9ed..4c6402d0 100644 --- a/ftplugin/terraform.vim +++ b/ftplugin/terraform.vim @@ -9,6 +9,16 @@ if exists('b:did_ftplugin') || v:version < 700 || &compatible finish endif +if !has('patch-7.4.1142') + " Include hyphens as keyword characters so that: + " 1. a keyword appearing as part of a longer name doesn't get partially + " highlighted. + " 2. Goto local declaration works correctly (see `:h gd`) + " 3. Tag navigation works correctly (see `:h i_CTRL-X_CTRL-]`) + setlocal iskeyword+=- + let b:undo_ftplugin .= ' iskeyword<' +endif + " Have only kept the terraform versions of these options for backwards " compatibility. if get(g:, 'terraform_fold_sections', 0)