GithubHelp home page GithubHelp logo

jannis-baum / vivify.vim Goto Github PK

View Code? Open in Web Editor NEW
6.0 2.0 3.0 23 KB

Live Markdown viewer for Vim and Neovim powered by Vivify

Home Page: https://github.com/jannis-baum/vivify

Vim Script 100.00%
markdown-viewer vim-markdown

vivify.vim's People

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

azic0 tuurep

vivify.vim's Issues

Sync cursor when first opening on viewer

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?

Make filetypes with auto-syncing customizable

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.

NeoVim support

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 ?

Configure refreshing speed

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.