Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add desc to keymaps #47

Merged
merged 1 commit into from
Feb 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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