render markdown only line render
This commit is contained in:
parent
340430a5cd
commit
dde7d87052
@ -22,6 +22,7 @@ Nvim как менеджер заметок! Что еще нужно для с
|
||||
## Менеджер заметок
|
||||
|
||||
#### Функционал
|
||||
|
||||
- [nvim-treesitter](https://github.com/nvim-treesitter/nvim-treesitter) - Обработка синтаксиса
|
||||
- [nvim-cmp](https://github.com/hrsh7th/nvim-cmp) - Система автодополнения
|
||||
- [fzf-lua](https://github.com/ibhagwan/fzf-lua) - Fuzzy finder
|
||||
@ -52,6 +53,7 @@ Nvim как менеджер заметок! Что еще нужно для с
|
||||
- [zoxide.vim](https://github.com/nanotee/zoxide.vim) - Интеграция zoxide для быстрого перехода между директориями
|
||||
|
||||
#### Визуал
|
||||
|
||||
- [indent-blankline.nvim](https://github.com/lukas-reineke/indent-blankline.nvim) - Визуализация отступов
|
||||
- [tokyonight.nvim](https://github.com/folke/tokyonight.nvim) - Цветовая схема Tokyo Night
|
||||
- [gruvbox](https://github.com/morhetz/gruvbox) - Цветовая схема Gruvbox
|
||||
|
6
init.lua
6
init.lua
@ -16,3 +16,9 @@ require("config.fzf")
|
||||
require("config.mkdx")
|
||||
|
||||
require("config.mutton")
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
pattern = "mchat",
|
||||
callback = function()
|
||||
vim.opt_local.foldenable = false
|
||||
end,
|
||||
})
|
||||
|
@ -5,11 +5,11 @@ vim.api.nvim_set_hl(0, "EndOfBuffer", { fg = normal_bg} ) -- overrides `~` chara
|
||||
vim.api.nvim_set_hl(0, "VertSplit", { fg = normal_bg} ) -- overrides `~` character at the end of buffer
|
||||
vim.api.nvim_set_hl(0, "WinSeparator", { fg = normal_bg })
|
||||
|
||||
|
||||
local mutton = false
|
||||
local function on_buf_read()
|
||||
vim.defer_fn(function()
|
||||
local buf_name = vim.api.nvim_buf_get_name(0) -- Получаем имя файла
|
||||
print (buf_name)
|
||||
if buf_name:match("%.md$") and mutton == false then -- Проверяем, заканчивается ли имя на ".md"
|
||||
mutton = true
|
||||
vim.cmd("MuttonToggle")
|
||||
@ -28,6 +28,25 @@ end
|
||||
|
||||
vim.api.nvim_create_autocmd("BufEnter", { callback = on_buf_read })
|
||||
|
||||
|
||||
|
||||
-- ~/.config/nvim/init.lua
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
-- Создаем автокоманду для события QuitPre
|
||||
vim.api.nvim_create_autocmd("QuitPre", {
|
||||
callback = function()
|
||||
|
@ -1,12 +1,15 @@
|
||||
require('render-markdown').setup({
|
||||
render_modes = true,
|
||||
heading = {
|
||||
enabled = true,
|
||||
icons = { "", },
|
||||
position = 'inline',
|
||||
backgrounds = {
|
||||
border = { true, true, true, false, false, false},
|
||||
border_virtual = true,
|
||||
width = 'block',
|
||||
right_pad = 2,
|
||||
left_pad = 1,
|
||||
},
|
||||
},
|
||||
dash = { icon = '------ ' },
|
||||
sign = { enabled = false },
|
||||
quote = { repeat_linebreak = true },
|
||||
link = {
|
||||
|
@ -55,7 +55,15 @@ return {
|
||||
"rcarriga/nvim-notify",
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
"iamcco/markdown-preview.nvim",
|
||||
cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" },
|
||||
build = "cd app && yarn install",
|
||||
init = function()
|
||||
vim.g.mkdp_filetypes = { "markdown" }
|
||||
end,
|
||||
ft = { "markdown" },
|
||||
},
|
||||
-- ==============================
|
||||
-- Функциональные плагины
|
||||
-- ==============================
|
||||
@ -116,4 +124,41 @@ return {
|
||||
require("config.nvim-treesitter")
|
||||
end,
|
||||
},
|
||||
{
|
||||
'gsuuon/model.nvim',
|
||||
config = function()
|
||||
local bash_provider = {
|
||||
request_completion = function(handlers, params, options)
|
||||
local input = params.input
|
||||
local command = "~/test '" .. input .. "'"
|
||||
local handle = io.popen(command)
|
||||
local result = handle:read("*a")
|
||||
handle:close()
|
||||
|
||||
local response = vim.json.decode(result)
|
||||
handlers.on_partial(response.message.content)
|
||||
handlers.on_finish()
|
||||
end
|
||||
}
|
||||
|
||||
require('model').setup({
|
||||
chats = {
|
||||
mybash = {
|
||||
provider = bash_provider,
|
||||
create = function(input, context)
|
||||
return {
|
||||
messages = {
|
||||
{ role = 'user', content = input }
|
||||
}
|
||||
}
|
||||
end,
|
||||
run = function(messages, config)
|
||||
local last_message = messages[#messages]
|
||||
return { input = last_message.content }
|
||||
end
|
||||
}
|
||||
}
|
||||
})
|
||||
end
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user