jannis-baum / vivify.vim Goto Github PK
View Code? Open in Web Editor NEWLive Markdown viewer for Vim and Neovim powered by Vivify
Home Page: https://github.com/jannis-baum/vivify
Live Markdown viewer for Vim and Neovim powered by Vivify
Home Page: https://github.com/jannis-baum/vivify
Hey, I've identified that one of my most common habits of opening a viewer is reading a markdown document far down somewhere, and wanting to preview that same section.
But the way it's currently set up is that it opens at top, and I have focus back to (n)vim and do a jk
or something.
Of course at first I thought it'd be as simple as doing call vivify#sync_cursor()
after first opening viv like so:
function! vivify#open()
" Note: nvim's jobstart doesn't use these opt keys
call s:job_start(
\ ['viv', expand('%:p')],
\ {"in_io": "null", "out_io": "null", "err_io": "null"}
\)
call vivify#sync_cursor()
endfunction
However then it tries syncing cursor before the webpage has finished loading (I believe?)
Putting a 1 second sleep before sync_cursor works:
function! vivify#open()
" Note: nvim's jobstart doesn't use these opt keys
call s:job_start(
\ ['viv', expand('%:p')],
\ {"in_io": "null", "out_io": "null", "err_io": "null"}
\)
exec 'sleep'
call vivify#sync_cursor()
endfunction
So...
Do you know of an easy way to do the sync_cursor at the exact time the webpage has finished loading?
Maybe I could find something in how Vim's job control works. Thought I'd ask if this is something you know off the top of your head.
Also, agree it's something that should be added?
Hi,
first of all thanks for the plugin, I really like functionality and the lightweight and structured way all of vivify is written.
However, it unfortunately seems to be incompatible with the vimwiki plugin. Whenever I activate it (using vims native plugin manager), the synchronisation ceases to work. After disabling vimwiki's autocommands using :au! vimwiki
and reloading the buffer using :e
, synchronisation automatically resumes.
Do you by any chance know why this could be?
All the best.
Hi, I was going to try creating a NeoVim version of this, since job_start()
doesn't exist in nvim. However I noticed that the only change it needs is to drop the underscore so job_start()
=> jobstart()
and looks like it works as expected in nvim.
Would you prefer to create a separate nvim plugin (I would be willing to maintain too) or add something like
if has('nvim')
" use 'jobstart'
else
" use 'job_start'
endif
in vivify.vim
?
I'm kinda bummed out about how slowly the page refreshes after saving file. Would this be easy to change or configurable if necessary?
I have a couple related questions with that:
- Would it be possible to refresh page even without having to save?
- Sometimes I run into this: trying to open an empty file doesn't work, it needs to have > like at least one character in the contents
^ Both of the above occur to me when I use Vivify as sort of a live-notetaking side preview
Edit:
Oh yeah, some of this might be about the vim plugin
Originally posted by @tuurep in jannis-baum/Vivify#35 (comment)
Discussed in context of #5
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.