init
This commit is contained in:
73
lua/config/render-markdown.lua
Normal file
73
lua/config/render-markdown.lua
Normal file
@ -0,0 +1,73 @@
|
||||
require('render-markdown').setup({
|
||||
debounce = 100,
|
||||
-- render_modes = true,
|
||||
heading = {
|
||||
enabled = true,
|
||||
icons = { "", },
|
||||
position = 'inline',
|
||||
border = { true, true, true, false, false, false},
|
||||
border_virtual = true,
|
||||
width = 'block',
|
||||
right_pad = 1,
|
||||
left_pad = 1,
|
||||
},
|
||||
sign = { enabled = false },
|
||||
quote = { repeat_linebreak = true },
|
||||
link = {
|
||||
enabled = true,
|
||||
render_modes = false,
|
||||
footnote = {
|
||||
superscript = false,
|
||||
prefix = '',
|
||||
suffix = '',
|
||||
},
|
||||
image = ' ',
|
||||
email = ' ',
|
||||
hyperlink = '',
|
||||
highlight = 'RenderMarkdownLink',
|
||||
wiki = {
|
||||
icon = ' ',
|
||||
body = function()
|
||||
return nil
|
||||
end,
|
||||
highlight = 'RenderMarkdownWikiLink',
|
||||
},
|
||||
custom = {
|
||||
web = { pattern = '^http', icon = ' ' },
|
||||
discord = { pattern = 'discord%.com', icon = ' ' },
|
||||
github = { pattern = 'github%.com', icon = ' ' },
|
||||
gitlab = { pattern = 'gitlab%.com', icon = ' ' },
|
||||
google = { pattern = 'google%.com', icon = ' ' },
|
||||
neovim = { pattern = 'neovim%.io', icon = ' ' },
|
||||
reddit = { pattern = 'reddit%.com', icon = ' ' },
|
||||
stackoverflow = { pattern = 'stackoverflow%.com', icon = ' ' },
|
||||
wikipedia = { pattern = 'wikipedia%.org', icon = ' ' },
|
||||
youtube = { pattern = 'youtube%.com', icon = ' ' },
|
||||
},
|
||||
},
|
||||
checkbox = {
|
||||
unchecked = { icon = '✘ ' },
|
||||
checked = { icon = '✔ ' },
|
||||
},
|
||||
bullet = { icons = { '•', '◦', '-',} },
|
||||
})
|
||||
|
||||
|
||||
|
||||
|
||||
-- переход по ссылкам
|
||||
vim.keymap.set('n', 'gl', function() FindHttpOrWwwInLine() end, { silent = true })
|
||||
|
||||
function FindHttpOrWwwInLine()
|
||||
local line = vim.api.nvim_get_current_line()
|
||||
local start_pos, end_pos = line:find("http")
|
||||
if start_pos then
|
||||
local col = start_pos - 1
|
||||
vim.api.nvim_win_set_cursor(0, {vim.fn.line('.'), col})
|
||||
vim.cmd("normal! vE")
|
||||
vim.fn.feedkeys("gx")
|
||||
vim.api.nvim_input("<Esc>")
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user