https://github.com/fnaufel/altw
RStudio addin to copy selection(s) in current source editor to X clipboard
https://github.com/fnaufel/altw
emacs-keybindings rstudio rstudio-addin
Last synced: about 1 month ago
JSON representation
RStudio addin to copy selection(s) in current source editor to X clipboard
- Host: GitHub
- URL: https://github.com/fnaufel/altw
- Owner: fnaufel
- License: gpl-3.0
- Created: 2022-04-05T15:35:13.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2022-04-15T22:35:44.000Z (about 3 years ago)
- Last Synced: 2025-01-25T10:27:28.425Z (3 months ago)
- Topics: emacs-keybindings, rstudio, rstudio-addin
- Language: R
- Homepage:
- Size: 22.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.Rmd
- License: LICENSE.md
Awesome Lists containing this project
README
---
output: github_document
---```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```# altw: an RStudio addin to copy selection to clipboard
In my installation of RStudio, even with Emacs keybindings, I was not able to use `M-w` (i.e., `Alt-W`) for copying.
In the **Tools | Modify Keyboard Shortcuts...** menu, it is not possible to bind keys to the `copy` command.
`C-w` and `C-y` work fine for killing and yanking, respectively.
`altw` is an RStudio addin to copy the current selection to the clipboard.
If there are multiple selections in the active document (made with multiple cursors), the `altw` concatenates them with `\n` as the separator before copying.
As any addin, it can be bound to a keyboard shortcut.
Now I can use `M-w` to copy text to the clipboard, as in Emacs.
## Installation
You can install `altw` from [GitHub](https://github.com/) with:
``` r
# install.packages("devtools")
devtools::install_github("fnaufel/altw")
```After installation, go to the **Tools | Addins | Browse Addins...** menu, find `altw`, select it, and click on `Keyboard shortcuts` to bind it to your favorite key.
## Dependencies
This addin uses [the great `clipr` package](http://matthewlincoln.net/clipr/index.html).
If you're using any distribution of GNU-Linux with X11, you need to have the [`xclip` program](https://github.com/astrand/xclip) installed.