moodymudskipper / nakedpipe

Pipe Into a Sequence of Calls Without Repeating the Pipe Symbol.
69 stars 7 forks source link

snippets #1

Closed moodymudskipper closed 4 years ago

moodymudskipper commented 4 years ago

I prepared this for the readme but I think I need something more convenient, + tabs become spaces when knitting so copy and paste won't work right.

I think CRAN policies forbid writing out of the project directory, but we could have a function set_nakedpipe_snippets() which will put what's needed into the pastebin, open the file using file.edit(), and give instructions about what to do in the console.

Useful snippets

You can use RStudio's snippets to save some typing. Follow the instructions below and you'll be able to type :

cars . # + 2 time the <tab> key

and display :

cars %.% {
  # with the cursor conveniently placed here
}

(or type .. to get the %..% equivalent)

To do this, run the command below to open the file in your script tab :

file.edit("~/.R/snippets/r.snippets")

Then paste the following anywhere (at the top is ok), and in this order :

snippet ..
    %..% {
      ${1}
    }

snippet .
    %.% {
      ${1}
    }
moodymudskipper commented 4 years ago

done

github-actions[bot] commented 2 years ago

This old thread has been automatically locked. If you think you have found something related to this, please open a new issue and link to this old issue if necessary.