From f2cd9d619b7a6efdcaa04e939382df78f1b73b5c Mon Sep 17 00:00:00 2001 From: Jannik Buhr Date: Thu, 20 Apr 2023 13:52:38 +0200 Subject: [PATCH] feat: add keybindings to add different code chunks with `co` `b/r/p/j` for bash, r, python, julia --- lua/config/keymap.lua | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lua/config/keymap.lua b/lua/config/keymap.lua index 8046654..0afc926 100644 --- a/lua/config/keymap.lua +++ b/lua/config/keymap.lua @@ -231,13 +231,18 @@ wk.register({ ['gN'] = { 'Nzzzv', 'center search' }, ['gl'] = { '', 'open help link' }, ['gf'] = { ':e ', 'edit file' }, - ['co'] = { 'o#%%', 'new code chunk below' }, - ['cO'] = { 'O#%%', 'new code chunk above' }, + ['coo'] = { 'o#%%', 'new code chunk below' }, + ['cOo'] = { 'O#%%', 'new code chunk above' }, + ['cob'] = { 'o```{bash}```O', "bash code chunk" }, + ['cor'] = { 'o```{r}```O', "r code chunk" }, + ['cop'] = { 'o```{python}```O', "python code chunk" }, + ['col'] = { 'o```{julia}```O', "julia code chunk" }, [''] = { 'o```{r}```O', "r code chunk" }, [''] = { 'o```{python}```O', "r code chunk" }, [''] = { 'o```{python}```O', "r code chunk" }, }, { mode = 'n' }) + -- visual mode wk.register({ [''] = { 'SlimeRegionSend', 'run code region' },