From 376e581ba5879a4bbff7320878180339bad397b1 Mon Sep 17 00:00:00 2001 From: Price Hiller Date: Tue, 29 Aug 2023 22:49:41 -0500 Subject: [PATCH] style(nvim): format with stylua --- .../nvim/after/ftplugin/dockerfile.lua | 6 ++--- dots/.config/nvim/after/ftplugin/html.lua | 2 +- .../nvim/lua/plugins/configs/autolist.lua | 12 ++++----- .../nvim/lua/plugins/configs/formatter.lua | 2 +- dots/.config/nvim/lua/plugins/configs/gx.lua | 2 +- .../nvim/lua/plugins/configs/headlines.lua | 8 +++--- .../lua/plugins/configs/highlight-colors.lua | 5 ++-- .../nvim/lua/plugins/configs/nvim-lint.lua | 10 ++++---- .../nvim/lua/plugins/configs/treesitter.lua | 25 +++++++++++++++---- 9 files changed, 44 insertions(+), 28 deletions(-) diff --git a/dots/.config/nvim/after/ftplugin/dockerfile.lua b/dots/.config/nvim/after/ftplugin/dockerfile.lua index 953b44db..e0700084 100644 --- a/dots/.config/nvim/after/ftplugin/dockerfile.lua +++ b/dots/.config/nvim/after/ftplugin/dockerfile.lua @@ -2,8 +2,8 @@ local file_loc = vim.fn.expand("%:p:h") vim.opt_local.makeprg = "docker build " .. file_loc -vim.api.nvim_create_autocmd({ "TextChanged", "TextChangedI"}, { +vim.api.nvim_create_autocmd({ "TextChanged", "TextChangedI" }, { callback = function() require("lint").try_lint() - end -}) \ No newline at end of file + end, +}) diff --git a/dots/.config/nvim/after/ftplugin/html.lua b/dots/.config/nvim/after/ftplugin/html.lua index 3f0df6ec..06e16bb7 100644 --- a/dots/.config/nvim/after/ftplugin/html.lua +++ b/dots/.config/nvim/after/ftplugin/html.lua @@ -3,5 +3,5 @@ vim.opt_local.shiftwidth = 2 vim.keymap.set("n", "fr", ":!xdg-open %", { buffer = true, - silent = true + silent = true, }) diff --git a/dots/.config/nvim/lua/plugins/configs/autolist.lua b/dots/.config/nvim/lua/plugins/configs/autolist.lua index 0ad51ac2..475254f0 100644 --- a/dots/.config/nvim/lua/plugins/configs/autolist.lua +++ b/dots/.config/nvim/lua/plugins/configs/autolist.lua @@ -14,9 +14,9 @@ return { config = function() local list_patterns = { unordered = "[-+*]", -- - + * - digit = "%d+[.)]", -- 1. 2. 3. - ascii = "%a[.)]", -- a) b) c) - roman = "%u*[.)]", -- I. II. III. + digit = "%d+[.)]", -- 1. 2. 3. + ascii = "%a[.)]", -- a) b) c) + roman = "%u*[.)]", -- I. II. III. } require("autolist").setup({ @@ -35,8 +35,8 @@ return { list_patterns.digit, list_patterns.ascii, list_patterns.roman, - ">" - } + ">", + }, }, }) local autolist_group = vim.api.nvim_create_augroup("Autolist", {}) @@ -120,4 +120,4 @@ return { }) end, }, -} \ No newline at end of file +} diff --git a/dots/.config/nvim/lua/plugins/configs/formatter.lua b/dots/.config/nvim/lua/plugins/configs/formatter.lua index 205d0c9d..a2e53f7c 100644 --- a/dots/.config/nvim/lua/plugins/configs/formatter.lua +++ b/dots/.config/nvim/lua/plugins/configs/formatter.lua @@ -24,7 +24,7 @@ return { filetype = { markdown = filetypes.markdown.prettierd, css = filetypes.css.prettierd, - lua = filetypes.lua.stylua + lua = filetypes.lua.stylua, }, } end, diff --git a/dots/.config/nvim/lua/plugins/configs/gx.lua b/dots/.config/nvim/lua/plugins/configs/gx.lua index 7530abf4..475bd855 100644 --- a/dots/.config/nvim/lua/plugins/configs/gx.lua +++ b/dots/.config/nvim/lua/plugins/configs/gx.lua @@ -2,7 +2,7 @@ return { { "chrishrb/gx.nvim", keys = { - { "gx", desc = "Open filepath or URI" } + { "gx", desc = "Open filepath or URI" }, }, dependencies = { "nvim-lua/plenary.nvim" }, config = true, -- default settings diff --git a/dots/.config/nvim/lua/plugins/configs/headlines.lua b/dots/.config/nvim/lua/plugins/configs/headlines.lua index 19117963..7f035e86 100644 --- a/dots/.config/nvim/lua/plugins/configs/headlines.lua +++ b/dots/.config/nvim/lua/plugins/configs/headlines.lua @@ -1,8 +1,8 @@ return { { - 'lukas-reineke/headlines.nvim', + "lukas-reineke/headlines.nvim", dependencies = "nvim-treesitter/nvim-treesitter", config = true, -- or `opts = {}` - filetypes = { "markdown", "norg", "rmd", "org" } - } -} \ No newline at end of file + filetypes = { "markdown", "norg", "rmd", "org" }, + }, +} diff --git a/dots/.config/nvim/lua/plugins/configs/highlight-colors.lua b/dots/.config/nvim/lua/plugins/configs/highlight-colors.lua index 62e5b802..40836612 100644 --- a/dots/.config/nvim/lua/plugins/configs/highlight-colors.lua +++ b/dots/.config/nvim/lua/plugins/configs/highlight-colors.lua @@ -11,7 +11,8 @@ return { "HighlightColorsToggle", }, config = true, - },{ + }, + { "uga-rosa/ccc.nvim", event = { "BufReadPre", "BufNewFile" }, config = function() @@ -24,7 +25,7 @@ return { }, highlighter = { auto_enable = true, - lsp = true + lsp = true, }, }) end, diff --git a/dots/.config/nvim/lua/plugins/configs/nvim-lint.lua b/dots/.config/nvim/lua/plugins/configs/nvim-lint.lua index e77e070f..3618db27 100644 --- a/dots/.config/nvim/lua/plugins/configs/nvim-lint.lua +++ b/dots/.config/nvim/lua/plugins/configs/nvim-lint.lua @@ -4,13 +4,13 @@ return { event = { "BufReadPre", "BufNewFile" }, config = function() require("lint").linters_by_ft = { - markdown = {"proselint"} + markdown = { "proselint" }, } vim.api.nvim_create_autocmd({ "BufWritePost", "BufEnter" }, { callback = function() require("lint").try_lint() - end + end, }) - end - } -} \ No newline at end of file + end, + }, +} diff --git a/dots/.config/nvim/lua/plugins/configs/treesitter.lua b/dots/.config/nvim/lua/plugins/configs/treesitter.lua index a86a2410..88ebf1d3 100644 --- a/dots/.config/nvim/lua/plugins/configs/treesitter.lua +++ b/dots/.config/nvim/lua/plugins/configs/treesitter.lua @@ -39,7 +39,23 @@ return { "windwp/nvim-ts-autotag", dependencies = { "nvim-treesitter/nvim-treesitter" }, event = { "BufReadPre", "BufNewFile" }, - config = true, + opts = { + filetypes = { + "astro", + "glimmer", + "handlebars", + "html", + "javascript", + "jsx", + "php", + "rescript", + "svelte", + "tsx", + "typescript", + "vue", + "xml", + }, + }, ft = { "astro", "glimmer", @@ -47,7 +63,6 @@ return { "html", "javascript", "jsx", - "markdown", "php", "rescript", "svelte", @@ -105,7 +120,7 @@ return { "pfeiferj/nvim-hurl", config = true, }, - "JoosepAlviste/nvim-ts-context-commentstring" + "JoosepAlviste/nvim-ts-context-commentstring", }, config = function() local treesitter_dir = vim.fn.stdpath("data") .. "/treesitter" @@ -160,8 +175,8 @@ return { enable = true, }, context_commentstring = { - enable = true - } + enable = true, + }, }) end, },