require('ftplugin.common-space') bo.tabstop = 2 bo.shiftwidth = 2 -- bo.formatoptions = 'watqc' bo.formatoptions = 'qc' bo.textwidth = 80 o.colorcolumn = '80' if require("zk.util").notebook_root(vim.fn.expand('%:p')) ~= nil then local function map(...) vim.api.nvim_buf_set_keymap(0, ...) end local opts = { noremap=true, silent=false } map("n", "", "lua vim.lsp.buf.definition()", opts) map("n", "K", "lua vim.lsp.buf.hover()", opts) vim.api.nvim_exec([[ syn region markdownWikiLink matchgroup=markdownLinkDelimiter \ start="\[\[" end="\]\]" contains=markdownUrl keepend oneline concealends syn region markdownLink matchgroup=markdownLinkDelimiter \ start="\[" end="\]" contains=markdownUrl keepend oneline concealends syn region markdownLink matchgroup=markdownLinkDelimiter \ start="(" end=")" contains=markdownUrl keepend contained conceal syn region markdownLinkText matchgroup=markdownLinkTextDelimiter \ start="!\=\[\%(\%(\_[^][]\|\[\_[^][]*\]\)*]\%( \=[[(]\)\)\@=" \ end="\]\%( \=[[(]\)\@=" nextgroup=markdownLink,markdownId \ skipwhite contains=@markdownInline,markdownLineStart concealends " unlet b:current_syntax syntax include @Yaml syntax/yaml.vim syntax include @Toml syntax/toml.vim syntax region yamlFrontmatter start=/\%^---$/ end=/^---$/ \ keepend contains=@Yaml syntax region tomlFrontmatter start=/\%^+++$/ end=/^+++$/ \ keepend contains=@Toml ]], true) end