Skip to content

Commit a2aa921

Browse files
flatcapAvidSeeker
authored andcommitted
patch 9.1.0779: filetype: neomuttlog files are not recognized
Problem: filetype: neomuttlog files are not recognized Solution: detect '*.neomuttdebug' file as neomuttlog filetype, include neomuttlog syntax script (Richard Russon) closes: #15858 Co-authored-by: AvidSeeker <avidseeker7@protonmail.com> Signed-off-by: Richard Russon <rich@flatcap.org> Signed-off-by: Christian Brabandt <cb@256bit.org>
1 parent 0f146b7 commit a2aa921

7 files changed

Lines changed: 450 additions & 336 deletions

File tree

runtime/doc/syntax.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2538,6 +2538,12 @@ set "msql_minlines" to the value you desire. Example: >
25382538
:let msql_minlines = 200
25392539
25402540
2541+
NEOMUTT *neomutt.vim* *ft-neomuttrc-syntax* *ft-neomuttlog-syntax*
2542+
2543+
To disable the default NeoMutt log colors >
2544+
2545+
:let g:neolog_disable_default_colors = 1
2546+
25412547
N1QL *n1ql.vim* *ft-n1ql-syntax*
25422548

25432549
N1QL is a SQL-like declarative language for manipulating JSON documents in

runtime/doc/tags

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7365,6 +7365,8 @@ ft-msql-syntax syntax.txt /*ft-msql-syntax*
73657365
ft-n1ql-syntax syntax.txt /*ft-n1ql-syntax*
73667366
ft-nasm-syntax syntax.txt /*ft-nasm-syntax*
73677367
ft-ncf-syntax syntax.txt /*ft-ncf-syntax*
7368+
ft-neomuttlog-syntax syntax.txt /*ft-neomuttlog-syntax*
7369+
ft-neomuttrc-syntax syntax.txt /*ft-neomuttrc-syntax*
73687370
ft-nroff-syntax syntax.txt /*ft-nroff-syntax*
73697371
ft-ocaml-syntax syntax.txt /*ft-ocaml-syntax*
73707372
ft-pandoc-syntax syntax.txt /*ft-pandoc-syntax*
@@ -8875,6 +8877,7 @@ nb-protocol_errors netbeans.txt /*nb-protocol_errors*
88758877
nb-special netbeans.txt /*nb-special*
88768878
nb-terms netbeans.txt /*nb-terms*
88778879
ncf.vim syntax.txt /*ncf.vim*
8880+
neomutt.vim syntax.txt /*neomutt.vim*
88788881
netbeans netbeans.txt /*netbeans*
88798882
netbeans-commands netbeans.txt /*netbeans-commands*
88808883
netbeans-configure netbeans.txt /*netbeans-configure*

runtime/filetype.vim

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1592,6 +1592,9 @@ au BufNewFile,BufRead Mutt{ng,}rc setf muttrc
15921592
" N1QL
15931593
au BufRead,BufNewfile *.n1ql,*.nql setf n1ql
15941594

1595+
" Neomutt log
1596+
au BufNewFile,BufRead *.neomuttdebug* setf neomuttlog
1597+
15951598
" Nano
15961599
au BufNewFile,BufRead */etc/nanorc,*.nanorc setf nanorc
15971600

runtime/syntax/neomuttlog.vim

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
" Vim syntax file
2+
" Language: NeoMutt log files
3+
" Maintainer: Richard Russon <rich@flatcap.org>
4+
" Last Change: 2024 Oct 12
5+
6+
" quit when a syntax file was already loaded
7+
if exists("b:current_syntax")
8+
finish
9+
endif
10+
11+
syntax match neolog_date "\v^\[\d\d\d\d-\d\d-\d\d \d\d:\d\d:\d\d\] *" conceal
12+
syntax match neolog_version "\v<NeoMutt-\d{8}(-\d+-\x+)*(-dirty)*>"
13+
syntax match neolog_banner "\v^\[\d\d\d\d-\d\d-\d\d \d\d:\d\d:\d\d\] .*" contains=neolog_date,neolog_version
14+
syntax match neolog_function "\v%26v\i+\(\)"
15+
16+
syntax match neolog_perror_key "\v%22v\<P\> " conceal transparent
17+
syntax match neolog_error_key "\v%22v\<E\> " conceal transparent
18+
syntax match neolog_warning_key "\v%22v\<W\> " conceal transparent
19+
syntax match neolog_message_key "\v%22v\<M\> " conceal transparent
20+
syntax match neolog_debug1_key "\v%22v\<1\> " conceal transparent
21+
syntax match neolog_debug2_key "\v%22v\<2\> " conceal transparent
22+
syntax match neolog_debug3_key "\v%22v\<3\> " conceal transparent
23+
syntax match neolog_debug4_key "\v%22v\<4\> " conceal transparent
24+
syntax match neolog_debug5_key "\v%22v\<5\> " conceal transparent
25+
syntax match neolog_notify_key "\v%22v\<N\> " conceal transparent
26+
27+
syntax match neolog_perror "\v%22v\<P\> .*" contains=neolog_perror_key,neolog_function
28+
syntax match neolog_error "\v%22v\<E\> .*" contains=neolog_error_key,neolog_function
29+
syntax match neolog_warning "\v%22v\<W\> .*" contains=neolog_warning_key,neolog_function
30+
syntax match neolog_message "\v%22v\<M\> .*" contains=neolog_message_key,neolog_function
31+
syntax match neolog_debug1 "\v%22v\<1\> .*" contains=neolog_debug1_key,neolog_function
32+
syntax match neolog_debug2 "\v%22v\<2\> .*" contains=neolog_debug2_key,neolog_function
33+
syntax match neolog_debug3 "\v%22v\<3\> .*" contains=neolog_debug3_key,neolog_function
34+
syntax match neolog_debug4 "\v%22v\<4\> .*" contains=neolog_debug4_key,neolog_function
35+
syntax match neolog_debug5 "\v%22v\<5\> .*" contains=neolog_debug5_key,neolog_function
36+
syntax match neolog_notify "\v%22v\<N\> .*" contains=neolog_notify_key,neolog_function
37+
38+
if !exists('g:neolog_disable_default_colors')
39+
highlight neolog_date ctermfg=cyan guifg=#40ffff
40+
highlight neolog_banner ctermfg=magenta guifg=#ff00ff
41+
highlight neolog_version cterm=reverse gui=reverse
42+
highlight neolog_function guibg=#282828
43+
44+
highlight neolog_perror ctermfg=red guifg=#ff8080
45+
highlight neolog_error ctermfg=red guifg=#ff8080
46+
highlight neolog_warning ctermfg=yellow guifg=#ffff80
47+
highlight neolog_message ctermfg=green guifg=#80ff80
48+
highlight neolog_debug1 ctermfg=white guifg=#ffffff
49+
highlight neolog_debug2 ctermfg=white guifg=#ffffff
50+
highlight neolog_debug3 ctermfg=grey guifg=#c0c0c0
51+
highlight neolog_debug4 ctermfg=grey guifg=#c0c0c0
52+
highlight neolog_debug5 ctermfg=grey guifg=#c0c0c0
53+
highlight neolog_notify ctermfg=grey guifg=#c0c0c0
54+
endif
55+
56+
highlight link neolog_perror_key neolog_perror
57+
highlight link neolog_error_key neolog_error
58+
highlight link neolog_warning_key neolog_warning
59+
highlight link neolog_message_key neolog_message
60+
highlight link neolog_debug1_key neolog_debug1
61+
highlight link neolog_debug2_key neolog_debug2
62+
highlight link neolog_debug3_key neolog_debug3
63+
highlight link neolog_debug4_key neolog_debug4
64+
highlight link neolog_debug5_key neolog_debug5
65+
highlight link neolog_notify_key neolog_notify
66+
67+
let b:current_syntax = "neomuttlog"
68+
69+
" vim: ts=2 et tw=100 sw=2 sts=0 ft=vim

0 commit comments

Comments
 (0)