From a7ea37b7372d4b665258e0c3c16662d23c2d9f16 Mon Sep 17 00:00:00 2001 From: Federico Ramirez Date: Wed, 6 Apr 2022 13:49:09 -0300 Subject: [PATCH 1/2] Conceal terminal color escape codes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This adds ```vimscript syntax match Normal '\[[0-9;]*m' conceal ``` To conceal all ANSI color code escape sequences, so they do not distract you from reading the logs. It also sets `conceallevel` to 3 so they are completely hidden (unless the cursor is on that line). --- syntax/log.vim | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/syntax/log.vim b/syntax/log.vim index a12f0e8..b4f8cb4 100644 --- a/syntax/log.vim +++ b/syntax/log.vim @@ -152,6 +152,10 @@ hi def link logLevelInfo Repeat hi def link logLevelDebug Debug hi def link logLevelTrace Comment +" Conceal Terminal Color Escape Codes +"--------------------------------------------------------------------------- +syntax match Normal '\[[0-9;]*m' conceal +setlocal conceallevel=3 let b:current_syntax = 'log' From dfb0c56934c6899ec0820bc2c548d7b04f2c8c6d Mon Sep 17 00:00:00 2001 From: Federico Ramirez Date: Wed, 6 Apr 2022 14:13:44 -0300 Subject: [PATCH 2/2] Conceal even when cursor is on that line In normal mode only --- syntax/log.vim | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/syntax/log.vim b/syntax/log.vim index b4f8cb4..6678245 100644 --- a/syntax/log.vim +++ b/syntax/log.vim @@ -155,7 +155,8 @@ hi def link logLevelTrace Comment " Conceal Terminal Color Escape Codes "--------------------------------------------------------------------------- syntax match Normal '\[[0-9;]*m' conceal -setlocal conceallevel=3 +setlocal conceallevel=2 +setlocal concealcursor=n let b:current_syntax = 'log'