Git Product home page Git Product logo

mkdocs-vim-md-tags-plugin's Introduction

mkdocs-vim-md-tags-plugin

An MkDocs plugin that generates a vim tags file for autocompleting and navigating through markdown pages.

demo

The above demo shows how the plugin can be used to rapidly develop wiki-style interconnected pages in a very organic way. While writing the space article, the author decides to link to a new article called universe, for which a file does not yet exist. So the author creates the file, and---as long as an instance of mkdocs serve is running in the background---the plugin generates a new tags file that includes universe.md, which the author can then navigate to and begin filling out the new article.

This way of authoring pages allows for articles to be highly interconnected. The best time to contextually link between articles is while the content is being generated. No one is going to come back and link together pages after the fact. This plugin allows for these connections to be created in a very straightforward and easy manner.

This plugin takes advantage of vim's build in tag system. type :help tags while in vim for more information on tags. For the purposes of this plugin, the two most imporant keybindings to remember are:

Ctrl+] - This command jumps to the tag underneath the cursor.

Ctrl+t - This command returns to the previous entry in the tag stack.

Install the Plugin

Install the plugin using pip:

pip install mkdocs-vim-md-tags-plugin

Activate the plugin in mkdocs.yml:

plugins:
  - search
  - vim-md-tags

Note: If you have no plugins entry in your config file yet, you'll likely also want to add the search plugin. MkDocs enables it by default if there is no plugins entry set, but now you have to enable it explicitly.

More information about plugins in the MkDocs documentation.

Add tag file to vim

Edit your vimrc file

vim ~/.vimrc

Add this plugin's tags file to the list of tags

set tags=./md_tags;/

vim should now recursively load the tags file as long as it was started from somewhere in the MkDocs site structure from which it was generated.

Getting YouCompleteMe autocomplete

If you use YouCompleteMe, you can tell it to load the tags file to get autocompletion of the markdown file names by adding the following to your ~/.vimrc

let g:ycm_collect_identifiers_from_tags_files = 1
let g:ycm_filetype_blacklist = {}

Config

  • tag_file - Sets the filename of the tags file to be generated

See Also

More information about templates here.

More information about blocks here.

mkdocs-vim-md-tags-plugin's People

Contributors

mcstclai avatar zachhannum avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

mcstclai

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.