An open API service indexing awesome lists of open source software.

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

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.