GithubHelp home page GithubHelp logo

bgeron / character-snippets Goto Github PK

View Code? Open in Web Editor NEW
1.0 3.0 0.0 109 KB

Convert a TOML file in a certain format to a Visual Studio Code snippets file. Contains many useful snippets by default: https://gist.github.com/bgeron/1c0e1422890b2bbd899738b1c22ce3cc

Rust 59.76% PowerShell 7.47% Shell 32.77%

character-snippets's Introduction

Character-snippets

Commitizen friendly Travis Build Status AppVeyor Build status

A small program that generates a Visual Studio Code snippets file, with either builtin snippets (>1000 Unicode characters) or a custom TOML input file.

# Install with Rust. Alternatively, download a binary from the Releases page.
cargo install character-snippets

# Put a snippets file in a good location for Visual Studio Code on Linux. These
# snippets will be visible in all workspaces.
character-snippets --builtin > ~/.config/Code/User/snippets/chars.code-snippets

# Use a custom snippets file.
character-snippets my-custom-snippets.toml > ~/.config/Code/User/snippets/chars.code-snippets

# To find out where the snippets files are located on your operating system, run
# "Preferences: Configure User Snippets" and create a new global snippets file.

The format of the input file should be as follows:

[Snippets]
    xbrackets = "〚$1〛"
    xcheckbox = ""
    xchecked = ""
    xcheckmark = ""
    xch = ""

Visual Studio Code will interpret variables such as $1 as placeholders.

Output will be sent to standard output.

Installing

Download binaries:

→ from the GitHub releases page

Alternatively, compile from scratch on Unix:

# 1. Install Rust
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
# 2. Add ~/.cargo/bin to PATH
source $HOME/.cargo/env # or log in again
# 3. We need a basic build environment (cc, ld) for a dependency
apt install build-essential
# 4. Install character-snippets
cargo install character-snippets
# 5. Profit!
character-snippets --builtin > ~/.config/Code/User/snippets/chars.code-snippets # for Linux
character-snippets src/builtin-snippets.toml > ~/.config/Code/User/snippets/chars.code-snippets

License

This project is licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this project by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.