From af6015fab200d10fb714b60cfda0f81d86d88cd3 Mon Sep 17 00:00:00 2001 From: long Date: Wed, 12 Jul 2023 00:13:38 -0500 Subject: [PATCH] golang and sql linters/formatters, angular css injections, text visual line movement --- ftplugin/text.lua | 5 +++++ lua/plugins/config.lua | 16 +++++++++++++++- queries/typescript/injections.scm | 25 +++++++++++++++++++++++++ 3 files changed, 45 insertions(+), 1 deletion(-) diff --git a/ftplugin/text.lua b/ftplugin/text.lua index 23bd033..20ab5ea 100644 --- a/ftplugin/text.lua +++ b/ftplugin/text.lua @@ -9,6 +9,11 @@ silent_map("n", "", "gj") silent_map("n", "", "g") silent_map("n", "", "g") +silent_map("v", "", "gk") +silent_map("v", "", "gj") +silent_map("v", "", "g") +silent_map("v", "", "g") + silent_map("i", "", "gk") silent_map("i", "", "gj") silent_map("i", "", "g") diff --git a/lua/plugins/config.lua b/lua/plugins/config.lua index d6e03ac..d801393 100644 --- a/lua/plugins/config.lua +++ b/lua/plugins/config.lua @@ -184,7 +184,7 @@ end function M.nvim_treesitter() local highlight_disable = { - tsx = true, + --tsx = true, cpp = true, } local rainbow_disable = vim.tbl_extend("force", highlight_disable, { @@ -408,6 +408,10 @@ function M.null_ls() local null_ls = require("null-ls") local config = lsp_config_defaults() + local sqlfluff_args = { + extra_args = { "--dialect", "postgres" }, + } + -- ORDER IN TABLE DETERMINES EXECUTION ORDER local sources = { -- python @@ -438,6 +442,16 @@ function M.null_ls() -- cpp null_ls.builtins.formatting.clang_format, + + -- golang + null_ls.builtins.diagnostics.golangci_lint, + null_ls.builtins.formatting.gofmt, + + -- sql + -- null_ls.builtins.diagnostics.sqlfluff.with(sqlfluff_args), + -- null_ls.builtins.formatting.sqlfluff.with(sqlfluff_args), + -- null_ls.builtins.formatting.sqlfmt, + null_ls.builtins.formatting.sql_formatter, } null_ls.setup({ sources = sources, diff --git a/queries/typescript/injections.scm b/queries/typescript/injections.scm index 73c671e..86fc372 100644 --- a/queries/typescript/injections.scm +++ b/queries/typescript/injections.scm @@ -8,3 +8,28 @@ (property_identifier) @_key (template_string) @html))))) (#eq? @_decorator "Component") (#eq? @_key "template")) + +; angular inline styles +((decorator + (call_expression + (identifier) @_decorator + (arguments + (object + (pair + (property_identifier) @_key + (array + (string + (string_fragment) @css))))))) + (#eq? @_decorator "Component") (#eq? @_key "styles")) + +; angular inline styles "template string" +((decorator + (call_expression + (identifier) @_decorator + (arguments + (object + (pair + (property_identifier) @_key + (array + (template_string) @css)))))) + (#eq? @_decorator "Component") (#eq? @_key "styles"))