reorganization
This commit is contained in:
parent
bc44678dac
commit
91b5421848
46 changed files with 47 additions and 51 deletions
43
home/modules/nvim/dotfiles/ftplugin/rmd.vim
Normal file
43
home/modules/nvim/dotfiles/ftplugin/rmd.vim
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
runtime ftplugin/markdown.vim
|
||||
runtime ftplugin/r.vim
|
||||
|
||||
" let g:slime_cell_delimiter = "```"
|
||||
nmap <silent> snc <plug>SlimeMotionSendic/```{<cr>:noh<cr>j
|
||||
|
||||
nmap <silent> <localleader>pd :execute 'SlimeSend1 datapasta::tribble_construct() \|> clipr::write_clip()'<cr>:sleep500ms<cr>"*p
|
||||
nmap <silent> <localleader>pv :execute 'SlimeSend1 datapasta::vector_construct() \|> clipr::write_clip()'<cr>:sleep500ms<cr>"*p
|
||||
|
||||
nmap sc :set opfunc=SendAndPaste<CR>g@
|
||||
nmap sc<cr> ^:set opfunc=SendAndPaste<CR>g@$
|
||||
vmap sc :<C-U>call SendAndPaste(visualmode(), 1)<CR>
|
||||
|
||||
function! SendAndPaste(type, ...)
|
||||
|
||||
let v = winsaveview()
|
||||
let sel_save = &selection
|
||||
let &selection = "inclusive"
|
||||
let reg_save = @@
|
||||
|
||||
if a:0 " Invoked from Visual mode, use gv command.
|
||||
silent exe "normal! gvy"
|
||||
elseif a:type == 'line'
|
||||
silent exe "normal! '[V']y"
|
||||
else
|
||||
silent exe "normal! `[v`]y"
|
||||
endif
|
||||
|
||||
call slime#send(trim(@@) . " |> capture.output() |> clipr::write_clip()\r")
|
||||
|
||||
/```
|
||||
call append(line("."), ["", "```{r}", "```"])
|
||||
/```{r}
|
||||
sleep 500m
|
||||
let @*=substitute(@*, '\e\[[0-9;]*m', '', 'g')
|
||||
:put*
|
||||
call winrestview(v)
|
||||
let &selection = sel_save
|
||||
let @@ = reg_save
|
||||
endfunction
|
||||
|
||||
|
||||
:UltiSnipsAddFiletypes rmd.r.markdown
|
||||
Loading…
Add table
Add a link
Reference in a new issue