02-helix.sh 623 B

1234567891011121314151617181920
  1. #!/usr/bin/env bash
  2. set -e
  3. DIR="$HOME/.local/src/helix"
  4. rm -rf "$DIR"
  5. git clone --depth=1 https://github.com/helix-editor/helix "$DIR"
  6. pushd "$DIR"
  7. # gitcommit grammar build hangs during install, so remove its grammar block
  8. 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
  9. cargo install --path helix-term --locked
  10. popd
  11. # Symlink runtime (grammars, themes) so helix finds them at runtime
  12. mkdir -p "$HOME/.config/helix"
  13. ln -sfn "$DIR/runtime" "$HOME/.config/helix/runtime"