From 89b3146866e5756b19438697fa0e0155b5047c56 Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Mon, 19 Aug 2024 21:25:05 +0200 Subject: nvim: Fix bash injections finally --- .config/nvim/after/ftdetect/bash.vim | 2 ++ .config/nvim/after/queries/bash/injections.scm | 11 +++++++++++ .config/nvim/after/queries/sh/injections.scm | 11 ----------- 3 files changed, 13 insertions(+), 11 deletions(-) create mode 100644 .config/nvim/after/ftdetect/bash.vim create mode 100644 .config/nvim/after/queries/bash/injections.scm delete mode 100644 .config/nvim/after/queries/sh/injections.scm (limited to '.config') diff --git a/.config/nvim/after/ftdetect/bash.vim b/.config/nvim/after/ftdetect/bash.vim new file mode 100644 index 0000000..56af254 --- /dev/null +++ b/.config/nvim/after/ftdetect/bash.vim @@ -0,0 +1,2 @@ +" Force bash syntax instead of sh so that we get tree-sitter support +autocmd BufRead,BufNewFile *.sh set ft=bash diff --git a/.config/nvim/after/queries/bash/injections.scm b/.config/nvim/after/queries/bash/injections.scm new file mode 100644 index 0000000..3e11149 --- /dev/null +++ b/.config/nvim/after/queries/bash/injections.scm @@ -0,0 +1,11 @@ +;; extends + +(command + name: (command_name) @injection.language + argument: (raw_string) @injection.content) + +((command + name: (command_name (word)) @_name + argument: (raw_string) @injection.content) + (#eq? @_name "gawk") + (#set! injection.language "awk")) diff --git a/.config/nvim/after/queries/sh/injections.scm b/.config/nvim/after/queries/sh/injections.scm deleted file mode 100644 index 3e11149..0000000 --- a/.config/nvim/after/queries/sh/injections.scm +++ /dev/null @@ -1,11 +0,0 @@ -;; extends - -(command - name: (command_name) @injection.language - argument: (raw_string) @injection.content) - -((command - name: (command_name (word)) @_name - argument: (raw_string) @injection.content) - (#eq? @_name "gawk") - (#set! injection.language "awk")) -- cgit v1.2.3