diff --git a/lua/plugins/config.lua b/lua/plugins/config.lua index 3683b3c..ff3b904 100644 --- a/lua/plugins/config.lua +++ b/lua/plugins/config.lua @@ -50,8 +50,12 @@ function M.rnvimr() end function M.nvim_fzf() + local bat_command = "bat --color=always --style=header,grid --line-range :300 {}" + local default_command = "strings {+}" + local preview = '[[ -n "$(command -v bat)" ]] && ' .. bat_command .. " || " .. default_command + require("fzf").default_options = { - fzf_cli_args = " --height 100% --preview='[[ -n \"$(command -v bat)\" ]] && bat --color=always --style=header,grid --line-range :300 {} || strings {+}' ", + fzf_cli_args = " --height 100% --preview='" .. preview .. "' ", } end diff --git a/queries/html/injections.scm b/queries/html/injections.scm index 47fd6df..37ec94b 100644 --- a/queries/html/injections.scm +++ b/queries/html/injections.scm @@ -1,21 +1,14 @@ ((attribute (attribute_name) @_alpine - (quoted_attribute_value (attribute_value) @javascript)) + (quoted_attribute_value + (attribute_value) @javascript)) (#lua-match? @_alpine "^[@:]%l+.-$")) ((attribute (attribute_name) @_alpine - (quoted_attribute_value (attribute_value) @javascript)) + (quoted_attribute_value + (attribute_value) @javascript)) (#lua-match? @_alpine "^x[-]%l+$")) (script_element (raw_text) @javascript) - -;((text) @htmldjango (#lua-match? @htmldjango "^{%p%s+%l+.-%s+%p}$")) -; -;((text) @htmldjango (#lua-match? @htmldjango "^{{%s+.-%s+}}$")) -; -;((attribute -; (quoted_attribute_value (attribute_value) @htmldjango)) -; (#lua-match? @htmldjango "^{{%s+.-%s+}}$")) - diff --git a/queries/python/injections.scm b/queries/python/injections.scm index abb5722..aac337f 100644 --- a/queries/python/injections.scm +++ b/queries/python/injections.scm @@ -1,16 +1,25 @@ (type (string (string_content) @python)) ((assignment - (type (identifier) @_type) - (string (string_content) @python)) + (type + (identifier) @_type) + (string + (string_content) @python)) (#eq? @_type "TypeAlias")) ((assignment - (type (string (string_content) @_type)) - (string (string_content) @python)) + (type + (string + (string_content) @_type)) + (string + (string_content) @python)) (#eq? @_type "TypeAlias")) -(class_definition (argument_list (subscript (string (string_content) @python)))) +(class_definition + (argument_list + (subscript + (string + (string_content) @python)))) (((string (string_content) @python) @_str) (#match? @_str "^r.*$")) diff --git a/queries/typescript/injections.scm b/queries/typescript/injections.scm new file mode 100644 index 0000000..73c671e --- /dev/null +++ b/queries/typescript/injections.scm @@ -0,0 +1,10 @@ +; angular inline templates +((decorator + (call_expression + (identifier) @_decorator + (arguments + (object + (pair + (property_identifier) @_key + (template_string) @html))))) + (#eq? @_decorator "Component") (#eq? @_key "template"))