Skip to content

Markdown like keymaps for toggling text formatting

Notifications You must be signed in to change notification settings

Urthor/markdowny.nvim

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 

Repository files navigation

markdowny.nvim

Neovim plugin for markdown like keybindings. Similar to notion, discord, slack etc

plugin demo

Install

-- packer
use {
    'antonk52/markdowny.nvim',
    config = function()
        require('markdowny').setup()
    end
}

require('markdowny').setup()
-- lazy.nvim
{
    'antonk52/markdowny.nvim'
    config = function()
        require('markdowny').setup()
    end
}

Setup Options

  • filetypes a table of filetypes to add markdowny keymaps. Default {'markdown'}
require('markdowny').setup({filetypes = {'markdown', 'txt'}})

Keymaps

All in visual mode

  • <C-k> add link to visually selected text
  • <C-b> toggle visually selected text bold
  • <C-i> toggle visually selected text italic

Custom setup

Alternatively to default keymaps you can use custom keymaps. Make sure to keymap to a string, not lua function. Defaults

vim.keymap.set('v', '<C-b>', ":lua require('markdowny').bold()<cr>", { buffer = 0 })
vim.keymap.set('v', '<C-i>', ":lua require('markdowny').italic()<cr>", { buffer = 0 })
vim.keymap.set('v', '<C-k>', ":lua require('markdowny').link()<cr>", { buffer = 0 })

Acknowledgments

This plugin uses vim.ui.input to prompt for link's href, to have it in a floating window, like in the demo above, you can use dressing.nvim.

About

Markdown like keymaps for toggling text formatting

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Lua 100.0%