Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Nedra1998/nvim-mdlink
Useful functionality for working with links in markdown
https://github.com/Nedra1998/nvim-mdlink
lua neovim nvim nvim-cmp
Last synced: about 1 month ago
JSON representation
Useful functionality for working with links in markdown
- Host: GitHub
- URL: https://github.com/Nedra1998/nvim-mdlink
- Owner: Nedra1998
- License: mit
- Created: 2022-12-30T21:46:56.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-02-26T03:50:37.000Z (10 months ago)
- Last Synced: 2024-08-02T06:19:19.868Z (4 months ago)
- Topics: lua, neovim, nvim, nvim-cmp
- Language: Lua
- Homepage:
- Size: 35.2 KB
- Stars: 20
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
- awesome-neovim - Nedra1998/nvim-mdlink - Simplify creating and following markdown links. (Programming Languages Support / Markdown and LaTeX)
README
# nvim-mdlink
**nvim-mdlink** provides additional functionality when working with markdown
links.## :sparkles: Features
- Follow link under cursor
- Create new link from selected text
- Open links in the default browser
- Open binary files in the system default application
- [nvim-cmp](https://github.com/hrsh7th/nvim-cmp) markdown link completion integration## :zap: Requirements
- [Neovim >= **0.8.0**](https://github.com/neovim/neovim/wiki/Installing-Neovim)
- [Treesitter](https://github.com/nvim-treesitter/nvim-treesitter)
- [markdown](https://github.com/MDeiml/tree-sitter-markdown)
- [markdown-inline](https://github.com/MDeiml/tree-sitter-markdown)## :package: Installation
Install with [vim-plug](https://github.com/junegunn/vim-plug):
```vim
Plug 'Nedra1998/nvim-mdlink'
```or with [packer.nvim](https://github.com/wbthomason/packer.nvim):
```lua
use { 'Nedra1998/nvim-mdlink' }
```or with [lazy.nvim](https://github.com/folke/lazy.nvim):
```lua
{ 'Nedra1998/nvim-mdlink' }
```## :gear: Configuration
```lua
require('nvim-mdlink').setup({
keymap = true,
cmp = true
})
```For a complete list of available configuration options see [:help
nvim-mdlink-configuration](https://github.com/Nedra1998/nvim-mdlink/blob/master/doc/nvim-mdlink.txt).Each option is documented in `:help nvim-mdlink.OPTION_NAME`.
## :rocket: Usage
### Keybinding
See [:help nvim-mdlink-mappings](https://github.com/Nedra1998/nvim-mdlink/blob/master/doc/nvim-mdlink.txt).
| Keybinding | Description |
| ---------- | ------------------------------------------------------ |
| `` | Follow the link under the cursor, or create a new link |
| `` | After following a link, go back to the previous file |### nvim-cmp Integration
If [nvim-mdlink.cmp](https://github.com/Nedra1998/nvim-mdlink/blob/master/doc/nvim-mdlink.txt)
is `true`, then the `mdlink` completion source will be registered in nvim-cmp is available (i.e. if nvim-cmp has already been loaded by your plugin manager). If nvim-mdlink is loaded before nvim-cmp, then you will need to manually register the completion source in the configuration for nvim-cmp, by using the following snippet.```lua
local has_mdlink, mdlink = pcall(require, "nvim-mdlink.cmp")
if has_mdlink then
require('cmp').register_source("mdlink", mdlink.new())
end
```Then you are able to make use the the mdlink completion source in your nvim-cmp configuration.
```lua
require('cmp').setup {
sources = {
{ name = 'mdlink' }
}
}
```