Skip to content

Commit

Permalink
Add desc to keymaps
Browse files Browse the repository at this point in the history
  • Loading branch information
kiyoon committed Feb 23, 2023
1 parent ddf249f commit c5c08eb
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 13 deletions.
37 changes: 31 additions & 6 deletions lua/jupynium/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,37 @@ function M.default_keybindings(augroup)
pattern = "*.ju.*",
callback = function()
local buf_id = vim.api.nvim_get_current_buf()
vim.keymap.set({ "n", "x" }, "<space>x", "<cmd>JupyniumExecuteSelectedCells<CR>", { buffer = buf_id })
vim.keymap.set({ "n", "x" }, "<space>c", "<cmd>JupyniumClearSelectedCellsOutputs<CR>", { buffer = buf_id })
vim.keymap.set({ "n", "x" }, "<space>S", "<cmd>JupyniumScrollToCell<cr>", { buffer = buf_id })
vim.keymap.set({ "n", "x" }, "<space>T", "<cmd>JupyniumToggleSelectedCellsOutputsScroll<cr>", { buffer = buf_id })
vim.keymap.set("", "<PageUp>", "<cmd>JupyniumScrollUp<cr>", { buffer = buf_id })
vim.keymap.set("", "<PageDown>", "<cmd>JupyniumScrollDown<cr>", { buffer = buf_id })
vim.keymap.set(
{ "n", "x" },
"<space>x",
"<cmd>JupyniumExecuteSelectedCells<CR>",
{ buffer = buf_id, desc = "Jupynium execute selected cells" }
)
vim.keymap.set(
{ "n", "x" },
"<space>c",
"<cmd>JupyniumClearSelectedCellsOutputs<CR>",
{ buffer = buf_id, desc = "Jupynium clear selected cells" }
)
vim.keymap.set(
{ "n", "x" },
"<space>S",
"<cmd>JupyniumScrollToCell<cr>",
{ buffer = buf_id, desc = "Jupynium scroll to cell" }
)
vim.keymap.set(
{ "n", "x" },
"<space>T",
"<cmd>JupyniumToggleSelectedCellsOutputsScroll<cr>",
{ buffer = buf_id, desc = "Jupynium toggle selected cell output scroll" }
)
vim.keymap.set("", "<PageUp>", "<cmd>JupyniumScrollUp<cr>", { buffer = buf_id, desc = "Jupynium scroll up" })
vim.keymap.set(
"",
"<PageDown>",
"<cmd>JupyniumScrollDown<cr>",
{ buffer = buf_id, desc = "Jupynium scroll down" }
)
end,
group = augroup,
})
Expand Down
14 changes: 7 additions & 7 deletions lua/jupynium/textobj.lua
Original file line number Diff line number Diff line change
Expand Up @@ -120,43 +120,43 @@ M.default_keybindings = function(augroup)
{ "n", "x", "o" },
"[j",
"<cmd>lua require'jupynium.textobj'.goto_previous_cell_separator()<cr>",
{ buffer = buf_id }
{ buffer = buf_id, desc = "Go to previous Jupynium cell" }
)
vim.keymap.set(
{ "n", "x", "o" },
"]j",
"<cmd>lua require'jupynium.textobj'.goto_next_cell_separator()<cr>",
{ buffer = buf_id }
{ buffer = buf_id, desc = "Go to next Jupynium cell" }
)
vim.keymap.set(
{ "n", "x", "o" },
"<space>j",
"<cmd>lua require'jupynium.textobj'.goto_current_cell_separator()<cr>",
{ buffer = buf_id }
{ buffer = buf_id, desc = "Go to current Jupynium cell" }
)
vim.keymap.set(
{ "x", "o" },
"aj",
"<cmd>lua require'jupynium.textobj'.select_cell(true, false)<cr>",
{ buffer = buf_id }
{ buffer = buf_id, desc = "Select around Jupynium cell" }
)
vim.keymap.set(
{ "x", "o" },
"ij",
"<cmd>lua require'jupynium.textobj'.select_cell(false, false)<cr>",
{ buffer = buf_id }
{ buffer = buf_id, desc = "Select inside Jupynium cell" }
)
vim.keymap.set(
{ "x", "o" },
"aJ",
"<cmd>lua require'jupynium.textobj'.select_cell(true, true)<cr>",
{ buffer = buf_id }
{ buffer = buf_id, desc = "Select around Jupynium cell (include next cell separator)" }
)
vim.keymap.set(
{ "x", "o" },
"iJ",
"<cmd>lua require'jupynium.textobj'.select_cell(false, true)<cr>",
{ buffer = buf_id }
{ buffer = buf_id, desc = "Select inside Jupynium cell (include next cell separator)" }
)
end,
group = augroup,
Expand Down

0 comments on commit c5c08eb

Please sign in to comment.