summary refs log tree commit diff
path: root/pkgs/misc
diff options
context:
space:
mode:
authorWael Nasreddine <wael.nasreddine@gmail.com>2020-01-04 11:29:06 -0800
committerGitHub <noreply@github.com>2020-01-04 11:29:06 -0800
commitfa92f00dc39e9f2194517c22f0f4c5433f231f40 (patch)
treed152a7b8c946e88500b8eab64f19440e17b62678 /pkgs/misc
parent2f22e67c994653171ce5f0d6ac2f6b89fbf9b27d (diff)
downloadnixpkgs-fa92f00dc39e9f2194517c22f0f4c5433f231f40.tar
nixpkgs-fa92f00dc39e9f2194517c22f0f4c5433f231f40.tar.gz
nixpkgs-fa92f00dc39e9f2194517c22f0f4c5433f231f40.tar.bz2
nixpkgs-fa92f00dc39e9f2194517c22f0f4c5433f231f40.tar.lz
nixpkgs-fa92f00dc39e9f2194517c22f0f4c5433f231f40.tar.xz
nixpkgs-fa92f00dc39e9f2194517c22f0f4c5433f231f40.tar.zst
nixpkgs-fa92f00dc39e9f2194517c22f0f4c5433f231f40.zip
vim-plugins: hashivim/vim-terraform: fix the filetypedetect autocmd (#76845)
Diffstat (limited to 'pkgs/misc')
-rw-r--r--pkgs/misc/vim-plugins/overrides.nix3
-rw-r--r--pkgs/misc/vim-plugins/vim-terraform-fix-event.patch23
2 files changed, 26 insertions, 0 deletions
diff --git a/pkgs/misc/vim-plugins/overrides.nix b/pkgs/misc/vim-plugins/overrides.nix
index a23eb80c9fe..4985f02bfb2 100644
--- a/pkgs/misc/vim-plugins/overrides.nix
+++ b/pkgs/misc/vim-plugins/overrides.nix
@@ -413,6 +413,9 @@ self: super: {
     dependencies = with super; [ vim-addon-mw-utils tlib_vim ];
   });
 
+  vim-terraform = super.vim-terraform.overrideAttrs(oa: {
+    patches = (oa.patches or []) ++ lib.singleton ./vim-terraform-fix-event.patch;
+  });
 
   vim-wakatime = super.vim-wakatime.overrideAttrs(old: {
     buildInputs = [ python ];
diff --git a/pkgs/misc/vim-plugins/vim-terraform-fix-event.patch b/pkgs/misc/vim-plugins/vim-terraform-fix-event.patch
new file mode 100644
index 00000000000..b36c4992c13
--- /dev/null
+++ b/pkgs/misc/vim-plugins/vim-terraform-fix-event.patch
@@ -0,0 +1,23 @@
+From cad4661952ad7983ece6d6486f0f68d437037015 Mon Sep 17 00:00:00 2001
+From: "Wael M. Nasreddine" <wael.nasreddine@gmail.com>
+Date: Thu, 2 Jan 2020 13:31:13 -0800
+Subject: [PATCH] Put the autocmd filetypedetect in an augroup
+
+---
+ ftdetect/terraform.vim | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/ftdetect/terraform.vim b/ftdetect/terraform.vim
+index 5919422..24bc731 100644
+--- a/ftdetect/terraform.vim
++++ b/ftdetect/terraform.vim
+@@ -1,5 +1,8 @@
+ " By default, Vim associates .tf files with TinyFugue - tell it not to.
+-autocmd! filetypedetect BufRead,BufNewFile *.tf
++augroup filetypedetect
++  au BufRead,BufNewFile *.tf set filetype=terraform
++augroup END
++
+ autocmd BufRead,BufNewFile *.tf set filetype=terraform
+ autocmd BufRead,BufNewFile *.tfvars set filetype=terraform
+ autocmd BufRead,BufNewFile *.tfstate set filetype=json