diff --git a/lua/plugins/tools/conform.lua b/lua/plugins/tools/conform.lua new file mode 100644 index 0000000..862c79a --- /dev/null +++ b/lua/plugins/tools/conform.lua @@ -0,0 +1,36 @@ +local conform = require('conform') + + conform.setup({ + formatters_by_ft = { + lua = { "stylua" }, + svelte = { { "prettierd", "prettier" } }, + javascript = { { "prettierd", "prettier" } }, + typescript = { { "prettierd", "prettier" } }, + javascriptreact = { { "prettierd", "prettier" } }, + typescriptreact = { { "prettierd", "prettier" } }, + json = { { "prettierd", "prettier" } }, + graphql = { { "prettierd", "prettier" } }, + java = { "google-java-format" }, + kotlin = { "ktlint" }, + ruby = { "standardrb" }, + markdown = { { "prettierd", "prettier" } }, + erb = { "htmlbeautifier" }, + html = { "htmlbeautifier" }, + bash = { "beautysh" }, + proto = { "buf" }, + rust = { "rustfmt" }, + yaml = { "yamlfix" }, + toml = { "taplo" }, + css = { { "prettierd", "prettier" } }, + scss = { { "prettierd", "prettier" } }, + sh = { { "shellcheck" } }, + }, + }) + + vim.keymap.set({ "n", "v" }, "l", function() + conform.format({ + lsp_fallback = true, + async = false, + timeout_ms = 1000, + }) + end, { desc = "Format file or range (in visual mode)" }) diff --git a/lua/plugins/tools/url-open.lua b/lua/plugins/tools/url-open.lua new file mode 100644 index 0000000..541a650 --- /dev/null +++ b/lua/plugins/tools/url-open.lua @@ -0,0 +1,23 @@ +require("url-open").setup({ + -- default will open url with default browser of your system or you can choose your browser like this + -- open_app = "micorsoft-edge-stable", + -- google-chrome, firefox, micorsoft-edge-stable, opera, brave, vivaldi + open_app = "default", + open_only_when_cursor_on_url = true, + highlight_url = { + all_urls = { + enabled = true, + fg = "#21d5ff", -- nil will use default color + bg = nil, -- transparent + underline = true, + }, + cursor_move = { + enabled = true, + fg = "#199eff", -- nil will use default color + bg = nil, -- transparent + underline = true, + }, + }, + deep_pattern = false, + extra_patterns = { }, +})