aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCody Hiar <cody@hiar.ca>2022-12-02 19:58:41 -0700
committerCody Hiar <cody@hiar.ca>2022-12-02 19:58:41 -0700
commitef72069de3febd41305f41f398ec07effc344854 (patch)
treed74261d813436e1cb884bb023767e6c953262b12
parent1a19154482a1e8fb99eac67bc41bbcbe6d72d9b3 (diff)
Add shortcut for embedding ipython
-rw-r--r--init.lua2
1 files changed, 2 insertions, 0 deletions
diff --git a/init.lua b/init.lua
index c3b6d9b..b17b046 100644
--- a/init.lua
+++ b/init.lua
@@ -120,6 +120,8 @@ vim.api.nvim_set_keymap('n', '<leader>ld', 'j^f$lC', { noremap = true })
vim.api.nvim_set_keymap('n', '<leader>ly', 'vapy<C-o>p{{jvEy}jvEpl', { noremap = true })
-- Shorcut to insert pudb statements for python
vim.api.nvim_set_keymap('n', '<leader>epu', 'ofrom pudb import set_trace; set_trace()<esc>', { noremap = true })
+-- Shorcut to embed ipython
+vim.api.nvim_set_keymap('n', '<leader>epi', 'ofrom IPython import embed<cr>from traitlets.config import get_config<cr>c = get_config()<cr>c.InteractiveShellEmbed.colors = "Linux"<cr>embed(config=c)<esc>', { noremap = true })
-- yank current word and make print statement on next line
vim.api.nvim_set_keymap('n', '<leader>epp', 'yiwoprint("<esc>pa: ", <esc>pa)<esc>V=', { noremap = true })
-- Easy new tab creation