Cross Platform Rust Repl
:help => print help
:reset => reset repl
:show => show repl current code (optionally depends on rustfmt to format output)
:add cargo-edit
arguments
:type \:type vec!(5)
:time \:time 5+4
:time my_fun(arg1,arg2)
:time_release \time
command but with release mode
:load => load a rust file into the repl
:reload => reload the last specified file
:pop => remove last repl code line
:del
:edit \:edit micro
, Note that any edit made to $cache/irust/src/main_extern.rs
file will be immediatly reflected on the repl (after saving)
:cd => change current working directory
:color \:color function red
:color macro #ff12ab
:color reset
:toolchain \stable
, beta
, nighty
:checkstatements *true*/*false* => If its set to true, irust will check each statemnt (input that ends with ;) with cargocheck before inserting it to the repl
:bench => run cargo bench
:: => run a shell command, example ::ls
You can use arrow keys to cycle through commands history
ctrl-l clear screen
ctrl-c clear line
ctrl-d exit if buffer is empty
ctrl-z [unix only] send IRust to the background
ctrl-r search history
ctrl-left/right jump through words
HOME/END go to line start / line end
Tab/ShiftTab cycle through auto-completion suggestions (requires racer)
Alt-Enter add line break
ctrl-e force evaluation
irust
--help prints help message
--reset-config reset IRust configuration to default
IRust config file is located in:
Linux: /home/$USER/.config/irust/config
Win: C:\Users\$USER\AppData\Roaming/irust/config
Mac: /Users/$USER/Library/Preferences/irust/config
default config: ``` // history addirustcmdtohistory = true addshellcmdtohistory = false
// colors okcolor = "Blue" evalcolor = "White" irustcolor = "DarkBlue" irustwarncolor = "Cyan" outcolor = "Red" shellcolor = "DarkYellow" errcolor = "DarkRed" inputcolor = "Green" insertcolor = "White" welcomemsg = "" welcomecolor = "DarkBlue"
// racer racerinlinesuggestioncolor = "Cyan" racersuggestionstablecolor = "Green" racerselectedsuggestioncolor = "DarkRed" racermaxsuggestions = 5 enableracer = true
// other firstirustrun = false toolchain = "stable" check_statements = true ```
Since release 0.8.9
IRust
can now parse a theme file located on $config_dir/irust/theme
and use it for the highlighting colors.
Colors can be specified as names ("red") or as hex representation ("#ff12ab").
Default theme file:
``` keyword = "magenta" keyword2 = "darkred" function = "blue" type = "cyan" number = "darkyellow" symbol = "red" macro = "darkyellow" stringliteral = "yellow" character = "green" lifetime = "darkmagenta" comment = "darkgrey" const = "dark_green" x = "white"
```
Automatic releases by github actions are uploaded here https://github.com/sigmaSd/irust/releases
cargo b --release
1- Why is autocompletion not working
-> you need racer installed and configured correctly
cargo +nightly install racer
rustup component add rust-src