]> git.madduck.net Git - etc/vim.git/commit

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Follow named anchors with ge
authormemeplex <carlosjosepita@gmail.com>
Wed, 22 Feb 2017 16:52:36 +0000 (13:52 -0300)
committermemeplex <carlosjosepita@gmail.com>
Wed, 22 Feb 2017 17:15:05 +0000 (14:15 -0300)
commit256f9f10d3a43dc265ffd0ac8d416d4a33c6dbdc
tree2c9b69447db8b4b66b3d56a621d85e940b207ba5
parentd6d59eef6f604b6430fd6adade9e18364666232b
Follow named anchors with ge

This commit allows ge to follow named anchors in links of the form
file#anchor, where file may omit the .md extension as usual.

Two global variables control the operation of this feature:

    vim_markdown_follow_anchor: a flag that tells vim-markdown whether
    to attempt to follow a named anchor in a link or not. When this is
    1, and only if a link can be split in exactly two parts by the
    pattern '#', then the first part is interpreted as the file and the
    second one as the named anchor. After the file is opened, the anchor
    will be searched.

    vim_markdown_anchorexpr: if available this expression will be
    evaluated substituting v:anchor with a quoted string that contains
    the anchor to visit. The result of the evaluation will become the
    real anchor to search in the target file. This is useful in order to
    convert anchors of the form my-section-title to searches of the form
    My Section Title. It needs to be generic since every markdown
    renderer follows its own conventions to generate "auto-anchors".
    A dummy example: let vim_markdown_anchorexpr = "'<<'.v:anchor"

Note: I've also reformatted EditUrlUnderCursor a bit since it was
violating the 4-space tab and single-quoted string conventions that most
of the rest of the code seems to follow.
ftplugin/markdown.vim