← Back to team overview

zim-wiki team mailing list archive

Re: Close notebook (or quit zim) from the command line? (Linux)

 

Hi John,

I do not believe it this is necessary to close zim in this case. Zim checks
the mtime on files when reading and writing, so will not easily overwrite
your edits. Assume zim is open and you edit the page in some other process,
then come back to zim, you will get an error on the first auto-save
(usually within seconds after you start editing). To avoid the error, just
press reload (Ctrl-R)  when you return to zim.

In future releases I will make it more seamless and have zim detect the
change before you start typing.

Regards,

Jaap


On Thu, Apr 9, 2015 at 11:14 PM, John R. Marks, IV <jrm4@xxxxxxxx> wrote:

> The short question is -- is there a way to issue a command to cleanly
> close a Zim notebook (or zim entirely) from a linux command line?
>
> Background/reasoning: I've been learning some Vim, and would like to
> integrate that into my workflow. So,
>
> (1) if I'm already inside Zim, I of course can use the "external edit"
> command;
>
> (2) but I'd like to be able to do this outside of Zim -- as in, pop into
> vim or gvim (or other editor), edit a file, and have it save properly. --
> now, of course, this isn't a problem either, unless Zim is already open, in
> which case my edits may get overwritten.
>
> So, my simple hack would be to write a little script+hotkey which says:
>
> - if zim is open, close it, then
> - open desired page in Vim
> - (optionally reopen zim)
>
> The short way (being able to close zim externally) would theoretically
> work fine, but, for example, killing the pid of the zim process does not
> work nicely for me. Any ideas? (I may be missing some other simpler
> solution)
>
>
> John
>
>
> _______________________________________________
> Mailing list: https://launchpad.net/~zim-wiki
> Post to     : zim-wiki@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~zim-wiki
> More help   : https://help.launchpad.net/ListHelp
>

References