Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ThinkR-open/prompt
Dynamic prompt
https://github.com/ThinkR-open/prompt
console prompt r
Last synced: 3 months ago
JSON representation
Dynamic prompt
- Host: GitHub
- URL: https://github.com/ThinkR-open/prompt
- Owner: ThinkR-open
- License: other
- Archived: true
- Created: 2017-05-29T08:26:17.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-08-29T13:43:30.000Z (about 7 years ago)
- Last Synced: 2024-05-21T02:54:30.007Z (6 months ago)
- Topics: console, prompt, r
- Language: R
- Size: 104 KB
- Stars: 28
- Watchers: 2
- Forks: 1
- Open Issues: 3
-
Metadata Files:
- Readme: README.Rmd
- License: LICENSE
Awesome Lists containing this project
README
---
title: "prompt"
author: Romain Francois
output:
md_document:
variant: markdown_github
---```{r, echo=FALSE, print=FALSE}
library("prompt")
```![](prompt.png)
# prompt
Dynamic Prompt.
# Usage
This use `glue` to expand the function passed in, with the follwing bindings available:
- `t` the current time, in format "%H:%M:%S"
- `v` the version of R
- `V` the version of R, including the svn revision
- `u` the user name
- `g` the github user name
- `m` the memory currently used by R
- `w` the current working directory
```{r eval = FALSE}
set_prompt( ~ "{t}> " )
set_prompt( ~ "{w}> " )
set_prompt( ~ "[{m}] {t} {w}> ")
```You can use `expand_prompt` to experiment :
```{r}
expand_prompt( ~ "{t}> " )
expand_prompt( ~ "{w}> " )
expand_prompt( ~ "[{m}] {t} {w}> ")
```
## Installation```
install_github( "ThinkR-open/prompt" )
```## Initial ideas
in a way that can be configured. Things we might want to display:
- current time
- memory used `pryr::mem_used`
- current working directory, maybe slightly differently when it's not the directory of the current rstudio project
- are we developping a package ? Do we need to rebuild it ?
- are we sync with github
- R version
- ...
- (please add your own with PR)## License
MIT + file LICENSE ©