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

How to dump a markdown file straight-away? #88

Closed
symbolix opened this issue Oct 19, 2014 · 3 comments
Closed

How to dump a markdown file straight-away? #88

symbolix opened this issue Oct 19, 2014 · 3 comments

Comments

@symbolix
Copy link

Hi,

I am trying to integrate a note taking project with a git repository. I keep my notes, but also would like to have an markdown version the moment I save my note. In this way I can push the markdown files to my git repository once I save my note. Is this possible?

Well, I tried to create an "au BufWritePre" workflow, but it seems like I cannot any kind of a BufWrite behaviour to work? If I were to get that working, I could have written a function to dump a markdown file in parallel, but no success so far.

Any ideas?

Thanks.

@xolox
Copy link
Owner

xolox commented Oct 20, 2014

Hi symbolix,

I tried defining a BufWritePost automatic command that would be triggered after a note is saved but was unable to get it working; the automatic command is never triggered. This confirms your issue.

I suspected that the use of the BufWriteCmd automatic command by vim-notes is the cause of this so I tried to find a reference in the Vim documentation. Unfortunately this part of the manual is somewhat thin so I couldn't find anything. However I took a look at the netrw plug-in bundled with Vim and indeed it manually triggers BufWritePre and BufWritePost automatic commands.

I'll see if I can do the same in vim-notes. The only problem is the unexpected fallout this can create because I'll suddenly be enabling BufWritePre and BufWritePost automatic commands that have previously always been disabled while editing notes... I can think of one way to find out :-)

xolox added a commit that referenced this issue Oct 20, 2014
It's hard to estimate the consequences of this change, but there's really
only one way to find out, hence I'm committing the change. The previous
behavior was a bug anyway, it's just that it could have been hiding a lot
of other bugs and incompatibilities until now... I'm keeping my fingers
crossed ;-)

See also issue #88 on GitHub:
  #88
@xolox
Copy link
Owner

xolox commented Oct 20, 2014

I just released vim-notes 0.28, please try it out and let me know whether it resolves your issue. Cheers!

@xolox
Copy link
Owner

xolox commented Nov 11, 2014

Hey @symbolix, I'm pretty sure you can use a BufWritePost automatic command to do what you had in mind with the latest version of vim-notes, so I'm going to close this issue. If you're still having trouble with this please feel free to reopen this issue or report a new one. Thanks for the bug report and happy Vimming!

@xolox xolox closed this as completed Nov 11, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants