#text #editor #terminal #competitive #modal

bin+lib accepted

A text editor to be ACCEPTED

22 releases

✓ Uses Rust 2018 edition

0.2.0 Feb 25, 2019
0.1.20 Jan 17, 2019
0.1.18 Dec 8, 2018
0.1.16 Nov 15, 2018
0.1.11 Sep 30, 2018

#4 in Text editors

Download history 26/week @ 2018-12-16 60/week @ 2018-12-23 14/week @ 2018-12-30 57/week @ 2019-01-06 41/week @ 2019-01-13 9/week @ 2019-01-20 10/week @ 2019-01-27 7/week @ 2019-02-03 9/week @ 2019-02-10 2/week @ 2019-02-17 36/week @ 2019-02-24 111/week @ 2019-03-03 4/week @ 2019-03-10 27/week @ 2019-03-17 133/week @ 2019-03-24

149 downloads per month

MIT license

167KB
4.5K SLoC

Accepted

crates.io Build Status Join the chat at https://gitter.im/Accepted-text-editor/community

A terminal text editor to be ACCEPTED.

Accepted screenshot

Description

A modal text editor for competitive programmer written with Rust.

Currently Accepted supports Rust and C++.

Features

  • Preconfigured for Rust and C++
  • Autoformat with Rustfmt / ClangFormat / or specify with configuration
  • Completion with RLS / Clangd / or Other LSP servers
  • Auto compile and show compiler messages (Supports rustc / gcc / clang)
  • Easy to test a single a code
  • VScode style snippet support
  • Mouse support

Install

You need nightly Rust.

$ cargo install accepted

For Rust users

Install rust components.

$ rustup component add rls-preview
$ rustup component add rust-src
$ rustup component add rustfmt-preview

For C++ users

Install clang, clang-format and clangd.

Usage

$ acc [file]

TODO: More precisely.

Basic

Many commands of acc is same as Vim.

i, I, a, A, o, O to insert mode and Esc to return.

hjkl, w, e, b to move cursor.

y, d, c, v, V works like vim

Space Prefix

Some of commands can run with space as a prefix.

SPACE -> q to Quit.

SPACE -> s to Save.

SPACE -> a to Save As.

SPACE -> y to Copy all to clipboard

SPACE -> SPACE to Rustfmt.

SPACE -> t to compile and run with clipboard input.

SPACE -> T to compile (optimized) and run with clipboard input.

SPACE -> q to Quit.

Configuration

You can configure this by toml file placed in [config_dir]/acc/config.toml

config_dir is defined in here.

Below is default configure. You can override with your own configure.

# Configure to defaults
[file_default]
indent_width = 4
# Set true if you are running in legacy terminal which has no true color
ansi_color = false

# Configure for *.rs files
[file.rs]
# Setting compiler and its type.
compiler = { command=["rustc", "$FilePath$", "-Z", "unstable-options", "--error-format=json"], type="rustc", optimize_option=["-O"] }
# Setting LSP server command
lsp = ["rls"]
# Setting formatter command
formatter = ["rustfmt"]

[file.cpp]
# Configure for *.cpp files
# Respect clang-format
indent_width = 2
compiler = { command=["clang", "$FilePath$", "-o", "$FileStem$"], type="gcc", optimize_option=["-O2"] }
lsp = ["clangd"]
formatter = ["clang-format"]

Snippet Support

This supports vscode style snippet.

You can specify snippet files in configure

# On *.rs files
[file.rs]
# Use a snippet in this path
snippets=["~.config/acc/snippet.json"]

Contribution

Any kind of contribution including feature request is welcome!!

Dependencies

~9.5MB
~166K SLoC