From ca246e1c316b5195f5344e6189f6fc06f792e3e0 Mon Sep 17 00:00:00 2001 From: Jeremy Kaplan Date: Wed, 29 Apr 2026 21:32:42 -0700 Subject: [PATCH] helix: Install with theme --- bin/set-colors | 7 +++++-- default.conf.yaml | 1 + helix/.gitignore | 1 + helix/install | 12 ++++++++++++ helix/languages.toml | 7 +++++++ helix/main.toml | 9 ++++----- 6 files changed, 30 insertions(+), 7 deletions(-) create mode 100755 helix/install create mode 100644 helix/languages.toml diff --git a/bin/set-colors b/bin/set-colors index 4a81e0f..c7b648e 100755 --- a/bin/set-colors +++ b/bin/set-colors @@ -15,7 +15,7 @@ install_dark() { ln -sf "${DOTFILES}/vim/colors/jdkaplan-dark.vim" "${DOTFILES}/vim/colors/jdkaplan.vim" ln -sf "${DOTFILES}/neovim/colors/jdkaplan-cool.lua" "${DOTFILES}/neovim/colors/jdkaplan-temp.lua" - cat "${DOTFILES}/helix/dark.toml" "${DOTFILES}/helix/main.toml" > "${DOTFILES}/helix/config.toml" + "${DOTFILES}/helix/install" dark if [ "${OSTYPE}" == 'Linux' ]; then ln -sf "${DOTFILES}/xsettingsd/xsettingsd-dark.conf" "${DOTFILES}/xsettingsd/xsettingsd.conf" @@ -35,7 +35,7 @@ install_light() { ln -sf "${DOTFILES}/vim/colors/jdkaplan-light.vim" "${DOTFILES}/vim/colors/jdkaplan.vim" ln -sf "${DOTFILES}/neovim/colors/jdkaplan-warm.lua" "${DOTFILES}/neovim/colors/jdkaplan-temp.lua" - cat "${DOTFILES}/helix/light.toml" "${DOTFILES}/helix/main.toml" > "${DOTFILES}/helix/config.toml" + "${DOTFILES}/helix/install" light if [ "${OSTYPE}" == 'Linux' ]; then ln -sf "${DOTFILES}/xsettingsd/xsettingsd-light.conf" "${DOTFILES}/xsettingsd/xsettingsd.conf" @@ -54,6 +54,9 @@ postinstall() { # to trigger the reload. touch "${DOTFILES}/alacritty/alacritty.toml" + # Helix reloads the config in response to SIGUSR1. + pkill -USR1 helix || true + if [ "${OSTYPE}" == 'Linux' ]; then killall --signal HUP xsettingsd fi diff --git a/default.conf.yaml b/default.conf.yaml index 294b894..789cecc 100644 --- a/default.conf.yaml +++ b/default.conf.yaml @@ -5,6 +5,7 @@ - mkdir -p ~/.config/gh - mkdir -p ~/.task - ./bin/set-colors + - ./helix/install - ./task/install - clean: ["~", "~/.config"] diff --git a/helix/.gitignore b/helix/.gitignore index 5b6c096..2aa20b5 100644 --- a/helix/.gitignore +++ b/helix/.gitignore @@ -1 +1,2 @@ config.toml +theme.toml diff --git a/helix/install b/helix/install new file mode 100755 index 0000000..14c305b --- /dev/null +++ b/helix/install @@ -0,0 +1,12 @@ +#!/usr/bin/env bash + +set -exuo pipefail + +cd "$(dirname "${BASH_SOURCE[0]}")" + +case "${1-}" in + light) ln -sf light.toml theme.toml ;; + dark) ln -sf dark.toml theme.toml ;; +esac + +cat theme.toml main.toml > config.toml diff --git a/helix/languages.toml b/helix/languages.toml new file mode 100644 index 0000000..45e11cd --- /dev/null +++ b/helix/languages.toml @@ -0,0 +1,7 @@ +[[language]] +name = "go" +auto-format = true +formatter = { command = "goimports" } + +[language-server.rust-analyzer.config.check] +command = "clippy" diff --git a/helix/main.toml b/helix/main.toml index bda01cc..a80facc 100644 --- a/helix/main.toml +++ b/helix/main.toml @@ -4,7 +4,6 @@ cursorline = true gutters = [ "diff", "diagnostics", - "spacer", "line-numbers", "spacer", ] @@ -14,13 +13,13 @@ insert = "bar" normal = "block" select = "underline" +[editor.soft-wrap] +enable = true + [editor.statusline] left = ["mode", "spinner", "file-name"] center = [] right = ["diagnostics", "selections", "position", "position-percentage", "file-encoding"] [keys.normal] -"\\" = { w = ":w" } - -"C-e" = "scroll_down" -"C-y" = "scroll_up" +"C-l" = [":config-reload", ":redraw"]