fixup! ✨ feat(nvim): Laravel support in nvim
This commit is contained in:
parent
1c2fad489a
commit
9aa0560b27
6 changed files with 75 additions and 0 deletions
36
.config/nvim/after/queries/html/injections.scm
Normal file
36
.config/nvim/after/queries/html/injections.scm
Normal file
|
@ -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
|
||||
; <x-foo ::bar="baz" />
|
||||
(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
|
||||
; <x-foo :bar="$baz" />
|
||||
(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"))))
|
10
.config/nvim/after/queries/php/indents.scm
Normal file
10
.config/nvim/after/queries/php/indents.scm
Normal file
|
@ -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
|
8
.config/nvim/queries/blade/folds.scm
Normal file
8
.config/nvim/queries/blade/folds.scm
Normal file
|
@ -0,0 +1,8 @@
|
|||
((directive_start) @start
|
||||
(directive_end) @end.after
|
||||
(#set! role block))
|
||||
|
||||
|
||||
((bracket_start) @start
|
||||
(bracket_end) @end
|
||||
(#set! role block))
|
4
.config/nvim/queries/blade/highlights.scm
Normal file
4
.config/nvim/queries/blade/highlights.scm
Normal file
|
@ -0,0 +1,4 @@
|
|||
(directive) @tag
|
||||
(directive_start) @tag
|
||||
(directive_end) @tag
|
||||
(comment) @comment @spell
|
15
.config/nvim/queries/blade/injections.scm
Normal file
15
.config/nvim/queries/blade/injections.scm
Normal file
|
@ -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))
|
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -78,3 +78,5 @@ hackin/
|
|||
.config/Thunar/
|
||||
.config/xfce4/xfconf/xfce-perchannel-xml/thunar.xml
|
||||
.config/composer/vendor/
|
||||
go/pkg
|
||||
.config/systemd/
|
||||
|
|
Loading…
Reference in a new issue