• Stars
    star
    111
  • Rank 314,510 (Top 7 %)
  • Language
    Rust
  • License
    MIT License
  • Created about 6 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A terminal text editor to be ACCEPTED

Accepted

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

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 TabNine / 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
  • rmate protocol

Install

You need nightly Rust.

$ cargo install accepted

If you want to install HEAD version, you can install from git to

$ cargo install -f --git=https://github.com/hatoo/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.

SPACE -> r to Start rmate server

Configuration

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

You can open config file via $ acc --config easily.

config_dir is defined in here.

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

# Configure to defaults
[file_default]
# Put spaces instead of '\t' when tab key is pressed
hard_tab = false
indent_width = 4
# Set true if you are running in legacy terminal which has no true color
ansi_color = false
# Command for TabNine
tabnine = ["TabNine"]
# Set theme
# You can set either theme name which is bundled by `syntect` and file path for .tmTheme
theme = "Solarized (dark)"

# Configure for *.rs files
[file.rs]
# Setting compiler and its type.
compiler = { command=["rustc", "$FILE_PATH", "--error-format=json"], type="rustc", optimize_option=["-O"] }
# Setting LSP server command
lsp = ["rls"]
# Setting formatter command
formatter = ["rustfmt"]
# Command for testing
test_command = ["./$FILE_STEM"]

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

[file.c]
# Same as cpp
indent_width = 2
compiler = { command=["clang", "$FILE_PATH", "-o", "$FILE_STEM"], type="gcc", optimize_option=["-O2"] }
lsp = ["clangd"]
formatter = ["clang-format"]
test_command = ["./$FILE_STEM"]

[file.rb]
indent_width = 2

[file.go]
formatter = ["gofmt"]
hard_tab = true

Contribution

Any kind of contribution including feature request is welcome!!

More Repositories

1

oha

Ohayou(おはよう), HTTP load generator, inspired by rakyll/hey with tui animation.
Rust
4,651
star
2

competitive-rust-snippets

My Rust snippets for competitive programming
Rust
79
star
3

cargo-snippet

A snippet extrator for competitive programmers
Rust
74
star
4

kiro

A minimal text editor in Rust
Rust
31
star
5

rene

WIP Vulkan Raytracing renderer entirely written in Rust
Rust
18
star
6

http-mitm-proxy

A HTTP proxy server library intended to be a backend of application like Burp proxy
Rust
15
star
7

vst-rs-example-iced

An examle for vst-rs with GUI with iced
Rust
12
star
8

ash-raytracing-example

An example of KHR raytracing using ash and rust-gpu.
Rust
10
star
9

egglog-language-server

A language server and VScode extension for egglog
Rust
7
star
10

myc

my c compiler
Rust
5
star
11

zenn-content

Rust
5
star
12

pingora_bench

Rust
4
star
13

vst-rs-example-egui

Rust
3
star
14

fluid-animations

My codes for The Art of Fluid Animation
Rust
3
star
15

blackbody

Temperature to blackbody color
Rust
3
star
16

apd

Simple fluid simulation library supports Advect, Project and Diffuse operations.
Rust
3
star
17

chainer-text-generator

Python
3
star
18

hlsl-grimoire-sample-wgpu

Samples written in Rust for "HLSL シェーダーの魔導書 シェーディングの基礎からレイトレーシングまで"
Rust
3
star
19

vst_plugin_parameters_derive

derive macro for vst::plugin::PluginParameters in vst-rs
Rust
2
star
20

vst-rs-example-conrod

An examle for vst-rs with GUI with conrod
Rust
2
star
21

calc

https://github.com/PacktPublishing/Learn-LLVM-12/tree/master/Chapter03/calc in Rust
Rust
2
star
22

haneru

Rust
2
star
23

RNN-hearthstone-card-generator-web

hearthstone card generator using RNN
HTML
2
star
24

rukako

WIP GPU Renderer in Rust
Rust
1
star
25

Cursion

A pure Rust, like Curses, cursor optimization library to avoid flickering in terminal.
Rust
1
star
26

sound-programming-study

A personal playground for [Pythonではじめる音のプログラミング](https://www.ohmsha.co.jp/book/9784274228995/)
Rust
1
star
27

raspi-k8s-itamae-recipi

An itamae recipi to setup kubeadm for Raspberry pi
Ruby
1
star
28

hash_benchmark

Rust
1
star
29

rew

Rust
1
star
30

codecrafters-sqlite-rust

Rust
1
star
31

https-mitm

Rust
1
star
32

raytracing-1w

My codes for Ray Tracing in One Weekend Book Series.
Rust
1
star
33

vanion

Rust
1
star
34

bitset-fixed

Bitset for DP
Rust
1
star
35

nstrm

Streem like language
Go
1
star
36

whisper_volume

Rust
1
star
37

read_to_char_vec_benchmark

Rust
1
star
38

window_ime

A library to obtain IME access from a `raw-window-handle`
Rust
1
star
39

oha-538

https://github.com/hatoo/oha/issues/538
Rust
1
star
40

cs6120

My attempts to https://www.cs.cornell.edu/courses/cs6120/2020fa/self-guided/
Rust
1
star