File tree Expand file tree Collapse file tree 1 file changed +22
-1
lines changed Expand file tree Collapse file tree 1 file changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -192,8 +192,29 @@ export default defineUserConfig({
192192 } ,
193193 } ) ,
194194 shikiPlugin ( {
195- theme : 'dark-plus' ,
195+ themes : {
196+ dark : 'dark-plus' ,
197+ onedarkpro : 'one-dark-pro' , // pre-load one-dark-pro for ansi code blocks
198+ } ,
196199 lineNumbers : 10 ,
200+ transformers : [
201+ // use one-dark-pro theme for ansi code blocks
202+ {
203+ preprocess ( code , options ) {
204+ if ( options . lang == 'ansi' ) {
205+ this . options . defaultColor = 'onedarkpro' ;
206+ // this doesn't work at the top-level for some reason
207+ this . options . colorReplacements = {
208+ // make one-dark-pro background color the same as dark-plus
209+ '#282c34' : '#1e1e1e' ,
210+ // HACK: change color of comments, since nu-highlight can't highlight them
211+ '#abb2bf' : '#80858f' ,
212+ } ;
213+ }
214+ return code ;
215+ } ,
216+ } ,
217+ ] ,
197218 langs : [
198219 'csv' ,
199220 'nushell' ,
You can’t perform that action at this time.
0 commit comments