From 9aa0560b278dcbac70c2324cb2e269c78826699a Mon Sep 17 00:00:00 2001 From: punkfairie <23287005+punkfairie@users.noreply.github.com> Date: Sat, 9 Mar 2024 18:44:59 -0800 Subject: [PATCH] =?UTF-8?q?fixup!=20=E2=9C=A8=20feat(nvim):=20Laravel=20su?= =?UTF-8?q?pport=20in=20nvim?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../nvim/after/queries/html/injections.scm | 36 +++++++++++++++++++ .config/nvim/after/queries/php/indents.scm | 10 ++++++ .config/nvim/queries/blade/folds.scm | 8 +++++ .config/nvim/queries/blade/highlights.scm | 4 +++ .config/nvim/queries/blade/injections.scm | 15 ++++++++ .gitignore | 2 ++ 6 files changed, 75 insertions(+) create mode 100644 .config/nvim/after/queries/html/injections.scm create mode 100644 .config/nvim/after/queries/php/indents.scm create mode 100644 .config/nvim/queries/blade/folds.scm create mode 100644 .config/nvim/queries/blade/highlights.scm create mode 100644 .config/nvim/queries/blade/injections.scm diff --git a/.config/nvim/after/queries/html/injections.scm b/.config/nvim/after/queries/html/injections.scm new file mode 100644 index 0000000..e183fb0 --- /dev/null +++ b/.config/nvim/after/queries/html/injections.scm @@ -0,0 +1,36 @@ +;; extends + +; AlpineJS attributes +(attribute + (attribute_name) @_attr + (#lua-match? @_attr "^x%-%l") + (#not-any-of? @_attr "x-teleport" "x-ref" "x-transition") + (quoted_attribute_value + (attribute_value) @injection.content) + (#set! injection.language "javascript")) + +; Blade escaped JS attributes +; +(element + (_ + (tag_name) @_tag + (#lua-match? @_tag "^x%-%l") + (attribute + (attribute_name) @_attr + (#lua-match? @_attr "^::%l") + (quoted_attribute_value + (attribute_value) @injection.content) + (#set! injection.language "javascript")))) + +; Blade PHP attributes +; +(element + (_ + (tag_name) @_tag + (#lua-match? @_tag "^x%-%l") + (attribute + (attribute_name) @_attr + (#lua-match? @_attr "^:%l") + (quoted_attribute_value + (attribute_value) @injection.content) + (#set! injection.language "php_only")))) diff --git a/.config/nvim/after/queries/php/indents.scm b/.config/nvim/after/queries/php/indents.scm new file mode 100644 index 0000000..b2044f3 --- /dev/null +++ b/.config/nvim/after/queries/php/indents.scm @@ -0,0 +1,10 @@ +;; extends + +[ + ; prevent double indent for `return new class ...` + (return_statement + (object_creation_expression)) + ; prevent double indent for `return function() { ... }` + (return_statement + (anonymous_function_creation_expression)) +] @indent.dedent diff --git a/.config/nvim/queries/blade/folds.scm b/.config/nvim/queries/blade/folds.scm new file mode 100644 index 0000000..0705d92 --- /dev/null +++ b/.config/nvim/queries/blade/folds.scm @@ -0,0 +1,8 @@ +((directive_start) @start + (directive_end) @end.after + (#set! role block)) + + +((bracket_start) @start + (bracket_end) @end + (#set! role block)) diff --git a/.config/nvim/queries/blade/highlights.scm b/.config/nvim/queries/blade/highlights.scm new file mode 100644 index 0000000..2c9c2cd --- /dev/null +++ b/.config/nvim/queries/blade/highlights.scm @@ -0,0 +1,4 @@ +(directive) @tag +(directive_start) @tag +(directive_end) @tag +(comment) @comment @spell diff --git a/.config/nvim/queries/blade/injections.scm b/.config/nvim/queries/blade/injections.scm new file mode 100644 index 0000000..bd3ead0 --- /dev/null +++ b/.config/nvim/queries/blade/injections.scm @@ -0,0 +1,15 @@ +((text) @injection.content + (#not-has-ancestor? @injection.content "envoy") + (#set! injection.combined) + (#set! injection.language php)) + +((text) @injection.content + (#has-ancestor? @injection.content "envoy") + (#set! injection.combined) + (#set! injection.language bash)) + +((php_only) @injection.content + (#set! injection.combined) + (#set! injection.language php_only)) +((parameter) @injection.content + (#set! injection.language php_only)) diff --git a/.gitignore b/.gitignore index bba3fe8..517a9bb 100644 --- a/.gitignore +++ b/.gitignore @@ -78,3 +78,5 @@ hackin/ .config/Thunar/ .config/xfce4/xfconf/xfce-perchannel-xml/thunar.xml .config/composer/vendor/ +go/pkg +.config/systemd/