luk400 / vim-jukit

Jupyter-Notebook inspired Neovim/Vim Plugin
MIT License
587 stars 23 forks source link

keymapping has error #67

Open cyoki opened 1 year ago

cyoki commented 1 year ago

I want to remap the keys like below

vim.keymap.set({'n', 'i'}, '\<f3>', '\<esc>\<cmd>call jukit#send#section(0)\<cr>\<esc>\<cmd>call jukit#convert#notebook_convert("jupyter-notebook")\<cr>')

but there's error:

Error detected while processing function jukit#send#section[10]..\<SNR>63_send_single_section[21]..\<SNR>63_send_to_split[14]..\<SNR>63_send[20]..jukit#convert#notebook_convert: line 3

but the code seems can run.

Thanks for your time!

luk400 commented 1 year ago

Hi! I tried out your key mapping and it works fine for me. The error suggests that the problem occurs in the third line of jukit#convert#notebook_convert function, when it tries to save the file before converting to a notebook. Did you by chance somehow try the mapping on a readonly file? Does the jukit#convert#notebook_convert function work on its own?