Skip to content

Commit

Permalink
feat: add keybindings to add different code chunks
Browse files Browse the repository at this point in the history
with `co` `b/r/p/j` for bash, r, python, julia
  • Loading branch information
jmbuhr committed Apr 20, 2023
1 parent c4bb018 commit f2cd9d6
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lua/config/keymap.lua
Original file line number Diff line number Diff line change
Expand Up @@ -231,13 +231,18 @@ wk.register({
['gN'] = { 'Nzzzv', 'center search' },
['gl'] = { '<c-]>', 'open help link' },
['gf'] = { ':e <cfile><CR>', 'edit file' },
['co'] = { 'o#%%<cr>', 'new code chunk below' },
['cO'] = { 'O#%%<cr>', 'new code chunk above' },
['coo'] = { 'o#%%<cr>', 'new code chunk below' },
['cOo'] = { 'O#%%<cr>', 'new code chunk above' },
['cob'] = { 'o```{bash}<cr>```<esc>O', "bash code chunk" },
['cor'] = { 'o```{r}<cr>```<esc>O', "r code chunk" },
['cop'] = { 'o```{python}<cr>```<esc>O', "python code chunk" },
['col'] = { 'o```{julia}<cr>```<esc>O', "julia code chunk" },
['<m-i>'] = { 'o```{r}<cr>```<esc>O', "r code chunk" },
['<cm-i>'] = { 'o```{python}<cr>```<esc>O', "r code chunk" },
['<m-I>'] = { 'o```{python}<cr>```<esc>O', "r code chunk" },
}, { mode = 'n' })


-- visual mode
wk.register({
['<cr>'] = { '<Plug>SlimeRegionSend', 'run code region' },
Expand Down

0 comments on commit f2cd9d6

Please sign in to comment.