{"id":14984313,"url":"https://github.com/jamshedvesuna/vim-markdown-preview","last_synced_at":"2025-04-04T20:10:11.734Z","repository":{"id":19744486,"uuid":"23001221","full_name":"JamshedVesuna/vim-markdown-preview","owner":"JamshedVesuna","description":"A light Vim plugin for previewing markdown files in a browser - without leaving Vim.","archived":false,"fork":false,"pushed_at":"2021-10-30T11:46:12.000Z","size":8462,"stargazers_count":580,"open_issues_count":39,"forks_count":91,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-03-28T19:07:39.285Z","etag":null,"topics":["google-chrome","grip","markdown","preview","vim","vim-plugins"],"latest_commit_sha":null,"homepage":"","language":"Vim script","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JamshedVesuna.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-08-15T19:53:55.000Z","updated_at":"2025-01-21T19:15:27.000Z","dependencies_parsed_at":"2022-09-11T22:01:07.912Z","dependency_job_id":null,"html_url":"https://github.com/JamshedVesuna/vim-markdown-preview","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JamshedVesuna%2Fvim-markdown-preview","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JamshedVesuna%2Fvim-markdown-preview/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JamshedVesuna%2Fvim-markdown-preview/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JamshedVesuna%2Fvim-markdown-preview/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JamshedVesuna","download_url":"https://codeload.github.com/JamshedVesuna/vim-markdown-preview/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247242678,"owners_count":20907134,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["google-chrome","grip","markdown","preview","vim","vim-plugins"],"created_at":"2024-09-24T14:08:50.619Z","updated_at":"2025-04-04T20:10:11.717Z","avatar_url":"https://github.com/JamshedVesuna.png","language":"Vim script","funding_links":[],"categories":[],"sub_categories":[],"readme":"Vim Markdown Preview\n====================\n\n- [Intro](#intro)\n- [Installation](#installation)\n- [Usage](#usage)\n- [Requirements](#requirements)\n    - [Mac OS X](#mac-os-x)\n    - [Unix](#unix)\n- [Options](#options)\n    - [Image rendering \u0026 save on buffer write](#toggle)\n    - [Hotkey](#hotkey)\n    - [Browser](#browser)\n    - [Temp File](#temp)\n    - [Github Flavoured Markdown](#github)\n    - [Markdown.pl](#perl)\n    - [Pandoc](#pandoc)\n    - [Use xdg-open](#xdg)\n- [Behind the Scenes](#behind-the-scenes)\n\nIntro\n-----\nA small Vim plugin for previewing markdown files in a browser.\n\nThe aim of this plugin is to be light weight with minimal dependencies. Thus, there is *no* polling engine or webserver involved.\n\n![Screenshot](http://i.imgur.com/1hvnXwA.gif?raw=true \"Preview on buffer write using Unix\")\n\nInstallation\n------------\n\n* With [Pathogen](https://github.com/tpope/vim-pathogen): Place `vim-markdown-preview/` in `.vim/bundle/`.\n* With [Vundle](https://github.com/VundleVim/Vundle.vim):\n    * Add `Plugin 'JamshedVesuna/vim-markdown-preview'` to your `.vimrc`.\n    * Launch `vim` and run `:PluginInstall`\n\nSee more [Options](#options).\n\nUsage\n-----\n\nBy default, when in a `.markdown` or `.md` file, and  `Ctrl-p` is pressed, this plugin will either open a preview in your browser, or refresh your current preview (can be remapped, see [Options](#options)).\n\nYour cursor will remain in Vim.\n\nRequirements\n------------\n\n### Mac OS X:\n\n* [Markdown](http://daringfireball.net/projects/markdown/) or [grip](https://github.com/joeyespo/grip) (for [GitHub flavoured markdown](#github))\n    * If using Grip, put `let vim_markdown_preview_github=1` in your `.vimrc` file\n* [Safari](https://www.apple.com/safari/)\n\n### Unix:\n\n* [Markdown](http://daringfireball.net/projects/markdown/) or [grip](https://github.com/joeyespo/grip) (for [GitHub flavoured markdown](#github))\n    * If using Grip, put `let vim_markdown_preview_github=1` in your `.vimrc` file\n* [xdotool](https://github.com/jordansissel/xdotool)\n* [Google Chrome](https://www.google.com/chrome/browser/) or [other browser](https://github.com/JamshedVesuna/vim-markdown-preview/wiki/Use-other-browser-to-preview-markdown#ubuntu-or-debian)\n\nIt is recommended to use grip when rendering Unicode characters.\n\nOptions\n-------\nAll options have default values and work out of the box. If you prefer to change these, just add the following lines to your [.vimrc](http://vim.wikia.com/wiki/Open_vimrc_file) file.\nNote that after changing an option, you have to restart Vim for the change to take effect.\n\n\u003ca name='toggle'\u003e\u003c/a\u003e\n### The `vim_markdown_preview_toggle` option\n\nThis option does two things (to be fixed by [#17](https://github.com/JamshedVesuna/vim-markdown-preview/issues/17)):\n\n1. Display images in the preview\n2. Generate preview on buffer write (Example: on `:w`)\n\nThere are a total of four values (`0`, `1`, `2`, `3`) this option can take.\n\nDefault: `0`, which maps Control p (*not* a buffer write) to generating the preview and does *not* display images.\n\nExample: To display images with the [hotkey](#hotkey) mapping (defaults to Control p).\n```vim\nlet vim_markdown_preview_toggle=1\n```\n\nExample: To display images automatically on buffer write.\n```vim\nlet vim_markdown_preview_toggle=2\n```\n\nExample: To disregard images and still automatically preview on buffer write.\n```vim\nlet vim_markdown_preview_toggle=3\n```\n\n\u003ca name='hotkey'\u003e\u003c/a\u003e\n### The `vim_markdown_preview_hotkey` option\n\nBy default, this plugin maps `\u003cC-p\u003e` (Control p) to activate the preview. To remap Control p to a different hotkey, change the binding. Don't forget to add the single quotation marks.\n\nDefault: `'\u003cC-p\u003e'`\n\nExample: Mapping Control M.\n```vim\nlet vim_markdown_preview_hotkey='\u003cC-m\u003e'\n```\n\n\u003ca name='browser'\u003e\u003c/a\u003e\n### The `vim_markdown_preview_browser` option\n\nBy default, if you are using Unix, [Google Chrome](https://www.google.com/chrome/) is the default browser. If you are on Mac OS X, [Safari](https://www.apple.com/safari/) is the default.\nNote that bug [#16](https://github.com/JamshedVesuna/vim-markdown-preview/issues/16) does not allow cross operating system and browser support. See the [wiki page](https://github.com/JamshedVesuna/vim-markdown-preview/wiki/Use-other-browser-to-preview-markdown) for more help.\n\nDefault: `'Google Chrome'`\n\nExample: Using Google Chrome.\n```vim\nlet vim_markdown_preview_browser='Google Chrome'\n```\n\n\u003ca name='temp'\u003e\u003c/a\u003e\n### The `vim_markdown_preview_temp_file` option\n\nBy default, this plugin keeps the rendered `.html` file. If you would automatically like to remove the html file after opening it in a browser, set this option to `1`. Note that removing the rendered html file with a slow browser may err.\n\nDefault: `0`\n\nExample: Remove the rendered preview.\n```vim\nlet vim_markdown_preview_temp_file=1\n```\n\n\u003ca name='github'\u003e\u003c/a\u003e\n### The `vim_markdown_preview_github` option\n\nIf you prefer [GitHub flavoured markdown](https://help.github.com/articles/github-flavored-markdown/) you need to install [Python grip](https://github.com/joeyespo/grip). Note that this makes a request to [GitHub's API](https://developer.github.com/v3/markdown/) (causing latencies) and may require [authentication](https://github.com/joeyespo/grip#access). This option also requires a network connection.\n\nDefault: `0`\n\nExample: Use GitHub flavoured markdown.\n```vim\nlet vim_markdown_preview_github=1\n```\n\n\u003ca name='perl'\u003e\u003c/a\u003e\n### The `vim_markdown_preview_perl` option\nIf you prefer to use John Gruber's [Markdown.pl](https://daringfireball.net/projects/markdown/) to render HTML, set the following flag:\n\nDefault: `0`\n\nExample: Use Markdown.pl to render HTML.\n```vim\nlet vim_markdown_preview_perl=1\n```\n\n\u003ca name='pandoc'\u003e\u003c/a\u003e\n### The `vim_markdown_preview_pandoc` option\nIf you prefer to use John MacFarlane's [Pandoc](http://pandoc.org/) to render HTML, set the following flag:\n\nDefault: `0`\n\nExample: Use Pandoc to render HTML.\n```vim\nlet vim_markdown_preview_pandoc=1\n```\n\n\u003ca name='xdg'\u003e\u003c/a\u003e\n### The `vim_markdown_preview_use_xdg_open` option\n\nIf your system does not come with `see`, and you would like to use `xdg-open` to view your rendered html in the browser, set the following flag:\n\nDefault: `0`\n\nExample: Use `xdg-open`.\n```vim\nlet vim_markdown_preview_use_xdg_open=1\n```\n\nBehind The Scenes\n-----------------\n\n1. First, this plugin renders your markdown as html and creates a temporary html file.\n    * If [image rendering](#toggle) is on, the html file will be in your [working directory](https://en.wikipedia.org/wiki/Working_directory).\n    * Otherwise, it will be in `/tmp/`.\n2. Next, this plugin either opens the html file or refreshes the Google Chrome or Safari tab.\n    * If you are using GitHub flavoured markdown, `grip` will make a call to the GitHub API and retrieve the html.\n3. Lastly, if you choose, this plugin will remove the temporary file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjamshedvesuna%2Fvim-markdown-preview","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjamshedvesuna%2Fvim-markdown-preview","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjamshedvesuna%2Fvim-markdown-preview/lists"}