-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.Rmd
52 lines (32 loc) · 1.55 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{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
<!-- badges: start -->
<!-- badges: end -->
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.