Giter VIP home page Giter VIP logo

vim-livemark2's Introduction

vim-livemark

Real-time markdown preview plugin for vim.

!!! NOT STABLE !!!

Requirements

Latest Vim which has +channel and +job features.

Python 3.5+ and wdom, misaka, and pygments are also required to be installed in your python.

To install them:

pip3 install -U wdom misaka pygments

Or,

python3 -m pip intsall -U wdom misaka pygments

Install

When clone into your pack/start, need --recurcive option since this plugin includes git-submodule.

git clone --recurcive https://github.com/miyakogi/vim-livemark2

Usage

Open markdown file and execute :LiveMark. This command opens browser window and starts real-time preview.

To stop previewing, execute :LiveMarkDisable command.

Theming

By adding theme-name as an argument of the :LiveMark command, livemark change theme of the preview window. To see available themes, press <Tab> key after :LiveMark on vim. Default theme is skyblue.

Note: Former version supported use-define js/css files, but current version does not support this feature.

Scrolling Browser

LiveMark.vim has BrowserMode.

When execute :LiveMarkBrowserMode, some keys (j/k/<C-d>/<C-u>/<C-f>/<C-b>/gg/G) become to move browser window, not vim. To exit this mode, press <Esc> key or execute :LiveMarkBrowserModeExit.

TODO: prepare screen cast.

Note: Former version has cursor sync feature, but its removed now.

Configuration

Python binary

This plugin uses python3 installed in your path by default. If you want to use another python, you can specify the path as follows:

let g:livemark_python = '/path/to/python/binary'  " default 'python3'

Browser

By default, this plugin use system's default browser to show preview. To use other browser, for example, firefox, set g:livemark_browser variable in your vimrc.

let g:livemark_browser = 'firefox'

This value is passed to python's webbrowser module. Available browsers and corresponding names are listed here.

Connections

For now, this plugin uses two ports; one for tornado web-server (8089), and the other for sending markdown texts from vim (8090). If you want to change these port numbers, add the following lines to your vimrc and change values as you like.

let g:livemark_browser_port = 8089
let g:livemark_vim_port = 8090

Default theme

Default theme can change via g:livemark_theme option. The following setting change default theme to bootstrap3.

let g:livemark_theme = "bootstrap3"

This setting can be overridden by :LiveMark command's argument.

Syntax highlighting

LiveMark.vim supports code blocks and syntax highlighting. If you change theme of the code block, add the below option.

let g:livemark_highlight_theme = 'friendly'  " default ''

To list all available themes, run below command in shell.

python3 -c "import pygments.styles; print(pygments.styles.STYLE_MAP.keys())"

License

MIT License

vim-livemark2's People

Contributors

miyakogi avatar

Stargazers

Too large to fit in the margin avatar Eric Iniguez avatar

Watchers

James Cloos avatar  avatar  avatar

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.