Просмотр исходного кода

disable helix grammar build for gitcommit, symlink helix runtime4

chach 2 недель назад
Родитель
Сommit
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"
+