瀏覽代碼

disable helix grammar build for gitcommit, symlink helix runtime4

chach 2 周之前
父節點
當前提交
fb7c66528f
共有 1 個文件被更改,包括 8 次插入1 次删除
  1. 8 1
      02-helix.sh

+ 8 - 1
02-helix.sh

@@ -5,9 +5,16 @@ rm -rf "$DIR"
 git clone --depth=1 https://github.com/helix-editor/helix "$DIR"
 
 pushd "$DIR"
-export HELIX_DISABLE_AUTO_GRAMMAR_BUILD="1"
+
+# gitcommit grammar build hangs during install, so remove its grammar block
+awk '/^\[\[grammar\]\]$/{b=$0; next} b{if(/^$/){if(b!~/gitcommit/)print b"\n"$0; b=""}else{b=b"\n"$0; next}} END{if(b&&b!~/gitcommit/)print b}' languages.toml > l.tmp && mv l.tmp languages.toml
+
 cargo install --path helix-term --locked
 
 popd
 
+# Symlink runtime (grammars, themes) so helix finds them at runtime
+mkdir -p "$HOME/.config/helix"
+ln -sfn "$DIR/runtime" "$HOME/.config/helix/runtime"
+