From b61e2ff9511db1c6bfd90f7a30eab49a6573a32c Mon Sep 17 00:00:00 2001 From: Donovan Glover Date: Wed, 26 Jul 2023 13:09:05 -0400 Subject: [PATCH] neovim: Conceal markdown links without vim-markdown This also conceals some other stuff like JSON strings, but seems to be worth it overall. --- home/neovim.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/home/neovim.nix b/home/neovim.nix index 92c1813..7179da4 100644 --- a/home/neovim.nix +++ b/home/neovim.nix @@ -103,6 +103,11 @@ in }; }; + xdg.configFile."nvim/after/syntax/markdown.vim".text = /* vim */ '' + 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 + ''; + programs.neovim = { enable = true; extraConfig = /* vim */ '' @@ -124,6 +129,7 @@ in set tabstop=4 " Show a tab character as 4 spaces set softtabstop=0 " Edit soft tabs as if they're regular spaces set shiftwidth=4 " Make autoindent appear as 4 spaces + set conceallevel=2 set foldmethod=indent set foldlevelstart=99