Vim plugin for preview GLSL and WGSL (only fragment shader). This plugin is inspired from previm/previm
- GLSL ES 1.0
- Browser must support WebGL 1.0 or above.
- GLSL ES 3.0
- Browser must support WebGL 2.0.
- WGSL
- Browser must support WebGPU.
- EXPERIMENTAL
No need for extra libraries or plug-ins.
It can, however, be integrated with open-browser.vim. For detailed usages, please see below.
- Define
g:previmglsl_open_cmd
in .vimrc- This command is used in terminal for opening your browser.
- For example, uses Safari on Mac
let g:previmglsl_open_cmd = 'open -a Safari'
:help g:previmglsl_open_cmd
for more details- You can skip this setting if you're using open-browser.
- Start editing the file of Markdown.(
filetype
ismarkdown
) - Run
:PrevimGlslOpen
to open browser to preview - Back to Vim to edit your file
- Update the file, and the content for previewing will be updated automatically
To force a refresh run :PrevimGlslRefresh
. To clear the preview cache (in dir PLUGIN_INSTALL/preview) run :PrevimGlslWipeCache
.
There is an issue using Safari 13.0.3, which page transition stops after "Loading...".
You need to set up below to make previmglsl work on Safari.
- Safari > Preference > Advanced > check "Show develop menu" in menubar
- Develop > Disable Local File Restrictions
This software is released under the public domain, see LICENSE.