From 0fc590b2935905a215e20ed6fb3a22cb95a1e37d Mon Sep 17 00:00:00 2001 From: Alex Vear Date: Sun, 24 Feb 2019 13:23:19 +0000 Subject: [PATCH] Fix issues with hyperlinks --- README.md | 2 +- syntax/org.vim | 12 +++++------- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 8ce1c7d..e136bd6 100644 --- a/README.md +++ b/README.md @@ -10,4 +10,4 @@ Org-mode files. - **TODO**: test with other colorthemes - **TODO**: fix italics -- **TODO**: fix hyperlinks +- **TODO**: fix spell checker diff --git a/syntax/org.vim b/syntax/org.vim index 715ad0a..860e81f 100644 --- a/syntax/org.vim +++ b/syntax/org.vim @@ -49,13 +49,11 @@ syntax match orgTimestamp /<\d\{4}-\d\{2}-\d\{2}.\{-}>/ keepend highlight def link orgTimestamp Operator -" FIXME Hyperlinks -" - Highlight a link without formatting -" - Fix issues with italics -syntax match orgHyperlink "\[\{2}[^][]*\(\]\[[^][]*\)\?\]\{2}" contains=orgHyperlinkBracketsLeft,orgHyperlinkURL,orgHyperlinkBracketsRight containedin=ALL -syntax match orgHyperlinkBracketsLeft contained "\[\{2}#\?" conceal -syntax match orgHyperlinkURL contained "[^][]*\]\[" conceal -syntax match orgHyperlinkBracketsRight contained "\]\{2}" conceal +" Hyperlinks +syntax match orgHyperlink /\[\{2}\([^][]\{-1,}\]\[\)\?[^][]\{-1,}\]\{2}/ containedin=ALL contains=orgHyperLeft,orgHyperRight,orgHyperURL +syntax match orgHyperLeft /\[\{2}/ contained conceal +syntax match orgHyperRight /\]\{2}/ contained conceal +syntax match orgHyperURL /[^][]\{-1,}\]\[/ contained conceal highlight def link orgHyperlink Underlined