Skip to content

Commit d23a24e

Browse files
TimelordUKclaude
andcommitted
feat: Enhanced FIX message syntax highlighting with case-insensitive matching
Improvements to nvim plugin example config: - Case-insensitive patterns (\c) for all message types and statuses - Distinct colors for each order status (Pendingnew, New, Partial, Filled, Cancelled) - Multi-leg trade highlighting (ORDER0001.1, etc.) in bold cyan - Bloomberg Yellow Key Codes (Index, Comdty, Equity, Govt, Corp, Curncy) - Futures code pattern matching (FVZ5, ESH4, etc.) - Simplified color names with hex values in comments for reference Color scheme for order status progression: - Pendingnew: Yellow (waiting) - New: Cyan (active) - Partial: Magenta (in progress) - Filled: Bold Green (complete) - Cancelled: DarkGray (inactive) - Rejected: Bold Red (error) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 50bb5ee commit d23a24e

1 file changed

Lines changed: 67 additions & 41 deletions

File tree

nvim-plugin/examples/sql-cli.lua

Lines changed: 67 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -17,53 +17,79 @@ return
1717
-- FIX Message Syntax Highlighting
1818
syntax = {
1919
patterns = {
20-
-- Message Types
21-
{ pattern = [[\<ExecutionReport\>]], group = "FixExecReport",
22-
color = { gui = "#50fa7b", cterm = "Green", bold = true } },
23-
{ pattern = [[\<AllocationReport\>]], group = "FixAllocReport",
24-
color = { gui = "#8be9fd", cterm = "Cyan", bold = true } },
25-
{ pattern = [[\<NewOrderSingle\>]], group = "FixNewOrder",
26-
color = { gui = "#f1fa8c", cterm = "Yellow", bold = true } },
27-
{ pattern = [[\<OrderCancelReject\>]], group = "FixCancelReject",
28-
color = { gui = "#ff5555", cterm = "Red", bold = true } },
20+
-- Multi-leg trades (ORDER0001.1, ORDER0001.2, etc.)
21+
{ pattern = [[\w\+\.\d\+]], group = "FixMultiLeg",
22+
color = { gui = "Cyan", cterm = "Cyan", bold = true } },
2923

30-
-- Order Status
31-
{ pattern = [[\<PendingNew\>]], group = "FixStatPendingNew",
32-
color = { gui = "#f1fa8c", cterm = "Yellow" } },
33-
{ pattern = [[\<New\>]], group = "FixStatNew",
34-
color = { gui = "#50fa7b", cterm = "Green" } },
35-
{ pattern = [[\<PartiallyFilled\>]], group = "FixStatPartial",
36-
color = { gui = "#50fa7b", cterm = "Green" } },
37-
{ pattern = [[\<Filled\>]], group = "FixStatFilled",
38-
color = { gui = "#50fa7b", cterm = "Green", bold = true } },
39-
{ pattern = [[\<Canceled\>]], group = "FixStatCanceled",
40-
color = { gui = "#6272a4", cterm = "DarkGray" } },
41-
{ pattern = [[\<Rejected\>]], group = "FixStatRejected",
42-
color = { gui = "#ff5555", cterm = "Red", bold = true } },
24+
-- Message Types (case-insensitive to match Executionreport, etc.)
25+
{ pattern = [[\c\<ExecutionReport\>]], group = "FixExecReport",
26+
color = { gui = "Green", cterm = "Green", bold = true } }, -- #50fa7b
27+
{ pattern = [[\c\<AllocationReport\>]], group = "FixAllocReport",
28+
color = { gui = "Cyan", cterm = "Cyan", bold = true } }, -- #8be9fd
29+
{ pattern = [[\c\<NewOrderSingle\>]], group = "FixNewOrder",
30+
color = { gui = "Yellow", cterm = "Yellow", bold = true } }, -- #f1fa8c
31+
{ pattern = [[\c\<OrderCancelReject\>]], group = "FixCancelReject",
32+
color = { gui = "Red", cterm = "Red", bold = true } }, -- #ff5555
4333

44-
-- Side (Buy/Sell)
45-
{ pattern = [[\<Buy\>]], group = "FixSideBuy",
46-
color = { gui = "#50fa7b", cterm = "Green", bold = true } },
47-
{ pattern = [[\<Sell\>]], group = "FixSideSell",
48-
color = { gui = "#ff5555", cterm = "Red", bold = true } },
34+
-- Order Status (case-insensitive: Pendingnew, New, Partial, Filled, Cancelled)
35+
-- Different colors for each state to show what's going on
36+
{ pattern = [[\c\<Pendingnew\>]], group = "FixStatPendingNew",
37+
color = { gui = "Yellow", cterm = "Yellow" } }, -- #f1fa8c - Warning/waiting
38+
{ pattern = [[\c\<New\>]], group = "FixStatNew",
39+
color = { gui = "Cyan", cterm = "Cyan" } }, -- #8be9fd - Active/submitted
40+
{ pattern = [[\c\<Partial\>]], group = "FixStatPartial",
41+
color = { gui = "Magenta", cterm = "Magenta" } }, -- #bd93f9 - In progress
42+
{ pattern = [[\c\<Filled\>]], group = "FixStatFilled",
43+
color = { gui = "Green", cterm = "Green", bold = true } }, -- #50fa7b - Complete
44+
{ pattern = [[\c\<Cancelled\>]], group = "FixStatCanceled",
45+
color = { gui = "DarkGray", cterm = "DarkGray" } }, -- #6272a4 - Inactive
46+
{ pattern = [[\c\<Canceled\>]], group = "FixStatCanceled2",
47+
color = { gui = "DarkGray", cterm = "DarkGray" } }, -- US spelling variant
48+
{ pattern = [[\c\<Rejected\>]], group = "FixStatRejected",
49+
color = { gui = "Red", cterm = "Red", bold = true } }, -- #ff5555 - Error
50+
51+
-- Side (Buy/Sell) - Green/Red for quick visual
52+
{ pattern = [[\c\<Buy\>]], group = "FixSideBuy",
53+
color = { gui = "Green", cterm = "Green", bold = true } }, -- #50fa7b
54+
{ pattern = [[\c\<Sell\>]], group = "FixSideSell",
55+
color = { gui = "Red", cterm = "Red", bold = true } }, -- #ff5555
56+
57+
-- Bloomberg Yellow Key Codes
58+
{ pattern = [[\c\<Index\>]], group = "BBGIndex",
59+
color = { gui = "Yellow", cterm = "Yellow", bold = true } },
60+
{ pattern = [[\c\<Comdty\>]], group = "BBGComdty",
61+
color = { gui = "Yellow", cterm = "Yellow", bold = true } },
62+
{ pattern = [[\c\<Equity\>]], group = "BBGEquity",
63+
color = { gui = "Cyan", cterm = "Cyan" } },
64+
{ pattern = [[\c\<Govt\>]], group = "BBGGovt",
65+
color = { gui = "Green", cterm = "Green" } },
66+
{ pattern = [[\c\<Corp\>]], group = "BBGCorp",
67+
color = { gui = "Magenta", cterm = "Magenta" } },
68+
{ pattern = [[\c\<Curncy\>]], group = "BBGCurncy",
69+
color = { gui = "Cyan", cterm = "Cyan", bold = true } },
70+
71+
-- Futures codes (e.g., FVZ5, ESH4) - 2-3 letters + month code + digit
72+
-- This is conservative to avoid false positives
73+
{ pattern = [[\<[A-Z]\{2,3\}[FGHJKMNQUVXZ]\d\>]], group = "FuturesCode",
74+
color = { gui = "Yellow", cterm = "Yellow" } },
4975

5076
-- Exchanges
51-
{ pattern = [[\<NYSE\>]], group = "FixExchNYSE",
52-
color = { gui = "#bd93f9", cterm = "Magenta" } },
53-
{ pattern = [[\<NASDAQ\>]], group = "FixExchNASDAQ",
54-
color = { gui = "#ff79c6", cterm = "Magenta" } },
55-
{ pattern = [[\<LSE\>]], group = "FixExchLSE",
56-
color = { gui = "#bd93f9", cterm = "Magenta" } },
77+
{ pattern = [[\c\<NYSE\>]], group = "FixExchNYSE",
78+
color = { gui = "Magenta", cterm = "Magenta" } }, -- #bd93f9
79+
{ pattern = [[\c\<NASDAQ\>]], group = "FixExchNASDAQ",
80+
color = { gui = "Magenta", cterm = "Magenta" } }, -- #ff79c6
81+
{ pattern = [[\c\<LSE\>]], group = "FixExchLSE",
82+
color = { gui = "Magenta", cterm = "Magenta" } }, -- #bd93f9
5783

5884
-- Instrument Types
59-
{ pattern = [[\<NDS\>]], group = "FixInstNDS",
60-
color = { gui = "#00aaff", cterm = "Cyan" } },
61-
{ pattern = [[\<NFD\>]], group = "FixInstNFD",
62-
color = { gui = "#ffaa00", cterm = "Yellow" } },
63-
{ pattern = [[\<CDS\>]], group = "FixInstCDS",
64-
color = { gui = "#aa00ff", cterm = "Magenta" } },
65-
{ pattern = [[\<IRS\>]], group = "FixInstIRS",
66-
color = { gui = "#00ffaa", cterm = "Green" } },
85+
{ pattern = [[\c\<NDS\>]], group = "FixInstNDS",
86+
color = { gui = "Cyan", cterm = "Cyan" } }, -- #00aaff
87+
{ pattern = [[\c\<NFD\>]], group = "FixInstNFD",
88+
color = { gui = "Yellow", cterm = "Yellow" } }, -- #ffaa00
89+
{ pattern = [[\c\<CDS\>]], group = "FixInstCDS",
90+
color = { gui = "Magenta", cterm = "Magenta" } }, -- #aa00ff
91+
{ pattern = [[\c\<IRS\>]], group = "FixInstIRS",
92+
color = { gui = "Green", cterm = "Green" } }, -- #00ffaa
6793
}
6894
},
6995
})

0 commit comments

Comments
 (0)