mirror of
https://github.com/sharkdp/bat.git
synced 2024-09-30 06:31:30 +02:00
Compare commits
No commits in common. "master" and "v0.8.0" have entirely different histories.
1
.github/.codecov.yml
vendored
1
.github/.codecov.yml
vendored
@ -1 +0,0 @@
|
|||||||
comment: false
|
|
1
.github/FUNDING.yml
vendored
1
.github/FUNDING.yml
vendored
@ -1 +0,0 @@
|
|||||||
github: [sharkdp, keith-hall, Enselic]
|
|
64
.github/ISSUE_TEMPLATE/bug_report.md
vendored
64
.github/ISSUE_TEMPLATE/bug_report.md
vendored
@ -1,64 +0,0 @@
|
|||||||
---
|
|
||||||
name: Bug Report
|
|
||||||
about: Report a bug.
|
|
||||||
title: ""
|
|
||||||
labels: bug
|
|
||||||
assignees: ''
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
<!--
|
|
||||||
|
|
||||||
Hey there, thank you for reporting a bug!
|
|
||||||
|
|
||||||
Please note that the following bugs have already been reported:
|
|
||||||
|
|
||||||
* dpkg: error processing archive /some/path/some-program.deb (--unpack):
|
|
||||||
trying to overwrite '/usr/.crates2.json'
|
|
||||||
|
|
||||||
See https://github.com/sharkdp/bat/issues/938
|
|
||||||
|
|
||||||
-->
|
|
||||||
|
|
||||||
**What steps will reproduce the bug?**
|
|
||||||
|
|
||||||
1. step 1
|
|
||||||
2. step 2
|
|
||||||
3. ...
|
|
||||||
|
|
||||||
**What happens?**
|
|
||||||
|
|
||||||
...
|
|
||||||
|
|
||||||
**What did you expect to happen instead?**
|
|
||||||
|
|
||||||
...
|
|
||||||
|
|
||||||
|
|
||||||
**How did you install `bat`?**
|
|
||||||
|
|
||||||
<!-- apt-get, homebrew, GitHub release, etc. -->
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
**bat version and environment**
|
|
||||||
|
|
||||||
<!--
|
|
||||||
In order to reproduce your issue, please add some information about the environment
|
|
||||||
in which you're running bat. To do this, run the full `bat` command that demonstrates
|
|
||||||
the bug, and attach the `--diagnostic` option:
|
|
||||||
|
|
||||||
bat [other options and arguments…] --diagnostic
|
|
||||||
|
|
||||||
Finally, paste the Markdown output here. Please make sure that it does not reveal any
|
|
||||||
personal information.
|
|
||||||
|
|
||||||
|
|
||||||
If you are running bat 0.17.1 or older (where --diagnostic is not available), please
|
|
||||||
run the script at
|
|
||||||
|
|
||||||
https://github.com/sharkdp/bat/blob/master/diagnostics/info.sh
|
|
||||||
|
|
||||||
(click "Raw" to get the actual source code) and paste the Markdown output here. If you
|
|
||||||
are on Windows, please let us know your bat version and your Windows version.
|
|
||||||
-->
|
|
1
.github/ISSUE_TEMPLATE/config.yml
vendored
1
.github/ISSUE_TEMPLATE/config.yml
vendored
@ -1 +0,0 @@
|
|||||||
blank_issues_enabled: true
|
|
9
.github/ISSUE_TEMPLATE/feature_request.md
vendored
9
.github/ISSUE_TEMPLATE/feature_request.md
vendored
@ -1,9 +0,0 @@
|
|||||||
---
|
|
||||||
name: Feature Request
|
|
||||||
about: Suggest an idea for this project.
|
|
||||||
title: ''
|
|
||||||
labels: feature-request
|
|
||||||
assignees: ''
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
11
.github/ISSUE_TEMPLATE/question.md
vendored
11
.github/ISSUE_TEMPLATE/question.md
vendored
@ -1,11 +0,0 @@
|
|||||||
---
|
|
||||||
name: Question
|
|
||||||
about: Ask a question about 'bat'.
|
|
||||||
title: ''
|
|
||||||
labels: question
|
|
||||||
assignees: ''
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
<!-- Using a normal ticket is still fine, but feel free to ask your
|
|
||||||
questions about bat on https://github.com/sharkdp/bat/discussions instead. -->
|
|
29
.github/ISSUE_TEMPLATE/syntax_request.md
vendored
29
.github/ISSUE_TEMPLATE/syntax_request.md
vendored
@ -1,29 +0,0 @@
|
|||||||
---
|
|
||||||
name: Syntax Request
|
|
||||||
about: Request adding a new syntax to bat.
|
|
||||||
title: ""
|
|
||||||
labels: syntax-request
|
|
||||||
assignees: ''
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
<!--
|
|
||||||
BEFORE YOU MAKE A REQUEST:
|
|
||||||
|
|
||||||
Are you looking to add a new syntax to use on one of your devices?
|
|
||||||
Bat supports locally-installed language definitions. See the link below:
|
|
||||||
|
|
||||||
https://github.com/sharkdp/bat#adding-new-syntaxes--language-definitions
|
|
||||||
|
|
||||||
If you think adding this syntax would help others as well, please make sure that it meets our
|
|
||||||
guidelines for adding new syntaxes:
|
|
||||||
|
|
||||||
- 10,000 downloads on packagecontrol.io
|
|
||||||
-->
|
|
||||||
|
|
||||||
|
|
||||||
**Syntax:**
|
|
||||||
[Name or description of the syntax/language here]
|
|
||||||
|
|
||||||
**Guideline Criteria:**
|
|
||||||
[packagecontrol.io link here]
|
|
24
.github/dependabot.yml
vendored
24
.github/dependabot.yml
vendored
@ -1,24 +0,0 @@
|
|||||||
version: 2
|
|
||||||
updates:
|
|
||||||
- package-ecosystem: cargo
|
|
||||||
directory: "/"
|
|
||||||
schedule:
|
|
||||||
interval: monthly
|
|
||||||
time: "04:00"
|
|
||||||
timezone: Europe/Berlin
|
|
||||||
ignore:
|
|
||||||
- dependency-name: git2
|
|
||||||
versions:
|
|
||||||
- 0.13.17
|
|
||||||
- package-ecosystem: gitsubmodule
|
|
||||||
directory: "/"
|
|
||||||
schedule:
|
|
||||||
interval: monthly
|
|
||||||
time: "04:00"
|
|
||||||
timezone: Europe/Berlin
|
|
||||||
- package-ecosystem: "github-actions"
|
|
||||||
directory: "/"
|
|
||||||
schedule:
|
|
||||||
interval: monthly
|
|
||||||
time: "04:00"
|
|
||||||
timezone: Europe/Berlin
|
|
23
.github/workflows/Auto-merge-dependabot-PRs.yml
vendored
23
.github/workflows/Auto-merge-dependabot-PRs.yml
vendored
@ -1,23 +0,0 @@
|
|||||||
# This workflow triggers auto-merge of any PR that dependabot creates so that
|
|
||||||
# PRs will be merged automatically without maintainer intervention if CI passes
|
|
||||||
name: Auto-merge dependabot PRs
|
|
||||||
|
|
||||||
on:
|
|
||||||
pull_request_target:
|
|
||||||
types: [opened]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
auto-merge:
|
|
||||||
if: github.repository == 'sharkdp/bat' && startsWith(github.head_ref, 'dependabot/')
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
environment:
|
|
||||||
name: auto-merge
|
|
||||||
url: https://github.com/sharkdp/bat/blob/main/.github/workflows/Auto-merge-dependabot-PRs.yml
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.AUTO_MERGE_GITHUB_TOKEN }}
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- run: |
|
|
||||||
gh pr review ${{ github.event.pull_request.number }} --comment --body "If CI passes, this dependabot PR will be [auto-merged](https://github.com/sharkdp/bat/blob/main/.github/workflows/Auto-merge-dependabot-PRs.yml) 🚀"
|
|
||||||
- run: |
|
|
||||||
gh pr merge --auto --squash ${{ github.event.pull_request.number }}
|
|
468
.github/workflows/CICD.yml
vendored
468
.github/workflows/CICD.yml
vendored
@ -1,468 +0,0 @@
|
|||||||
name: CICD
|
|
||||||
|
|
||||||
env:
|
|
||||||
CICD_INTERMEDIATES_DIR: "_cicd-intermediates"
|
|
||||||
MSRV_FEATURES: --no-default-features --features minimal-application,bugreport,build-assets
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_dispatch:
|
|
||||||
pull_request:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- master
|
|
||||||
tags:
|
|
||||||
- '*'
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
all-jobs:
|
|
||||||
if: always() # Otherwise this job is skipped if the matrix job fails
|
|
||||||
name: all-jobs
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
needs:
|
|
||||||
- crate_metadata
|
|
||||||
- ensure_cargo_fmt
|
|
||||||
- min_version
|
|
||||||
- license_checks
|
|
||||||
- test_with_new_syntaxes_and_themes
|
|
||||||
- test_with_system_config
|
|
||||||
- documentation
|
|
||||||
- cargo-audit
|
|
||||||
- build
|
|
||||||
steps:
|
|
||||||
- run: jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}'
|
|
||||||
|
|
||||||
crate_metadata:
|
|
||||||
name: Extract crate metadata
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- name: Extract crate information
|
|
||||||
id: crate_metadata
|
|
||||||
run: |
|
|
||||||
cargo metadata --no-deps --format-version 1 | jq -r '"name=" + .packages[0].name' | tee -a $GITHUB_OUTPUT
|
|
||||||
cargo metadata --no-deps --format-version 1 | jq -r '"version=" + .packages[0].version' | tee -a $GITHUB_OUTPUT
|
|
||||||
cargo metadata --no-deps --format-version 1 | jq -r '"maintainer=" + .packages[0].authors[0]' | tee -a $GITHUB_OUTPUT
|
|
||||||
cargo metadata --no-deps --format-version 1 | jq -r '"homepage=" + .packages[0].homepage' | tee -a $GITHUB_OUTPUT
|
|
||||||
cargo metadata --no-deps --format-version 1 | jq -r '"msrv=" + .packages[0].rust_version' | tee -a $GITHUB_OUTPUT
|
|
||||||
outputs:
|
|
||||||
name: ${{ steps.crate_metadata.outputs.name }}
|
|
||||||
version: ${{ steps.crate_metadata.outputs.version }}
|
|
||||||
maintainer: ${{ steps.crate_metadata.outputs.maintainer }}
|
|
||||||
homepage: ${{ steps.crate_metadata.outputs.homepage }}
|
|
||||||
msrv: ${{ steps.crate_metadata.outputs.msrv }}
|
|
||||||
|
|
||||||
ensure_cargo_fmt:
|
|
||||||
name: Ensure 'cargo fmt' has been run
|
|
||||||
runs-on: ubuntu-20.04
|
|
||||||
steps:
|
|
||||||
- uses: dtolnay/rust-toolchain@stable
|
|
||||||
with:
|
|
||||||
components: rustfmt
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- run: cargo fmt -- --check
|
|
||||||
|
|
||||||
min_version:
|
|
||||||
name: Minimum supported rust version
|
|
||||||
runs-on: ubuntu-20.04
|
|
||||||
needs: crate_metadata
|
|
||||||
steps:
|
|
||||||
- name: Checkout source code
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Install rust toolchain (v${{ needs.crate_metadata.outputs.msrv }})
|
|
||||||
uses: dtolnay/rust-toolchain@master
|
|
||||||
with:
|
|
||||||
toolchain: ${{ needs.crate_metadata.outputs.msrv }}
|
|
||||||
components: clippy
|
|
||||||
- name: Run clippy (on minimum supported rust version to prevent warnings we can't fix)
|
|
||||||
run: cargo clippy --locked --all-targets ${{ env.MSRV_FEATURES }}
|
|
||||||
- name: Run tests
|
|
||||||
run: cargo test --locked ${{ env.MSRV_FEATURES }}
|
|
||||||
|
|
||||||
license_checks:
|
|
||||||
name: License checks
|
|
||||||
runs-on: ubuntu-20.04
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
submodules: true # we especially want to perform license checks on submodules
|
|
||||||
- run: tests/scripts/license-checks.sh
|
|
||||||
|
|
||||||
test_with_new_syntaxes_and_themes:
|
|
||||||
name: Run tests with updated syntaxes and themes
|
|
||||||
runs-on: ubuntu-20.04
|
|
||||||
steps:
|
|
||||||
- name: Git checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
submodules: true # we need all syntax and theme submodules
|
|
||||||
- name: Install Rust toolchain
|
|
||||||
uses: dtolnay/rust-toolchain@stable
|
|
||||||
- name: Build and install bat
|
|
||||||
run: cargo install --locked --path .
|
|
||||||
- name: Rebuild binary assets (syntaxes and themes)
|
|
||||||
run: bash assets/create.sh
|
|
||||||
- name: Build and install bat with updated assets
|
|
||||||
run: cargo install --locked --path .
|
|
||||||
- name: Run unit tests with new syntaxes and themes
|
|
||||||
run: cargo test --locked --release
|
|
||||||
- name: Run ignored-by-default unit tests with new syntaxes and themes
|
|
||||||
run: cargo test --locked --release --test assets -- --ignored
|
|
||||||
- name: Syntax highlighting regression test
|
|
||||||
run: tests/syntax-tests/regression_test.sh
|
|
||||||
- name: List of languages
|
|
||||||
run: bat --list-languages
|
|
||||||
- name: List of themes
|
|
||||||
run: bat --list-themes
|
|
||||||
- name: Test custom assets
|
|
||||||
run: tests/syntax-tests/test_custom_assets.sh
|
|
||||||
|
|
||||||
test_with_system_config:
|
|
||||||
name: Run tests with system wide configuration
|
|
||||||
runs-on: ubuntu-20.04
|
|
||||||
steps:
|
|
||||||
- name: Git checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
- name: Prepare environment variables
|
|
||||||
run: |
|
|
||||||
echo "BAT_SYSTEM_CONFIG_PREFIX=$GITHUB_WORKSPACE/tests/examples/system_config" >> $GITHUB_ENV
|
|
||||||
- name: Install Rust toolchain
|
|
||||||
uses: dtolnay/rust-toolchain@stable
|
|
||||||
- name: Build and install bat
|
|
||||||
run: cargo install --locked --path .
|
|
||||||
- name: Run unit tests
|
|
||||||
run: cargo test --locked --test system_wide_config -- --ignored
|
|
||||||
|
|
||||||
documentation:
|
|
||||||
name: Documentation
|
|
||||||
runs-on: ubuntu-20.04
|
|
||||||
steps:
|
|
||||||
- name: Git checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
- name: Install Rust toolchain
|
|
||||||
uses: dtolnay/rust-toolchain@stable
|
|
||||||
- name: Check documentation
|
|
||||||
env:
|
|
||||||
RUSTDOCFLAGS: -D warnings
|
|
||||||
run: cargo doc --locked --no-deps --document-private-items --all-features
|
|
||||||
- name: Show man page
|
|
||||||
run: man $(find . -name bat.1)
|
|
||||||
|
|
||||||
cargo-audit:
|
|
||||||
name: cargo audit
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- run: cargo audit
|
|
||||||
|
|
||||||
build:
|
|
||||||
name: ${{ matrix.job.target }} (${{ matrix.job.os }})
|
|
||||||
runs-on: ${{ matrix.job.os }}
|
|
||||||
needs: crate_metadata
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
job:
|
|
||||||
- { target: aarch64-unknown-linux-musl , os: ubuntu-20.04, dpkg_arch: arm64, use-cross: true }
|
|
||||||
- { target: aarch64-unknown-linux-gnu , os: ubuntu-20.04, dpkg_arch: arm64, use-cross: true }
|
|
||||||
- { target: arm-unknown-linux-gnueabihf , os: ubuntu-20.04, dpkg_arch: armhf, use-cross: true }
|
|
||||||
- { target: arm-unknown-linux-musleabihf, os: ubuntu-20.04, dpkg_arch: musl-linux-armhf, use-cross: true }
|
|
||||||
- { target: i686-pc-windows-msvc , os: windows-2019, }
|
|
||||||
- { target: i686-unknown-linux-gnu , os: ubuntu-20.04, dpkg_arch: i686, use-cross: true }
|
|
||||||
- { target: i686-unknown-linux-musl , os: ubuntu-20.04, dpkg_arch: musl-linux-i686, use-cross: true }
|
|
||||||
- { target: x86_64-apple-darwin , os: macos-12, }
|
|
||||||
- { target: aarch64-apple-darwin , os: macos-14, }
|
|
||||||
- { target: x86_64-pc-windows-gnu , os: windows-2019, }
|
|
||||||
- { target: x86_64-pc-windows-msvc , os: windows-2019, }
|
|
||||||
- { target: x86_64-unknown-linux-gnu , os: ubuntu-20.04, dpkg_arch: amd64, use-cross: true }
|
|
||||||
- { target: x86_64-unknown-linux-musl , os: ubuntu-20.04, dpkg_arch: musl-linux-amd64, use-cross: true }
|
|
||||||
env:
|
|
||||||
BUILD_CMD: cargo
|
|
||||||
steps:
|
|
||||||
- name: Checkout source code
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Install prerequisites
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
case ${{ matrix.job.target }} in
|
|
||||||
arm-unknown-linux-*) sudo apt-get -y update ; sudo apt-get -y install gcc-arm-linux-gnueabihf ;;
|
|
||||||
aarch64-unknown-linux-gnu) sudo apt-get -y update ; sudo apt-get -y install gcc-aarch64-linux-gnu ;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
- name: Install Rust toolchain
|
|
||||||
uses: dtolnay/rust-toolchain@stable
|
|
||||||
with:
|
|
||||||
targets: ${{ matrix.job.target }}
|
|
||||||
|
|
||||||
- name: Install cross
|
|
||||||
if: matrix.job.use-cross
|
|
||||||
uses: taiki-e/install-action@v2
|
|
||||||
with:
|
|
||||||
tool: cross
|
|
||||||
|
|
||||||
- name: Overwrite build command env variable
|
|
||||||
if: matrix.job.use-cross
|
|
||||||
shell: bash
|
|
||||||
run: echo "BUILD_CMD=cross" >> $GITHUB_ENV
|
|
||||||
|
|
||||||
- name: Show version information (Rust, cargo, GCC)
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
gcc --version || true
|
|
||||||
rustup -V
|
|
||||||
rustup toolchain list
|
|
||||||
rustup default
|
|
||||||
cargo -V
|
|
||||||
rustc -V
|
|
||||||
|
|
||||||
- name: Build
|
|
||||||
shell: bash
|
|
||||||
run: $BUILD_CMD build --locked --release --target=${{ matrix.job.target }}
|
|
||||||
|
|
||||||
- name: Set binary name & path
|
|
||||||
id: bin
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
# Figure out suffix of binary
|
|
||||||
EXE_suffix=""
|
|
||||||
case ${{ matrix.job.target }} in
|
|
||||||
*-pc-windows-*) EXE_suffix=".exe" ;;
|
|
||||||
esac;
|
|
||||||
|
|
||||||
# Setup paths
|
|
||||||
BIN_NAME="${{ needs.crate_metadata.outputs.name }}${EXE_suffix}"
|
|
||||||
BIN_PATH="target/${{ matrix.job.target }}/release/${BIN_NAME}"
|
|
||||||
|
|
||||||
# Let subsequent steps know where to find the binary
|
|
||||||
echo "BIN_PATH=${BIN_PATH}" >> $GITHUB_OUTPUT
|
|
||||||
echo "BIN_NAME=${BIN_NAME}" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
- name: Set testing options
|
|
||||||
id: test-options
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
# test only library unit tests and binary for arm-type targets
|
|
||||||
unset CARGO_TEST_OPTIONS
|
|
||||||
unset CARGO_TEST_OPTIONS ; case ${{ matrix.job.target }} in arm-* | aarch64-*) CARGO_TEST_OPTIONS="--lib --bin ${{ needs.crate_metadata.outputs.name }}" ;; esac;
|
|
||||||
echo "CARGO_TEST_OPTIONS=${CARGO_TEST_OPTIONS}" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
- name: Run tests
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
if [[ ${{ matrix.job.os }} = windows-* ]]
|
|
||||||
then
|
|
||||||
powershell.exe -command "$BUILD_CMD test --locked --target=${{ matrix.job.target }} ${{ steps.test-options.outputs.CARGO_TEST_OPTIONS}}"
|
|
||||||
else
|
|
||||||
$BUILD_CMD test --locked --target=${{ matrix.job.target }} ${{ steps.test-options.outputs.CARGO_TEST_OPTIONS}}
|
|
||||||
fi
|
|
||||||
|
|
||||||
- name: Run bat
|
|
||||||
shell: bash
|
|
||||||
run: $BUILD_CMD run --locked --target=${{ matrix.job.target }} -- --paging=never --color=always --theme=ansi Cargo.toml src/config.rs
|
|
||||||
|
|
||||||
- name: Show diagnostics (bat --diagnostic)
|
|
||||||
shell: bash
|
|
||||||
run: $BUILD_CMD run --locked --target=${{ matrix.job.target }} -- --paging=never --color=always --theme=ansi Cargo.toml src/config.rs --diagnostic
|
|
||||||
|
|
||||||
- name: "Feature check: regex-onig"
|
|
||||||
shell: bash
|
|
||||||
run: $BUILD_CMD check --locked --target=${{ matrix.job.target }} --verbose --lib --no-default-features --features regex-onig
|
|
||||||
|
|
||||||
- name: "Feature check: regex-onig,git"
|
|
||||||
shell: bash
|
|
||||||
run: $BUILD_CMD check --locked --target=${{ matrix.job.target }} --verbose --lib --no-default-features --features regex-onig,git
|
|
||||||
|
|
||||||
- name: "Feature check: regex-onig,paging"
|
|
||||||
shell: bash
|
|
||||||
run: $BUILD_CMD check --locked --target=${{ matrix.job.target }} --verbose --lib --no-default-features --features regex-onig,paging
|
|
||||||
|
|
||||||
- name: "Feature check: regex-onig,git,paging"
|
|
||||||
shell: bash
|
|
||||||
run: $BUILD_CMD check --locked --target=${{ matrix.job.target }} --verbose --lib --no-default-features --features regex-onig,git,paging
|
|
||||||
|
|
||||||
- name: "Feature check: minimal-application"
|
|
||||||
shell: bash
|
|
||||||
run: $BUILD_CMD check --locked --target=${{ matrix.job.target }} --verbose --no-default-features --features minimal-application
|
|
||||||
|
|
||||||
- name: Create tarball
|
|
||||||
id: package
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
PKG_suffix=".tar.gz" ; case ${{ matrix.job.target }} in *-pc-windows-*) PKG_suffix=".zip" ;; esac;
|
|
||||||
PKG_BASENAME=${{ needs.crate_metadata.outputs.name }}-v${{ needs.crate_metadata.outputs.version }}-${{ matrix.job.target }}
|
|
||||||
PKG_NAME=${PKG_BASENAME}${PKG_suffix}
|
|
||||||
echo "PKG_NAME=${PKG_NAME}" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
PKG_STAGING="${{ env.CICD_INTERMEDIATES_DIR }}/package"
|
|
||||||
ARCHIVE_DIR="${PKG_STAGING}/${PKG_BASENAME}/"
|
|
||||||
mkdir -p "${ARCHIVE_DIR}"
|
|
||||||
mkdir -p "${ARCHIVE_DIR}/autocomplete"
|
|
||||||
|
|
||||||
# Binary
|
|
||||||
cp "${{ steps.bin.outputs.BIN_PATH }}" "$ARCHIVE_DIR"
|
|
||||||
|
|
||||||
# README, LICENSE and CHANGELOG files
|
|
||||||
cp "README.md" "LICENSE-MIT" "LICENSE-APACHE" "CHANGELOG.md" "$ARCHIVE_DIR"
|
|
||||||
|
|
||||||
# Man page
|
|
||||||
cp 'target/${{ matrix.job.target }}/release/build/${{ needs.crate_metadata.outputs.name }}'-*/out/assets/manual/bat.1 "$ARCHIVE_DIR"
|
|
||||||
|
|
||||||
# Autocompletion files
|
|
||||||
cp 'target/${{ matrix.job.target }}/release/build/${{ needs.crate_metadata.outputs.name }}'-*/out/assets/completions/bat.bash "$ARCHIVE_DIR/autocomplete/${{ needs.crate_metadata.outputs.name }}.bash"
|
|
||||||
cp 'target/${{ matrix.job.target }}/release/build/${{ needs.crate_metadata.outputs.name }}'-*/out/assets/completions/bat.fish "$ARCHIVE_DIR/autocomplete/${{ needs.crate_metadata.outputs.name }}.fish"
|
|
||||||
cp 'target/${{ matrix.job.target }}/release/build/${{ needs.crate_metadata.outputs.name }}'-*/out/assets/completions/_bat.ps1 "$ARCHIVE_DIR/autocomplete/_${{ needs.crate_metadata.outputs.name }}.ps1"
|
|
||||||
cp 'target/${{ matrix.job.target }}/release/build/${{ needs.crate_metadata.outputs.name }}'-*/out/assets/completions/bat.zsh "$ARCHIVE_DIR/autocomplete/${{ needs.crate_metadata.outputs.name }}.zsh"
|
|
||||||
|
|
||||||
# base compressed package
|
|
||||||
pushd "${PKG_STAGING}/" >/dev/null
|
|
||||||
case ${{ matrix.job.target }} in
|
|
||||||
*-pc-windows-*) 7z -y a "${PKG_NAME}" "${PKG_BASENAME}"/* | tail -2 ;;
|
|
||||||
*) tar czf "${PKG_NAME}" "${PKG_BASENAME}"/* ;;
|
|
||||||
esac;
|
|
||||||
popd >/dev/null
|
|
||||||
|
|
||||||
# Let subsequent steps know where to find the compressed package
|
|
||||||
echo "PKG_PATH=${PKG_STAGING}/${PKG_NAME}" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
- name: Create Debian package
|
|
||||||
id: debian-package
|
|
||||||
shell: bash
|
|
||||||
if: startsWith(matrix.job.os, 'ubuntu')
|
|
||||||
run: |
|
|
||||||
COPYRIGHT_YEARS="2018 - "$(date "+%Y")
|
|
||||||
DPKG_STAGING="${{ env.CICD_INTERMEDIATES_DIR }}/debian-package"
|
|
||||||
DPKG_DIR="${DPKG_STAGING}/dpkg"
|
|
||||||
mkdir -p "${DPKG_DIR}"
|
|
||||||
|
|
||||||
DPKG_BASENAME=${{ needs.crate_metadata.outputs.name }}
|
|
||||||
DPKG_CONFLICTS=${{ needs.crate_metadata.outputs.name }}-musl
|
|
||||||
case ${{ matrix.job.target }} in *-musl) DPKG_BASENAME=${{ needs.crate_metadata.outputs.name }}-musl ; DPKG_CONFLICTS=${{ needs.crate_metadata.outputs.name }} ;; esac;
|
|
||||||
DPKG_VERSION=${{ needs.crate_metadata.outputs.version }}
|
|
||||||
DPKG_ARCH="${{ matrix.job.dpkg_arch }}"
|
|
||||||
DPKG_NAME="${DPKG_BASENAME}_${DPKG_VERSION}_${DPKG_ARCH}.deb"
|
|
||||||
echo "DPKG_NAME=${DPKG_NAME}" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
# Binary
|
|
||||||
install -Dm755 "${{ steps.bin.outputs.BIN_PATH }}" "${DPKG_DIR}/usr/bin/${{ steps.bin.outputs.BIN_NAME }}"
|
|
||||||
|
|
||||||
# Man page
|
|
||||||
install -Dm644 'target/${{ matrix.job.target }}/release/build/${{ needs.crate_metadata.outputs.name }}'-*/out/assets/manual/bat.1 "${DPKG_DIR}/usr/share/man/man1/${{ needs.crate_metadata.outputs.name }}.1"
|
|
||||||
gzip -n --best "${DPKG_DIR}/usr/share/man/man1/${{ needs.crate_metadata.outputs.name }}.1"
|
|
||||||
|
|
||||||
# Autocompletion files
|
|
||||||
install -Dm644 'target/${{ matrix.job.target }}/release/build/${{ needs.crate_metadata.outputs.name }}'-*/out/assets/completions/bat.bash "${DPKG_DIR}/usr/share/bash-completion/completions/${{ needs.crate_metadata.outputs.name }}"
|
|
||||||
install -Dm644 'target/${{ matrix.job.target }}/release/build/${{ needs.crate_metadata.outputs.name }}'-*/out/assets/completions/bat.fish "${DPKG_DIR}/usr/share/fish/vendor_completions.d/${{ needs.crate_metadata.outputs.name }}.fish"
|
|
||||||
install -Dm644 'target/${{ matrix.job.target }}/release/build/${{ needs.crate_metadata.outputs.name }}'-*/out/assets/completions/bat.zsh "${DPKG_DIR}/usr/share/zsh/vendor-completions/_${{ needs.crate_metadata.outputs.name }}"
|
|
||||||
|
|
||||||
# README and LICENSE
|
|
||||||
install -Dm644 "README.md" "${DPKG_DIR}/usr/share/doc/${DPKG_BASENAME}/README.md"
|
|
||||||
install -Dm644 "LICENSE-MIT" "${DPKG_DIR}/usr/share/doc/${DPKG_BASENAME}/LICENSE-MIT"
|
|
||||||
install -Dm644 "LICENSE-APACHE" "${DPKG_DIR}/usr/share/doc/${DPKG_BASENAME}/LICENSE-APACHE"
|
|
||||||
install -Dm644 "CHANGELOG.md" "${DPKG_DIR}/usr/share/doc/${DPKG_BASENAME}/changelog"
|
|
||||||
gzip -n --best "${DPKG_DIR}/usr/share/doc/${DPKG_BASENAME}/changelog"
|
|
||||||
|
|
||||||
cat > "${DPKG_DIR}/usr/share/doc/${DPKG_BASENAME}/copyright" <<EOF
|
|
||||||
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
|
|
||||||
Upstream-Name: ${{ needs.crate_metadata.outputs.name }}
|
|
||||||
Source: ${{ needs.crate_metadata.outputs.homepage }}
|
|
||||||
|
|
||||||
Files: *
|
|
||||||
Copyright: ${{ needs.crate_metadata.outputs.maintainer }}
|
|
||||||
Copyright: $COPYRIGHT_YEARS ${{ needs.crate_metadata.outputs.maintainer }}
|
|
||||||
License: Apache-2.0 or MIT
|
|
||||||
|
|
||||||
License: Apache-2.0
|
|
||||||
On Debian systems, the complete text of the Apache-2.0 can be found in the
|
|
||||||
file /usr/share/common-licenses/Apache-2.0.
|
|
||||||
|
|
||||||
License: MIT
|
|
||||||
Permission is hereby granted, free of charge, to any
|
|
||||||
person obtaining a copy of this software and associated
|
|
||||||
documentation files (the "Software"), to deal in the
|
|
||||||
Software without restriction, including without
|
|
||||||
limitation the rights to use, copy, modify, merge,
|
|
||||||
publish, distribute, sublicense, and/or sell copies of
|
|
||||||
the Software, and to permit persons to whom the Software
|
|
||||||
is furnished to do so, subject to the following
|
|
||||||
conditions:
|
|
||||||
.
|
|
||||||
The above copyright notice and this permission notice
|
|
||||||
shall be included in all copies or substantial portions
|
|
||||||
of the Software.
|
|
||||||
.
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
|
|
||||||
ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
|
|
||||||
TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
|
|
||||||
PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
|
|
||||||
SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
|
||||||
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
||||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
|
|
||||||
IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
|
||||||
DEALINGS IN THE SOFTWARE.
|
|
||||||
EOF
|
|
||||||
chmod 644 "${DPKG_DIR}/usr/share/doc/${DPKG_BASENAME}/copyright"
|
|
||||||
|
|
||||||
# control file
|
|
||||||
mkdir -p "${DPKG_DIR}/DEBIAN"
|
|
||||||
cat > "${DPKG_DIR}/DEBIAN/control" <<EOF
|
|
||||||
Package: ${DPKG_BASENAME}
|
|
||||||
Version: ${DPKG_VERSION}
|
|
||||||
Section: utils
|
|
||||||
Priority: optional
|
|
||||||
Maintainer: ${{ needs.crate_metadata.outputs.maintainer }}
|
|
||||||
Homepage: ${{ needs.crate_metadata.outputs.homepage }}
|
|
||||||
Architecture: ${DPKG_ARCH}
|
|
||||||
Provides: ${{ needs.crate_metadata.outputs.name }}
|
|
||||||
Conflicts: ${DPKG_CONFLICTS}
|
|
||||||
Description: cat(1) clone with wings.
|
|
||||||
A cat(1) clone with syntax highlighting and Git integration.
|
|
||||||
EOF
|
|
||||||
|
|
||||||
DPKG_PATH="${DPKG_STAGING}/${DPKG_NAME}"
|
|
||||||
echo "DPKG_PATH=${DPKG_PATH}" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
# build dpkg
|
|
||||||
fakeroot dpkg-deb --build "${DPKG_DIR}" "${DPKG_PATH}"
|
|
||||||
|
|
||||||
- name: "Artifact upload: tarball"
|
|
||||||
uses: actions/upload-artifact@master
|
|
||||||
with:
|
|
||||||
name: ${{ steps.package.outputs.PKG_NAME }}
|
|
||||||
path: ${{ steps.package.outputs.PKG_PATH }}
|
|
||||||
|
|
||||||
- name: "Artifact upload: Debian package"
|
|
||||||
uses: actions/upload-artifact@master
|
|
||||||
if: steps.debian-package.outputs.DPKG_NAME
|
|
||||||
with:
|
|
||||||
name: ${{ steps.debian-package.outputs.DPKG_NAME }}
|
|
||||||
path: ${{ steps.debian-package.outputs.DPKG_PATH }}
|
|
||||||
|
|
||||||
- name: Check for release
|
|
||||||
id: is-release
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
unset IS_RELEASE ; if [[ $GITHUB_REF =~ ^refs/tags/v[0-9].* ]]; then IS_RELEASE='true' ; fi
|
|
||||||
echo "IS_RELEASE=${IS_RELEASE}" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
- name: Publish archives and packages
|
|
||||||
uses: softprops/action-gh-release@v2
|
|
||||||
if: steps.is-release.outputs.IS_RELEASE
|
|
||||||
with:
|
|
||||||
files: |
|
|
||||||
${{ steps.package.outputs.PKG_PATH }}
|
|
||||||
${{ steps.debian-package.outputs.DPKG_PATH }}
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
|
|
||||||
winget:
|
|
||||||
name: Publish to Winget
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
needs: build
|
|
||||||
if: startsWith(github.ref, 'refs/tags/v')
|
|
||||||
steps:
|
|
||||||
- uses: vedantmgoyal2009/winget-releaser@v2
|
|
||||||
with:
|
|
||||||
identifier: sharkdp.bat
|
|
||||||
installers-regex: '-pc-windows-msvc\.zip$'
|
|
||||||
token: ${{ secrets.WINGET_TOKEN }}
|
|
33
.github/workflows/require-changelog-for-PRs.yml
vendored
33
.github/workflows/require-changelog-for-PRs.yml
vendored
@ -1,33 +0,0 @@
|
|||||||
name: Changelog
|
|
||||||
|
|
||||||
on:
|
|
||||||
pull_request:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
check-changelog:
|
|
||||||
name: Check for changelog entry
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
# dependabot PRs are automerged if CI passes; we shouldn't block these
|
|
||||||
if: github.actor != 'dependabot[bot]'
|
|
||||||
env:
|
|
||||||
PR_NUMBER: ${{ github.event.number }}
|
|
||||||
PR_BASE: ${{ github.base_ref }}
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- name: Fetch PR base
|
|
||||||
run: git fetch --no-tags --prune --depth=1 origin
|
|
||||||
|
|
||||||
# cannot use `github.actor`: the triggering commit may be authored by a maintainer
|
|
||||||
- name: Get PR submitter
|
|
||||||
id: get-submitter
|
|
||||||
run: curl -sSfL https://api.github.com/repos/sharkdp/bat/pulls/${PR_NUMBER} | jq -r '"submitter=" + .user.login' | tee -a $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
- name: Search for added line in changelog
|
|
||||||
env:
|
|
||||||
PR_SUBMITTER: ${{ steps.get-submitter.outputs.submitter }}
|
|
||||||
run: |
|
|
||||||
ADDED=$(git diff -U0 "origin/${PR_BASE}" HEAD -- CHANGELOG.md | grep -P '^\+[^\+].+$')
|
|
||||||
echo "Added lines in CHANGELOG.md:"
|
|
||||||
echo "$ADDED"
|
|
||||||
echo "Grepping for PR info (see CONTRIBUTING.md):"
|
|
||||||
grep "#${PR_NUMBER}\\b.*@${PR_SUBMITTER}\\b" <<< "$ADDED"
|
|
8
.gitignore
vendored
8
.gitignore
vendored
@ -1,9 +1,3 @@
|
|||||||
|
|
||||||
/target/
|
/target/
|
||||||
**/*.rs.bk
|
**/*.rs.bk
|
||||||
|
|
||||||
# Generated files
|
|
||||||
/assets/completions/bat.bash
|
|
||||||
/assets/completions/bat.fish
|
|
||||||
/assets/completions/bat.zsh
|
|
||||||
/assets/manual/bat.1
|
|
||||||
/assets/metadata.yaml
|
|
||||||
|
233
.gitmodules
vendored
233
.gitmodules
vendored
@ -1,32 +1,32 @@
|
|||||||
[submodule "assets/syntaxes/Elixir"]
|
[submodule "assets/syntaxes/Elixir"]
|
||||||
path = assets/syntaxes/02_Extra/Elixir
|
path = assets/syntaxes/Elixir
|
||||||
url = https://github.com/princemaple/elixir-sublime-syntax/
|
url = https://github.com/princemaple/elixir-sublime-syntax/
|
||||||
[submodule "assets/syntaxes/Packages"]
|
[submodule "assets/syntaxes/Packages"]
|
||||||
path = assets/syntaxes/01_Packages
|
path = assets/syntaxes/Packages
|
||||||
url = https://github.com/sublimehq/Packages/
|
url = https://github.com/sublimehq/Packages/
|
||||||
[submodule "assets/syntaxes/TOML"]
|
[submodule "assets/syntaxes/TOML"]
|
||||||
path = assets/syntaxes/02_Extra/TOML
|
path = assets/syntaxes/TOML
|
||||||
url = https://github.com/jasonwilliams/sublime_toml_highlighting
|
url = https://github.com/sharkdp/sublime_toml_highlighting
|
||||||
[submodule "assets/syntaxes/Julia"]
|
[submodule "assets/syntaxes/Julia"]
|
||||||
path = assets/syntaxes/02_Extra/Julia
|
path = assets/syntaxes/Julia
|
||||||
url = https://github.com/JuliaEditorSupport/Julia-sublime
|
url = https://github.com/JuliaEditorSupport/Julia-sublime
|
||||||
[submodule "assets/themes/sublime-monokai-extended"]
|
[submodule "assets/themes/sublime-monokai-extended"]
|
||||||
path = assets/themes/sublime-monokai-extended
|
path = assets/themes/sublime-monokai-extended
|
||||||
url = https://github.com/jonschlinkert/sublime-monokai-extended
|
url = https://github.com/jonschlinkert/sublime-monokai-extended
|
||||||
[submodule "assets/syntaxes/Docker"]
|
[submodule "assets/syntaxes/Docker"]
|
||||||
path = assets/syntaxes/02_Extra/Docker
|
path = assets/syntaxes/Docker
|
||||||
url = https://github.com/asbjornenge/Docker.tmbundle
|
url = https://github.com/asbjornenge/Docker.tmbundle
|
||||||
[submodule "assets/syntaxes/VimL"]
|
[submodule "assets/syntaxes/VimL"]
|
||||||
path = assets/syntaxes/02_Extra/VimL
|
path = assets/syntaxes/VimL
|
||||||
url = https://github.com/SalGnt/Sublime-VimL
|
url = https://github.com/SalGnt/Sublime-VimL
|
||||||
[submodule "assets/syntaxes/INI"]
|
[submodule "assets/syntaxes/INI"]
|
||||||
path = assets/syntaxes/02_Extra/INI
|
path = assets/syntaxes/INI
|
||||||
url = https://github.com/clintberry/sublime-text-2-ini
|
url = https://github.com/clintberry/sublime-text-2-ini
|
||||||
[submodule "assets/syntaxes/CMake"]
|
[submodule "assets/syntaxes/CMake"]
|
||||||
path = assets/syntaxes/02_Extra/CMake
|
path = assets/syntaxes/CMake
|
||||||
url = https://github.com/zyxar/Sublime-CMakeLists
|
url = https://github.com/zyxar/Sublime-CMakeLists
|
||||||
[submodule "assets/syntaxes/LESS"]
|
[submodule "assets/syntaxes/LESS"]
|
||||||
path = assets/syntaxes/02_Extra/LESS
|
path = assets/syntaxes/LESS
|
||||||
url = https://github.com/danro/LESS-sublime
|
url = https://github.com/danro/LESS-sublime
|
||||||
[submodule "assets/themes/DarkNeon"]
|
[submodule "assets/themes/DarkNeon"]
|
||||||
path = assets/themes/DarkNeon
|
path = assets/themes/DarkNeon
|
||||||
@ -41,225 +41,56 @@
|
|||||||
path = assets/themes/TwoDark
|
path = assets/themes/TwoDark
|
||||||
url = https://github.com/erremauro/TwoDark
|
url = https://github.com/erremauro/TwoDark
|
||||||
[submodule "assets/syntaxes/AWK"]
|
[submodule "assets/syntaxes/AWK"]
|
||||||
path = assets/syntaxes/02_Extra/AWK
|
path = assets/syntaxes/AWK
|
||||||
url = https://github.com/JohnNilsson/awk-sublime
|
url = https://github.com/JohnNilsson/awk-sublime
|
||||||
[submodule "assets/syntaxes/Nix"]
|
[submodule "assets/syntaxes/Nix"]
|
||||||
path = assets/syntaxes/02_Extra/Nix
|
path = assets/syntaxes/Nix
|
||||||
url = https://github.com/wmertens/sublime-nix
|
url = https://github.com/wmertens/sublime-nix
|
||||||
[submodule "assets/themes/zenburn"]
|
[submodule "assets/themes/zenburn"]
|
||||||
path = assets/themes/zenburn
|
path = assets/themes/zenburn
|
||||||
url = https://github.com/colinta/zenburn.git
|
url = https://github.com/colinta/zenburn.git
|
||||||
[submodule "assets/syntaxes/Kotlin"]
|
[submodule "assets/syntaxes/Kotlin"]
|
||||||
path = assets/syntaxes/02_Extra/Kotlin
|
path = assets/syntaxes/Kotlin
|
||||||
url = https://github.com/vkostyukov/kotlin-sublime-package
|
url = https://github.com/vkostyukov/kotlin-sublime-package
|
||||||
[submodule "assets/syntaxes/Elm"]
|
[submodule "assets/syntaxes/Elm"]
|
||||||
path = assets/syntaxes/02_Extra/Elm
|
path = assets/syntaxes/Elm
|
||||||
url = https://github.com/elm-community/SublimeElmLanguageSupport
|
url = https://github.com/elm-community/SublimeElmLanguageSupport
|
||||||
[submodule "assets/syntaxes/TypeScript"]
|
[submodule "assets/syntaxes/TypeScript"]
|
||||||
path = assets/syntaxes/02_Extra/TypeScript
|
path = assets/syntaxes/TypeScript
|
||||||
url = https://github.com/Microsoft/TypeScript-Sublime-Plugin
|
url = https://github.com/Microsoft/TypeScript-Sublime-Plugin
|
||||||
[submodule "assets/syntaxes/Puppet"]
|
[submodule "assets/syntaxes/Puppet"]
|
||||||
path = assets/syntaxes/02_Extra/Puppet
|
path = assets/syntaxes/Puppet
|
||||||
url = https://github.com/russCloak/SublimePuppet
|
url = https://github.com/russCloak/SublimePuppet
|
||||||
|
[submodule "assets/syntaxes/CSV"]
|
||||||
|
path = assets/syntaxes/CSV
|
||||||
|
url = https://github.com/wadetb/Sublime-Text-Advanced-CSV
|
||||||
[submodule "assets/themes/onehalf"]
|
[submodule "assets/themes/onehalf"]
|
||||||
path = assets/themes/onehalf
|
path = assets/themes/onehalf
|
||||||
url = https://github.com/sonph/onehalf
|
url = https://github.com/sonph/onehalf
|
||||||
[submodule "assets/syntaxes/JavaScript (Babel)"]
|
[submodule "assets/syntaxes/JavaScript (Babel)"]
|
||||||
path = assets/syntaxes/02_Extra/JavaScript (Babel)
|
path = assets/syntaxes/JavaScript (Babel)
|
||||||
url = https://github.com/babel/babel-sublime
|
url = https://github.com/babel/babel-sublime
|
||||||
|
[submodule "assets/syntaxes/Cabal"]
|
||||||
|
path = assets/syntaxes/Cabal
|
||||||
|
url = https://github.com/SublimeHaskell/SublimeHaskell
|
||||||
|
[submodule "assets/syntaxes/Dart"]
|
||||||
|
path = assets/syntaxes/Dart
|
||||||
|
url = https://github.com/guillermooo/dart-sublime-bundle
|
||||||
[submodule "assets/syntaxes/FSharp"]
|
[submodule "assets/syntaxes/FSharp"]
|
||||||
path = assets/syntaxes/02_Extra/FSharp
|
path = assets/syntaxes/FSharp
|
||||||
url = https://github.com/hoest/sublimetext-fsharp
|
url = https://github.com/hoest/sublimetext-fsharp
|
||||||
[submodule "assets/syntaxes/PureScript"]
|
[submodule "assets/syntaxes/PureScript"]
|
||||||
path = assets/syntaxes/02_Extra/PureScript
|
path = assets/syntaxes/PureScript
|
||||||
url = https://github.com/tellnobody1/sublime-purescript-syntax
|
url = https://github.com/tellnobody1/sublime-purescript-syntax
|
||||||
[submodule "assets/syntaxes/Swift"]
|
[submodule "assets/syntaxes/Swift"]
|
||||||
path = assets/syntaxes/02_Extra/Swift
|
path = assets/syntaxes/Swift
|
||||||
url = https://github.com/quiqueg/Swift-Sublime-Package
|
url = https://github.com/quiqueg/Swift-Sublime-Package
|
||||||
[submodule "assets/syntaxes/Crystal"]
|
[submodule "assets/syntaxes/Crystal"]
|
||||||
path = assets/syntaxes/02_Extra/Crystal
|
path = assets/syntaxes/Crystal
|
||||||
url = https://github.com/crystal-lang-tools/sublime-crystal.git
|
url = https://github.com/crystal-lang-tools/sublime-crystal.git
|
||||||
[submodule "assets/syntaxes/PowerShell"]
|
[submodule "assets/syntaxes/PowerShell"]
|
||||||
path = assets/syntaxes/02_Extra/PowerShell
|
path = assets/syntaxes/PowerShell
|
||||||
url = https://github.com/PowerShell/EditorSyntax
|
url = https://github.com/PowerShell/EditorSyntax
|
||||||
[submodule "assets/syntaxes/Robot"]
|
[submodule "assets/syntaxes/Robot"]
|
||||||
path = assets/syntaxes/02_Extra/Robot
|
path = assets/syntaxes/Robot
|
||||||
url = https://github.com/andriyko/sublime-robot-framework-assistant.git
|
url = https://github.com/andriyko/sublime-robot-framework-assistant.git
|
||||||
[submodule "assets/themes/sublime-snazzy"]
|
|
||||||
path = assets/themes/sublime-snazzy
|
|
||||||
url = https://github.com/greggb/sublime-snazzy
|
|
||||||
[submodule "assets/syntaxes/Assembly (ARM)"]
|
|
||||||
path = assets/syntaxes/02_Extra/Assembly (ARM)
|
|
||||||
url = https://github.com/tvi/Sublime-ARM-Assembly
|
|
||||||
[submodule "assets/syntaxes/protobuf-syntax-highlighting"]
|
|
||||||
path = assets/syntaxes/02_Extra/Protobuf
|
|
||||||
url = https://github.com/VcamX/protobuf-syntax-highlighting.git
|
|
||||||
branch = master
|
|
||||||
[submodule "assets/syntaxes/Terraform"]
|
|
||||||
path = assets/syntaxes/02_Extra/Terraform
|
|
||||||
url = https://github.com/alexlouden/Terraform.tmLanguage.git
|
|
||||||
[submodule "assets/syntaxes/Jsonnet"]
|
|
||||||
path = assets/syntaxes/02_Extra/Jsonnet
|
|
||||||
url = https://github.com/gburiola/sublime-jsonnet-syntax.git
|
|
||||||
[submodule "assets/syntaxes/varlink"]
|
|
||||||
path = assets/syntaxes/02_Extra/varlink
|
|
||||||
url = https://github.com/varlink/syntax-highlight-varlink.git
|
|
||||||
[submodule "assets/syntaxes/sublime-fish"]
|
|
||||||
path = assets/syntaxes/02_Extra/Fish
|
|
||||||
url = https://github.com/Phidica/sublime-fish.git
|
|
||||||
[submodule "assets/syntaxes/Org mode"]
|
|
||||||
path = assets/syntaxes/02_Extra/Org mode
|
|
||||||
url = https://github.com/jezcope/Org.tmbundle.git
|
|
||||||
[submodule "assets/syntaxes/DotENV"]
|
|
||||||
path = assets/syntaxes/02_Extra/DotENV
|
|
||||||
url = https://github.com/zaynali53/DotENV
|
|
||||||
[submodule "assets/syntaxes/hosts"]
|
|
||||||
path = assets/syntaxes/02_Extra/hosts
|
|
||||||
url = https://github.com/brandonwamboldt/sublime-hosts
|
|
||||||
[submodule "assets/syntaxes/ssh-config"]
|
|
||||||
path = assets/syntaxes/02_Extra/ssh-config
|
|
||||||
url = https://github.com/robballou/sublimetext-sshconfig.git
|
|
||||||
[submodule "assets/syntaxes/GraphQL"]
|
|
||||||
path = assets/syntaxes/02_Extra/GraphQL
|
|
||||||
url = https://github.com/dncrews/GraphQL-SublimeText3.git
|
|
||||||
[submodule "assets/syntaxes/Verilog"]
|
|
||||||
path = assets/syntaxes/02_Extra/Verilog
|
|
||||||
url = https://github.com/pro711/sublime-verilog
|
|
||||||
[submodule "assets/syntaxes/SCSS_Sass"]
|
|
||||||
path = assets/syntaxes/02_Extra/SCSS_Sass
|
|
||||||
url = https://github.com/braver/SublimeSass
|
|
||||||
[submodule "assets/syntaxes/Strace"]
|
|
||||||
path = assets/syntaxes/02_Extra/Strace
|
|
||||||
url = https://github.com/djuretic/SublimeStrace
|
|
||||||
[submodule "assets/syntaxes/Jinja2"]
|
|
||||||
path = assets/syntaxes/02_Extra/Jinja2
|
|
||||||
url = https://github.com/Martin819/sublime-jinja2
|
|
||||||
[submodule "assets/syntaxes/SLS"]
|
|
||||||
path = assets/syntaxes/02_Extra/SLS
|
|
||||||
url = https://github.com/saltstack/sublime-text
|
|
||||||
branch = master
|
|
||||||
[submodule "assets/themes/dracula-sublime"]
|
|
||||||
path = assets/themes/dracula-sublime
|
|
||||||
url = https://github.com/dracula/sublime.git
|
|
||||||
[submodule "assets/syntaxes/HTML (Twig)"]
|
|
||||||
path = assets/syntaxes/02_Extra/HTML (Twig)
|
|
||||||
url = https://github.com/Anomareh/PHP-Twig.tmbundle.git
|
|
||||||
[submodule "assets/themes/Nord-sublime"]
|
|
||||||
path = assets/themes/Nord-sublime
|
|
||||||
url = https://github.com/crabique/Nord-plist.git
|
|
||||||
[submodule "assets/syntaxes/Vue"]
|
|
||||||
path = assets/syntaxes/02_Extra/Vue
|
|
||||||
url = https://github.com/vuejs/vue-syntax-highlight.git
|
|
||||||
branch = new
|
|
||||||
[submodule "assets/syntaxes/CoffeeScript"]
|
|
||||||
path = assets/syntaxes/02_Extra/CoffeeScript
|
|
||||||
url = https://github.com/sustained/CoffeeScript-Sublime-Plugin
|
|
||||||
[submodule "assets/syntaxes/02_Extra/Stylus"]
|
|
||||||
path = assets/syntaxes/02_Extra/Stylus
|
|
||||||
url = https://github.com/billymoon/Stylus
|
|
||||||
[submodule "assets/themes/Solarized"]
|
|
||||||
path = assets/themes/Solarized
|
|
||||||
url = https://github.com/braver/Solarized
|
|
||||||
[submodule "assets/syntaxes/02_Extra/Fortran"]
|
|
||||||
path = assets/syntaxes/02_Extra/Fortran
|
|
||||||
url = https://github.com/315234/SublimeFortran
|
|
||||||
[submodule "assets/syntaxes/02_Extra/Email"]
|
|
||||||
path = assets/syntaxes/02_Extra/Email
|
|
||||||
url = https://github.com/mariozaizar/email.sublime-syntax.git
|
|
||||||
[submodule "assets/syntaxes/02_Extra/QML"]
|
|
||||||
path = assets/syntaxes/02_Extra/QML
|
|
||||||
url = https://github.com/skozlovf/Sublime-QML
|
|
||||||
[submodule "assets/syntaxes/02_Extra/AsciiDoc"]
|
|
||||||
path = assets/syntaxes/02_Extra/AsciiDoc
|
|
||||||
url = https://github.com/asciidoctor/sublimetext-asciidoc.git
|
|
||||||
[submodule "assets/syntaxes/02_Extra/GLSL"]
|
|
||||||
path = assets/syntaxes/02_Extra/GLSL
|
|
||||||
url = https://github.com/euler0/sublime-glsl
|
|
||||||
[submodule "assets/syntaxes/02_Extra/Nginx"]
|
|
||||||
path = assets/syntaxes/02_Extra/Nginx
|
|
||||||
url = https://github.com/brandonwamboldt/sublime-nginx
|
|
||||||
[submodule "assets/syntaxes/02_Extra/Apache"]
|
|
||||||
path = assets/syntaxes/02_Extra/Apache
|
|
||||||
url = https://github.com/colinta/ApacheConf.tmLanguage
|
|
||||||
[submodule "assets/syntaxes/02_Extra/Ninja"]
|
|
||||||
path = assets/syntaxes/02_Extra/Ninja
|
|
||||||
url = https://github.com/pope/SublimeNinja.git
|
|
||||||
[submodule "assets/syntaxes/02_Extra/Svelte"]
|
|
||||||
path = assets/syntaxes/02_Extra/Svelte
|
|
||||||
url = https://github.com/corneliusio/svelte-sublime
|
|
||||||
[submodule "assets/themes/Coldark"]
|
|
||||||
path = assets/themes/Coldark
|
|
||||||
url = https://github.com/ArmandPhilippot/coldark-bat.git
|
|
||||||
[submodule "assets/themes/gruvbox"]
|
|
||||||
path = assets/themes/gruvbox
|
|
||||||
url = https://github.com/subnut/gruvbox-tmTheme.git
|
|
||||||
branch = bat-source
|
|
||||||
[submodule "assets/syntaxes/02_Extra/Lean"]
|
|
||||||
path = assets/syntaxes/02_Extra/Lean
|
|
||||||
url = https://github.com/leanprover/vscode-lean.git
|
|
||||||
[submodule "assets/syntaxes/02_Extra/LiveScript"]
|
|
||||||
path = assets/syntaxes/02_Extra/LiveScript
|
|
||||||
url = https://github.com/paulmillr/LiveScript.tmbundle
|
|
||||||
[submodule "assets/syntaxes/02_Extra/Zig"]
|
|
||||||
path = assets/syntaxes/02_Extra/Zig
|
|
||||||
url = https://github.com/ziglang/sublime-zig-language.git
|
|
||||||
[submodule "assets/syntaxes/02_Extra/gnuplot"]
|
|
||||||
path = assets/syntaxes/02_Extra/gnuplot
|
|
||||||
url = https://github.com/hesstobi/sublime_gnuplot
|
|
||||||
[submodule "assets/syntaxes/02_Extra/SystemVerilog"]
|
|
||||||
path = assets/syntaxes/02_Extra/SystemVerilog
|
|
||||||
url = https://github.com/TheClams/SystemVerilog.git
|
|
||||||
[submodule "assets/themes/visual-studio-dark-plus"]
|
|
||||||
path = assets/themes/visual-studio-dark-plus
|
|
||||||
url = https://github.com/vidann1/visual-studio-dark-plus.git
|
|
||||||
[submodule "assets/syntaxes/02_Extra/SublimeEthereum"]
|
|
||||||
path = assets/syntaxes/02_Extra/SublimeEthereum
|
|
||||||
url = https://github.com/davidhq/SublimeEthereum.git
|
|
||||||
[submodule "assets/syntaxes/02_Extra/Groff"]
|
|
||||||
path = assets/syntaxes/02_Extra/Groff
|
|
||||||
url = https://github.com/carsonoid/sublime_man_page_support
|
|
||||||
[submodule "assets/syntaxes/02_Extra/http-request-response"]
|
|
||||||
path = assets/syntaxes/02_Extra/http-request-response
|
|
||||||
url = https://github.com/keith-hall/http-request-response-syntax.git
|
|
||||||
[submodule "assets/syntaxes/02_Extra/LLVM"]
|
|
||||||
path = assets/syntaxes/02_Extra/LLVM
|
|
||||||
url = https://github.com/ioncodes/LLVM.tmBundle
|
|
||||||
[submodule "assets/syntaxes/02_Extra/Slim"]
|
|
||||||
path = assets/syntaxes/02_Extra/Slim
|
|
||||||
url = https://github.com/slim-template/ruby-slim.tmbundle.git
|
|
||||||
[submodule "assets/syntaxes/02_Extra/Racket"]
|
|
||||||
path = assets/syntaxes/02_Extra/Racket
|
|
||||||
url = https://github.com/follesoe/sublime-racket.git
|
|
||||||
[submodule "assets/syntaxes/02_Extra/MediaWiki"]
|
|
||||||
path = assets/syntaxes/02_Extra/MediaWiki
|
|
||||||
url = https://github.com/tosher/Mediawiker.git
|
|
||||||
[submodule "assets/syntaxes/02_Extra/Dart"]
|
|
||||||
path = assets/syntaxes/02_Extra/Dart
|
|
||||||
url = https://github.com/elMuso/Dartlight.git
|
|
||||||
[submodule "assets/syntaxes/02_Extra/SublimeJQ"]
|
|
||||||
path = assets/syntaxes/02_Extra/SublimeJQ
|
|
||||||
url = https://github.com/zogwarg/SublimeJQ.git
|
|
||||||
[submodule "assets/syntaxes/02_Extra/cmd-help"]
|
|
||||||
path = assets/syntaxes/02_Extra/cmd-help
|
|
||||||
url = https://github.com/victor-gp/cmd-help-sublime-syntax.git
|
|
||||||
branch = main
|
|
||||||
shallow = true
|
|
||||||
[submodule "assets/syntaxes/02_Extra/TodoTxt"]
|
|
||||||
path = assets/syntaxes/02_Extra/TodoTxt
|
|
||||||
url = https://github.com/dertuxmalwieder/SublimeTodoTxt
|
|
||||||
[submodule "assets/syntaxes/02_Extra/Ada"]
|
|
||||||
path = assets/syntaxes/02_Extra/Ada
|
|
||||||
url = https://github.com/wiremoons/ada-sublime-syntax
|
|
||||||
|
|
||||||
[submodule "assets/syntaxes/02_Extra/Crontab"]
|
|
||||||
path = assets/syntaxes/02_Extra/Crontab
|
|
||||||
url = https://github.com/michaelblyons/SublimeSyntax-Crontab
|
|
||||||
[submodule "assets/syntaxes/02_Extra/NSIS"]
|
|
||||||
path = assets/syntaxes/02_Extra/NSIS
|
|
||||||
url = https://github.com/SublimeText/NSIS
|
|
||||||
[submodule "assets/syntaxes/02_Extra/vscode-wgsl"]
|
|
||||||
path = assets/syntaxes/02_Extra/vscode-wgsl
|
|
||||||
url = https://github.com/PolyMeilex/vscode-wgsl.git
|
|
||||||
[submodule "assets/syntaxes/02_Extra/CFML"]
|
|
||||||
path = assets/syntaxes/02_Extra/CFML
|
|
||||||
url = https://github.com/jcberquist/sublimetext-cfml.git
|
|
||||||
|
105
.travis.yml
Normal file
105
.travis.yml
Normal file
@ -0,0 +1,105 @@
|
|||||||
|
language: rust
|
||||||
|
cache: cargo
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
# Stable channel.
|
||||||
|
- os: linux
|
||||||
|
rust: stable
|
||||||
|
env: TARGET=x86_64-unknown-linux-gnu
|
||||||
|
- os: linux
|
||||||
|
rust: stable
|
||||||
|
env:
|
||||||
|
- TARGET=x86_64-unknown-linux-musl
|
||||||
|
- CC_x86_64_unknown_linux_musl=/usr/bin/musl-gcc
|
||||||
|
- os: linux
|
||||||
|
rust: stable
|
||||||
|
env: TARGET=i686-unknown-linux-gnu
|
||||||
|
- os: osx
|
||||||
|
rust: stable
|
||||||
|
env: TARGET=x86_64-apple-darwin
|
||||||
|
- os: linux
|
||||||
|
rust: stable
|
||||||
|
env:
|
||||||
|
- TARGET=arm-unknown-linux-gnueabihf
|
||||||
|
- CC_arm_unknown_linux_gnueabihf=/usr/bin/arm-linux-gnueabihf-gcc-4.8
|
||||||
|
- CARGO_TARGET_ARM_UNKNOWN_LINUX_GNUEABIHF_LINKER=arm-linux-gnueabihf-gcc-4.8
|
||||||
|
- os: linux
|
||||||
|
rust: stable
|
||||||
|
env:
|
||||||
|
- TARGET=aarch64-unknown-linux-gnu
|
||||||
|
- CC_aarch64-unknown-linux-gnu=/usr/bin/aarch64-linux-gnu-gcc-4.8
|
||||||
|
- CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc-4.8
|
||||||
|
|
||||||
|
# Minimum Rust supported channel.
|
||||||
|
- os: linux
|
||||||
|
rust: 1.29.0
|
||||||
|
env: TARGET=x86_64-unknown-linux-gnu
|
||||||
|
- os: linux
|
||||||
|
rust: 1.29.0
|
||||||
|
env:
|
||||||
|
- TARGET=x86_64-unknown-linux-musl
|
||||||
|
- CC_x86_64_unknown_linux_musl=/usr/bin/musl-gcc
|
||||||
|
- os: osx
|
||||||
|
rust: 1.29.0
|
||||||
|
env: TARGET=x86_64-apple-darwin
|
||||||
|
|
||||||
|
# Code formatting check
|
||||||
|
- os: linux
|
||||||
|
rust: nightly
|
||||||
|
# skip the global install step
|
||||||
|
install:
|
||||||
|
- cargo install --debug --force rustfmt-nightly
|
||||||
|
script: cargo fmt -- --check
|
||||||
|
|
||||||
|
sudo: required
|
||||||
|
|
||||||
|
before_install:
|
||||||
|
- ci/before_install.bash
|
||||||
|
|
||||||
|
env:
|
||||||
|
global:
|
||||||
|
# Default target on travis-ci.
|
||||||
|
# Used as conditional check in the install stage
|
||||||
|
- HOST=x86_64-unknown-linux-gnu
|
||||||
|
# Used on the deployment script
|
||||||
|
- PROJECT_NAME=bat
|
||||||
|
|
||||||
|
install:
|
||||||
|
# prevent target re-add error from rustup
|
||||||
|
- if [[ $TRAVIS_OS_NAME = linux && $HOST != $TARGET ]]; then rustup target add $TARGET; fi
|
||||||
|
|
||||||
|
script:
|
||||||
|
- ci/script.bash
|
||||||
|
|
||||||
|
before_deploy:
|
||||||
|
- bash ci/before_deploy.bash
|
||||||
|
|
||||||
|
deploy:
|
||||||
|
provider: releases
|
||||||
|
# NOTE updating the `api_key.secure`
|
||||||
|
# - go to: https://github.com/settings/tokens/new
|
||||||
|
# - generate new token using `public_repo` scope
|
||||||
|
# - encrypt it using: `travis encrypt API_KEY_HERE`
|
||||||
|
# - paste the output below
|
||||||
|
api_key:
|
||||||
|
secure: "GZL8nYk+/MZGEqejpP0UMMGVmwUEdxiF9CflFIGccu+/tznDyHnHOpyJmbH3M5IKWIxa7xFgqOE8pHuD4oQXt4mzyJGB0KMKKEFLW7ckbTYKya5bw0heKznaqGnS0Yz+vpfqYR25eiPFYCz7mDsGsCzH5QZqt3cdn9MDQGu1D0IaxPjuBNH3T9kBblR0ifBd3Diy0JYhiVcMSI3V1rkel18F1yBHO2GQ95hkWxVgjANQnefq5+zdzbx4ki539ewYENShA8N0w6ULJVY9LmWRWJIp90ggOD3JCH6Nz/fBpYBqwfABO6Dr7Csw7IRm7pM4IVkFZS1taiDYFX9thxZh3UTmI4YYtSTPxH9NGV47kxPipbf4vAXFwW+1VcHKMpBzz+5IVsHnk1Pfx9/GZsXbqXM3PUWCStec36Xtqh5vQapDKEg9khkEs4b1X7/E73gvpRuQl9gbnyufSVWgDsXIWqM+0aDbqQz1FpLmVxz6eij0cB9vR+8kbNoe/CEPHPO9ZllvAHseukOeHPzSBd8rILORXaaGmQausXz2wWgSsffUSYz4705P8joI0zFCfmkHjL+kA1ZUx5SxLCc1ID7CFFZChhAxHoPL7xc21snswwr8QeheERdwvuzKNaerBGZEw8dmMMx98YkjftIj65DDySr2mRZuufBQeQpmMhFyIT4="
|
||||||
|
# for uploading multiple files
|
||||||
|
file_glob: true
|
||||||
|
# NOTE explanation on each env variable
|
||||||
|
# - PROJECT_NAME: name of the project, set on the `env.global` above
|
||||||
|
# - TRAVIS_TAG: tag name that the build is being deployed for, usually the version number
|
||||||
|
# - TARGET: target triple of the build
|
||||||
|
file:
|
||||||
|
- $PROJECT_NAME-$TRAVIS_TAG-$TARGET.*
|
||||||
|
- $PROJECT_NAME*.deb
|
||||||
|
# don't delete artifacts from previous stage
|
||||||
|
skip_cleanup: true
|
||||||
|
on:
|
||||||
|
# deploy only if we push a tag
|
||||||
|
tags: true
|
||||||
|
# deploy only on stable channel that has TARGET env variable sets
|
||||||
|
condition: $TRAVIS_RUST_VERSION = stable && $TARGET != ""
|
||||||
|
|
||||||
|
notifications:
|
||||||
|
email:
|
||||||
|
on_success: never
|
1198
CHANGELOG.md
1198
CHANGELOG.md
File diff suppressed because it is too large
Load Diff
@ -1,91 +0,0 @@
|
|||||||
# Contributing
|
|
||||||
|
|
||||||
Thank you for considering to contribute to `bat`!
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## Add an entry to the changelog
|
|
||||||
|
|
||||||
Keeping the [`CHANGELOG.md`](CHANGELOG.md) file up-to-date makes the release
|
|
||||||
process much easier and therefore helps to get your changes into a new `bat`
|
|
||||||
release faster. However, not every change to the repository requires a
|
|
||||||
changelog entry. Below are a few examples of that.
|
|
||||||
|
|
||||||
Please update the changelog if your contribution contains changes regarding
|
|
||||||
any of the following:
|
|
||||||
- the behavior of `bat`
|
|
||||||
- syntax mappings
|
|
||||||
- syntax definitions
|
|
||||||
- themes
|
|
||||||
- the build system, linting, or CI workflows
|
|
||||||
|
|
||||||
A changelog entry is not necessary when:
|
|
||||||
- updating documentation
|
|
||||||
- fixing typos
|
|
||||||
|
|
||||||
>[!NOTE]
|
|
||||||
> For PRs, a CI workflow verifies that a suitable changelog entry is
|
|
||||||
> added. If such an entry is missing, the workflow will fail. If your
|
|
||||||
> changes do not need an entry to the changelog (see above), that
|
|
||||||
> workflow failure can be disregarded.
|
|
||||||
|
|
||||||
|
|
||||||
### Changelog entry format
|
|
||||||
|
|
||||||
The top of the `CHANGELOG` contains a *"unreleased"* section with a few
|
|
||||||
subsections (Features, Bugfixes, …). Please add your entry to the subsection
|
|
||||||
that best describes your change.
|
|
||||||
|
|
||||||
Entries must follow this format:
|
|
||||||
```
|
|
||||||
- Short description of what has been changed, see #123 (@user)
|
|
||||||
```
|
|
||||||
Please replace `#123` with the number of your pull request (not issue) and
|
|
||||||
`@user` by your GitHub username.
|
|
||||||
|
|
||||||
|
|
||||||
## Development
|
|
||||||
|
|
||||||
Please check out the [Development](https://github.com/sharkdp/bat#development)
|
|
||||||
section in the README.
|
|
||||||
|
|
||||||
|
|
||||||
## Adding a new feature
|
|
||||||
|
|
||||||
Please consider opening a
|
|
||||||
[feature request ticket](https://github.com/sharkdp/bat/issues/new?assignees=&labels=feature-request&template=feature_request.md)
|
|
||||||
first in order to give us a chance to discuss the details and specifics of the potential new feature before you go and build it.
|
|
||||||
|
|
||||||
|
|
||||||
## Adding new syntaxes/languages or themes
|
|
||||||
|
|
||||||
Before you make a pull request that adds a new syntax or theme, please read
|
|
||||||
the [Customization](https://github.com/sharkdp/bat#customization) section
|
|
||||||
in the README first.
|
|
||||||
|
|
||||||
If you really think that a particular syntax or theme should be added for all
|
|
||||||
users, please read the corresponding
|
|
||||||
[documentation](https://github.com/sharkdp/bat/blob/master/doc/assets.md)
|
|
||||||
first.
|
|
||||||
|
|
||||||
|
|
||||||
## Regression tests
|
|
||||||
|
|
||||||
You are **strongly encouraged** to add regression tests. Regression tests are great,
|
|
||||||
not least because they:
|
|
||||||
|
|
||||||
* ensure that your contribution will never completely stop working.
|
|
||||||
|
|
||||||
* makes code reviews easier, because it becomes very clear what the code is
|
|
||||||
supposed to do.
|
|
||||||
|
|
||||||
For functional changes, you most likely want to add a test to
|
|
||||||
[`tests/integration_tests.rs`](https://github.com/sharkdp/bat/blob/master/tests/integration_tests.rs).
|
|
||||||
Look at existing tests to know how to write a new test. In short, you will
|
|
||||||
invoke the `bat` binary with a certain set of arguments, and then assert on
|
|
||||||
stdout/stderr.
|
|
||||||
|
|
||||||
To learn how to write regression tests for theme and syntax changes, read the
|
|
||||||
[Syntax
|
|
||||||
tests](https://github.com/sharkdp/bat/blob/master/doc/assets.md#syntax-tests)
|
|
||||||
section in `assets.md`.
|
|
1845
Cargo.lock
generated
1845
Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
133
Cargo.toml
133
Cargo.toml
@ -1,123 +1,54 @@
|
|||||||
[package]
|
[package]
|
||||||
authors = ["David Peter <mail@david-peter.de>"]
|
authors = ["David Peter <mail@david-peter.de>"]
|
||||||
categories = ["command-line-utilities"]
|
categories = ["command-line-utilities"]
|
||||||
description = "A cat(1) clone with wings."
|
description="A cat(1) clone with wings."
|
||||||
homepage = "https://github.com/sharkdp/bat"
|
homepage = "https://github.com/sharkdp/bat"
|
||||||
license = "MIT OR Apache-2.0"
|
license = "MIT/Apache-2.0"
|
||||||
name = "bat"
|
name = "bat"
|
||||||
|
readme = "README.md"
|
||||||
repository = "https://github.com/sharkdp/bat"
|
repository = "https://github.com/sharkdp/bat"
|
||||||
version = "0.24.0"
|
version = "0.8.0"
|
||||||
exclude = ["assets/syntaxes/*", "assets/themes/*"]
|
exclude = [
|
||||||
build = "build/main.rs"
|
"assets/syntaxes/*",
|
||||||
edition = '2021'
|
"assets/themes/*",
|
||||||
rust-version = "1.70"
|
|
||||||
|
|
||||||
[features]
|
|
||||||
default = ["application"]
|
|
||||||
# Feature required for bat the application. Should be disabled when depending on
|
|
||||||
# bat as a library.
|
|
||||||
application = [
|
|
||||||
"bugreport",
|
|
||||||
"build-assets",
|
|
||||||
"git",
|
|
||||||
"minimal-application",
|
|
||||||
]
|
]
|
||||||
# Mainly for developers that want to iterate quickly
|
build = "build.rs"
|
||||||
# Be aware that the included features might change in the future
|
|
||||||
minimal-application = [
|
|
||||||
"clap",
|
|
||||||
"etcetera",
|
|
||||||
"paging",
|
|
||||||
"regex-onig",
|
|
||||||
"wild",
|
|
||||||
]
|
|
||||||
git = ["git2"] # Support indicating git modifications
|
|
||||||
paging = ["shell-words", "grep-cli"] # Support applying a pager on the output
|
|
||||||
lessopen = ["run_script", "os_str_bytes"] # Support $LESSOPEN preprocessor
|
|
||||||
build-assets = ["syntect/yaml-load", "syntect/plist-load", "regex", "walkdir"]
|
|
||||||
|
|
||||||
# You need to use one of these if you depend on bat as a library:
|
|
||||||
regex-onig = ["syntect/regex-onig"] # Use the "oniguruma" regex engine
|
|
||||||
regex-fancy = ["syntect/regex-fancy"] # Use the rust-only "fancy-regex" engine
|
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
nu-ansi-term = "0.50.0"
|
atty = "0.2.2"
|
||||||
ansi_colours = "^1.2"
|
ansi_term = "0.11"
|
||||||
bincode = "1.0"
|
ansi_colours = "^1.0"
|
||||||
console = "0.15.8"
|
console = "0.6"
|
||||||
flate2 = "1.0"
|
directories = "1.0"
|
||||||
once_cell = "1.19"
|
lazy_static = "1.0"
|
||||||
thiserror = "1.0"
|
wild = "2.0"
|
||||||
wild = { version = "2.2", optional = true }
|
content_inspector = "0.2.3"
|
||||||
content_inspector = "0.2.4"
|
encoding = "0.2"
|
||||||
shell-words = { version = "1.1.0", optional = true }
|
shell-words = "0.1.0"
|
||||||
unicode-width = "0.1.13"
|
|
||||||
globset = "0.4"
|
|
||||||
serde = "1.0"
|
|
||||||
serde_derive = "1.0"
|
|
||||||
serde_yaml = "0.9.28"
|
|
||||||
semver = "1.0"
|
|
||||||
path_abs = { version = "0.5", default-features = false }
|
|
||||||
clircle = "0.5"
|
|
||||||
bugreport = { version = "0.5.0", optional = true }
|
|
||||||
etcetera = { version = "0.8.0", optional = true }
|
|
||||||
grep-cli = { version = "0.1.10", optional = true }
|
|
||||||
regex = { version = "1.10.2", optional = true }
|
|
||||||
walkdir = { version = "2.5", optional = true }
|
|
||||||
bytesize = { version = "1.3.0" }
|
|
||||||
encoding_rs = "0.8.34"
|
|
||||||
os_str_bytes = { version = "~7.0", optional = true }
|
|
||||||
run_script = { version = "^0.10.1", optional = true}
|
|
||||||
|
|
||||||
[dependencies.git2]
|
[dependencies.git2]
|
||||||
version = "0.18"
|
version = "0.7"
|
||||||
optional = true
|
|
||||||
default-features = false
|
default-features = false
|
||||||
|
features = []
|
||||||
|
|
||||||
[dependencies.syntect]
|
[dependencies.syntect]
|
||||||
version = "5.2.0"
|
version = "3.0.1"
|
||||||
default-features = false
|
default-features = false
|
||||||
features = ["parsing"]
|
features = ["parsing", "yaml-load", "dump-load", "dump-create"]
|
||||||
|
|
||||||
[dependencies.clap]
|
[dependencies.clap]
|
||||||
version = "4.4.12"
|
version = "2.32"
|
||||||
optional = true
|
default-features = false
|
||||||
features = ["wrap_help", "cargo"]
|
features = ["suggestions", "color", "wrap_help"]
|
||||||
|
|
||||||
[target.'cfg(target_os = "macos")'.dependencies]
|
[dependencies.error-chain]
|
||||||
home = "0.5.9"
|
version = "0.12"
|
||||||
plist = "1.7.0"
|
default-features = false
|
||||||
|
features = []
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
assert_cmd = "2.0.12"
|
tempdir = "0.3"
|
||||||
expect-test = "1.5.0"
|
assert_cmd = "0.10.1"
|
||||||
serial_test = { version = "2.0.0", default-features = false }
|
|
||||||
predicates = "3.1.0"
|
|
||||||
wait-timeout = "0.2.0"
|
|
||||||
tempfile = "3.8.1"
|
|
||||||
serde = { version = "1.0", features = ["derive"] }
|
|
||||||
|
|
||||||
[target.'cfg(unix)'.dev-dependencies]
|
|
||||||
nix = { version = "0.26.4", default-features = false, features = ["term"] }
|
|
||||||
|
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
anyhow = "1.0.86"
|
clap = "2.32"
|
||||||
indexmap = { version = "2.3.0", features = ["serde"] }
|
|
||||||
itertools = "0.13.0"
|
|
||||||
once_cell = "1.18"
|
|
||||||
regex = "1.10.2"
|
|
||||||
serde = "1.0"
|
|
||||||
serde_derive = "1.0"
|
|
||||||
serde_with = { version = "3.8.1", default-features = false, features = ["macros"] }
|
|
||||||
toml = { version = "0.8.9", features = ["preserve_order"] }
|
|
||||||
walkdir = "2.5"
|
|
||||||
|
|
||||||
[build-dependencies.clap]
|
|
||||||
version = "4.4.12"
|
|
||||||
optional = true
|
|
||||||
features = ["wrap_help", "cargo"]
|
|
||||||
|
|
||||||
[profile.release]
|
|
||||||
lto = true
|
|
||||||
strip = true
|
|
||||||
codegen-units = 1
|
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
Copyright (c) 2018-2023 bat-developers (https://github.com/sharkdp/bat).
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
in the Software without restriction, including without limitation the rights
|
in the Software without restriction, including without limitation the rights
|
||||||
|
6
NOTICE
6
NOTICE
@ -1,6 +0,0 @@
|
|||||||
Copyright (c) 2018-2021 bat-developers (https://github.com/sharkdp/bat).
|
|
||||||
|
|
||||||
bat is made available under the terms of either the MIT License or the Apache
|
|
||||||
License 2.0, at your option.
|
|
||||||
|
|
||||||
See the LICENSE-APACHE and LICENSE-MIT files for license details.
|
|
712
README.md
712
README.md
@ -1,6 +1,7 @@
|
|||||||
<p align="center">
|
<p align="center">
|
||||||
<img src="doc/logo-header.svg" alt="bat - a cat clone with wings"><br>
|
<img src="doc/logo-header.svg" alt="bat - a cat clone with wings"><br>
|
||||||
<a href="https://github.com/sharkdp/bat/actions?query=workflow%3ACICD"><img src="https://github.com/sharkdp/bat/workflows/CICD/badge.svg" alt="Build Status"></a>
|
<a href="https://travis-ci.org/sharkdp/bat"><img src="https://travis-ci.org/sharkdp/bat.svg?branch=master" alt="Build Status"></a>
|
||||||
|
<a href="https://ci.appveyor.com/project/sharkdp/bat"><img src="https://ci.appveyor.com/api/projects/status/cptsmtbiwbnr2vhf?svg=true"></a>
|
||||||
<img src="https://img.shields.io/crates/l/bat.svg" alt="license">
|
<img src="https://img.shields.io/crates/l/bat.svg" alt="license">
|
||||||
<a href="https://crates.io/crates/bat"><img src="https://img.shields.io/crates/v/bat.svg?colorB=319e8c" alt="Version info"></a><br>
|
<a href="https://crates.io/crates/bat"><img src="https://img.shields.io/crates/v/bat.svg?colorB=319e8c" alt="Version info"></a><br>
|
||||||
A <i>cat(1)</i> clone with syntax highlighting and Git integration.
|
A <i>cat(1)</i> clone with syntax highlighting and Git integration.
|
||||||
@ -11,37 +12,9 @@
|
|||||||
<a href="#how-to-use">How To Use</a> •
|
<a href="#how-to-use">How To Use</a> •
|
||||||
<a href="#installation">Installation</a> •
|
<a href="#installation">Installation</a> •
|
||||||
<a href="#customization">Customization</a> •
|
<a href="#customization">Customization</a> •
|
||||||
<a href="#project-goals-and-alternatives">Project goals, alternatives</a><br>
|
<a href="#project-goals-and-alternatives">Project goals, alternatives</a>
|
||||||
[English]
|
|
||||||
[<a href="doc/README-zh.md">中文</a>]
|
|
||||||
[<a href="doc/README-ja.md">日本語</a>]
|
|
||||||
[<a href="doc/README-ko.md">한국어</a>]
|
|
||||||
[<a href="doc/README-ru.md">Русский</a>]
|
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
### Sponsors
|
|
||||||
|
|
||||||
A special *thank you* goes to our biggest <a href="doc/sponsors.md">sponsors</a>:<br>
|
|
||||||
<a href="https://workos.com/?utm_campaign=github_repo&utm_medium=referral&utm_content=bat&utm_source=github">
|
|
||||||
<img src="doc/sponsors/workos-logo-white-bg.svg" width="200" alt="WorkOS">
|
|
||||||
<br>
|
|
||||||
<strong>Your app, enterprise-ready.</strong>
|
|
||||||
<br>
|
|
||||||
<sub>Start selling to enterprise customers with just a few lines of code.</sub>
|
|
||||||
<br>
|
|
||||||
<sup>Add Single Sign-On (and more) in minutes instead of months.</sup>
|
|
||||||
</a>
|
|
||||||
|
|
||||||
<a href="https://www.warp.dev/?utm_source=github&utm_medium=referral&utm_campaign=bat_20231001">
|
|
||||||
<img src="doc/sponsors/warp-logo.png" width="200" alt="Warp">
|
|
||||||
<br>
|
|
||||||
<strong>Warp is a modern, Rust-based terminal with AI built in<br>so you and your team can build great software, faster.</strong>
|
|
||||||
<br>
|
|
||||||
<sub>Feel more productive on the command line with parameterized commands,</sub>
|
|
||||||
<br>
|
|
||||||
<sup>autosuggestions, and an IDE-like text editor.</sup>
|
|
||||||
</a>
|
|
||||||
|
|
||||||
### Syntax highlighting
|
### Syntax highlighting
|
||||||
|
|
||||||
`bat` supports syntax highlighting for a large number of programming and markup
|
`bat` supports syntax highlighting for a large number of programming and markup
|
||||||
@ -56,23 +29,15 @@ languages:
|
|||||||
|
|
||||||
![Git integration example](https://i.imgur.com/2lSW4RE.png)
|
![Git integration example](https://i.imgur.com/2lSW4RE.png)
|
||||||
|
|
||||||
### Show non-printable characters
|
|
||||||
|
|
||||||
You can use the `-A`/`--show-all` option to show and highlight non-printable
|
|
||||||
characters:
|
|
||||||
|
|
||||||
![Non-printable character example](https://i.imgur.com/WndGp9H.png)
|
|
||||||
|
|
||||||
### Automatic paging
|
### Automatic paging
|
||||||
|
|
||||||
By default, `bat` pipes its own output to a pager (e.g. `less`) if the output is too large for one screen.
|
`bat` can pipe its own output to `less` if the output is too large for one screen.
|
||||||
If you would rather `bat` work like `cat` all the time (never page output), you can set `--paging=never` as an option, either on the command line or in your configuration file.
|
|
||||||
If you intend to alias `cat` to `bat` in your shell configuration, you can use `alias cat='bat --paging=never'` to preserve the default behavior.
|
|
||||||
|
|
||||||
#### File concatenation
|
### File concatenation
|
||||||
|
|
||||||
Even with a pager set, you can still use `bat` to concatenate files :wink:.
|
Oh.. you can also use it to concatenate files :wink:. Whenever
|
||||||
Whenever `bat` detects a non-interactive terminal (i.e. when you pipe into another process or into a file), `bat` will act as a drop-in replacement for `cat` and fall back to printing the plain file contents, regardless of the `--pager` option's value.
|
`bat` detects a non-interactive terminal, it will fall back to printing
|
||||||
|
the plain file contents.
|
||||||
|
|
||||||
## How to use
|
## How to use
|
||||||
|
|
||||||
@ -88,9 +53,7 @@ Display multiple files at once
|
|||||||
> bat src/*.rs
|
> bat src/*.rs
|
||||||
```
|
```
|
||||||
|
|
||||||
Read from stdin, determine the syntax automatically (note, highlighting will
|
Read from stdin, determine the syntax automatically
|
||||||
only work if the syntax can be determined from the first line of the file,
|
|
||||||
usually through a shebang such as `#!/bin/sh`)
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
> curl -s https://sh.rustup.rs | bat
|
> curl -s https://sh.rustup.rs | bat
|
||||||
@ -102,12 +65,8 @@ Read from stdin, specify the language explicitly
|
|||||||
> yaml2json .travis.yml | json_pp | bat -l json
|
> yaml2json .travis.yml | json_pp | bat -l json
|
||||||
```
|
```
|
||||||
|
|
||||||
Show and highlight non-printable characters:
|
|
||||||
```bash
|
|
||||||
> bat -A /etc/hosts
|
|
||||||
```
|
|
||||||
|
|
||||||
Use it as a `cat` replacement:
|
As a replacement for `cat`:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
bat > note.md # quickly create a new file
|
bat > note.md # quickly create a new file
|
||||||
@ -119,227 +78,31 @@ bat -n main.rs # show line numbers (only)
|
|||||||
bat f - g # output 'f', then stdin, then 'g'.
|
bat f - g # output 'f', then stdin, then 'g'.
|
||||||
```
|
```
|
||||||
|
|
||||||
### Integration with other tools
|
|
||||||
|
|
||||||
#### `fzf`
|
|
||||||
|
|
||||||
You can use `bat` as a previewer for [`fzf`](https://github.com/junegunn/fzf). To do this,
|
|
||||||
use `bat`s `--color=always` option to force colorized output. You can also use `--line-range`
|
|
||||||
option to restrict the load times for long files:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
fzf --preview "bat --color=always --style=numbers --line-range=:500 {}"
|
|
||||||
```
|
|
||||||
|
|
||||||
For more information, see [`fzf`'s `README`](https://github.com/junegunn/fzf#preview-window).
|
|
||||||
|
|
||||||
#### `find` or `fd`
|
|
||||||
|
|
||||||
You can use the `-exec` option of `find` to preview all search results with `bat`:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
find … -exec bat {} +
|
|
||||||
```
|
|
||||||
|
|
||||||
If you happen to use [`fd`](https://github.com/sharkdp/fd), you can use the `-X`/`--exec-batch` option to do the same:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
fd … -X bat
|
|
||||||
```
|
|
||||||
|
|
||||||
#### `ripgrep`
|
|
||||||
|
|
||||||
With [`batgrep`](https://github.com/eth-p/bat-extras/blob/master/doc/batgrep.md), `bat` can be used as the printer for [`ripgrep`](https://github.com/BurntSushi/ripgrep) search results.
|
|
||||||
|
|
||||||
```bash
|
|
||||||
batgrep needle src/
|
|
||||||
```
|
|
||||||
|
|
||||||
#### `tail -f`
|
|
||||||
|
|
||||||
`bat` can be combined with `tail -f` to continuously monitor a given file with syntax highlighting.
|
|
||||||
|
|
||||||
```bash
|
|
||||||
tail -f /var/log/pacman.log | bat --paging=never -l log
|
|
||||||
```
|
|
||||||
|
|
||||||
Note that we have to switch off paging in order for this to work. We have also specified the syntax
|
|
||||||
explicitly (`-l log`), as it can not be auto-detected in this case.
|
|
||||||
|
|
||||||
#### `git`
|
|
||||||
|
|
||||||
You can combine `bat` with `git show` to view an older version of a given file with proper syntax
|
|
||||||
highlighting:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
git show v0.6.0:src/main.rs | bat -l rs
|
|
||||||
```
|
|
||||||
|
|
||||||
#### `git diff`
|
|
||||||
|
|
||||||
You can combine `bat` with `git diff` to view lines around code changes with proper syntax
|
|
||||||
highlighting:
|
|
||||||
```bash
|
|
||||||
batdiff() {
|
|
||||||
git diff --name-only --relative --diff-filter=d | xargs bat --diff
|
|
||||||
}
|
|
||||||
```
|
|
||||||
If you prefer to use this as a separate tool, check out `batdiff` in [`bat-extras`](https://github.com/eth-p/bat-extras).
|
|
||||||
|
|
||||||
If you are looking for more support for git and diff operations, check out [`delta`](https://github.com/dandavison/delta).
|
|
||||||
|
|
||||||
#### `xclip`
|
|
||||||
|
|
||||||
The line numbers and Git modification markers in the output of `bat` can make it hard to copy
|
|
||||||
the contents of a file. To prevent this, you can call `bat` with the `-p`/`--plain` option or
|
|
||||||
simply pipe the output into `xclip`:
|
|
||||||
```bash
|
|
||||||
bat main.cpp | xclip
|
|
||||||
```
|
|
||||||
`bat` will detect that the output is being redirected and print the plain file contents.
|
|
||||||
|
|
||||||
#### `man`
|
|
||||||
|
|
||||||
`bat` can be used as a colorizing pager for `man`, by setting the
|
|
||||||
`MANPAGER` environment variable:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
export MANPAGER="sh -c 'col -bx | bat -l man -p'"
|
|
||||||
man 2 select
|
|
||||||
```
|
|
||||||
(replace `bat` with `batcat` if you are on Debian or Ubuntu)
|
|
||||||
|
|
||||||
It might also be necessary to set `MANROFFOPT="-c"` if you experience
|
|
||||||
formatting problems.
|
|
||||||
|
|
||||||
If you prefer to have this bundled in a new command, you can also use [`batman`](https://github.com/eth-p/bat-extras/blob/master/doc/batman.md).
|
|
||||||
|
|
||||||
Note that the [Manpage syntax](assets/syntaxes/02_Extra/Manpage.sublime-syntax) is developed in this repository and still needs some work.
|
|
||||||
|
|
||||||
Also, note that this will [not work](https://github.com/sharkdp/bat/issues/1145) with Mandocs `man` implementation.
|
|
||||||
|
|
||||||
#### `prettier` / `shfmt` / `rustfmt`
|
|
||||||
|
|
||||||
The [`prettybat`](https://github.com/eth-p/bat-extras/blob/master/doc/prettybat.md) script is a wrapper that will format code and print it with `bat`.
|
|
||||||
|
|
||||||
#### Highlighting `--help` messages
|
|
||||||
|
|
||||||
You can use `bat` to colorize help text: `$ cp --help | bat -plhelp`
|
|
||||||
|
|
||||||
You can also use a wrapper around this:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# in your .bashrc/.zshrc/*rc
|
|
||||||
alias bathelp='bat --plain --language=help'
|
|
||||||
help() {
|
|
||||||
"$@" --help 2>&1 | bathelp
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
Then you can do `$ help cp` or `$ help git commit`.
|
|
||||||
|
|
||||||
When you are using `zsh`, you can also use global aliases to override `-h` and `--help` entirely:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
alias -g -- -h='-h 2>&1 | bat --language=help --style=plain'
|
|
||||||
alias -g -- --help='--help 2>&1 | bat --language=help --style=plain'
|
|
||||||
```
|
|
||||||
|
|
||||||
This way, you can keep on using `cp --help`, but get colorized help pages.
|
|
||||||
|
|
||||||
Be aware that in some cases, `-h` may not be a shorthand of `--help` (for example with `ls`).
|
|
||||||
|
|
||||||
Please report any issues with the help syntax in [this repository](https://github.com/victor-gp/cmd-help-sublime-syntax).
|
|
||||||
|
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
[![Packaging status](https://repology.org/badge/vertical-allrepos/bat-cat.svg?columns=3&exclude_unsupported=1)](https://repology.org/project/bat-cat/versions)
|
### On Ubuntu
|
||||||
|
|
||||||
### On Ubuntu (using `apt`)
|
|
||||||
*... and other Debian-based Linux distributions.*
|
*... and other Debian-based Linux distributions.*
|
||||||
|
|
||||||
`bat` is available on [Ubuntu since 20.04 ("Focal")](https://packages.ubuntu.com/search?keywords=bat&exact=1) and [Debian since August 2021 (Debian 11 - "Bullseye")](https://packages.debian.org/bullseye/bat).
|
Download the latest `.deb` package from the [release page](https://github.com/sharkdp/bat/releases)
|
||||||
|
and install it via:
|
||||||
If your Ubuntu/Debian installation is new enough you can simply run:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
sudo apt install bat
|
|
||||||
```
|
|
||||||
|
|
||||||
**Important**: If you install `bat` this way, please note that the executable may be installed as `batcat` instead of `bat` (due to [a name
|
|
||||||
clash with another package](https://github.com/sharkdp/bat/issues/982)). You can set up a `bat -> batcat` symlink or alias to prevent any issues that may come up because of this and to be consistent with other distributions:
|
|
||||||
``` bash
|
``` bash
|
||||||
mkdir -p ~/.local/bin
|
sudo dpkg -i bat_0.8.0_amd64.deb # adapt version number and architecture
|
||||||
ln -s /usr/bin/batcat ~/.local/bin/bat
|
|
||||||
```
|
|
||||||
|
|
||||||
### On Ubuntu (using most recent `.deb` packages)
|
|
||||||
*... and other Debian-based Linux distributions.*
|
|
||||||
|
|
||||||
If the package has not yet been promoted to your Ubuntu/Debian installation, or you want
|
|
||||||
the most recent release of `bat`, download the latest `.deb` package from the
|
|
||||||
[release page](https://github.com/sharkdp/bat/releases) and install it via:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
sudo dpkg -i bat_0.18.3_amd64.deb # adapt version number and architecture
|
|
||||||
```
|
|
||||||
|
|
||||||
### On Alpine Linux
|
|
||||||
|
|
||||||
You can install [the `bat` package](https://pkgs.alpinelinux.org/packages?name=bat)
|
|
||||||
from the official sources, provided you have the appropriate repository enabled:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
apk add bat
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### On Arch Linux
|
### On Arch Linux
|
||||||
|
|
||||||
You can install [the `bat` package](https://www.archlinux.org/packages/extra/x86_64/bat/)
|
You can install [the `bat` package](https://www.archlinux.org/packages/community/x86_64/bat/)
|
||||||
from the official sources:
|
from the official sources:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
pacman -S bat
|
pacman -S bat
|
||||||
```
|
```
|
||||||
|
|
||||||
### On Fedora
|
|
||||||
|
|
||||||
You can install [the `bat` package](https://koji.fedoraproject.org/koji/packageinfo?packageID=27506) from the official [Fedora Modular](https://docs.fedoraproject.org/en-US/modularity/using-modules/) repository.
|
|
||||||
|
|
||||||
```bash
|
|
||||||
dnf install bat
|
|
||||||
```
|
|
||||||
|
|
||||||
### On Funtoo Linux
|
|
||||||
|
|
||||||
You can install [the `bat` package](https://github.com/funtoo/dev-kit/tree/1.4-release/sys-apps/bat) from dev-kit.
|
|
||||||
|
|
||||||
```bash
|
|
||||||
emerge sys-apps/bat
|
|
||||||
```
|
|
||||||
|
|
||||||
### On Gentoo Linux
|
|
||||||
|
|
||||||
You can install [the `bat` package](https://packages.gentoo.org/packages/sys-apps/bat)
|
|
||||||
from the official sources:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
emerge sys-apps/bat
|
|
||||||
```
|
|
||||||
|
|
||||||
### On Void Linux
|
### On Void Linux
|
||||||
|
|
||||||
You can install `bat` via xbps-install:
|
You can install `bat` via xbps-install:
|
||||||
```bash
|
|
||||||
xbps-install -S bat
|
|
||||||
```
|
```
|
||||||
|
xbps-install -S bat
|
||||||
### On Termux
|
|
||||||
|
|
||||||
You can install `bat` via pkg:
|
|
||||||
```bash
|
|
||||||
pkg install bat
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### On FreeBSD
|
### On FreeBSD
|
||||||
@ -357,14 +120,6 @@ cd /usr/ports/textproc/bat
|
|||||||
make install
|
make install
|
||||||
```
|
```
|
||||||
|
|
||||||
### On OpenBSD
|
|
||||||
|
|
||||||
You can install `bat` package using [`pkg_add(1)`](https://man.openbsd.org/pkg_add.1):
|
|
||||||
|
|
||||||
```bash
|
|
||||||
pkg_add bat
|
|
||||||
```
|
|
||||||
|
|
||||||
### Via nix
|
### Via nix
|
||||||
|
|
||||||
You can install `bat` using the [nix package manager](https://nixos.org/nix):
|
You can install `bat` using the [nix package manager](https://nixos.org/nix):
|
||||||
@ -373,97 +128,79 @@ You can install `bat` using the [nix package manager](https://nixos.org/nix):
|
|||||||
nix-env -i bat
|
nix-env -i bat
|
||||||
```
|
```
|
||||||
|
|
||||||
### Via flox
|
### On macOS
|
||||||
|
|
||||||
You can install `bat` using [Flox](https://flox.dev)
|
You can install `bat` with [Homebrew](http://braumeister.org/formula/bat):
|
||||||
|
|
||||||
```bash
|
|
||||||
flox install bat
|
|
||||||
```
|
|
||||||
|
|
||||||
### On openSUSE
|
|
||||||
|
|
||||||
You can install `bat` with zypper:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
zypper install bat
|
|
||||||
```
|
|
||||||
|
|
||||||
### Via snap package
|
|
||||||
|
|
||||||
There is currently no recommended snap package available.
|
|
||||||
Existing packages may be available, but are not officially supported and may contain [issues](https://github.com/sharkdp/bat/issues/1519).
|
|
||||||
|
|
||||||
### On macOS (or Linux) via Homebrew
|
|
||||||
|
|
||||||
You can install `bat` with [Homebrew](https://formulae.brew.sh/formula/bat):
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
brew install bat
|
brew install bat
|
||||||
```
|
```
|
||||||
|
|
||||||
### On macOS via MacPorts
|
|
||||||
|
|
||||||
Or install `bat` with [MacPorts](https://ports.macports.org/port/bat/summary):
|
|
||||||
|
|
||||||
```bash
|
|
||||||
port install bat
|
|
||||||
```
|
|
||||||
|
|
||||||
### On Windows
|
### On Windows
|
||||||
|
|
||||||
There are a few options to install `bat` on Windows. Once you have installed `bat`,
|
You can download prebuilt binaries from the [Release page](https://github.com/sharkdp/bat/releases),
|
||||||
take a look at the ["Using `bat` on Windows"](#using-bat-on-windows) section.
|
or install it with [scoop](https://scoop.sh/):
|
||||||
|
|
||||||
#### Prerequisites
|
|
||||||
|
|
||||||
You will need to install the [Visual C++ Redistributable](https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads) package.
|
|
||||||
|
|
||||||
#### With WinGet
|
|
||||||
|
|
||||||
You can install `bat` via [WinGet](https://learn.microsoft.com/en-us/windows/package-manager/winget):
|
|
||||||
|
|
||||||
```bash
|
|
||||||
winget install sharkdp.bat
|
|
||||||
```
|
|
||||||
|
|
||||||
#### With Chocolatey
|
|
||||||
|
|
||||||
You can install `bat` via [Chocolatey](https://chocolatey.org/packages/Bat):
|
|
||||||
```bash
|
|
||||||
choco install bat
|
|
||||||
```
|
|
||||||
|
|
||||||
#### With Scoop
|
|
||||||
|
|
||||||
You can install `bat` via [scoop](https://scoop.sh/):
|
|
||||||
```bash
|
```bash
|
||||||
scoop install bat
|
scoop install bat
|
||||||
```
|
```
|
||||||
|
|
||||||
#### From prebuilt binaries:
|
[See below](#using-bat-on-windows) for notes.
|
||||||
|
|
||||||
You can download prebuilt binaries from the [Release page](https://github.com/sharkdp/bat/releases),
|
### Via Docker
|
||||||
|
|
||||||
You will need to install the [Visual C++ Redistributable](https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads) package.
|
There is a [Docker image](https://hub.docker.com/r/danlynn/bat/) that you can use to run `bat` in a container:
|
||||||
|
```bash
|
||||||
|
docker pull danlynn/bat
|
||||||
|
alias bat='docker run -it --rm -e BAT_THEME -e BAT_STYLE -e BAT_TABS -v "$(pwd):/myapp" danlynn/bat'
|
||||||
|
```
|
||||||
|
|
||||||
|
### Via Ansible
|
||||||
|
|
||||||
|
You can install `bat` with [Ansible](https://www.ansible.com/):
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Install role on local machine
|
||||||
|
ansible-galaxy install aeimer.install_bat
|
||||||
|
```
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
---
|
||||||
|
# Playbook to install bat
|
||||||
|
- host: all
|
||||||
|
roles:
|
||||||
|
- aeimer.install_bat
|
||||||
|
```
|
||||||
|
|
||||||
|
- [Ansible Galaxy](https://galaxy.ansible.com/aeimer/install_bat)
|
||||||
|
- [GitHub](https://github.com/aeimer/ansible-install-bat)
|
||||||
|
|
||||||
|
This should work with the following distributions:
|
||||||
|
- Debian/Ubuntu
|
||||||
|
- ARM (eg. Raspberry PI)
|
||||||
|
- Arch Linux
|
||||||
|
- Void Linux
|
||||||
|
- FreeBSD
|
||||||
|
- MacOS
|
||||||
|
|
||||||
### From binaries
|
### From binaries
|
||||||
|
|
||||||
Check out the [Release page](https://github.com/sharkdp/bat/releases) for
|
Check out the [Release page](https://github.com/sharkdp/bat/releases) for
|
||||||
prebuilt versions of `bat` for many different architectures. Statically-linked
|
prebuilt versions of `bat` for many different architectures. Statically-linked
|
||||||
binaries are also available: look for archives with `musl` in the file name.
|
binaries are available, just look for releases with `musl` in the name on the
|
||||||
|
releases page.
|
||||||
|
|
||||||
### From source
|
### From source
|
||||||
|
|
||||||
If you want to build `bat` from source, you need Rust 1.70.0 or
|
If you want to build `bat` from source, you need Rust 1.29 or
|
||||||
higher. You can then use `cargo` to build everything:
|
higher. You can then use `cargo` to build everything:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
cargo install --locked bat
|
cargo install bat
|
||||||
```
|
```
|
||||||
|
|
||||||
Note that additional files like the man page or shell completion
|
You may have to install `cmake` and the `libz` development package
|
||||||
files can not be installed in this way. They will be generated by `cargo` and should be available in the cargo target folder (under `build`).
|
(`libz-dev` or `libz-devel`) in order for the build to succeed.
|
||||||
|
|
||||||
## Customization
|
## Customization
|
||||||
|
|
||||||
@ -473,99 +210,59 @@ Use `bat --list-themes` to get a list of all available themes for syntax
|
|||||||
highlighting. To select the `TwoDark` theme, call `bat` with the
|
highlighting. To select the `TwoDark` theme, call `bat` with the
|
||||||
`--theme=TwoDark` option or set the `BAT_THEME` environment variable to
|
`--theme=TwoDark` option or set the `BAT_THEME` environment variable to
|
||||||
`TwoDark`. Use `export BAT_THEME="TwoDark"` in your shell's startup file to
|
`TwoDark`. Use `export BAT_THEME="TwoDark"` in your shell's startup file to
|
||||||
make the change permanent. Alternatively, use `bat`s
|
make the change permanent.
|
||||||
[configuration file](https://github.com/sharkdp/bat#configuration-file).
|
|
||||||
|
|
||||||
If you want to preview the different themes on a custom file, you can use
|
If you want to preview the different themes on a custom file, you can use
|
||||||
the following command (you need [`fzf`](https://github.com/junegunn/fzf) for this):
|
the following command (you need [`fzf`](https://github.com/junegunn/fzf) for this):
|
||||||
```bash
|
``` bash
|
||||||
bat --list-themes | fzf --preview="bat --theme={} --color=always /path/to/file"
|
bat --list-themes | fzf --preview="bat --theme={} --color=always /path/to/file"
|
||||||
```
|
```
|
||||||
|
|
||||||
`bat` looks good on a dark background by default. However, if your terminal uses a
|
`bat` looks good on a dark background by default. However, if your terminal uses a
|
||||||
light background, some themes like `GitHub` or `OneHalfLight` will work better for you.
|
light background, some themes will work better for you. For example, the `GitHub`
|
||||||
You can also use a custom theme by following the
|
theme is made for light backgrounds. You can also make your own theme by following the
|
||||||
['Adding new themes' section below](https://github.com/sharkdp/bat#adding-new-themes).
|
['Adding new themes' section below](https://github.com/sharkdp/bat#adding-new-themes).
|
||||||
|
|
||||||
### 8-bit themes
|
|
||||||
|
|
||||||
`bat` has three themes that always use [8-bit colors](https://en.wikipedia.org/wiki/ANSI_escape_code#Colors),
|
|
||||||
even when truecolor support is available:
|
|
||||||
|
|
||||||
- `ansi` looks decent on any terminal. It uses 3-bit colors: black, red, green,
|
|
||||||
yellow, blue, magenta, cyan, and white.
|
|
||||||
- `base16` is designed for [base16](https://github.com/chriskempson/base16) terminal themes. It uses
|
|
||||||
4-bit colors (3-bit colors plus bright variants) in accordance with the
|
|
||||||
[base16 styling guidelines](https://github.com/chriskempson/base16/blob/master/styling.md).
|
|
||||||
- `base16-256` is designed for [base16-shell](https://github.com/chriskempson/base16-shell).
|
|
||||||
It replaces certain bright colors with 8-bit colors from 16 to 21. **Do not** use this simply
|
|
||||||
because you have a 256-color terminal but are not using base16-shell.
|
|
||||||
|
|
||||||
Although these themes are more restricted, they have three advantages over truecolor themes. They:
|
|
||||||
|
|
||||||
- Enjoy maximum compatibility. Some terminal utilities do not support more than 3-bit colors.
|
|
||||||
- Adapt to terminal theme changes. Even for already printed output.
|
|
||||||
- Visually harmonize better with other terminal software.
|
|
||||||
|
|
||||||
### Output style
|
### Output style
|
||||||
|
|
||||||
You can use the `--style` option to control the appearance of `bat`s output.
|
You can use the `--style` option to control the appearance of `bat`s output.
|
||||||
You can use `--style=numbers,changes`, for example, to show only Git changes
|
You can use `--style=numbers,changes`, for example, to show only Git changes
|
||||||
and line numbers but no grid and no file header. Set the `BAT_STYLE` environment
|
and line numbers but no grid and no file header. Use the `BAT_STYLE` environment
|
||||||
variable to make these changes permanent or use `bat`s
|
variable to make these changes permanent.
|
||||||
[configuration file](https://github.com/sharkdp/bat#configuration-file).
|
|
||||||
|
|
||||||
>[!tip]
|
|
||||||
> If you specify a default style in `bat`'s config file, you can change which components
|
|
||||||
> are displayed during a single run of `bat` using the `--style` command-line argument.
|
|
||||||
> By prefixing a component with `+` or `-`, it can be added or removed from the current style.
|
|
||||||
>
|
|
||||||
> For example, if your config contains `--style=full,-snip`, you can run bat with
|
|
||||||
> `--style=-grid,+snip` to remove the grid and add back the `snip` component.
|
|
||||||
> Or, if you want to override the styles completely, you use `--style=numbers` to
|
|
||||||
> only show the line numbers.
|
|
||||||
|
|
||||||
### Adding new syntaxes / language definitions
|
### Adding new syntaxes / language definitions
|
||||||
|
|
||||||
Should you find that a particular syntax is not available within `bat`, you can follow these
|
|
||||||
instructions to easily add new syntaxes to your current `bat` installation.
|
|
||||||
|
|
||||||
`bat` uses the excellent [`syntect`](https://github.com/trishume/syntect/)
|
`bat` uses the excellent [`syntect`](https://github.com/trishume/syntect/)
|
||||||
library for syntax highlighting. `syntect` can read any
|
library for syntax highlighting. `syntect` can read any
|
||||||
[Sublime Text `.sublime-syntax` file](https://www.sublimetext.com/docs/3/syntax.html)
|
[Sublime Text `.sublime-syntax` file](https://www.sublimetext.com/docs/3/syntax.html)
|
||||||
and theme.
|
and theme. To add new syntax definitions, do the following.
|
||||||
|
|
||||||
A good resource for finding Sublime Syntax packages is [Package Control](https://packagecontrol.io/). Once you found a
|
Create a folder with syntax definition files:
|
||||||
syntax:
|
|
||||||
|
|
||||||
1. Create a folder with syntax definition files:
|
```bash
|
||||||
|
BAT_CONFIG_DIR="$(bat cache --config-dir)"
|
||||||
|
|
||||||
```bash
|
mkdir -p "$BAT_CONFIG_DIR/syntaxes"
|
||||||
mkdir -p "$(bat --config-dir)/syntaxes"
|
cd "$BAT_CONFIG_DIR/syntaxes"
|
||||||
cd "$(bat --config-dir)/syntaxes"
|
|
||||||
|
|
||||||
# Put new '.sublime-syntax' language definition files
|
# Put new '.sublime-syntax' language definition files
|
||||||
# in this folder (or its subdirectories), for example:
|
# in this folder (or its subdirectories), for example:
|
||||||
git clone https://github.com/tellnobody1/sublime-purescript-syntax
|
git clone https://github.com/tellnobody1/sublime-purescript-syntax
|
||||||
```
|
```
|
||||||
|
|
||||||
2. Now use the following command to parse these files into a binary cache:
|
Now use the following command to parse these files into a binary cache:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
bat cache --build
|
bat cache --init
|
||||||
```
|
```
|
||||||
|
|
||||||
3. Finally, use `bat --list-languages` to check if the new languages are available.
|
Finally, use `bat --list-languages` to check if the new languages are available.
|
||||||
|
|
||||||
If you ever want to go back to the default settings, call:
|
If you ever want to go back to the default settings, call:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
bat cache --clear
|
bat cache --clear
|
||||||
```
|
```
|
||||||
|
|
||||||
4. If you think that a specific syntax should be included in `bat` by default, please
|
|
||||||
consider opening a "syntax request" ticket after reading the policies and
|
|
||||||
instructions [here](doc/assets.md): [Open Syntax Request](https://github.com/sharkdp/bat/issues/new?labels=syntax-request&template=syntax_request.md).
|
|
||||||
|
|
||||||
### Adding new themes
|
### Adding new themes
|
||||||
|
|
||||||
@ -573,46 +270,20 @@ This works very similar to how we add new syntax definitions.
|
|||||||
|
|
||||||
First, create a folder with the new syntax highlighting themes:
|
First, create a folder with the new syntax highlighting themes:
|
||||||
```bash
|
```bash
|
||||||
mkdir -p "$(bat --config-dir)/themes"
|
BAT_CONFIG_DIR="$(bat cache --config-dir)"
|
||||||
cd "$(bat --config-dir)/themes"
|
|
||||||
|
mkdir -p "$BAT_CONFIG_DIR/themes"
|
||||||
|
cd "$BAT_CONFIG_DIR/themes"
|
||||||
|
|
||||||
# Download a theme in '.tmTheme' format, for example:
|
# Download a theme in '.tmTheme' format, for example:
|
||||||
git clone https://github.com/greggb/sublime-snazzy
|
git clone https://github.com/greggb/sublime-snazzy
|
||||||
|
|
||||||
# Update the binary cache
|
# Update the binary cache
|
||||||
bat cache --build
|
bat cache --init
|
||||||
```
|
```
|
||||||
|
|
||||||
Finally, use `bat --list-themes` to check if the new themes are available.
|
Finally, use `bat --list-themes` to check if the new themes are available.
|
||||||
|
|
||||||
### Adding or changing file type associations
|
|
||||||
|
|
||||||
You can add new (or change existing) file name patterns using the `--map-syntax`
|
|
||||||
command line option. The option takes an argument of the form `pattern:syntax` where
|
|
||||||
`pattern` is a glob pattern that is matched against the file name and
|
|
||||||
the absolute file path. The `syntax` part is the full name of a supported language
|
|
||||||
(use `bat --list-languages` for an overview).
|
|
||||||
|
|
||||||
**Note:** You probably want to use this option as [an entry in `bat`'s configuration file](#configuration-file)
|
|
||||||
for persistence instead of passing it on the command line as a one-off. Generally
|
|
||||||
you'd just use `-l` if you want to manually specify a language for a file.
|
|
||||||
|
|
||||||
Example: To use "INI" syntax highlighting for all files with a `.conf` file extension, use
|
|
||||||
```bash
|
|
||||||
--map-syntax='*.conf:INI'
|
|
||||||
```
|
|
||||||
|
|
||||||
Example: To open all files called `.ignore` (exact match) with the "Git Ignore" syntax, use:
|
|
||||||
```bash
|
|
||||||
--map-syntax='.ignore:Git Ignore'
|
|
||||||
```
|
|
||||||
|
|
||||||
Example: To open all `.conf` files in subfolders of `/etc/apache2` with the "Apache Conf"
|
|
||||||
syntax, use (this mapping is already built in):
|
|
||||||
```bash
|
|
||||||
--map-syntax='/etc/apache2/**/*.conf:Apache Conf'
|
|
||||||
```
|
|
||||||
|
|
||||||
### Using a different pager
|
### Using a different pager
|
||||||
|
|
||||||
`bat` uses the pager that is specified in the `PAGER` environment variable. If this variable is not
|
`bat` uses the pager that is specified in the `PAGER` environment variable. If this variable is not
|
||||||
@ -620,136 +291,51 @@ set, `less` is used by default. If you want to use a different pager, you can ei
|
|||||||
`PAGER` variable or set the `BAT_PAGER` environment variable to override what is specified in
|
`PAGER` variable or set the `BAT_PAGER` environment variable to override what is specified in
|
||||||
`PAGER`.
|
`PAGER`.
|
||||||
|
|
||||||
>[!NOTE]
|
If you want to pass command-line arguments to the pager, you need to create a small shell
|
||||||
> If `PAGER` is `more` or `most`, `bat` will silently use `less` instead to ensure support for colors.
|
script as a wrapper, for example
|
||||||
|
|
||||||
If you want to pass command-line arguments to the pager, you can also set them via the
|
|
||||||
`PAGER`/`BAT_PAGER` variables:
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
export BAT_PAGER="less -RF"
|
#!/bin/bash
|
||||||
|
|
||||||
|
less --tabs 4 -R "$@"
|
||||||
```
|
```
|
||||||
|
(put this in a file `~/.bat-pager.sh`, make it executable `chmod +x ~/.bat-pager.sh` and use
|
||||||
|
`export BAT_PAGER="$HOME/.bat-pager.sh"` in your shells `rc` file)
|
||||||
|
|
||||||
Instead of using environment variables, you can also use `bat`s [configuration file](https://github.com/sharkdp/bat#configuration-file) to configure the pager (`--pager` option).
|
**Note**: By default, if the pager is set to `less`, `bat` will pass the following command line
|
||||||
|
options to the pager: `-R`/`--RAW-CONTROL-CHARS`, `-F`/`--quit-if-one-screen` and `-X`/`--no-init`.
|
||||||
|
The first (`-R`) is needed to interpret ANSI colors correctly. The second option (`-F`) instructs
|
||||||
|
less to exit immediately if the output size is smaller than the vertical size of the terminal.
|
||||||
|
This is convenient for small files because you do not have to press `q` to quit the pager. The
|
||||||
|
third option (`-X`) is needed to fix a bug with the `--quit-if-one-screen` feature in old versions
|
||||||
|
of `less`. Unfortunately, it also breaks mouse-wheel support in `less`. If you want to enable
|
||||||
|
mouse-wheel scrolling, you can either pass just `-R` (as in the example above, this will disable
|
||||||
|
the quit-if-one-screen feature), or you can use a recent version of `less` and pass `-RF` which
|
||||||
|
will hopefully enable both quit-if-one-screen and mouse-wheel scrolling.
|
||||||
|
|
||||||
|
If scrolling still doesn't work for you, you can try to pass the `-S` option in addition.
|
||||||
### Using `less` as a pager
|
|
||||||
|
|
||||||
When using `less` as a pager, `bat` will automatically pass extra options along to `less`
|
|
||||||
to improve the experience. Specifically, `-R`/`--RAW-CONTROL-CHARS`, `-F`/`--quit-if-one-screen`,
|
|
||||||
and under certain conditions, `-X`/`--no-init` and/or `-S`/`--chop-long-lines`.
|
|
||||||
|
|
||||||
>[!IMPORTANT]
|
|
||||||
> These options will not be added if:
|
|
||||||
> - The pager is not named `less`.
|
|
||||||
> - The `--pager` argument contains any command-line arguments (e.g. `--pager="less -R"`).
|
|
||||||
> - The `BAT_PAGER` environment variable contains any command-line arguments (e.g. `export BAT_PAGER="less -R"`)
|
|
||||||
>
|
|
||||||
> The `--quit-if-one-screen` option will not be added when:
|
|
||||||
> - The `--paging=always` argument is used.
|
|
||||||
> - The `BAT_PAGING` environment is set to `always`.
|
|
||||||
|
|
||||||
The `-R` option is needed to interpret ANSI colors correctly.
|
|
||||||
|
|
||||||
The `-F` option instructs `less` to exit immediately if the output size is smaller than
|
|
||||||
the vertical size of the terminal. This is convenient for small files because you do not
|
|
||||||
have to press `q` to quit the pager.
|
|
||||||
|
|
||||||
The `-X` option is needed to fix a bug with the `--quit-if-one-screen` feature in versions
|
|
||||||
of `less` older than version 530. Unfortunately, it also breaks mouse-wheel support in `less`.
|
|
||||||
If you want to enable mouse-wheel scrolling on older versions of `less` and do not mind losing
|
|
||||||
the quit-if-one-screen feature, you can set the pager (via `--pager` or `BAT_PAGER`) to `less -R`.
|
|
||||||
For `less` 530 or newer, it should work out of the box.
|
|
||||||
|
|
||||||
The `-S` option is added when `bat`'s `-S`/`--chop-long-lines` option is used. This tells `less`
|
|
||||||
to truncate any lines larger than the terminal width.
|
|
||||||
|
|
||||||
### Indentation
|
|
||||||
|
|
||||||
`bat` expands tabs to 4 spaces by itself, not relying on the pager. To change this, simply add the
|
|
||||||
`--tabs` argument with the number of spaces you want to be displayed.
|
|
||||||
|
|
||||||
**Note**: Defining tab stops for the pager (via the `--pager` argument by `bat`, or via the `LESS`
|
|
||||||
environment variable for `less`) won't be taken into account because the pager will already get
|
|
||||||
expanded spaces instead of tabs. This behaviour is added to avoid indentation issues caused by the
|
|
||||||
sidebar. Calling `bat` with `--tabs=0` will override it and let tabs be consumed by the pager.
|
|
||||||
|
|
||||||
### Dark mode
|
|
||||||
|
|
||||||
If you make use of the dark mode feature in macOS, you might want to configure `bat` to use a different
|
|
||||||
theme based on the OS theme. The following snippet uses the `default` theme when in the _dark mode_
|
|
||||||
and the `GitHub` theme when in the _light mode_.
|
|
||||||
|
|
||||||
```bash
|
|
||||||
alias cat="bat --theme=\$(defaults read -globalDomain AppleInterfaceStyle &> /dev/null && echo default || echo GitHub)"
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
## Configuration file
|
|
||||||
|
|
||||||
`bat` can also be customized with a configuration file. The location of the file is dependent
|
|
||||||
on your operating system. To get the default path for your system, call
|
|
||||||
```bash
|
|
||||||
bat --config-file
|
|
||||||
```
|
|
||||||
|
|
||||||
Alternatively, you can use the `BAT_CONFIG_PATH` environment variable to point `bat` to a
|
|
||||||
non-default location of the configuration file:
|
|
||||||
```bash
|
|
||||||
export BAT_CONFIG_PATH="/path/to/bat.conf"
|
|
||||||
```
|
|
||||||
|
|
||||||
A default configuration file can be created with the `--generate-config-file` option.
|
|
||||||
```bash
|
|
||||||
bat --generate-config-file
|
|
||||||
```
|
|
||||||
|
|
||||||
There is also now a systemwide configuration file, which is located under `/etc/bat/config` on
|
|
||||||
Linux and Mac OS and `C:\ProgramData\bat\config` on windows. If the system wide configuration
|
|
||||||
file is present, the content of the user configuration will simply be appended to it.
|
|
||||||
|
|
||||||
### Format
|
|
||||||
|
|
||||||
The configuration file is a simple list of command line arguments. Use `bat --help` to see a full list of possible options and values. In addition, you can add comments by prepending a line with the `#` character.
|
|
||||||
|
|
||||||
Example configuration file:
|
|
||||||
```bash
|
|
||||||
# Set the theme to "TwoDark"
|
|
||||||
--theme="TwoDark"
|
|
||||||
|
|
||||||
# Show line numbers, Git modifications and file header (but no grid)
|
|
||||||
--style="numbers,changes,header"
|
|
||||||
|
|
||||||
# Use italic text on the terminal (not supported on all terminals)
|
|
||||||
--italic-text=always
|
|
||||||
|
|
||||||
# Use C++ syntax for Arduino .ino files
|
|
||||||
--map-syntax "*.ino:C++"
|
|
||||||
```
|
|
||||||
|
|
||||||
## Using `bat` on Windows
|
## Using `bat` on Windows
|
||||||
|
|
||||||
`bat` mostly works out-of-the-box on Windows, but a few features may need extra configuration.
|
`bat` mostly works out-of-the-box on Windows, but a few features may need extra configuration.
|
||||||
|
|
||||||
### Prerequisites
|
|
||||||
|
|
||||||
You will need to install the [Visual C++ Redistributable](https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads) package.
|
|
||||||
|
|
||||||
### Paging
|
### Paging
|
||||||
|
|
||||||
Windows only includes a very limited pager in the form of `more`. You can download a Windows binary
|
Windows only includes a very limited pager in the form of `more`. You can download a Windows binary
|
||||||
for `less` [from its homepage](http://www.greenwoodsoftware.com/less/download.html) or [through
|
for `less` [from its homepage](http://www.greenwoodsoftware.com/less/download.html) or [through
|
||||||
Chocolatey](https://chocolatey.org/packages/Less). To use it, place the binary in a directory in
|
Chocolatey](https://chocolatey.org/packages/Less). To use it, place the binary in a directory in
|
||||||
your `PATH` or [define an environment variable](#using-a-different-pager). The [Chocolatey package](#on-windows) installs `less` automatically.
|
your `PATH` or [define an environment variable](#using-a-different-pager).
|
||||||
|
|
||||||
### Colors
|
### Colours
|
||||||
|
|
||||||
Windows 10 natively supports colors in both `conhost.exe` (Command Prompt) and PowerShell since
|
Windows 10 natively supports colours in both `conhost.exe` (Command Prompt) and PowerShell since
|
||||||
[v1511](https://en.wikipedia.org/wiki/Windows_10_version_history#Version_1511_(November_Update)), as
|
[v1511](https://en.wikipedia.org/wiki/Windows_10_version_history#Version_1511_(November_Update)), as
|
||||||
well as in newer versions of bash. On earlier versions of Windows, you can use
|
well as in newer versions of bash. On earlier versions of Windows, you can use
|
||||||
[Cmder](http://cmder.app/), which includes [ConEmu](https://conemu.github.io/).
|
[Cmder](http://cmder.net/), which includes [ConEmu](https://conemu.github.io/).
|
||||||
|
|
||||||
**Note:** Old versions of `less` do not correctly interpret colors on Windows. To fix this, you can add the optional Unix tools to your PATH when installing Git. If you don’t have any other pagers installed, you can disable paging entirely by passing `--paging=never` or by setting `BAT_PAGER` to an empty string.
|
**Note:** The Git and MSYS versions of `less` do not correctly interpret colours on Windows. If you
|
||||||
|
don’t have any other pagers installed, you can disable paging entirely by passing `--paging=never`
|
||||||
|
or by setting `BAT_PAGER` to an empty string.
|
||||||
|
|
||||||
### Cygwin
|
### Cygwin
|
||||||
|
|
||||||
@ -757,7 +343,7 @@ well as in newer versions of bash. On earlier versions of Windows, you can use
|
|||||||
|
|
||||||
This can be solved by creating a wrapper or adding the following function to your `.bash_profile` file:
|
This can be solved by creating a wrapper or adding the following function to your `.bash_profile` file:
|
||||||
|
|
||||||
```bash
|
```shell
|
||||||
bat() {
|
bat() {
|
||||||
local index
|
local index
|
||||||
local args=("$@")
|
local args=("$@")
|
||||||
@ -773,24 +359,11 @@ bat() {
|
|||||||
|
|
||||||
## Troubleshooting
|
## Troubleshooting
|
||||||
|
|
||||||
### Garbled output
|
|
||||||
|
|
||||||
If an input file contains color codes or other ANSI escape sequences or control characters, `bat` will have problems
|
|
||||||
performing syntax highlighting and text wrapping, and thus the output can become garbled.
|
|
||||||
|
|
||||||
If your version of `bat` supports the `--strip-ansi=auto` option, it can be used to remove such sequences
|
|
||||||
before syntax highlighting. Alternatively, you may disable both syntax highlighting and wrapping by
|
|
||||||
passing the `--color=never --wrap=never` options to `bat`.
|
|
||||||
|
|
||||||
> [!NOTE]
|
|
||||||
> The `auto` option of `--strip-ansi` avoids removing escape sequences when the syntax is plain text.
|
|
||||||
|
|
||||||
### Terminals & colors
|
### Terminals & colors
|
||||||
|
|
||||||
`bat` handles terminals *with* and *without* truecolor support. However, the colors in most syntax
|
`bat` handles terminals *with* and *without* truecolor support. However, the colors in the syntax
|
||||||
highlighting themes are not optimized for 8-bit colors. It is therefore strongly recommended
|
highlighting themes are not optimized for 8-bit colors and it is therefore strongly recommended
|
||||||
that you use a terminal with 24-bit truecolor support (`terminator`, `konsole`, `iTerm2`, ...),
|
that you use a terminal with 24-bit truecolor support (`terminator`, `konsole`, `iTerm2`, ...).
|
||||||
or use one of the basic [8-bit themes](#8-bit-themes) designed for a restricted set of colors.
|
|
||||||
See [this article](https://gist.github.com/XVilka/8346728) for more details and a full list of
|
See [this article](https://gist.github.com/XVilka/8346728) for more details and a full list of
|
||||||
terminals with truecolor support.
|
terminals with truecolor support.
|
||||||
|
|
||||||
@ -803,18 +376,6 @@ are supported (and fall back to 8-bit colors).
|
|||||||
Please try a different theme (see `bat --list-themes` for a list). The `OneHalfDark` and
|
Please try a different theme (see `bat --list-themes` for a list). The `OneHalfDark` and
|
||||||
`OneHalfLight` themes provide grid and line colors that are brighter.
|
`OneHalfLight` themes provide grid and line colors that are brighter.
|
||||||
|
|
||||||
### File encodings
|
|
||||||
|
|
||||||
`bat` natively supports UTF-8 as well as UTF-16. For every other file encoding, you may need to
|
|
||||||
convert to UTF-8 first because the encodings can typically not be auto-detected. You can `iconv`
|
|
||||||
to do so.
|
|
||||||
Example: if you have a PHP file in Latin-1 (ISO-8859-1) encoding, you can call:
|
|
||||||
``` bash
|
|
||||||
iconv -f ISO-8859-1 -t UTF-8 my-file.php | bat
|
|
||||||
```
|
|
||||||
Note: you might have to use the `-l`/`--language` option if the syntax can not be auto-detected
|
|
||||||
by `bat`.
|
|
||||||
|
|
||||||
## Development
|
## Development
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
@ -823,39 +384,19 @@ git clone --recursive https://github.com/sharkdp/bat
|
|||||||
|
|
||||||
# Build (debug version)
|
# Build (debug version)
|
||||||
cd bat
|
cd bat
|
||||||
cargo build --bins
|
cargo build
|
||||||
|
|
||||||
# Run unit tests and integration tests
|
# Run unit tests and integration tests
|
||||||
cargo test
|
cargo test
|
||||||
|
|
||||||
# Install (release version)
|
# Install (release version)
|
||||||
cargo install --path . --locked
|
cargo install
|
||||||
|
|
||||||
# Build a bat binary with modified syntaxes and themes
|
# Build a bat binary with modified syntaxes and themes
|
||||||
bash assets/create.sh
|
bash assets/create.sh
|
||||||
cargo install --path . --locked --force
|
cargo install -f
|
||||||
```
|
```
|
||||||
|
|
||||||
If you want to build an application that uses `bat`s pretty-printing
|
|
||||||
features as a library, check out the [the API documentation](https://docs.rs/bat/).
|
|
||||||
Note that you have to use either `regex-onig` or `regex-fancy` as a feature
|
|
||||||
when you depend on `bat` as a library.
|
|
||||||
|
|
||||||
## Contributing
|
|
||||||
|
|
||||||
Take a look at the [`CONTRIBUTING.md`](CONTRIBUTING.md) guide.
|
|
||||||
|
|
||||||
## Maintainers
|
|
||||||
|
|
||||||
- [sharkdp](https://github.com/sharkdp)
|
|
||||||
- [eth-p](https://github.com/eth-p)
|
|
||||||
- [keith-hall](https://github.com/keith-hall)
|
|
||||||
- [Enselic](https://github.com/Enselic)
|
|
||||||
|
|
||||||
## Security vulnerabilities
|
|
||||||
|
|
||||||
Please contact [David Peter](https://david-peter.de/) via email if you want to report a vulnerability in `bat`.
|
|
||||||
|
|
||||||
## Project goals and alternatives
|
## Project goals and alternatives
|
||||||
|
|
||||||
`bat` tries to achieve the following goals:
|
`bat` tries to achieve the following goals:
|
||||||
@ -867,10 +408,3 @@ Please contact [David Peter](https://david-peter.de/) via email if you want to r
|
|||||||
|
|
||||||
There are a lot of alternatives, if you are looking for similar programs. See
|
There are a lot of alternatives, if you are looking for similar programs. See
|
||||||
[this document](doc/alternatives.md) for a comparison.
|
[this document](doc/alternatives.md) for a comparison.
|
||||||
|
|
||||||
## License
|
|
||||||
Copyright (c) 2018-2023 [bat-developers](https://github.com/sharkdp/bat).
|
|
||||||
|
|
||||||
`bat` is made available under the terms of either the MIT License or the Apache License 2.0, at your option.
|
|
||||||
|
|
||||||
See the [LICENSE-APACHE](LICENSE-APACHE) and [LICENSE-MIT](LICENSE-MIT) files for license details.
|
|
||||||
|
49
appveyor.yml
Normal file
49
appveyor.yml
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
environment:
|
||||||
|
global:
|
||||||
|
TARGET: x86_64-pc-windows-msvc
|
||||||
|
RUST_VERSION: stable
|
||||||
|
CRATE_NAME: bat
|
||||||
|
CARGO_HOME: "c:\\cargo"
|
||||||
|
RUSTUP_HOME: "c:\\rustup"
|
||||||
|
|
||||||
|
install:
|
||||||
|
- appveyor DownloadFile https://win.rustup.rs/ -FileName rustup-init.exe
|
||||||
|
- rustup-init.exe -y --default-host %TARGET%
|
||||||
|
- set PATH=%PATH%;C:\cargo\bin
|
||||||
|
- rustc -Vv
|
||||||
|
- cargo -V
|
||||||
|
|
||||||
|
build: false
|
||||||
|
test_script:
|
||||||
|
- cargo test --target %TARGET% --verbose
|
||||||
|
- cargo run --target %TARGET% -- src/main.rs README.md --paging=never
|
||||||
|
|
||||||
|
before_deploy:
|
||||||
|
# Generate artifacts for release
|
||||||
|
- cargo build --release --verbose
|
||||||
|
- ps: ci\before_deploy.ps1
|
||||||
|
|
||||||
|
deploy:
|
||||||
|
description: 'Automatically deployed release'
|
||||||
|
artifact: /.*\.zip/
|
||||||
|
# Here's how:
|
||||||
|
# - Go to 'https://github.com/settings/tokens/new' and generate a Token with only the
|
||||||
|
# `public_repo` scope enabled
|
||||||
|
# - Then go to 'https://ci.appveyor.com/tools/encrypt' and enter the newly generated token.
|
||||||
|
# - Enter the "encrypted value" below
|
||||||
|
auth_token:
|
||||||
|
secure: oO4/J+hcFXgXcEqEc8gzlQNqLG0IxU78s4EyH+uczGdsyWajb3yipxPR6nXUvmoj
|
||||||
|
provider: GitHub
|
||||||
|
on:
|
||||||
|
RUST_VERSION: stable
|
||||||
|
appveyor_repo_tag: true
|
||||||
|
|
||||||
|
cache:
|
||||||
|
- C:\Users\appveyor\.cargo\registry
|
||||||
|
- target
|
||||||
|
|
||||||
|
notifications:
|
||||||
|
- provider: Email
|
||||||
|
on_build_success: false
|
||||||
|
on_build_failure: false
|
||||||
|
on_build_status_changed: false
|
1
assets/.gitattributes
vendored
1
assets/.gitattributes
vendored
@ -1 +0,0 @@
|
|||||||
* linguist-vendored
|
|
@ -1,7 +1,7 @@
|
|||||||
diff --git syntaxes/01_Packages/Java/JavaDoc.sublime-syntax syntaxes/01_Packages/Java/JavaDoc.sublime-syntax
|
diff --git syntaxes/Packages/Java/JavaDoc.sublime-syntax syntaxes/Packages/Java/JavaDoc.sublime-syntax
|
||||||
index 422a6a9..40a741e 100644
|
index 422a6a9..40a741e 100644
|
||||||
--- syntaxes/01_Packages/Java/JavaDoc.sublime-syntax
|
--- syntaxes/Packages/Java/JavaDoc.sublime-syntax
|
||||||
+++ syntaxes/01_Packages/Java/JavaDoc.sublime-syntax
|
+++ syntaxes/Packages/Java/JavaDoc.sublime-syntax
|
||||||
@@ -13,7 +13,7 @@ variables:
|
@@ -13,7 +13,7 @@ variables:
|
||||||
contexts:
|
contexts:
|
||||||
prototype:
|
prototype:
|
32
assets/README.md
Normal file
32
assets/README.md
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
## Syntax Highlighting in bat
|
||||||
|
|
||||||
|
`bat` uses the [syntect](https://github.com/trishume/syntect) library to highlight source
|
||||||
|
code. As a basis, syntect uses [Sublime Text](https://www.sublimetext.com/) syntax definitions
|
||||||
|
in the `.sublime-syntax` format.
|
||||||
|
|
||||||
|
In order to add new syntaxes to `bat`, follow these steps:
|
||||||
|
|
||||||
|
1. Find a Sublime Text syntax for the given language, preferably in a separate Git repository
|
||||||
|
which can be included as a submodule (under `assets/syntaxes`).
|
||||||
|
|
||||||
|
2. If the Sublime Text syntax is only available as a `.tmLanguage` file, open the file in
|
||||||
|
Sublime Text and convert it to a `.sublime-syntax` file via *Tools* -> *Developer* ->
|
||||||
|
*New Syntax from XXX.tmLanguage...*. Save the new file in the `assets/syntaxes` folder.
|
||||||
|
|
||||||
|
3. Run the `create.sh` script. It calls `bat cache --init` to parse all available
|
||||||
|
`.sublime-syntax` files and serialize them to a `syntaxes.bin` file (in this folder).
|
||||||
|
|
||||||
|
4. Re-compile `bat`. At compilation time, the `syntaxes.bin` file will be stored inside the
|
||||||
|
`bat` binary.
|
||||||
|
|
||||||
|
### Troubleshooting
|
||||||
|
|
||||||
|
Make sure that the local cache does not interfere with the internally stored syntaxes and
|
||||||
|
themes (`bat cache --clear`).
|
||||||
|
|
||||||
|
### Manual modifications
|
||||||
|
|
||||||
|
The following files have been manually modified after converting from a `.tmLanguage` file:
|
||||||
|
|
||||||
|
* `Dart.sublime-syntax` => removed `#regex.dart` include.
|
||||||
|
* `INI.sublime-syntax` => added `.hgrc` and `hgrc` file types.
|
Binary file not shown.
@ -1,95 +0,0 @@
|
|||||||
|
|
||||||
using namespace System.Management.Automation
|
|
||||||
using namespace System.Management.Automation.Language
|
|
||||||
|
|
||||||
Register-ArgumentCompleter -Native -CommandName '{{PROJECT_EXECUTABLE}}' -ScriptBlock {
|
|
||||||
param($wordToComplete, $commandAst, $cursorPosition)
|
|
||||||
|
|
||||||
$commandElements = $commandAst.CommandElements
|
|
||||||
$command = @(
|
|
||||||
'{{PROJECT_EXECUTABLE}}'
|
|
||||||
for ($i = 1; $i -lt $commandElements.Count; $i++) {
|
|
||||||
$element = $commandElements[$i]
|
|
||||||
if ($element -isnot [StringConstantExpressionAst] -or
|
|
||||||
$element.StringConstantType -ne [StringConstantType]::BareWord -or
|
|
||||||
$element.Value.StartsWith('-')) {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
$element.Value
|
|
||||||
}) -join ';'
|
|
||||||
|
|
||||||
$completions = @(switch ($command) {
|
|
||||||
'{{PROJECT_EXECUTABLE}}' {
|
|
||||||
[CompletionResult]::new('-l', 'l', [CompletionResultType]::ParameterName, 'Set the language for syntax highlighting.')
|
|
||||||
[CompletionResult]::new('--language', 'language', [CompletionResultType]::ParameterName, 'Set the language for syntax highlighting.')
|
|
||||||
[CompletionResult]::new('-H', 'H', [CompletionResultType]::ParameterName, 'Highlight lines N through M.')
|
|
||||||
[CompletionResult]::new('--highlight-line', 'highlight-line', [CompletionResultType]::ParameterName, 'Highlight lines N through M.')
|
|
||||||
[CompletionResult]::new('--file-name', 'file-name', [CompletionResultType]::ParameterName, 'Specify the name to display for a file.')
|
|
||||||
[CompletionResult]::new('--diff-context', 'diff-context', [CompletionResultType]::ParameterName, 'diff-context')
|
|
||||||
[CompletionResult]::new('--tabs', 'tabs', [CompletionResultType]::ParameterName, 'Set the tab width to T spaces.')
|
|
||||||
[CompletionResult]::new('--wrap', 'wrap', [CompletionResultType]::ParameterName, 'Specify the text-wrapping mode (*auto*, never, character).')
|
|
||||||
[CompletionResult]::new('--terminal-width', 'terminal-width', [CompletionResultType]::ParameterName, 'Explicitly set the width of the terminal instead of determining it automatically. If prefixed with ''+'' or ''-'', the value will be treated as an offset to the actual terminal width. See also: ''--wrap''.')
|
|
||||||
[CompletionResult]::new('--color', 'color', [CompletionResultType]::ParameterName, 'When to use colors (*auto*, never, always).')
|
|
||||||
[CompletionResult]::new('--italic-text', 'italic-text', [CompletionResultType]::ParameterName, 'Use italics in output (always, *never*)')
|
|
||||||
[CompletionResult]::new('--decorations', 'decorations', [CompletionResultType]::ParameterName, 'When to show the decorations (*auto*, never, always).')
|
|
||||||
[CompletionResult]::new('--paging', 'paging', [CompletionResultType]::ParameterName, 'Specify when to use the pager, or use `-P` to disable (*auto*, never, always).')
|
|
||||||
[CompletionResult]::new('--pager', 'pager', [CompletionResultType]::ParameterName, 'Determine which pager to use.')
|
|
||||||
[CompletionResult]::new('-m', 'm', [CompletionResultType]::ParameterName, 'Use the specified syntax for files matching the glob pattern (''*.cpp:C++'').')
|
|
||||||
[CompletionResult]::new('--map-syntax', 'map-syntax', [CompletionResultType]::ParameterName, 'Use the specified syntax for files matching the glob pattern (''*.cpp:C++'').')
|
|
||||||
[CompletionResult]::new('--theme', 'theme', [CompletionResultType]::ParameterName, 'Set the color theme for syntax highlighting.')
|
|
||||||
[CompletionResult]::new('--style', 'style', [CompletionResultType]::ParameterName, 'Comma-separated list of style elements to display (*default*, auto, full, plain, changes, header, header-filename, header-filesize, grid, rule, numbers, snip).')
|
|
||||||
[CompletionResult]::new('-r', 'r', [CompletionResultType]::ParameterName, 'Only print the lines from N to M.')
|
|
||||||
[CompletionResult]::new('--line-range', 'line-range', [CompletionResultType]::ParameterName, 'Only print the lines from N to M.')
|
|
||||||
[CompletionResult]::new('-A', 'A', [CompletionResultType]::ParameterName, 'Show non-printable characters (space, tab, newline, ..).')
|
|
||||||
[CompletionResult]::new('--show-all', 'show-all', [CompletionResultType]::ParameterName, 'Show non-printable characters (space, tab, newline, ..).')
|
|
||||||
[CompletionResult]::new('-p', 'p', [CompletionResultType]::ParameterName, 'Show plain style (alias for ''--style=plain'').')
|
|
||||||
[CompletionResult]::new('--plain', 'plain', [CompletionResultType]::ParameterName, 'Show plain style (alias for ''--style=plain'').')
|
|
||||||
[CompletionResult]::new('-d', 'd', [CompletionResultType]::ParameterName, 'Only show lines that have been added/removed/modified.')
|
|
||||||
[CompletionResult]::new('--diff', 'diff', [CompletionResultType]::ParameterName, 'Only show lines that have been added/removed/modified.')
|
|
||||||
[CompletionResult]::new('-n', 'n', [CompletionResultType]::ParameterName, 'Show line numbers (alias for ''--style=numbers'').')
|
|
||||||
[CompletionResult]::new('--number', 'number', [CompletionResultType]::ParameterName, 'Show line numbers (alias for ''--style=numbers'').')
|
|
||||||
[CompletionResult]::new('-f', 'f', [CompletionResultType]::ParameterName, 'f')
|
|
||||||
[CompletionResult]::new('--force-colorization', 'force-colorization', [CompletionResultType]::ParameterName, 'force-colorization')
|
|
||||||
[CompletionResult]::new('-P', 'P', [CompletionResultType]::ParameterName, 'Alias for ''--paging=never''')
|
|
||||||
[CompletionResult]::new('--no-paging', 'no-paging', [CompletionResultType]::ParameterName, 'Alias for ''--paging=never''')
|
|
||||||
[CompletionResult]::new('--list-themes', 'list-themes', [CompletionResultType]::ParameterName, 'Display all supported highlighting themes.')
|
|
||||||
[CompletionResult]::new('-L', 'L', [CompletionResultType]::ParameterName, 'Display all supported languages.')
|
|
||||||
[CompletionResult]::new('--list-languages', 'list-languages', [CompletionResultType]::ParameterName, 'Display all supported languages.')
|
|
||||||
[CompletionResult]::new('-u', 'u', [CompletionResultType]::ParameterName, 'u')
|
|
||||||
[CompletionResult]::new('--unbuffered', 'unbuffered', [CompletionResultType]::ParameterName, 'unbuffered')
|
|
||||||
[CompletionResult]::new('--no-config', 'no-config', [CompletionResultType]::ParameterName, 'Do not use the configuration file')
|
|
||||||
[CompletionResult]::new('--no-custom-assets', 'no-custom-assets', [CompletionResultType]::ParameterName, 'Do not load custom assets')
|
|
||||||
[CompletionResult]::new('--lessopen', 'lessopen', [CompletionResultType]::ParameterName, 'Enable the $LESSOPEN preprocessor')
|
|
||||||
[CompletionResult]::new('--no-lessopen', 'no-lessopen', [CompletionResultType]::ParameterName, 'Disable the $LESSOPEN preprocessor if enabled (overrides --lessopen)')
|
|
||||||
[CompletionResult]::new('--config-file', 'config-file', [CompletionResultType]::ParameterName, 'Show path to the configuration file.')
|
|
||||||
[CompletionResult]::new('--generate-config-file', 'generate-config-file', [CompletionResultType]::ParameterName, 'Generates a default configuration file.')
|
|
||||||
[CompletionResult]::new('--config-dir', 'config-dir', [CompletionResultType]::ParameterName, 'Show bat''s configuration directory.')
|
|
||||||
[CompletionResult]::new('--cache-dir', 'cache-dir', [CompletionResultType]::ParameterName, 'Show bat''s cache directory.')
|
|
||||||
[CompletionResult]::new('--diagnostic', 'diagnostic', [CompletionResultType]::ParameterName, 'Show diagnostic information for bug reports.')
|
|
||||||
[CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print this help message.')
|
|
||||||
[CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print this help message.')
|
|
||||||
[CompletionResult]::new('-V', 'V', [CompletionResultType]::ParameterName, 'Show version information.')
|
|
||||||
[CompletionResult]::new('--version', 'version', [CompletionResultType]::ParameterName, 'Show version information.')
|
|
||||||
## Completion of the 'cache' command itself is removed for better UX
|
|
||||||
## See https://github.com/sharkdp/bat/issues/2085#issuecomment-1271646802
|
|
||||||
break
|
|
||||||
}
|
|
||||||
'{{PROJECT_EXECUTABLE}};cache' {
|
|
||||||
[CompletionResult]::new('--source', 'source', [CompletionResultType]::ParameterName, 'Use a different directory to load syntaxes and themes from.')
|
|
||||||
[CompletionResult]::new('--target', 'target', [CompletionResultType]::ParameterName, 'Use a different directory to store the cached syntax and theme set.')
|
|
||||||
[CompletionResult]::new('-b', 'b', [CompletionResultType]::ParameterName, 'Initialize (or update) the syntax/theme cache.')
|
|
||||||
[CompletionResult]::new('--build', 'build', [CompletionResultType]::ParameterName, 'Initialize (or update) the syntax/theme cache.')
|
|
||||||
[CompletionResult]::new('-c', 'c', [CompletionResultType]::ParameterName, 'Remove the cached syntax definitions and themes.')
|
|
||||||
[CompletionResult]::new('--clear', 'clear', [CompletionResultType]::ParameterName, 'Remove the cached syntax definitions and themes.')
|
|
||||||
[CompletionResult]::new('--blank', 'blank', [CompletionResultType]::ParameterName, 'Create completely new syntax and theme sets (instead of appending to the default sets).')
|
|
||||||
[CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Prints help information')
|
|
||||||
[CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Prints help information')
|
|
||||||
[CompletionResult]::new('-V', 'V', [CompletionResultType]::ParameterName, 'Prints version information')
|
|
||||||
[CompletionResult]::new('--version', 'version', [CompletionResultType]::ParameterName, 'Prints version information')
|
|
||||||
break
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
$completions.Where{ $_.CompletionText -like "$wordToComplete*" } |
|
|
||||||
Sort-Object -Property ListItemText
|
|
||||||
}
|
|
@ -1,200 +0,0 @@
|
|||||||
# shellcheck disable=SC2207
|
|
||||||
|
|
||||||
# Requires https://github.com/scop/bash-completion
|
|
||||||
|
|
||||||
# Macs have bash3 for which the bash-completion package doesn't include
|
|
||||||
# _init_completion. This is a minimal version of that function.
|
|
||||||
__bat_init_completion()
|
|
||||||
{
|
|
||||||
COMPREPLY=()
|
|
||||||
_get_comp_words_by_ref "$@" cur prev words cword
|
|
||||||
}
|
|
||||||
|
|
||||||
__bat_escape_completions()
|
|
||||||
{
|
|
||||||
# Do not escape if completing a quoted value.
|
|
||||||
[[ $cur == [\"\']* ]] && return 0
|
|
||||||
# printf -v to an array index is available in bash >= 4.1.
|
|
||||||
# Use it if available, as -o filenames is semantically incorrect if
|
|
||||||
# we are not actually completing filenames, and it has side effects
|
|
||||||
# (e.g. adds trailing slash to candidates matching present dirs).
|
|
||||||
if ((
|
|
||||||
BASH_VERSINFO[0] > 4 || \
|
|
||||||
BASH_VERSINFO[0] == 4 && BASH_VERSINFO[1] > 0
|
|
||||||
)); then
|
|
||||||
local i
|
|
||||||
for i in ${!COMPREPLY[*]}; do
|
|
||||||
printf -v "COMPREPLY[i]" %q "${COMPREPLY[i]}"
|
|
||||||
done
|
|
||||||
else
|
|
||||||
compopt -o filenames
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
_bat() {
|
|
||||||
local cur prev words split=false
|
|
||||||
if declare -F _init_completion >/dev/null 2>&1; then
|
|
||||||
_init_completion -s || return 0
|
|
||||||
else
|
|
||||||
__bat_init_completion -n "=" || return 0
|
|
||||||
_split_longopt && split=true
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ ${words[1]-} == cache ]]; then
|
|
||||||
case $prev in
|
|
||||||
--source | --target)
|
|
||||||
_filedir -d
|
|
||||||
return 0
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
COMPREPLY=($(compgen -W "
|
|
||||||
--build
|
|
||||||
--clear
|
|
||||||
--source
|
|
||||||
--target
|
|
||||||
--blank
|
|
||||||
--help
|
|
||||||
" -- "$cur"))
|
|
||||||
return 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
case $prev in
|
|
||||||
-l | --language)
|
|
||||||
local IFS=$'\n'
|
|
||||||
COMPREPLY=($(compgen -W "$(
|
|
||||||
"$1" --list-languages | while IFS=: read -r lang _; do
|
|
||||||
printf "%s\n" "$lang"
|
|
||||||
done
|
|
||||||
)" -- "$cur"))
|
|
||||||
__bat_escape_completions
|
|
||||||
return 0
|
|
||||||
;;
|
|
||||||
-H | --highlight-line | \
|
|
||||||
--diff-context | \
|
|
||||||
--tabs | \
|
|
||||||
--terminal-width | \
|
|
||||||
-m | --map-syntax | \
|
|
||||||
--ignored-suffix | \
|
|
||||||
--list-themes | \
|
|
||||||
--squeeze-limit | \
|
|
||||||
--line-range | \
|
|
||||||
-L | --list-languages | \
|
|
||||||
--lessopen | \
|
|
||||||
--diagnostic | \
|
|
||||||
--acknowledgements | \
|
|
||||||
-h | --help | \
|
|
||||||
-V | --version | \
|
|
||||||
--cache-dir | \
|
|
||||||
--config-dir | \
|
|
||||||
--config-file | \
|
|
||||||
--generate-config-file)
|
|
||||||
# argument required but no completion available, or option
|
|
||||||
# causes an exit
|
|
||||||
return 0
|
|
||||||
;;
|
|
||||||
--file-name)
|
|
||||||
_filedir
|
|
||||||
return 0
|
|
||||||
;;
|
|
||||||
--wrap)
|
|
||||||
COMPREPLY=($(compgen -W "auto never character" -- "$cur"))
|
|
||||||
return 0
|
|
||||||
;;
|
|
||||||
--color | --decorations | --paging)
|
|
||||||
COMPREPLY=($(compgen -W "auto never always" -- "$cur"))
|
|
||||||
return 0
|
|
||||||
;;
|
|
||||||
--italic-text)
|
|
||||||
COMPREPLY=($(compgen -W "always never" -- "$cur"))
|
|
||||||
return 0
|
|
||||||
;;
|
|
||||||
--pager)
|
|
||||||
COMPREPLY=($(compgen -c -- "$cur"))
|
|
||||||
return 0
|
|
||||||
;;
|
|
||||||
--theme)
|
|
||||||
local IFS=$'\n'
|
|
||||||
COMPREPLY=($(compgen -W "$("$1" --list-themes)" -- "$cur"))
|
|
||||||
__bat_escape_completions
|
|
||||||
return 0
|
|
||||||
;;
|
|
||||||
--style)
|
|
||||||
# shellcheck disable=SC2034
|
|
||||||
local -a styles=(
|
|
||||||
default
|
|
||||||
full
|
|
||||||
auto
|
|
||||||
plain
|
|
||||||
changes
|
|
||||||
header
|
|
||||||
header-filename
|
|
||||||
header-filesize
|
|
||||||
grid
|
|
||||||
rule
|
|
||||||
numbers
|
|
||||||
snip
|
|
||||||
)
|
|
||||||
# shellcheck disable=SC2016
|
|
||||||
if declare -F _comp_delimited >/dev/null 2>&1; then
|
|
||||||
# bash-completion > 2.11
|
|
||||||
_comp_delimited , -W '"${styles[@]}"'
|
|
||||||
else
|
|
||||||
COMPREPLY=($(compgen -W '${styles[@]}' -- "$cur"))
|
|
||||||
fi
|
|
||||||
return 0
|
|
||||||
esac
|
|
||||||
|
|
||||||
$split && return 0
|
|
||||||
|
|
||||||
if [[ $cur == -* ]]; then
|
|
||||||
# --unbuffered excluded intentionally (no-op)
|
|
||||||
COMPREPLY=($(compgen -W "
|
|
||||||
--show-all
|
|
||||||
--plain
|
|
||||||
--language
|
|
||||||
--highlight-line
|
|
||||||
--file-name
|
|
||||||
--diff
|
|
||||||
--diff-context
|
|
||||||
--tabs
|
|
||||||
--wrap
|
|
||||||
--chop-long-lines
|
|
||||||
--terminal-width
|
|
||||||
--number
|
|
||||||
--color
|
|
||||||
--italic-text
|
|
||||||
--decorations
|
|
||||||
--force-colorization
|
|
||||||
--paging
|
|
||||||
--pager
|
|
||||||
--map-syntax
|
|
||||||
--ignored-suffix
|
|
||||||
--theme
|
|
||||||
--list-themes
|
|
||||||
--squeeze-blank
|
|
||||||
--squeeze-limit
|
|
||||||
--style
|
|
||||||
--line-range
|
|
||||||
--list-languages
|
|
||||||
--lessopen
|
|
||||||
--diagnostic
|
|
||||||
--acknowledgements
|
|
||||||
--set-terminal-title
|
|
||||||
--help
|
|
||||||
--version
|
|
||||||
--cache-dir
|
|
||||||
--config-dir
|
|
||||||
--config-file
|
|
||||||
--generate-config-file
|
|
||||||
--no-config
|
|
||||||
--no-custom-assets
|
|
||||||
--no-lessopen
|
|
||||||
" -- "$cur"))
|
|
||||||
return 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
_filedir
|
|
||||||
|
|
||||||
## Completion of the 'cache' command itself is removed for better UX
|
|
||||||
## See https://github.com/sharkdp/bat/issues/2085#issuecomment-1271646802
|
|
||||||
} && complete -F _bat {{PROJECT_EXECUTABLE}}
|
|
@ -1,232 +0,0 @@
|
|||||||
# Fish Shell Completions
|
|
||||||
# Copy or symlink to $XDG_CONFIG_HOME/fish/completions/{{PROJECT_EXECUTABLE}}.fish
|
|
||||||
# ($XDG_CONFIG_HOME is usually set to ~/.config)
|
|
||||||
|
|
||||||
# `bat` is `batcat` on Debian and Ubuntu
|
|
||||||
set bat {{PROJECT_EXECUTABLE}}
|
|
||||||
|
|
||||||
# Helper functions:
|
|
||||||
|
|
||||||
function __bat_complete_files -a token
|
|
||||||
# Cheat to complete files by calling `complete -C` on a fake command name,
|
|
||||||
# like `__fish_complete_directories` does.
|
|
||||||
set -l fake_command aaabccccdeeeeefffffffffgghhhhhhiiiii
|
|
||||||
complete -C"$fake_command $token"
|
|
||||||
end
|
|
||||||
|
|
||||||
function __bat_complete_one_language -a comp
|
|
||||||
command $bat --list-languages | string split -f1 : | string match -e "$comp"
|
|
||||||
end
|
|
||||||
|
|
||||||
function __bat_complete_list_languages
|
|
||||||
for spec in (command $bat --list-languages)
|
|
||||||
set -l name (string split -f1 : $spec)
|
|
||||||
for ext in (string split -f2 : $spec | string split ,)
|
|
||||||
test -n "$ext"; or continue
|
|
||||||
string match -rq '[/*]' $ext; and continue
|
|
||||||
printf "%s\t%s\n" $ext $name
|
|
||||||
end
|
|
||||||
printf "%s\t\n" $name
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function __bat_complete_map_syntax
|
|
||||||
set -l token (commandline -ct)
|
|
||||||
|
|
||||||
if string match -qr '(?<glob>.+):(?<syntax>.*)' -- $token
|
|
||||||
# If token ends with a colon, complete with the list of language names.
|
|
||||||
set -f comps $glob:(__bat_complete_one_language $syntax)
|
|
||||||
else if string match -qr '\*' -- $token
|
|
||||||
# If token contains a globbing character (`*`), complete only possible
|
|
||||||
# globs in the current directory
|
|
||||||
set -f comps (__bat_complete_files $token | string match -er '[*]'):
|
|
||||||
else
|
|
||||||
# Complete files (and globs).
|
|
||||||
set -f comps (__bat_complete_files $token | string match -erv '/$'):
|
|
||||||
end
|
|
||||||
|
|
||||||
if set -q comps[1]
|
|
||||||
printf "%s\t\n" $comps
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function __bat_cache_subcommand
|
|
||||||
__fish_seen_subcommand_from cache
|
|
||||||
end
|
|
||||||
|
|
||||||
# Returns true if no exclusive arguments seen.
|
|
||||||
function __bat_no_excl_args
|
|
||||||
not __bat_cache_subcommand; and not __fish_seen_argument \
|
|
||||||
-s h -l help \
|
|
||||||
-s V -l version \
|
|
||||||
-l acknowledgements \
|
|
||||||
-l config-dir -l config-file \
|
|
||||||
-l diagnostic \
|
|
||||||
-l list-languages -l list-themes
|
|
||||||
end
|
|
||||||
|
|
||||||
# Returns true if the 'cache' subcommand is seen without any exclusive arguments.
|
|
||||||
function __bat_cache_no_excl
|
|
||||||
__bat_cache_subcommand; and not __fish_seen_argument \
|
|
||||||
-s h -l help \
|
|
||||||
-l acknowledgements -l build -l clear
|
|
||||||
end
|
|
||||||
|
|
||||||
function __bat_style_opts
|
|
||||||
set -l style_opts \
|
|
||||||
"default,recommended components" \
|
|
||||||
"auto,same as 'default' unless piped" \
|
|
||||||
"full,all components" \
|
|
||||||
"plain,no components" \
|
|
||||||
"changes,Git change markers" \
|
|
||||||
"header,alias for header-filename" \
|
|
||||||
"header-filename,filename above content" \
|
|
||||||
"header-filesize,filesize above content" \
|
|
||||||
"grid,lines b/w sidebar/header/content" \
|
|
||||||
"numbers,line numbers in sidebar" \
|
|
||||||
"rule,separate files" \
|
|
||||||
"snip,separate ranges"
|
|
||||||
|
|
||||||
string replace , \t $style_opts
|
|
||||||
end
|
|
||||||
|
|
||||||
# Use option argument descriptions to indicate which is the default, saving
|
|
||||||
# horizontal space and making sure the option description isn't truncated.
|
|
||||||
set -l color_opts '
|
|
||||||
auto\tdefault
|
|
||||||
never\t
|
|
||||||
always\t
|
|
||||||
'
|
|
||||||
set -l decorations_opts $color_opts
|
|
||||||
set -l paging_opts $color_opts
|
|
||||||
|
|
||||||
# Include some examples so we can indicate the default.
|
|
||||||
set -l pager_opts '
|
|
||||||
less\tdefault
|
|
||||||
less\ -FR\t
|
|
||||||
more\t
|
|
||||||
vimpager\t
|
|
||||||
'
|
|
||||||
|
|
||||||
set -l italic_text_opts '
|
|
||||||
always\t
|
|
||||||
never\tdefault
|
|
||||||
'
|
|
||||||
|
|
||||||
set -l wrap_opts '
|
|
||||||
auto\tdefault
|
|
||||||
never\t
|
|
||||||
character\t
|
|
||||||
'
|
|
||||||
|
|
||||||
# While --tabs theoretically takes any number, most people should be OK with these.
|
|
||||||
# Specifying a list lets us explain what 0 does.
|
|
||||||
set -l tabs_opts '
|
|
||||||
0\tpass\ tabs\ through\ directly
|
|
||||||
1\t
|
|
||||||
2\t
|
|
||||||
4\t
|
|
||||||
8\t
|
|
||||||
'
|
|
||||||
|
|
||||||
# Completions:
|
|
||||||
|
|
||||||
complete -c $bat -l acknowledgements -d "Print acknowledgements" -n __fish_is_first_arg
|
|
||||||
|
|
||||||
complete -c $bat -l cache-dir -f -d "Show bat's cache directory" -n __fish_is_first_arg
|
|
||||||
|
|
||||||
complete -c $bat -l color -x -a "$color_opts" -d "When to use colored output" -n __bat_no_excl_args
|
|
||||||
|
|
||||||
complete -c $bat -l config-dir -f -d "Display location of configuration directory" -n __fish_is_first_arg
|
|
||||||
|
|
||||||
complete -c $bat -l config-file -f -d "Display location of configuration file" -n __fish_is_first_arg
|
|
||||||
|
|
||||||
complete -c $bat -l decorations -x -a "$decorations_opts" -d "When to use --style decorations" -n __bat_no_excl_args
|
|
||||||
|
|
||||||
complete -c $bat -l diagnostic -d "Print diagnostic info for bug reports" -n __fish_is_first_arg
|
|
||||||
|
|
||||||
complete -c $bat -s d -l diff -d "Only show lines with Git changes" -n __bat_no_excl_args
|
|
||||||
|
|
||||||
complete -c $bat -l diff-context -x -d "Show N context lines around Git changes" -n "__fish_seen_argument -s d -l diff"
|
|
||||||
|
|
||||||
complete -c $bat -l generate-config-file -f -d "Generates a default configuration file" -n __fish_is_first_arg
|
|
||||||
|
|
||||||
complete -c $bat -l file-name -x -d "Specify the display name" -n __bat_no_excl_args
|
|
||||||
|
|
||||||
complete -c $bat -s f -l force-colorization -d "Force color and decorations" -n __bat_no_excl_args
|
|
||||||
|
|
||||||
complete -c $bat -s h -d "Print a concise overview" -n __fish_is_first_arg
|
|
||||||
|
|
||||||
complete -c $bat -l help -f -d "Print all help information" -n __fish_is_first_arg
|
|
||||||
|
|
||||||
complete -c $bat -s H -l highlight-line -x -d "Highlight line(s) N[:M]" -n __bat_no_excl_args
|
|
||||||
|
|
||||||
complete -c $bat -l ignored-suffix -x -d "Ignore extension" -n __bat_no_excl_args
|
|
||||||
|
|
||||||
complete -c $bat -l italic-text -x -a "$italic_text_opts" -d "When to use italic text in the output" -n __bat_no_excl_args
|
|
||||||
|
|
||||||
complete -c $bat -s l -l language -x -k -a "(__bat_complete_list_languages)" -d "Set the syntax highlighting language" -n __bat_no_excl_args
|
|
||||||
|
|
||||||
complete -c $bat -l lessopen -d "Enable the $LESSOPEN preprocessor" -n __fish_is_first_arg
|
|
||||||
|
|
||||||
complete -c $bat -s r -l line-range -x -d "Only print lines [M]:[N] (either optional)" -n __bat_no_excl_args
|
|
||||||
|
|
||||||
complete -c $bat -l list-languages -f -d "List syntax highlighting languages" -n __fish_is_first_arg
|
|
||||||
|
|
||||||
complete -c $bat -l list-themes -f -d "List syntax highlighting themes" -n __fish_is_first_arg
|
|
||||||
|
|
||||||
complete -c $bat -s m -l map-syntax -x -a "(__bat_complete_map_syntax)" -d "Map <glob pattern>:<language syntax>" -n __bat_no_excl_args
|
|
||||||
|
|
||||||
complete -c $bat -l no-config -d "Do not use the configuration file"
|
|
||||||
|
|
||||||
complete -c $bat -l no-custom-assets -d "Do not load custom assets"
|
|
||||||
|
|
||||||
complete -c $bat -l no-lessopen -d "Disable the $LESSOPEN preprocessor if enabled (overrides --lessopen)"
|
|
||||||
|
|
||||||
complete -c $bat -s n -l number -d "Only show line numbers, no other decorations" -n __bat_no_excl_args
|
|
||||||
|
|
||||||
complete -c $bat -l pager -x -a "$pager_opts" -d "Which pager to use" -n __bat_no_excl_args
|
|
||||||
|
|
||||||
complete -c $bat -l paging -x -a "$paging_opts" -d "When to use the pager" -n __bat_no_excl_args
|
|
||||||
|
|
||||||
complete -c $bat -s p -l plain -d "Disable decorations" -n __bat_no_excl_args
|
|
||||||
|
|
||||||
complete -c $bat -o pp -d "Disable decorations and paging" -n __bat_no_excl_args
|
|
||||||
|
|
||||||
complete -c $bat -s P -d "Disable paging" -n __bat_no_excl_args
|
|
||||||
|
|
||||||
complete -c $bat -s A -l show-all -d "Show non-printable characters" -n __bat_no_excl_args
|
|
||||||
|
|
||||||
complete -c $bat -l style -x -k -a "(__fish_complete_list , __bat_style_opts)" -d "Specify which non-content elements to display" -n __bat_no_excl_args
|
|
||||||
|
|
||||||
complete -c $bat -l tabs -x -a "$tabs_opts" -d "Set tab width" -n __bat_no_excl_args
|
|
||||||
|
|
||||||
complete -c $bat -l terminal-width -x -d "Set terminal <width>, +<offset>, or -<offset>" -n __bat_no_excl_args
|
|
||||||
|
|
||||||
complete -c $bat -l theme -x -a "(command $bat --list-themes | command cat)" -d "Set the syntax highlighting theme" -n __bat_no_excl_args
|
|
||||||
|
|
||||||
complete -c $bat -s V -l version -f -d "Show version information" -n __fish_is_first_arg
|
|
||||||
|
|
||||||
complete -c $bat -l wrap -x -a "$wrap_opts" -d "Text-wrapping mode" -n __bat_no_excl_args
|
|
||||||
|
|
||||||
# Sub-command 'cache' completions
|
|
||||||
## Completion of the 'cache' command itself is removed for better UX
|
|
||||||
## See https://github.com/sharkdp/bat/issues/2085#issuecomment-1271646802
|
|
||||||
|
|
||||||
complete -c $bat -l build -f -d "Parse new definitions into cache" -n __bat_cache_no_excl
|
|
||||||
|
|
||||||
complete -c $bat -l clear -f -d "Reset definitions to defaults" -n __bat_cache_no_excl
|
|
||||||
|
|
||||||
complete -c $bat -l blank -f -d "Create new data instead of appending" -n "__bat_cache_subcommand; and not __fish_seen_argument -l clear"
|
|
||||||
|
|
||||||
complete -c $bat -l source -x -a "(__fish_complete_directories)" -d "Load syntaxes and themes from DIR" -n "__bat_cache_subcommand; and not __fish_seen_argument -l clear"
|
|
||||||
|
|
||||||
complete -c $bat -l target -x -a "(__fish_complete_directories)" -d "Store cache in DIR" -n __bat_cache_subcommand
|
|
||||||
|
|
||||||
complete -c $bat -l acknowledgements -d "Build acknowledgements.bin" -n __bat_cache_no_excl
|
|
||||||
|
|
||||||
complete -c $bat -s h -d "Print a concise overview of $bat-cache help" -n __bat_cache_no_excl
|
|
||||||
|
|
||||||
complete -c $bat -l help -f -d "Print all $bat-cache help" -n __bat_cache_no_excl
|
|
||||||
|
|
||||||
# vim:ft=fish
|
|
@ -1,107 +0,0 @@
|
|||||||
#compdef {{PROJECT_EXECUTABLE}}
|
|
||||||
|
|
||||||
local curcontext="$curcontext" ret=1
|
|
||||||
local -a state state_descr line
|
|
||||||
typeset -A opt_args
|
|
||||||
|
|
||||||
(( $+functions[_{{PROJECT_EXECUTABLE}}_cache_subcommand] )) ||
|
|
||||||
_{{PROJECT_EXECUTABLE}}_cache_subcommand() {
|
|
||||||
local -a args
|
|
||||||
args=(
|
|
||||||
'(-b --build -c --clear)'{-b,--build}'[initialize or update the syntax/theme cache]'
|
|
||||||
'(-b --build -c --clear)'{-c,--clear}'[remove the cached syntax definitions and themes]'
|
|
||||||
--source='[specify directory to load syntaxes and themes from]:directory:_files -/'
|
|
||||||
--target='[specify directory to store the cached syntax and theme set in]:directory:_files -/'
|
|
||||||
--blank'[create completely new syntax and theme sets]'
|
|
||||||
--acknowledgements'[build acknowledgements.bin]'
|
|
||||||
'(: -)'{-h,--help}'[show help information]'
|
|
||||||
)
|
|
||||||
|
|
||||||
_arguments -S -s $args
|
|
||||||
}
|
|
||||||
|
|
||||||
(( $+functions[_{{PROJECT_EXECUTABLE}}_main] )) ||
|
|
||||||
_{{PROJECT_EXECUTABLE}}_main() {
|
|
||||||
local -a args
|
|
||||||
args=(
|
|
||||||
'(-A --show-all)'{-A,--show-all}'[show non-printable characters (space, tab, newline, ..)]'
|
|
||||||
--nonprintable-notation='[specify how to display non-printable characters when using --show-all]:notation:(caret unicode)'
|
|
||||||
\*{-p,--plain}'[show plain style (alias for `--style=plain`), repeat twice to disable disable automatic paging (alias for `--paging=never`)]'
|
|
||||||
'(-l --language)'{-l+,--language=}'[set the language for syntax highlighting]:language:->languages'
|
|
||||||
\*{-H+,--highlight-line=}'[highlight specified block of lines]:start\:end'
|
|
||||||
\*--file-name='[specify the name to display for a file]:name:_files'
|
|
||||||
'(-d --diff)'--diff'[only show lines that have been added/removed/modified]'
|
|
||||||
--diff-context='[specify lines of context around added/removed/modified lines when using `--diff`]:lines'
|
|
||||||
--tabs='[set the tab width]:tab width [4]'
|
|
||||||
--wrap='[specify the text-wrapping mode]:mode [auto]:(auto never character)'
|
|
||||||
'!(--wrap)'{-S,--chop-long-lines}
|
|
||||||
--terminal-width='[explicitly set the width of the terminal instead of determining it automatically]:width'
|
|
||||||
'(-n --number --diff --diff-context)'{-n,--number}'[show line numbers]'
|
|
||||||
--color='[specify when to use colors]:when:(auto never always)'
|
|
||||||
--italic-text='[use italics in output]:when:(always never)'
|
|
||||||
--decorations='[specify when to show the decorations]:when:(auto never always)'
|
|
||||||
--paging='[specify when to use the pager]:when:(auto never always)'
|
|
||||||
'(-m --map-syntax)'{-m+,--map-syntax=}'[map a glob pattern to an existing syntax name]: :->syntax-maps'
|
|
||||||
'(--theme)'--theme='[set the color theme for syntax highlighting]:theme:->themes'
|
|
||||||
'(: --list-themes --list-languages -L)'--list-themes'[show all supported highlighting themes]'
|
|
||||||
--style='[comma-separated list of style elements to display]: : _values "style [default]"
|
|
||||||
default auto full plain changes header header-filename header-filesize grid rule numbers snip'
|
|
||||||
\*{-r+,--line-range=}'[only print the specified line range]:start\:end'
|
|
||||||
'(* -)'{-L,--list-languages}'[display all supported languages]'
|
|
||||||
-P'[disable paging]'
|
|
||||||
"--no-config[don't use the configuration file]"
|
|
||||||
"--no-custom-assets[don't load custom assets]"
|
|
||||||
'(--no-lessopen)'--lessopen'[enable the $LESSOPEN preprocessor]'
|
|
||||||
'(--lessopen)'--no-lessopen'[disable the $LESSOPEN preprocessor if enabled (overrides --lessopen)]'
|
|
||||||
'(* -)'--config-dir"[show bat's configuration directory]"
|
|
||||||
'(* -)'--config-file'[show path to the configuration file]'
|
|
||||||
'(* -)'--generate-config-file'[generate a default configuration file]'
|
|
||||||
'(* -)'--cache-dir"[show bat's cache directory]"
|
|
||||||
'(* -)'{-h,--help}'[show help information]'
|
|
||||||
'(* -)'{-V,--version}'[show version information]'
|
|
||||||
'*: :{ _files || compadd cache }'
|
|
||||||
)
|
|
||||||
|
|
||||||
_arguments -S -s $args && ret=0
|
|
||||||
|
|
||||||
case "$state" in
|
|
||||||
syntax-maps)
|
|
||||||
if ! compset -P '*:'; then
|
|
||||||
_message -e patterns 'glob pattern:language'
|
|
||||||
return
|
|
||||||
fi
|
|
||||||
;& # fall-through
|
|
||||||
|
|
||||||
languages)
|
|
||||||
local IFS=$'\n'
|
|
||||||
local -a languages
|
|
||||||
languages=( $({{PROJECT_EXECUTABLE}} --list-languages | awk -F':|,' '{ for (i = 1; i <= NF; ++i) printf("%s:%s\n", $i, $1) }') )
|
|
||||||
|
|
||||||
_describe 'language' languages && ret=0
|
|
||||||
;;
|
|
||||||
|
|
||||||
themes)
|
|
||||||
local -a themes expl
|
|
||||||
themes=( ${(f)"$(_call_program themes {{PROJECT_EXECUTABLE}} --list-themes)"} )
|
|
||||||
|
|
||||||
_wanted themes expl 'theme' compadd -a themes && ret=0
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
return ret
|
|
||||||
}
|
|
||||||
|
|
||||||
case $words[2] in
|
|
||||||
cache)
|
|
||||||
## Completion of the 'cache' command itself is removed for better UX
|
|
||||||
## See https://github.com/sharkdp/bat/issues/2085#issuecomment-1271646802
|
|
||||||
shift words
|
|
||||||
(( CURRENT-- ))
|
|
||||||
curcontext="${curcontext%:*}-${words[1]}:"
|
|
||||||
_{{PROJECT_EXECUTABLE}}_cache_subcommand
|
|
||||||
;;
|
|
||||||
|
|
||||||
*)
|
|
||||||
_{{PROJECT_EXECUTABLE}}_main
|
|
||||||
;;
|
|
||||||
esac
|
|
@ -1,69 +1,16 @@
|
|||||||
#!/usr/bin/env bash
|
#!/bin/bash
|
||||||
set -euo pipefail
|
|
||||||
|
|
||||||
ASSET_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
ASSET_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||||
REPO_DIR="$ASSET_DIR/.."
|
|
||||||
|
|
||||||
# Ensure submodules are initialized.
|
|
||||||
update_submodules() {
|
|
||||||
local submodule
|
|
||||||
local submodule_prompt=unspecified
|
|
||||||
local submodule_path
|
|
||||||
|
|
||||||
{
|
|
||||||
while { read -r submodule && read -r submodule_path; } <&3; do
|
|
||||||
if ! [[ -d "${REPO_DIR}/.git/modules/${submodule}" ]] && [[ -d "${REPO_DIR}/${submodule_path}" ]]; then
|
|
||||||
if [[ "$submodule_prompt" = "unspecified" ]]; then
|
|
||||||
echo "One or more submodules were found to be uninitialized."
|
|
||||||
printf "Initialize and update them? [Y/n] "
|
|
||||||
read -r submodule_prompt
|
|
||||||
fi
|
|
||||||
|
|
||||||
case "$submodule_prompt" in
|
|
||||||
y|yes|'') {
|
|
||||||
git -C "$REPO_DIR" submodule update --init "$submodule_path"
|
|
||||||
};;
|
|
||||||
n|no) {
|
|
||||||
return
|
|
||||||
};;
|
|
||||||
*) {
|
|
||||||
echo "Unknown answer. Not updating submodules."
|
|
||||||
};;
|
|
||||||
esac
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
} 3< <(git config --file "${REPO_DIR}/.gitmodules" --null --get-regexp path | xargs -0 printf "%s\n" | sed 's/^submodule.//;s/.path$//')
|
|
||||||
}
|
|
||||||
|
|
||||||
if [ -t 0 ]; then
|
|
||||||
update_submodules
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Always remove the local cache to avoid any confusion
|
# Always remove the local cache to avoid any confusion
|
||||||
bat cache --clear
|
bat cache --clear
|
||||||
|
|
||||||
# TODO:
|
# TODO: Remove this (and the reverse part below) when
|
||||||
# - Remove the JavaDoc patch once https://github.com/trishume/syntect/issues/222 has been fixed
|
# https://github.com/trishume/syntect/issues/160 has been fixed
|
||||||
# - Remove the C# patch once https://github.com/sublimehq/Packages/pull/2331 has been merged
|
JAVADOC_FILE="${ASSET_DIR}/syntaxes/Packages/Java/JavaDoc.sublime-syntax"
|
||||||
|
JAVADOC_PATCH="${ASSET_DIR}/JavaDoc.sublime-syntax.patch"
|
||||||
|
patch "$JAVADOC_FILE" "$JAVADOC_PATCH"
|
||||||
|
|
||||||
# Apply patches
|
bat cache --init --blank --source="$ASSET_DIR" --target="$ASSET_DIR"
|
||||||
(
|
|
||||||
cd "$ASSET_DIR"
|
|
||||||
for patch in patches/*.patch; do
|
|
||||||
patch --strip=0 < "$patch"
|
|
||||||
done
|
|
||||||
)
|
|
||||||
|
|
||||||
reverse_patches() {
|
patch -R "$JAVADOC_FILE" "$JAVADOC_PATCH"
|
||||||
(
|
|
||||||
cd "$ASSET_DIR"
|
|
||||||
for patch in patches/*.patch; do
|
|
||||||
patch --strip=0 --reverse <"$patch"
|
|
||||||
done
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
# Make sure to always reverse patches, even if the `bat cache` command fails or aborts
|
|
||||||
trap reverse_patches EXIT
|
|
||||||
|
|
||||||
bat cache --build --blank --acknowledgements --source="$ASSET_DIR" --target="$ASSET_DIR"
|
|
||||||
|
@ -1,332 +0,0 @@
|
|||||||
.TH {{PROJECT_EXECUTABLE_UPPERCASE}} "1"
|
|
||||||
.SH NAME
|
|
||||||
{{PROJECT_EXECUTABLE}} \- a cat(1) clone with syntax highlighting and Git integration.
|
|
||||||
.SH "USAGE"
|
|
||||||
.IP "{{PROJECT_EXECUTABLE}} [OPTIONS] [FILE]..."
|
|
||||||
.IP "{{PROJECT_EXECUTABLE}} cache [CACHE-OPTIONS] [--build|--clear]
|
|
||||||
.SH DESCRIPTION
|
|
||||||
{{PROJECT_EXECUTABLE}} prints the syntax-highlighted content of a collection of FILEs to the
|
|
||||||
terminal. If no FILE is specified, or when FILE is '-', it reads from standard input.
|
|
||||||
|
|
||||||
{{PROJECT_EXECUTABLE}} supports a large number of programming and markup languages.
|
|
||||||
It also communicates with git(1) to show modifications with respect to the git index.
|
|
||||||
{{PROJECT_EXECUTABLE}} automatically pipes its output through a pager (by default: less).
|
|
||||||
|
|
||||||
Whenever the output of {{PROJECT_EXECUTABLE}} goes to a non-interactive terminal, i.e. when the
|
|
||||||
output is piped into another process or into a file, {{PROJECT_EXECUTABLE}} will act as a drop-in
|
|
||||||
replacement for cat(1) and fall back to printing the plain file contents.
|
|
||||||
|
|
||||||
.SH "OPTIONS"
|
|
||||||
General remarks: Command-line options like '-l'/'--language' that take values can be specified as
|
|
||||||
either '--language value', '--language=value', '-l value' or '-lvalue'.
|
|
||||||
.HP
|
|
||||||
\fB\-A\fR, \fB\-\-show\-all\fR
|
|
||||||
.IP
|
|
||||||
Show non\-printable characters like space, tab or newline. Use '\-\-tabs' to
|
|
||||||
control the width of the tab\-placeholders.
|
|
||||||
.HP
|
|
||||||
\fB\-\-nonprintable\-notation\fR <notation>
|
|
||||||
.IP
|
|
||||||
Specify how to display non-printable characters when using \-\-show\-all.
|
|
||||||
|
|
||||||
Possible values:
|
|
||||||
.RS
|
|
||||||
.IP "caret"
|
|
||||||
Use character sequences like ^G, ^J, ^@, .. to identify non-printable characters
|
|
||||||
.IP "unicode"
|
|
||||||
Use special Unicode code points to identify non-printable characters
|
|
||||||
.RE
|
|
||||||
.HP
|
|
||||||
\fB\-p\fR, \fB\-\-plain\fR
|
|
||||||
.IP
|
|
||||||
Only show plain style, no decorations. This is an alias for
|
|
||||||
\&'\-\-style=plain'. When '\-p' is used twice ('\-pp'), it also disables
|
|
||||||
automatic paging (alias for '\-\-style=plain \fB\-\-paging\fR=\fI\,never\/\fR').
|
|
||||||
.HP
|
|
||||||
\fB\-l\fR, \fB\-\-language\fR <language>
|
|
||||||
.IP
|
|
||||||
Explicitly set the language for syntax highlighting. The language can be
|
|
||||||
specified as a name (like 'C++' or 'LaTeX') or possible file extension
|
|
||||||
(like 'cpp', 'hpp' or 'md'). Use '\-\-list\-languages' to show all supported
|
|
||||||
language names and file extensions.
|
|
||||||
.HP
|
|
||||||
\fB\-H\fR, \fB\-\-highlight\-line\fR <N:M>...
|
|
||||||
.IP
|
|
||||||
Highlight the specified line ranges with a different background color. For example:
|
|
||||||
.RS
|
|
||||||
.IP "\-\-highlight\-line 40"
|
|
||||||
highlights line 40
|
|
||||||
.IP "\-\-highlight\-line 30:40"
|
|
||||||
highlights lines 30 to 40
|
|
||||||
.IP "\-\-highlight\-line :40"
|
|
||||||
highlights lines 1 to 40
|
|
||||||
.IP "\-\-highlight\-line 40:"
|
|
||||||
highlights lines 40 to the end of the file
|
|
||||||
.IP "\-\-highlight\-line 30:+10"
|
|
||||||
highlights lines 30 to 40
|
|
||||||
.RE
|
|
||||||
.HP
|
|
||||||
\fB\-\-file\-name\fR <name>...
|
|
||||||
.IP
|
|
||||||
Specify the name to display for a file. Useful when piping data to {{PROJECT_EXECUTABLE}} from STDIN when {{PROJECT_EXECUTABLE}} does not otherwise know the filename. Note that the provided file name is also used for syntax detection.
|
|
||||||
.HP
|
|
||||||
\fB\-d\fR, \fB\-\-diff\fR
|
|
||||||
.IP
|
|
||||||
Only show lines that have been added/removed/modified with respect to the Git index. Use '\-\-diff\-context=N' to control how much context you want to see.
|
|
||||||
.HP
|
|
||||||
\fB\-\-diff\-context\fR <N>...
|
|
||||||
.IP
|
|
||||||
Include N lines of context around added/removed/modified lines when using '\-\-diff'.
|
|
||||||
.HP
|
|
||||||
\fB\-\-tabs\fR <T>
|
|
||||||
.IP
|
|
||||||
Set the tab width to T spaces. Use a width of 0 to pass tabs through directly
|
|
||||||
.HP
|
|
||||||
\fB\-\-wrap\fR <mode>
|
|
||||||
.IP
|
|
||||||
Specify the text\-wrapping mode (*auto*, never, character). The '\-\-terminal\-width' option
|
|
||||||
can be used in addition to control the output width.
|
|
||||||
.HP
|
|
||||||
\fB\-S\fR, \fB\-\-chop\-long\-lines\fR
|
|
||||||
.IP
|
|
||||||
Truncate all lines longer than screen width. Alias for '\-\-wrap=never'.
|
|
||||||
.HP
|
|
||||||
\fB\-\-terminal\-width\fR <width>
|
|
||||||
.IP
|
|
||||||
Explicitly set the width of the terminal instead of determining it automatically. If
|
|
||||||
prefixed with '+' or '\-', the value will be treated as an offset to the actual terminal
|
|
||||||
width. See also: '\-\-wrap'.
|
|
||||||
.HP
|
|
||||||
\fB\-n\fR, \fB\-\-number\fR
|
|
||||||
.IP
|
|
||||||
Only show line numbers, no other decorations. This is an alias for '\-\-style=numbers'
|
|
||||||
.HP
|
|
||||||
\fB\-\-color\fR <when>
|
|
||||||
.IP
|
|
||||||
Specify when to use colored output. The automatic mode only enables colors if an
|
|
||||||
interactive terminal is detected. Possible values: *auto*, never, always.
|
|
||||||
.HP
|
|
||||||
\fB\-\-italic\-text\fR <when>
|
|
||||||
.IP
|
|
||||||
Specify when to use ANSI sequences for italic text in the output. Possible values:
|
|
||||||
always, *never*.
|
|
||||||
.HP
|
|
||||||
\fB\-\-decorations\fR <when>
|
|
||||||
.IP
|
|
||||||
Specify when to use the decorations that have been specified via '\-\-style'. The
|
|
||||||
automatic mode only enables decorations if an interactive terminal is detected. Possible
|
|
||||||
values: *auto*, never, always.
|
|
||||||
.HP
|
|
||||||
\fB\-f\fR, \fB\-\-force\-colorization\fR
|
|
||||||
.IP
|
|
||||||
Alias for '--decorations=always --color=always'. This is useful \
|
|
||||||
if the output of {{PROJECT_EXECUTABLE}} is piped to another program, but you want \
|
|
||||||
to keep the colorization/decorations.
|
|
||||||
.HP
|
|
||||||
\fB\-\-paging\fR <when>
|
|
||||||
.IP
|
|
||||||
Specify when to use the pager. To disable the pager, use \&'\-\-paging=never' or its alias,
|
|
||||||
\fB-P\fR. To disable the pager permanently, set BAT_PAGER to an empty string. To control
|
|
||||||
which pager is used, see the '\-\-pager' option. Possible values: *auto*, never, always.
|
|
||||||
.HP
|
|
||||||
\fB\-\-pager\fR <command>
|
|
||||||
.IP
|
|
||||||
Determine which pager is used. This option will override the PAGER and BAT_PAGER
|
|
||||||
environment variables. The default pager is 'less'. To control when the pager is used, see
|
|
||||||
the '\-\-paging' option. Example: '\-\-pager "less \fB\-RF\fR"'.
|
|
||||||
|
|
||||||
Note: By default, if the pager is set to 'less' (and no command-line options are specified), 'bat' will pass the following command line options to the pager: '-R'/'--RAW-CONTROL-CHARS', '-F'/'--quit-if-one-screen' and '-X'/'--no-init'. The last option ('-X') is only used for 'less' versions older than 530. The '-R' option is needed to interpret ANSI colors correctly. The second option ('-F') instructs less to exit immediately if the output size is smaller than the vertical size of the terminal. This is convenient for small files because you do not have to press 'q' to quit the pager. The third option ('-X') is needed to fix a bug with the '--quit-if-one-screen' feature in old versions of 'less'. Unfortunately, it also breaks mouse-wheel support in 'less'. If you want to enable mouse-wheel scrolling on older versions of 'less', you can pass just '-R' (as in the example above, this will disable the quit-if-one-screen feature). For less 530 or newer, it should work out of the box.
|
|
||||||
.HP
|
|
||||||
\fB\-m\fR, \fB\-\-map\-syntax\fR <glob-pattern:syntax-name>...
|
|
||||||
.IP
|
|
||||||
Map a glob pattern to an existing syntax name. The glob pattern is matched on the full
|
|
||||||
path and the filename. For example, to highlight *.build files with the Python syntax,
|
|
||||||
use -m '*.build:Python'. To highlight files named '.myignore' with the Git Ignore
|
|
||||||
syntax, use -m '.myignore:Git Ignore'.
|
|
||||||
Note that the right-hand side is the *name* of the syntax, not a file extension.
|
|
||||||
.HP
|
|
||||||
\fB\-\-ignored\-suffix\fR <ignored-suffix>
|
|
||||||
.IP
|
|
||||||
Ignore extension. For example: 'bat \-\-ignored-suffix ".dev" my_file.json.dev'
|
|
||||||
will use JSON syntax, and ignore '.dev'
|
|
||||||
.HP
|
|
||||||
\fB\-\-theme\fR <theme>
|
|
||||||
.IP
|
|
||||||
Set the theme for syntax highlighting. Use '\-\-list\-themes' to see all available themes.
|
|
||||||
To set a default theme, add the '\-\-theme="..."' option to the configuration file or
|
|
||||||
export the BAT_THEME environment variable (e.g.: export BAT_THEME="...").
|
|
||||||
.HP
|
|
||||||
\fB\-\-list\-themes\fR
|
|
||||||
.IP
|
|
||||||
Display a list of supported themes for syntax highlighting.
|
|
||||||
.HP
|
|
||||||
\fB\-s\fR, \fB\-\-squeeze\-blank\fR
|
|
||||||
.IP
|
|
||||||
Squeeze consecutive empty lines into a single empty line.
|
|
||||||
.HP
|
|
||||||
\fB\-\-squeeze\-limit\fR <squeeze-limit>
|
|
||||||
.IP
|
|
||||||
Set the maximum number of consecutive empty lines to be printed.
|
|
||||||
.HP
|
|
||||||
\fB\-\-style\fR <style\-components>
|
|
||||||
.IP
|
|
||||||
Configure which elements (line numbers, file headers, grid borders, Git modifications,
|
|
||||||
\&..) to display in addition to the file contents. The argument is a comma\-separated list
|
|
||||||
of components to display (e.g. 'numbers,changes,grid') or a pre\-defined style ('full').
|
|
||||||
To set a default style, add the '\-\-style=".."' option to the configuration file or
|
|
||||||
export the BAT_STYLE environment variable (e.g.: export BAT_STYLE=".."). Possible
|
|
||||||
values: *default*, full, auto, plain, changes, header, header-filename, header-filesize, grid,
|
|
||||||
rule, numbers, snip.
|
|
||||||
.HP
|
|
||||||
\fB\-r\fR, \fB\-\-line\-range\fR <N:M>...
|
|
||||||
.IP
|
|
||||||
Only print the specified range of lines for each file. For example:
|
|
||||||
.RS
|
|
||||||
.IP "\-\-line\-range 30:40"
|
|
||||||
prints lines 30 to 40
|
|
||||||
.IP "\-\-line\-range :40"
|
|
||||||
prints lines 1 to 40
|
|
||||||
.IP "\-\-line\-range 40:"
|
|
||||||
prints lines 40 to the end of the file
|
|
||||||
.IP "\-\-line\-range 30:+10"
|
|
||||||
prints lines 30 to 40
|
|
||||||
.RE
|
|
||||||
.HP
|
|
||||||
\fB\-L\fR, \fB\-\-list\-languages\fR
|
|
||||||
.IP
|
|
||||||
Display a list of supported languages for syntax highlighting.
|
|
||||||
.HP
|
|
||||||
\fB\-u\fR, \fB\-\-unbuffered\fR
|
|
||||||
.IP
|
|
||||||
This option exists for POSIX\-compliance reasons ('u' is for 'unbuffered'). The output is
|
|
||||||
always unbuffered \- this option is simply ignored.
|
|
||||||
.HP
|
|
||||||
\fB\-\-no\-custom\-assets\fR
|
|
||||||
.IP
|
|
||||||
Do not load custom assets.
|
|
||||||
.HP
|
|
||||||
\fB\-\-config\-dir\fR
|
|
||||||
.IP
|
|
||||||
Show bat's configuration directory.
|
|
||||||
.HP
|
|
||||||
\fB\-\-cache\-dir\fR
|
|
||||||
.IP
|
|
||||||
Show bat's cache directory.
|
|
||||||
.HP
|
|
||||||
\fB\-\-diagnostic\fR
|
|
||||||
.IP
|
|
||||||
Show diagnostic information for bug reports.
|
|
||||||
.HP
|
|
||||||
\fB\-\-acknowledgements\fR
|
|
||||||
.IP
|
|
||||||
Show acknowledgements.
|
|
||||||
.HP
|
|
||||||
\fB\-\-set\-terminal\-title\fR
|
|
||||||
.IP
|
|
||||||
Sets terminal title to filenames when using a pager.
|
|
||||||
.HP
|
|
||||||
\fB\-h\fR, \fB\-\-help\fR
|
|
||||||
.IP
|
|
||||||
Print this help message.
|
|
||||||
.HP
|
|
||||||
\fB\-V\fR, \fB\-\-version\fR
|
|
||||||
.IP
|
|
||||||
Show version information.
|
|
||||||
.SH "POSITIONAL ARGUMENTS"
|
|
||||||
.HP
|
|
||||||
\fB<FILE>...\fR
|
|
||||||
.IP
|
|
||||||
Files to print and concatenate. Use a dash ('\-') or no argument at all to read from
|
|
||||||
standard input.
|
|
||||||
.SH "SUBCOMMANDS"
|
|
||||||
.HP
|
|
||||||
\fBcache\fR - Modify the syntax\-definition and theme cache.
|
|
||||||
.SH "FILES"
|
|
||||||
{{PROJECT_EXECUTABLE}} can also be customized with a configuration file. The location of the file
|
|
||||||
is dependent on your operating system. To get the default path for your system, call:
|
|
||||||
|
|
||||||
\fB{{PROJECT_EXECUTABLE}} --config-file\fR
|
|
||||||
|
|
||||||
Alternatively, you can use the BAT_CONFIG_PATH environment variable to point {{PROJECT_EXECUTABLE}} to a non-default
|
|
||||||
location of the configuration file.
|
|
||||||
|
|
||||||
To generate a default configuration file, call:
|
|
||||||
|
|
||||||
\fB{{PROJECT_EXECUTABLE}} --generate-config-file\fR
|
|
||||||
|
|
||||||
These are related options:
|
|
||||||
.HP
|
|
||||||
\fB\-\-config\-file\fR
|
|
||||||
.IP
|
|
||||||
Show path to the configuration file.
|
|
||||||
.HP
|
|
||||||
\fB\-\-generate-config\-file\fR
|
|
||||||
.IP
|
|
||||||
Generates a default configuration file.
|
|
||||||
.HP
|
|
||||||
\fB\-\-no\-config\fR
|
|
||||||
.IP
|
|
||||||
Do not use the configuration file.
|
|
||||||
.SH "ADDING CUSTOM LANGUAGES"
|
|
||||||
{{PROJECT_EXECUTABLE}} supports Sublime Text \fB.sublime-syntax\fR language files, and can be
|
|
||||||
customized to add additional languages to your local installation. To do this, add the \fB.sublime-syntax\fR language
|
|
||||||
files to `\fB$({{PROJECT_EXECUTABLE}} --config-dir)/syntaxes\fR` and run `\fB{{PROJECT_EXECUTABLE}} cache --build\fR`.
|
|
||||||
|
|
||||||
\fBExample:\fR
|
|
||||||
|
|
||||||
.RS 0.5i
|
|
||||||
mkdir -p "$({{PROJECT_EXECUTABLE}} --config-dir)/syntaxes"
|
|
||||||
.br
|
|
||||||
cd "$({{PROJECT_EXECUTABLE}} --config-dir)/syntaxes"
|
|
||||||
|
|
||||||
# Put new '.sublime-syntax' language definition files
|
|
||||||
.br
|
|
||||||
# in this folder (or its subdirectories), for example:
|
|
||||||
.br
|
|
||||||
git clone https://github.com/tellnobody1/sublime-purescript-syntax
|
|
||||||
|
|
||||||
# And then build the cache.
|
|
||||||
.br
|
|
||||||
{{PROJECT_EXECUTABLE}} cache --build
|
|
||||||
.RE
|
|
||||||
|
|
||||||
Once the cache is built, the new language will be visible in `\fB{{PROJECT_EXECUTABLE}} --list-languages\fR`.
|
|
||||||
.br
|
|
||||||
If you ever want to remove the custom languages, you can clear the cache with `\fB{{PROJECT_EXECUTABLE}} cache --clear\fR`.
|
|
||||||
|
|
||||||
.SH "ADDING CUSTOM THEMES"
|
|
||||||
Similarly to custom languages, {{PROJECT_EXECUTABLE}} supports Sublime Text \fB.tmTheme\fR themes.
|
|
||||||
These can be installed to `\fB$({{PROJECT_EXECUTABLE}} --config-dir)/themes\fR`, and are added to the cache with
|
|
||||||
`\fB{{PROJECT_EXECUTABLE}} cache --build`.
|
|
||||||
|
|
||||||
.SH "INPUT PREPROCESSOR"
|
|
||||||
Much like less(1) does, {{PROJECT_EXECUTABLE}} supports input preprocessors via the LESSOPEN and LESSCLOSE environment variables.
|
|
||||||
In addition, {{PROJECT_EXECUTABLE}} attempts to be as compatible with less's preprocessor implementation as possible.
|
|
||||||
|
|
||||||
To use the preprocessor, call:
|
|
||||||
|
|
||||||
\fB{{PROJECT_EXECUTABLE}} --lessopen\fR
|
|
||||||
|
|
||||||
Alternatively, the preprocessor may be enabled by default by adding the '\-\-lessopen' option to the configuration file.
|
|
||||||
|
|
||||||
To temporarily disable the preprocessor if it is enabled by default, call:
|
|
||||||
|
|
||||||
\fB{{PROJECT_EXECUTABLE}} --no-lessopen\fR
|
|
||||||
|
|
||||||
These are related options:
|
|
||||||
.HP
|
|
||||||
\fB\-\-lessopen\fR
|
|
||||||
.IP
|
|
||||||
Enable the $LESSOPEN preprocessor.
|
|
||||||
.HP
|
|
||||||
\fB\-\-no\-lessopen\fR
|
|
||||||
.IP
|
|
||||||
Disable the $LESSOPEN preprocessor if enabled (overrides --lessopen)
|
|
||||||
.PP
|
|
||||||
For more information, see the "INPUT PREPROCESSOR" section of less(1).
|
|
||||||
|
|
||||||
.SH "MORE INFORMATION"
|
|
||||||
|
|
||||||
For more information and up-to-date documentation, visit the {{PROJECT_EXECUTABLE}} repo:
|
|
||||||
.br
|
|
||||||
\fBhttps://github.com/sharkdp/bat\fR
|
|
@ -1,13 +0,0 @@
|
|||||||
diff --git syntaxes/01_Packages/C#/C#.sublime-syntax syntaxes/01_Packages/C#/C#.sublime-syntax
|
|
||||||
index ed494f8b..01b710e8 100644
|
|
||||||
--- syntaxes/01_Packages/C#/C#.sublime-syntax
|
|
||||||
+++ syntaxes/01_Packages/C#/C#.sublime-syntax
|
|
||||||
@@ -1312,7 +1312,7 @@ contexts:
|
|
||||||
2: punctuation.separator.cs
|
|
||||||
3: punctuation.section.brackets.end.cs
|
|
||||||
4: keyword.operator.pointer.cs
|
|
||||||
- - match: \((?=(?:[^,)(]*|\([^\)]*\))*,)
|
|
||||||
+ - match: \((?=(?:[^,)(]|\([^\)]*\))*,)
|
|
||||||
scope: punctuation.section.group.begin.cs
|
|
||||||
push:
|
|
||||||
- meta_scope: meta.group.tuple.cs
|
|
@ -1,16 +0,0 @@
|
|||||||
diff --git syntaxes/02_Extra/Groff/Man Page/Man Page.sublime-syntax syntaxes/02_Extra/Groff/Man Page/Man Page.sublime-syntax
|
|
||||||
index 57834af..6648664 100644
|
|
||||||
--- syntaxes/02_Extra/Groff/Man Page/Man Page.sublime-syntax
|
|
||||||
+++ syntaxes/02_Extra/Groff/Man Page/Man Page.sublime-syntax
|
|
||||||
@@ -4,9 +4,9 @@
|
|
||||||
# - man-pages(7)
|
|
||||||
# - groff(7)
|
|
||||||
---
|
|
||||||
-name: Man Page (groff/troff)
|
|
||||||
+name: Groff/troff
|
|
||||||
scope: text.groff
|
|
||||||
-file_extensions: [man, groff, troff, '1', '2', '3', '4', '5', '6', '7']
|
|
||||||
+file_extensions: [groff, troff, '1', '2', '3', '4', '5', '6', '7', '8', '9']
|
|
||||||
|
|
||||||
contexts:
|
|
||||||
main:
|
|
@ -1,14 +0,0 @@
|
|||||||
Submodule assets/syntaxes/01_Packages contains modified content
|
|
||||||
diff --git syntaxes/01_Packages/JavaScript/JavaScript.sublime-syntax syntaxes/01_Packages/JavaScript/JavaScript.sublime-syntax
|
|
||||||
index 05a4fed6..78a7bf55 100644
|
|
||||||
--- syntaxes/01_Packages/JavaScript/JavaScript.sublime-syntax
|
|
||||||
+++ syntaxes/01_Packages/JavaScript/JavaScript.sublime-syntax
|
|
||||||
@@ -5,7 +5,7 @@ name: JavaScript
|
|
||||||
file_extensions:
|
|
||||||
- js
|
|
||||||
- htc
|
|
||||||
-first_line_match: ^#!\s*/.*\b(node|js)\b
|
|
||||||
+first_line_match: ^#!\s*/.*\b(node|bun|js)\b
|
|
||||||
scope: source.js
|
|
||||||
variables:
|
|
||||||
bin_digit: '[01_]'
|
|
File diff suppressed because one or more lines are too long
@ -1,81 +0,0 @@
|
|||||||
diff --git syntaxes/01_Packages/Makefile/Makefile.sublime-syntax syntaxes/01_Packages/Makefile/Makefile.sublime-syntax
|
|
||||||
index 3cc3a97e..0c7a3f24 100644
|
|
||||||
--- syntaxes/01_Packages/Makefile/Makefile.sublime-syntax
|
|
||||||
+++ syntaxes/01_Packages/Makefile/Makefile.sublime-syntax
|
|
||||||
@@ -44,64 +44,50 @@ variables:
|
|
||||||
# variable substitutions anywhere. We try to remedy this by hacking in a
|
|
||||||
# regex that matches up to four levels of nested parentheses, and ignores
|
|
||||||
# whatever's inside the parentheses.
|
|
||||||
- nps: '[^()]*'
|
|
||||||
- open: '(?:\('
|
|
||||||
- close: '\))?' # ignore this invalid.illegal
|
|
||||||
+ nps_unnested: '[^()]*'
|
|
||||||
+ nps: '[^()]*(?=[()])'
|
|
||||||
+ open: '(?:{{nps}}\('
|
|
||||||
+ close: '\){{nps_unnested}})?' # ignore this invalid.illegal
|
|
||||||
just_eat: | # WARNING: INSANITY FOLLOWS!
|
|
||||||
- (?x) # ignore whitespace in this regex
|
|
||||||
- {{nps}} # level 0
|
|
||||||
+ (?x)(?: # ignore whitespace in this regex
|
|
||||||
{{open}} # start level 1 __
|
|
||||||
- {{nps}} # level 1 _______ /*_>-<
|
|
||||||
{{open}} # start level 2 ___/ _____ \__/ /
|
|
||||||
- {{nps}} # level 2 <____/ \____/
|
|
||||||
{{open}} # start level 3 is like snek... (by Valerie Haecky)
|
|
||||||
- {{nps}} # level 3
|
|
||||||
{{open}} # start level 4
|
|
||||||
{{nps}} # level 4
|
|
||||||
{{close}} # end level 4
|
|
||||||
- {{nps}} # level 3
|
|
||||||
{{close}} # end level 3
|
|
||||||
- {{nps}} # level 2
|
|
||||||
{{open}} # start level 3
|
|
||||||
- {{nps}} # level 3
|
|
||||||
{{open}} # start level 4
|
|
||||||
{{nps}} # level 4
|
|
||||||
{{close}} # end level 4
|
|
||||||
- {{nps}} # level 3
|
|
||||||
{{close}} # end level 3
|
|
||||||
- {{nps}} # level 2
|
|
||||||
+ {{nps}}
|
|
||||||
{{close}} # end level 2
|
|
||||||
- {{nps}} # level 1
|
|
||||||
{{open}} # start level 2
|
|
||||||
- {{nps}} # level 2
|
|
||||||
{{open}} # start level 3
|
|
||||||
- {{nps}} # level 3
|
|
||||||
{{open}} # start level 4
|
|
||||||
{{nps}} # level 4
|
|
||||||
{{close}} # end level 4
|
|
||||||
- {{nps}} # level 3
|
|
||||||
+ {{nps}}
|
|
||||||
{{close}} # end level 3
|
|
||||||
- {{nps}} # level 2
|
|
||||||
{{open}} # start level 3
|
|
||||||
- {{nps}} # level 3
|
|
||||||
{{open}} # start level 4
|
|
||||||
{{nps}} # level 4
|
|
||||||
{{close}} # end level 4
|
|
||||||
- {{nps}} # level 3
|
|
||||||
+ {{nps}}
|
|
||||||
{{close}} # end level 3
|
|
||||||
- {{nps}} # level 2
|
|
||||||
{{open}} # start level 3
|
|
||||||
- {{nps}} # level 3
|
|
||||||
{{open}} # start level 4
|
|
||||||
{{nps}} # level 4
|
|
||||||
{{close}} # end level 4
|
|
||||||
- {{nps}} # level 3
|
|
||||||
+ {{nps}}
|
|
||||||
{{close}} # end level 3
|
|
||||||
- {{nps}} # level 2
|
|
||||||
+ {{nps}}
|
|
||||||
{{close}} # end level 2
|
|
||||||
- {{nps}} # level 1
|
|
||||||
+ {{nps}}
|
|
||||||
{{close}} # end level 1
|
|
||||||
- {{nps}} # level 0
|
|
||||||
+ |{{nps_unnested}})
|
|
||||||
rule_lookahead: '{{just_eat}}{{ruleassign}}{{just_eat}}'
|
|
||||||
|
|
||||||
var_lookahead_base: '{{just_eat}}({{varassign}}|{{shellassign}}){{just_eat}}'
|
|
@ -1,177 +0,0 @@
|
|||||||
diff --git syntaxes/01_Packages/Markdown/Markdown.sublime-syntax syntaxes/01_Packages/Markdown/Markdown.sublime-syntax
|
|
||||||
index 19dc685d..44440c7f 100644
|
|
||||||
--- syntaxes/01_Packages/Markdown/Markdown.sublime-syntax
|
|
||||||
+++ syntaxes/01_Packages/Markdown/Markdown.sublime-syntax
|
|
||||||
@@ -24,7 +24,6 @@ variables:
|
|
||||||
)
|
|
||||||
[ \t]*$ # followed by any number of tabs or spaces, followed by the end of the line
|
|
||||||
)
|
|
||||||
- setext_escape: ^(?=\s{0,3}(?:---+|===+)\s*$)
|
|
||||||
block_quote: (?:[ ]{,3}>(?:.|$)) # between 0 and 3 spaces, followed by a greater than sign, followed by any character or the end of the line
|
|
||||||
atx_heading: (?:[#]{1,6}\s*) # between 1 and 6 hashes, followed by any amount of whitespace
|
|
||||||
indented_code_block: (?:[ ]{4}|\t) # 4 spaces or a tab
|
|
||||||
@@ -277,69 +276,40 @@ contexts:
|
|
||||||
8: markup.underline.link.markdown
|
|
||||||
push: [link-ref-def, after-link-title, link-title]
|
|
||||||
- match: '^(?=\S)(?![=-]{3,}\s*$)'
|
|
||||||
- branch_point: heading2-branch
|
|
||||||
- branch:
|
|
||||||
- - not-heading2
|
|
||||||
- - heading2
|
|
||||||
-
|
|
||||||
- not-paragraph:
|
|
||||||
- - match: |-
|
|
||||||
- (?x) # pop out of this context when one of the following conditions are met:
|
|
||||||
- ^(?:
|
|
||||||
- \s*$ # the line is blank (or only contains whitespace)
|
|
||||||
- | (?=
|
|
||||||
- {{block_quote}} # a block quote begins the line
|
|
||||||
- | [ ]{,3}[*+-][ ] # an unordered list item begins the line
|
|
||||||
- | [ ]{,3}1[.][ ] # an ordered list item with number "1" begins the line
|
|
||||||
- | \# # an ATX heading begins the line
|
|
||||||
- | [ ]{,3}<( # all types of HTML blocks except type 7 may interrupt a paragraph
|
|
||||||
- {{html_tag_block_end_at_close_tag}} # 1
|
|
||||||
- | !-- # 2
|
|
||||||
- | \? # 3
|
|
||||||
- | ![A-Z] # 4
|
|
||||||
- | !\[CDATA\[ # 5
|
|
||||||
- | {{html_tag_block_end_at_blank_line}} # 6
|
|
||||||
+ push:
|
|
||||||
+ - meta_scope: meta.paragraph.markdown
|
|
||||||
+ - match: |-
|
|
||||||
+ (?x) # pop out of this context when one of the following conditions are met:
|
|
||||||
+ ^(?:
|
|
||||||
+ \s*$ # the line is blank (or only contains whitespace)
|
|
||||||
+ | (?=
|
|
||||||
+ {{block_quote}} # a block quote begins the line
|
|
||||||
+ | [ ]{,3}[*+-][ ] # an unordered list item begins the line
|
|
||||||
+ | [ ]{,3}1[.][ ] # an ordered list item with number "1" begins the line
|
|
||||||
+ | \# # an ATX heading begins the line
|
|
||||||
+ | [ ]{,3}<( # all types of HTML blocks except type 7 may interrupt a paragraph
|
|
||||||
+ {{html_tag_block_end_at_close_tag}} # 1
|
|
||||||
+ | !-- # 2
|
|
||||||
+ | \? # 3
|
|
||||||
+ | ![A-Z] # 4
|
|
||||||
+ | !\[CDATA\[ # 5
|
|
||||||
+ | {{html_tag_block_end_at_blank_line}} # 6
|
|
||||||
+ )
|
|
||||||
)
|
|
||||||
)
|
|
||||||
- )
|
|
||||||
- pop: true
|
|
||||||
-
|
|
||||||
- not-heading2:
|
|
||||||
- - include: not-paragraph
|
|
||||||
- - match: (?=\S)
|
|
||||||
- branch_point: heading1-branch
|
|
||||||
- branch:
|
|
||||||
- - paragraph
|
|
||||||
- - heading1
|
|
||||||
- - match: ''
|
|
||||||
- pop: true
|
|
||||||
-
|
|
||||||
- paragraph:
|
|
||||||
- - meta_scope: meta.paragraph.markdown
|
|
||||||
- - match: ^\s{0,3}===+\s*$
|
|
||||||
- fail: heading1-branch
|
|
||||||
- - match: ^\s{0,3}---+\s*$
|
|
||||||
- fail: heading2-branch
|
|
||||||
- - include: not-paragraph
|
|
||||||
- - include: inline-bold-italic-linebreak
|
|
||||||
- - include: scope:text.html.basic
|
|
||||||
-
|
|
||||||
- heading1:
|
|
||||||
- - meta_scope: markup.heading.1.markdown
|
|
||||||
- - include: inline-bold-italic-linebreak
|
|
||||||
- - match: '^[ \t]{0,3}(={3,})(?=[ \t]*$)'
|
|
||||||
- captures:
|
|
||||||
- 1: markup.heading.1.setext.markdown punctuation.definition.heading.setext.markdown
|
|
||||||
- pop: true
|
|
||||||
-
|
|
||||||
- heading2:
|
|
||||||
- - meta_scope: markup.heading.2.markdown
|
|
||||||
- - include: inline-bold-italic-linebreak
|
|
||||||
- - match: '^[ \t]{0,3}(-{3,})(?=[ \t]*$)'
|
|
||||||
- captures:
|
|
||||||
- 1: markup.heading.2.setext.markdown punctuation.definition.heading.setext.markdown
|
|
||||||
- pop: true
|
|
||||||
-
|
|
||||||
+ pop: true
|
|
||||||
+ - include: inline-bold-italic-linebreak
|
|
||||||
+ - include: scope:text.html.basic
|
|
||||||
+ - match: '^(={3,})(?=[ \t]*$)'
|
|
||||||
+ scope: markup.heading.1.setext.markdown
|
|
||||||
+ captures:
|
|
||||||
+ 1: punctuation.definition.heading.setext.markdown
|
|
||||||
+ pop: true
|
|
||||||
+ - match: '^(-{3,})(?=[ \t]*$)'
|
|
||||||
+ scope: markup.heading.2.setext.markdown
|
|
||||||
+ captures:
|
|
||||||
+ 1: punctuation.definition.heading.setext.markdown
|
|
||||||
+ pop: true
|
|
||||||
link-ref-def:
|
|
||||||
- meta_scope: meta.link.reference.def.markdown
|
|
||||||
- match: ''
|
|
||||||
@@ -430,8 +400,6 @@ contexts:
|
|
||||||
push:
|
|
||||||
- meta_scope: markup.bold.markdown
|
|
||||||
- meta_content_scope: markup.italic.markdown
|
|
||||||
- - match: '{{setext_escape}}'
|
|
||||||
- pop: true
|
|
||||||
- match: |-
|
|
||||||
(?x)
|
|
||||||
[ \t]*\*{4,} # if there are more than 3 its not applicable to be bold or italic
|
|
||||||
@@ -446,8 +414,6 @@ contexts:
|
|
||||||
scope: punctuation.definition.bold.end.markdown
|
|
||||||
set:
|
|
||||||
- meta_content_scope: markup.italic.markdown
|
|
||||||
- - match: '{{setext_escape}}'
|
|
||||||
- pop: true
|
|
||||||
- match: |-
|
|
||||||
(?x)
|
|
||||||
[ \t]*\*{3,} # if there are more than 3 its not applicable to be bold or italic
|
|
||||||
@@ -463,8 +429,6 @@ contexts:
|
|
||||||
scope: punctuation.definition.italic.end.markdown
|
|
||||||
set:
|
|
||||||
- meta_content_scope: markup.bold.markdown
|
|
||||||
- - match: '{{setext_escape}}'
|
|
||||||
- pop: true
|
|
||||||
- match: |-
|
|
||||||
(?x)
|
|
||||||
[ \t]*\*{3,} # if there are more than 3 its not applicable to be bold or italic
|
|
||||||
@@ -727,8 +691,6 @@ contexts:
|
|
||||||
scope: punctuation.definition.italic.begin.markdown
|
|
||||||
push:
|
|
||||||
- meta_scope: markup.italic.markdown
|
|
||||||
- - match: '{{setext_escape}}'
|
|
||||||
- pop: true
|
|
||||||
- match: |-
|
|
||||||
(?x)
|
|
||||||
[ \t]*\*{4,} # if there are more than 3 its not applicable to be bold or italic
|
|
||||||
@@ -745,8 +707,6 @@ contexts:
|
|
||||||
scope: punctuation.definition.italic.begin.markdown
|
|
||||||
push:
|
|
||||||
- meta_scope: markup.italic.markdown
|
|
||||||
- - match: '{{setext_escape}}'
|
|
||||||
- pop: true
|
|
||||||
- match: |-
|
|
||||||
(?x)
|
|
||||||
[ \t]*_{4,} # if there are more than 3 its not applicable to be bold or italic
|
|
||||||
@@ -773,8 +733,6 @@ contexts:
|
|
||||||
- include: bold-italic-trailing
|
|
||||||
bold-italic-trailing:
|
|
||||||
- include: scope:text.html.basic
|
|
||||||
- - match: '{{setext_escape}}'
|
|
||||||
- pop: true
|
|
||||||
- match: ^\s*$\n?
|
|
||||||
scope: invalid.illegal.non-terminated.bold-italic.markdown
|
|
||||||
pop: true
|
|
||||||
@@ -1152,7 +1110,7 @@ contexts:
|
|
||||||
- match: |-
|
|
||||||
(?x)
|
|
||||||
{{fenced_code_block_start}}
|
|
||||||
- ((?i:rust))
|
|
||||||
+ ((?i:rust|rs))
|
|
||||||
{{fenced_code_block_trailing_infostring_characters}}
|
|
||||||
captures:
|
|
||||||
0: meta.code-fence.definition.begin.rust.markdown-gfm
|
|
@ -1,13 +0,0 @@
|
|||||||
diff --git syntaxes/02_Extra/MediaWiki/MediawikiNG.sublime-syntax syntaxes/02_Extra/MediaWiki/MediawikiNG.sublime-syntax
|
|
||||||
index f542c9e..8eaf020 100644
|
|
||||||
--- syntaxes/02_Extra/MediaWiki/MediawikiNG.sublime-syntax
|
|
||||||
+++ syntaxes/02_Extra/MediaWiki/MediawikiNG.sublime-syntax
|
|
||||||
@@ -1,7 +1,7 @@
|
|
||||||
%YAML 1.2
|
|
||||||
---
|
|
||||||
# http://www.sublimetext.com/docs/3/syntax.html
|
|
||||||
-name: Mediawiki NG
|
|
||||||
+name: MediaWiki
|
|
||||||
file_extensions: [mediawiki, wikipedia, wiki]
|
|
||||||
scope: text.html.mediawiki
|
|
||||||
|
|
@ -1,36 +0,0 @@
|
|||||||
diff --git themes/sublime-monokai-extended/Monokai\ Extended.tmTheme themes/sublime-monokai-extended/Monokai\ Extended.tmTheme
|
|
||||||
index 9c2aa3e..180cbbf 100644
|
|
||||||
--- themes/sublime-monokai-extended/Monokai Extended.tmTheme
|
|
||||||
+++ themes/sublime-monokai-extended/Monokai Extended.tmTheme
|
|
||||||
@@ -810,11 +810,11 @@
|
|
||||||
<key>name</key>
|
|
||||||
<string>JSON String</string>
|
|
||||||
<key>scope</key>
|
|
||||||
- <string>meta.structure.dictionary.json string.quoted.double.json</string>
|
|
||||||
+ <string>meta.mapping.key.json string.quoted.double.json, punctuation.separator.sequence.csv</string>
|
|
||||||
<key>settings</key>
|
|
||||||
<dict>
|
|
||||||
<key>foreground</key>
|
|
||||||
- <string>#cfcfc2</string>
|
|
||||||
+ <string>#fd971f</string>
|
|
||||||
</dict>
|
|
||||||
</dict>
|
|
||||||
<dict>
|
|
||||||
@@ -1027,7 +1027,7 @@
|
|
||||||
<key>name</key>
|
|
||||||
<string>Invalid</string>
|
|
||||||
<key>scope</key>
|
|
||||||
- <string>invalid</string>
|
|
||||||
+ <string>invalid, markup.error</string>
|
|
||||||
<key>settings</key>
|
|
||||||
<dict>
|
|
||||||
<key>background</key>
|
|
||||||
@@ -1042,7 +1042,7 @@
|
|
||||||
<key>name</key>
|
|
||||||
<string>Invalid deprecated</string>
|
|
||||||
<key>scope</key>
|
|
||||||
- <string>invalid.deprecated</string>
|
|
||||||
+ <string>invalid.deprecated, markup.warning</string>
|
|
||||||
<key>settings</key>
|
|
||||||
<dict>
|
|
||||||
<key>background</key>
|
|
@ -1,15 +0,0 @@
|
|||||||
diff --git syntaxes/01_Packages/Python/Python.sublime-syntax syntaxes/01_Packages/Python/Python.sublime-syntax
|
|
||||||
index 2acd86d8..86257f7b 100644
|
|
||||||
--- syntaxes/01_Packages/Python/Python.sublime-syntax
|
|
||||||
+++ syntaxes/01_Packages/Python/Python.sublime-syntax
|
|
||||||
@@ -988,10 +988,6 @@ contexts:
|
|
||||||
- match: \}
|
|
||||||
scope: punctuation.section.mapping-or-set.end.python
|
|
||||||
set: after-expression
|
|
||||||
- - match: (?={{simple_expression}}:|\s*\*\*)
|
|
||||||
- set: inside-dictionary
|
|
||||||
- - match: (?={{simple_expression}}[,}]|\s*\*)
|
|
||||||
- set: inside-set
|
|
||||||
- match: ','
|
|
||||||
scope: punctuation.separator.set.python
|
|
||||||
set: inside-set
|
|
@ -1,13 +0,0 @@
|
|||||||
diff --git syntaxes/01_Packages/Rust/Rust.sublime-syntax syntaxes/01_Packages/Rust/Rust.sublime-syntax
|
|
||||||
index 3c354486..24727a4e 100644
|
|
||||||
--- syntaxes/01_Packages/Rust/Rust.sublime-syntax
|
|
||||||
+++ syntaxes/01_Packages/Rust/Rust.sublime-syntax
|
|
||||||
@@ -907,6 +907,8 @@ contexts:
|
|
||||||
- include: type-any-identifier
|
|
||||||
- match: ':'
|
|
||||||
scope: punctuation.separator.rust
|
|
||||||
+ - match: (?=;)
|
|
||||||
+ pop: true
|
|
||||||
|
|
||||||
fn-body:
|
|
||||||
- meta_scope: meta.function.rust
|
|
@ -1,20 +0,0 @@
|
|||||||
diff --git syntaxes/01_Packages/ShellScript/Bash.sublime-syntax syntaxes/01_Packages/ShellScript/Bash.sublime-syntax
|
|
||||||
index e973e319..07c170a7 100644
|
|
||||||
--- syntaxes/01_Packages/ShellScript/Bash.sublime-syntax
|
|
||||||
+++ syntaxes/01_Packages/ShellScript/Bash.sublime-syntax
|
|
||||||
@@ -30,12 +30,12 @@ file_extensions:
|
|
||||||
- .zshenv
|
|
||||||
- .zshrc
|
|
||||||
- PKGBUILD # https://jlk.fjfi.cvut.cz/arch/manpages/man/PKGBUILD.5
|
|
||||||
- - .ebuild
|
|
||||||
- - .eclass
|
|
||||||
+ - ebuild
|
|
||||||
+ - eclass
|
|
||||||
|
|
||||||
first_line_match: |
|
|
||||||
(?x)
|
|
||||||
- ^\#! .* \b(bash|zsh|sh|tcsh|ash)\b
|
|
||||||
+ ^\#! .* \b(bash|zsh|sh|tcsh|ash|dash)\b
|
|
||||||
| ^\# \s* -\*- [^*]* mode: \s* shell-script [^*]* -\*-
|
|
||||||
|
|
||||||
#-------------------------------------------------------------------------------
|
|
@ -1,13 +0,0 @@
|
|||||||
diff --git syntaxes/02_Extra/TodoTxt/TodoTxt.sublime-syntax syntaxes/02_Extra/TodoTxt/TodoTxt.sublime-syntax
|
|
||||||
index 6c75dbb..0115978 100644
|
|
||||||
--- syntaxes/02_Extra/TodoTxt/TodoTxt.sublime-syntax
|
|
||||||
+++ syntaxes/02_Extra/TodoTxt/TodoTxt.sublime-syntax
|
|
||||||
@@ -68,7 +68,7 @@ contexts:
|
|
||||||
|
|
||||||
- match: (\s+[^\s:]+:[^\s:]+)+\s*$
|
|
||||||
comment: Custom attributes
|
|
||||||
- scope: variable.annotation.todotxt.attribute
|
|
||||||
+ scope: variable.other.todotxt.attribute
|
|
||||||
|
|
||||||
comments:
|
|
||||||
# Comments begin with a '//' and finish at the end of the line.
|
|
@ -1,20 +0,0 @@
|
|||||||
diff --git themes/TwoDark/TwoDark.tmTheme themes/TwoDark/TwoDark.tmTheme
|
|
||||||
index 87fd358..56376d3 100644
|
|
||||||
--- themes/TwoDark/TwoDark.tmTheme
|
|
||||||
+++ themes/TwoDark/TwoDark.tmTheme
|
|
||||||
@@ -533,7 +533,7 @@
|
|
||||||
<key>name</key>
|
|
||||||
<string>Json key</string>
|
|
||||||
<key>scope</key>
|
|
||||||
- <string>source.json meta.structure.dictionary.json string.quoted.double.json</string>
|
|
||||||
+ <string>source.json meta.mapping.key.json string.quoted.double.json</string>
|
|
||||||
<key>settings</key>
|
|
||||||
<dict>
|
|
||||||
<key>foreground</key>
|
|
||||||
@@ -875,4 +875,4 @@
|
|
||||||
<key>comment</key>
|
|
||||||
<string>Work in progress</string>
|
|
||||||
</dict>
|
|
||||||
-</plist>
|
|
||||||
\ No newline at end of file
|
|
||||||
+</plist>
|
|
@ -1,12 +0,0 @@
|
|||||||
diff --git syntaxes/01_Packages/XML/XML.sublime-syntax syntaxes/01_Packages/XML/XML.sublime-syntax
|
|
||||||
index ad7d9c87..af4a00f0 100644
|
|
||||||
--- syntaxes/01_Packages/XML/XML.sublime-syntax
|
|
||||||
+++ syntaxes/01_Packages/XML/XML.sublime-syntax
|
|
||||||
@@ -12,6 +12,7 @@ file_extensions:
|
|
||||||
- rss
|
|
||||||
- opml
|
|
||||||
- svg
|
|
||||||
+ - xaml
|
|
||||||
first_line_match: |-
|
|
||||||
(?x:
|
|
||||||
^(?:
|
|
Binary file not shown.
@ -1 +0,0 @@
|
|||||||
Subproject commit 759d6eed9b4beed87e602a23303a121c3a6c2fb3
|
|
@ -1 +0,0 @@
|
|||||||
Subproject commit e23926eca1b6a0bd0b572b7191aead9f77c748d1
|
|
@ -1 +0,0 @@
|
|||||||
Subproject commit e2b8fd51756e0cc42172c1c3405832ce9c19b6b6
|
|
@ -1 +0,0 @@
|
|||||||
Subproject commit 163bc03ae8998a237dfb4be353d0aea198ea17f5
|
|
@ -1,221 +0,0 @@
|
|||||||
%YAML 1.2
|
|
||||||
---
|
|
||||||
# http://www.sublimetext.com/docs/3/syntax.html
|
|
||||||
name: Apache Conf
|
|
||||||
file_extensions:
|
|
||||||
- envvars
|
|
||||||
- htaccess
|
|
||||||
- HTACCESS
|
|
||||||
- htgroups
|
|
||||||
- HTGROUPS
|
|
||||||
- htpasswd
|
|
||||||
- HTPASSWD
|
|
||||||
- .htaccess
|
|
||||||
- .HTACCESS
|
|
||||||
- .htgroups
|
|
||||||
- .HTGROUPS
|
|
||||||
- .htpasswd
|
|
||||||
- .HTPASSWD
|
|
||||||
scope: source.apacheconf
|
|
||||||
contexts:
|
|
||||||
main:
|
|
||||||
- match: ^(\s)*(#).*$\n?
|
|
||||||
scope: comment.line.hash.ini
|
|
||||||
captures:
|
|
||||||
1: punctuation.definition.comment.apacheconf
|
|
||||||
- match: (<)(Proxy|ProxyMatch|IfVersion|Directory|DirectoryMatch|Files|FilesMatch|IfDefine|IfModule|Limit|LimitExcept|Location|LocationMatch|VirtualHost|Macro|If|Else|ElseIf)(\s(.+?))?(>)
|
|
||||||
captures:
|
|
||||||
1: punctuation.definition.tag.apacheconf
|
|
||||||
2: entity.tag.apacheconf
|
|
||||||
4: string.value.apacheconf
|
|
||||||
5: punctuation.definition.tag.apacheconf
|
|
||||||
- match: (</)(Proxy|ProxyMatch|IfVersion|Directory|DirectoryMatch|Files|FilesMatch|IfDefine|IfModule|Limit|LimitExcept|Location|LocationMatch|VirtualHost|Macro|If|Else|ElseIf)(>)
|
|
||||||
captures:
|
|
||||||
1: punctuation.definition.tag.apacheconf
|
|
||||||
2: entity.tag.apacheconf
|
|
||||||
3: punctuation.definition.tag.apacheconf
|
|
||||||
- match: (?<=(Rewrite(Rule|Cond)))\s+(.+?)\s+(.+?)($|\s)
|
|
||||||
captures:
|
|
||||||
3: string.regexp.apacheconf
|
|
||||||
4: string.replacement.apacheconf
|
|
||||||
- match: (?<=RedirectMatch)(\s+(\d\d\d|permanent|temp|seeother|gone))?\s+(.+?)\s+((.+?)($|\s))?
|
|
||||||
captures:
|
|
||||||
2: entity.status.apacheconf
|
|
||||||
3: string.regexp.apacheconf
|
|
||||||
5: string.path.apacheconf
|
|
||||||
- match: (?<=Redirect)(\s+(\d\d\d|permanent|temp|seeother|gone))?\s+(.+?)\s+((.+?)($|\s))?
|
|
||||||
captures:
|
|
||||||
2: entity.status.apacheconf
|
|
||||||
3: string.path.apacheconf
|
|
||||||
5: string.path.apacheconf
|
|
||||||
- match: (?<=ScriptAliasMatch|AliasMatch)\s+(.+?)\s+((.+?)\s)?
|
|
||||||
captures:
|
|
||||||
1: string.regexp.apacheconf
|
|
||||||
3: string.path.apacheconf
|
|
||||||
- match: (?<=RedirectPermanent|RedirectTemp|ScriptAlias|Alias)\s+(.+?)\s+((.+?)($|\s))?
|
|
||||||
captures:
|
|
||||||
1: string.path.apacheconf
|
|
||||||
3: string.path.apacheconf
|
|
||||||
- match: \b(AcceptPathInfo|AccessFileName|AddDefaultCharset|AddOutputFilterByType|AllowEncodedSlashes|AllowOverride|AuthName|AuthType|CGIMapExtension|ContentDigest|DefaultType|Define|DocumentRoot|EnableMMAP|EnableSendfile|ErrorDocument|ErrorLog|FileETag|ForceType|HostnameLookups|IdentityCheck|Include(Optional)?|KeepAlive|KeepAliveTimeout|LimitInternalRecursion|LimitRequestBody|LimitRequestFields|LimitRequestFieldSize|LimitRequestLine|LimitXMLRequestBody|LogLevel|MaxKeepAliveRequests|Mutex|NameVirtualHost|Options|Require|RLimitCPU|RLimitMEM|RLimitNPROC|Satisfy|ScriptInterpreterSource|ServerAdmin|ServerAlias|ServerName|ServerPath|ServerRoot|ServerSignature|ServerTokens|SetHandler|SetInputFilter|SetOutputFilter|Time(O|o)ut|TraceEnable|UseCanonicalName|Use|ErrorLogFormat|GlobalLog|PHPIniDir|SSLHonorCipherOrder|SSLCompression|SSLUseStapling|SSLStapling\w+|SSLCARevocationCheck|SSLSRPVerifierFile|SSLSessionTickets|RequestReadTimeout|ProxyHTML\w+|MaxRanges)\b
|
|
||||||
captures:
|
|
||||||
1: keyword.core.apacheconf
|
|
||||||
- match: \b(AcceptMutex|AssignUserID|BS2000Account|ChildPerUserID|CoreDumpDirectory|EnableExceptionHook|Group|Listen|ListenBacklog|LockFile|MaxClients|MaxConnectionsPerChild|MaxMemFree|MaxRequestsPerChild|MaxRequestsPerThread|MaxRequestWorkers|MaxSpareServers|MaxSpareThreads|MaxThreads|MaxThreadsPerChild|MinSpareServers|MinSpareThreads|NumServers|PidFile|ReceiveBufferSize|ScoreBoardFile|SendBufferSize|ServerLimit|StartServers|StartThreads|ThreadLimit|ThreadsPerChild|ThreadStackSize|User|Win32DisableAcceptEx)\b
|
|
||||||
captures:
|
|
||||||
1: keyword.mpm.apacheconf
|
|
||||||
- match: \b(Allow|Deny|Order)\b
|
|
||||||
captures:
|
|
||||||
1: keyword.access.apacheconf
|
|
||||||
- match: \b(Action|Script)\b
|
|
||||||
captures:
|
|
||||||
1: keyword.actions.apacheconf
|
|
||||||
- match: \b(Alias|AliasMatch|Redirect|RedirectMatch|RedirectPermanent|RedirectTemp|ScriptAlias|ScriptAliasMatch)\b
|
|
||||||
captures:
|
|
||||||
1: keyword.alias.apacheconf
|
|
||||||
- match: \b(AuthAuthoritative|AuthGroupFile|AuthUserFile|AuthBasicProvider|AuthBasicFake|AuthBasicAuthoritative|AuthBasicUseDigestAlgorithm)\b
|
|
||||||
captures:
|
|
||||||
1: keyword.auth.apacheconf
|
|
||||||
- match: \b(Anonymous|Anonymous_Authoritative|Anonymous_LogEmail|Anonymous_MustGiveEmail|Anonymous_NoUserID|Anonymous_VerifyEmail)\b
|
|
||||||
captures:
|
|
||||||
1: keyword.auth_anon.apacheconf
|
|
||||||
- match: \b(AuthDBMAuthoritative|AuthDBMGroupFile|AuthDBMType|AuthDBMUserFile)\b
|
|
||||||
captures:
|
|
||||||
1: keyword.auth_dbm.apacheconf
|
|
||||||
- match: \b(AuthDigestAlgorithm|AuthDigestDomain|AuthDigestFile|AuthDigestGroupFile|AuthDigestNcCheck|AuthDigestNonceFormat|AuthDigestNonceLifetime|AuthDigestQop|AuthDigestShmemSize|AuthDigestProvider)\b
|
|
||||||
captures:
|
|
||||||
1: keyword.auth_digest.apacheconf
|
|
||||||
- match: \b(AuthLDAPAuthoritative|AuthLDAPBindDN|AuthLDAPBindPassword|AuthLDAPCharsetConfig|AuthLDAPCompareDNOnServer|AuthLDAPDereferenceAliases|AuthLDAPEnabled|AuthLDAPFrontPageHack|AuthLDAPGroupAttribute|AuthLDAPGroupAttributeIsDN|AuthLDAPRemoteUserIsDN|AuthLDAPUrl)\b
|
|
||||||
captures:
|
|
||||||
1: keyword.auth_ldap.apacheconf
|
|
||||||
- match: \b(AddAlt|AddAltByEncoding|AddAltByType|AddDescription|AddIcon|AddIconByEncoding|AddIconByType|DefaultIcon|HeaderName|IndexIgnore|IndexOptions|IndexOrderDefault|IndexStyleSheet|IndexHeadInsert|ReadmeName)\b
|
|
||||||
captures:
|
|
||||||
1: keyword.autoindex.apacheconf
|
|
||||||
- match: \b(BalancerMember|BalancerGrowth|BalancerPersist|BalancerInherit)\b
|
|
||||||
captures:
|
|
||||||
1: keyword.filter.apacheconf
|
|
||||||
- match: \b(CacheDefaultExpire|CacheDisable|CacheEnable|CacheForceCompletion|CacheIgnoreCacheControl|CacheIgnoreHeaders|CacheIgnoreNoLastMod|CacheLastModifiedFactor|CacheMaxExpire)\b
|
|
||||||
captures:
|
|
||||||
1: keyword.cache.apacheconf
|
|
||||||
- match: \b(MetaDir|MetaFiles|MetaSuffix)\b
|
|
||||||
captures:
|
|
||||||
1: keyword.cern_meta.apacheconf
|
|
||||||
- match: \b(ScriptLog|ScriptLogBuffer|ScriptLogLength)\b
|
|
||||||
captures:
|
|
||||||
1: keyword.cgi.apacheconf
|
|
||||||
- match: \b(ScriptLog|ScriptLogBuffer|ScriptLogLength|ScriptSock)\b
|
|
||||||
captures:
|
|
||||||
1: keyword.cgid.apacheconf
|
|
||||||
- match: \b(CharsetDefault|CharsetOptions|CharsetSourceEnc)\b
|
|
||||||
captures:
|
|
||||||
1: keyword.charset_lite.apacheconf
|
|
||||||
- match: \b(Dav|DavDepthInfinity|DavMinTimeout|DavLockDB)\b
|
|
||||||
captures:
|
|
||||||
1: keyword.dav.apacheconf
|
|
||||||
- match: \b(DeflateBufferSize|DeflateCompressionLevel|DeflateFilterNote|DeflateMemLevel|DeflateWindowSize)\b
|
|
||||||
captures:
|
|
||||||
1: keyword.deflate.apacheconf
|
|
||||||
- match: \b(DirectoryIndex|DirectorySlash|FallbackResource)\b
|
|
||||||
captures:
|
|
||||||
1: keyword.dir.apacheconf
|
|
||||||
- match: \b(CacheDirLength|CacheDirLevels|CacheExpiryCheck|CacheGcClean|CacheGcDaily|CacheGcInterval|CacheGcMemUsage|CacheGcUnused|CacheMaxFileSize|CacheMinFileSize|CacheRoot|CacheSize|CacheTimeMargin)\b
|
|
||||||
captures:
|
|
||||||
1: keyword.disk_cache.apacheconf
|
|
||||||
- match: \b(DumpIOInput|DumpIOOutput)\b
|
|
||||||
captures:
|
|
||||||
1: keyword.dumpio.apacheconf
|
|
||||||
- match: \b(PassEnv|SetEnv|UnsetEnv)\b
|
|
||||||
captures:
|
|
||||||
1: keyword.env.apacheconf
|
|
||||||
- match: \b(ExpiresActive|ExpiresByType|ExpiresDefault)\b
|
|
||||||
captures:
|
|
||||||
1: keyword.expires.apacheconf
|
|
||||||
- match: \b(ExtFilterDefine|ExtFilterOptions)\b
|
|
||||||
captures:
|
|
||||||
1: keyword.ext_filter.apacheconf
|
|
||||||
- match: \b(CacheFile|MMapFile)\b
|
|
||||||
captures:
|
|
||||||
1: keyword.file_cache.apacheconf
|
|
||||||
- match: \b(AddOutputFilterByType|FilterChain|FilterDeclare|FilterProtocol|FilterProvider|FilterTrace)\b
|
|
||||||
captures:
|
|
||||||
1: keyword.filter.apacheconf
|
|
||||||
- match: \b(Header|RequestHeader)\b
|
|
||||||
captures:
|
|
||||||
1: keyword.headers.apacheconf
|
|
||||||
- match: \b(ImapBase|ImapDefault|ImapMenu)\b
|
|
||||||
captures:
|
|
||||||
1: keyword.imap.apacheconf
|
|
||||||
- match: \b(SSIEndTag|SSIErrorMsg|SSIStartTag|SSITimeFormat|SSIUndefinedEcho|XBitHack)\b
|
|
||||||
captures:
|
|
||||||
1: keyword.include.apacheconf
|
|
||||||
- match: \b(ISAPIAppendLogToErrors|ISAPIAppendLogToQuery|ISAPICacheFile|ISAPIFakeAsync|ISAPILogNotSupported|ISAPIReadAheadBuffer)\b
|
|
||||||
captures:
|
|
||||||
1: keyword.isapi.apacheconf
|
|
||||||
- match: \b(LDAPCacheEntries|LDAPCacheTTL|LDAPConnectionTimeout|LDAPOpCacheEntries|LDAPOpCacheTTL|LDAPSharedCacheFile|LDAPSharedCacheSize|LDAPTrustedCA|LDAPTrustedCAType)\b
|
|
||||||
captures:
|
|
||||||
1: keyword.ldap.apacheconf
|
|
||||||
- match: \b(BufferedLogs|CookieLog|CustomLog|LogFormat|TransferLog|ForensicLog)\b
|
|
||||||
captures:
|
|
||||||
1: keyword.log.apacheconf
|
|
||||||
- match: \b(MCacheMaxObjectCount|MCacheMaxObjectSize|MCacheMaxStreamingBuffer|MCacheMinObjectSize|MCacheRemovalAlgorithm|MCacheSize)\b
|
|
||||||
captures:
|
|
||||||
1: keyword.mem_cache.apacheconf
|
|
||||||
- match: \b(AddCharset|AddEncoding|AddHandler|AddInputFilter|AddLanguage|AddOutputFilter|AddType|DefaultLanguage|ModMimeUsePathInfo|MultiviewsMatch|RemoveCharset|RemoveEncoding|RemoveHandler|RemoveInputFilter|RemoveLanguage|RemoveOutputFilter|RemoveType|TypesConfig)\b
|
|
||||||
captures:
|
|
||||||
1: keyword.mime.apacheconf
|
|
||||||
- match: \b(ProtocolEcho|Example|AddModuleInfo|MimeMagicFile|CheckSpelling|ExtendedStatus|SuexecUserGroup|UserDir)\b
|
|
||||||
captures:
|
|
||||||
1: keyword.misc.apacheconf
|
|
||||||
- match: \b(CacheNegotiatedDocs|ForceLanguagePriority|LanguagePriority)\b
|
|
||||||
captures:
|
|
||||||
1: keyword.negotiation.apacheconf
|
|
||||||
- match: \b(NWSSLTrustedCerts|NWSSLUpgradeable|SecureListen)\b
|
|
||||||
captures:
|
|
||||||
1: keyword.nw_ssl.apacheconf
|
|
||||||
- match: \b(AllowCONNECT|NoProxy|ProxyBadHeader|ProxyBlock|ProxyDomain|ProxyErrorOverride|ProxyFtpDirCharset|ProxyIOBufferSize|ProxyMaxForwards|ProxyPass|ProxyPassMatch|ProxyPassReverse|ProxyPreserveHost|ProxyReceiveBufferSize|ProxyRemote|ProxyRemoteMatch|ProxyRequests|ProxyTimeout|ProxyVia)\b
|
|
||||||
captures:
|
|
||||||
1: keyword.proxy.apacheconf
|
|
||||||
- match: \b(RewriteBase|RewriteCond|RewriteEngine|RewriteLock|RewriteLog|RewriteLogLevel|RewriteMap|RewriteOptions|RewriteRule)\b
|
|
||||||
captures:
|
|
||||||
1: keyword.rewrite.apacheconf
|
|
||||||
- match: \b(BrowserMatch|BrowserMatchNoCase|SetEnvIf|SetEnvIfNoCase)\b
|
|
||||||
captures:
|
|
||||||
1: keyword.setenvif.apacheconf
|
|
||||||
- match: \b(LoadFile|LoadModule)\b
|
|
||||||
captures:
|
|
||||||
1: keyword.so.apacheconf
|
|
||||||
- match: \b(SSLCACertificateFile|SSLCACertificatePath|SSLCARevocationFile|SSLCARevocationPath|SSLCertificateChainFile|SSLCertificateFile|SSLCertificateKeyFile|SSLCipherSuite|SSLEngine|SSLMutex|SSLOptions|SSLPassPhraseDialog|SSLProtocol|SSLProxyCACertificateFile|SSLProxyCACertificatePath|SSLProxyCARevocationFile|SSLProxyCARevocationPath|SSLProxyCipherSuite|SSLProxyEngine|SSLProxyMachineCertificateFile|SSLProxyMachineCertificatePath|SSLProxyProtocol|SSLProxyVerify|SSLProxyVerifyDepth|SSLRandomSeed|SSLRequire|SSLRequireSSL|SSLSessionCache|SSLSessionCacheTimeout|SSLUserName|SSLVerifyClient|SSLVerifyDepth|SSLInsecureRenegotiation|SSLOpenSSLConfCmd)\b
|
|
||||||
captures:
|
|
||||||
1: keyword.ssl.apacheconf
|
|
||||||
- match: \b(Substitute|SubstituteInheritBefore|SubstituteMaxLineLength)\b
|
|
||||||
captures:
|
|
||||||
1: keyword.substitute.apacheconf
|
|
||||||
- match: \b(CookieDomain|CookieExpires|CookieName|CookieStyle|CookieTracking)\b
|
|
||||||
captures:
|
|
||||||
1: keyword.usertrack.apacheconf
|
|
||||||
- match: \b(VirtualDocumentRoot|VirtualDocumentRootIP|VirtualScriptAlias|VirtualScriptAliasIP)\b
|
|
||||||
captures:
|
|
||||||
1: keyword.vhost_alias.apacheconf
|
|
||||||
- match: \b(php_value|php_flag|php_admin_value|php_admin_flag)\b(\s+(.+?)(\s+(".+?"|.+?))?)?\s
|
|
||||||
captures:
|
|
||||||
1: keyword.php.apacheconf
|
|
||||||
3: entity.property.apacheconf
|
|
||||||
5: string.value.apacheconf
|
|
||||||
- match: '(%\{)((HTTP_USER_AGENT|HTTP_REFERER|HTTP_COOKIE|HTTP_FORWARDED|HTTP_HOST|HTTP_PROXY_CONNECTION|HTTP_ACCEPT|REMOTE_ADDR|REMOTE_HOST|REMOTE_PORT|REMOTE_USER|REMOTE_IDENT|REQUEST_METHOD|SCRIPT_FILENAME|PATH_INFO|QUERY_STRING|AUTH_TYPE|DOCUMENT_ROOT|SERVER_ADMIN|SERVER_NAME|SERVER_ADDR|SERVER_PORT|SERVER_PROTOCOL|SERVER_SOFTWARE|TIME_YEAR|TIME_MON|TIME_DAY|TIME_HOUR|TIME_MIN|TIME_SEC|TIME_WDAY|TIME|API_VERSION|THE_REQUEST|REQUEST_URI|REQUEST_FILENAME|IS_SUBREQ|HTTPS)|(.*?))(\})'
|
|
||||||
captures:
|
|
||||||
1: punctuation.variable.apacheconf
|
|
||||||
3: variable.env.apacheconf
|
|
||||||
4: variable.misc.apacheconf
|
|
||||||
5: punctuation.variable.apacheconf
|
|
||||||
- match: \b((text|image|application|video|audio)/.+?)\s
|
|
||||||
captures:
|
|
||||||
1: entity.mime-type.apacheconf
|
|
||||||
- match: \b(?i)(export|from|unset|set|on|off)\b
|
|
||||||
captures:
|
|
||||||
1: entity.helper.apacheconf
|
|
||||||
- match: \b(\d+)\b
|
|
||||||
captures:
|
|
||||||
1: constant.numeric.integer.decimal.apacheconf
|
|
||||||
- match: '\s(\[)(.*?)(\])\s'
|
|
||||||
captures:
|
|
||||||
1: punctuation.definition.flag.apacheconf
|
|
||||||
2: string.flag.apacheconf
|
|
||||||
3: punctuation.definition.flag.apacheconf
|
|
@ -1 +0,0 @@
|
|||||||
Subproject commit e316a0a85c67c3edb73a46fc3a3ec4a9dfbbba40
|
|
@ -1,997 +0,0 @@
|
|||||||
%YAML 1.2
|
|
||||||
---
|
|
||||||
# http://www.sublimetext.com/docs/3/syntax.html
|
|
||||||
name: AsciiDoc (Asciidoctor)
|
|
||||||
file_extensions:
|
|
||||||
- adoc
|
|
||||||
- ad
|
|
||||||
- asciidoc
|
|
||||||
scope: text.asciidoc
|
|
||||||
contexts:
|
|
||||||
main:
|
|
||||||
- include: lists
|
|
||||||
- include: blocks
|
|
||||||
- include: section_titles
|
|
||||||
- include: lines
|
|
||||||
- include: inline
|
|
||||||
- include: characters
|
|
||||||
attribute_entry:
|
|
||||||
- match: |-
|
|
||||||
(?x)
|
|
||||||
^(:) # opening delimiter
|
|
||||||
(!)? # bang symbol (unset attribute)
|
|
||||||
([A-Za-z0-9_][A-Za-z0-9_-]*) # attribute name
|
|
||||||
(!)? # bang symbol (unset attribute)
|
|
||||||
(:) # closing delimiter
|
|
||||||
(?:\s+|(?=$))
|
|
||||||
comment: |
|
|
||||||
An attribute entry.
|
|
||||||
|
|
||||||
Examples:
|
|
||||||
:my-attribute: value
|
|
||||||
:sectnums!:
|
|
||||||
:!sectnums:
|
|
||||||
captures:
|
|
||||||
1: punctuation.definition.attributeentry.attrname.begin.asciidoc
|
|
||||||
2: punctuation.definition.attributeentry.unset.asciidoc
|
|
||||||
3: support.variable.attribute.asciidoc
|
|
||||||
4: punctuation.definition.attributeentry.unset.asciidoc
|
|
||||||
5: punctuation.definition.attributeentry.attrname.end.asciidoc
|
|
||||||
push:
|
|
||||||
- meta_scope: meta.attributeentry.asciidoc
|
|
||||||
- meta_content_scope: meta.attributeentry.value.asciidoc
|
|
||||||
- match: $\n?
|
|
||||||
pop: true
|
|
||||||
- include: characters
|
|
||||||
attribute_list_line:
|
|
||||||
- match: '^(\[)[^\[\]]*(\])\s*$\n?'
|
|
||||||
comment: "Attribute list as paragraph: single brackets. No need for special treatment of escape; follows literal block, section template as being a more general regex."
|
|
||||||
scope: support.variable.attributelist.asciidoc
|
|
||||||
captures:
|
|
||||||
1: punctuation.definition.attributelistline.begin.asciidoc
|
|
||||||
2: punctuation.definition.attributelistline.end.asciidoc
|
|
||||||
attribute_reference:
|
|
||||||
- match: "({)([A-Za-z0-9_][A-Za-z0-9_-]*)(})"
|
|
||||||
comment: |
|
|
||||||
Examples:
|
|
||||||
{my-attribute}
|
|
||||||
scope: variable.other
|
|
||||||
captures:
|
|
||||||
1: constant.character.attributes.reference.begin.asciidoc
|
|
||||||
2: support.variable.attribute.asciidoc
|
|
||||||
3: constant.character.attributes.reference.end.asciidoc
|
|
||||||
biblio_anchor:
|
|
||||||
- match: '(?<!\[)(\[\[\[).*?(\]\]\])(?!\])'
|
|
||||||
comment: |
|
|
||||||
Bibliography anchor
|
|
||||||
|
|
||||||
Examples:
|
|
||||||
[[[Lorem ipsum]]]
|
|
||||||
scope: storage.type.reference.biblioanchor.asciidoc
|
|
||||||
captures:
|
|
||||||
1: punctuation.definition.biblioanchor.begin.asciidoc
|
|
||||||
2: punctuation.definition.biblioanchor.end.asciidoc
|
|
||||||
block_admonition_label:
|
|
||||||
- match: ^(NOTE|TIP|IMPORTANT|WARNING|CAUTION):(?=\s+)
|
|
||||||
comment: |
|
|
||||||
Label of an admonition block.
|
|
||||||
|
|
||||||
Examples:
|
|
||||||
NOTE: This is a admonition block.
|
|
||||||
WARNING: Be aware of them!
|
|
||||||
scope: support.constant.admonitionword.asciidoc
|
|
||||||
block_comment:
|
|
||||||
- match: '^(/{4,})\s*$\n?'
|
|
||||||
comment: |
|
|
||||||
Examples:
|
|
||||||
////
|
|
||||||
A multi-line comment.
|
|
||||||
Notice it's a delimited block.
|
|
||||||
////
|
|
||||||
captures:
|
|
||||||
0: punctuation.definition.comment.begin.asciidoc
|
|
||||||
push:
|
|
||||||
- meta_scope: comment.block.asciidoc
|
|
||||||
- meta_content_scope: meta.block.comment.content.asciidoc
|
|
||||||
- match: ^\1\s*$\n?
|
|
||||||
captures:
|
|
||||||
0: punctuation.definition.comment.end.asciidoc
|
|
||||||
pop: true
|
|
||||||
- include: macro
|
|
||||||
block_example:
|
|
||||||
- match: '^(={4,})\s*$\n?'
|
|
||||||
comment: |
|
|
||||||
Examples:
|
|
||||||
====
|
|
||||||
Lorem ipsum.
|
|
||||||
====
|
|
||||||
|
|
||||||
Note: Might need to add more includes, but these are the ones that arise in
|
|
||||||
practice for me.
|
|
||||||
captures:
|
|
||||||
0: constant.delimiter.example.begin.asciidoc
|
|
||||||
push:
|
|
||||||
- meta_scope: string.unquoted.block.example.asciidoc
|
|
||||||
- meta_content_scope: meta.block.example.content.asciidoc
|
|
||||||
- match: ^\1\s*$\n?
|
|
||||||
captures:
|
|
||||||
0: constant.delimiter.example.end.asciidoc
|
|
||||||
pop: true
|
|
||||||
- include: lists
|
|
||||||
- include: block_listing
|
|
||||||
- include: lines
|
|
||||||
- include: inline
|
|
||||||
- include: characters
|
|
||||||
block_id:
|
|
||||||
- match: '^(\[\[)([^\[].*)(\]\])\s*$\n?'
|
|
||||||
comment: |
|
|
||||||
A block id (i.e. anchor).
|
|
||||||
|
|
||||||
Examples:
|
|
||||||
[[myid]]
|
|
||||||
Lorem ipsum dolor.
|
|
||||||
scope: meta.tag.blockid.asciidoc
|
|
||||||
captures:
|
|
||||||
1: punctuation.definition.blockid.begin.asciidoc
|
|
||||||
2: markup.underline.blockid.id.asciidoc
|
|
||||||
3: punctuation.definition.blockid.end.asciidoc
|
|
||||||
block_listing:
|
|
||||||
- match: '^(\-{4,})\s*$\n?'
|
|
||||||
comment: |
|
|
||||||
Examples:
|
|
||||||
----
|
|
||||||
Lorem ipsum.
|
|
||||||
----
|
|
||||||
captures:
|
|
||||||
0: constant.delimiter.listing.begin.asciidoc
|
|
||||||
push:
|
|
||||||
- meta_scope: meta.embedded.block.listing.asciidoc
|
|
||||||
- meta_content_scope: source.block.listing.content.asciidoc
|
|
||||||
- match: ^\1\s*$\n?
|
|
||||||
captures:
|
|
||||||
0: constant.delimiter.listing.end.asciidoc
|
|
||||||
pop: true
|
|
||||||
- include: inline_callout
|
|
||||||
block_literal:
|
|
||||||
- match: '^(\.{4,})\s*$\n?'
|
|
||||||
comment: |
|
|
||||||
Examples:
|
|
||||||
....
|
|
||||||
Lorem ipsum.
|
|
||||||
....
|
|
||||||
captures:
|
|
||||||
0: constant.delimiter.block.literal.begin.asciidoc
|
|
||||||
push:
|
|
||||||
- meta_scope: string.literal.block.delimited.asciidoc
|
|
||||||
- meta_content_scope: meta.block.literal.content.asciidoc
|
|
||||||
- match: ^\1\s*$\n?
|
|
||||||
captures:
|
|
||||||
0: constant.delimiter.block.literal.end.asciidoc
|
|
||||||
pop: true
|
|
||||||
- include: inline_callout
|
|
||||||
block_open:
|
|
||||||
- match: ^\-\-\s*$\n?
|
|
||||||
comment: |
|
|
||||||
Examples:
|
|
||||||
--
|
|
||||||
Lorem ipsum
|
|
||||||
--
|
|
||||||
Note: Might need to check on these includes.
|
|
||||||
captures:
|
|
||||||
0: constant.delimiter.block.open.begin.asciidoc
|
|
||||||
push:
|
|
||||||
- meta_scope: meta.block.open.asciidoc
|
|
||||||
- meta_content_scope: meta.block.open.content.asciidoc
|
|
||||||
- match: ^\-\-\s*$\n?
|
|
||||||
captures:
|
|
||||||
0: constant.delimiter.block.open.end.asciidoc
|
|
||||||
pop: true
|
|
||||||
- include: lists
|
|
||||||
- include: block_comment
|
|
||||||
- include: block_listing
|
|
||||||
- include: block_pass
|
|
||||||
- include: lines
|
|
||||||
- include: inline
|
|
||||||
- include: characters
|
|
||||||
block_page_break:
|
|
||||||
- match: '^<{3,}$\n?'
|
|
||||||
comment: |
|
|
||||||
A page break.
|
|
||||||
|
|
||||||
Examples:
|
|
||||||
<<<
|
|
||||||
<<<<<
|
|
||||||
scope: meta.separator.pagebreak.asciidoc
|
|
||||||
block_pass:
|
|
||||||
- match: '^(\+{4,})\s*$\n?'
|
|
||||||
captures:
|
|
||||||
0: constant.delimiter.block.passthrough.begin.asciidoc
|
|
||||||
push:
|
|
||||||
- meta_scope: meta.embedded.block.passthrough.asciidoc
|
|
||||||
- meta_content_scope: text.xml.block.passthrough.content.asciidoc
|
|
||||||
- match: ^\1\s*$\n?
|
|
||||||
captures:
|
|
||||||
0: constant.delimiter.block.passthrough.end.asciidoc
|
|
||||||
pop: true
|
|
||||||
- include: scope:text.xml
|
|
||||||
block_quote:
|
|
||||||
- match: '^(_{4,})\s*$\n?'
|
|
||||||
comment: |
|
|
||||||
Examples:
|
|
||||||
____
|
|
||||||
Lorem ipsum
|
|
||||||
____
|
|
||||||
|
|
||||||
Note: Might need to add more includes, but these are the ones that arise for me in practice.
|
|
||||||
captures:
|
|
||||||
0: constant.delimiter.block.quote.begin.asciidoc
|
|
||||||
push:
|
|
||||||
- meta_scope: markup.quote.block.asciidoc
|
|
||||||
- meta_content_scope: meta.block.quote.content.asciidoc
|
|
||||||
- match: ^\1\s*$\n?
|
|
||||||
captures:
|
|
||||||
0: constant.delimiter.block.quote.end.asciidoc
|
|
||||||
pop: true
|
|
||||||
- include: lines
|
|
||||||
- include: inline
|
|
||||||
- include: characters
|
|
||||||
block_sidebar:
|
|
||||||
- match: '^(\*{4,})\s*$\n?'
|
|
||||||
comment: |
|
|
||||||
Examples:
|
|
||||||
****
|
|
||||||
Lorem ipsum
|
|
||||||
****
|
|
||||||
|
|
||||||
Note: Might need to add more includes, but these are the ones that arise
|
|
||||||
for me in practice.
|
|
||||||
captures:
|
|
||||||
0: constant.delimiter.block.sidebar.begin.asciidoc
|
|
||||||
push:
|
|
||||||
- meta_scope: string.quoted.block.sidebar.asciidoc
|
|
||||||
- meta_content_scope: meta.block.sidebar.content.asciidoc
|
|
||||||
- match: ^\1\s*$\n?
|
|
||||||
captures:
|
|
||||||
0: constant.delimiter.block.sidebar.end.asciidoc
|
|
||||||
pop: true
|
|
||||||
- include: lists
|
|
||||||
- include: block_comment
|
|
||||||
- include: block_listing
|
|
||||||
- include: lines
|
|
||||||
- include: inline
|
|
||||||
- include: characters
|
|
||||||
block_source_fenced:
|
|
||||||
- match: ^(```)(\w+)?\s*$\n?
|
|
||||||
comment: |
|
|
||||||
Fenced code block (ala Markdown)
|
|
||||||
|
|
||||||
Examples:
|
|
||||||
```rb
|
|
||||||
puts 'Hello world!'
|
|
||||||
```
|
|
||||||
captures:
|
|
||||||
0: constant.delimiter.listing.begin.asciidoc
|
|
||||||
push:
|
|
||||||
- meta_scope: meta.embedded.block.listing.asciidoc
|
|
||||||
- meta_content_scope: source.block.listing.content.asciidoc
|
|
||||||
- match: ^\1\s*$\n?
|
|
||||||
captures:
|
|
||||||
0: constant.delimiter.listing.end.asciidoc
|
|
||||||
pop: true
|
|
||||||
- include: inline_callout
|
|
||||||
block_thematic_break:
|
|
||||||
- match: '^''{3,}$\n?'
|
|
||||||
comment: |
|
|
||||||
A thematic break (aka horizontal rule).
|
|
||||||
|
|
||||||
Examples:
|
|
||||||
'''
|
|
||||||
''''''
|
|
||||||
scope: meta.separator.ruler.asciidoc
|
|
||||||
block_title:
|
|
||||||
- match: ^(\.)\w.*$\n?
|
|
||||||
comment: |
|
|
||||||
Title of a block.
|
|
||||||
|
|
||||||
Examples:
|
|
||||||
.My title
|
|
||||||
Lorem ipsum dolor.
|
|
||||||
scope: markup.heading.block.asciidoc
|
|
||||||
captures:
|
|
||||||
1: punctuation.definition.blockheading.asciidoc
|
|
||||||
blocks:
|
|
||||||
- include: block_literal
|
|
||||||
- include: block_comment
|
|
||||||
- include: block_listing
|
|
||||||
- include: block_source_fenced
|
|
||||||
- include: block_sidebar
|
|
||||||
- include: block_pass
|
|
||||||
- include: block_quote
|
|
||||||
- include: block_example
|
|
||||||
- include: block_open
|
|
||||||
characters:
|
|
||||||
- include: attribute_reference
|
|
||||||
- include: entity_number
|
|
||||||
- include: entity_name
|
|
||||||
- include: escape
|
|
||||||
- include: replacement
|
|
||||||
- include: macro_pass
|
|
||||||
- include: macro
|
|
||||||
- include: xref
|
|
||||||
- include: biblio_anchor
|
|
||||||
- include: indexterm_triple
|
|
||||||
- include: indexterm_double
|
|
||||||
colist_item_marker:
|
|
||||||
- match: ^(\s*((<)\d+?(>)))\s+(?=\S)
|
|
||||||
comment: |
|
|
||||||
Marker of a callout list item.
|
|
||||||
|
|
||||||
Examples:
|
|
||||||
<1> a callout
|
|
||||||
<42> another callout
|
|
||||||
scope: markup.list.numbered.callout.asciidoc
|
|
||||||
captures:
|
|
||||||
1: string.unquoted.list.callout.asciidoc
|
|
||||||
2: constant.numeric.callout.asciidoc
|
|
||||||
3: punctuation.definition.calloutlistnumber.begin.asciidoc
|
|
||||||
4: punctuation.definition.calloutlistnumber.end.asciidoc
|
|
||||||
dlist_item_label:
|
|
||||||
- match: '^\s*(?=.*:{2,4}(?:\s|$))'
|
|
||||||
comment: |
|
|
||||||
Label of a definition (labeled) list item.
|
|
||||||
|
|
||||||
Examples:
|
|
||||||
Label level 1:: lorem ipsum
|
|
||||||
Label level 2::: dolor sit amet
|
|
||||||
Label level 3:::: consectetur
|
|
||||||
Label level 1::
|
|
||||||
lorem ipsum
|
|
||||||
Another label :: lorem ipsum
|
|
||||||
Last::label:: dolor sit amet
|
|
||||||
|
|
||||||
Note: This rule is not strictly correct, because Asciidoctor allows
|
|
||||||
double colon followed by a space inside a label, i.e. it matches the
|
|
||||||
*last* double colon, not the first. I don't know how to do that
|
|
||||||
*effectively.
|
|
||||||
push:
|
|
||||||
- meta_scope: markup.list.labeled.asciidoc
|
|
||||||
- meta_content_scope: meta.list.label.asciidoc
|
|
||||||
- match: '(:{2,4})(?:\s|$\n?)'
|
|
||||||
captures:
|
|
||||||
1: constant.labeledlist.separator.asciidoc
|
|
||||||
pop: true
|
|
||||||
- include: inline
|
|
||||||
- include: characters
|
|
||||||
emphasis:
|
|
||||||
- match: |-
|
|
||||||
(?x)
|
|
||||||
(\[[^\]]*?\])? # might be preceded by an attributes list
|
|
||||||
(?<=^|\W)(?<!\\|}) # must be preceded by nonword character, and not by escape or } (attribute)
|
|
||||||
(_)(?=\S) # delimiter underscore that must be followed by a nonspace character
|
|
||||||
comment: |
|
|
||||||
Emphasized (italic) text (constrained variant).
|
|
||||||
|
|
||||||
Examples:
|
|
||||||
_Lorem ipsum_ dolor
|
|
||||||
[red]_Lorem ipsum_ dolor
|
|
||||||
captures:
|
|
||||||
1: support.variable.attributelist.asciidoc
|
|
||||||
2: punctuation.definition.italic.single.begin.asciidoc
|
|
||||||
push:
|
|
||||||
- meta_scope: markup.italic.single.asciidoc
|
|
||||||
- meta_content_scope: meta.italicinner.single.asciidoc
|
|
||||||
- match: |-
|
|
||||||
(?x)
|
|
||||||
(?<=\S)(_) # delimiter underscore that must be preceded by a nonspace character
|
|
||||||
(?!\w) # ...and followed by a nonword character
|
|
||||||
captures:
|
|
||||||
1: punctuation.definition.italic.single.end.asciidoc
|
|
||||||
pop: true
|
|
||||||
- include: strong_double
|
|
||||||
- include: monospaced_double
|
|
||||||
- include: mark_double
|
|
||||||
- include: strong
|
|
||||||
- include: monospaced
|
|
||||||
- include: mark
|
|
||||||
- include: superscript
|
|
||||||
- include: subscript
|
|
||||||
- include: characters
|
|
||||||
emphasis_double:
|
|
||||||
- match: |-
|
|
||||||
(?x)
|
|
||||||
(\[[^\]]*?\])? # might start with attribute list
|
|
||||||
(?<!\\) # must not be preceded by escape
|
|
||||||
(__)
|
|
||||||
comment: |
|
|
||||||
Emphasized (italic) text (unconstrained variant).
|
|
||||||
|
|
||||||
Examples:
|
|
||||||
Lo__re__m __ipsum dolor__.
|
|
||||||
Lo[red]__re__m
|
|
||||||
captures:
|
|
||||||
1: support.variable.attributelist.asciidoc
|
|
||||||
2: punctuation.definition.italic.double.begin.asciidoc
|
|
||||||
push:
|
|
||||||
- meta_scope: markup.italic.double.asciidoc
|
|
||||||
- meta_content_scope: meta.italicinner.double.asciidoc
|
|
||||||
- match: __
|
|
||||||
captures:
|
|
||||||
0: punctuation.definition.italic.double.end.asciidoc
|
|
||||||
pop: true
|
|
||||||
- include: strong_double
|
|
||||||
- include: monospaced_double
|
|
||||||
- include: mark_double
|
|
||||||
- include: strong
|
|
||||||
- include: monospaced
|
|
||||||
- include: mark
|
|
||||||
- include: superscript
|
|
||||||
- include: subscript
|
|
||||||
- include: characters
|
|
||||||
entity_name:
|
|
||||||
- match: '(?<!\\)&([a-zA-Z][a-zA-Z0-9]*);'
|
|
||||||
comment: |
|
|
||||||
Character entity reference
|
|
||||||
|
|
||||||
Examples:
|
|
||||||
|
|
||||||
²
|
|
||||||
scope: constant.character.entity.xml.asciidoc
|
|
||||||
entity_number:
|
|
||||||
- match: '(?<!\\)&#(x?[0-9a-fA-f]{2,4});'
|
|
||||||
comment: |
|
|
||||||
Numeric character reference
|
|
||||||
|
|
||||||
Examples:
|
|
||||||
➊
|
|
||||||
¶
|
|
||||||
scope: constant.character.entity.asciidoc
|
|
||||||
escape:
|
|
||||||
- match: '\\(?=[-`*_#+.!(){}\[\]\\>:])'
|
|
||||||
comment: |
|
|
||||||
List of special characters that may be escaped.
|
|
||||||
|
|
||||||
Note: I do not really know if this is a good list, adopted wholesale from
|
|
||||||
original bundle.
|
|
||||||
scope: constant.character.escape.asciidoc
|
|
||||||
indexterm_double:
|
|
||||||
- match: '(?<!\()(\({2})([^\(\s].*?)(\){2})(?!\))'
|
|
||||||
comment: |
|
|
||||||
Double parenthesis indexterm.
|
|
||||||
|
|
||||||
Examples:
|
|
||||||
((Arthur))
|
|
||||||
scope: variable.other.indexterm.double.asciidoc
|
|
||||||
captures:
|
|
||||||
1: constant.character.indexterm.double.begin.asciidoc
|
|
||||||
3: constant.character.indexterm.double.end.asciidoc
|
|
||||||
indexterm_triple:
|
|
||||||
- match: '(?<!\()(\({3})([^\(].*?)(\){3})(?!\))'
|
|
||||||
comment: |
|
|
||||||
Triple parenthesis indexterm.
|
|
||||||
|
|
||||||
Examples:
|
|
||||||
(((Sword, Broadsword, Excalibur)))
|
|
||||||
scope: variable.other.indexterm.triple.asciidoc
|
|
||||||
captures:
|
|
||||||
1: constant.character.indexterm.triple.begin.asciidoc
|
|
||||||
3: constant.character.indexterm.triple.end.asciidoc
|
|
||||||
inline:
|
|
||||||
- include: passthrough
|
|
||||||
- include: strong_double
|
|
||||||
- include: emphasis_double
|
|
||||||
- include: monospaced_double
|
|
||||||
- include: mark_double
|
|
||||||
- include: strong
|
|
||||||
- include: emphasis
|
|
||||||
- include: monospaced
|
|
||||||
- include: mark
|
|
||||||
- include: superscript
|
|
||||||
- include: subscript
|
|
||||||
inline_break:
|
|
||||||
- match: (?<=\s)\+$\n?
|
|
||||||
comment: |
|
|
||||||
Line hard break with a plus sign (+).
|
|
||||||
|
|
||||||
Examples:
|
|
||||||
Rubies are red, +
|
|
||||||
Topazes are blue.
|
|
||||||
scope: constant.linebreak.asciidoc
|
|
||||||
inline_callout:
|
|
||||||
- match: (?<!\\)(<)\d+(>)
|
|
||||||
comment: |
|
|
||||||
Callout label
|
|
||||||
|
|
||||||
Examples:
|
|
||||||
<1>
|
|
||||||
<42>
|
|
||||||
scope: constant.other.callout.asciidoc
|
|
||||||
captures:
|
|
||||||
1: punctuation.definition.callout.begin.asciidoc
|
|
||||||
2: punctuation.definition.callout.end.asciidoc
|
|
||||||
inline_comment:
|
|
||||||
- match: '^(//)([^/\n].*|)$\n?'
|
|
||||||
comment: |
|
|
||||||
Inline comment.
|
|
||||||
|
|
||||||
Examples:
|
|
||||||
// This is just a comment!
|
|
||||||
scope: comment.line.double-slash.asciidoc
|
|
||||||
captures:
|
|
||||||
1: punctuation.definition.comment.line.asciidoc
|
|
||||||
2: meta.line.comment.content.asciidoc
|
|
||||||
lines:
|
|
||||||
- include: inline_comment
|
|
||||||
- include: list_continuation
|
|
||||||
- include: inline_break
|
|
||||||
- include: block_page_break
|
|
||||||
- include: block_thematic_break
|
|
||||||
- include: block_title
|
|
||||||
- include: block_id
|
|
||||||
- include: section_template
|
|
||||||
- include: attribute_list_line
|
|
||||||
- include: attribute_entry
|
|
||||||
list_continuation:
|
|
||||||
- match: ^\+\s*$\n?
|
|
||||||
scope: constant.listcontinuation.asciidoc
|
|
||||||
lists:
|
|
||||||
- include: block_admonition_label
|
|
||||||
- include: ulist_item_marker
|
|
||||||
- include: olist_item_marker
|
|
||||||
- include: dlist_item_label
|
|
||||||
- include: colist_item_marker
|
|
||||||
macro:
|
|
||||||
- match: |-
|
|
||||||
(?x)
|
|
||||||
(?:
|
|
||||||
((?:https?|mailto|ftp|file) # specify separately so we can mark them as links that TextMate opens
|
|
||||||
?:{1} # inline only
|
|
||||||
\S*) # (others such as image are partial URLs and/or TextMate cannot handle them)
|
|
||||||
|
|
|
||||||
(([a-zA-Z0-9][a-zA-Z0-9_]*)
|
|
||||||
(:{1,2})
|
|
||||||
(\S*))
|
|
||||||
)
|
|
||||||
(?:(\[)([^\]]*)(\]))
|
|
||||||
comment: |
|
|
||||||
Note: There are other macro notations, but I match only those that end in
|
|
||||||
square brackets.
|
|
||||||
scope: meta.macro.asciidoc
|
|
||||||
captures:
|
|
||||||
1: markup.underline.link.macro.asciidoc
|
|
||||||
3: keyword.control.name.macro.asciidoc
|
|
||||||
4: constant.character.separator.macro.asciidoc
|
|
||||||
5: markup.underline.target.macro.asciidoc
|
|
||||||
6: constant.character.attributes.macro.begin.asciidoc
|
|
||||||
7: variable.parameter.attributes.macro.asciidoc
|
|
||||||
8: constant.character.attributes.macro.end.asciidoc
|
|
||||||
macro_pass:
|
|
||||||
- match: |-
|
|
||||||
(?x)
|
|
||||||
(pass)
|
|
||||||
(:{1,2})
|
|
||||||
(\S*)
|
|
||||||
(\[)(?=[^\]]*\])
|
|
||||||
comment: |
|
|
||||||
Passthrough macro
|
|
||||||
|
|
||||||
Examples:
|
|
||||||
pass:[Lorem ipsum]
|
|
||||||
pass::[Lorem ipsum]
|
|
||||||
captures:
|
|
||||||
1: keyword.control.name.macro.pass.asciidoc
|
|
||||||
2: constant.character.separator.macro.asciidoc
|
|
||||||
3: markup.underline.target.macro.asciidoc
|
|
||||||
4: constant.character.attributes.macro.begin.asciidoc
|
|
||||||
push:
|
|
||||||
- meta_scope: meta.macro.pass.asciidoc
|
|
||||||
- meta_content_scope: variable.parameter.attributes.macro.pass.asciidoc
|
|
||||||
- match: '\]'
|
|
||||||
captures:
|
|
||||||
0: constant.character.attributes.macro.end.asciidoc
|
|
||||||
pop: true
|
|
||||||
- include: scope:text.xml
|
|
||||||
mark:
|
|
||||||
- match: |-
|
|
||||||
(?x)
|
|
||||||
(\[[^\]]*?\])? # might start with attribute list (darned well better or why are we here)
|
|
||||||
(?<=^|\W)(?<!\\|}) # must be preceded by nonword character, and not by escape or } (attribute)
|
|
||||||
(\#)(?=\S) # delimiter hash that must be followed by a nonspace character
|
|
||||||
comment: |
|
|
||||||
Marked text (constrained variant).
|
|
||||||
|
|
||||||
Examples:
|
|
||||||
#Lorem ipsum# dolor
|
|
||||||
[red]#Lorem ipsum# dolor
|
|
||||||
captures:
|
|
||||||
1: support.variable.attributelist.asciidoc
|
|
||||||
2: punctuation.definition.string.unquoted.single.begin.asciidoc
|
|
||||||
push:
|
|
||||||
- meta_scope: string.other.unquoted.single.asciidoc
|
|
||||||
- meta_content_scope: string.unquoted.unquotedinner.single.asciidoc
|
|
||||||
- match: |-
|
|
||||||
(?x)
|
|
||||||
(?<=\S)(\#) # delimiter hash that must be preceded by a nonspace character
|
|
||||||
(?!\w) # ...and followed by a nonword character
|
|
||||||
captures:
|
|
||||||
1: punctuation.definition.string.unquoted.single.end.asciidoc
|
|
||||||
pop: true
|
|
||||||
- include: strong_double
|
|
||||||
- include: emphasis_double
|
|
||||||
- include: monospaced_double
|
|
||||||
- include: strong
|
|
||||||
- include: emphasis
|
|
||||||
- include: monospaced
|
|
||||||
- include: superscript
|
|
||||||
- include: subscript
|
|
||||||
- include: characters
|
|
||||||
mark_double:
|
|
||||||
- match: |-
|
|
||||||
(?x)
|
|
||||||
(\[[^\]]*?\])? # might start with an attribute list (indeed, that is its purpose)
|
|
||||||
(?<!\\) # must not be preceded by escape
|
|
||||||
(\#\#)
|
|
||||||
comment: |
|
|
||||||
Marked text (unconstrained variant).
|
|
||||||
|
|
||||||
Examples:
|
|
||||||
Lo##re##m ##ipsum dolor##.
|
|
||||||
Lo[red]##re##m
|
|
||||||
captures:
|
|
||||||
1: support.variable.attributelist.asciidoc
|
|
||||||
2: punctuation.definition.string.unquoted.double.begin.asciidoc
|
|
||||||
push:
|
|
||||||
- meta_scope: string.other.unquoted.double.asciidoc
|
|
||||||
- meta_content_scope: string.unquoted.unquotedinner.double.asciidoc
|
|
||||||
- match: '\#\#'
|
|
||||||
captures:
|
|
||||||
0: punctuation.definition.string.unquoted.double.end.asciidoc
|
|
||||||
pop: true
|
|
||||||
- include: strong_double
|
|
||||||
- include: emphasis_double
|
|
||||||
- include: monospaced_double
|
|
||||||
- include: strong
|
|
||||||
- include: emphasis
|
|
||||||
- include: monospaced
|
|
||||||
- include: superscript
|
|
||||||
- include: subscript
|
|
||||||
- include: characters
|
|
||||||
monospaced:
|
|
||||||
- match: |-
|
|
||||||
(?x)
|
|
||||||
(\[[^\]]*?\])? # might start with attributes list
|
|
||||||
(?<=^|\W)(?<!\\|}) # must be preceded by nonword character, and not by escape or } (attribute)
|
|
||||||
(`)(?=\S) # delimiter backtick that must be followed by a nonspace character
|
|
||||||
comment: |
|
|
||||||
Monospaced text (constrained variant).
|
|
||||||
|
|
||||||
Examples:
|
|
||||||
`Lorem ipsum` dolor
|
|
||||||
[red]`Lorem ipsum` dolor
|
|
||||||
captures:
|
|
||||||
1: support.variable.attributelist.asciidoc
|
|
||||||
2: punctuation.definition.literal.single.begin.asciidoc
|
|
||||||
push:
|
|
||||||
- meta_scope: string.other.literal.single.asciidoc
|
|
||||||
- meta_content_scope: meta.literalinner.single.asciidoc
|
|
||||||
- match: |-
|
|
||||||
(?x)
|
|
||||||
(?<=\S)(`) # delimiter backtick that must be preceded by a nonspace character
|
|
||||||
(?!\w) # ...and followed by a nonword character
|
|
||||||
captures:
|
|
||||||
1: punctuation.definition.literal.single.end.asciidoc
|
|
||||||
pop: true
|
|
||||||
- include: strong_double
|
|
||||||
- include: emphasis_double
|
|
||||||
- include: mark_double
|
|
||||||
- include: strong
|
|
||||||
- include: emphasis
|
|
||||||
- include: mark
|
|
||||||
- include: superscript
|
|
||||||
- include: subscript
|
|
||||||
- include: characters
|
|
||||||
monospaced_double:
|
|
||||||
- match: |-
|
|
||||||
(?x)
|
|
||||||
(\[[^\]]*?\])? # might start with attribute list
|
|
||||||
(?<!\\) # must not be preceded by escape
|
|
||||||
(``)
|
|
||||||
comment: |
|
|
||||||
Monospaced text (unconstrained variant).
|
|
||||||
|
|
||||||
Examples:
|
|
||||||
Lo``re``m ``ipsum dolor``.
|
|
||||||
Lo[red]``re``m
|
|
||||||
captures:
|
|
||||||
1: support.variable.attributelist.asciidoc
|
|
||||||
2: punctuation.definition.literal.double.begin.asciidoc
|
|
||||||
push:
|
|
||||||
- meta_scope: string.other.literal.double.asciidoc
|
|
||||||
- meta_content_scope: meta.literalinner.double.asciidoc
|
|
||||||
- match: "``"
|
|
||||||
captures:
|
|
||||||
0: punctuation.definition.literal.double.end.asciidoc
|
|
||||||
pop: true
|
|
||||||
- include: strong_double
|
|
||||||
- include: emphasis_double
|
|
||||||
- include: mark_double
|
|
||||||
- include: strong
|
|
||||||
- include: emphasis
|
|
||||||
- include: mark
|
|
||||||
- include: superscript
|
|
||||||
- include: subscript
|
|
||||||
- include: characters
|
|
||||||
olist_item_marker:
|
|
||||||
- match: '^(\s*(\.{1,5}))\s+(?=\S)'
|
|
||||||
comment: |
|
|
||||||
Marker of an ordered (numbered) list item.
|
|
||||||
|
|
||||||
Examples:
|
|
||||||
. level 1
|
|
||||||
.. level 2
|
|
||||||
... level 3
|
|
||||||
.... level 4
|
|
||||||
..... level 5
|
|
||||||
|
|
||||||
Note: The space distinguishes it from a block title.
|
|
||||||
scope: markup.list.numbered.dotted.asciidoc
|
|
||||||
captures:
|
|
||||||
1: string.unquoted.list.dotted.asciidoc
|
|
||||||
2: constant.numeric.list.dot.asciidoc
|
|
||||||
passthrough:
|
|
||||||
- match: (\+\+\+|\$\$)
|
|
||||||
comment: |
|
|
||||||
Inline triple-plus and double dolar passthrough.
|
|
||||||
|
|
||||||
Examples:
|
|
||||||
Lo+++re++++m +++ipsum dolor+++.
|
|
||||||
Lo$$re$$m $$ipsum dolor$$.
|
|
||||||
|
|
||||||
Note: Must be dead first among the inlines, so as to take priority.
|
|
||||||
captures:
|
|
||||||
1: constant.character.passthru.begin.asciidoc
|
|
||||||
push:
|
|
||||||
- meta_scope: meta.passthru.inline.asciidoc
|
|
||||||
- meta_content_scope: variable.parameter.passthruinner.asciidoc
|
|
||||||
- match: \1
|
|
||||||
captures:
|
|
||||||
0: constant.character.passthru.end.asciidoc
|
|
||||||
pop: true
|
|
||||||
replacement:
|
|
||||||
- match: |-
|
|
||||||
(?x)
|
|
||||||
(?<!\\) # must not be escaped
|
|
||||||
(
|
|
||||||
\(C\)
|
|
||||||
| \(TM\)
|
|
||||||
| \(R\)
|
|
||||||
| ((?<!\-)\-\-(?!\-)) # exactly two, and even this may not rule out all that I want to
|
|
||||||
| ((?<!\.)\.\.\.(?!\.)) # exactly three
|
|
||||||
| \->
|
|
||||||
| <\-
|
|
||||||
| =>
|
|
||||||
| <=
|
|
||||||
)
|
|
||||||
scope: constant.character.replacement.asciidoc
|
|
||||||
section_template:
|
|
||||||
- match: |-
|
|
||||||
(?x)^
|
|
||||||
(\[) # in square brackets
|
|
||||||
(template\s*=\s*)?(")? # might start with template-equals and might have template name in quotes
|
|
||||||
(
|
|
||||||
sect\d|abstract|preface|colophon|dedication|glossary|bibliography|synopsis|appendix|index # fixed list of known templates
|
|
||||||
)
|
|
||||||
(".*(\])|(\])) # either close the quote (and perhaps go on) and close the bracket, or close the bracket immediately
|
|
||||||
\s*$\n?
|
|
||||||
comment: fixed list of known template names
|
|
||||||
scope: variable.parameter.sectiontemplate.asciidoc
|
|
||||||
captures:
|
|
||||||
1: punctuation.definition.sectiontemplate.begin.asciidoc
|
|
||||||
4: meta.tag.sectiontemplate.asciidoc
|
|
||||||
6: punctuation.definition.sectiontemplate.end.asciidoc
|
|
||||||
7: punctuation.definition.sectiontemplate.end.asciidoc
|
|
||||||
section_titles:
|
|
||||||
- include: title_level_5
|
|
||||||
- include: title_level_4
|
|
||||||
- include: title_level_3
|
|
||||||
- include: title_level_2
|
|
||||||
- include: title_level_1
|
|
||||||
- include: title_level_0
|
|
||||||
strong:
|
|
||||||
- match: |-
|
|
||||||
(?x)
|
|
||||||
(\[[^\]]*?\])? # might start with an attributes list
|
|
||||||
(?<=^|\W)(?<!\\|}) # must be preceded by nonword character, and not by escape or } (attribute)
|
|
||||||
(\*)(?=\S) # delimiter star that must be followed by a nonspace character
|
|
||||||
comment: |
|
|
||||||
Strong (bold) text (constrained variant).
|
|
||||||
|
|
||||||
Examples:
|
|
||||||
*Lorem ipsum* dolor
|
|
||||||
[red]*Lorem ipsum* dolor
|
|
||||||
captures:
|
|
||||||
1: support.variable.attributelist.asciidoc
|
|
||||||
2: punctuation.definition.bold.single.begin.asciidoc
|
|
||||||
push:
|
|
||||||
- meta_scope: markup.bold.single.asciidoc
|
|
||||||
- meta_content_scope: meta.boldinner.single.asciidoc
|
|
||||||
- match: |-
|
|
||||||
(?x)
|
|
||||||
(?<=\S)(\*) # delimiter star that must be preceded by a nonspace character
|
|
||||||
(?!\w) # ...and followed by a nonword character
|
|
||||||
captures:
|
|
||||||
1: punctuation.definition.bold.single.end.asciidoc
|
|
||||||
pop: true
|
|
||||||
- include: emphasis_double
|
|
||||||
- include: monospaced_double
|
|
||||||
- include: mark_double
|
|
||||||
- include: emphasis
|
|
||||||
- include: monospaced
|
|
||||||
- include: mark
|
|
||||||
- include: superscript
|
|
||||||
- include: subscript
|
|
||||||
- include: characters
|
|
||||||
strong_double:
|
|
||||||
- match: |-
|
|
||||||
(?x)
|
|
||||||
(\[[^\]]*?\])? # might start with an attribute list
|
|
||||||
(?<!\\) # must not be preceded by escape
|
|
||||||
(\*\*)
|
|
||||||
comment: |
|
|
||||||
Strong (bold) text (unconstrained variant).
|
|
||||||
|
|
||||||
Examples:
|
|
||||||
Lo**re**m **ipsum dolor**.
|
|
||||||
Lo[red]**re**m
|
|
||||||
captures:
|
|
||||||
1: support.variable.attributelist.asciidoc
|
|
||||||
2: punctuation.definition.bold.double.begin.asciidoc
|
|
||||||
push:
|
|
||||||
- meta_scope: markup.bold.double.asciidoc
|
|
||||||
- meta_content_scope: meta.boldinner.double.asciidoc
|
|
||||||
- match: \*\*
|
|
||||||
captures:
|
|
||||||
0: punctuation.definition.bold.double.end.asciidoc
|
|
||||||
pop: true
|
|
||||||
- include: emphasis_double
|
|
||||||
- include: monospaced_double
|
|
||||||
- include: mark_double
|
|
||||||
- include: emphasis
|
|
||||||
- include: monospaced
|
|
||||||
- include: mark
|
|
||||||
- include: superscript
|
|
||||||
- include: subscript
|
|
||||||
- include: characters
|
|
||||||
subscript:
|
|
||||||
- match: |-
|
|
||||||
(?x)
|
|
||||||
(\[[^\]]*?\])? # might start with attribute list
|
|
||||||
(?<!\\) # must not be preceded by escape
|
|
||||||
(~)
|
|
||||||
comment: |
|
|
||||||
Subscript text.
|
|
||||||
|
|
||||||
Examples:
|
|
||||||
E=mc^2^
|
|
||||||
E=mc[red]^2^
|
|
||||||
captures:
|
|
||||||
1: support.variable.attributelist.asciidoc
|
|
||||||
2: punctuation.definition.string.subscript.begin.asciidoc
|
|
||||||
push:
|
|
||||||
- meta_scope: string.other.subscript.asciidoc
|
|
||||||
- meta_content_scope: meta.subscriptinner.asciidoc
|
|
||||||
- match: '~' # this tilda a problem if unquoted
|
|
||||||
captures:
|
|
||||||
0: punctuation.definition.string.subscript.end.asciidoc
|
|
||||||
pop: true
|
|
||||||
- include: strong_double
|
|
||||||
- include: emphasis_double
|
|
||||||
- include: monospaced_double
|
|
||||||
- include: mark_double
|
|
||||||
- include: strong
|
|
||||||
- include: emphasis
|
|
||||||
- include: monospaced
|
|
||||||
- include: mark
|
|
||||||
- include: superscript
|
|
||||||
- include: characters
|
|
||||||
superscript:
|
|
||||||
- match: |-
|
|
||||||
(?x)
|
|
||||||
(\[[^\]]*?\])? # might start with attribute list
|
|
||||||
(?<!\\) # no preceding escape
|
|
||||||
(\^)
|
|
||||||
comment: |
|
|
||||||
Superscript text.
|
|
||||||
|
|
||||||
Examples:
|
|
||||||
H~2~O
|
|
||||||
H[red]~2~O
|
|
||||||
captures:
|
|
||||||
1: support.variable.attributelist.asciidoc
|
|
||||||
2: punctuation.definition.string.superscript.begin.asciidoc
|
|
||||||
push:
|
|
||||||
- meta_scope: string.other.superscript.asciidoc
|
|
||||||
- meta_content_scope: meta.superscriptinner.asciidoc
|
|
||||||
- match: ^
|
|
||||||
captures:
|
|
||||||
0: punctuation.definition.string.superscript.end.asciidoc
|
|
||||||
pop: true
|
|
||||||
- include: strong_double
|
|
||||||
- include: emphasis_double
|
|
||||||
- include: monospaced_double
|
|
||||||
- include: mark_double
|
|
||||||
- include: strong
|
|
||||||
- include: emphasis
|
|
||||||
- include: monospaced
|
|
||||||
- include: mark
|
|
||||||
- include: subscript
|
|
||||||
- include: characters
|
|
||||||
title_level_0:
|
|
||||||
- match: ^(=) (\w.*)$\n?
|
|
||||||
scope: markup.heading.level.0.asciidoc
|
|
||||||
captures:
|
|
||||||
1: punctuation.definition.heading.asciidoc
|
|
||||||
2: entity.name.section.asciidoc
|
|
||||||
title_level_1:
|
|
||||||
- match: ^(==) (\w.*)$\n?
|
|
||||||
scope: markup.heading.level.1.asciidoc
|
|
||||||
captures:
|
|
||||||
1: punctuation.definition.heading.asciidoc
|
|
||||||
2: entity.name.section.asciidoc
|
|
||||||
title_level_2:
|
|
||||||
- match: ^(===) (\w.*)$\n?
|
|
||||||
scope: markup.heading.level.2.asciidoc
|
|
||||||
captures:
|
|
||||||
1: punctuation.definition.heading.asciidoc
|
|
||||||
2: entity.name.section.asciidoc
|
|
||||||
title_level_3:
|
|
||||||
- match: ^(====) (\w.*)$\n?
|
|
||||||
scope: markup.heading.level.3.asciidoc
|
|
||||||
captures:
|
|
||||||
1: punctuation.definition.heading.asciidoc
|
|
||||||
2: entity.name.section.asciidoc
|
|
||||||
title_level_4:
|
|
||||||
- match: ^(=====) (\w.*)$\n?
|
|
||||||
scope: markup.heading.level.4.asciidoc
|
|
||||||
captures:
|
|
||||||
1: punctuation.definition.heading.asciidoc
|
|
||||||
2: entity.name.section.asciidoc
|
|
||||||
title_level_5:
|
|
||||||
- match: ^(======) (\w.*)$\n?
|
|
||||||
scope: markup.heading.level.5.asciidoc
|
|
||||||
captures:
|
|
||||||
1: punctuation.definition.heading.asciidoc
|
|
||||||
2: entity.name.section.asciidoc
|
|
||||||
ulist_item_marker:
|
|
||||||
- match: '^(\s*(\-|\*{1,5}))\s+(?=\S)'
|
|
||||||
comment: |
|
|
||||||
Marker of an unordered (bullet) list item.
|
|
||||||
|
|
||||||
Examples:
|
|
||||||
* level 1
|
|
||||||
** level 2
|
|
||||||
*** level 3
|
|
||||||
**** level 4
|
|
||||||
***** level 5
|
|
||||||
- level 1
|
|
||||||
-- level 2
|
|
||||||
--- level 3
|
|
||||||
---- level 4
|
|
||||||
----- level 5
|
|
||||||
scope: markup.list.bulleted.asciidoc
|
|
||||||
captures:
|
|
||||||
1: string.unquoted.list.bullet.asciidoc
|
|
||||||
2: constant.numeric.list.bullet.asciidoc
|
|
||||||
xref:
|
|
||||||
- match: '(?<!<)(<<)([^,]*?)((,\s*)(.*?))?(>>)(?!<)'
|
|
||||||
comment: |
|
|
||||||
Internal cross-reference
|
|
||||||
|
|
||||||
Examples:
|
|
||||||
<<lorem>>
|
|
||||||
<<lorem, see here>>
|
|
||||||
scope: meta.xref.asciidoc
|
|
||||||
captures:
|
|
||||||
1: constant.character.xref.begin.asciidoc
|
|
||||||
2: markup.underline.term.xref.asciidoc
|
|
||||||
5: variable.parameter.xref.asciidoc
|
|
||||||
6: constant.character.xref.end.asciidoc
|
|
@ -1 +0,0 @@
|
|||||||
Subproject commit 08f33d80ded128a708d83017148dba52ebdfb04a
|
|
@ -1,172 +0,0 @@
|
|||||||
%YAML 1.2
|
|
||||||
---
|
|
||||||
# http://www.sublimetext.com/docs/3/syntax.html
|
|
||||||
name: ARM Assembly
|
|
||||||
file_extensions:
|
|
||||||
- s
|
|
||||||
- S
|
|
||||||
scope: source.asm.arm
|
|
||||||
contexts:
|
|
||||||
main:
|
|
||||||
- match: "@.*$"
|
|
||||||
scope: comment.line
|
|
||||||
- match: //.*$
|
|
||||||
scope: comment.line
|
|
||||||
- match: ;.*$
|
|
||||||
scope: comment.line
|
|
||||||
- match: ^\s*\#\s*if\s+0\b
|
|
||||||
push:
|
|
||||||
- meta_scope: comment.preprocessor
|
|
||||||
- match: ^\s*\#\s*endif\b
|
|
||||||
pop: true
|
|
||||||
- match: /\*
|
|
||||||
push:
|
|
||||||
- meta_scope: comment.block
|
|
||||||
- match: \*/
|
|
||||||
pop: true
|
|
||||||
- match: |-
|
|
||||||
(?x)
|
|
||||||
^\s*\#\s*(define)\s+ # define
|
|
||||||
((?<id>[a-zA-Z_][a-zA-Z0-9_]*)) # macro name
|
|
||||||
(?: # and optionally:
|
|
||||||
(\() # an open parenthesis
|
|
||||||
(
|
|
||||||
\s* \g<id> \s* # first argument
|
|
||||||
((,) \s* \g<id> \s*)* # additional arguments
|
|
||||||
(?:\.\.\.)? # varargs ellipsis?
|
|
||||||
)
|
|
||||||
(\)) # a close parenthesis
|
|
||||||
)?
|
|
||||||
captures:
|
|
||||||
1: keyword.control.import.define.c
|
|
||||||
2: entity.name.function.preprocessor.c
|
|
||||||
4: punctuation.definition.parameters.c
|
|
||||||
5: variable.parameter.preprocessor.c
|
|
||||||
7: punctuation.separator.parameters.c
|
|
||||||
8: punctuation.definition.parameters.c
|
|
||||||
push:
|
|
||||||
- meta_scope: meta.preprocessor.macro.c
|
|
||||||
- match: (?=(?://|/\*))|$
|
|
||||||
pop: true
|
|
||||||
- match: (?>\\\s*\n)
|
|
||||||
scope: punctuation.separator.continuation.c
|
|
||||||
- include: $top_level_main
|
|
||||||
- match: ^\s*#\s*(error|warning)\b
|
|
||||||
captures:
|
|
||||||
1: keyword.control.import.error.c
|
|
||||||
push:
|
|
||||||
- meta_scope: meta.preprocessor.diagnostic.c
|
|
||||||
- match: $
|
|
||||||
captures:
|
|
||||||
1: keyword.control.import.error.c
|
|
||||||
pop: true
|
|
||||||
- match: (?>\\\s*\n)
|
|
||||||
scope: punctuation.separator.continuation.c
|
|
||||||
- match: ^\s*#\s*(include|import)\b\s+
|
|
||||||
captures:
|
|
||||||
1: keyword.control.import.include.c
|
|
||||||
push:
|
|
||||||
- meta_scope: meta.preprocessor.c.include
|
|
||||||
- match: (?=(?://|/\*))|$
|
|
||||||
captures:
|
|
||||||
1: keyword.control.import.include.c
|
|
||||||
pop: true
|
|
||||||
- match: (?>\\\s*\n)
|
|
||||||
scope: punctuation.separator.continuation.c
|
|
||||||
- match: '"'
|
|
||||||
captures:
|
|
||||||
0: punctuation.definition.string.begin.c
|
|
||||||
push:
|
|
||||||
- meta_scope: string.quoted.double.include.c
|
|
||||||
- match: '"'
|
|
||||||
captures:
|
|
||||||
0: punctuation.definition.string.end.c
|
|
||||||
pop: true
|
|
||||||
- match: <
|
|
||||||
captures:
|
|
||||||
0: punctuation.definition.string.begin.c
|
|
||||||
push:
|
|
||||||
- meta_scope: string.quoted.other.lt-gt.include.c
|
|
||||||
- match: ">"
|
|
||||||
captures:
|
|
||||||
0: punctuation.definition.string.end.c
|
|
||||||
pop: true
|
|
||||||
- match: '((?i)([xw][0-9]|[xw]1[0-9]||[xw]2[0-9]|[wx]30|wzr|xzr|wsp|fpsr|fpcr|[rcp]1[0-5]|[rcp][0-9]|a[1-4]|v[1-8]|sl|sb|fp|ip|sp|lr|(c|s)psr(_c)?|pc|[sd]3[0-1]|[sd][12][0-9]|[sd][0-9]|fpsid|fpscr|fpexc|q3[0-1]|q2[0-9]|q1[0-9]|q[0-9]|APSR_nzcv|sy)!?(?-i))?\b'
|
|
||||||
scope: storage.other.register
|
|
||||||
- match: \.(?i)(globl|global|macro|endm|purgem|if|elseif|else|endif|section|text|arm|align|balign|irp|rept|endr|req|unreq|error|short|func|endfunc|hidden|type|fpu|arch|code|altmacro|object_arch|word|int|string)(?-i)\b
|
|
||||||
scope: keyword.control.directive
|
|
||||||
- match: armv(2a?|3m?|4t?|5t?e?6(j|t2|zk?|-m)?|7v?e?(-(a|r|m))?|8-a(\+crc)?)
|
|
||||||
scope: keyword.control.arch.arm
|
|
||||||
- match: ^\s*#\s*(define|defined|elif|else|if|ifdef|ifndef|line|pragma|undef|endif)\b
|
|
||||||
captures:
|
|
||||||
1: keyword.control.import.c
|
|
||||||
push:
|
|
||||||
- meta_scope: meta.preprocessor.c
|
|
||||||
- match: (?=(?://|/\*))|$
|
|
||||||
captures:
|
|
||||||
1: keyword.control.import.c
|
|
||||||
pop: true
|
|
||||||
- match: (?>\\\s*\n)
|
|
||||||
scope: punctuation.separator.continuation.c
|
|
||||||
- match: |-
|
|
||||||
(?x)\b((?i)
|
|
||||||
(
|
|
||||||
(bf(c|i)|(u|s)bfx|(u|s)xta?(h|b)?) |
|
|
||||||
(v(add|cvt|sub|mov|trn|cmp|div|qdmulh|mrs|mul|ld1|qadd|qshrun|st[1234]|addw|mull|mlal|rshrn|swp|qmovun)|qmovun)(\.([isup]?8|[isupf]?16|[isuf]?32|[isu]?64))* |
|
|
||||||
(and|m(rs|sr)|eor|sub|rsb|add|adc|sbc|rsc|tst|teq|cmp|cmn|orr|mov|bic|mvn |
|
|
||||||
(neg) |
|
|
||||||
(lsr|lsl|ror|asr) # shift ops either pseudo ops or actual shifts
|
|
||||||
)s? |
|
|
||||||
(mul|mla|mull|smlabb) |
|
|
||||||
(mov(w|t)) |
|
|
||||||
rev(8|16)? |
|
|
||||||
(pld|adr|adrl|vswp)
|
|
||||||
)
|
|
||||||
(ne|eq|cs|hs|cc|lo|mi|pl|vs|vc|hi|ls|lt|le|gt|ge|al)?(?-i))?\b
|
|
||||||
scope: support.function.mnemonic.arithmetic
|
|
||||||
- match: |-
|
|
||||||
(?x)\b((?i)(
|
|
||||||
swi|svc|wfi|
|
|
||||||
dmb | clrex | dsb | isb |
|
|
||||||
v(ldr|str|push|pop) |
|
|
||||||
(push|pop) |
|
|
||||||
(st|ld)(
|
|
||||||
p |
|
|
||||||
r(ex|s?(h|b)|d)? |
|
|
||||||
m(
|
|
||||||
(f|e)(d|a) |
|
|
||||||
(d|i)(b|a)
|
|
||||||
)?
|
|
||||||
) |
|
|
||||||
b(l|x|lx|lr|r)? |
|
|
||||||
(i|e)?ret|
|
|
||||||
b\.(eq|ne|hs|cs|lo|cc|mi|pl|vs|vc|hi|ls|ge|lt|gt|le|al|nv)+ |
|
|
||||||
(c|t)?bn?z|
|
|
||||||
)+(ne|eq|cs|hs|cc|lo|mi|pl|vs|vc|hi|ls|lt|le|gt|ge|al)?(?-i))\b
|
|
||||||
scope: support.function.mnemonic.memory
|
|
||||||
- match: '\b((?i)(def(b|w|s)|equ|(include|get)(\s+([a-zA-Z_]+[0-9a-zA-Z_]*|[0-9]+[a-zA-Z_]+[0-9a-zA-Z_]*?)\.s)?)?(?-i))\b'
|
|
||||||
scope: meta.preprocessor.c.include
|
|
||||||
- match: \b((?i)(align)(?-i))?\b
|
|
||||||
scope: storage.type.c.memaccess
|
|
||||||
- match: \s+\".+\"
|
|
||||||
scope: string
|
|
||||||
- match: \b((?i)nop(ne|eq|cs|hs|cc|lo|mi|pl|vs|vc|hi|ls|lt|le|gt|ge|al)?(?-i))?\b
|
|
||||||
scope: comment.nop
|
|
||||||
- match: '\s\['
|
|
||||||
push:
|
|
||||||
- meta_scope: storage.type.c.memaccess
|
|
||||||
- match: '\]'
|
|
||||||
pop: true
|
|
||||||
- match: (?>\\\s*\n)
|
|
||||||
scope: punctuation.separator.continuation.c
|
|
||||||
- include: $top_level_main
|
|
||||||
- match: (\b|\s+)\=\b
|
|
||||||
scope: keyword.control.evaluation
|
|
||||||
- match: '(\b|\s+)(\#)?-?(0x|&)[0-9a-fA-F_]+\b'
|
|
||||||
scope: constant.numeric.hex
|
|
||||||
- match: '(\b|\s+)\#-?[0-9a-zA-Z_]+\b'
|
|
||||||
scope: constant.numeric.literal
|
|
||||||
- match: '(\b|\s+)[0-9]+\b'
|
|
||||||
scope: constant.numeric.dec
|
|
||||||
- match: '\b([a-zA-Z_]+[0-9a-zA-Z_]*|[0-9]+[a-zA-Z_]+[0-9a-zA-Z_]*)\b'
|
|
||||||
scope: meta.function.source.arm.label
|
|
File diff suppressed because it is too large
Load Diff
@ -1 +0,0 @@
|
|||||||
Subproject commit b91c44a32e251c20c6359a8d9232287e1b408e6c
|
|
@ -1 +0,0 @@
|
|||||||
Subproject commit eb40ede56c2d4d5a4a129b2a5bc7095a2df46bb1
|
|
@ -1,78 +0,0 @@
|
|||||||
%YAML 1.2
|
|
||||||
---
|
|
||||||
# See http://www.sublimetext.com/docs/3/syntax.html
|
|
||||||
name: Comma Separated Values
|
|
||||||
file_extensions:
|
|
||||||
- csv
|
|
||||||
- tsv
|
|
||||||
scope: text.csv
|
|
||||||
variables:
|
|
||||||
field_separator: (?:[,;\t])
|
|
||||||
record_separator: (?:$\n?)
|
|
||||||
contexts:
|
|
||||||
prototype:
|
|
||||||
- match: (?={{record_separator}})
|
|
||||||
pop: true
|
|
||||||
fields:
|
|
||||||
- match: ''
|
|
||||||
push:
|
|
||||||
- field_or_record_separator
|
|
||||||
- field4
|
|
||||||
- field_or_record_separator
|
|
||||||
- field3
|
|
||||||
- field_or_record_separator
|
|
||||||
- field2
|
|
||||||
- field_or_record_separator
|
|
||||||
- field1
|
|
||||||
main:
|
|
||||||
- meta_include_prototype: false
|
|
||||||
- match: '^'
|
|
||||||
set: fields
|
|
||||||
|
|
||||||
field_or_record_separator:
|
|
||||||
- meta_include_prototype: false
|
|
||||||
- match: '{{record_separator}}'
|
|
||||||
scope: punctuation.terminator.record.csv
|
|
||||||
pop: true
|
|
||||||
- match: '{{field_separator}}'
|
|
||||||
scope: punctuation.separator.sequence.csv
|
|
||||||
pop: true
|
|
||||||
|
|
||||||
field_contents:
|
|
||||||
- match: '"'
|
|
||||||
scope: punctuation.definition.string.begin.csv
|
|
||||||
push: double_quoted_string
|
|
||||||
|
|
||||||
- match: (?={{field_separator}}|{{record_separator}})
|
|
||||||
pop: true
|
|
||||||
|
|
||||||
double_quoted_string:
|
|
||||||
- meta_include_prototype: false
|
|
||||||
- meta_scope: string.quoted.double.csv
|
|
||||||
- match: '""'
|
|
||||||
scope: constant.character.escape.csv
|
|
||||||
- match: '"'
|
|
||||||
scope: punctuation.definition.string.end.csv
|
|
||||||
pop: true
|
|
||||||
|
|
||||||
field1:
|
|
||||||
- match: ''
|
|
||||||
set:
|
|
||||||
- meta_content_scope: meta.field-1.csv support.type
|
|
||||||
- include: field_contents
|
|
||||||
field2:
|
|
||||||
- match: ''
|
|
||||||
set:
|
|
||||||
- meta_content_scope: meta.field-2.csv support.function
|
|
||||||
- include: field_contents
|
|
||||||
field3:
|
|
||||||
- match: ''
|
|
||||||
set:
|
|
||||||
- meta_content_scope: meta.field-3.csv constant.numeric
|
|
||||||
- include: field_contents
|
|
||||||
field4:
|
|
||||||
- match: ''
|
|
||||||
set:
|
|
||||||
- meta_content_scope: meta.field-4.csv keyword.operator
|
|
||||||
- include: field_contents
|
|
||||||
|
|
@ -1 +0,0 @@
|
|||||||
Subproject commit e08f9b8cdfc84e0456ae63dca7aaefb94bf06e24
|
|
@ -1,271 +0,0 @@
|
|||||||
%YAML 1.2
|
|
||||||
---
|
|
||||||
# http://www.sublimetext.com/docs/3/syntax.html
|
|
||||||
name: CoffeeScript
|
|
||||||
comment: "CoffeeScript Syntax: version 1"
|
|
||||||
file_extensions:
|
|
||||||
- coffee
|
|
||||||
- Cakefile
|
|
||||||
- coffee.erb
|
|
||||||
- cson
|
|
||||||
first_line_match: ^#!.*\bcoffee
|
|
||||||
scope: source.coffee
|
|
||||||
contexts:
|
|
||||||
main:
|
|
||||||
- match: '(\([^()]*?\))\s*([=-]>)'
|
|
||||||
comment: "match stuff like: a -> …"
|
|
||||||
scope: meta.inline.function.coffee
|
|
||||||
captures:
|
|
||||||
1: variable.parameter.function.coffee
|
|
||||||
2: storage.type.function.coffee
|
|
||||||
- match: (new)\s+(\w+(?:\.\w*)*)
|
|
||||||
scope: meta.class.instance.constructor
|
|
||||||
captures:
|
|
||||||
1: keyword.operator.new.coffee
|
|
||||||
2: support.class.coffee
|
|
||||||
- match: "'''"
|
|
||||||
captures:
|
|
||||||
0: punctuation.definition.string.begin.coffee
|
|
||||||
push:
|
|
||||||
- meta_scope: string.quoted.heredoc.coffee
|
|
||||||
- match: "'''"
|
|
||||||
captures:
|
|
||||||
0: punctuation.definition.string.end.coffee
|
|
||||||
pop: true
|
|
||||||
- match: '"""'
|
|
||||||
captures:
|
|
||||||
0: punctuation.definition.string.begin.coffee
|
|
||||||
push:
|
|
||||||
- meta_scope: string.quoted.double.heredoc.coffee
|
|
||||||
- match: '"""'
|
|
||||||
captures:
|
|
||||||
0: punctuation.definition.string.end.coffee
|
|
||||||
pop: true
|
|
||||||
- match: \\.
|
|
||||||
scope: constant.character.escape.coffee
|
|
||||||
- include: interpolated_coffee
|
|
||||||
- match: "`"
|
|
||||||
captures:
|
|
||||||
0: punctuation.definition.string.begin.coffee
|
|
||||||
push:
|
|
||||||
- meta_scope: string.quoted.script.coffee
|
|
||||||
- match: "`"
|
|
||||||
captures:
|
|
||||||
0: punctuation.definition.string.end.coffee
|
|
||||||
pop: true
|
|
||||||
- match: '\\(x\h{2}|[0-2][0-7]{,2}|3[0-6][0-7]|37[0-7]?|[4-7][0-7]?|.)'
|
|
||||||
scope: constant.character.escape.coffee
|
|
||||||
- match: (?<!#)###(?!#)
|
|
||||||
captures:
|
|
||||||
0: punctuation.definition.comment.coffee
|
|
||||||
push:
|
|
||||||
- meta_scope: comment.block.coffee
|
|
||||||
- match: '###(?:[ \t]*\n)'
|
|
||||||
captures:
|
|
||||||
0: punctuation.definition.comment.coffee
|
|
||||||
pop: true
|
|
||||||
- match: '@\w*'
|
|
||||||
scope: storage.type.annotation.coffeescript
|
|
||||||
- match: '(#)(?!\{).*$\n?'
|
|
||||||
scope: comment.line.number-sign.coffee
|
|
||||||
captures:
|
|
||||||
1: punctuation.definition.comment.coffee
|
|
||||||
- match: "/{3}"
|
|
||||||
push:
|
|
||||||
- meta_scope: string.regexp.coffee
|
|
||||||
- match: "/{3}[imgy]{0,4}"
|
|
||||||
pop: true
|
|
||||||
- include: interpolated_coffee
|
|
||||||
- include: embedded_comment
|
|
||||||
- match: '/(?![\s=/*+{}?]).*?[^\\]/[igmy]{0,4}(?![a-zA-Z0-9])'
|
|
||||||
scope: string.regexp.coffee
|
|
||||||
- match: |-
|
|
||||||
(?x)
|
|
||||||
\b(?<![\.\$])(
|
|
||||||
break|by|catch|continue|else|finally|for|in|of|if|return|switch|
|
|
||||||
then|throw|try|unless|when|while|until|loop|do|(?<=for)\s+own
|
|
||||||
)(?!\s*:)\b
|
|
||||||
scope: keyword.control.coffee
|
|
||||||
- match: |-
|
|
||||||
(?x)
|
|
||||||
and=|or=|!|%|&|\^|\*|\/|(\-)?\-(?!>)|\+\+|\+|~|==|=(?!>)|!=|<=|>=|<<=|>>=|
|
|
||||||
>>>=|<>|<|>|!|&&|\.\.(\.)?|\?|\||\|\||\:|\*=|(?<!\()/=|%=|\+=|\-=|&=|
|
|
||||||
\^=|\b(?<![\.\$])(instanceof|new|delete|typeof|and|or|is|isnt|not|super)\b
|
|
||||||
scope: keyword.operator.coffee
|
|
||||||
- match: '([a-zA-Z\$_](\w|\$|\.)*\s*(?!\::)((:)|(=[^=]))(?!(\s*\(.*\))?\s*((=|-)>)))'
|
|
||||||
scope: variable.assignment.coffee
|
|
||||||
captures:
|
|
||||||
1: variable.assignment.coffee
|
|
||||||
4: punctuation.separator.key-value
|
|
||||||
5: keyword.operator.coffee
|
|
||||||
- match: '(?<=\s|^)([\[\{])(?=.*?[\]\}]\s+[:=])'
|
|
||||||
captures:
|
|
||||||
0: keyword.operator.coffee
|
|
||||||
push:
|
|
||||||
- meta_scope: meta.variable.assignment.destructured.coffee
|
|
||||||
- match: '([\]\}]\s*[:=])'
|
|
||||||
captures:
|
|
||||||
0: keyword.operator.coffee
|
|
||||||
pop: true
|
|
||||||
- include: variable_name
|
|
||||||
- include: instance_variable
|
|
||||||
- include: single_quoted_string
|
|
||||||
- include: double_quoted_string
|
|
||||||
- include: numeric
|
|
||||||
- match: |-
|
|
||||||
(?x)
|
|
||||||
(\s*)
|
|
||||||
(?=[a-zA-Z\$_])
|
|
||||||
(
|
|
||||||
[a-zA-Z\$_](\w|\$|:|\.)*\s*
|
|
||||||
(?=[:=](\s*\(.*\))?\s*([=-]>))
|
|
||||||
)
|
|
||||||
scope: meta.function.coffee
|
|
||||||
captures:
|
|
||||||
2: entity.name.function.coffee
|
|
||||||
3: entity.name.function.coffee
|
|
||||||
4: variable.parameter.function.coffee
|
|
||||||
5: storage.type.function.coffee
|
|
||||||
- match: ^\s*(describe|it|app\.(get|post|put|all|del|delete))
|
|
||||||
comment: Show well-known functions from Express and Mocha in Go To Symbol view
|
|
||||||
push:
|
|
||||||
- meta_scope: meta.function.symbols.coffee
|
|
||||||
- match: $
|
|
||||||
pop: true
|
|
||||||
- include: main
|
|
||||||
- match: "[=-]>"
|
|
||||||
scope: storage.type.function.coffee
|
|
||||||
- match: '\b(?<!\.)(true|on|yes)(?!\s*[:=])\b'
|
|
||||||
scope: constant.language.boolean.true.coffee
|
|
||||||
- match: '\b(?<!\.)(false|off|no)(?!\s*[:=])\b'
|
|
||||||
scope: constant.language.boolean.false.coffee
|
|
||||||
- match: '\b(?<!\.)null(?!\s*[:=])\b'
|
|
||||||
scope: constant.language.null.coffee
|
|
||||||
- match: '\b(?<!\.)(this|extends)(?!\s*[:=])\b'
|
|
||||||
scope: variable.language.coffee
|
|
||||||
- match: '(class\b)\s+(@?[a-zA-Z\$_][\w\.]*)?(?:\s+(extends)\s+(@?[a-zA-Z\$\._][\w\.]*))?'
|
|
||||||
scope: meta.class.coffee
|
|
||||||
captures:
|
|
||||||
1: storage.type.class.coffee
|
|
||||||
2: entity.name.type.class.coffee
|
|
||||||
3: keyword.control.inheritance.coffee
|
|
||||||
4: entity.other.inherited-class.coffee
|
|
||||||
- match: \b(debugger|\\)\b
|
|
||||||
scope: keyword.other.coffee
|
|
||||||
- match: |-
|
|
||||||
(?x)\b(
|
|
||||||
Array|ArrayBuffer|Blob|Boolean|Date|document|event|Function|
|
|
||||||
Int(8|16|32|64)Array|Math|Map|Number|
|
|
||||||
Object|Proxy|RegExp|Set|String|WeakMap|
|
|
||||||
window|Uint(8|16|32|64)Array|XMLHttpRequest
|
|
||||||
)\b
|
|
||||||
scope: support.class.coffee
|
|
||||||
- match: ((?<=console\.)(debug|warn|info|log|error|time|timeEnd|assert))\b
|
|
||||||
scope: support.function.console.coffee
|
|
||||||
- match: |-
|
|
||||||
(?x)\b(
|
|
||||||
decodeURI(Component)?|encodeURI(Component)?|eval|parse(Float|Int)|require
|
|
||||||
)\b
|
|
||||||
scope: support.function.coffee
|
|
||||||
- match: |-
|
|
||||||
(?x)((?<=\.)(
|
|
||||||
apply|call|concat|every|filter|forEach|from|hasOwnProperty|indexOf|
|
|
||||||
isPrototypeOf|join|lastIndexOf|map|of|pop|propertyIsEnumerable|push|
|
|
||||||
reduce(Right)?|reverse|shift|slice|some|sort|splice|to(Locale)?String|
|
|
||||||
unshift|valueOf
|
|
||||||
))\b
|
|
||||||
scope: support.function.method.array.coffee
|
|
||||||
- match: |-
|
|
||||||
(?x)((?<=Array\.)(
|
|
||||||
isArray
|
|
||||||
))\b
|
|
||||||
scope: support.function.static.array.coffee
|
|
||||||
- match: |-
|
|
||||||
(?x)((?<=Object\.)(
|
|
||||||
create|definePropert(ies|y)|freeze|getOwnProperty(Descriptors?|Names)|
|
|
||||||
getProperty(Descriptor|Names)|getPrototypeOf|is(Extensible|Frozen|Sealed)?|
|
|
||||||
isnt|keys|preventExtensions|seal
|
|
||||||
))\b
|
|
||||||
scope: support.function.static.object.coffee
|
|
||||||
- match: |-
|
|
||||||
(?x)((?<=Math\.)(
|
|
||||||
abs|acos|acosh|asin|asinh|atan|atan2|atanh|ceil|cos|cosh|exp|expm1|floor|
|
|
||||||
hypot|log|log10|log1p|log2|max|min|pow|random|round|sign|sin|sinh|sqrt|
|
|
||||||
tan|tanh|trunc
|
|
||||||
))\b
|
|
||||||
scope: support.function.static.math.coffee
|
|
||||||
- match: |-
|
|
||||||
(?x)((?<=Number\.)(
|
|
||||||
is(Finite|Integer|NaN)|toInteger
|
|
||||||
))\b
|
|
||||||
scope: support.function.static.number.coffee
|
|
||||||
- match: \b(Infinity|NaN|undefined)\b
|
|
||||||
scope: constant.language.coffee
|
|
||||||
- match: \;
|
|
||||||
scope: punctuation.terminator.statement.coffee
|
|
||||||
- match: ',[ |\t]*'
|
|
||||||
scope: meta.delimiter.object.comma.coffee
|
|
||||||
- match: \.
|
|
||||||
scope: meta.delimiter.method.period.coffee
|
|
||||||
- match: '\{|\}'
|
|
||||||
scope: meta.brace.curly.coffee
|
|
||||||
- match: \(|\)
|
|
||||||
scope: meta.brace.round.coffee
|
|
||||||
- match: '\[|\]\s*'
|
|
||||||
scope: meta.brace.square.coffee
|
|
||||||
- include: instance_variable
|
|
||||||
- include: single_quoted_string
|
|
||||||
- include: double_quoted_string
|
|
||||||
- include: numeric
|
|
||||||
double_quoted_string:
|
|
||||||
- match: '"'
|
|
||||||
captures:
|
|
||||||
0: punctuation.definition.string.begin.coffee
|
|
||||||
push:
|
|
||||||
- meta_scope: string.quoted.double.coffee
|
|
||||||
- match: '"'
|
|
||||||
captures:
|
|
||||||
0: punctuation.definition.string.end.coffee
|
|
||||||
pop: true
|
|
||||||
- match: '\\(x\h{2}|[0-2][0-7]{,2}|3[0-6][0-7]|37[0-7]?|[4-7][0-7]?|.)'
|
|
||||||
scope: constant.character.escape.coffee
|
|
||||||
- include: interpolated_coffee
|
|
||||||
embedded_comment:
|
|
||||||
- match: (?<!\\)(#).*$\n?
|
|
||||||
scope: comment.line.number-sign.coffee
|
|
||||||
captures:
|
|
||||||
1: punctuation.definition.comment.coffee
|
|
||||||
instance_variable:
|
|
||||||
- match: '(@)([a-zA-Z_\$]\w*)?'
|
|
||||||
scope: variable.other.readwrite.instance.coffee
|
|
||||||
interpolated_coffee:
|
|
||||||
- match: '\#\{'
|
|
||||||
captures:
|
|
||||||
0: punctuation.section.embedded.coffee
|
|
||||||
push:
|
|
||||||
- meta_scope: source.coffee.embedded.source
|
|
||||||
- match: '\}'
|
|
||||||
captures:
|
|
||||||
0: punctuation.section.embedded.coffee
|
|
||||||
pop: true
|
|
||||||
- include: main
|
|
||||||
numeric:
|
|
||||||
- match: '(?<!\$)\b((0([box])[0-9a-fA-F]+)|([0-9]+(\.[0-9]+)?(e[+\-]?[0-9]+)?))\b'
|
|
||||||
scope: constant.numeric.coffee
|
|
||||||
single_quoted_string:
|
|
||||||
- match: "'"
|
|
||||||
captures:
|
|
||||||
0: punctuation.definition.string.begin.coffee
|
|
||||||
push:
|
|
||||||
- meta_scope: string.quoted.single.coffee
|
|
||||||
- match: "'"
|
|
||||||
captures:
|
|
||||||
0: punctuation.definition.string.end.coffee
|
|
||||||
pop: true
|
|
||||||
- match: '\\(x\h{2}|[0-2][0-7]{,2}|3[0-6][0-7]?|37[0-7]?|[4-7][0-7]?|.)'
|
|
||||||
scope: constant.character.escape.coffee
|
|
||||||
variable_name:
|
|
||||||
- match: '([a-zA-Z\$_]\w*(\.\w+)*)'
|
|
||||||
scope: variable.assignment.coffee
|
|
||||||
captures:
|
|
||||||
1: variable.assignment.coffee
|
|
@ -1,14 +0,0 @@
|
|||||||
%YAML 1.2
|
|
||||||
---
|
|
||||||
# http://www.sublimetext.com/docs/3/syntax.html
|
|
||||||
name: CpuInfo
|
|
||||||
file_extensions:
|
|
||||||
- cpuinfo
|
|
||||||
scope: source.cpuinfo
|
|
||||||
|
|
||||||
contexts:
|
|
||||||
main:
|
|
||||||
- match: '^([^:]+)\w*:\w*(.*)$'
|
|
||||||
captures:
|
|
||||||
1: keyword.other.cpuinfo-key
|
|
||||||
2: string.other.cpuinfo-value
|
|
@ -1 +0,0 @@
|
|||||||
Subproject commit 54f1fa7ff0c9d18aea3790555dba6e533ce3749b
|
|
@ -1 +0,0 @@
|
|||||||
Subproject commit eb63666f35c259733d4c7fcec9adbd82e5a91dda
|
|
@ -1 +0,0 @@
|
|||||||
Subproject commit 2734901b014191f5a7f71c3f48678adf31239098
|
|
@ -1,211 +0,0 @@
|
|||||||
%YAML 1.2
|
|
||||||
---
|
|
||||||
# http://www.sublimetext.com/docs/syntax.html
|
|
||||||
name: Dart
|
|
||||||
file_extensions:
|
|
||||||
- dart
|
|
||||||
scope: source.dart
|
|
||||||
contexts:
|
|
||||||
main:
|
|
||||||
- match: ^(#!.*)$
|
|
||||||
scope: meta.preprocessor.script.dart
|
|
||||||
- match: ^\w*\b(library|import|part of|part|export)\b
|
|
||||||
captures:
|
|
||||||
0: keyword.other.import.dart
|
|
||||||
push:
|
|
||||||
- meta_scope: meta.declaration.dart
|
|
||||||
- match: ;
|
|
||||||
captures:
|
|
||||||
0: punctuation.terminator.dart
|
|
||||||
pop: true
|
|
||||||
- include: strings
|
|
||||||
- include: comments
|
|
||||||
- match: \b(as|show|hide)\b
|
|
||||||
scope: keyword.other.import.dart
|
|
||||||
- include: comments
|
|
||||||
- include: punctuation
|
|
||||||
- include: annotations
|
|
||||||
- include: keywords
|
|
||||||
- include: constants-and-special-vars
|
|
||||||
- include: strings
|
|
||||||
annotations:
|
|
||||||
- match: '@[a-zA-Z]+'
|
|
||||||
scope: storage.type.annotation.dart
|
|
||||||
comments:
|
|
||||||
- match: /\*\*/
|
|
||||||
scope: comment.block.empty.dart
|
|
||||||
captures:
|
|
||||||
0: punctuation.definition.comment.dart
|
|
||||||
- include: comments-doc-oldschool
|
|
||||||
- include: comments-doc
|
|
||||||
- include: comments-inline
|
|
||||||
comments-block:
|
|
||||||
- match: /\*
|
|
||||||
push:
|
|
||||||
- meta_scope: comment.block.dart
|
|
||||||
- match: \*/
|
|
||||||
pop: true
|
|
||||||
- include: comments-block
|
|
||||||
comments-doc:
|
|
||||||
- match: ///
|
|
||||||
push:
|
|
||||||
- meta_scope: comment.block.documentation.dart
|
|
||||||
- match: .*
|
|
||||||
pop: true
|
|
||||||
- include: dartdoc
|
|
||||||
comments-doc-oldschool:
|
|
||||||
- match: /\*\*
|
|
||||||
push:
|
|
||||||
- meta_scope: comment.block.documentation.dart
|
|
||||||
- match: \*/
|
|
||||||
pop: true
|
|
||||||
- include: comments-doc-oldschool
|
|
||||||
- include: comments-block
|
|
||||||
- include: dartdoc
|
|
||||||
comments-inline:
|
|
||||||
- include: comments-block
|
|
||||||
- match: ((//).*)$
|
|
||||||
captures:
|
|
||||||
1: comment.line.double-slash.dart
|
|
||||||
constants-and-special-vars:
|
|
||||||
- match: (?<!\$)\b(true|false|null)\b(?!\$)
|
|
||||||
scope: constant.language.dart
|
|
||||||
- match: (?<!\$)\b(this|super)\b(?!\$)
|
|
||||||
scope: variable.language.dart
|
|
||||||
- match: '(?<!\$)\b((0(x|X)[0-9a-fA-F]*)|(([0-9]+\.?[0-9]*)|(\.[0-9]+))((e|E)(\+|-)?[0-9]+)?)\b(?!\$)'
|
|
||||||
scope: constant.numeric.dart
|
|
||||||
- match: '(?<![a-zA-Z0-9_$])([_$]*[A-Z][a-zA-Z0-9_$]*|bool\b|num\b|int\b|double\b|dynamic\b)'
|
|
||||||
scope: support.class.dart
|
|
||||||
- match: '([_$]*[a-z][a-zA-Z0-9_$]*)(<|\(|\s+=>)'
|
|
||||||
captures:
|
|
||||||
1: entity.name.function.dart
|
|
||||||
dartdoc:
|
|
||||||
- match: '(\[.*?\])'
|
|
||||||
captures:
|
|
||||||
0: variable.name.source.dart
|
|
||||||
- match: '^ {4,}(?![ \*]).*'
|
|
||||||
captures:
|
|
||||||
0: variable.name.source.dart
|
|
||||||
- match: '```.*?$'
|
|
||||||
push:
|
|
||||||
- meta_content_scope: variable.other.source.dart
|
|
||||||
- match: '```'
|
|
||||||
pop: true
|
|
||||||
- match: (`.*?`)
|
|
||||||
captures:
|
|
||||||
0: variable.other.source.dart
|
|
||||||
- match: (`.*?`)
|
|
||||||
captures:
|
|
||||||
0: variable.other.source.dart
|
|
||||||
- match: (\* (( ).*))$
|
|
||||||
captures:
|
|
||||||
2: variable.other.source.dart
|
|
||||||
- match: (\* .*)$
|
|
||||||
keywords:
|
|
||||||
- match: (?<!\$)\bas\b(?!\$)
|
|
||||||
scope: keyword.cast.dart
|
|
||||||
- match: (?<!\$)\b(try|on|catch|finally|throw|rethrow)\b(?!\$)
|
|
||||||
scope: keyword.control.catch-exception.dart
|
|
||||||
- match: (?<!\$)\b(break|case|continue|default|do|else|for|if|in|return|switch|while)\b(?!\$)
|
|
||||||
scope: keyword.control.dart
|
|
||||||
- match: (?<!\$)\b(sync(\*)?|async(\*)?|await|yield(\*)?)\b(?!\$)
|
|
||||||
scope: keyword.control.dart
|
|
||||||
- match: (?<!\$)\bassert\b(?!\$)
|
|
||||||
scope: keyword.control.dart
|
|
||||||
- match: (?<!\$)\b(new)\b(?!\$)
|
|
||||||
scope: keyword.control.new.dart
|
|
||||||
- match: (?<!\$)\b(abstract|class|enum|extends|external|factory|implements|get|mixin|native|operator|set|typedef|with|covariant)\b(?!\$)
|
|
||||||
scope: keyword.declaration.dart
|
|
||||||
- match: (?<!\$)\b(is\!?)\b(?!\$)
|
|
||||||
scope: keyword.operator.dart
|
|
||||||
- match: '\?|:'
|
|
||||||
scope: keyword.operator.ternary.dart
|
|
||||||
- match: (<<|>>>?|~|\^|\||&)
|
|
||||||
scope: keyword.operator.bitwise.dart
|
|
||||||
- match: ((&|\^|\||<<|>>>?)=)
|
|
||||||
scope: keyword.operator.assignment.bitwise.dart
|
|
||||||
- match: (=>)
|
|
||||||
scope: keyword.operator.closure.dart
|
|
||||||
- match: (==|!=|<=?|>=?)
|
|
||||||
scope: keyword.operator.comparison.dart
|
|
||||||
- match: '(([+*/%-]|\~)=)'
|
|
||||||
scope: keyword.operator.assignment.arithmetic.dart
|
|
||||||
- match: (=)
|
|
||||||
scope: keyword.operator.assignment.dart
|
|
||||||
- match: (\-\-|\+\+)
|
|
||||||
scope: keyword.operator.increment-decrement.dart
|
|
||||||
- match: (\-|\+|\*|\/|\~\/|%)
|
|
||||||
scope: keyword.operator.arithmetic.dart
|
|
||||||
- match: (!|&&|\|\|)
|
|
||||||
scope: keyword.operator.logical.dart
|
|
||||||
- match: (?<!\$)\b(static|final|const)\b(?!\$)
|
|
||||||
scope: storage.modifier.dart
|
|
||||||
- match: (?<!\$)\b(?:void|var)\b(?!\$)
|
|
||||||
scope: storage.type.primitive.dart
|
|
||||||
punctuation:
|
|
||||||
- match: ','
|
|
||||||
scope: punctuation.comma.dart
|
|
||||||
- match: ;
|
|
||||||
scope: punctuation.terminator.dart
|
|
||||||
- match: \.
|
|
||||||
scope: punctuation.dot.dart
|
|
||||||
string-interp:
|
|
||||||
- match: '\$((\w+)|\{([^{}]+)\})'
|
|
||||||
captures:
|
|
||||||
2: variable.parameter.dart
|
|
||||||
3: variable.parameter.dart
|
|
||||||
- match: \\.
|
|
||||||
scope: constant.character.escape.dart
|
|
||||||
strings:
|
|
||||||
- match: (?<!r)"""
|
|
||||||
push:
|
|
||||||
- meta_scope: string.interpolated.triple.double.dart
|
|
||||||
- match: '"""(?!")'
|
|
||||||
pop: true
|
|
||||||
- include: string-interp
|
|
||||||
- match: (?<!r)'''
|
|
||||||
push:
|
|
||||||
- meta_scope: string.interpolated.triple.single.dart
|
|
||||||
- match: '''''''(?!'')'
|
|
||||||
pop: true
|
|
||||||
- include: string-interp
|
|
||||||
- match: r"""
|
|
||||||
push:
|
|
||||||
- meta_scope: string.quoted.triple.double.dart
|
|
||||||
- match: '"""(?!")'
|
|
||||||
pop: true
|
|
||||||
- match: r'''
|
|
||||||
push:
|
|
||||||
- meta_scope: string.quoted.triple.single.dart
|
|
||||||
- match: '''''''(?!'')'
|
|
||||||
pop: true
|
|
||||||
- match: (?<!\|r)"
|
|
||||||
push:
|
|
||||||
- meta_scope: string.interpolated.double.dart
|
|
||||||
- match: '"'
|
|
||||||
pop: true
|
|
||||||
- match: \n
|
|
||||||
scope: invalid.string.newline
|
|
||||||
- include: string-interp
|
|
||||||
- match: r"
|
|
||||||
push:
|
|
||||||
- meta_scope: string.quoted.double.dart
|
|
||||||
- match: '"'
|
|
||||||
pop: true
|
|
||||||
- match: \n
|
|
||||||
scope: invalid.string.newline
|
|
||||||
- match: (?<!\|r)'
|
|
||||||
push:
|
|
||||||
- meta_scope: string.interpolated.single.dart
|
|
||||||
- match: "'"
|
|
||||||
pop: true
|
|
||||||
- match: \n
|
|
||||||
scope: invalid.string.newline
|
|
||||||
- include: string-interp
|
|
||||||
- match: r'
|
|
||||||
push:
|
|
||||||
- meta_scope: string.quoted.single.dart
|
|
||||||
- match: "'"
|
|
||||||
pop: true
|
|
||||||
- match: \n
|
|
||||||
scope: invalid.string.newline
|
|
@ -1 +0,0 @@
|
|||||||
Subproject commit 0f6b7bc87acf684f7b0790fd480731ffb4615b87
|
|
@ -1 +0,0 @@
|
|||||||
Subproject commit 58201ba2abbbe6a12b2f6d0595efea3b388c1e38
|
|
@ -1,98 +0,0 @@
|
|||||||
%YAML 1.2
|
|
||||||
---
|
|
||||||
# http://www.sublimetext.com/docs/3/syntax.html
|
|
||||||
name: DotENV
|
|
||||||
file_extensions:
|
|
||||||
- .env
|
|
||||||
- .env.dist
|
|
||||||
- .env.local
|
|
||||||
- .env.sample
|
|
||||||
- .env.example
|
|
||||||
- .env.template
|
|
||||||
- .env.test
|
|
||||||
- .env.test.local
|
|
||||||
- .env.testing
|
|
||||||
- .env.dev
|
|
||||||
- .env.development
|
|
||||||
- .env.development.local
|
|
||||||
- .env.prod
|
|
||||||
- .env.production
|
|
||||||
- .env.production.local
|
|
||||||
- .env.dusk.local
|
|
||||||
- .env.staging
|
|
||||||
- .env.default
|
|
||||||
- .env.defaults
|
|
||||||
- .envrc
|
|
||||||
- .flaskenv
|
|
||||||
- env
|
|
||||||
- env.example
|
|
||||||
- env.sample
|
|
||||||
- env.template
|
|
||||||
scope: source.env
|
|
||||||
contexts:
|
|
||||||
main:
|
|
||||||
- match: (#).*$\n?
|
|
||||||
comment: "Comments - starts with #"
|
|
||||||
scope: comment.line.number-sign.env
|
|
||||||
captures:
|
|
||||||
1: punctuation.definition.comment.env
|
|
||||||
- match: (\")
|
|
||||||
comment: Strings (double)
|
|
||||||
captures:
|
|
||||||
1: punctuation.definition.string.begin.env
|
|
||||||
push:
|
|
||||||
- meta_scope: string.quoted.double.env
|
|
||||||
- match: (\")
|
|
||||||
captures:
|
|
||||||
1: punctuation.definition.string.end
|
|
||||||
pop: true
|
|
||||||
- include: interpolation
|
|
||||||
- include: variable
|
|
||||||
- include: escape-characters
|
|
||||||
- match: (\')
|
|
||||||
comment: Strings (single)
|
|
||||||
captures:
|
|
||||||
1: punctuation.definition.string.begin.env
|
|
||||||
push:
|
|
||||||
- meta_scope: string.quoted.single.env
|
|
||||||
- match: (\')
|
|
||||||
captures:
|
|
||||||
1: punctuation.definition.string.end
|
|
||||||
pop: true
|
|
||||||
- match: '(?<=[\w])\s?='
|
|
||||||
comment: Assignment Operator
|
|
||||||
scope: keyword.operator.assignment.env
|
|
||||||
- match: '([\w]+)(?=\s?\=)'
|
|
||||||
comment: Variable
|
|
||||||
scope: variable.other.env
|
|
||||||
- match: (?i)\s?(export)
|
|
||||||
comment: Keywords
|
|
||||||
scope: keyword.other.env
|
|
||||||
- match: (?i)(?<=\=)\s?(true|false|null)
|
|
||||||
comment: Constants
|
|
||||||
scope: constant.language.env
|
|
||||||
- match: '\b((0(x|X)[0-9a-fA-F]*)|(([0-9]+\.?[0-9]*)|(\.[0-9]+))((e|E)(\+|-)?[0-9]+)?)\b'
|
|
||||||
comment: Numeric
|
|
||||||
scope: constant.numeric.env
|
|
||||||
escape-characters:
|
|
||||||
- match: '\\[nrt\\\$\"\'']'
|
|
||||||
scope: constant.character.escape.env
|
|
||||||
interpolation:
|
|
||||||
- match: '(\$\{|\{)'
|
|
||||||
comment: 'Template Syntax: "foo ${bar} {$baz}"'
|
|
||||||
captures:
|
|
||||||
1: string.interpolated.env keyword.other.template.begin.env
|
|
||||||
push:
|
|
||||||
- match: '(\})'
|
|
||||||
captures:
|
|
||||||
1: string.interpolated.env keyword.other.template.end.env
|
|
||||||
pop: true
|
|
||||||
- match: '(?x)(\$+)?([a-zA-Z_\x{7f}-\x{ff}][a-zA-Z0-9_\x{7f}-\x{ff}]*?\b)'
|
|
||||||
captures:
|
|
||||||
1: punctuation.definition.variable.env variable.other.env
|
|
||||||
2: variable.other.env
|
|
||||||
variable:
|
|
||||||
- match: '(?x)(\$+)([a-zA-Z_\x{7f}-\x{ff}][a-zA-Z0-9_\x{7f}-\x{ff}]*?\b)'
|
|
||||||
captures:
|
|
||||||
1: punctuation.definition.variable.env variable.other.env
|
|
||||||
2: variable.other.env
|
|
@ -1 +0,0 @@
|
|||||||
Subproject commit 4fb01891dd17434dde42887bc821917a30f4e010
|
|
@ -1 +0,0 @@
|
|||||||
Subproject commit e266d279c8074aa342f106554cfa87ebe839a782
|
|
@ -1 +0,0 @@
|
|||||||
Subproject commit e89d09d440f342b753a490918f2c9777c64836b3
|
|
@ -1 +0,0 @@
|
|||||||
Subproject commit 9e4645c6085871d6fe4ae8dbcbafe93cb155b074
|
|
@ -1 +0,0 @@
|
|||||||
Subproject commit 98316d4332936f74babb51cb56161410ae9d6e2c
|
|
@ -1 +0,0 @@
|
|||||||
Subproject commit dcf4f24f1cecd9eebf6b1eb388e4f5db671a7b08
|
|
@ -1,135 +0,0 @@
|
|||||||
%YAML 1.2
|
|
||||||
---
|
|
||||||
# http://www.sublimetext.com/docs/3/syntax.html
|
|
||||||
name: fstab
|
|
||||||
file_extensions:
|
|
||||||
- fstab
|
|
||||||
- crypttab
|
|
||||||
- mtab
|
|
||||||
scope: source.fstab
|
|
||||||
|
|
||||||
contexts:
|
|
||||||
main:
|
|
||||||
- include: comment
|
|
||||||
- match: '^'
|
|
||||||
push: fstab_device
|
|
||||||
comment: leading spaces
|
|
||||||
|
|
||||||
fstab_device:
|
|
||||||
- include: comment
|
|
||||||
- match: '\s*([^=\s]+=)([^\s]+)\s*'
|
|
||||||
comment: device by uuid or label
|
|
||||||
set: fstab_mountpoint
|
|
||||||
captures:
|
|
||||||
1: punctuation.accessor
|
|
||||||
2: keyword.other.device
|
|
||||||
- match: '\s*(//|\\\\)([^\s]+)\s*'
|
|
||||||
comment: device by samba share
|
|
||||||
set: fstab_mountpoint
|
|
||||||
captures:
|
|
||||||
1: punctuation.accessor
|
|
||||||
2: keyword.other.device
|
|
||||||
- match: '\s*([^\s]+)(:)([^\s]+)\s*'
|
|
||||||
comment: device by server
|
|
||||||
set: fstab_mountpoint
|
|
||||||
captures:
|
|
||||||
1: keyword.other.device
|
|
||||||
2: punctuation.accessor
|
|
||||||
3: keyword.other.device
|
|
||||||
- match: '\s*[^\s/\\]+\s*'
|
|
||||||
comment: device by dev name
|
|
||||||
set: fstab_mountpoint
|
|
||||||
scope: keyword.other.device
|
|
||||||
- match: '\s*(/dev/)([^\s]+)\s*'
|
|
||||||
comment: device by dev path
|
|
||||||
set: fstab_mountpoint
|
|
||||||
captures:
|
|
||||||
1: punctuation.accessor
|
|
||||||
2: keyword.other.device
|
|
||||||
- match: '\s*([^\s/]*/)*([^\s]+)\s*'
|
|
||||||
comment: device by unknown path
|
|
||||||
set: fstab_mountpoint
|
|
||||||
captures:
|
|
||||||
1: punctuation.accessor
|
|
||||||
2: keyword.other.device
|
|
||||||
- include: clear
|
|
||||||
|
|
||||||
fstab_mountpoint:
|
|
||||||
- include: comment
|
|
||||||
- match: '\s*/[^\s]*\s*'
|
|
||||||
comment: mount point
|
|
||||||
set: fstab_filesystem
|
|
||||||
scope: string.unquoted.mountpoint
|
|
||||||
- match: '\s*[^\s]+\s*'
|
|
||||||
comment: mount point without leading slash (invalid)
|
|
||||||
set: fstab_filesystem
|
|
||||||
scope: invalid.illegal
|
|
||||||
- include: clear
|
|
||||||
|
|
||||||
fstab_filesystem:
|
|
||||||
- include: comment
|
|
||||||
- match: '\s*[^\s]+\s*'
|
|
||||||
comment: filesystem type
|
|
||||||
set: fstab_options
|
|
||||||
scope: variable.parameter.filesystem
|
|
||||||
- include: clear
|
|
||||||
|
|
||||||
fstab_options:
|
|
||||||
- include: comment
|
|
||||||
- match: '([^\s,=]+)(=)([^\s,]+)'
|
|
||||||
comment: key-value option
|
|
||||||
captures:
|
|
||||||
1: entity.name.option
|
|
||||||
2: entity.other.separator
|
|
||||||
3: variable.parameter
|
|
||||||
- match: '[^\s,]+'
|
|
||||||
comment: flag option
|
|
||||||
scope: entity.name.option
|
|
||||||
- match: ','
|
|
||||||
comment: option separator
|
|
||||||
scope: punctuation.separator
|
|
||||||
- match: '\s+'
|
|
||||||
comment: next field
|
|
||||||
set: fstab_dump
|
|
||||||
- include: clear
|
|
||||||
|
|
||||||
fstab_dump:
|
|
||||||
- include: comment
|
|
||||||
- match: '\s*[012]\s*'
|
|
||||||
comment: dump field
|
|
||||||
scope: constant.numeric
|
|
||||||
set: fstab_pass
|
|
||||||
- match: '\s*[^\s]+\s*'
|
|
||||||
comment: invalid dump field
|
|
||||||
scope: invalid.illegal
|
|
||||||
set: fstab_pass
|
|
||||||
- include: clear
|
|
||||||
|
|
||||||
fstab_pass:
|
|
||||||
- include: comment
|
|
||||||
- match: '\s*[012]\s*'
|
|
||||||
comment: pass field
|
|
||||||
scope: constant.numeric
|
|
||||||
set: expected_eol
|
|
||||||
- match: '\s*[^\s]+\s*'
|
|
||||||
comment: invalid pass field
|
|
||||||
scope: invalid.illegal
|
|
||||||
set: expected_eol
|
|
||||||
- include: clear
|
|
||||||
|
|
||||||
expected_eol:
|
|
||||||
- include: comment
|
|
||||||
- include: clear
|
|
||||||
- match: '.*'
|
|
||||||
scope: invalid.illegal
|
|
||||||
|
|
||||||
comment:
|
|
||||||
- match: '\s*#.*$'
|
|
||||||
comment: comment using the number sign
|
|
||||||
scope: comment.line
|
|
||||||
|
|
||||||
clear:
|
|
||||||
- match: '.*$'
|
|
||||||
comment: used for clearing the context
|
|
||||||
pop: true
|
|
||||||
|
|
@ -1 +0,0 @@
|
|||||||
Subproject commit 59a5f8a3120358657cefdc4b830b4a883ebfbf77
|
|
@ -1 +0,0 @@
|
|||||||
Subproject commit 9b6f6d0a86d7e7ef1d44490b107472af7fb4ffaf
|
|
@ -1 +0,0 @@
|
|||||||
Subproject commit 651091c7e266e05c0a529b137b6efd43d717894c
|
|
@ -1,48 +0,0 @@
|
|||||||
%YAML 1.2
|
|
||||||
---
|
|
||||||
# http://www.sublimetext.com/docs/3/syntax.html
|
|
||||||
name: group
|
|
||||||
file_extensions:
|
|
||||||
- group
|
|
||||||
scope: source.group
|
|
||||||
|
|
||||||
contexts:
|
|
||||||
main:
|
|
||||||
- comment: name
|
|
||||||
match: ^[^:]+
|
|
||||||
scope: keyword
|
|
||||||
|
|
||||||
- comment: password
|
|
||||||
match: ":"
|
|
||||||
push: password
|
|
||||||
|
|
||||||
password:
|
|
||||||
- comment: uid
|
|
||||||
match: ":"
|
|
||||||
set: gid
|
|
||||||
|
|
||||||
- comment: shadowpassword
|
|
||||||
match: "[^:]+"
|
|
||||||
scope: invalid
|
|
||||||
|
|
||||||
gid:
|
|
||||||
- comment: gid
|
|
||||||
match: ":"
|
|
||||||
set: users
|
|
||||||
|
|
||||||
- comment: number
|
|
||||||
match: "[0-9]+"
|
|
||||||
scope: constant.numeric
|
|
||||||
|
|
||||||
users:
|
|
||||||
- comment: newline
|
|
||||||
match: "\n"
|
|
||||||
pop: true
|
|
||||||
|
|
||||||
- comment: directory
|
|
||||||
match: "[^:\n]+"
|
|
||||||
scope: variable.parameter
|
|
||||||
|
|
||||||
- comment: separator
|
|
||||||
match: ","
|
|
||||||
scope: punctuation
|
|
@ -1 +0,0 @@
|
|||||||
Subproject commit aedf955eba9753554815b2cbef5e072415e42068
|
|
@ -1,662 +0,0 @@
|
|||||||
%YAML 1.2
|
|
||||||
---
|
|
||||||
# http://www.sublimetext.com/docs/3/syntax.html
|
|
||||||
name: HTML (Twig)
|
|
||||||
file_extensions:
|
|
||||||
- twig
|
|
||||||
- html.twig
|
|
||||||
scope: text.html.twig
|
|
||||||
contexts:
|
|
||||||
main:
|
|
||||||
- match: '(<)([a-zA-Z0-9:]++)(?=[^>]*></\2>)'
|
|
||||||
captures:
|
|
||||||
1: punctuation.definition.tag.html
|
|
||||||
2: entity.name.tag.html
|
|
||||||
push:
|
|
||||||
- meta_scope: meta.tag.any.html
|
|
||||||
- match: (>(<)/)(\2)(>)
|
|
||||||
captures:
|
|
||||||
1: punctuation.definition.tag.html
|
|
||||||
2: meta.scope.between-tag-pair.html
|
|
||||||
3: entity.name.tag.html
|
|
||||||
4: punctuation.definition.tag.html
|
|
||||||
pop: true
|
|
||||||
- include: tag-stuff
|
|
||||||
- match: (<\?)(xml)
|
|
||||||
captures:
|
|
||||||
1: punctuation.definition.tag.html
|
|
||||||
2: entity.name.tag.xml.html
|
|
||||||
push:
|
|
||||||
- meta_scope: meta.tag.preprocessor.xml.html
|
|
||||||
- match: (\?>)
|
|
||||||
captures:
|
|
||||||
1: punctuation.definition.tag.html
|
|
||||||
2: entity.name.tag.xml.html
|
|
||||||
pop: true
|
|
||||||
- include: tag-generic-attribute
|
|
||||||
- include: string-double-quoted
|
|
||||||
- include: string-single-quoted
|
|
||||||
- match: <!--
|
|
||||||
captures:
|
|
||||||
0: punctuation.definition.comment.html
|
|
||||||
push:
|
|
||||||
- meta_scope: comment.block.html
|
|
||||||
- match: '--\s*>'
|
|
||||||
captures:
|
|
||||||
0: punctuation.definition.comment.html
|
|
||||||
pop: true
|
|
||||||
- match: "--"
|
|
||||||
scope: invalid.illegal.bad-comments-or-CDATA.html
|
|
||||||
- include: embedded-code
|
|
||||||
- match: <!
|
|
||||||
captures:
|
|
||||||
0: punctuation.definition.tag.html
|
|
||||||
push:
|
|
||||||
- meta_scope: meta.tag.sgml.html
|
|
||||||
- match: ">"
|
|
||||||
captures:
|
|
||||||
0: punctuation.definition.tag.html
|
|
||||||
pop: true
|
|
||||||
- match: (?i:DOCTYPE)
|
|
||||||
captures:
|
|
||||||
1: entity.name.tag.doctype.html
|
|
||||||
push:
|
|
||||||
- meta_scope: meta.tag.sgml.doctype.html
|
|
||||||
- match: (?=>)
|
|
||||||
captures:
|
|
||||||
1: entity.name.tag.doctype.html
|
|
||||||
pop: true
|
|
||||||
- match: '"[^">]*"'
|
|
||||||
scope: string.quoted.double.doctype.identifiers-and-DTDs.html
|
|
||||||
- match: '\[CDATA\['
|
|
||||||
push:
|
|
||||||
- meta_scope: constant.other.inline-data.html
|
|
||||||
- match: "]](?=>)"
|
|
||||||
pop: true
|
|
||||||
- match: (\s*)(?!--|>)\S(\s*)
|
|
||||||
scope: invalid.illegal.bad-comments-or-CDATA.html
|
|
||||||
- include: embedded-code
|
|
||||||
- match: '(?:^\s+)?(<)((?i:style))\b(?![^>]*/>)'
|
|
||||||
captures:
|
|
||||||
1: punctuation.definition.tag.html
|
|
||||||
2: entity.name.tag.style.html
|
|
||||||
3: punctuation.definition.tag.html
|
|
||||||
push:
|
|
||||||
- meta_scope: source.css.embedded.html
|
|
||||||
- match: (</)((?i:style))(>)(?:\s*\n)?
|
|
||||||
captures:
|
|
||||||
1: punctuation.definition.tag.html
|
|
||||||
2: entity.name.tag.style.html
|
|
||||||
3: punctuation.definition.tag.html
|
|
||||||
pop: true
|
|
||||||
- include: tag-stuff
|
|
||||||
- match: (>)
|
|
||||||
captures:
|
|
||||||
1: punctuation.definition.tag.html
|
|
||||||
push:
|
|
||||||
- match: (?=</(?i:style))
|
|
||||||
pop: true
|
|
||||||
- include: embedded-code
|
|
||||||
- include: scope:source.css
|
|
||||||
- match: '(?:^\s+)?(<)((?i:script))\b(?![^>]*/>)'
|
|
||||||
captures:
|
|
||||||
1: punctuation.definition.tag.html
|
|
||||||
2: entity.name.tag.script.html
|
|
||||||
push:
|
|
||||||
- meta_scope: source.js.embedded.html
|
|
||||||
- match: (?<=</(script|SCRIPT))(>)(?:\s*\n)?
|
|
||||||
captures:
|
|
||||||
2: punctuation.definition.tag.html
|
|
||||||
pop: true
|
|
||||||
- include: tag-stuff
|
|
||||||
- match: (?<!</(?:script|SCRIPT))(>)
|
|
||||||
captures:
|
|
||||||
1: punctuation.definition.tag.html
|
|
||||||
2: entity.name.tag.script.html
|
|
||||||
push:
|
|
||||||
- match: (</)((?i:script))
|
|
||||||
captures:
|
|
||||||
1: punctuation.definition.tag.html
|
|
||||||
2: entity.name.tag.script.html
|
|
||||||
pop: true
|
|
||||||
- match: (//).*?((?=</script)|$\n?)
|
|
||||||
scope: comment.line.double-slash.js
|
|
||||||
captures:
|
|
||||||
1: punctuation.definition.comment.js
|
|
||||||
- match: /\*
|
|
||||||
captures:
|
|
||||||
0: punctuation.definition.comment.js
|
|
||||||
push:
|
|
||||||
- meta_scope: comment.block.js
|
|
||||||
- match: \*/|(?=</script)
|
|
||||||
captures:
|
|
||||||
0: punctuation.definition.comment.js
|
|
||||||
pop: true
|
|
||||||
- include: php
|
|
||||||
- include: twig-print-tag
|
|
||||||
- include: twig-statement-tag
|
|
||||||
- include: twig-comment-tag
|
|
||||||
- include: scope:source.js
|
|
||||||
- match: (</?)((?i:body|head|html)\b)
|
|
||||||
captures:
|
|
||||||
1: punctuation.definition.tag.html
|
|
||||||
2: entity.name.tag.structure.any.html
|
|
||||||
push:
|
|
||||||
- meta_scope: meta.tag.structure.any.html
|
|
||||||
- match: (>)
|
|
||||||
captures:
|
|
||||||
1: punctuation.definition.tag.html
|
|
||||||
2: entity.name.tag.structure.any.html
|
|
||||||
pop: true
|
|
||||||
- include: tag-stuff
|
|
||||||
- match: (</?)((?i:address|blockquote|dd|div|dl|dt|fieldset|form|frame|frameset|h1|h2|h3|h4|h5|h6|iframe|noframes|object|ol|p|ul|applet|center|dir|hr|menu|pre)\b)
|
|
||||||
captures:
|
|
||||||
1: punctuation.definition.tag.begin.html
|
|
||||||
2: entity.name.tag.block.any.html
|
|
||||||
push:
|
|
||||||
- meta_scope: meta.tag.block.any.html
|
|
||||||
- match: (>)
|
|
||||||
captures:
|
|
||||||
1: punctuation.definition.tag.end.html
|
|
||||||
pop: true
|
|
||||||
- include: tag-stuff
|
|
||||||
- match: (</?)((?i:a|abbr|acronym|area|b|base|basefont|bdo|big|br|button|caption|cite|code|col|colgroup|del|dfn|em|font|head|html|i|img|input|ins|isindex|kbd|label|legend|li|link|map|meta|noscript|optgroup|option|param|q|s|samp|script|select|small|span|strike|strong|style|sub|sup|table|tbody|td|textarea|tfoot|th|thead|title|tr|tt|u|var)\b)
|
|
||||||
captures:
|
|
||||||
1: punctuation.definition.tag.begin.html
|
|
||||||
2: entity.name.tag.inline.any.html
|
|
||||||
push:
|
|
||||||
- meta_scope: meta.tag.inline.any.html
|
|
||||||
- match: "((?: ?/)?>)"
|
|
||||||
captures:
|
|
||||||
1: punctuation.definition.tag.end.html
|
|
||||||
pop: true
|
|
||||||
- include: tag-stuff
|
|
||||||
- match: "(</?)([a-zA-Z0-9:]+)"
|
|
||||||
captures:
|
|
||||||
1: punctuation.definition.tag.begin.html
|
|
||||||
2: entity.name.tag.other.html
|
|
||||||
push:
|
|
||||||
- meta_scope: meta.tag.other.html
|
|
||||||
- match: (>)
|
|
||||||
captures:
|
|
||||||
1: punctuation.definition.tag.end.html
|
|
||||||
pop: true
|
|
||||||
- include: tag-stuff
|
|
||||||
- include: entities
|
|
||||||
- match: <>
|
|
||||||
scope: invalid.illegal.incomplete.html
|
|
||||||
- match: <
|
|
||||||
scope: invalid.illegal.bad-angle-bracket.html
|
|
||||||
- include: twig-print-tag
|
|
||||||
- include: twig-statement-tag
|
|
||||||
- include: twig-comment-tag
|
|
||||||
embedded-code:
|
|
||||||
- include: ruby
|
|
||||||
- include: php
|
|
||||||
- include: twig-print-tag
|
|
||||||
- include: twig-statement-tag
|
|
||||||
- include: twig-comment-tag
|
|
||||||
- include: python
|
|
||||||
entities:
|
|
||||||
- match: "(&)([a-zA-Z0-9]+|#[0-9]+|#x[0-9a-fA-F]+)(;)"
|
|
||||||
scope: constant.character.entity.html
|
|
||||||
captures:
|
|
||||||
1: punctuation.definition.entity.html
|
|
||||||
3: punctuation.definition.entity.html
|
|
||||||
- match: "&"
|
|
||||||
scope: invalid.illegal.bad-ampersand.html
|
|
||||||
php:
|
|
||||||
- match: (?=(^\s*)?<\?)
|
|
||||||
push:
|
|
||||||
- match: (?!(^\s*)?<\?)
|
|
||||||
pop: true
|
|
||||||
- include: scope:text.html.php
|
|
||||||
python:
|
|
||||||
- match: (?:^\s*)<\?python(?!.*\?>)
|
|
||||||
push:
|
|
||||||
- meta_scope: source.python.embedded.html
|
|
||||||
- match: \?>(?:\s*$\n)?
|
|
||||||
pop: true
|
|
||||||
- include: scope:source.python
|
|
||||||
ruby:
|
|
||||||
- match: "<%+#"
|
|
||||||
captures:
|
|
||||||
0: punctuation.definition.comment.erb
|
|
||||||
push:
|
|
||||||
- meta_scope: comment.block.erb
|
|
||||||
- match: "%>"
|
|
||||||
captures:
|
|
||||||
0: punctuation.definition.comment.erb
|
|
||||||
pop: true
|
|
||||||
- match: <%+(?!>)=?
|
|
||||||
captures:
|
|
||||||
0: punctuation.section.embedded.ruby
|
|
||||||
push:
|
|
||||||
- meta_scope: source.ruby.embedded.html
|
|
||||||
- match: "-?%>"
|
|
||||||
captures:
|
|
||||||
0: punctuation.section.embedded.ruby
|
|
||||||
pop: true
|
|
||||||
- match: (#).*?(?=-?%>)
|
|
||||||
scope: comment.line.number-sign.ruby
|
|
||||||
captures:
|
|
||||||
1: punctuation.definition.comment.ruby
|
|
||||||
- include: scope:source.ruby
|
|
||||||
- match: <\?r(?!>)=?
|
|
||||||
captures:
|
|
||||||
0: punctuation.section.embedded.ruby.nitro
|
|
||||||
push:
|
|
||||||
- meta_scope: source.ruby.nitro.embedded.html
|
|
||||||
- match: '-?\?>'
|
|
||||||
captures:
|
|
||||||
0: punctuation.section.embedded.ruby.nitro
|
|
||||||
pop: true
|
|
||||||
- match: (#).*?(?=-?\?>)
|
|
||||||
scope: comment.line.number-sign.ruby.nitro
|
|
||||||
captures:
|
|
||||||
1: punctuation.definition.comment.ruby.nitro
|
|
||||||
- include: scope:source.ruby
|
|
||||||
string-double-quoted:
|
|
||||||
- match: '"'
|
|
||||||
captures:
|
|
||||||
0: punctuation.definition.string.begin.html
|
|
||||||
push:
|
|
||||||
- meta_scope: string.quoted.double.html
|
|
||||||
- match: '"'
|
|
||||||
captures:
|
|
||||||
0: punctuation.definition.string.end.html
|
|
||||||
pop: true
|
|
||||||
- include: embedded-code
|
|
||||||
- include: entities
|
|
||||||
string-single-quoted:
|
|
||||||
- match: "'"
|
|
||||||
captures:
|
|
||||||
0: punctuation.definition.string.begin.html
|
|
||||||
push:
|
|
||||||
- meta_scope: string.quoted.single.html
|
|
||||||
- match: "'"
|
|
||||||
captures:
|
|
||||||
0: punctuation.definition.string.end.html
|
|
||||||
pop: true
|
|
||||||
- include: embedded-code
|
|
||||||
- include: entities
|
|
||||||
tag-generic-attribute:
|
|
||||||
- match: '\b([a-zA-Z\-:]+)'
|
|
||||||
scope: entity.other.attribute-name.html
|
|
||||||
tag-id-attribute:
|
|
||||||
- match: \b(id)\b\s*(=)
|
|
||||||
captures:
|
|
||||||
1: entity.other.attribute-name.id.html
|
|
||||||
2: punctuation.separator.key-value.html
|
|
||||||
push:
|
|
||||||
- meta_scope: meta.attribute-with-value.id.html
|
|
||||||
- match: (?<='|")
|
|
||||||
captures:
|
|
||||||
1: entity.other.attribute-name.id.html
|
|
||||||
2: punctuation.separator.key-value.html
|
|
||||||
pop: true
|
|
||||||
- match: '"'
|
|
||||||
captures:
|
|
||||||
0: punctuation.definition.string.begin.html
|
|
||||||
push:
|
|
||||||
- meta_scope: string.quoted.double.html
|
|
||||||
- meta_content_scope: meta.toc-list.id.html
|
|
||||||
- match: '"'
|
|
||||||
captures:
|
|
||||||
0: punctuation.definition.string.end.html
|
|
||||||
pop: true
|
|
||||||
- include: embedded-code
|
|
||||||
- include: entities
|
|
||||||
- match: "'"
|
|
||||||
captures:
|
|
||||||
0: punctuation.definition.string.begin.html
|
|
||||||
push:
|
|
||||||
- meta_scope: string.quoted.single.html
|
|
||||||
- meta_content_scope: meta.toc-list.id.html
|
|
||||||
- match: "'"
|
|
||||||
captures:
|
|
||||||
0: punctuation.definition.string.end.html
|
|
||||||
pop: true
|
|
||||||
- include: embedded-code
|
|
||||||
- include: entities
|
|
||||||
tag-stuff:
|
|
||||||
- include: tag-id-attribute
|
|
||||||
- include: tag-generic-attribute
|
|
||||||
- include: string-double-quoted
|
|
||||||
- include: string-single-quoted
|
|
||||||
- include: embedded-code
|
|
||||||
twig-arrays:
|
|
||||||
- match: '(?<=[\s\(\{\[:,])\['
|
|
||||||
captures:
|
|
||||||
0: punctuation.section.array.begin.twig
|
|
||||||
push:
|
|
||||||
- meta_scope: meta.array.twig
|
|
||||||
- match: '\]'
|
|
||||||
captures:
|
|
||||||
0: punctuation.section.array.end.twig
|
|
||||||
pop: true
|
|
||||||
- include: twig-arrays
|
|
||||||
- include: twig-hashes
|
|
||||||
- include: twig-constants
|
|
||||||
- include: twig-strings
|
|
||||||
- include: twig-functions-warg
|
|
||||||
- include: twig-functions
|
|
||||||
- include: twig-macros
|
|
||||||
- include: twig-objects
|
|
||||||
- include: twig-properties
|
|
||||||
- include: twig-filters-warg
|
|
||||||
- include: twig-filters
|
|
||||||
- include: twig-filters-warg-ud
|
|
||||||
- include: twig-filters-ud
|
|
||||||
- match: ","
|
|
||||||
scope: punctuation.separator.object.twig
|
|
||||||
twig-comment-tag:
|
|
||||||
- match: '\{#-?'
|
|
||||||
captures:
|
|
||||||
0: punctuation.definition.comment.begin.twig
|
|
||||||
push:
|
|
||||||
- meta_scope: comment.block.twig
|
|
||||||
- match: '-?#\}'
|
|
||||||
captures:
|
|
||||||
0: punctuation.definition.comment.end.twig
|
|
||||||
pop: true
|
|
||||||
twig-constants:
|
|
||||||
- match: '(?i)(?<=[\s\[\(\{:,])(?:true|false|null|none)(?=[\s\)\]\}\,])'
|
|
||||||
scope: constant.language.twig
|
|
||||||
- match: '(?<=[\s\[\(\{:,]|\.\.|\*\*)[0-9]+(?:\.[0-9]+)?(?=[\s\)\]\}\,]|\.\.|\*\*)'
|
|
||||||
scope: constant.numeric.twig
|
|
||||||
twig-filters:
|
|
||||||
- match: '(?<=(?:[a-zA-Z0-9_\x{7f}-\x{ff}\]\)\''\"]\|)|\{%\sfilter\s)(abs|capitalize|e(?:scape)?|first|join|(?:json|url)_encode|keys|last|length|lower|nl2br|number_format|raw|reverse|round|sort|striptags|title|trim|upper)(?=[\s\|\]\}\):,]|\.\.|\*\*)'
|
|
||||||
captures:
|
|
||||||
1: support.function.twig
|
|
||||||
twig-filters-ud:
|
|
||||||
- match: '(?<=(?:[a-zA-Z0-9_\x{7f}-\x{ff}\]\)\''\"]\|)|\{%\sfilter\s)([a-zA-Z_\x{7f}-\x{ff}][a-zA-Z0-9_\x{7f}-\x{ff}]*)'
|
|
||||||
captures:
|
|
||||||
1: meta.function-call.other.twig
|
|
||||||
twig-filters-warg:
|
|
||||||
- match: '(?<=(?:[a-zA-Z0-9_\x{7f}-\x{ff}\]\)\''\"]\|)|\{%\sfilter\s)(batch|convert_encoding|date|date_modify|default|e(?:scape)?|format|join|merge|number_format|replace|round|slice|split|trim)(\()'
|
|
||||||
captures:
|
|
||||||
1: support.function.twig
|
|
||||||
2: punctuation.definition.parameters.begin.twig
|
|
||||||
push:
|
|
||||||
- meta_content_scope: meta.function.arguments.twig
|
|
||||||
- match: \)
|
|
||||||
captures:
|
|
||||||
0: punctuation.definition.parameters.end.twig
|
|
||||||
pop: true
|
|
||||||
- include: twig-constants
|
|
||||||
- include: twig-functions-warg
|
|
||||||
- include: twig-functions
|
|
||||||
- include: twig-macros
|
|
||||||
- include: twig-objects
|
|
||||||
- include: twig-properties
|
|
||||||
- include: twig-filters-warg
|
|
||||||
- include: twig-filters
|
|
||||||
- include: twig-filters-warg-ud
|
|
||||||
- include: twig-filters-ud
|
|
||||||
- include: twig-strings
|
|
||||||
- include: twig-arrays
|
|
||||||
- include: twig-hashes
|
|
||||||
twig-filters-warg-ud:
|
|
||||||
- match: '(?<=(?:[a-zA-Z0-9_\x{7f}-\x{ff}\]\)\''\"]\|)|\{%\sfilter\s)([a-zA-Z_\x{7f}-\x{ff}][a-zA-Z0-9_\x{7f}-\x{ff}]*)(\()'
|
|
||||||
captures:
|
|
||||||
1: meta.function-call.other.twig
|
|
||||||
2: punctuation.definition.parameters.begin.twig
|
|
||||||
push:
|
|
||||||
- meta_content_scope: meta.function.arguments.twig
|
|
||||||
- match: \)
|
|
||||||
captures:
|
|
||||||
0: punctuation.definition.parameters.end.twig
|
|
||||||
pop: true
|
|
||||||
- include: twig-constants
|
|
||||||
- include: twig-functions-warg
|
|
||||||
- include: twig-functions
|
|
||||||
- include: twig-macros
|
|
||||||
- include: twig-objects
|
|
||||||
- include: twig-properties
|
|
||||||
- include: twig-filters-warg
|
|
||||||
- include: twig-filters
|
|
||||||
- include: twig-filters-warg-ud
|
|
||||||
- include: twig-filters-ud
|
|
||||||
- include: twig-strings
|
|
||||||
- include: twig-arrays
|
|
||||||
- include: twig-hashes
|
|
||||||
twig-functions:
|
|
||||||
- match: (?<=is\s)(defined|empty|even|iterable|odd)
|
|
||||||
captures:
|
|
||||||
1: support.function.twig
|
|
||||||
twig-functions-warg:
|
|
||||||
- match: '(?<=[\s\(\[\{:,])(attribute|block|constant|cycle|date|divisible by|dump|include|max|min|parent|random|range|same as|source|template_from_string)(\()'
|
|
||||||
captures:
|
|
||||||
1: support.function.twig
|
|
||||||
2: punctuation.definition.parameters.begin.twig
|
|
||||||
push:
|
|
||||||
- meta_content_scope: meta.function.arguments.twig
|
|
||||||
- match: \)
|
|
||||||
captures:
|
|
||||||
0: punctuation.definition.parameters.end.twig
|
|
||||||
pop: true
|
|
||||||
- include: twig-constants
|
|
||||||
- include: twig-functions-warg
|
|
||||||
- include: twig-functions
|
|
||||||
- include: twig-macros
|
|
||||||
- include: twig-objects
|
|
||||||
- include: twig-properties
|
|
||||||
- include: twig-filters-warg
|
|
||||||
- include: twig-filters
|
|
||||||
- include: twig-filters-warg-ud
|
|
||||||
- include: twig-filters-ud
|
|
||||||
- include: twig-strings
|
|
||||||
- include: twig-arrays
|
|
||||||
twig-hashes:
|
|
||||||
- match: '(?<=[\s\(\{\[:,])\{'
|
|
||||||
captures:
|
|
||||||
0: punctuation.section.hash.begin.twig
|
|
||||||
push:
|
|
||||||
- meta_scope: meta.hash.twig
|
|
||||||
- match: '\}'
|
|
||||||
captures:
|
|
||||||
0: punctuation.section.hash.end.twig
|
|
||||||
pop: true
|
|
||||||
- include: twig-hashes
|
|
||||||
- include: twig-arrays
|
|
||||||
- include: twig-constants
|
|
||||||
- include: twig-strings
|
|
||||||
- include: twig-functions-warg
|
|
||||||
- include: twig-functions
|
|
||||||
- include: twig-macros
|
|
||||||
- include: twig-objects
|
|
||||||
- include: twig-properties
|
|
||||||
- include: twig-filters-warg
|
|
||||||
- include: twig-filters
|
|
||||||
- include: twig-filters-warg-ud
|
|
||||||
- include: twig-filters-ud
|
|
||||||
- match: ":"
|
|
||||||
scope: punctuation.separator.key-value.twig
|
|
||||||
- match: ","
|
|
||||||
scope: punctuation.separator.object.twig
|
|
||||||
twig-keywords:
|
|
||||||
- match: (?<=\s)((?:end)?(?:autoescape|block|embed|filter|for|if|macro|raw|sandbox|set|spaceless|trans|verbatim)|as|do|else|elseif|extends|flush|from|ignore missing|import|include|only|use|with)(?=\s)
|
|
||||||
scope: keyword.control.twig
|
|
||||||
twig-macros:
|
|
||||||
- match: |-
|
|
||||||
(?x)
|
|
||||||
(?<=[\s\(\[\{:,])
|
|
||||||
([a-zA-Z_\x{7f}-\x{ff}][a-zA-Z0-9_\x{7f}-\x{ff}]*)
|
|
||||||
(?:
|
|
||||||
(\.)([a-zA-Z_\x{7f}-\x{ff}][a-zA-Z0-9_\x{7f}-\x{ff}]*)
|
|
||||||
)?
|
|
||||||
(\()
|
|
||||||
captures:
|
|
||||||
1: meta.function-call.twig
|
|
||||||
2: punctuation.separator.property.twig
|
|
||||||
3: variable.other.property.twig
|
|
||||||
4: punctuation.definition.parameters.begin.twig
|
|
||||||
push:
|
|
||||||
- meta_content_scope: meta.function.arguments.twig
|
|
||||||
- match: \)
|
|
||||||
captures:
|
|
||||||
0: punctuation.definition.parameters.end.twig
|
|
||||||
pop: true
|
|
||||||
- include: twig-constants
|
|
||||||
- include: twig-operators
|
|
||||||
- include: twig-functions-warg
|
|
||||||
- include: twig-functions
|
|
||||||
- include: twig-macros
|
|
||||||
- include: twig-objects
|
|
||||||
- include: twig-properties
|
|
||||||
- include: twig-filters-warg
|
|
||||||
- include: twig-filters
|
|
||||||
- include: twig-filters-warg-ud
|
|
||||||
- include: twig-filters-ud
|
|
||||||
- include: twig-strings
|
|
||||||
- include: twig-arrays
|
|
||||||
- include: twig-hashes
|
|
||||||
twig-objects:
|
|
||||||
- match: '(?<=[\s\{\[\(:,])([a-zA-Z_\x{7f}-\x{ff}][a-zA-Z0-9_\x{7f}-\x{ff}]*)(?=[\s\}\[\]\(\)\.\|,:])'
|
|
||||||
captures:
|
|
||||||
1: variable.other.twig
|
|
||||||
twig-operators:
|
|
||||||
- match: (?<=\s)(\+|-|//?|%|\*\*?)(?=\s)
|
|
||||||
captures:
|
|
||||||
1: keyword.operator.arithmetic.twig
|
|
||||||
- match: (?<=\s)(=|~)(?=\s)
|
|
||||||
captures:
|
|
||||||
1: keyword.operator.assignment.twig
|
|
||||||
- match: (?<=\s)(b-(?:and|or|xor))(?=\s)
|
|
||||||
captures:
|
|
||||||
1: keyword.operator.bitwise.twig
|
|
||||||
- match: '(?<=\s)((?:!|=)=|<=?|>=?|(?:not )?in|is(?: not)?|(?:ends|starts) with|matches)(?=\s)'
|
|
||||||
captures:
|
|
||||||
1: keyword.operator.comparison.twig
|
|
||||||
- match: (?<=\s)(\?|:|and|not|or)(?=\s)
|
|
||||||
captures:
|
|
||||||
1: keyword.operator.logical.twig
|
|
||||||
- match: '(?<=[a-zA-Z0-9_\x{7f}-\x{ff}\]\)''"])\.\.(?=[a-zA-Z0-9_\x{7f}-\x{ff}''"])'
|
|
||||||
captures:
|
|
||||||
0: keyword.operator.other.twig
|
|
||||||
- match: '(?<=[a-zA-Z0-9_\x{7f}-\x{ff}\]\}\)''"])\|(?=[a-zA-Z_\x{7f}-\x{ff}])'
|
|
||||||
captures:
|
|
||||||
0: keyword.operator.other.twig
|
|
||||||
twig-print-tag:
|
|
||||||
- match: '\{\{-?'
|
|
||||||
captures:
|
|
||||||
0: punctuation.section.tag.twig
|
|
||||||
push:
|
|
||||||
- meta_scope: meta.tag.template.value.twig
|
|
||||||
- match: '-?\}\}'
|
|
||||||
captures:
|
|
||||||
0: punctuation.section.tag.twig
|
|
||||||
pop: true
|
|
||||||
- include: twig-constants
|
|
||||||
- include: twig-operators
|
|
||||||
- include: twig-functions-warg
|
|
||||||
- include: twig-functions
|
|
||||||
- include: twig-macros
|
|
||||||
- include: twig-objects
|
|
||||||
- include: twig-properties
|
|
||||||
- include: twig-filters-warg
|
|
||||||
- include: twig-filters
|
|
||||||
- include: twig-filters-warg-ud
|
|
||||||
- include: twig-filters-ud
|
|
||||||
- include: twig-strings
|
|
||||||
- include: twig-arrays
|
|
||||||
- include: twig-hashes
|
|
||||||
twig-properties:
|
|
||||||
- match: |-
|
|
||||||
(?x)
|
|
||||||
(?<=[a-zA-Z0-9_\x{7f}-\x{ff}])
|
|
||||||
(\.)([a-zA-Z_\x{7f}-\x{ff}][a-zA-Z0-9_\x{7f}-\x{ff}]*)
|
|
||||||
(?=[\.\s\|\[\)\]\}:,])
|
|
||||||
captures:
|
|
||||||
1: punctuation.separator.property.twig
|
|
||||||
2: variable.other.property.twig
|
|
||||||
- match: |-
|
|
||||||
(?x)
|
|
||||||
(?<=[a-zA-Z0-9_\x{7f}-\x{ff}])
|
|
||||||
(\.)([a-zA-Z_\x{7f}-\x{ff}][a-zA-Z0-9_\x{7f}-\x{ff}]*)
|
|
||||||
(\()
|
|
||||||
captures:
|
|
||||||
1: punctuation.separator.property.twig
|
|
||||||
2: variable.other.property.twig
|
|
||||||
3: punctuation.definition.parameters.begin.twig
|
|
||||||
push:
|
|
||||||
- meta_content_scope: meta.function.arguments.twig
|
|
||||||
- match: \)
|
|
||||||
captures:
|
|
||||||
0: punctuation.definition.parameters.end.twig
|
|
||||||
pop: true
|
|
||||||
- include: twig-constants
|
|
||||||
- include: twig-functions-warg
|
|
||||||
- include: twig-functions
|
|
||||||
- include: twig-macros
|
|
||||||
- include: twig-objects
|
|
||||||
- include: twig-properties
|
|
||||||
- include: twig-filters-warg
|
|
||||||
- include: twig-filters
|
|
||||||
- include: twig-filters-warg-ud
|
|
||||||
- include: twig-filters-ud
|
|
||||||
- include: twig-strings
|
|
||||||
- include: twig-arrays
|
|
||||||
- match: |-
|
|
||||||
(?x)
|
|
||||||
(?<=[a-zA-Z0-9_\x{7f}-\x{ff}\]])
|
|
||||||
(?:
|
|
||||||
(\[)('[a-zA-Z_\x{7f}-\x{ff}][a-zA-Z0-9_\x{7f}-\x{ff}]*')(\])
|
|
||||||
|(\[)("[a-zA-Z_\x{7f}-\x{ff}][a-zA-Z0-9_\x{7f}-\x{ff}]*")(\])
|
|
||||||
|(\[)([a-zA-Z_\x{7f}-\x{ff}][a-zA-Z0-9_\x{7f}-\x{ff}]*)(\])
|
|
||||||
)
|
|
||||||
captures:
|
|
||||||
1: punctuation.section.array.begin.twig
|
|
||||||
2: variable.other.property.twig
|
|
||||||
3: punctuation.section.array.end.twig
|
|
||||||
4: punctuation.section.array.begin.twig
|
|
||||||
5: variable.other.property.twig
|
|
||||||
6: punctuation.section.array.end.twig
|
|
||||||
7: punctuation.section.array.begin.twig
|
|
||||||
8: variable.other.property.twig
|
|
||||||
9: punctuation.section.array.end.twig
|
|
||||||
twig-statement-tag:
|
|
||||||
- match: '\{%-?'
|
|
||||||
captures:
|
|
||||||
0: punctuation.section.tag.twig
|
|
||||||
push:
|
|
||||||
- meta_scope: meta.tag.template.block.twig
|
|
||||||
- match: '-?%\}'
|
|
||||||
captures:
|
|
||||||
0: punctuation.section.tag.twig
|
|
||||||
pop: true
|
|
||||||
- include: twig-constants
|
|
||||||
- include: twig-keywords
|
|
||||||
- include: twig-operators
|
|
||||||
- include: twig-functions-warg
|
|
||||||
- include: twig-functions
|
|
||||||
- include: twig-macros
|
|
||||||
- include: twig-filters-warg
|
|
||||||
- include: twig-filters
|
|
||||||
- include: twig-filters-warg-ud
|
|
||||||
- include: twig-filters-ud
|
|
||||||
- include: twig-objects
|
|
||||||
- include: twig-properties
|
|
||||||
- include: twig-strings
|
|
||||||
- include: twig-arrays
|
|
||||||
- include: twig-hashes
|
|
||||||
twig-strings:
|
|
||||||
- match: (?:(?<!\\)|(?<=\\\\))'
|
|
||||||
captures:
|
|
||||||
0: punctuation.definition.string.begin.twig
|
|
||||||
push:
|
|
||||||
- meta_scope: string.quoted.single.twig
|
|
||||||
- match: (?:(?<!\\)|(?<=\\\\))'
|
|
||||||
captures:
|
|
||||||
0: punctuation.definition.string.end.twig
|
|
||||||
pop: true
|
|
||||||
- match: (?:(?<!\\)|(?<=\\\\))"
|
|
||||||
captures:
|
|
||||||
0: punctuation.definition.string.begin.twig
|
|
||||||
push:
|
|
||||||
- meta_scope: string.quoted.double.twig
|
|
||||||
- match: (?:(?<!\\)|(?<=\\\\))"
|
|
||||||
captures:
|
|
||||||
0: punctuation.definition.string.end.twig
|
|
||||||
pop: true
|
|
@ -1,23 +0,0 @@
|
|||||||
%YAML 1.2
|
|
||||||
---
|
|
||||||
# http://www.sublimetext.com/docs/3/syntax.html
|
|
||||||
name: hosts
|
|
||||||
file_extensions:
|
|
||||||
- hosts
|
|
||||||
scope: source.hosts
|
|
||||||
|
|
||||||
contexts:
|
|
||||||
main:
|
|
||||||
- scope: comment.line.number-sign
|
|
||||||
match: \#.*
|
|
||||||
comment: comment
|
|
||||||
|
|
||||||
- match: ^\s*([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}|[0-9a-f:]+)
|
|
||||||
comment: ipaddress
|
|
||||||
scope: constant.numeric.ipaddress
|
|
||||||
|
|
||||||
|
|
||||||
- match: \s(localhost|ip6-loopback|ip6-localhost|ip6-localnet|ip6-mcastprefix|ip6-allnodes|ip6-allrouters|ip6-allhosts|broadcasthost)\b
|
|
||||||
scope: keyword.host.predefined}
|
|
||||||
comment: prefdfined
|
|
||||||
|
|
@ -1 +0,0 @@
|
|||||||
Subproject commit f4579f9107996c16208466248a85dc2296083a5f
|
|
@ -1 +0,0 @@
|
|||||||
Subproject commit 45355633d17ee562481ca1d2ad0e3502c238f58a
|
|
@ -1 +0,0 @@
|
|||||||
Subproject commit e2c917ed7d6020e2ba6c18b06c7278c094db03f7
|
|
@ -1 +0,0 @@
|
|||||||
Subproject commit 3366b10be91aaab7a61ae0bc0a5af5cc375e58d1
|
|
@ -1 +0,0 @@
|
|||||||
Subproject commit 836b47ec61a9c6a6445b4007e8353337fe63e2c9
|
|
@ -1 +0,0 @@
|
|||||||
Subproject commit 274126faa9febfb649981cc97ecd499fcd7f5b90
|
|
@ -1 +0,0 @@
|
|||||||
Subproject commit 29a03a8abaa884bde65b3c3dd1e46e87bb0fbfc4
|
|
@ -1,125 +0,0 @@
|
|||||||
%YAML 1.2
|
|
||||||
---
|
|
||||||
# http://www.sublimetext.com/docs/3/syntax.html
|
|
||||||
name: Lean
|
|
||||||
file_extensions:
|
|
||||||
- lean
|
|
||||||
scope: source.lean
|
|
||||||
contexts:
|
|
||||||
main:
|
|
||||||
- include: comments
|
|
||||||
- match: '\b(?<!\.)(inductive|coinductive|structure|theorem|axiom|axioms|abbreviation|lemma|definition|def|instance|class|constant)\b\s+(\{[^}]*\})?'
|
|
||||||
captures:
|
|
||||||
1: keyword.other.definitioncommand.lean
|
|
||||||
push:
|
|
||||||
- meta_scope: meta.definitioncommand.lean
|
|
||||||
- match: '(?=\bwith\b|\bextends\b|[:\|\(\[\{⦃<>])'
|
|
||||||
pop: true
|
|
||||||
- include: comments
|
|
||||||
- include: definitionName
|
|
||||||
- match: ","
|
|
||||||
- match: \b(Prop|Type|Sort)\b
|
|
||||||
scope: storage.type.lean
|
|
||||||
- match: '\battribute\b\s*\[[^\]]*\]'
|
|
||||||
scope: storage.modifier.lean
|
|
||||||
- match: '@\[[^\]]*\]'
|
|
||||||
scope: storage.modifier.lean
|
|
||||||
- match: \b(?<!\.)(private|meta|mutual|protected|noncomputable)\b
|
|
||||||
scope: keyword.control.definition.modifier.lean
|
|
||||||
- match: \b(sorry)\b
|
|
||||||
scope: invalid.illegal.lean
|
|
||||||
- match: '#print\s+(def|definition|inductive|instance|structure|axiom|axioms|class)\b'
|
|
||||||
scope: keyword.other.command.lean
|
|
||||||
- match: '#(print|eval|reduce|check|help|exit|find|where)\b'
|
|
||||||
scope: keyword.other.command.lean
|
|
||||||
- match: \b(?<!\.)(import|export|prelude|theory|definition|def|abbreviation|instance|renaming|hiding|exposing|parameter|parameters|begin|constant|constants|lemma|variable|variables|theorem|example|open|axiom|inductive|coinductive|with|structure|universe|universes|alias|precedence|reserve|postfix|prefix|infix|infixl|infixr|notation|end|using|namespace|section|local|set_option|extends|include|omit|class|classes|instances|raw|run_cmd|restate_axiom)(?!\.)\b
|
|
||||||
scope: keyword.other.lean
|
|
||||||
- match: \b(?<!\.)(calc|have|this|match|do|suffices|show|by|in|at|let|forall|fun|exists|assume|from|obtain|haveI|λ)(?!\.)\b
|
|
||||||
scope: keyword.other.lean
|
|
||||||
- match: «
|
|
||||||
push:
|
|
||||||
- meta_content_scope: entity.name.lean
|
|
||||||
- match: »
|
|
||||||
pop: true
|
|
||||||
- match: \b(?<!\.)(if|then|else)\b
|
|
||||||
scope: keyword.control.lean
|
|
||||||
- match: '"'
|
|
||||||
captures:
|
|
||||||
0: punctuation.definition.string.begin.lean
|
|
||||||
push:
|
|
||||||
- meta_scope: string.quoted.double.lean
|
|
||||||
- match: '"'
|
|
||||||
captures:
|
|
||||||
0: punctuation.definition.string.end.lean
|
|
||||||
pop: true
|
|
||||||
- match: '\\[\\"nt'']'
|
|
||||||
scope: constant.character.escape.lean
|
|
||||||
- match: '\\x[0-9A-Fa-f][0-9A-Fa-f]'
|
|
||||||
scope: constant.character.escape.lean
|
|
||||||
- match: '\\u[0-9A-Fa-f][0-9A-Fa-f][0-9A-Fa-f][0-9A-Fa-f]'
|
|
||||||
scope: constant.character.escape.lean
|
|
||||||
- match: '''[^\\'']'''
|
|
||||||
scope: string.quoted.single.lean
|
|
||||||
- match: '''(\\(x..|u....|.))'''
|
|
||||||
scope: string.quoted.single.lean
|
|
||||||
captures:
|
|
||||||
1: constant.character.escape.lean
|
|
||||||
- match: '`+[^\[(]\S+'
|
|
||||||
scope: entity.name.lean
|
|
||||||
- match: '\b([0-9]+|0([xX][0-9a-fA-F]+))\b'
|
|
||||||
scope: constant.numeric.lean
|
|
||||||
blockComment:
|
|
||||||
- match: /-
|
|
||||||
push:
|
|
||||||
- meta_scope: comment.block.lean
|
|
||||||
- match: "-/"
|
|
||||||
pop: true
|
|
||||||
- include: scope:source.lean.markdown
|
|
||||||
- include: blockComment
|
|
||||||
comments:
|
|
||||||
- include: dashComment
|
|
||||||
- include: docComment
|
|
||||||
- include: stringBlock
|
|
||||||
- include: modDocComment
|
|
||||||
- include: blockComment
|
|
||||||
dashComment:
|
|
||||||
- match: (--)
|
|
||||||
captures:
|
|
||||||
0: punctuation.definition.comment.lean
|
|
||||||
push:
|
|
||||||
- meta_scope: comment.line.double-dash.lean
|
|
||||||
- match: $
|
|
||||||
pop: true
|
|
||||||
- include: scope:source.lean.markdown
|
|
||||||
definitionName:
|
|
||||||
- match: '\b[^:«»\(\)\{\}[:space:]=→λ∀?][^:«»\(\)\{\}[:space:]]*'
|
|
||||||
scope: entity.name.function.lean
|
|
||||||
- match: «
|
|
||||||
push:
|
|
||||||
- meta_content_scope: entity.name.function.lean
|
|
||||||
- match: »
|
|
||||||
pop: true
|
|
||||||
docComment:
|
|
||||||
- match: /--
|
|
||||||
push:
|
|
||||||
- meta_scope: comment.block.documentation.lean
|
|
||||||
- match: "-/"
|
|
||||||
pop: true
|
|
||||||
- include: scope:source.lean.markdown
|
|
||||||
- include: blockComment
|
|
||||||
modDocComment:
|
|
||||||
- match: /-!
|
|
||||||
push:
|
|
||||||
- meta_scope: comment.block.documentation.lean
|
|
||||||
- match: "-/"
|
|
||||||
pop: true
|
|
||||||
- include: scope:source.lean.markdown
|
|
||||||
- include: blockComment
|
|
||||||
stringBlock:
|
|
||||||
- match: /-"
|
|
||||||
push:
|
|
||||||
- meta_scope: comment.block.string.lean
|
|
||||||
- match: '"-/'
|
|
||||||
pop: true
|
|
||||||
- include: scope:source.lean.markdown
|
|
||||||
- include: blockComment
|
|
@ -1 +0,0 @@
|
|||||||
Subproject commit d82aeb737d4883d1a74aba7a07053f90211d427b
|
|
@ -1,400 +0,0 @@
|
|||||||
%YAML 1.2
|
|
||||||
---
|
|
||||||
# http://www.sublimetext.com/docs/3/syntax.html
|
|
||||||
name: LiveScript
|
|
||||||
comment: "LiveScript Syntax: version 1"
|
|
||||||
file_extensions:
|
|
||||||
- ls
|
|
||||||
- Slakefile
|
|
||||||
- ls.erb
|
|
||||||
first_line_match: ^#!.*\bls
|
|
||||||
scope: source.livescript
|
|
||||||
contexts:
|
|
||||||
main:
|
|
||||||
- match: |-
|
|
||||||
(?x)
|
|
||||||
!?[~-]{1,2}>\*?
|
|
||||||
|<[~-]{1,2}!?
|
|
||||||
|\(\s* (?= instanceof[\s)]|and[\s)]|or[\s)]|is[\s)]|isnt[\s)]|in[\s)]|import[\s)]|import\ all[\s)] |\.|[-+/*%^&<>=|][\b\s)\w$]|\*\*|\%\%)
|
|
||||||
| (?<=[\s(]instanceof|[\s(]and|[\s(]or|[\s(]is|[\s(]isnt|[\s(]in|[\s(]import|[\s(]import\ all|[\s(]do|\.|\*\*|\%\%|[\b\s(\w$][-+/*%^&<>=|]) \s*\)
|
|
||||||
scope: storage.type.function.livescript
|
|
||||||
- match: \/\*
|
|
||||||
captures:
|
|
||||||
0: punctuation.definition.comment.livescript
|
|
||||||
push:
|
|
||||||
- meta_scope: comment.block.livescript
|
|
||||||
- match: \*\/
|
|
||||||
captures:
|
|
||||||
0: punctuation.definition.comment.livescript
|
|
||||||
pop: true
|
|
||||||
- match: '@\w*'
|
|
||||||
scope: storage.type.annotation.livescriptscript
|
|
||||||
- match: '(#)(?!\{).*$\n?'
|
|
||||||
scope: comment.line.number-sign.livescript
|
|
||||||
captures:
|
|
||||||
1: punctuation.definition.comment.livescript
|
|
||||||
- match: '((?:!|~|!~|~!)?function\*?)\s+([$\w\-]*[$\w]+)'
|
|
||||||
captures:
|
|
||||||
1: storage.type.function.livescript
|
|
||||||
2: entity.name.function.livescript
|
|
||||||
- match: (new)\s+(\w+(?:\.\w*)*)
|
|
||||||
captures:
|
|
||||||
1: keyword.operator.new.livescript
|
|
||||||
2: entity.name.type.instance.livescript
|
|
||||||
- match: \b(package|private|protected|public|interface|enum|static)(?!-)\b
|
|
||||||
scope: keyword.illegal.livescript
|
|
||||||
- match: "'''"
|
|
||||||
captures:
|
|
||||||
0: punctuation.definition.string.begin.livescript
|
|
||||||
push:
|
|
||||||
- meta_scope: string.quoted.heredoc.livescript
|
|
||||||
- match: "'''"
|
|
||||||
captures:
|
|
||||||
0: punctuation.definition.string.end.livescript
|
|
||||||
pop: true
|
|
||||||
- match: '"""'
|
|
||||||
captures:
|
|
||||||
0: punctuation.definition.string.begin.livescript
|
|
||||||
push:
|
|
||||||
- meta_scope: string.quoted.double.heredoc.livescript
|
|
||||||
- match: '"""'
|
|
||||||
captures:
|
|
||||||
0: punctuation.definition.string.end.livescript
|
|
||||||
pop: true
|
|
||||||
- match: \\.
|
|
||||||
scope: constant.character.escape.livescript
|
|
||||||
- include: interpolated_livescript
|
|
||||||
- match: "``"
|
|
||||||
captures:
|
|
||||||
0: punctuation.definition.string.begin.livescript
|
|
||||||
push:
|
|
||||||
- meta_scope: string.quoted.script.livescript
|
|
||||||
- match: "``"
|
|
||||||
captures:
|
|
||||||
0: punctuation.definition.string.end.livescript
|
|
||||||
pop: true
|
|
||||||
- match: '\\(x[0-9A-Fa-f]{2}|[0-2][0-7]{0,2}|3[0-6][0-7]|37[0-7]?|[4-7][0-7]?|.)'
|
|
||||||
scope: constant.character.escape.livescript
|
|
||||||
- match: '<\['
|
|
||||||
push:
|
|
||||||
- meta_scope: string.array-literal.livescript
|
|
||||||
- match: '\]>'
|
|
||||||
pop: true
|
|
||||||
- match: '/{2}(?![\s=/*+{}?]).*?[^\\]/[igmy]{0,4}(?![a-zA-Z0-9])/{2}'
|
|
||||||
scope: string.regexp.livescript
|
|
||||||
- match: '/{2}\n'
|
|
||||||
push:
|
|
||||||
- meta_scope: string.regexp.livescript
|
|
||||||
- match: "/{2}[imgy]{0,4}"
|
|
||||||
pop: true
|
|
||||||
- include: embedded_spaced_comment
|
|
||||||
- include: interpolated_livescript
|
|
||||||
- match: "/{2}"
|
|
||||||
push:
|
|
||||||
- meta_scope: string.regexp.livescript
|
|
||||||
- match: "/{2}[imgy]{0,4}"
|
|
||||||
pop: true
|
|
||||||
- match: '\\(x[0-9A-Fa-f]{2}|[0-2][0-7]{0,2}|3[0-6][0-7]|37[0-7]?|[4-7][0-7]?|.)'
|
|
||||||
scope: constant.character.escape.livescript
|
|
||||||
- include: interpolated_livescript
|
|
||||||
- match: '/(?![\s=/*+{}?]).*?[^\\]/[igmy]{0,4}(?![a-zA-Z0-9])'
|
|
||||||
scope: string.regexp.livescript
|
|
||||||
- match: |-
|
|
||||||
(?x)
|
|
||||||
\b(?<![\.\$\-@])(
|
|
||||||
instanceof|new|delete|typeof|and|or|is|isnt|not
|
|
||||||
)(?!\-|\s*:)\b
|
|
||||||
scope: keyword.operator.livescript
|
|
||||||
- match: <\||\|>
|
|
||||||
scope: keyword.operator.livescript
|
|
||||||
- match: "=>"
|
|
||||||
scope: keyword.control.livescript
|
|
||||||
- match: |-
|
|
||||||
(?x)
|
|
||||||
\b(?<![\.\$\-@])(?:
|
|
||||||
return|break|continue|throw
|
|
||||||
|try|if|while|for|for\s+own|switch|unless|until
|
|
||||||
|catch|finally|else|nobreak|case|default|fallthrough|when|otherwise|then
|
|
||||||
|yield
|
|
||||||
)(?!\-|\s*:)\b
|
|
||||||
scope: keyword.control.livescript
|
|
||||||
- match: |-
|
|
||||||
(?x)
|
|
||||||
and=|or=|%|&|\^|\*|\/|(?<![a-zA-Z$_])(\-)?\-(?!\-?>)|\+\+|\+|
|
|
||||||
~(?!~?>)|==|=|!=|<=|>=|<<=|>>=|
|
|
||||||
>>>=|<>|<(?!\[)|(?<!\])>|(?<!\w)!(?!([~\-]+)?>)|&&|\.\.(\.)?|\s\.\s|\?|\|\||\:|\*=|(?<!\()/=|%=|\+=|\-=|\.=|&=
|
|
||||||
|\^=
|
|
||||||
scope: keyword.operator.livescript
|
|
||||||
- match: |-
|
|
||||||
(?x)
|
|
||||||
\b(?<![\.\$\-@])(?:
|
|
||||||
function
|
|
||||||
)(?!\-|\s*:)\b
|
|
||||||
scope: storage.type.function.livescript
|
|
||||||
- match: |-
|
|
||||||
(?x)
|
|
||||||
\b(?<![\.\$\-@])(?:
|
|
||||||
this|throw|then|try|typeof!?|til|to
|
|
||||||
|continue|const|case|catch|class
|
|
||||||
|in|instanceof|import|import\s+all|implements|if|is
|
|
||||||
|default|delete|debugger|do
|
|
||||||
|for|for\s+own|finally|function|from|fallthrough
|
|
||||||
|super|switch
|
|
||||||
|else|nobreak|extends|export|eval
|
|
||||||
|and|arguments
|
|
||||||
|new|not
|
|
||||||
|unless|until
|
|
||||||
|while|with|when
|
|
||||||
|of|or|otherwise
|
|
||||||
|let|var|loop
|
|
||||||
|match
|
|
||||||
|by|yield
|
|
||||||
)(?!\-|\s*:)\b
|
|
||||||
scope: keyword.other.livescript
|
|
||||||
- match: '([a-zA-Z\$_](?:[\w$.-])*)\s*(?!\::)((:)|(=(?!>)))\s*(?!(\s*!?\s*\(.*\))?\s*(!?[~-]{1,2}>\*?))'
|
|
||||||
captures:
|
|
||||||
1: variable.assignment.livescript
|
|
||||||
3: punctuation.separator.key-value, keyword.operator.livescript
|
|
||||||
4: keyword.operator.livescript
|
|
||||||
- match: '(?<=\s|^)([\[\{])(?=.*?[\]\}]\s+[:=])'
|
|
||||||
captures:
|
|
||||||
0: keyword.operator.livescript
|
|
||||||
push:
|
|
||||||
- meta_scope: meta.variable.assignment.destructured.livescript
|
|
||||||
- match: '([\]\}]\s*[:=])'
|
|
||||||
captures:
|
|
||||||
0: keyword.operator.livescript
|
|
||||||
pop: true
|
|
||||||
- include: variable_name
|
|
||||||
- include: instance_variable
|
|
||||||
- include: single_quoted_string
|
|
||||||
- include: double_quoted_string
|
|
||||||
- include: numeric
|
|
||||||
- match: |-
|
|
||||||
(?x)
|
|
||||||
(\s*)
|
|
||||||
(?=[a-zA-Z\$_])
|
|
||||||
([a-zA-Z\$_]([\w$.:-])*)\s*
|
|
||||||
(?=[:=](\s*!?\s*\(.*\))?\s*(!?[~-]{1,2}>\*?))
|
|
||||||
scope: meta.function.livescript
|
|
||||||
captures:
|
|
||||||
2: entity.name.function.livescript
|
|
||||||
3: entity.name.function.livescript
|
|
||||||
4: variable.parameter.function.livescript
|
|
||||||
5: storage.type.function.livescript
|
|
||||||
- match: \b(?<!\.)(true|on|yes)(?!\s*:)\b
|
|
||||||
scope: constant.language.boolean.true.livescript
|
|
||||||
- match: \b(?<!\.)(false|off|no)(?!\s*:)\b
|
|
||||||
scope: constant.language.boolean.false.livescript
|
|
||||||
- match: \b(?<!\.)(null|void)(?!\s*:)\b
|
|
||||||
scope: constant.language.null.livescript
|
|
||||||
- match: \b(?<!\.)(super|this|extends)(?!\s*:)\b
|
|
||||||
scope: variable.language.livescript
|
|
||||||
- match: '(class\b)\s+(@?[a-zA-Z$_][\w$.-]*)?(?:\s+(extends)\s+(@?[a-zA-Z$_][\w$.-]*))?'
|
|
||||||
scope: meta.class.livescript
|
|
||||||
captures:
|
|
||||||
1: storage.type.class.livescript
|
|
||||||
2: entity.name.type.class.livescript
|
|
||||||
3: keyword.control.inheritance.livescript
|
|
||||||
4: entity.other.inherited-class.livescript
|
|
||||||
- match: \b(debugger|\\)\b
|
|
||||||
scope: keyword.other.livescript
|
|
||||||
- match: |-
|
|
||||||
(?x)\b(
|
|
||||||
Array|ArrayBuffer|Blob|Boolean|Date|document|event|Function|
|
|
||||||
Int(8|16|32|64)Array|Math|Map|Number|
|
|
||||||
Object|Proxy|RegExp|Set|String|WeakMap|
|
|
||||||
window|Uint(8|16|32|64)Array|XMLHttpRequest
|
|
||||||
)\b
|
|
||||||
scope: support.class.livescript
|
|
||||||
- match: \b(console)\b
|
|
||||||
scope: entity.name.type.object.livescript
|
|
||||||
- match: \b(Infinity|NaN|undefined)\b
|
|
||||||
scope: constant.language.livescript
|
|
||||||
- match: \;
|
|
||||||
scope: punctuation.terminator.statement.livescript
|
|
||||||
- match: ',[ |\t]*'
|
|
||||||
scope: meta.delimiter.object.comma.livescript
|
|
||||||
- match: \.
|
|
||||||
scope: meta.delimiter.method.period.livescript
|
|
||||||
- match: '\{|\}'
|
|
||||||
scope: meta.brace.curly.livescript
|
|
||||||
- match: \(|\)
|
|
||||||
scope: meta.brace.round.livescript
|
|
||||||
- match: '\[|\]\s*'
|
|
||||||
scope: meta.brace.square.livescript
|
|
||||||
- include: instance_variable
|
|
||||||
- include: backslash_string
|
|
||||||
- include: single_quoted_string
|
|
||||||
- include: double_quoted_string
|
|
||||||
- include: numeric
|
|
||||||
- match: '()(@|@@|[$\w\-]*[$\w]+)\s*(`)'
|
|
||||||
captures:
|
|
||||||
1: keyword.operator.livescript
|
|
||||||
2: meta.function-call.livescript
|
|
||||||
3: keyword.operator.livescript
|
|
||||||
- match: "`"
|
|
||||||
scope: keyword.operator.livescript
|
|
||||||
- match: '()(@|@@|[$\w\-]*[$\w]+)(?:(\??\!)|[(])'
|
|
||||||
captures:
|
|
||||||
1: keyword.operator.livescript
|
|
||||||
2: meta.function-call.livescript
|
|
||||||
3: keyword.operator.livescript
|
|
||||||
- match: '(@|@@|[$\w\-]*[$\w]+)(\?)? (?!\s*(((by|of|and|or|with|when|unless|if|is|isnt|else|nobreak|for|from|not in|in|catch|til|to|then|import|extends|implements|instanceof)\b)|[=:.*\/+\-%\^<>][ =)]|[`}%*)]|/(?!.*?/)|&&|[.][^.]|=>|\/ +|\||\|\||\-\-|\+\+|\|>|<|\||$|\n|\#|/\*))'
|
|
||||||
captures:
|
|
||||||
1: meta.function-call.livescript
|
|
||||||
2: keyword.operator.livescript
|
|
||||||
- match: \| _
|
|
||||||
scope: keyword.control.livescript
|
|
||||||
- match: '\|(?![.])'
|
|
||||||
scope: keyword.control.livescript
|
|
||||||
- match: \|
|
|
||||||
scope: keyword.operator.livescript
|
|
||||||
- match: ((?<=console\.)(debug|warn|info|log|error|time(End|-end)|assert))\b
|
|
||||||
scope: support.function.console.livescript
|
|
||||||
- match: |-
|
|
||||||
(?x)\b(
|
|
||||||
decodeURI(Component)?|encodeURI(Component)?|eval|parse(Float|Int)|require
|
|
||||||
)\b
|
|
||||||
scope: support.function.livescript
|
|
||||||
- match: |-
|
|
||||||
(?x)(?<![.-])\b(
|
|
||||||
map|filter|reject|partition|find|each|head|tail|last|initial|empty|
|
|
||||||
values|keys|length|cons|append|join|reverse|fold(l|r)?1?|unfoldr|
|
|
||||||
and(List|-list)|or(List|-list)|any|all|unique|sum|product|mean|compact|
|
|
||||||
concat(Map|-map)?|maximum|minimum|scan(l|r)?1?|replicate|slice|apply|
|
|
||||||
split(At|-at)?|take(While|-while)?|drop(While|-while)?|span|first|
|
|
||||||
break(It|-it)|list(ToObj|-to-obj)|obj(ToFunc|-to-func)|
|
|
||||||
pairs(ToObj|-to-obj)|obj(ToPairs|-to-pairs|ToLists|-to-lists)|
|
|
||||||
zip(All|-all)?(With|-with)?|compose|curry|partial|flip|fix|
|
|
||||||
sort(With|-with|By|-by)?|group(By|-by)|break(List|-list|Str|-str)|
|
|
||||||
difference|intersection|union|average|flatten|chars|unchars|repeat|
|
|
||||||
lines|unlines|words|unwords|max|min|negate|abs|signum|quot|rem|div|mod|
|
|
||||||
recip|pi|tau|exp|sqrt|ln|pow|sin|cos|tan|asin|acos|atan|atan2|truncate|
|
|
||||||
round|ceiling|floor|is(It|-it)NaN|even|odd|gcd|lcm|disabled__id
|
|
||||||
)\b(?![.-])
|
|
||||||
comment: |
|
|
||||||
Generated by DOM query from http://gkz.github.com/prelude-ls/:
|
|
||||||
[].slice
|
|
||||||
.call(document.querySelectorAll(".nav-pills li a"))
|
|
||||||
.map(function(_) {return _.innerText})
|
|
||||||
.filter(function(_) {return _.trim() !== '})
|
|
||||||
.slice(2)
|
|
||||||
.join("|")
|
|
||||||
scope: support.function.prelude.livescript
|
|
||||||
- match: '(?x)(?<![.-])\b(that|it|e|_)\b'
|
|
||||||
scope: support.function.semireserved.livescript
|
|
||||||
- match: |-
|
|
||||||
(?x)((?<=(\.|\]|\)))(
|
|
||||||
apply|call|concat|every|filter|for(Each|-each)|
|
|
||||||
from|has(Own|-own)(Property|-property)|index(Of|-of)|
|
|
||||||
is(Prototype|-prototype)(Of|-of)|join|last(Index|-index)(Of|-of)|
|
|
||||||
map|of|pop|property(Is|-is)(Enumerable|-enumerable)|push|
|
|
||||||
reduce(Right|-right)?|reverse|shift|slice|some|sort|
|
|
||||||
splice|to(Locale|-locale)?(String|-string)|unshift|valueOf
|
|
||||||
))\b(?!-)
|
|
||||||
scope: support.function.method.array.livescript
|
|
||||||
- match: |-
|
|
||||||
(?x)((?<=Array\.)(
|
|
||||||
isArray
|
|
||||||
))\b
|
|
||||||
scope: support.function.static.array.livescript
|
|
||||||
- match: |-
|
|
||||||
(?x)((?<=Object\.)(
|
|
||||||
create|define(Propert|-propert)(ies|y)|freeze|
|
|
||||||
get(Own|-own)(Property|-property)(Descriptors?|Names)|
|
|
||||||
get(Property|-property)(Descriptor|Names)|getPrototypeOf|
|
|
||||||
is((Extensible|-extensible)|(Frozen|-frozen)|(Sealed|-sealed))?|
|
|
||||||
keys|prevent(Extensions|-extensions)|seal
|
|
||||||
))\b
|
|
||||||
scope: support.function.static.object.livescript
|
|
||||||
- match: |-
|
|
||||||
(?x)((?<=Math\.)(
|
|
||||||
abs|acos|acosh|asin|asinh|atan|atan2|atanh|ceil|cos|cosh|exp|expm1|floor|
|
|
||||||
hypot|log|log10|log1p|log2|max|min|pow|random|round|sign|sin|sinh|sqrt|
|
|
||||||
tan|tanh|trunc
|
|
||||||
))\b
|
|
||||||
scope: support.function.static.math.livescript
|
|
||||||
- match: |-
|
|
||||||
(?x)((?<=Number\.)(
|
|
||||||
is(Finite|Integer|NaN)|to(Integer|-integer)
|
|
||||||
))\b
|
|
||||||
scope: support.function.static.number.livescript
|
|
||||||
- match: '[\$\w][\w-]*'
|
|
||||||
scope: variable.other.livescript
|
|
||||||
backslash_string:
|
|
||||||
- match: '\\([\\)\s,\};\]])?'
|
|
||||||
captures:
|
|
||||||
0: string.quoted.single.livescript
|
|
||||||
push:
|
|
||||||
- meta_content_scope: string.quoted.single.livescript
|
|
||||||
- match: '([\\)\s,\};\]])'
|
|
||||||
captures:
|
|
||||||
0: punctuation.definition.string.end.livescript
|
|
||||||
pop: true
|
|
||||||
constructor_variable:
|
|
||||||
- match: '([a-zA-Z$_][\w$-]*)(@{2})([a-zA-Z$_][\w$-]*)?'
|
|
||||||
scope: variable.other.readwrite.constructor.livescript
|
|
||||||
double_quoted_string:
|
|
||||||
- match: '"'
|
|
||||||
captures:
|
|
||||||
0: punctuation.definition.string.begin.livescript
|
|
||||||
push:
|
|
||||||
- meta_scope: string.quoted.double.livescript
|
|
||||||
- match: '"'
|
|
||||||
captures:
|
|
||||||
0: punctuation.definition.string.end.livescript
|
|
||||||
pop: true
|
|
||||||
- match: '\\(x[0-9A-Fa-f]{2}|[0-2][0-7]{0,2}|3[0-6][0-7]|37[0-7]?|[4-7][0-7]?|.)'
|
|
||||||
scope: constant.character.escape.livescript
|
|
||||||
- include: interpolated_livescript
|
|
||||||
embedded_comment:
|
|
||||||
- match: (?<!\\)(#).*$\n
|
|
||||||
scope: comment.line.number-sign.livescript
|
|
||||||
captures:
|
|
||||||
1: punctuation.definition.comment.livescript
|
|
||||||
embedded_spaced_comment:
|
|
||||||
- match: (?<!\\)(#\s).*$\n
|
|
||||||
scope: comment.line.number-sign.livescript
|
|
||||||
captures:
|
|
||||||
1: punctuation.definition.comment.livescript
|
|
||||||
instance_variable:
|
|
||||||
- match: '(?<![$\w\-])(@)'
|
|
||||||
scope: variable.other.readwrite.instance.livescript
|
|
||||||
interpolated_livescript:
|
|
||||||
- match: '\#\{'
|
|
||||||
captures:
|
|
||||||
0: punctuation.section.embedded.livescript
|
|
||||||
push:
|
|
||||||
- meta_scope: source.livescript.embedded.source
|
|
||||||
- match: '\}'
|
|
||||||
captures:
|
|
||||||
0: punctuation.section.embedded.livescript
|
|
||||||
pop: true
|
|
||||||
- include: main
|
|
||||||
- match: '\#'
|
|
||||||
push:
|
|
||||||
- meta_scope: source.livescript.embedded.source.simple
|
|
||||||
- match: ""
|
|
||||||
pop: true
|
|
||||||
- include: main
|
|
||||||
numeric:
|
|
||||||
- match: '(?<![\$@a-zA-Z_])(([0-9]+r[0-9_]+)|((16r|0[xX])[0-9a-fA-F_]+)|([0-9]+(\.[0-9]+[0-9_]*)?(e[+\-]?[0-9_]+)?)[_a-zA-Z0-9]*)'
|
|
||||||
scope: constant.numeric.livescript
|
|
||||||
single_quoted_string:
|
|
||||||
- match: "'"
|
|
||||||
captures:
|
|
||||||
0: punctuation.definition.string.begin.livescript
|
|
||||||
push:
|
|
||||||
- meta_scope: string.quoted.single.livescript
|
|
||||||
- match: "'"
|
|
||||||
captures:
|
|
||||||
0: punctuation.definition.string.end.livescript
|
|
||||||
pop: true
|
|
||||||
- match: '\\(x[0-9A-Fa-f]{2}|[0-2][0-7]{0,2}|3[0-6][0-7]?|37[0-7]?|[4-7][0-7]?|.)'
|
|
||||||
scope: constant.character.escape.livescript
|
|
||||||
variable_name:
|
|
||||||
- match: '([a-zA-Z\$_][\w$-]*(\.\w+)*)(?!\-)'
|
|
||||||
scope: variable.assignment.livescript
|
|
||||||
captures:
|
|
||||||
1: variable.assignment.livescript
|
|
@ -1,202 +0,0 @@
|
|||||||
%YAML 1.2
|
|
||||||
---
|
|
||||||
# http://www.sublimetext.com/docs/3/syntax.html
|
|
||||||
name: Manpage
|
|
||||||
file_extensions:
|
|
||||||
- man
|
|
||||||
scope: source.man
|
|
||||||
|
|
||||||
variables:
|
|
||||||
section_heading: '^(?!#)\S.*$'
|
|
||||||
command_line_option: '(--?[A-Za-z0-9][_A-Za-z0-9-]*)'
|
|
||||||
|
|
||||||
contexts:
|
|
||||||
prototype:
|
|
||||||
# ignore syntax test lines
|
|
||||||
- match: '^#'
|
|
||||||
push:
|
|
||||||
- meta_scope: comment.syntax-test.man
|
|
||||||
- match: $\n?
|
|
||||||
pop: true
|
|
||||||
main:
|
|
||||||
- match: ^
|
|
||||||
push: first_line
|
|
||||||
|
|
||||||
first_line:
|
|
||||||
- match: '([A-Z0-9_\-]+)(\()([^)]+)(\))\s*'
|
|
||||||
captures:
|
|
||||||
1: meta.preprocessor.man
|
|
||||||
2: keyword.operator.man
|
|
||||||
3: string.quoted.other.man
|
|
||||||
4: keyword.operator.man
|
|
||||||
push:
|
|
||||||
- match: (?:[\w'-]+|\s(?!\s))
|
|
||||||
scope: markup.heading.title.man
|
|
||||||
- match: \s\s
|
|
||||||
pop: true
|
|
||||||
- match: '(?=\S|$)'
|
|
||||||
pop: true
|
|
||||||
|
|
||||||
- match: '$'
|
|
||||||
set: body
|
|
||||||
|
|
||||||
body:
|
|
||||||
# English, ..., ..., ..., Russian, ...
|
|
||||||
|
|
||||||
- match: '^(?:SYNOPSIS|SYNTAX|SINTASSI|SKŁADNIA|СИНТАКСИС|書式)'
|
|
||||||
scope: markup.heading.synopsis.man
|
|
||||||
embed: synopsis
|
|
||||||
escape: '(?={{section_heading}})'
|
|
||||||
|
|
||||||
- match: '^(?:USAGE)'
|
|
||||||
scope: markup.heading.synopsis.man
|
|
||||||
embed: synopsis
|
|
||||||
escape: '(?={{section_heading}})'
|
|
||||||
|
|
||||||
- match: '^(?:COMMANDS)\b'
|
|
||||||
scope: markup.heading.commands.man
|
|
||||||
embed: commands-start
|
|
||||||
escape: '(?={{section_heading}})'
|
|
||||||
|
|
||||||
- match: '^(?:ENVIRONMENT\s+VARIABLES)'
|
|
||||||
scope: markup.heading.env.man
|
|
||||||
embed: environment-variables
|
|
||||||
escape: '(?={{section_heading}})'
|
|
||||||
|
|
||||||
- match: '{{section_heading}}'
|
|
||||||
scope: markup.heading.other.man
|
|
||||||
embed: options # some man pages put command line options under the description heading
|
|
||||||
escape: '(?={{section_heading}})'
|
|
||||||
|
|
||||||
function-call:
|
|
||||||
- match: '\b([A-Za-z0-9_\-]+\.)?([A-Za-z0-9_\-]+)(\()([^)]*)(\))'
|
|
||||||
captures:
|
|
||||||
1: entity.name.function.man
|
|
||||||
2: entity.name.function.man
|
|
||||||
3: keyword.operator.man
|
|
||||||
4: constant.numeric.man
|
|
||||||
5: keyword.operator.man
|
|
||||||
|
|
||||||
env-var:
|
|
||||||
- match: '(\$)(?!\d)(\w+)\b'
|
|
||||||
captures:
|
|
||||||
1: punctuation.definition.variable.man
|
|
||||||
2: constant.other.man
|
|
||||||
|
|
||||||
options:
|
|
||||||
# command-line options like --option=value, --some-flag, or -x
|
|
||||||
- match: '^[ ]{7}(?=-|\+)'
|
|
||||||
push: expect-command-line-option
|
|
||||||
- match: '(?:[^a-zA-Z0-9_-]|^|\s){{command_line_option}}'
|
|
||||||
captures:
|
|
||||||
1: entity.name.command-line-option
|
|
||||||
push:
|
|
||||||
- match: '='
|
|
||||||
scope: keyword.operator.man
|
|
||||||
set:
|
|
||||||
- match: '[^],.() ]+'
|
|
||||||
scope: variable.parameter.man
|
|
||||||
pop: true
|
|
||||||
- match: $
|
|
||||||
pop: true
|
|
||||||
- match: ''
|
|
||||||
pop: true
|
|
||||||
- include: function-call
|
|
||||||
- include: c-code
|
|
||||||
- include: env-var
|
|
||||||
|
|
||||||
expect-command-line-option:
|
|
||||||
- match: '[A-Za-z0-9-\.\?:#\$\+]+'
|
|
||||||
scope: entity.name.command-line-option.man
|
|
||||||
- match: '(\[)(=)'
|
|
||||||
captures:
|
|
||||||
1: punctuation.section.brackets.begin.man
|
|
||||||
2: keyword.operator.man
|
|
||||||
push: [command-line-option-or-pipe, expect-parameter]
|
|
||||||
- match: '\['
|
|
||||||
push:
|
|
||||||
- meta_scope: entity.name.command-line-option.man
|
|
||||||
- match: '\]'
|
|
||||||
pop: true
|
|
||||||
- match: '='
|
|
||||||
scope: keyword.operator.man
|
|
||||||
push: expect-parameter
|
|
||||||
- match: (?=.*\.)
|
|
||||||
pop: true
|
|
||||||
- match: '\s'
|
|
||||||
push: expect-parameter
|
|
||||||
- match: '(,)\s*'
|
|
||||||
captures:
|
|
||||||
1: punctuation.separator.man
|
|
||||||
- match: $|(?=\])
|
|
||||||
pop: true
|
|
||||||
|
|
||||||
expect-parameter:
|
|
||||||
- match: '[A-Za-z0-9-_]+'
|
|
||||||
scope: variable.parameter.man
|
|
||||||
- match: (?=\s+\|)
|
|
||||||
pop: true
|
|
||||||
- match: \|
|
|
||||||
scope: keyword.operator.logical.man
|
|
||||||
- match: '\['
|
|
||||||
scope: punctuation.section.brackets.begin.man
|
|
||||||
push:
|
|
||||||
- match: '\]'
|
|
||||||
scope: punctuation.section.brackets.end.man
|
|
||||||
pop: true
|
|
||||||
- include: expect-parameter
|
|
||||||
- match: '<'
|
|
||||||
scope: punctuation.definition.generic.begin.man
|
|
||||||
- match: '>'
|
|
||||||
scope: punctuation.definition.generic.end.man
|
|
||||||
- match: '$|(?=[],]|{{command_line_option}})'
|
|
||||||
pop: true
|
|
||||||
|
|
||||||
c-code:
|
|
||||||
- match: '^(?=\s+(?:#include\b|#define\b|/\*|struct\s+(\w+\s*)?\{))'
|
|
||||||
embed: scope:source.c
|
|
||||||
#embed_scope: source.c.embedded.man
|
|
||||||
#escape: ^(?!#|\1|\s*(?:$|/\*|#include\b|#define\b))
|
|
||||||
escape: ^(?=\s*(?:\(.*\.\)\s*$|[A-Z](?![A-Z])))
|
|
||||||
|
|
||||||
synopsis:
|
|
||||||
- include: c-code
|
|
||||||
- match: \[
|
|
||||||
scope: punctuation.section.brackets.begin.man
|
|
||||||
push: command-line-option-or-pipe
|
|
||||||
- include: options
|
|
||||||
|
|
||||||
command-line-option-or-pipe:
|
|
||||||
- match: (\|)\s*
|
|
||||||
captures:
|
|
||||||
1: keyword.operator.logical.man
|
|
||||||
#- match: (?={{command_line_option}})
|
|
||||||
- match: \w+-\w+
|
|
||||||
- match: (?=-)
|
|
||||||
push:
|
|
||||||
- match: (?=\s*\|)
|
|
||||||
pop: true
|
|
||||||
- include: expect-command-line-option
|
|
||||||
- match: \]
|
|
||||||
scope: punctuation.section.brackets.end.man
|
|
||||||
pop: true
|
|
||||||
- match: \[
|
|
||||||
scope: punctuation.section.brackets.begin.man
|
|
||||||
push: command-line-option-or-pipe
|
|
||||||
|
|
||||||
commands-start:
|
|
||||||
- match: (?=^[ ]{7}.*(?:[ ]<|[|]))
|
|
||||||
push: commands
|
|
||||||
|
|
||||||
commands:
|
|
||||||
- match: '^[ ]{7}([a-z_\-]+)(?=[ ]|$)'
|
|
||||||
captures:
|
|
||||||
1: entity.name.command.man
|
|
||||||
push: expect-parameter
|
|
||||||
- match: '^[ ]{7}(?=[\[<]|\w+[|\]])'
|
|
||||||
push: expect-parameter
|
|
||||||
|
|
||||||
environment-variables:
|
|
||||||
- match: '^[ ]{7}([A-Z_]+)\b'
|
|
||||||
captures:
|
|
||||||
1: support.constant.environment-variable.man
|
|
@ -1 +0,0 @@
|
|||||||
Subproject commit 5dceaa9dd9af0d2266f1c9e45966d8a610226213
|
|
@ -1,14 +0,0 @@
|
|||||||
%YAML 1.2
|
|
||||||
---
|
|
||||||
# http://www.sublimetext.com/docs/3/syntax.html
|
|
||||||
name: MemInfo
|
|
||||||
file_extensions:
|
|
||||||
- meminfo
|
|
||||||
scope: source.meminfo
|
|
||||||
|
|
||||||
contexts:
|
|
||||||
main:
|
|
||||||
- match: '^([^:]+)\w*:\w*(.*)$'
|
|
||||||
captures:
|
|
||||||
1: keyword.other.meminfo-key
|
|
||||||
2: string.other.meminfo-value
|
|
@ -1 +0,0 @@
|
|||||||
Subproject commit 619a65a04efbf343bdfcde875700675b9b273368
|
|
@ -1 +0,0 @@
|
|||||||
Subproject commit 65f5a63c0d1760c5db2264e50e3b14a7a4567cc0
|
|
@ -1,258 +0,0 @@
|
|||||||
%YAML 1.2
|
|
||||||
---
|
|
||||||
# http://www.sublimetext.com/docs/3/syntax.html
|
|
||||||
name: Nim
|
|
||||||
file_extensions:
|
|
||||||
- nim
|
|
||||||
- nims
|
|
||||||
- nimble
|
|
||||||
scope: source.nim
|
|
||||||
contexts:
|
|
||||||
main:
|
|
||||||
- match: '(\#\[\s*(TODO|todo)?)'
|
|
||||||
comment: A multiline comment.
|
|
||||||
captures:
|
|
||||||
1: punctuation.definition.multi-comment.nim
|
|
||||||
2: invalid.illegal.TODO.nim
|
|
||||||
push:
|
|
||||||
- meta_scope: comment.line.number-sign.multi-comment.nim
|
|
||||||
- match: '(.*]\#)'
|
|
||||||
captures:
|
|
||||||
1: punctuation.definition.multi-comment.nim
|
|
||||||
2: invalid.illegal.TODO.nim
|
|
||||||
pop: true
|
|
||||||
- match: (##\s*(TODO|todo)?).+$\n?
|
|
||||||
comment: A documentation comment.
|
|
||||||
scope: comment.line.number-sign.doc-comment.nim
|
|
||||||
captures:
|
|
||||||
1: punctuation.definition.doc-comment.nim
|
|
||||||
2: invalid.illegal.TODO.nim
|
|
||||||
- match: (##\s*)$\n?
|
|
||||||
comment: An empty documentation comment.
|
|
||||||
scope: comment.line.number-sign.doc-comment.empty.nim
|
|
||||||
captures:
|
|
||||||
1: punctuation.definition.doc-comment.empty.nim
|
|
||||||
- match: (#\s*(TODO|todo)?).*$\n?
|
|
||||||
comment: A regular comment
|
|
||||||
scope: comment.line.number-sign.comment.nim
|
|
||||||
captures:
|
|
||||||
1: punctuation.definition.comment.nim
|
|
||||||
2: invalid.illegal.TODO.nim
|
|
||||||
- match: '\{\.'
|
|
||||||
comment: Pragmas
|
|
||||||
push:
|
|
||||||
- meta_scope: pragma
|
|
||||||
- match: '\.?\}'
|
|
||||||
pop: true
|
|
||||||
- match: \"
|
|
||||||
push:
|
|
||||||
- meta_scope: string.something.nim
|
|
||||||
- match: \"
|
|
||||||
pop: true
|
|
||||||
- match: '([\w\x{80}-\x{10FFFF}]+)'
|
|
||||||
scope: entity.other.attribute-name.pragma.nim
|
|
||||||
- match: discard \"\"\"
|
|
||||||
comment: A discarded triple string literal comment
|
|
||||||
push:
|
|
||||||
- meta_scope: comment.line.discarded.nim
|
|
||||||
- match: \"\"\"
|
|
||||||
pop: true
|
|
||||||
- match: '(?<![\w\x{80}-\x{10FFFF}])(\d[_\d]*((\.[_\d]+([eE][\+\-]?\d[_\d]*)?)|([eE][\+\-]?\d[_\d]*)))(''?([fF](32|64|128))|[fFdD])?'
|
|
||||||
comment: A float literal
|
|
||||||
scope: constant.numeric.float.decimal.nim
|
|
||||||
- match: '(?<![\w\x{80}-\x{10FFFF}])(0[xX][0-9A-Fa-f][_0-9A-Fa-f]*)(''?(([iIuUfF](8|16|32|64))|[uUfFdD]))?'
|
|
||||||
comment: A hexadecimal literal
|
|
||||||
scope: constant.numeric.integer.hexadecimal.nim
|
|
||||||
- match: '(?<![\w\x{80}-\x{10FFFF}])(0[ocC][0-7][_0-7]*)(''?(([iIuUfF](8|16|32|64))|[uUfFdD]))?'
|
|
||||||
comment: A base-8 integer literal
|
|
||||||
scope: constant.numeric.integer.octal.nim
|
|
||||||
- match: '(?<![\w\x{80}-\x{10FFFF}])(0(b|B)[01][_01]*)(''?(([iIuUfF](8|16|32|64))|[uUfFdD]))?'
|
|
||||||
comment: A base-2 integer literal
|
|
||||||
scope: constant.numeric.integer.binary.nim
|
|
||||||
- match: '(?<![\w\x{80}-\x{10FFFF}])(\d[_\d]*)(''?(([iIuUfF](8|16|32|64))|[uUfFdD]))?'
|
|
||||||
comment: A base-10 integer literal
|
|
||||||
scope: constant.numeric.integer.decimal.nim
|
|
||||||
- match: '(?<![\w\x{80}-\x{10FFFF}])(true|false|inf|nil)(?![\w\x{80}-\x{10FFFF}])'
|
|
||||||
comment: Language Constants.
|
|
||||||
scope: constant.language.nim
|
|
||||||
- match: (?:^|\s+|=)(when|if)\b
|
|
||||||
comment: Primary branching keywords
|
|
||||||
captures:
|
|
||||||
1: keyword.control.primary.nim
|
|
||||||
push:
|
|
||||||
- match: (?=:)
|
|
||||||
captures:
|
|
||||||
1: control.variable.parameter.nim
|
|
||||||
pop: true
|
|
||||||
- include: scope:source.nim
|
|
||||||
- match: (?:^|\s+|=)(case)\b
|
|
||||||
comment: Primary branching keyword 'case'
|
|
||||||
captures:
|
|
||||||
1: keyword.control.primary.nim
|
|
||||||
push:
|
|
||||||
- match: (?=\bof\b)
|
|
||||||
captures:
|
|
||||||
1: control.variable.parameter.nim
|
|
||||||
pop: true
|
|
||||||
- include: scope:source.nim
|
|
||||||
- match: (?:^|\s+)(of|else|elif)\b
|
|
||||||
comment: Secondary branching keywords and their conditions
|
|
||||||
captures:
|
|
||||||
1: keyword.control.secondary.nim
|
|
||||||
push:
|
|
||||||
- match: (?=:)
|
|
||||||
captures:
|
|
||||||
1: control.variable.parameter.nim
|
|
||||||
pop: true
|
|
||||||
- include: scope:source.nim
|
|
||||||
- match: '(?<![\w\x{80}-\x{10FFFF}])(await|block|break|continue|do|end|except|finally|raise|return|try|while|yield)(?![\w\x{80}-\x{10FFFF}])'
|
|
||||||
comment: Keywords that affect program control flow or scope.
|
|
||||||
scope: keyword.control.nim
|
|
||||||
- match: '((?<![\w\x{80}-\x{10FFFF}])(and|in|is|isnot|not|notin|or|xor)(?![\w\x{80}-\x{10FFFF}]))'
|
|
||||||
comment: Keyword boolean operators for expressions.
|
|
||||||
scope: keyword.operator.boolean.nim
|
|
||||||
- match: '((?<![\w\x{80}-\x{10FFFF}])(addr|as|atomic|bind|cast|const|converter|defer|discard|distinct|div|enum|export|include|let|mixin|object|of|ptr|ref|shl|shr|static|type|var)(?![\w\x{80}-\x{10FFFF}]))'
|
|
||||||
comment: Other keywords.
|
|
||||||
scope: keyword.other.nim
|
|
||||||
- match: (\b()\b|(=|\+|-|\*|/|<|>|@|\$|~|&|%|!|\?|\^|\.|:|\\)+)
|
|
||||||
comment: Generic operators for expressions.
|
|
||||||
scope: keyword.operator.nim
|
|
||||||
- match: (for)\s+
|
|
||||||
comment: in keyword in a 'for' loop
|
|
||||||
captures:
|
|
||||||
1: keyword.control.nim
|
|
||||||
push:
|
|
||||||
- meta_scope: meta.forloop.nim
|
|
||||||
- match: (?=:)
|
|
||||||
captures:
|
|
||||||
1: keyword.control.nim
|
|
||||||
pop: true
|
|
||||||
- match: '\ [\w\x{80}-\x{10FFFF},]+\s+(in)\s+'
|
|
||||||
captures:
|
|
||||||
1: keyword.control.nim
|
|
||||||
- include: scope:source.nim
|
|
||||||
- match: '((import)\s+[\.|\w|\/]+,?)'
|
|
||||||
comment: Import syntax
|
|
||||||
captures:
|
|
||||||
2: keyword.control.nim
|
|
||||||
- match: '(from)\s+[\/\w]+\s+(?=import)'
|
|
||||||
captures:
|
|
||||||
1: keyword.control.nim
|
|
||||||
- match: (var|let)\s*\(
|
|
||||||
comment: Destructure syntax
|
|
||||||
captures:
|
|
||||||
1: keyword.other.nim
|
|
||||||
push:
|
|
||||||
- match: \)
|
|
||||||
captures:
|
|
||||||
1: keyword.other.nim
|
|
||||||
pop: true
|
|
||||||
- match: '((?<![\w\x{80}-\x{10FFFF}])(generic|interface|lambda|out|shared|with|without)(?![\w\x{80}-\x{10FFFF}]))'
|
|
||||||
comment: Invalid and unused keywords.
|
|
||||||
scope: keyword.invalid.nim
|
|
||||||
- match: '(?<![\w\x{80}-\x{10FFFF}])(new|GC_ref|GC_unref|assert|echo|defined|declared|newException|countup|countdown|len|high|low)(?![\w\x{80}-\x{10FFFF}])'
|
|
||||||
comment: Common functions
|
|
||||||
scope: keyword.other.common.function.nim
|
|
||||||
- match: '(?<![\w\x{80}-\x{10FFFF}])(((uint|int|float)(8|16|32|64)?)|clong|culong|cchar|cschar|cshort|cint|csize|clonglong|cfloat|cdouble|clongdouble|cuchar|cushort|cuint|culonglong|cstringArray|bool|string|auto|cstring|char|byte|tobject|typedesc|stmt|expr|any|untyped|typed)(?![\w\x{80}-\x{10FFFF}])'
|
|
||||||
comment: Built-in, concrete types.
|
|
||||||
scope: storage.type.concrete.nim
|
|
||||||
- match: '(?<![\w\x{80}-\x{10FFFF}])(range|array|seq|tuple|natural|set|ref|ptr|pointer)(?![\w\x{80}-\x{10FFFF}])'
|
|
||||||
comment: Built-in, generic types.
|
|
||||||
scope: storage.type.generic.nim
|
|
||||||
- match: '(?<![\w\x{80}-\x{10FFFF}])(proc|iterator|method|template|macro)(?![\w\x{80}-\x{10FFFF}])'
|
|
||||||
comment: Function types
|
|
||||||
scope: storage.type.function.nim
|
|
||||||
- match: '(?<![\w\x{80}-\x{10FFFF}])(openarray|varargs|void)(?![\w\x{80}-\x{10FFFF}])'
|
|
||||||
comment: Special types.
|
|
||||||
scope: storage.type.generic.nim
|
|
||||||
- match: '(?<![\w\x{80}-\x{10FFFF}])([A-Z][A-Z0-9_]+)(?![\w\x{80}-\x{10FFFF}])'
|
|
||||||
comment: Other constants.
|
|
||||||
scope: support.constant.nim
|
|
||||||
- match: '(?<![\w\x{80}-\x{10FFFF}])([A-Z]\w+)(?![\w\x{80}-\x{10FFFF}])'
|
|
||||||
comment: Other types.
|
|
||||||
scope: support.type.nim
|
|
||||||
- match: '(?<![\w\x{80}-\x{10FFFF}])(\w+)(?![\w\x{80}-\x{10FFFF}])(?=\()'
|
|
||||||
comment: Function call.
|
|
||||||
scope: support.function.any-method.nim
|
|
||||||
- match: r?\"\"\"
|
|
||||||
comment: (Raw) Triple Quoted String
|
|
||||||
push:
|
|
||||||
- meta_scope: string.quoted.triple.nim
|
|
||||||
- match: '\"\"\"[^\"]'
|
|
||||||
pop: true
|
|
||||||
- match: r\"
|
|
||||||
comment: Raw Double Quoted String
|
|
||||||
push:
|
|
||||||
- meta_scope: string.quoted.double.raw.nim
|
|
||||||
- match: \"
|
|
||||||
pop: true
|
|
||||||
- match: \"\"
|
|
||||||
- match: \"
|
|
||||||
comment: Double Quoted String
|
|
||||||
push:
|
|
||||||
- meta_scope: string.quoted.double.nim
|
|
||||||
- match: \"
|
|
||||||
pop: true
|
|
||||||
- include: escaped_char
|
|
||||||
- match: \'
|
|
||||||
comment: Single quoted character literal
|
|
||||||
push:
|
|
||||||
- meta_scope: string.quoted.single.nim
|
|
||||||
- match: \'
|
|
||||||
pop: true
|
|
||||||
- match: \\n
|
|
||||||
scope: invalid.illegal.character.nim
|
|
||||||
- include: escaped_char
|
|
||||||
- match: '([^\''][^\'']+?)'
|
|
||||||
scope: invalid.illegal.character.nim
|
|
||||||
- match: '([\w\x{80}-\x{10FFFF}\`]+)\s*(?=\(|\[.+?\]\s*\()'
|
|
||||||
comment: Call syntax
|
|
||||||
captures:
|
|
||||||
1: support.function.any-method.nim
|
|
||||||
push:
|
|
||||||
- match: \)
|
|
||||||
captures:
|
|
||||||
1: support.function.any-method.nim
|
|
||||||
pop: true
|
|
||||||
- include: scope:source.nim
|
|
||||||
- match: '([\w\x{80}-\x{10FFFF}]+)(?=\s+[\w](?![\w\x{80}-\x{10FFFF}]+((?!\n)\s)+))'
|
|
||||||
comment: Command syntax
|
|
||||||
captures:
|
|
||||||
1: support.function.any-method.nim
|
|
||||||
- match: '([\w\x{80}-\x{10FFFF}]+)(?=\s+[\"\''\`])'
|
|
||||||
captures:
|
|
||||||
1: support.function.any-method.nim
|
|
||||||
- match: (tmpl(i)?)(?=( (nim|html|xml|js|css|glsl|md))?\"\"\")
|
|
||||||
comment: tmpl specifier
|
|
||||||
captures:
|
|
||||||
1: storage.type.function.nim
|
|
||||||
2: keyword.operator.nim
|
|
||||||
escaped_char:
|
|
||||||
- match: '\\[nN]'
|
|
||||||
scope: constant.character.escape.newline.nim
|
|
||||||
- match: '\\[cC]|\\[rR]'
|
|
||||||
scope: constant.character.escape.carriagereturn.nim
|
|
||||||
- match: '\\[lL]'
|
|
||||||
scope: constant.character.escape.linefeed.nim
|
|
||||||
- match: '\\[fF]'
|
|
||||||
scope: constant.character.escape.formfeed.nim
|
|
||||||
- match: '\\[tT]'
|
|
||||||
scope: constant.character.escape.tabulator.nim
|
|
||||||
- match: '\\[vV]'
|
|
||||||
scope: constant.character.escape.verticaltabulator.nim
|
|
||||||
- match: \\\"
|
|
||||||
scope: constant.character.escape.double-quote.nim
|
|
||||||
- match: \\'
|
|
||||||
scope: constant.character.escape.single-quote.nim
|
|
||||||
- match: '\\[0-9]+'
|
|
||||||
scope: constant.character.escape.chardecimalvalue.nim
|
|
||||||
- match: '\\[aA]'
|
|
||||||
scope: constant.character.escape.alert.nim
|
|
||||||
- match: '\\[bB]'
|
|
||||||
scope: constant.character.escape.backspace.nim
|
|
||||||
- match: '\\[eE]'
|
|
||||||
scope: constant.character.escape.escape.nim
|
|
||||||
- match: '\\[xX][0-9A-Fa-f]{2}'
|
|
||||||
scope: constant.character.escape.hex.nim
|
|
||||||
- match: \\\\
|
|
||||||
scope: constant.character.escape.backslash.nim
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user