add markdown preview
parent
46d493db65
commit
ae9fc10678
@ -1,34 +1,34 @@
|
|||||||
return {
|
-- return {
|
||||||
{ 'kevinhwang91/nvim-ufo',
|
-- { 'kevinhwang91/nvim-ufo',
|
||||||
dependecies = { 'kevinhwang91/promise-async' },
|
-- dependecies = { 'kevinhwang91/promise-async' },
|
||||||
config = function()
|
-- config = function()
|
||||||
vim.o.foldcolumn = "1" -- '0' is not bad
|
-- vim.o.foldcolumn = "2" -- '0' is not bad
|
||||||
vim.o.foldlevel = 99 -- Using ufo provider need a large value, feel free to decrease the value
|
-- vim.o.foldlevel = 99 -- Using ufo provider need a large value, feel free to decrease the value
|
||||||
vim.o.foldlevelstart = 99
|
-- vim.o.foldlevelstart = 99
|
||||||
vim.o.foldenable = true
|
-- vim.o.foldenable = true
|
||||||
vim.o.fillchars = [[eob: ,fold: ,foldopen:,foldsep: ,foldclose:]]
|
-- vim.o.fillchars = [[eob: ,fold: ,foldopen:,foldsep: ,foldclose:]]
|
||||||
|
--
|
||||||
-- Using ufo provider need remap `zR` and `zM`. If Neovim is 0.6.1, remap yourself
|
-- -- Using ufo provider need remap `zR` and `zM`. If Neovim is 0.6.1, remap yourself
|
||||||
vim.keymap.set('n', 'zR', require('ufo').openAllFolds)
|
-- vim.keymap.set('n', 'zR', require('ufo').openAllFolds)
|
||||||
vim.keymap.set('n', 'zM', require('ufo').closeAllFolds)
|
-- vim.keymap.set('n', 'zM', require('ufo').closeAllFolds)
|
||||||
|
--
|
||||||
|
--
|
||||||
-- Option 2: nvim lsp as LSP client
|
-- -- Option 2: nvim lsp as LSP client
|
||||||
-- Tell the server the capability of foldingRange,
|
-- -- Tell the server the capability of foldingRange,
|
||||||
-- Neovim hasn't added foldingRange to default capabilities, users must add it manually
|
-- -- Neovim hasn't added foldingRange to default capabilities, users must add it manually
|
||||||
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
-- local capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||||
capabilities.textDocument.foldingRange = {
|
-- capabilities.textDocument.foldingRange = {
|
||||||
dynamicRegistration = false,
|
-- dynamicRegistration = false,
|
||||||
lineFoldingOnly = true
|
-- lineFoldingOnly = true
|
||||||
}
|
-- }
|
||||||
local language_servers = require("lspconfig").util.available_servers() -- or list servers manually like {'gopls', 'clangd'}
|
-- local language_servers = require("lspconfig").util.available_servers() -- or list servers manually like {'gopls', 'clangd'}
|
||||||
for _, ls in ipairs(language_servers) do
|
-- for _, ls in ipairs(language_servers) do
|
||||||
require('lspconfig')[ls].setup({
|
-- require('lspconfig')[ls].setup({
|
||||||
capabilities = capabilities
|
-- capabilities = capabilities
|
||||||
-- you can add other fields for setting up lsp server in this table
|
-- -- you can add other fields for setting up lsp server in this table
|
||||||
})
|
-- })
|
||||||
end
|
-- end
|
||||||
require('ufo').setup()
|
-- require('ufo').setup()
|
||||||
end,
|
-- end,
|
||||||
}
|
-- }
|
||||||
}
|
-- }
|
||||||
|
@ -0,0 +1,11 @@
|
|||||||
|
-- if does not work, go manually in the folder .local/share/nvim/site/pack/packer/start/markdown-preview.nvim/app and run yarn install
|
||||||
|
|
||||||
|
return {
|
||||||
|
"iamcco/markdown-preview.nvim",
|
||||||
|
run = "cd app && yarn install",
|
||||||
|
setup = function()
|
||||||
|
vim.g.mkdp_filetypes = {
|
||||||
|
"markdown" }
|
||||||
|
end,
|
||||||
|
ft = { "markdown" }
|
||||||
|
}
|
Loading…
Reference in New Issue