vim-rmarkdown icon indicating copy to clipboard operation
vim-rmarkdown copied to clipboard

formating rmarkdown files

Open etheleon opened this issue 9 years ago • 0 comments

Hi,

i've written a small function to use in my own ~/.vimrc.local to open a chunk. Maybe we could add this to one of the functions in this vim package.

function Chunk()
   normal i```{r}^M^M```^[k
endfunction
nnoremap <leader>r :call Chunk()<CR>

however its not complete. I was hopping it could do the wrapping of the a few lines of code (visual selection) and wrapping the starting and ending chunk identifiers around the code. Not familiar with vim enough to write this piece of code

| <multiline CODE> 
| <multiline CODE> 
| <multiline CODE> 
| ```{r}
| <multiline CODE> 
| <multiline CODE> 
| <multiline CODE> 
| ```

any ideas?

etheleon avatar May 07 '15 01:05 etheleon