diff --git a/lua/rakshit/plugins/dressing.lua b/lua/rakshit/plugins/dressing.lua index 76454948..105f7e58 100644 --- a/lua/rakshit/plugins/dressing.lua +++ b/lua/rakshit/plugins/dressing.lua @@ -1,4 +1,4 @@ return { - 'stevearc/dressing.nvim', - event = 'VeryLazy', + "stevearc/dressing.nvim", + event = "VeryLazy", } diff --git a/lua/rakshit/plugins/formatting.lua b/lua/rakshit/plugins/formatting.lua index 7615ced1..f1d00d19 100644 --- a/lua/rakshit/plugins/formatting.lua +++ b/lua/rakshit/plugins/formatting.lua @@ -1,15 +1,15 @@ return { -- Autoformat - 'stevearc/conform.nvim', - event = { 'BufWritePre', 'BufReadPre', 'BufNewFile' }, - cmd = { 'ConformInfo' }, + "stevearc/conform.nvim", + event = { "BufWritePre", "BufReadPre", "BufNewFile" }, + cmd = { "ConformInfo" }, keys = { { - 'f', + "f", function() - require('conform').format({ async = true, lsp_format = 'fallback' }) + require("conform").format({ async = true, lsp_format = "fallback" }) end, - mode = '', - desc = '[F]ormat buffer', + mode = "", + desc = "[F]ormat buffer", }, }, opts = { @@ -21,35 +21,35 @@ return { -- Autoformat timeout_ms = 5000, }, formatters_by_ft = { - go = { 'goimports', 'gofmt' }, - terraform = { 'terraform_fmt' }, - lua = { 'stylua' }, - javascript = { 'prettier' }, - typescript = { 'prettier' }, - javascriptreact = { 'prettier' }, - typescriptreact = { 'prettier' }, - svelte = { 'prettier' }, - css = { 'prettier' }, - html = { 'prettier' }, - json = { 'prettier' }, - yaml = { 'prettier' }, - markdown = { 'prettier' }, - graphql = { 'prettier' }, - liquid = { 'prettier' }, + go = { "goimports", "gofmt" }, + terraform = { "terraform_fmt" }, + lua = { "stylua" }, + javascript = { "prettier" }, + typescript = { "prettier" }, + javascriptreact = { "prettier" }, + typescriptreact = { "prettier" }, + svelte = { "prettier" }, + css = { "prettier" }, + html = { "prettier" }, + json = { "prettier" }, + yaml = { "prettier" }, + markdown = { "prettier" }, + graphql = { "prettier" }, + liquid = { "prettier" }, -- python = { 'isort', 'black' }, -- You can use a function here to determine the formatters dynamically python = function(bufnr) - if require('conform').get_formatter_info('ruff_format', bufnr).available then - return { 'ruff_format' } + if require("conform").get_formatter_info("ruff_format", bufnr).available then + return { "ruff_format" } else - return { 'isort', 'black' } + return { "isort", "black" } end end, -- Use the "*" filetype to run formatters on all filetypes. - ['*'] = { 'codespell' }, + ["*"] = { "codespell" }, -- Use the "_" filetype to run formatters on filetypes that don't -- have other formatters configured. - ['_'] = { 'trim_whitespace' }, + ["_"] = { "trim_whitespace" }, -- Conform can also run multiple formatters sequentially -- python = { "isort", "black" }, --