Skip to content
This repository has been archived by the owner on Jan 14, 2024. It is now read-only.

Starting vim with new note fails with undefined var #53

Open
MartinPotier opened this issue Nov 24, 2020 · 12 comments
Open

Starting vim with new note fails with undefined var #53

MartinPotier opened this issue Nov 24, 2020 · 12 comments
Labels

Comments

@MartinPotier
Copy link

vim -g "+call neuron#edit_zettel_new()"

image

Can I/How can I do this?

@butgit
Copy link

butgit commented Nov 24, 2020

I replicated your command and it shows:

E233: cannot open display
Press ENTER or type command to continue

When I continue, I see:

Error detected while processing command line..function neuron#edit_zettel_new:
line    1:
"~/zettelkasten/517a280e.md" [New]
Press ENTER or type command to continue

Anyway, when I press enter, I can begin editing it in VIM without further problems. I can link it to other Zettels. I can also search other Zettels.

Have you checked if ag is installed? As read.me says, ag is required if you intend to use the content search command. In my case, I missed it during the setup. When I installed it and rebooted the OS, the problems similar to yours went away.

@MartinPotier
Copy link
Author

MartinPotier commented Nov 25, 2020

Hmm, interesting. I do have ag installed, and neuron works correctly if I don't try invoking the edit_zettel_new at vim start.

Maybe neuron#edit_zettel_new() requires some setup to be done before it can be invoked?

@fenetikm
Copy link
Collaborator

Just pushed a changed that hopefully fixes this - essentially it was trying to write the current buffer before creating the zettel but since there was no buffer yet it was throwing errors.

@MartinPotier
Copy link
Author

I have a different warning now:

image

This neuron_extension should already be defined, right (doc says it has a default -> .md)? Should I define it explicitely?

@MartinPotier
Copy link
Author

Actually, this error shows when I start vim, even without any arguments now.

@MartinPotier
Copy link
Author

Adding in my vim config:

let g:neuron_extension = '.md'

did not remove the error message :/ Admittedly, I do not understand vimscript.

@beandipper
Copy link

Hi Martin, this looks like the result of a recent commit. It looks like somebody had something similar and they were able to fix it by making sure that g:neuron_dir = "/your/zettekasten/here/" line in your config came after your plugin lines. See #51 (comment)

@MartinPotier
Copy link
Author

Oh bugger, my let g:neuron_dir = "/home/<me>/zk/" is the very last line on my vimrc…

@beandipper
Copy link

Did moving it fix the issue?

@MartinPotier
Copy link
Author

Should I? I understood it should be on the last line, therefore after the “plugin lines”

@fenetikm
Copy link
Collaborator

@beandipper could you please look at what happens if you change b to g for you in ftdetect - I've been thinking about it and unless you are running two different zettelkastens at the same time I don't think the use of a buffer variable for the directory is necessary.

@fenetikm
Copy link
Collaborator

fenetikm commented Dec 6, 2020

ok, as noted elsewhere the issue is because of neuron_extension - pushed a fix.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants