Coder Social home page Coder Social logo

follow-md-links.nvim's Introduction

follow-md-links.nvim

This neovim plugin allows you to follow markdown links by pressing enter when the cursor is positioned on a link. It supports:

  • absolute file paths (e.g. [a file](/home/user/file.md))
  • relative file paths (e.g. [a file](../somefile.txt))
  • file paths beginning with ~ (e.g. [a file](~/folder/a_file)).
  • reference links (e.g. [a file][label]. [label]: ~/folder/a_file)
  • web links (e.g. [wikipedia](https://wikipedia.org))

Local files are opened in neovim and web links are opened with the default browser. Web links need to start with https:// or http:// to be identified properly.

This plugin is tested against the latest stable version of neovim. It might work with other versions, but this is not guaranteed.

Installation

Packer:

use {
  'jghauser/follow-md-links.nvim'
}

As this plugin uses nvim-treesitter to identify links, you will need that plugin, and you will need to make sure you have the treesitter markdown and markdown_inline parsers installed. You can check whether that is the case by looking at the entries in :checkhealth nvim-treesitter (there should be a tick in the "H" column). If the markdown parsers are missing, install it with TSInstall markdown markdown_inline or by adding them to ensure_installed in your nvim-treesitter setup function.

Configuration

The plugin maps <cr> in normal mode to open links in markdown files. You might also want to add the following keymap to easily go back to the previous file with backspace:

vim.keymap.set('n', '<bs>', ':edit #<cr>', { silent = true })

follow-md-links.nvim's People

Contributors

jghauser avatar tvanyo avatar ur4ltz avatar dogezen avatar barelyhuman avatar tobinpalmer avatar eightpigs 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.