Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jghauser/follow-md-links.nvim
Easily follow markdown links with this neovim plugin
https://github.com/jghauser/follow-md-links.nvim
links lua markdown neovim nvim plugin
Last synced: about 2 months ago
JSON representation
Easily follow markdown links with this neovim plugin
- Host: GitHub
- URL: https://github.com/jghauser/follow-md-links.nvim
- Owner: jghauser
- License: gpl-3.0
- Created: 2021-05-16T16:33:00.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-03-18T07:26:46.000Z (6 months ago)
- Last Synced: 2024-04-12T07:12:07.642Z (5 months ago)
- Topics: links, lua, markdown, neovim, nvim, plugin
- Language: Lua
- Homepage:
- Size: 31.3 KB
- Stars: 125
- Watchers: 1
- Forks: 13
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-neovim - jghauser/follow-md-links.nvim - Press enter to follow internal markdown links. (Programming Languages Support / Markdown and LaTeX)
README
# 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:
```lua
use {
'jghauser/follow-md-links.nvim'
}
```As this plugin uses [nvim-treesitter](https://github.com/nvim-treesitter/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 `` 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:
```lua
vim.keymap.set('n', '', ':edit #', { silent = true })
```