From 7ba6d860a01b7bd17e4c03a135ae7f7f2084623b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Wei=C3=9F?= Date: Thu, 9 Jun 2022 12:27:23 +0200 Subject: [PATCH] Update proposed keybindings for new autocommand syntax --- docs/drafts/keybindgs.md | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/docs/drafts/keybindgs.md b/docs/drafts/keybindgs.md index 22cae4f3..331ccba4 100644 --- a/docs/drafts/keybindgs.md +++ b/docs/drafts/keybindgs.md @@ -3,17 +3,21 @@ ## Python ```lua -lvim.autocommands.custom_groups = { +lvim.autocommands = { { "Filetype", - "python", - "nnoremap r lua require('core.terminal')._exec_toggle('python " .. vim.fn.expand "%" .. ";read')", + { + pattern = "python", + command = "nnoremap r lua require('toggleterm.terminal').Terminal:new {cmd='python ' .. vim.fn.expand('%') .. ';read', hidden =false}:toggle()", + }, }, { "Filetype", - "python", - "nnoremap t lua require('toggleterm.terminal').Terminal:new {cmd='python -m unittest;read', hidden =false}:toggle()", - }, + { + pattern = "python", + command = "nnoremap t lua require('toggleterm.terminal').Terminal:new {cmd='python -m unittest;read', hidden =false}:toggle()", + }, + } } lvim.builtin.which_key.mappings["r"] = "Run" lvim.builtin.which_key.mappings["t"] = "Test"