Accepted
A terminal text editor to be ACCEPTED.
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
- rmate protocol
Install
You need nightly Rust.
If you want to install HEAD
version, you can install from git to
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
config_dir
is defined in here.
Below is default configure. You can override with your own configure.
# Configure to defaults
[]
= 4
# Set true if you are running in legacy terminal which has no true color
= false
# Configure for *.rs files
[]
# Setting compiler and its type.
= { =["rustc", "$FilePath$", "-Z", "unstable-options", "--error-format=json"], ="rustc", =["-O"] }
# Setting LSP server command
= ["rls"]
# Setting formatter command
= ["rustfmt"]
[]
# Configure for *.cpp files
# Respect clang-format
= 2
= { =["clang", "$FilePath$", "-o", "$FileStem$"], ="gcc", =["-O2"] }
= ["clangd"]
= ["clang-format"]
Snippet Support
This supports vscode style snippet.
You can specify snippet files in configure
# On *.rs files
[]
# Use a snippet in this path
=["~.config/acc/snippet.json"]
Contribution
Any kind of contribution including feature request is welcome!!