From d49177afd9806f651c0177f9cc68c5a22dba2938 Mon Sep 17 00:00:00 2001 From: Michael Lingelbach Date: Sat, 6 Mar 2021 20:04:03 -0800 Subject: lsp: add custom syntax rules for lsp floating window --- runtime/lua/vim/lsp/util.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'runtime/lua/vim/lsp/util.lua') diff --git a/runtime/lua/vim/lsp/util.lua b/runtime/lua/vim/lsp/util.lua index 6fb9f09c99..e611ad3220 100644 --- a/runtime/lua/vim/lsp/util.lua +++ b/runtime/lua/vim/lsp/util.lua @@ -873,8 +873,11 @@ function M.fancy_floating_markdown(contents, opts) -- This is because the syntax command doesn't accept a target. local cwin = vim.api.nvim_get_current_win() vim.api.nvim_set_current_win(winnr) + api.nvim_win_set_option(winnr, 'conceallevel', 2) + api.nvim_win_set_option(winnr, 'concealcursor', 'n') - vim.cmd("ownsyntax markdown") + vim.cmd("ownsyntax lsp_markdown") + vim.cmd("set filetype=lsp_markdown") local idx = 1 --@private local function apply_syntax_to_region(ft, start, finish) -- cgit