From 14042b255fcb1a0b1cf7432be27bdda46f087b58 Mon Sep 17 00:00:00 2001 From: Rudxain Date: Tue, 16 Jul 2024 16:33:56 -0400 Subject: [PATCH] BIG CHANGES - change some indent sizes - Taplo fmt config - add Richard Stallman GNU+Linux copypasta, but for shells - rm default ESlint config, as hx 24.7 already has it - JSON config --- .config/helix/languages.toml | 76 ++++++++++++++++++++++-------------- .config/taplo.toml | 2 + .sh/exports | 2 + 3 files changed, 50 insertions(+), 30 deletions(-) create mode 100644 .config/taplo.toml diff --git a/.config/helix/languages.toml b/.config/helix/languages.toml index f05cf1151ff..1a589eca749 100644 --- a/.config/helix/languages.toml +++ b/.config/helix/languages.toml @@ -1,10 +1,29 @@ [[language]] -name = "bash" # and POSIX sh +name = "toml" +formatter = { command = "taplo", args = ["fmt", "-"] } +auto-format = true + +[[language]] +# um, actually 🤓, +# I'd just like to interject for a moment. +# What you're refering to as "Bash", is in fact, POSIX/Ksh/Dash/Bash/Zsh/Fish, +# or as I've recently taken to calling it, *sh. +# Bash is a shell, but it's just one of many shells supported by "Bash-LSP", +# +# Many computer users run a modified version of the POSIX shell (such as Dash) +# every day, without realizing it. +# Through a peculiar turn of events, +# the version of POSIX-sh which is widely used today is often called "Bash", +# and many of its users are not aware that it is basically the POSIX-sh. +# +# There really is a Bash, and some people are using it, +# but it is just one shell among many. +name = "bash" indent = { tab-width = 4, unit = "\t" } [[language]] name = "python" -language-servers = [ "pyright" ] +language-servers = ["pyright"] [[language]] name = "markdown" @@ -13,54 +32,51 @@ indent = { tab-width = 4, unit = "\t" } [[language]] name = "html" -indent = { tab-width = 4, unit = "\t" } +indent = { tab-width = 3, unit = "\t" } [[language]] name = "css" -indent = { tab-width = 4, unit = "\t" } +indent = { tab-width = 3, unit = "\t" } + +[[language]] +name = "json" +indent = { tab-width = 3, unit = "\t" } +auto-format = false + +[language-server.vscode-json-language-server.config] +provideFormatter = true +[language-server.vscode-json-language-server.config.json] +validate.enable = true +format.enable = true +keepLines.enable = true [[language]] name = "javascript" -language-servers = ["typescript-language-server", "eslint"] +language-servers = [ + "typescript-language-server", + "vscode-eslint-language-server", +] indent = { tab-width = 4, unit = "\t" } auto-format = true [[language]] name = "typescript" -language-servers = ["typescript-language-server", "eslint"] +language-servers = [ + "typescript-language-server", + "vscode-eslint-language-server", +] indent = { tab-width = 4, unit = "\t" } auto-format = true -[language-server.eslint] -command = "vscode-eslint-language-server" -args = ["--stdio"] -[language-server.eslint.config] -validate = "on" -experimental = { useFlatConfig = false } -rulesCustomizations = [] -run = "onType" # is there `onSave`? -problems = { shortenToSingleLine = false } -nodePath = "" -[language-server.eslint.config.codeAction] -[language-server.eslint.config.codeAction.disableRuleComment] -enable = true -location = "separateLine" -[language-server.eslint.config.codeAction.showDocumentation] -enable = true -[language-server.eslint.config.codeActionOnSave] +[language-server.vscode-eslint-language-server.config.codeActionOnSave] enable = true mode = "fixAll" -[language-server.eslint.config.workingDirectory] -mode = "location" +# `indent` controlled by `rustfmt` [language-server.rust-analyzer.config.check] command = "clippy" -[[language]] -name = "toml" -formatter = { command = "taplo", args = ["fmt", "-"] } - [[language]] name = "go" +formatter.command = "goimports" auto-format = true -formatter = { command = "goimports" } diff --git a/.config/taplo.toml b/.config/taplo.toml new file mode 100644 index 00000000000..0cffd2a2c1a --- /dev/null +++ b/.config/taplo.toml @@ -0,0 +1,2 @@ +[formatting] +align_comments = false diff --git a/.sh/exports b/.sh/exports index 35c34c12d2e..f803b77d055 100644 --- a/.sh/exports +++ b/.sh/exports @@ -13,3 +13,5 @@ export NODE_REPL_MODE=strict # Helix export EDITOR=hx #export VISUAL= # ??? + +export TAPLO_CONFIG="$HOME/.config/taplo.toml"